diff --git a/MobiFlight/Modifier/Interpolation.cs b/MobiFlight/Modifier/Interpolation.cs index 2bb20572..2e94792e 100644 --- a/MobiFlight/Modifier/Interpolation.cs +++ b/MobiFlight/Modifier/Interpolation.cs @@ -172,22 +172,25 @@ protected double interpolate(double value, double x1, double y1, double x2, doub public override bool Equals(object obj) { - bool entriesAreSame = (Values.Count == (obj as Interpolation).Count); - if (entriesAreSame) + var interpolation = (obj as Interpolation); + if (interpolation == null) return false; + + bool valuesAreSame = (Values.Count == interpolation.Count); + + if (valuesAreSame) { foreach (double x in Values.Keys) { - entriesAreSame = entriesAreSame && ((obj as Interpolation).Values.ContainsKey(x) && Values[x] == (obj as Interpolation).Values[x]); + valuesAreSame = valuesAreSame && (interpolation.Values.ContainsKey(x) && Values[x] == interpolation.Values[x]); } } return - obj != null && obj is Interpolation && - Max == (obj as Interpolation).Max && - Min == (obj as Interpolation).Min && - Count == (obj as Interpolation).Count && - Active == (obj as Interpolation).Active && - entriesAreSame; + Max == interpolation.Max && + Min == interpolation.Min && + Count == interpolation.Count && + Active == interpolation.Active && + valuesAreSame; } public override string ToSummaryLabel() { diff --git a/MobiFlightConnector.csproj b/MobiFlightConnector.csproj index 39114382..9a2068d3 100644 --- a/MobiFlightConnector.csproj +++ b/MobiFlightConnector.csproj @@ -1460,6 +1460,7 @@ FsuipcConfigPanel.cs + Designer InterpolationPanel.cs diff --git a/UI/Panels/Config/FsuipcConfigPanel.cs b/UI/Panels/Config/FsuipcConfigPanel.cs index 5c5f2bf5..9645a1a5 100644 --- a/UI/Panels/Config/FsuipcConfigPanel.cs +++ b/UI/Panels/Config/FsuipcConfigPanel.cs @@ -103,8 +103,8 @@ private void fsuipcPresetUseButton_Click(object sender, EventArgs e) { var config = rows[0]["settings"] as IFsuipcConfigItem; syncFromConfig(config); - panelModifierHint.Visible = (config?.Modifiers.Items.Count > 0); - PresetChanged(this, config); + panelModifierHint.Visible = (config?.Modifiers.Items.Count > 0) && OutputPanelMode; + PresetChanged?.Invoke(this, config); } } } @@ -258,7 +258,7 @@ public void syncFromConfig(object config) if (preset.FSUIPC.Equals(conf.FSUIPC)) { - if (!preset.Modifiers.Items.TrueForAll(m => m.Active && conf.Modifiers.ContainsModifier(m))) continue; + if (!preset.Modifiers.Items.FindAll(m=>m.Active).TrueForAll(m => conf.Modifiers.ContainsModifier(m))) continue; // we found the preset fsuipcPresetComboBox.Text = row["description"].ToString(); panelModifierHint.Visible = (row["settings"] as IFsuipcConfigItem).Modifiers.Items.Count > 0; diff --git a/UI/Panels/Config/FsuipcConfigPanel.de.resx b/UI/Panels/Config/FsuipcConfigPanel.de.resx index db81b0f6..96bbe67d 100644 --- a/UI/Panels/Config/FsuipcConfigPanel.de.resx +++ b/UI/Panels/Config/FsuipcConfigPanel.de.resx @@ -118,35 +118,23 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3, 5 - - - 106, 13 - - - Setze Wert - - - bis - - - Weitere Optionen - 101, 13 Maskiere Wert mit + + Basis-Einstellungen + Wert Typ - + Größe in Bytes - - Basis-Einstellungen + + Preset laden 24, 25 @@ -157,7 +145,14 @@ Verwende Preset - - Preset laden + + 300, 3 + + + 300, 18 + + + Preset enthält Modifikatoren. Du kannst sie anpassen auf dem + \ No newline at end of file diff --git a/UI/Panels/Config/TransformOptionsGroup.de.resx b/UI/Panels/Config/TransformOptionsGroup.de.resx index 448e97d0..ea5bf7c8 100644 --- a/UI/Panels/Config/TransformOptionsGroup.de.resx +++ b/UI/Panels/Config/TransformOptionsGroup.de.resx @@ -120,12 +120,6 @@ Setze Wert - - Substring von - - - bis - Weitere Optionen diff --git a/UI/Panels/Config/TransformOptionsGroup.resx b/UI/Panels/Config/TransformOptionsGroup.resx index d9635fc0..e2b5da0e 100644 --- a/UI/Panels/Config/TransformOptionsGroup.resx +++ b/UI/Panels/Config/TransformOptionsGroup.resx @@ -118,177 +118,177 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - True - - - - Top, Left, Right - - - NoControl - - - - 112, 25 - - - 226, 37 - 30 - - Supports variable value ($), input value (@) and placeholders (?,#, etc.) - - - ValuePlaceholderLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + ValuePanel 0 - - MiddleRight + + 1 + + + Set Value + NoControl - - 7, 5 - - - 98, 17 + + ValuePanel - - 18 + + + 350, 81 - - Set Value + + $this - - MiddleRight + + Top, Left, Right label5 - + + 350, 81 + + + 9 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ValuePanel + + fsuipcMoreOptionsGroupBox - - 1 + + True - - Top, Left, Right + + 17 - - Cascadia Mono, 8.25pt + + ValuePanel - - 110, 2 + + NoControl - - 228, 20 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17 + + 0 fsuipcValueTextBox - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + TransformOptionsGroup - - ValuePanel + + 0, 0 - - 2 + + 226, 37 - - Top + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 3, 16 - - 344, 62 + + 7, 5 - - 9 + + Top, Left, Right - - ValuePanel + + MiddleRight + + + 110, 2 System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - fsuipcMoreOptionsGroupBox - - - 0 - Top - - 0, 0 - - - 350, 81 + + 6, 13 22 - - More Options + + MiddleRight + + + ValuePanel + + + Cascadia Mono, 8.25pt + + + 344, 62 fsuipcMoreOptionsGroupBox - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 2 - - $this + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 0 - - True - - - 6, 13 + + 18 - + + 350, 0 + + + 112, 25 + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + More Options + + + 98, 17 + + + ValuePlaceholderLabel + + True GrowAndShrink - - 350, 0 + + True - - 350, 81 + + Supports variable value ($), input value (@) and placeholders (?,#, etc.) - - TransformOptionsGroup + + Top - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 228, 20 + + True + \ No newline at end of file