Setting individual array element variables (V3.5.0b1)
-
@OwenD were you using he latest commit of RRFLibraries from the 3.5-dev branch when you built RRF for Duet 2?
-
@dc42 said in Setting individual array element variables (V3.5.0b1):
@OwenD were you using he latest commit of RRFLibraries from the 3.5-dev branch when you built RRF for Duet 2?
Yes I believe so, downloaded a few hours ago.
Previously I was using 3.4-dev RRFLibraries, but had to change to 3.5-dev to get it to compile this time.
I use this batch file (entering 3.5-dev)@echo off set /p Version="Enter full version e.g. 3.4-dev : " cd C:\Eclipse\ del /f /s /q "C:\Eclipse\Firmware\*.*" rmdir /s /q "C:\Eclipse\Firmware" mkdir "C:\Eclipse\Firmware" cd "C:\Eclipse\Firmware" git clone https://github.com/Duet3D/ReprapFirmware.git -b %Version% git clone https://github.com/Duet3D/CANlib.git -b %Version% git clone https://github.com/Duet3D/CoreN2G -b %Version% git clone https://github.com/Duet3D/FreeRTOS -b 3.4-dev git clone https://github.com/Duet3D/RRFLibraries -b %Version% git clone https://github.com/Duet3D/DuetWiFiSocketServer -b dev echo ... echo **** press enter to exit **** pause >nul exit
-
@OwenD I found an issue when the Z probe has temperature coefficients specified in the G31 command, that could explain your reset. It should be fixed by the latest commit. Thanks for reporting this.
-
@dc42
Setting elements works for me too with your build, many thanks!
Now, before I convert all my code to use this style, is there something obviously bad/wrong with me defining my data like this? I know it's quite verbose, but this way it's easier to "see" the contents since these image data...;Digits global displayDigit = vector(10, null) ;0 set global.displayDigit[0] = vector(8, null) set global.displayDigit[0][0] = {0,1,1,1,1,1,1,0} set global.displayDigit[0][1] = {1,1,1,1,1,1,1,1} set global.displayDigit[0][2] = {1,1,1,0,0,1,1,1} set global.displayDigit[0][3] = {1,1,1,0,0,1,1,1} set global.displayDigit[0][4] = {1,1,1,0,0,1,1,1} set global.displayDigit[0][5] = {1,1,1,0,0,1,1,1} set global.displayDigit[0][6] = {1,1,1,1,1,1,1,1} set global.displayDigit[0][7] = {0,1,1,1,1,1,1,0} ;1 set global.displayDigit[1] = vector(8, null) set global.displayDigit[1][0] = {0,0,1,1,1,0,0,0} set global.displayDigit[1][1] = {0,0,1,1,1,1,0,0} set global.displayDigit[1][2] = {0,0,1,1,1,1,1,0} set global.displayDigit[1][3] = {0,0,1,1,1,0,0,0} set global.displayDigit[1][4] = {0,0,1,1,1,0,0,0} set global.displayDigit[1][5] = {0,0,1,1,1,0,0,0} set global.displayDigit[1][6] = {0,0,1,1,1,0,0,0} set global.displayDigit[1][7] = {0,0,1,1,1,0,0,0} ;2 set global.displayDigit[2] = vector(8, null) set global.displayDigit[2][0] = {0,1,1,1,1,1,1,0} set global.displayDigit[2][1] = {1,1,1,1,1,1,1,1} set global.displayDigit[2][2] = {1,1,1,0,0,1,1,1} set global.displayDigit[2][3] = {0,1,1,1,0,0,0,0} set global.displayDigit[2][4] = {0,0,0,1,1,1,0,0} set global.displayDigit[2][5] = {0,0,0,0,0,1,1,1} set global.displayDigit[2][6] = {1,1,1,1,1,1,1,1} set global.displayDigit[2][7] = {1,1,1,1,1,1,1,1} ;3 set global.displayDigit[3] = vector(8, null) set global.displayDigit[3][0] = {0,1,1,1,1,1,1,1} set global.displayDigit[3][1] = {1,1,1,1,1,1,1,1} set global.displayDigit[3][2] = {1,1,1,0,0,0,0,0} set global.displayDigit[3][3] = {0,1,1,1,1,1,1,1} set global.displayDigit[3][4] = {0,1,1,1,1,1,1,1} set global.displayDigit[3][5] = {1,1,1,0,0,0,0,0} set global.displayDigit[3][6] = {1,1,1,1,1,1,1,1} set global.displayDigit[3][7] = {0,1,1,1,1,1,1,1}
If there's no technical problem you can think of, I'd continue to use this style for my "image" data.
-
@Diamondback you could start with this:
global displayDigit = vector(10, vector(8,null))
I don't see any other way to improve it unless the individual vectors are sufficiently related so that you can calculate them algorithmically.
-
@dc42 Oh right, good point, thanks Yea the data is unfortunately all "art", so I don't see how I could automate that.
-
@dc42 said in Setting individual array element variables (V3.5.0b1):
@OwenD I found an issue when the Z probe has temperature coefficients specified in the G31 command, that could explain your reset. It should be fixed by the latest commit. Thanks for reporting this.
@dc42
FYI
I just compiled the latest commit again and the resets appear to have stopped. -
@Diamondback If your "art" becomes too big, you could still offload it to an SBC plugin in the next v3.5-b2. If a third-party SBC plugin exposes plugin data and you reference it in expressions (e.g. via
plugins.myArtPlugin.data.foo
), that data is replaced in expressions before it is evaluated by RRF.