-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Config: Full Parameter List: allow math expressions #2731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Build MissionPlanner 1.0.3104 completed (commit ca8820bc81 by @IamPete1) |
mission planner already includes in the "extlibs/utilities" project. so you could check out this as it may have better overall support for the wierd stuff |
491e250
to
4f70d42
Compare
✅ Build MissionPlanner 1.0.3106 completed (commit 775a03a6f0 by @IamPete1) |
4f70d42
to
f951f6d
Compare
@meee1 even better, I have switched to that, things like |
✅ Build MissionPlanner 1.0.3107 completed (commit b47fda56a6 by @IamPete1) |
if (float.IsNaN(newvalue) || float.IsInfinity(newvalue)) | ||
{ | ||
Params.CellValueChanged -= Params_CellValueChanged; | ||
Params[e.ColumnIndex, e.RowIndex].Value = newvalue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question? is this meant to be new value? or a restore of the old value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put the new value, ie the NaN
, so you can see your equation was wrong. Then again you could argue that it is better to leave it, the cell will go red thanks to the exception, and you can try and correct it. Maybe that would be nicer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i could go either way. changing it to NaN means you would have to reload the screen to see the old value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meee1 I have changed to not over write the value. So no you get left with what you typed in with the red background. This mean you can correct the error in the equation. This is also consistent with what happens in current version if you enter a none number.
f951f6d
to
a90cd4e
Compare
✅ Build MissionPlanner 1.0.3119 completed (commit 2e78603018 by @IamPete1) |
This allows params to be entered as basic math expressions in the full list.
1+2
,5*10
,8/9
ectBrackets work, but not constants, powers or trig.
We could do more complex expressions if we were to add a math parser sub-module, but this gets us 99% of what anyone will use, and sub-modules are above by C# skill level.