private void Stop_Click(object sender, EventArgs e) { try { this.ExitlistViewEx.Items[m_CurrentItemIndex].BackColor = Color.White; this.ExitlistViewEx.Items[m_CurrentItemIndex].Font = new Font("宋体", 9, FontStyle.Regular);//ChengSk if (GlobalDataInterface.global_IsTestMode) { stVolveTest stop_VolveTest = new stVolveTest(true); //停止电磁阀测试 if (this.chkSidebySideTest.Checked) //Modify by ChengSk - 20190726 { GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelSeleccomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_ALL_LANE_VOLVE, stop_VolveTest); } else { GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelSeleccomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_VOLVE, stop_VolveTest); } } m_CurrentItemIndex = -1; m_IsVolveTesting = false; } catch (Exception ex) { Trace.WriteLine("VolveTestFormExit中函数Stop_Click出错" + ex); #if REALEASE GlobalDataInterface.WriteErrorInfo("VolveTestForm中函数Stop_Click出错" + ex); #endif } }
/// <summary> /// 窗口关闭事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void VolveTestForm_FormClosed(object sender, FormClosedEventArgs e) { try { //if (m_ChannelcomboBoxSelectedIndex >= 0) //{ // if (this.StartTestbutton.Text == m_resourceManager.GetString("StopTestlabel.Text")) // { // if (GlobalDataInterface.global_IsTestMode) // { // stVolveTest VolveTest = new stVolveTest(true);//电磁阀测试参数 // VolveTest.ExitId = 255; // GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelcomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_VOLVE, VolveTest); // } // //this.StartTestbutton.Text = "开始测试"; // } //} if (GlobalDataInterface.global_IsTestMode) //Modify by ChengSk - 20180704 { stVolveTest VolveTest = new stVolveTest(true); //电磁阀测试参数 VolveTest.ExitId = 255; GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelcomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_VOLVE, VolveTest); } } catch (Exception ex) { Trace.WriteLine("VolveTestForm中函数VolveTestForm_FormClosed出错" + ex); #if REALEASE GlobalDataInterface.WriteErrorInfo("VolveTestForm中函数VolveTestForm_FormClosed出错" + ex); #endif } }
/// <summary> /// 通道选择改变 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ChannelcomboBox_SelectedIndexChanged(object sender, EventArgs e) { try { //if (m_ChannelcomboBoxClick && m_ChannelcomboBoxSelectedIndex >= 0) if (m_ChannelcomboBoxSelectedIndex >= 0) //Modify by ChengSk - 20191104 { if (this.StartTestbutton.Text == m_resourceManager.GetString("StopTestlabel.Text")) { if (GlobalDataInterface.global_IsTestMode) { stVolveTest VolveTest = new stVolveTest(true);//电磁阀测试参数 VolveTest.ExitId = 255; GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelcomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_VOLVE, VolveTest); } this.StartTestbutton.Text = m_resourceManager.GetString("StartTestbutton.Text"); } m_ChannelcomboBoxSelectedIndex = this.ChannelcomboBox.SelectedIndex; //m_ChannelcomboBoxClick = false; } } catch (Exception ex) { Trace.WriteLine("VolveTestForm中函数ChannelcomboBox_SelectedIndexChanged出错" + ex); #if REALEASE GlobalDataInterface.WriteErrorInfo("VolveTestForm中函数ChannelcomboBox_SelectedIndexChanged出错" + ex); #endif } }
///// <summary> ///// 通道出口保存配置 ///// </summary> ///// <returns></returns> //private bool ChannelExitSaveConfig() //{ // try // { // if (m_ExitSubsysindex >= 0 && m_ExitSubsysChannelIndex >= 0 && m_ChannelSeleccomboBoxSelectedIndex >= 0) // { // for (int i = 0; i < ConstPreDefine.MAX_SUBSYS_NUM * ConstPreDefine.MAX_CHANNEL_NUM; i++) // { // GlobalDataInterface.globalOut_ExitInfo[i].ToCopy(tempExitInfo[i]); // } // if (GlobalDataInterface.global_IsTestMode) // { // GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelSeleccomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_EXIT_INFO, null); // } // } // return true; // } // catch (Exception ex) // { // //MessageBox.Show("通道出口设置界面保存配置出错:" + ex); // //MessageBox.Show("0x10001007 Lane Outlet save error: " + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // MessageBox.Show("0x10001007 " + LanguageContainer.VolveTestFormMessagebox1Text[GlobalDataInterface.selectLanguageIndex], // LanguageContainer.VolveTestFormMessageboxErrorCaption[GlobalDataInterface.selectLanguageIndex], // MessageBoxButtons.OK, MessageBoxIcon.Error); // return false; // } //} //private void 单击测试ToolStripMenuItem_Click(object sender, EventArgs e) //{ // stVolveTest volveTest = new stVolveTest(true); // volveTest.ExitId = (byte)(m_CurrentMotorItemIndex + 48); // if (GlobalDataInterface.global_IsTestMode) // GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ExitChannelSelectIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_VOLVE, volveTest); //} private void 单机测试ToolStripMenuItem_Click(object sender, EventArgs e) { try { stVolveTest volveTest = new stVolveTest(true); volveTest.ExitId = (byte)(m_CurrentItemIndex + 48); GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelSeleccomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_VOLVE, volveTest); } catch (Exception ex) { Trace.WriteLine("ProjectSetForm-ChannelExit中函数Start_Click出错" + ex); #if REALEASE GlobalDataInterface.WriteErrorInfo("ProjectSetForm-ChannelExit中函数Start_Click出错" + ex); #endif } }
/// <summary> /// 窗口关闭事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void VolveTestForm_FormClosed(object sender, FormClosedEventArgs e) { try { if (GlobalDataInterface.global_IsTestMode) //Modify by ChengSk - 20180704 { stVolveTest VolveTest = new stVolveTest(true); //电磁阀测试参数 VolveTest.ExitId = 255; GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelcomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_VOLVE, VolveTest); } } catch (Exception ex) { Trace.WriteLine("VolveTestForm中函数VolveTestForm_FormClosed出错" + ex); #if REALEASE GlobalDataInterface.WriteErrorInfo("VolveTestForm中函数VolveTestForm_FormClosed出错" + ex); #endif } }
/// <summary> /// 开始测试按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void StartTestbutton_Click(object sender, EventArgs e) { try { if (m_ChannelcomboBoxSelectedIndex >= 0) { if (this.StartTestbutton.Text == m_resourceManager.GetString("StartTestbutton.Text")) { if (GlobalDataInterface.global_IsTestMode) { stVolveTest VolveTest = new stVolveTest(true);//电磁阀测试参数 VolveTest.ExitId = 254; GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelcomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_VOLVE, VolveTest); } this.StartTestbutton.Text = m_resourceManager.GetString("StopTestlabel.Text"); } else { if (GlobalDataInterface.global_IsTestMode) { stVolveTest VolveTest = new stVolveTest(true);//电磁阀测试参数 VolveTest.ExitId = 255; GlobalDataInterface.TransmitParam(m_ChanelIDList[m_ChannelcomboBoxSelectedIndex], (int)HC_FSM_COMMAND_TYPE.HC_CMD_TEST_VOLVE, VolveTest); } this.StartTestbutton.Text = m_resourceManager.GetString("StartTestbutton.Text"); } } } catch (Exception ex) { Trace.WriteLine("VolveTestForm中函数StartTestbutton_Click出错" + ex); #if REALEASE GlobalDataInterface.WriteErrorInfo("VolveTestForm中函数StartTestbutton_Click出错" + ex); #endif } }