Skip to content

Commit f0d967f

Browse files
committed
Overlay info lines print active nets, trans in bold
1 parent 55eff80 commit f0d967f

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

src/WidgetImageView.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,17 +530,33 @@ void WidgetImageView::mouseMoveEvent(QMouseEvent *event)
530530
{
531531
m_ov->setCoords(QString("%1,%2").arg(imageCoords.x()).arg(imageCoords.y()));
532532

533+
// Get a list of nets, net names and a possible transistor at the mouse location
533534
const QVector<net_t> nets = ::controller.getChip().getNetsAt<true>(imageCoords.x(), imageCoords.y());
534535
QStringList netNames = ::controller.getNetlist().get(nets); // Translate net numbers to names
535536
const tran_t trans = ::controller.getChip().getTransistorAt(imageCoords.x(), imageCoords.y());
537+
538+
// Make all active net names bold
539+
for (uint i = 0; i < netNames.count(); i++)
540+
{
541+
if (::controller.getSimZ80().getNetState(nets[i]) == 1)
542+
netNames[i] = QString("<b>%1</b>").arg(netNames[i]);
543+
}
544+
QString transInfo;
545+
// Insert the transistor name at the front and make the name bold if the transistor is ON
536546
if (trans)
537-
netNames.insert(0, QString("t%1").arg(trans)); // Insert the transistor name at the front
538-
netNames.removeAll(QString()); // Remove any blanks (likely due to an infrequent transistor area)
539-
netNames.removeDuplicates(); // Don't you simply love Qt?
547+
{
548+
transInfo = ::controller.getNetlist().transInfo(trans);
549+
if (::controller.getNetlist().isTransOn(trans))
550+
netNames.insert(0, QString("<b>t%1</b>").arg(trans));
551+
else
552+
netNames.insert(0, QString("t%1").arg(trans));
553+
}
554+
netNames.removeAll(QString()); // Remove any blanks
555+
netNames.removeDuplicates();
540556
m_ov->setInfoLine(1, netNames.join(", "));
541557

542558
QString tip = nets.count() ? ::controller.getTip().get(nets[0]) : QString();
543-
m_ov->setInfoLine(2, trans ? ::controller.getNetlist().transInfo(trans) : tip);
559+
m_ov->setInfoLine(2, trans ? transInfo : tip);
544560

545561
m_ov->setInfoLine(3, ::controller.getChip().getFeaturesAt(imageCoords.x(), imageCoords.y()));
546562
}

0 commit comments

Comments
 (0)