Error messages added to asserts
markummitchell
4 years ago
38 | 38 |
#include "Document.h"
|
39 | 39 |
#include "DocumentSerialize.h"
|
40 | 40 |
#include "EngaugeAssert.h"
|
|
41 |
#include "Logger.h"
|
41 | 42 |
#include "MainWindow.h"
|
42 | 43 |
#include <QXmlStreamReader>
|
43 | 44 |
|
|
56 | 57 |
!attributes.hasAttribute(DOCUMENT_SERIALIZE_CMD_DESCRIPTION)) {
|
57 | 58 |
|
58 | 59 |
// Invalid xml
|
|
60 |
LOG4CPP_ERROR_S ((*mainCat)) << "CmdFactory::createCmd missing " << DOCUMENT_SERIALIZE_CMD_TYPE.toLatin1().data()
|
|
61 |
<< " or " << DOCUMENT_SERIALIZE_CMD_DESCRIPTION.toLatin1().data();
|
59 | 62 |
ENGAUGE_ASSERT(false);
|
60 | 63 |
|
61 | 64 |
}
|
|
217 | 220 |
} else {
|
218 | 221 |
|
219 | 222 |
// Invalid xml
|
|
223 |
LOG4CPP_ERROR_S ((*mainCat)) << "CmdFactory::createCmd invalid command type " << cmdType.toLatin1().data();
|
220 | 224 |
ENGAUGE_ASSERT (false);
|
221 | 225 |
|
222 | 226 |
}
|
11 | 11 |
#include "ColorFilterStrategySaturation.h"
|
12 | 12 |
#include "ColorFilterStrategyValue.h"
|
13 | 13 |
#include "EngaugeAssert.h"
|
|
14 |
#include "Logger.h"
|
14 | 15 |
#include "mmsubs.h"
|
15 | 16 |
#include <QDebug>
|
16 | 17 |
#include <qmath.h>
|
|
185 | 186 |
|
186 | 187 |
} else {
|
187 | 188 |
|
|
189 |
LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilter::pixelToZeroToOneOrMinusOne is missing color filter mode";
|
188 | 190 |
ENGAUGE_ASSERT (false);
|
189 | 191 |
return 0.0;
|
190 | 192 |
|
|
201 | 203 |
|
202 | 204 |
} else {
|
203 | 205 |
|
|
206 |
LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilter::zeroToOneToValue is missing color filter mode";
|
204 | 207 |
ENGAUGE_ASSERT (false);
|
205 | 208 |
return 0;
|
206 | 209 |
|
147 | 147 |
const ColorFilterSettingsStrategyAbstractBase *strategy = m_strategies.value (m_colorFilterMode);
|
148 | 148 |
return strategy->high (*this);
|
149 | 149 |
} else {
|
|
150 |
LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilterSettings::high is missing color filter mode";
|
150 | 151 |
ENGAUGE_ASSERT (false);
|
151 | 152 |
return m_strategies [COLOR_FILTER_MODE_INTENSITY]->high (*this);
|
152 | 153 |
}
|
|
227 | 228 |
const ColorFilterSettingsStrategyAbstractBase *strategy = m_strategies.value (m_colorFilterMode);
|
228 | 229 |
return strategy->low (*this);
|
229 | 230 |
} else {
|
|
231 |
LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilterSettings::low is missing color filter mode";
|
230 | 232 |
ENGAUGE_ASSERT (false);
|
231 | 233 |
return m_strategies [COLOR_FILTER_MODE_INTENSITY]->low (*this);
|
232 | 234 |
}
|
|
303 | 305 |
return strategy->setHigh (*this,
|
304 | 306 |
s0To1);
|
305 | 307 |
} else {
|
|
308 |
LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilterSettings::setHigh is missing color filter mode";
|
306 | 309 |
ENGAUGE_ASSERT (false);
|
307 | 310 |
}
|
308 | 311 |
}
|
|
338 | 341 |
return strategy->setLow (*this,
|
339 | 342 |
s0To1);
|
340 | 343 |
} else {
|
|
344 |
LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilterSettings::setLow is missing color filter mode";
|
341 | 345 |
ENGAUGE_ASSERT (false);
|
342 | 346 |
}
|
343 | 347 |
}
|
601 | 601 |
} else if (tag == DOCUMENT_SERIALIZE_GUIDELINES) {
|
602 | 602 |
m_modelGuidelines.loadXml (reader);
|
603 | 603 |
} else if (tag == DOCUMENT_SERIALIZE_IMAGE) {
|
|
604 |
LOG4CPP_ERROR_S ((*mainCat)) << "CoordSystem::loadVersion6 encountered image out of order";
|
604 | 605 |
ENGAUGE_ASSERT (false); // The image should have been read before this method was called
|
605 | 606 |
} else if (tag == DOCUMENT_SERIALIZE_POINT_MATCH) {
|
606 | 607 |
m_modelPointMatch.loadXml (reader);
|
|
663 | 664 |
} else if (tag == DOCUMENT_SERIALIZE_GUIDELINES) {
|
664 | 665 |
m_modelGuidelines.loadXml (reader);
|
665 | 666 |
} else if (tag == DOCUMENT_SERIALIZE_IMAGE) {
|
|
667 |
LOG4CPP_ERROR_S ((*mainCat)) << "CoordSystem::loadVersions7AndUp encountered image out of order";
|
666 | 668 |
ENGAUGE_ASSERT (false); // The image should have been read before this method was called
|
667 | 669 |
} else if (tag == DOCUMENT_SERIALIZE_POINT_MATCH) {
|
668 | 670 |
m_modelPointMatch.loadXml (reader);
|
5 | 5 |
|
6 | 6 |
#include "CursorSize.h"
|
7 | 7 |
#include "EngaugeAssert.h"
|
|
8 |
#include "Logger.h"
|
8 | 9 |
|
9 | 10 |
int CursorSizeToPixels (CursorSize cursorSize)
|
10 | 11 |
{
|
|
27 | 28 |
break;
|
28 | 29 |
}
|
29 | 30 |
|
|
31 |
LOG4CPP_ERROR_S ((*mainCat)) << "CursorSizeToPixels encountered unexpected cursor size " << cursorSize;
|
30 | 32 |
ENGAUGE_ASSERT (false);
|
31 | 33 |
return 0;
|
32 | 34 |
}
|
292 | 292 |
}
|
293 | 293 |
}
|
294 | 294 |
|
|
295 |
LOG4CPP_ERROR_S ((*mainCat)) << "Curve::isXOnly encountered unknown indentifier "
|
|
296 |
<< pointIdentifier.toLatin1().data();
|
295 | 297 |
ENGAUGE_ASSERT (false);
|
296 | 298 |
|
297 | 299 |
return false;
|
|
443 | 445 |
}
|
444 | 446 |
}
|
445 | 447 |
|
|
448 |
LOG4CPP_ERROR_S ((*mainCat)) << "Curve::pointForPointIdentifier encountered unknown indentifier "
|
|
449 |
<< pointIdentifier.toLatin1().data();
|
446 | 450 |
ENGAUGE_ASSERT (false);
|
447 | 451 |
return nullptr;
|
448 | 452 |
}
|
|
586 | 590 |
|
587 | 591 |
} else {
|
588 | 592 |
|
589 | |
LOG4CPP_ERROR_S ((*mainCat)) << "Curve::updatePointOrdinals";
|
|
593 |
LOG4CPP_ERROR_S ((*mainCat)) << "Curve::updatePointOrdinals encountered unexpected connection configuration";
|
590 | 594 |
ENGAUGE_ASSERT (false);
|
591 | 595 |
|
592 | 596 |
}
|
127 | 127 |
}
|
128 | 128 |
}
|
129 | 129 |
|
|
130 |
LOG4CPP_ERROR_S ((*mainCat)) << "CurvesGraphs::iterateThroughCurvePoints encountered unexpected curve "
|
|
131 |
<< curveNameWanted.toLatin1().data();
|
130 | 132 |
ENGAUGE_ASSERT (false);
|
131 | 133 |
}
|
132 | 134 |
|
|
145 | 147 |
}
|
146 | 148 |
}
|
147 | 149 |
|
|
150 |
LOG4CPP_ERROR_S ((*mainCat)) << "CurvesGraphs::iterateThroughCurveSegments encountered unexpected curve "
|
|
151 |
<< curveNameWanted.toLatin1().data();
|
148 | 152 |
ENGAUGE_ASSERT (false);
|
149 | 153 |
}
|
150 | 154 |
|
336 | 336 |
break;
|
337 | 337 |
|
338 | 338 |
default:
|
|
339 |
LOG4CPP_ERROR_S ((*mainCat)) << "DigitizeStateColorPicker::saveLowerValueUpperValue unexpected color filter mode "
|
|
340 |
<< modelColorFilterAfter.colorFilterMode (curveName);
|
339 | 341 |
ENGAUGE_ASSERT (false);
|
340 | 342 |
}
|
341 | 343 |
}
|
328 | 328 |
|
329 | 329 |
void DlgSettingsMainWindow::load (CmdMediator & /* cmdMediator */)
|
330 | 330 |
{
|
331 | |
LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::load";
|
|
331 |
LOG4CPP_ERROR_S ((*mainCat)) << "DlgSettingsMainWindow::load";
|
332 | 332 |
|
333 | 333 |
ENGAUGE_ASSERT (false);
|
334 | 334 |
}
|
5 | 5 |
|
6 | 6 |
#include "EngaugeAssert.h"
|
7 | 7 |
#include "GridLine.h"
|
|
8 |
#include "Logger.h"
|
8 | 9 |
#include <qdebug.h>
|
9 | 10 |
#include <QGraphicsItem>
|
10 | 11 |
#include <QGraphicsScene>
|
|
16 | 17 |
|
17 | 18 |
GridLine::GridLine (const GridLine & /* other */)
|
18 | 19 |
{
|
|
20 |
LOG4CPP_ERROR_S ((*mainCat)) << "GridLine::GridLine";
|
19 | 21 |
ENGAUGE_ASSERT (false);
|
20 | 22 |
}
|
21 | 23 |
|
|
33 | 35 |
|
34 | 36 |
GridLine &GridLine::operator= (GridLine & /* other */)
|
35 | 37 |
{
|
|
38 |
LOG4CPP_ERROR_S ((*mainCat)) << "GridLine::operator=";
|
36 | 39 |
ENGAUGE_ASSERT (false);
|
37 | 40 |
|
38 | 41 |
return *this;
|
4 | 4 |
******************************************************************************************************/
|
5 | 5 |
|
6 | 6 |
#include "EngaugeAssert.h"
|
|
7 |
#include "Logger.h"
|
7 | 8 |
#include "ViewProfileScale.h"
|
8 | 9 |
#include <QPainter>
|
9 | 10 |
|
|
39 | 40 |
break;
|
40 | 41 |
|
41 | 42 |
default:
|
|
43 |
LOG4CPP_ERROR_S ((*mainCat)) << "ViewProfileScale::paintEvent unexpected color filter mode " << m_colorFilterMode;
|
42 | 44 |
ENGAUGE_ASSERT (false);
|
43 | 45 |
}
|
44 | 46 |
|
24 | 24 |
// Note the size is set externally by the layout engine
|
25 | 25 |
}
|
26 | 26 |
|
27 | |
QColor ViewSegmentFilter::colorFromSetting (ColorFilterMode coloFilterMode,
|
|
27 |
QColor ViewSegmentFilter::colorFromSetting (ColorFilterMode colorFilterMode,
|
28 | 28 |
int foreground,
|
29 | 29 |
int hue,
|
30 | 30 |
int intensity,
|
|
33 | 33 |
{
|
34 | 34 |
int r = 0, g = 0, b = 0;
|
35 | 35 |
|
36 | |
switch (coloFilterMode)
|
|
36 |
switch (colorFilterMode)
|
37 | 37 |
{
|
38 | 38 |
case COLOR_FILTER_MODE_FOREGROUND:
|
39 | 39 |
{
|
|
112 | 112 |
break;
|
113 | 113 |
|
114 | 114 |
default:
|
|
115 |
LOG4CPP_ERROR_S ((*mainCat)) << "ViewSegmentFilter::colorFromSetting unexpected color filter mode " << colorFilterMode;
|
115 | 116 |
ENGAUGE_ASSERT (false);
|
116 | 117 |
}
|
117 | 118 |
|
304 | 304 |
} else if (zoomFactorInitial == ZOOM_INITIAL_PREVIOUS) {
|
305 | 305 |
zoomFactor = currentZoomFactor ();
|
306 | 306 |
} else {
|
|
307 |
LOG4CPP_ERROR_S ((*mainCat)) << "MainWindow::applyZoomFactorAfterLoad unexpected zoom factor " << zoomFactorInitial;
|
307 | 308 |
ENGAUGE_ASSERT (false);
|
308 | 309 |
zoomFactor = currentZoomFactor();
|
309 | 310 |
}
|
|
372 | 373 |
}
|
373 | 374 |
}
|
374 | 375 |
|
|
376 |
LOG4CPP_ERROR_S ((*mainCat)) << "MainWindow::currentZoomFactor encountered unexpected zoom control";
|
375 | 377 |
ENGAUGE_ASSERT (false);
|
376 | 378 |
return ZOOM_1_TO_1;
|
377 | 379 |
}
|
|
3150 | 3152 |
indexBackground = m_cmbBackground->findData (QVariant (BACKGROUND_IMAGE_FILTERED));
|
3151 | 3153 |
backgroundImage = BACKGROUND_IMAGE_FILTERED;
|
3152 | 3154 |
} else {
|
|
3155 |
LOG4CPP_ERROR_S ((*mainCat)) << "MainWindow::slotViewGroupBackground unexpected action";
|
3153 | 3156 |
ENGAUGE_ASSERT (false);
|
3154 | 3157 |
|
3155 | 3158 |
// Defaults if assert is disabled so execution continues
|
|
4051 | 4054 |
m_scene->showCurves (false);
|
4052 | 4055 |
|
4053 | 4056 |
} else {
|
|
4057 |
LOG4CPP_ERROR_S ((*mainCat)) << "MainWindow::updateViewedCurves unexpected control";
|
4054 | 4058 |
ENGAUGE_ASSERT (false);
|
4055 | 4059 |
}
|
4056 | 4060 |
}
|
5 | 5 |
|
6 | 6 |
#include "EngaugeAssert.h"
|
7 | 7 |
#include "EnumsToQt.h"
|
|
8 |
#include "Logger.h"
|
8 | 9 |
#include <QHash>
|
9 | 10 |
#include <QString>
|
10 | 11 |
|
|
33 | 34 |
|
34 | 35 |
} else {
|
35 | 36 |
|
|
37 |
LOG4CPP_ERROR_S ((*mainCat)) << "ColorPaletteToQColor unexpected color " << color;
|
36 | 38 |
ENGAUGE_ASSERT (false);
|
37 | 39 |
return colorPaletteLookupTable [COLOR_PALETTE_BLACK];
|
38 | 40 |
|