30 #define DIMMED_SYMBOL 0.25
32 AlarmsMonitorWidget::AlarmsMonitorWidget()
42 error_sym =
new QGraphicsSvgItem();
43 error_sym->setSharedRenderer(renderer);
44 error_sym->setElementId(
"error_sym");
45 error_sym->setParentItem(graph);
46 error_txt =
new QGraphicsTextItem();
47 error_txt->setDefaultTextColor(Qt::white);
48 error_txt->setFont(QFont(
"Helvetica", 24, 2));
49 error_txt->setParentItem(graph);
50 error_txt->setPlainText(
"0");
52 QRectF orig = renderer->boundsOnElement(
"error_sym");
53 QMatrix Matrix = renderer->matrixForElement(
"error_sym");
54 orig = Matrix.mapRect(orig);
56 trans.translate(orig.x(), orig.y());
57 error_sym->setTransform(trans,
false);
60 trans.translate(orig.x() + orig.width() + 1, refY);
61 error_txt->setTransform(trans,
false);
64 info_sym =
new QGraphicsSvgItem();
65 info_sym->setSharedRenderer(renderer);
66 info_sym->setElementId(
"info_sym");
67 info_sym->setParentItem(graph);
68 info_txt =
new QGraphicsTextItem();
69 info_txt->setDefaultTextColor(Qt::white);
70 info_txt->setFont(QFont(
"Helvetica", 24, 2));
71 info_txt->setParentItem(graph);
72 info_txt->setPlainText(
"0");
73 orig = renderer->boundsOnElement(
"info_sym");
74 Matrix = renderer->matrixForElement(
"info_sym");
75 orig = Matrix.mapRect(orig);
76 trans.translate(orig.x(), orig.y());
77 info_sym->setTransform(trans,
false);
79 trans.translate(orig.x() + 3 + orig.width(), refY);
80 info_txt->setTransform(trans,
false);
83 warning_sym =
new QGraphicsSvgItem();
84 warning_sym->setSharedRenderer(renderer);
85 warning_sym->setElementId(
"warning_sym");
86 warning_sym->setParentItem(graph);
87 warning_txt =
new QGraphicsTextItem();
88 warning_txt->setDefaultTextColor(Qt::white);
89 warning_txt->setFont(QFont(
"Helvetica", 24, 2));
90 warning_txt->setParentItem(graph);
91 warning_txt->setPlainText(
"0");
92 orig = renderer->boundsOnElement(
"warning_sym");
93 Matrix = renderer->matrixForElement(
"warning_sym");
94 orig = Matrix.mapRect(orig);
95 trans.translate(orig.x(), orig.y());
96 warning_sym->setTransform(trans,
false);
98 trans.translate(orig.x() + orig.width() - 23, refY);
99 warning_txt->setTransform(trans,
false);
101 error_sym->setOpacity(DIMMED_SYMBOL);
102 warning_sym->setOpacity(DIMMED_SYMBOL);
103 info_sym->setOpacity(DIMMED_SYMBOL);
104 error_txt->setOpacity(DIMMED_SYMBOL);
105 warning_txt->setOpacity(DIMMED_SYMBOL);
106 info_txt->setOpacity(DIMMED_SYMBOL);
108 connect(&alertTimer, SIGNAL(timeout()),
this, SLOT(processAlerts()));
110 SLOT(updateMessages()));
112 SLOT(updateMessages()));
114 this, SLOT(updateNeeded()));
116 alertTimer.start(1000);
122 error.append(
"<html><head/><body>");
126 temp = QString(
"<p><span style=' font-size:11pt; font-weight:600;'>%0</span></p>")
129 temp = QString(
"<p><span style=' font-style:italic;'>%0</span></p>")
133 error.append(
"</body></html>");
135 warning.append(
"<html><head/><body>");
139 temp = QString(
"<p><span style=' font-size:11pt; font-weight:600;'>%0</span></p>")
141 warning.append(temp);
142 temp = QString(
"<p><span style=' font-style:italic;'>%0</span></p>")
144 warning.append(temp);
146 warning.append(
"</body></html>");
148 info.append(
"<html><head/><body>");
152 temp = QString(
"<p><span style=' font-size:11pt; font-weight:600;'>%0</span></p>")
155 temp = QString(
"<p><span style=' font-style:italic;'>%0</span></p>")
159 info.append(
"</body></html>");
160 error_txt->setPlainText(
163 error_txt->setOpacity(1);
167 error_txt->setOpacity(DIMMED_SYMBOL);
170 warning_txt->setPlainText(
173 warning_txt->setOpacity(1);
176 warning =
"No warnings";
177 warning_txt->setOpacity(DIMMED_SYMBOL);
180 info_txt->setPlainText(
183 info_txt->setOpacity(1);
187 info_txt->setOpacity(DIMMED_SYMBOL);
190 error_sym->setToolTip(error);
191 warning_sym->setToolTip(warning);
192 info_sym->setToolTip(info);
206 static bool flag =
true;
210 error_sym->setOpacity(1);
212 error_sym->setOpacity(DIMMED_SYMBOL);
214 error_sym->setOpacity(DIMMED_SYMBOL);
217 warning_sym->setOpacity(1);
219 warning_sym->setOpacity(DIMMED_SYMBOL);
221 warning_sym->setOpacity(DIMMED_SYMBOL);
224 info_sym->setOpacity(1);
226 info_sym->setOpacity(DIMMED_SYMBOL);
228 info_sym->setOpacity(DIMMED_SYMBOL);
static ICore * instance()
void init(QSvgRenderer *renderer, QGraphicsSvgItem *graph)
else error('Your technical computing program does not support file choosers.Please input the file name in the argument. ') end elseif nargin >0 logfile