Split Firmware Version In ObjectModel
-
Please add a way to get the Major, Minor, and Point info on a boards firmware version in the object model. I am in the process of updating my Surfacing Macro ( https://forum.duet3d.com/topic/26762/surfacing-macro ) to take advantage of 3.5.0's new M291 options for user input. I want to be able to check the firmware version to make sure the Macro will work properly and if not provide feedback to the user. The issue is that:
echo {boards[0].firmwareVersion} ; currently returns "3.4.5"
returns the version number as a string like "3.4.5" (I have not update to the beta yet). Without basic string functions there is no way to split that apart and check if the version is equal to or greater than "3.5.0". If however there was:
echo {boards[0].firmwareVersion} ; returns "3.4.5" echo {boards[0].firmwareVersion.major} ; returns "3" echo {boards[0].firmwareVersion.minor} ; returns "4" echo {boards[0].firmwareVersion.point} ; returns "5"
I could then do something like:
if boards[0].firmwareVersion.major == 3 && boards[0].firmwareVersion.minor >= 5 ; Do all the things ... else M291 P"Sorry but your firmware version is not compatible with this Macro" R"Error" S2