Trigger properties.
This commit is contained in:
+11
-3
@@ -436,6 +436,7 @@ export enum ControlType {
|
||||
OnOffSwitch,
|
||||
ABSwitch,
|
||||
Select,
|
||||
Trigger,
|
||||
|
||||
Tuner,
|
||||
Vu,
|
||||
@@ -444,7 +445,7 @@ export enum ControlType {
|
||||
}
|
||||
|
||||
export class UiControl implements Deserializable<UiControl> {
|
||||
deserialize(input: any): UiControl {
|
||||
deserialize(input: any): UiControl {
|
||||
this.symbol = input.symbol;
|
||||
this.name = input.name;
|
||||
this.index = input.index;
|
||||
@@ -458,7 +459,7 @@ export class UiControl implements Deserializable<UiControl> {
|
||||
this.integer_property = input.integer_property;
|
||||
this.enumeration_property = input.enumeration_property;
|
||||
this.toggled_property = input.toggled_property;
|
||||
this.trigger = input.trigger;
|
||||
this.trigger_property = input.trigger_property;
|
||||
this.not_on_gui = input.not_on_gui;
|
||||
this.scale_points = ScalePoint.deserialize_array(input.scale_points);
|
||||
this.port_group = input.port_group;
|
||||
@@ -499,6 +500,10 @@ export class UiControl implements Deserializable<UiControl> {
|
||||
this.controlType = ControlType.OnOffSwitch;
|
||||
}
|
||||
}
|
||||
if (this.is_input && this.trigger_property)
|
||||
{
|
||||
this.controlType = ControlType.Trigger;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
applyProperties(properties: Partial<UiControl>): UiControl {
|
||||
@@ -546,7 +551,7 @@ export class UiControl implements Deserializable<UiControl> {
|
||||
range_steps: number = 0;
|
||||
integer_property: boolean = false;
|
||||
enumeration_property: boolean = false;
|
||||
trigger: boolean = false;
|
||||
trigger_property: boolean = false;
|
||||
not_on_gui: boolean = false;
|
||||
toggled_property: boolean = false;
|
||||
scale_points: ScalePoint[] = [];
|
||||
@@ -590,6 +595,9 @@ export class UiControl implements Deserializable<UiControl> {
|
||||
isSelect(): boolean {
|
||||
return this.controlType === ControlType.Select;
|
||||
}
|
||||
isTrigger(): boolean {
|
||||
return this.controlType === ControlType.Trigger;
|
||||
}
|
||||
isOutputSelect(): boolean {
|
||||
return !this.is_input && this.controlType === ControlType.OutputSelect;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user