Possible example using <ma-set-point-value with a button & validation function?
-
Might please and thank-you someone furnish an example or direct to an example that uses a button to increment an integer point value while incorporating a validation function before setting the point?? The integer point should be the returned point from a watchlist filter.
-
@Phillip-Weeks I'm not sure what you mean by validation function here. Can you elaborate further?
-
Jared, my understanding of the variable environment is my biggest hurdle. and learning how to manipulate points from filtered watchlists as variables.. for example <ma-calc takes as input="designer.points | filter:... and produces a new output="mypointvar". This variable is created and set to the result of the input expression correct? I can then use this variable in other directives so how do we assign "designer.points | filter:{name:'COIL PUMP SPEED (P-10)'}:true | maFirst" to a variable like <ma-point-value takes the xid="DP_231293" and creates a point="myvariable" that can be used in other directives. Is there a directive that takes the filtered point and exposes this point as a variable like <ma-calc uses output="myvariable" except is the same reference as the input being the "designer.points" filtered point?
As well and I'm sure related to my misunderstanding please see if the below makes sense.I want a number input to initialize its input value as ng-init="setpoint=50" which works but instead setting the intitial value using a point's value.
ng-init="setpoint=Point1Value.value" can't get this to work.Please demonstrate how to initialize an input to the point value.
<ma-calc input="designer.points | filter:{name:'COIL PUMP SPEED (P-10)'}:true | maFirst" output="mycoilspeed" on-change="Point1Value = $value;" ng-init="counter=0;" > </ma-calc> <md-input-container id="input1" flex="10" style="width: 140px; height: 100px; top: 0px; left: 0px; position: absolute;"> <input id="input2" style="width: 125px; height: 60px; top: 28px; left: 11.091px; position: absolute;" type="number" step="1" min="45" max="55" ng-model="setpoint" ng-init="setpoint=Point1Value.value;"> </md-input-container>
-
@phillip-weeks said in Possible example using <ma-set-point-value with a button & validation function?:
<ma-calc takes as input="designer.points | filter:... and produces a new output="mypointvar". This variable is created and set to the result of the input expression correct?
Correct.
@phillip-weeks said in Possible example using <ma-set-point-value with a button & validation function?:
so how do we assign "designer.points | filter:{name:'COIL PUMP SPEED (P-10)'}:true | maFirst" to a variable
Using
<ma-calc>
as you described.@phillip-weeks said in Possible example using <ma-set-point-value with a button & validation function?:
like <ma-point-value takes the xid="DP_231293" and creates a point="myvariable" that can be used in other directives
<ma-point-value>
does not behave like this. It does not output anything, it only has inputs.@phillip-weeks said in Possible example using <ma-set-point-value with a button & validation function?:
Is there a directive that takes the filtered point and exposes this point as a variable like <ma-calc uses output="myvariable" except is the same reference as the input being the "designer.points" filtered point?
I'm not following this but I believe you just want
<ma-calc>
.@phillip-weeks said in Possible example using <ma-set-point-value with a button & validation function?:
I want a number input to initialize its input value as ng-init="setpoint=50" which works but instead setting the intitial value using a point's value.
ng-init="setpoint=Point1Value.value" can't get this to work.You have to understand how
ng-init
works, it is for initialization only so it is only evaluated once. The point value is not ready at the point in time when the expression is evaluated so the expression returns undefined. To make it work use something likeng-if="point.value != null" ng-init="variable=point.value"
. -
Thanks, Jared I am beginning to figure it out. Thank goodness. :)