File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -140,13 +140,20 @@ std::vector<vec2d> CDlgFormula::GetPoints()
140140 std::vector<vec2d> pts;
141141 MSimpleExpression m;
142142 MVariable* tvar = m.AddVariable (" t" );
143- m.Create (smath);
144- for ( int i = 0 ; i<samples; ++i )
143+ bool b = m.Create (smath);
144+ if (b == false )
145145 {
146- double x = fmin + i*(fmax - fmin) / (samples - 1 );
147- tvar->value (x);
148- double y = m.value ();
149- pts.push_back (vec2d (x, y));
146+ QMessageBox::critical (this , " Equation editor" , " Error in expression." );
147+ }
148+ else
149+ {
150+ for (int i = 0 ; i < samples; ++i)
151+ {
152+ double x = fmin + i * (fmax - fmin) / (samples - 1 );
153+ tvar->value (x);
154+ double y = m.value ();
155+ pts.push_back (vec2d (x, y));
156+ }
150157 }
151158
152159 return pts;
You can’t perform that action at this time.
0 commit comments