Greetings,
I have some custom AWE blocks for which I would like to use the inspector to view int state variables as full ints (i.e. I don't want them displayed as a truncated float notation).
Is it possible to use the const type (or any type, for that matter) and display (up to) the full 10 digit value stored in my int?
Thanks for your help.
Steve.
9:44am
Hi Steve,
To get the full int displayed, use the following line in the inspector instantiation section of your .m file:
M.<VariableName>.guiInfo.format=’%d’;
This should give you full resolution on your int.
-Axel
10:07am
Hi Axel,
That was the first thing I tried:
add_variable(M, 'R0', 'int', 0, 'state', 'Index 0 result value');
...
M.R0.guiInfo.format='%d'
add_control(M, '.R0');
There was no change in the output and the xml still shows format='%g'.
I've tried many other things as well. Changing the ordering has no effect. Explicitly setting the range to the full int32_t range (i.e. range=[0 2147483647] has the interesting result that instead of a const window, a bar graph is displayed AND it no longer displays the correct value.
Do you have some other ideas?
Thanks,
Steve.
10:10am
p.s. the other current irritant is that the const window is too small to fully display the '%g' format and, as a result you can not see a minus sign, if present, and the exponents is mostly truncated. So even if I keep the '%g' it's unusable unless I can increase the display area. I've tried change .guiInfo.size but this too, seems to have no effect on this variable.
3:06pm
Hey Steve,
There is a known bug with the 'guiInfo.size' file not correctly updating the size of inspectors. This is fixed and will be included in the next release of Designer.
I could create an inspector to your specs with the code below:
add_variable(M, 'value', 'int', 0, 'parameter', 'Data');
...
M.value.guiInfo.controlType = 'const';
add_control(M, '.value');
Let me know if this doesn't work for you,
-Axel
4:46pm
(duplicate? I thought I responded but I don't see it...)
Axel, Your suggestion does give the desired format below the blocks on the diagram. I'm assuming there isn't a currently known way to get them in the pop-up control panel (which is what I was shooting for). Your fix is a usable work-around for my needs but if there is a way to get the ints to display in the control panel, please let me know. Otherwise consider this issue closed and thanks for your help.
Steve.