181 this.lastapply = indexes.map(() => undefined); |
181 this.lastapply = indexes.map(() => undefined); |
182 this.inhibit = indexes.map(() => undefined); |
182 this.inhibit = indexes.map(() => undefined); |
183 this.pending = indexes.map(() => undefined); |
183 this.pending = indexes.map(() => undefined); |
184 this.bound_unhinibit = this.unhinibit.bind(this); |
184 this.bound_unhinibit = this.unhinibit.bind(this); |
185 this.forced_frequency = freq; |
185 this.forced_frequency = freq; |
|
186 this.clip = true; |
186 } |
187 } |
187 |
188 |
188 unsub(){ |
189 unsub(){ |
189 /* remove subsribers */ |
190 /* remove subsribers */ |
190 if(!this.unsubscribable) |
191 if(!this.unsubscribable) |
267 change_hmi_value(index, opstr) { |
268 change_hmi_value(index, opstr) { |
268 let realindex = this.get_variable_index(index); |
269 let realindex = this.get_variable_index(index); |
269 if(realindex == undefined) return undefined; |
270 if(realindex == undefined) return undefined; |
270 let old_val = cache[realindex]; |
271 let old_val = cache[realindex]; |
271 let new_val = eval_operation_string(old_val, opstr); |
272 let new_val = eval_operation_string(old_val, opstr); |
272 new_val = this.clip_min_max(index, new_val); |
273 if(this.clip) |
|
274 new_val = this.clip_min_max(index, new_val); |
273 return apply_hmi_value(realindex, new_val); |
275 return apply_hmi_value(realindex, new_val); |
274 } |
276 } |
275 |
277 |
276 _apply_hmi_value(index, new_val) { |
278 _apply_hmi_value(index, new_val) { |
277 let realindex = this.get_variable_index(index); |
279 let realindex = this.get_variable_index(index); |
278 if(realindex == undefined) return undefined; |
280 if(realindex == undefined) return undefined; |
279 new_val = this.clip_min_max(index, new_val); |
281 if(this.clip) |
|
282 new_val = this.clip_min_max(index, new_val); |
280 return apply_hmi_value(realindex, new_val); |
283 return apply_hmi_value(realindex, new_val); |
281 } |
284 } |
282 |
285 |
283 unhinibit(index){ |
286 unhinibit(index){ |
284 this.inhibit[index] = undefined; |
287 this.inhibit[index] = undefined; |