private void ShowProgressBar(atResult result) { tsPB.Maximum = result.Parameter2; tsPB.Value = result.Parameter1; if (result.ResultType == LYC.Common.ATResultType.SingleSuccess && tsPB.Visible == false) { tsPB.Visible = true; if (tsDownLoad.Enabled) { tsDownLoad.Enabled = false; } if (tsReadBack.Enabled) { tsReadBack.Enabled = false; } if (tsCommand.Enabled) { tsCommand.Enabled = false; } if (tsReboot.Enabled) { tsReboot.Enabled = false; } } else if (result.ResultType == LYC.Common.ATResultType.Success) { tsPB.Visible = false; tsDownLoad.Enabled = true; tsReadBack.Enabled = true; tsCommand.Enabled = true; tsReboot.Enabled = true; if (m_IsDownLoad) { m_atc.SendUpdateMbCfg(); MessageBox.Show("DownLoad Successed!"); } else { Openfile(System.Windows.Forms.Application.StartupPath + "\\configfile" + "\\modbus.cfg"); MessageBox.Show("ReadBack Successed!"); } } else if (result.ResultType == LYC.Common.ATResultType.Failure) { if (m_IsDownLoad) { MessageBox.Show("DownLoad Failure!"); } else { MessageBox.Show("ReadBack Failure!"); } } }
private void OnReceivedCommand(atResult result) { SetTextCallback d = new SetTextCallback(SetText); if (result.ResultType == LYC.Common.ATResultType.Message) { this.Invoke(d, new object[] { result.ResultText }); } }
protected override void FileTransmittingCallback(atResult result) { tsPB.Maximum = result.Parameter2; tsPB.Value = result.Parameter1; if (result.ResultType != LYC.Common.ATResultType.SingleSuccess) { tsPB.Visible = false; tsDownLoad.Enabled = true; tsReadBack.Enabled = true; tsReboot.Enabled = true; } }
private void ReceivedConnectReponse(atResult result) { if (result.ResultType == LYC.Common.ATResultType.Message && result.ResultText.Length >= 2) { if ((result.ResultText)[0] == 'O' && (result.ResultText)[1] == 'K') { if (m_pre_net) { m_connection = Config.ConnectionType.NETWORK; } else { m_connection = Config.ConnectionType.SERIAL_PORT; } } } }
private void Rebooted(atResult result) { if (result.ResultType == LYC.Common.ATResultType.Message && result.ResultText.Length >= 2) { if (result.ResultText.IndexOf("OK") != -1) { tsDownLoad.Enabled = false; tsReadBack.Enabled = false; tsCommand.Enabled = false; tsReboot.Enabled = false; if (m_spPort.IsOpen) { m_spPort.Close(); } if (m_cmdClient.IsRun) { m_cmdClient.Stop(); } m_connection = Config.ConnectionType.NONE; } } }
protected override void FileTransmittingCallback(atResult result) { tsPB.Maximum = result.Parameter2; tsPB.Value = result.Parameter1; if (result.ResultType != LYC.Common.ATResultType.SingleSuccess) { tsPB.Visible = false; if (m_IsDownLoad) { if ((bool)btUpdateCore.Tag == true) { btUpdateCore.Enabled = true; } if ((bool)btUpdateHmi.Tag == true) { btUpdateHmi.Enabled = true; } } } }