protected Gauges.BaseGauge AddDisplay( string name, Gauges.BaseGauge gauge, Point posn, Size size, string interfaceDeviceName, string interfaceElementName ) { gauge.Name = name; gauge.Top = posn.Y; gauge.Left = posn.X; gauge.Width = size.Width; gauge.Height = size.Height; string componentName = GetComponentName(name); gauge.Name = componentName; Children.Add(gauge); AddAction(gauge.Actions["set.value"], componentName); AddDefaultInputBinding( childName: componentName, interfaceTriggerName: interfaceDeviceName + "." + interfaceElementName + ".changed", deviceActionName: "set.value"); return(gauge); }
// // For gauges with more than one input function, we need this override to map the // different interface element names to the individual functions. This carries with it // a requirement for the gauge function name to equal the interface element name // protected new Gauges.BaseGauge AddGauge( string name, Gauges.BaseGauge gauge, Point posn, Size size, string interfaceDeviceName, string interfaceElementName ) => AddGauge(name, gauge, posn, size, interfaceDeviceName, new string[1] { interfaceElementName });
protected Gauges.BaseGauge AddGauge( string name, Gauges.BaseGauge gauge, Point posn, Size size, string interfaceDeviceName, string interfaceElementName ) { gauge.Name = name; gauge.Top = posn.Y; gauge.Left = posn.X; gauge.Width = size.Width; gauge.Height = size.Height; string componentName = GetComponentName(name); gauge.Name = componentName; Children.Add(gauge); foreach (IBindingTrigger trigger in gauge.Triggers) { AddTrigger(trigger, trigger.Device); } foreach (IBindingAction action in gauge.Actions) { if (action.Name != "hidden") { //string _actionName = action.Device; //if (_actionName == "") //{ // _actionName = action.Name; //} AddAction(action, action.Device); AddDefaultInputBinding( childName: componentName, interfaceTriggerName: interfaceDeviceName + "." + interfaceElementName + ".changed", deviceActionName: action.Device + "." + action.ActionVerb + "." + action.Name ); // previously working (mostly) //AddDefaultInputBinding( // childName: name, // interfaceTriggerName: name + "." + interfaceElementName + ".changed", // deviceActionName: action.ActionVerb + "." + _actionName // ); //AddDefaultInputBinding( // childName: componentName, // interfaceTriggerName: interfaceDeviceName + "." + interfaceElementName + ".changed", // deviceActionName: "set.value"); } } return(gauge); }
protected Gauges.BaseGauge AddGauge( string name, Gauges.BaseGauge gauge, Point posn, Size size, string interfaceDeviceName, string[] interfaceElementNames ) { if (DefaultInterfaceName == "DCS AV-8B" && (name == "Altimeter Gauge" || name == "ADI Gauge" || name == "Slip/Turn Gauge" || name == "AOA Gauge")) { gauge.Name = name; gauge.Top = posn.Y; gauge.Left = posn.X; gauge.Width = size.Width; gauge.Height = size.Height; string componentName = GetComponentName(name); gauge.Name = componentName; Children.Add(gauge); foreach (IBindingTrigger trigger in gauge.Triggers) { AddTrigger(trigger, trigger.Device); } int i = 0; foreach (IBindingAction action in gauge.Actions) { if (action.Name != "hidden") { AddAction(action, action.Device); AddDefaultInputBinding( childName: componentName, interfaceTriggerName: interfaceDeviceName + "." + interfaceElementNames[i++] + ".changed", deviceActionName: action.Device + "." + action.ActionVerb + "." + action.Name ); } } return(gauge); } else { return(base.AddGauge( name, gauge, posn, size, interfaceDeviceName, interfaceElementNames[0] )); } }
protected Gauges.BaseGauge AddGauge( string name, Gauges.BaseGauge gauge, Point posn, Size size, string interfaceDeviceName, string interfaceElementName ) { gauge.Name = name; gauge.Top = posn.Y; gauge.Left = posn.X; gauge.Width = size.Width; gauge.Height = size.Height; // XXX what is going on here? we just set Name above string componentName = GetComponentName(name); gauge.Name = componentName; Children.Add(gauge); foreach (IBindingTrigger trigger in gauge.Triggers) { AddTrigger(trigger, trigger.Device); } foreach (IBindingAction action in gauge.Actions) { if (action.Name == "hidden") { continue; } AddAction(action, action.Device); AddDefaultInputBinding( childName: componentName, interfaceTriggerName: interfaceDeviceName + "." + interfaceElementName + ".changed", deviceActionName: action.Device + "." + action.ActionVerb + "." + action.Name ); } return(gauge); }