private void OnPrinterConnectionChange(string msg) { toolConnection.Text = msg; if (conn.connected) { toolConnect.Image = imageList.Images[0]; toolConnect.ToolTipText = "Disconnect printer"; toolConnect.Text = "Disconnect"; foreach (ToolStripItem it in toolConnect.DropDownItems) it.Enabled = false; //eeprom.Enabled = true; toolStripEmergencyButton.Enabled = true; } else { toolConnect.Image = imageList.Images[1]; toolConnect.ToolTipText = "Connect printer"; toolConnect.Text = "Connect"; eeprom.Enabled = false; if (eepromSettings != null && eepromSettings.Visible) { eepromSettings.Close(); eepromSettings.Dispose(); eepromSettings = null; } if (eepromSettingsm != null && eepromSettingsm.Visible) { eepromSettingsm.Close(); eepromSettingsm.Dispose(); eepromSettingsm = null; } foreach (ToolStripItem it in toolConnect.DropDownItems) it.Enabled = true; toolStripEmergencyButton.Enabled = false; SDCard.Disconnected(); } }
private void testToolStripMenuItem_Click(object sender, EventArgs e) { if (conn.isRepetier) { if (eepromSettings != null) { if (eepromSettings.Visible) { eepromSettings.BringToFront(); return; } else { eepromSettings.Dispose(); eepromSettings = null; } } if (eepromSettings == null) eepromSettings = new EEPROMRepetier(); eepromSettings.Show2(); } if (conn.isMarlin) { if (eepromSettingsm != null) { if (eepromSettingsm.Visible) { eepromSettingsm.BringToFront(); return; } else { eepromSettingsm.Dispose(); eepromSettingsm = null; } } if (eepromSettingsm == null) eepromSettingsm = new EEPROMMarlin(); eepromSettingsm.Show2(); } }
private void OnPrinterConnectionChange(string msg) { toolConnection.Text = msg; bool connected = conn.connector.IsConnected(); sendScript1ToolStripMenuItem.Enabled = connected; sendScript2ToolStripMenuItem.Enabled = connected; sendScript3ToolStripMenuItem.Enabled = connected; sendScript4ToolStripMenuItem.Enabled = connected; sendScript5ToolStripMenuItem.Enabled = connected; saveStateToolStripMenuItem.Enabled = connected; if (connected) { toolConnect.Image = imageList.Images[0]; toolConnect.ToolTipText = Trans.T("L_DISCONNECT_PRINTER"); // "Disconnect printer"; toolConnect.Text = Trans.T("M_DISCONNECT"); // "Disconnect"; foreach (ToolStripItem it in toolConnect.DropDownItems) it.Enabled = false; //eeprom.Enabled = true; toolStripEmergencyButton.Enabled = true; //toolPrinterSettings.Enabled = false; printerSettingsToolStripMenuItem.Enabled = false; } else { toolConnect.Image = imageList.Images[1]; toolConnect.ToolTipText = Trans.T("L_CONNECT_PRINTER"); // "Connect printer"; toolConnect.Text = Trans.T("M_CONNECT"); // "Connect"; eeprom.Enabled = false; continuousMonitoringMenuItem.Enabled = false; if (eepromSettings != null && eepromSettings.Visible) { eepromSettings.Close(); eepromSettings.Dispose(); eepromSettings = null; } if (eepromSettingsm != null && eepromSettingsm.Visible) { eepromSettingsm.Close(); eepromSettingsm.Dispose(); eepromSettingsm = null; } foreach (ToolStripItem it in toolConnect.DropDownItems) it.Enabled = true; toolStripEmergencyButton.Enabled = false; //toolPrinterSettings.Enabled = true; printerSettingsToolStripMenuItem.Enabled = true; SDCard.Disconnected(); } }