- Messages
- 1,407
- Country
-
Hello lads
I am working with springed buttons and I need to learn more about <minvalue> </minvalue> and <maxvalue> </maxvalue> statements.
For example, this part code is working as I am expecting: The part named bell429_CAL_TOGGLE_cc_sw is the button itself; while bell429_CAL_AUTO_annun_on and bell429_CAL_MAN_annun_on are just detached polygons from the button and both were slightly moved upward. Their function is "turn on" or "turn off" depending on the value assigned by a left mouse click. Both polygons are linked to bell429_CAL_TOGGLE_cc_sw, so they can travel together within the animation (which is ok and it is doing what I need). The button has three states:
- no click: both annunciators off.
- 1st click: CAL AUTO annunciator is on and CAL MAN annunciator is off.
- 2nd click: CAL AUTO annunciator is off and CAL MAN annunciator is on.
- 3rd click: the cycle will begin again.
I used an exact replica of this code in other button and now, both annunciators are turning on at the same time; I don't understand why. Can you spot the difference?
As a side note, in all annunciators I've been using in the Bell 429, I used <minvalue>1</minvalue> without any trouble...until now. I don't know if this is related or not; and most important: how? If I understood well, the 'and' expressions will return a value of '1' if they are true and '0' otherwise. So, the <minvalue>1</minvalue> expressions are saying that the polygons will only visible when the 'and' expressions are true, Am I right?
Also, related to this, the only explanation about <minvalue> </minvalue> statment I was able to find, was made by Tom Gibson and I will show my personal note about it:
For a 3d part, "visible_in_range" statement explanation by Tom Gibson.
General syntax:
Where ### is the part name; note that it is just "inside" that statement /endstatement pair (<visible_in_range> </visible_in_range>). A, B are constants.
"In range" is set by the minvalue statement.
True is 1 or greater, false is less than that.
If the value is less than 1, then the visible_in_range statement is outside the range (i.e. false) and the part becomes invisible.
///////////////////////////////////////////////////////////////
/// This is opposed to the more usual boolean ///
/// determination - 0 is false; anything else is true. ///
//////////////////////////////////////////////////////////////
Nevertheless, I tried different values combining <minvalue> </minvalue> with <maxvalue> </maxvalue> statements. Can anybody would be so kind to provide a more detail explanation about those statements?
In advance, thank you.
All the best,
Sergio.
I am working with springed buttons and I need to learn more about <minvalue> </minvalue> and <maxvalue> </maxvalue> statements.
For example, this part code is working as I am expecting: The part named bell429_CAL_TOGGLE_cc_sw is the button itself; while bell429_CAL_AUTO_annun_on and bell429_CAL_MAN_annun_on are just detached polygons from the button and both were slightly moved upward. Their function is "turn on" or "turn off" depending on the value assigned by a left mouse click. Both polygons are linked to bell429_CAL_TOGGLE_cc_sw, so they can travel together within the animation (which is ok and it is doing what I need). The button has three states:
- no click: both annunciators off.
- 1st click: CAL AUTO annunciator is on and CAL MAN annunciator is off.
- 2nd click: CAL AUTO annunciator is off and CAL MAN annunciator is on.
- 3rd click: the cycle will begin again.
HTML:
<!-- Row 1_SW 3 CAL TOGGLE AUTO-MAN springed button with an annunciator lamp which toggles ON/OFF only -->
<!-- CAL_TOGGLE Button animation-->
<part>
<name>bell429_CAL_TOGGLE_cc_sw</name>
<animation>
<parameter>
<code>
(L:bell429_CAL_TOGGLE_button,bool) 100 *
</code>
<lag>200</lag>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<tooltip_text>CAL TOGGLE</tooltip_text>
<callback_code>
(L:bell429_CAL_TOGGLE_button,bool) ! (>L:bell429_CAL_TOGGLE_button,bool)
(L:bell429_CAL_TOGGLE_control, number) ++ 3 % (>L:bell429_CAL_TOGGLE_control, number)
</callback_code>
</mouserect>
</part>
<!-- CAL AUTO Annunciator toggle -->
<part>
<name>bell429_CAL_AUTO_annun_on</name>
<visible_in_range>
<parameter>
<code>
(A:Circuit general panel on, bool) (L:bell429_CAL_TOGGLE_control, number) 1 == &&
if{ 1 } els{ 0 }
</code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part>
<!-- CAL MAN Annunciator toggle -->
<part>
<name>bell429_CAL_MAN_annun_on</name>
<visible_in_range>
<parameter>
<code>
(A:Circuit general panel on, bool) (L:bell429_CAL_TOGGLE_control, number) 2 == &&
if{ 1 } els{ 0 }
</code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part>
I used an exact replica of this code in other button and now, both annunciators are turning on at the same time; I don't understand why. Can you spot the difference?
HTML:
<!-- Row 1_SW 2 NORM/ZOOM springed button with an annunciator lamp which toggles ON/OFF only -->
<!-- NORM_ZOOM Button animation-->
<part>
<name>bell429_NORM_ZOOM_cc_sw</name>
<animation>
<parameter>
<code>
(L:bell429_NORM_ZOOM_button, bool) 100 *
</code>
<lag>200</lag>
</parameter>
</animation>
<mouserect>
<cursor>Hand</cursor>
<tooltip_text>NORM/ZOOM</tooltip_text>
<callback_code>
(L:bell429_NORM_ZOOM_button, bool) ! (>L:bell429_NORM_ZOOM_button, bool)
(L:bell429_NZ_control, number) ++ 3 % (>L:bell429_NZ_control, number)
</callback_code>
</mouserect>
</part>
<!-- NORM Annunciator toggle -->
<part>
<name>bell429_NORM_annun_on</name>
<visible_in_range>
<parameter>
<code>
(A:Circuit general panel on, bool) (L:bell429_NZ_control, number) 1 == &&
if{ 1 } els{ 0 }
</code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part>
<!-- ZOOM Annunciator toggle -->
<part>
<name>bell429_ZOOM_annun_on</name>
<visible_in_range>
<parameter>
<code>
(A:Circuit general panel on, bool) (L:bell429_NZ_control, number) 2 == &&
if{ 1 } els{ 0 }
</code>
</parameter>
<minvalue>1</minvalue>
</visible_in_range>
</part>
As a side note, in all annunciators I've been using in the Bell 429, I used <minvalue>1</minvalue> without any trouble...until now. I don't know if this is related or not; and most important: how? If I understood well, the 'and' expressions will return a value of '1' if they are true and '0' otherwise. So, the <minvalue>1</minvalue> expressions are saying that the polygons will only visible when the 'and' expressions are true, Am I right?
Also, related to this, the only explanation about <minvalue> </minvalue> statment I was able to find, was made by Tom Gibson and I will show my personal note about it:
For a 3d part, "visible_in_range" statement explanation by Tom Gibson.
General syntax:
HTML:
<part>
<name>###</name>
<visible_in_range>
<parameter>
<code>
.
.
.
</code>
</parameter>
<minvalue>A</minvalue>
<maxvalue>B</maxvalue>
</visible_in_range>
</part>
Where ### is the part name; note that it is just "inside" that statement /endstatement pair (<visible_in_range> </visible_in_range>). A, B are constants.
"In range" is set by the minvalue statement.
True is 1 or greater, false is less than that.
If the value is less than 1, then the visible_in_range statement is outside the range (i.e. false) and the part becomes invisible.
///////////////////////////////////////////////////////////////
/// This is opposed to the more usual boolean ///
/// determination - 0 is false; anything else is true. ///
//////////////////////////////////////////////////////////////
Nevertheless, I tried different values combining <minvalue> </minvalue> with <maxvalue> </maxvalue> statements. Can anybody would be so kind to provide a more detail explanation about those statements?
In advance, thank you.
All the best,
Sergio.
Last edited: