Codebase list engauge-digitizer / e77d052
Error messages added to asserts markummitchell 4 years ago
15 changed file(s) with 42 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
3838 #include "Document.h"
3939 #include "DocumentSerialize.h"
4040 #include "EngaugeAssert.h"
41 #include "Logger.h"
4142 #include "MainWindow.h"
4243 #include <QXmlStreamReader>
4344
5657 !attributes.hasAttribute(DOCUMENT_SERIALIZE_CMD_DESCRIPTION)) {
5758
5859 // Invalid xml
60 LOG4CPP_ERROR_S ((*mainCat)) << "CmdFactory::createCmd missing " << DOCUMENT_SERIALIZE_CMD_TYPE.toLatin1().data()
61 << " or " << DOCUMENT_SERIALIZE_CMD_DESCRIPTION.toLatin1().data();
5962 ENGAUGE_ASSERT(false);
6063
6164 }
217220 } else {
218221
219222 // Invalid xml
223 LOG4CPP_ERROR_S ((*mainCat)) << "CmdFactory::createCmd invalid command type " << cmdType.toLatin1().data();
220224 ENGAUGE_ASSERT (false);
221225
222226 }
1111 #include "ColorFilterStrategySaturation.h"
1212 #include "ColorFilterStrategyValue.h"
1313 #include "EngaugeAssert.h"
14 #include "Logger.h"
1415 #include "mmsubs.h"
1516 #include <QDebug>
1617 #include <qmath.h>
185186
186187 } else {
187188
189 LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilter::pixelToZeroToOneOrMinusOne is missing color filter mode";
188190 ENGAUGE_ASSERT (false);
189191 return 0.0;
190192
201203
202204 } else {
203205
206 LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilter::zeroToOneToValue is missing color filter mode";
204207 ENGAUGE_ASSERT (false);
205208 return 0;
206209
147147 const ColorFilterSettingsStrategyAbstractBase *strategy = m_strategies.value (m_colorFilterMode);
148148 return strategy->high (*this);
149149 } else {
150 LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilterSettings::high is missing color filter mode";
150151 ENGAUGE_ASSERT (false);
151152 return m_strategies [COLOR_FILTER_MODE_INTENSITY]->high (*this);
152153 }
227228 const ColorFilterSettingsStrategyAbstractBase *strategy = m_strategies.value (m_colorFilterMode);
228229 return strategy->low (*this);
229230 } else {
231 LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilterSettings::low is missing color filter mode";
230232 ENGAUGE_ASSERT (false);
231233 return m_strategies [COLOR_FILTER_MODE_INTENSITY]->low (*this);
232234 }
303305 return strategy->setHigh (*this,
304306 s0To1);
305307 } else {
308 LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilterSettings::setHigh is missing color filter mode";
306309 ENGAUGE_ASSERT (false);
307310 }
308311 }
338341 return strategy->setLow (*this,
339342 s0To1);
340343 } else {
344 LOG4CPP_ERROR_S ((*mainCat)) << "ColorFilterSettings::setLow is missing color filter mode";
341345 ENGAUGE_ASSERT (false);
342346 }
343347 }
601601 } else if (tag == DOCUMENT_SERIALIZE_GUIDELINES) {
602602 m_modelGuidelines.loadXml (reader);
603603 } else if (tag == DOCUMENT_SERIALIZE_IMAGE) {
604 LOG4CPP_ERROR_S ((*mainCat)) << "CoordSystem::loadVersion6 encountered image out of order";
604605 ENGAUGE_ASSERT (false); // The image should have been read before this method was called
605606 } else if (tag == DOCUMENT_SERIALIZE_POINT_MATCH) {
606607 m_modelPointMatch.loadXml (reader);
663664 } else if (tag == DOCUMENT_SERIALIZE_GUIDELINES) {
664665 m_modelGuidelines.loadXml (reader);
665666 } else if (tag == DOCUMENT_SERIALIZE_IMAGE) {
667 LOG4CPP_ERROR_S ((*mainCat)) << "CoordSystem::loadVersions7AndUp encountered image out of order";
666668 ENGAUGE_ASSERT (false); // The image should have been read before this method was called
667669 } else if (tag == DOCUMENT_SERIALIZE_POINT_MATCH) {
668670 m_modelPointMatch.loadXml (reader);
55
66 #include "CursorSize.h"
77 #include "EngaugeAssert.h"
8 #include "Logger.h"
89
910 int CursorSizeToPixels (CursorSize cursorSize)
1011 {
2728 break;
2829 }
2930
31 LOG4CPP_ERROR_S ((*mainCat)) << "CursorSizeToPixels encountered unexpected cursor size " << cursorSize;
3032 ENGAUGE_ASSERT (false);
3133 return 0;
3234 }
292292 }
293293 }
294294
295 LOG4CPP_ERROR_S ((*mainCat)) << "Curve::isXOnly encountered unknown indentifier "
296 << pointIdentifier.toLatin1().data();
295297 ENGAUGE_ASSERT (false);
296298
297299 return false;
443445 }
444446 }
445447
448 LOG4CPP_ERROR_S ((*mainCat)) << "Curve::pointForPointIdentifier encountered unknown indentifier "
449 << pointIdentifier.toLatin1().data();
446450 ENGAUGE_ASSERT (false);
447451 return nullptr;
448452 }
586590
587591 } else {
588592
589 LOG4CPP_ERROR_S ((*mainCat)) << "Curve::updatePointOrdinals";
593 LOG4CPP_ERROR_S ((*mainCat)) << "Curve::updatePointOrdinals encountered unexpected connection configuration";
590594 ENGAUGE_ASSERT (false);
591595
592596 }
127127 }
128128 }
129129
130 LOG4CPP_ERROR_S ((*mainCat)) << "CurvesGraphs::iterateThroughCurvePoints encountered unexpected curve "
131 << curveNameWanted.toLatin1().data();
130132 ENGAUGE_ASSERT (false);
131133 }
132134
145147 }
146148 }
147149
150 LOG4CPP_ERROR_S ((*mainCat)) << "CurvesGraphs::iterateThroughCurveSegments encountered unexpected curve "
151 << curveNameWanted.toLatin1().data();
148152 ENGAUGE_ASSERT (false);
149153 }
150154
336336 break;
337337
338338 default:
339 LOG4CPP_ERROR_S ((*mainCat)) << "DigitizeStateColorPicker::saveLowerValueUpperValue unexpected color filter mode "
340 << modelColorFilterAfter.colorFilterMode (curveName);
339341 ENGAUGE_ASSERT (false);
340342 }
341343 }
498498
499499 } else {
500500
501 LOG4CPP_ERROR_S ((*mainCat)) << "DlgSettingsColorFilter::updateHistogram unknown button pressed";
501502 ENGAUGE_ASSERT (false);
502503
503504 }
328328
329329 void DlgSettingsMainWindow::load (CmdMediator & /* cmdMediator */)
330330 {
331 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::load";
331 LOG4CPP_ERROR_S ((*mainCat)) << "DlgSettingsMainWindow::load";
332332
333333 ENGAUGE_ASSERT (false);
334334 }
55
66 #include "EngaugeAssert.h"
77 #include "GridLine.h"
8 #include "Logger.h"
89 #include <qdebug.h>
910 #include <QGraphicsItem>
1011 #include <QGraphicsScene>
1617
1718 GridLine::GridLine (const GridLine & /* other */)
1819 {
20 LOG4CPP_ERROR_S ((*mainCat)) << "GridLine::GridLine";
1921 ENGAUGE_ASSERT (false);
2022 }
2123
3335
3436 GridLine &GridLine::operator= (GridLine & /* other */)
3537 {
38 LOG4CPP_ERROR_S ((*mainCat)) << "GridLine::operator=";
3639 ENGAUGE_ASSERT (false);
3740
3841 return *this;
44 ******************************************************************************************************/
55
66 #include "EngaugeAssert.h"
7 #include "Logger.h"
78 #include "ViewProfileScale.h"
89 #include <QPainter>
910
3940 break;
4041
4142 default:
43 LOG4CPP_ERROR_S ((*mainCat)) << "ViewProfileScale::paintEvent unexpected color filter mode " << m_colorFilterMode;
4244 ENGAUGE_ASSERT (false);
4345 }
4446
2424 // Note the size is set externally by the layout engine
2525 }
2626
27 QColor ViewSegmentFilter::colorFromSetting (ColorFilterMode coloFilterMode,
27 QColor ViewSegmentFilter::colorFromSetting (ColorFilterMode colorFilterMode,
2828 int foreground,
2929 int hue,
3030 int intensity,
3333 {
3434 int r = 0, g = 0, b = 0;
3535
36 switch (coloFilterMode)
36 switch (colorFilterMode)
3737 {
3838 case COLOR_FILTER_MODE_FOREGROUND:
3939 {
112112 break;
113113
114114 default:
115 LOG4CPP_ERROR_S ((*mainCat)) << "ViewSegmentFilter::colorFromSetting unexpected color filter mode " << colorFilterMode;
115116 ENGAUGE_ASSERT (false);
116117 }
117118
304304 } else if (zoomFactorInitial == ZOOM_INITIAL_PREVIOUS) {
305305 zoomFactor = currentZoomFactor ();
306306 } else {
307 LOG4CPP_ERROR_S ((*mainCat)) << "MainWindow::applyZoomFactorAfterLoad unexpected zoom factor " << zoomFactorInitial;
307308 ENGAUGE_ASSERT (false);
308309 zoomFactor = currentZoomFactor();
309310 }
372373 }
373374 }
374375
376 LOG4CPP_ERROR_S ((*mainCat)) << "MainWindow::currentZoomFactor encountered unexpected zoom control";
375377 ENGAUGE_ASSERT (false);
376378 return ZOOM_1_TO_1;
377379 }
31503152 indexBackground = m_cmbBackground->findData (QVariant (BACKGROUND_IMAGE_FILTERED));
31513153 backgroundImage = BACKGROUND_IMAGE_FILTERED;
31523154 } else {
3155 LOG4CPP_ERROR_S ((*mainCat)) << "MainWindow::slotViewGroupBackground unexpected action";
31533156 ENGAUGE_ASSERT (false);
31543157
31553158 // Defaults if assert is disabled so execution continues
40514054 m_scene->showCurves (false);
40524055
40534056 } else {
4057 LOG4CPP_ERROR_S ((*mainCat)) << "MainWindow::updateViewedCurves unexpected control";
40544058 ENGAUGE_ASSERT (false);
40554059 }
40564060 }
55
66 #include "EngaugeAssert.h"
77 #include "EnumsToQt.h"
8 #include "Logger.h"
89 #include <QHash>
910 #include <QString>
1011
3334
3435 } else {
3536
37 LOG4CPP_ERROR_S ((*mainCat)) << "ColorPaletteToQColor unexpected color " << color;
3638 ENGAUGE_ASSERT (false);
3739 return colorPaletteLookupTable [COLOR_PALETTE_BLACK];
3840