public void TransfercurrentFirmwareToNewFirmware() { if (currentFirmwareHelper.GetFeatureValue(Feature) == null && NewFirmwareHelper.GetFeatureValue(Feature) != null) { MessageBox.Show(@"The feature " + Feature + @" is not available in the old Marlin Firmware." + Environment.NewLine + @"This might be a new feature." + Environment.NewLine + @"Read the documentation and set this value manually.", @"New feature", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (NewFirmwareHelper.GetFeatureValue(Feature) == null) { MessageBox.Show(@"The feature " + Feature + @" is not available in the new Marlin Firmware." + Environment.NewLine + @"This might be a obsolite feature." + Environment.NewLine + @"Read the documentation and set this value manually.", @"Obsolite feature in new Firmware", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DialogResult result = MessageBox.Show(@"Do you want to transfer value from Current Firmware to the New Firmware?", @"Transfer value", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { Migrate(); } }
public void UpdateStatus() { ledBulbEqualcurrentFirmware.On = true; if (currentFirmwareHelper != null && NewFirmwareHelper != null) { if (currentFirmwareHelper.GetFeatureValue(Feature) == null && NewFirmwareHelper.GetFeatureValue(Feature) != null) { ledBulbEqualcurrentFirmware.Color = Color.Yellow; } else if (NewFirmwareHelper.GetFeatureValue(Feature) == null) { ledBulbEqualcurrentFirmware.Color = Color.Blue; this.Enabled = false; } else { ledBulbEqualcurrentFirmware.Color = currentFirmwareHelper.GetFeatureValue(Feature) == NewFirmwareHelper.GetFeatureValue(Feature) ? Color.Green : Color.Red; } } if (NewFirmwareHelper != null) { int resultValue; if (int.TryParse(NewFirmwareHelper.GetFeatureValue(Feature), out resultValue)) { numUpDnControl.Value = resultValue; } } }
public void UpdateStatus() { ledBulbEqualcurrentFirmware.On = true; if (currentFirmwareHelper != null && NewFirmwareHelper != null) { if (currentFirmwareHelper.GetFeatureValue(Feature) == null && NewFirmwareHelper.GetFeatureValue(Feature) != null) { ledBulbEqualcurrentFirmware.Color = Color.Yellow; } else if (NewFirmwareHelper.GetFeatureValue(Feature) == null) { ledBulbEqualcurrentFirmware.Color = Color.Blue; this.Enabled = false; } else { ledBulbEqualcurrentFirmware.Color = currentFirmwareHelper.GetEnabledFeature(Feature) == NewFirmwareHelper.GetEnabledFeature(Feature) ? Color.Green : Color.Red; } } if (NewFirmwareHelper != null) { try { chkBxProperty.Checked = Convert.ToBoolean(NewFirmwareHelper.GetEnabledFeature(Feature)); } catch (Exception) //(Exception e) { chkBxProperty.Checked = false; } } }
public void TransfercurrentFirmwareToNewFirmware() { if (currentFirmwareHelper.GetFeatureValue(Feature) == null && NewFirmwareHelper.GetFeatureValue(Feature) != null) { MessageBox.Show(@"The feature " + Feature + @" is not available in the old Marlin Firmware." + Environment.NewLine + @"This might be a new feature." + Environment.NewLine + @"Read the documentation and set this value manually.", @"New feature", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DialogResult result = MessageBox.Show(@"Do you want to transfer value from Current Firmware to the New Firmware?", @"Transfer value", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { bool oldvalue; try { oldvalue = Convert.ToBoolean(currentFirmwareHelper.GetEnabledFeature(Feature)); } catch (Exception e) { oldvalue = false; } NewFirmwareHelper.SetEnabledFeature(Feature, oldvalue); chkBxProperty.Checked = oldvalue; UpdateStatus(); } }
public void UpdateStatus() { ledBulbEqualcurrentFirmware.On = true; if (currentFirmwareHelper != null && NewFirmwareHelper != null) { if (currentFirmwareHelper.GetFeatureValue(Feature) == null && NewFirmwareHelper.GetFeatureValue(Feature) != null) { ledBulbEqualcurrentFirmware.Color = Color.Yellow; } else { ledBulbEqualcurrentFirmware.Color = currentFirmwareHelper.GetFeatureValue(Feature) == NewFirmwareHelper.GetFeatureValue(Feature) ? Color.Green : Color.Red; } } if (NewFirmwareHelper != null) { string currentvalue = NewFirmwareHelper.GetFeatureValue(Feature); foreach (object item in cmbBxControl.Items) { ComboboxItem temp = (ComboboxItem)item; if ((string)temp.Value == currentvalue || temp.Text == currentvalue) { cmbBxControl.Text = temp.Text; break; } } } }
public void TransfercurrentFirmwareToNewFirmware() { if (currentFirmwareHelper.GetFeatureValue(Feature) == null && NewFirmwareHelper.GetFeatureValue(Feature) != null) { MessageBox.Show(@"The feature " + Feature + @" is not available in the old Marlin Firmware." + Environment.NewLine + @"This might be a new feature." + Environment.NewLine + @"Read the documentation and set this value manually.", @"New feature", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } var result = MessageBox.Show(@"Do you want to transfer value from Current Firmware to the New Firmware?", @"Transfer value", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { NewFirmwareHelper.SetFeatureValue(Feature, currentFirmwareHelper.GetFeatureValue(Feature)); int resultValue; if (int.TryParse(NewFirmwareHelper.GetFeatureValue(Feature), out resultValue)) { numUpDnControl.Value = resultValue; } UpdateStatus(); } }
public void UpdateStatus() { ledBulbEqualcurrentFirmware.On = true; if (currentFirmwareHelper != null && NewFirmwareHelper != null) { if (currentFirmwareHelper.GetFeatureValue(Feature) == null && NewFirmwareHelper.GetFeatureValue(Feature) != null) { ledBulbEqualcurrentFirmware.Color = Color.Yellow; } else if (NewFirmwareHelper.GetFeatureValue(Feature) == null) { ledBulbEqualcurrentFirmware.Color = Color.Blue; this.Enabled = false; } else { ledBulbEqualcurrentFirmware.Color = currentFirmwareHelper.GetFeatureValue(Feature) == NewFirmwareHelper.GetFeatureValue(Feature) ? Color.Green : Color.Red; } } string value = NewFirmwareHelper?.GetFeatureValue(Feature); if (value != null) { txtBxValue.Text = NewFirmwareHelper.GetFeatureValue(Feature); } }
public void Migrate() { if (ledBulbEqualcurrentFirmware.Color == Color.Red || ledBulbEqualcurrentFirmware.Color == Color.Green) { NewFirmwareHelper.SetFeatureValue(Feature, currentFirmwareHelper.GetFeatureValue(Feature)); cmbBxControl.Text = NewFirmwareHelper.GetFeatureValue(Feature); UpdateStatus(); } }
public void UpdateStatus() { string newEnable = null; string newValue = null; string oldEnable; string oldValue; ledBulbEqualcurrentFirmware.On = true; if (currentFirmwareHelper != null && NewFirmwareHelper != null) { newEnable = NewFirmwareHelper.GetEnabledFeature(Feature); newValue = NewFirmwareHelper.GetFeatureValue(Feature); oldEnable = currentFirmwareHelper.GetEnabledFeature(Feature); oldValue = currentFirmwareHelper.GetFeatureValue(Feature); if (oldEnable == null && newEnable != null) { ledBulbEqualcurrentFirmware.Color = Color.Yellow; } else if (newValue == null) { ledBulbEqualcurrentFirmware.Color = Color.Blue; this.Enabled = false; } else { ledBulbEqualcurrentFirmware.Color = (oldEnable == newEnable && oldValue == newValue) ? Color.Green : Color.Red; } } if (NewFirmwareHelper != null) { chkBxProperty.Checked = Convert.ToBoolean(newEnable); txtBxValue.Text = newValue; } }