Skip to content

Commit

Permalink
Fix: Display encoder pins correctly (#1920)
Browse files Browse the repository at this point in the history
* Fix missing encoder pins

* Trigger value_changed event after swapping
  • Loading branch information
DocMoebiuz authored Jan 16, 2025
1 parent 624cd1e commit 11b45ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions UI/Panels/Device/MFEncoderPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public MFEncoderPanel(MobiFlight.Config.Encoder encoder, List<MobiFlightPin> Pin
UpdateFreePinsInDropDowns();

// Default standard selected values, next pins available
mfLeftPinComboBox.SelectedValue = byte.Parse(encoder.PinLeft);
mfRightPinComboBox.SelectedValue = byte.Parse(encoder.PinRight);
mfLeftPinComboBox.SelectedValue = uint.Parse(encoder.PinLeft);
mfRightPinComboBox.SelectedValue = uint.Parse(encoder.PinRight);
ComboBoxHelper.SetSelectedItemByIndex(mfEncoderTypeComboBox, int.Parse(encoder.EncoderType));
textBox1.Text = encoder.Name;

Expand Down Expand Up @@ -87,6 +87,7 @@ private void mfSwapButton_Click(object sender, EventArgs e)
{
(encoder.PinLeft, encoder.PinRight) = (encoder.PinRight, encoder.PinLeft);
UpdateFreePinsInDropDowns();
value_Changed(null, new EventArgs());
}
}
}

0 comments on commit 11b45ab

Please sign in to comment.