| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 点击按钮【启动模拟】 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void button8_Click(object sender, EventArgs e) |
| | | { |
| | | try |
| | | { |
| | | DataCaptureHandler.RefreshDataCommonStatic(); |
| | | button8.Text = "模拟已启动"; |
| | | button8.BackColor = Color.Green; |
| | | SystemValue.isStartedModel = true; |
| | | #region 数据采集项确定 |
| | | var dataCaptureConfigslist = DataCaptureConfigManager.GetDataCaptureConfigs(); |
| | | var columnList = DataCaptureConfigManager.GetDataCaptureColumnConfig(); |
| | | _dataCaptureHandler.Clear(); |
| | | foreach (var config in dataCaptureConfigslist) |
| | | { |
| | | //try |
| | | //{ |
| | | // DataCaptureHandler.RefreshDataCommonStatic(); |
| | | // button8.Text = "模拟已启动"; |
| | | // button8.BackColor = Color.Green; |
| | | // SystemValue.isStartedImitateModel = true; |
| | | // #region 数据采集项确定 |
| | | // var dataCaptureConfigslist = DataCaptureConfigManager.GetDataCaptureConfigs(); |
| | | // var columnList = DataCaptureConfigManager.GetDataCaptureColumnConfig(); |
| | | // _dataCaptureHandler.Clear(); |
| | | // foreach (var config in dataCaptureConfigslist) |
| | | // { |
| | | |
| | | switch (config.DataCapturePointCode) |
| | | { |
| | | #region HMI04 |
| | | case "RHMIOP104001": |
| | | case "RHMIOP2001": |
| | | case "RHMIOP303501": |
| | | case "RHMIOP5001": |
| | | case "RHMIOP6001": |
| | | HMI_WorkpieceReading.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(HMI_WorkpieceReading.Instance); |
| | | break; |
| | | case "WHMIOP104002": |
| | | case "WHMIOP2002": |
| | | case "WHMIOP303502": |
| | | case "WHMIOP5002": |
| | | case "WHMIOP6002": |
| | | HMI_WorkpieceWrite.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(HMI_WorkpieceWrite.Instance); |
| | | break; |
| | | #endregion |
| | | case "OP0501": |
| | | DataCaptureHandler_OP0501.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP0501.Instance); |
| | | break; |
| | | case "OP2001": |
| | | DataCaptureHandler_OP2001.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP2001.Instance); |
| | | break; |
| | | #region OP30 |
| | | case "OP3001": |
| | | DataCaptureHandler_OP3001.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3001.Instance); |
| | | break; |
| | | case "OP3002": |
| | | DataCaptureHandler_OP3002.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3002.Instance); |
| | | break; |
| | | case "OP3003": |
| | | DataCaptureHandler_OP3003.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3003.Instance); |
| | | break; |
| | | case "OP3004": |
| | | DataCaptureHandler_OP3004.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3004.Instance); |
| | | break; |
| | | case "OP3005": |
| | | DataCaptureHandler_OP3005.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3005.Instance); |
| | | break; |
| | | case "OP3006": |
| | | DataCaptureHandler_OP3006.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3006.Instance); |
| | | break; |
| | | case "OP3007": |
| | | DataCaptureHandler_OP3007.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3007.Instance); |
| | | break; |
| | | #endregion |
| | | // switch (config.DataCapturePointCode) |
| | | // { |
| | | // #region HMI04 |
| | | // case "RHMIOP104001": |
| | | // case "RHMIOP2001": |
| | | // case "RHMIOP303501": |
| | | // case "RHMIOP5001": |
| | | // case "RHMIOP6001": |
| | | // HMI_WorkpieceReading.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(HMI_WorkpieceReading.Instance); |
| | | // break; |
| | | // case "WHMIOP104002": |
| | | // case "WHMIOP2002": |
| | | // case "WHMIOP303502": |
| | | // case "WHMIOP5002": |
| | | // case "WHMIOP6002": |
| | | // HMI_WorkpieceWrite.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(HMI_WorkpieceWrite.Instance); |
| | | // break; |
| | | // #endregion |
| | | // case "OP0501": |
| | | // DataCaptureHandler_OP0501.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP0501.Instance); |
| | | // break; |
| | | // case "OP2001": |
| | | // DataCaptureHandler_OP2001.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP2001.Instance); |
| | | // break; |
| | | // #region OP30 |
| | | // case "OP3001": |
| | | // DataCaptureHandler_OP3001.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3001.Instance); |
| | | // break; |
| | | // case "OP3002": |
| | | // DataCaptureHandler_OP3002.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3002.Instance); |
| | | // break; |
| | | // case "OP3003": |
| | | // DataCaptureHandler_OP3003.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3003.Instance); |
| | | // break; |
| | | // case "OP3004": |
| | | // DataCaptureHandler_OP3004.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3004.Instance); |
| | | // break; |
| | | // case "OP3005": |
| | | // DataCaptureHandler_OP3005.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3005.Instance); |
| | | // break; |
| | | // case "OP3006": |
| | | // DataCaptureHandler_OP3006.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3006.Instance); |
| | | // break; |
| | | // case "OP3007": |
| | | // DataCaptureHandler_OP3007.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3007.Instance); |
| | | // break; |
| | | // #endregion |
| | | |
| | | |
| | | #region OP35 |
| | | case "OP3501": |
| | | DataCaptureHandler_OP3501.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3501.Instance); |
| | | break; |
| | | case "OP3502": |
| | | DataCaptureHandler_OP3502.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3502.Instance); |
| | | break; |
| | | case "OP3503": |
| | | DataCaptureHandler_OP3503.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3503.Instance); |
| | | break; |
| | | case "OP3504": |
| | | DataCaptureHandler_OP3504.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3504.Instance); |
| | | break; |
| | | case "OP3505": |
| | | DataCaptureHandler_OP3505.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3505.Instance); |
| | | break; |
| | | case "OP3506": |
| | | DataCaptureHandler_OP3506.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3506.Instance); |
| | | break; |
| | | case "OP3507": |
| | | DataCaptureHandler_OP3507.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP3507.Instance); |
| | | break; |
| | | #endregion |
| | | // #region OP35 |
| | | // case "OP3501": |
| | | // DataCaptureHandler_OP3501.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3501.Instance); |
| | | // break; |
| | | // case "OP3502": |
| | | // /* |
| | | // DataCaptureHandler_OP3502.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3502.Instance); |
| | | // //*/ |
| | | // break; |
| | | // case "OP3503": |
| | | // DataCaptureHandler_OP3503.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3503.Instance); |
| | | // break; |
| | | // case "OP3504": |
| | | // DataCaptureHandler_OP3504.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3504.Instance); |
| | | // break; |
| | | // case "OP3505": |
| | | // DataCaptureHandler_OP3505.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3505.Instance); |
| | | // break; |
| | | // case "OP3506": |
| | | // DataCaptureHandler_OP3506.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3506.Instance); |
| | | // break; |
| | | // case "OP3507": |
| | | // DataCaptureHandler_OP3507.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP3507.Instance); |
| | | // break; |
| | | // #endregion |
| | | |
| | | #region OP80 |
| | | case "OP8001": |
| | | DataCaptureHandler_OP8001.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP8001.Instance); |
| | | break; |
| | | case "OP8002": |
| | | DataCaptureHandler_OP8002.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP8002.Instance); |
| | | break; |
| | | case "OP8003": |
| | | DataCaptureHandler_OP8003.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP8003.Instance); |
| | | break; |
| | | case "OP8004": |
| | | DataCaptureHandler_OP8004.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP8004.Instance); |
| | | break; |
| | | case "OP8005": |
| | | DataCaptureHandler_OP8005.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP8005.Instance); |
| | | break; |
| | | case "OP8006": |
| | | DataCaptureHandler_OP8006.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP8006.Instance); |
| | | break; |
| | | case "OP8007": |
| | | DataCaptureHandler_OP8007.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP8007.Instance); |
| | | break; |
| | | #endregion |
| | | // #region OP80 |
| | | // case "OP8001": |
| | | // DataCaptureHandler_OP8001.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP8001.Instance); |
| | | // break; |
| | | // case "OP8002": |
| | | // /* |
| | | // DataCaptureHandler_OP8002.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP8002.Instance); |
| | | // //*/ |
| | | // break; |
| | | // case "OP8003": |
| | | // DataCaptureHandler_OP8003.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP8003.Instance); |
| | | // break; |
| | | // case "OP8004": |
| | | // DataCaptureHandler_OP8004.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP8004.Instance); |
| | | // break; |
| | | // case "OP8005": |
| | | // DataCaptureHandler_OP8005.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP8005.Instance); |
| | | // break; |
| | | // case "OP8006": |
| | | // DataCaptureHandler_OP8006.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP8006.Instance); |
| | | // break; |
| | | // case "OP8007": |
| | | // DataCaptureHandler_OP8007.Instance._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(DataCaptureHandler_OP8007.Instance); |
| | | // break; |
| | | // #endregion |
| | | |
| | | } |
| | | } |
| | | #endregion |
| | | // } |
| | | // } |
| | | // #endregion |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "启动线程时----btn_StartUpAllThread_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "启动线程时----btn_StartUpAllThread_Click all报错:", ex); |
| | | //} |
| | | |
| | | //**/ |
| | | } |
| | | |
| | | private void button10_Click(object sender, EventArgs e) |
| | | { |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | if (!SystemValue.isStartedImitateModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | |
| | | private void button9_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP3001.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP3001.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button11_Click(object sender, EventArgs e) |
| | |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | if (!SystemValue.isStartedImitateModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP3002.Instance.DataCaptureStart(); |
| | | //DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | //DataCaptureHandler_OP3002.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP3003.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP3003.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button15_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP3007.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP3007.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button13_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP3004.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP3004.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button14_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP3005.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP3005.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button16_Click(object sender, EventArgs e) |
| | |
| | | { |
| | | |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP8001.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP8001.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button21_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP8002.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP8002.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button20_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP8003.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP8003.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button19_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP8004.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP8004.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button18_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP8005.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP8005.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | private void button17_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | | } |
| | | DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | DataCaptureHandler_OP8007.Instance.DataCaptureStart(); |
| | | //try |
| | | //{ |
| | | // if (!SystemValue.isStartedImitateModel) |
| | | // { |
| | | // MessageBox.Show("请点击调试模式按钮"); |
| | | // return; |
| | | // } |
| | | // DataCaptureHandler.WorkPieceID = textBox10.Text.Trim(); |
| | | // DataCaptureHandler_OP8007.Instance.DataCaptureStart(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MessageBox.Show($"模拟异常:{ex.Message}"); |
| | | // Log4NetHelper.WriteErrorLog(LogType.FormMain, "----button10_Click all报错:", ex); |
| | | //} |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | if (!SystemValue.isStartedImitateModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | |
| | | { |
| | | try |
| | | { |
| | | if (!SystemValue.isStartedModel) |
| | | if (!SystemValue.isStartedImitateModel) |
| | | { |
| | | MessageBox.Show("请点击调试模式按钮"); |
| | | return; |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 正式环境,使用该按钮启动线程!!!! |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void button24_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | |
| | | DataCaptureHandler_OP6002.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP6002.Instance); |
| | | break; |
| | | |
| | | #endregion |
| | | #region 03 NOOK推出 |
| | | |
| | |
| | | _dataCaptureHandler.Add(dc06); |
| | | break; |
| | | #endregion |
| | | |
| | | case "OP7009"://清洗机获取采集数据 |
| | | DataCaptureHandler_OP7009.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP7009.Instance); |
| | | break; |
| | | //#region 07 数采盒子告警采集 |
| | | |
| | | ////case "OP1007": |
| | |
| | | try |
| | | { |
| | | |
| | | var WorkingProcedure = "OP35"; |
| | | var EquipmentID = "EOP35"; |
| | | var DataCapturePointCode = "OP3502A"; |
| | | //var DataCapturePointCode = "OP3002CH3"; |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | wplog.WorkingProcedure = WorkingProcedure; |
| | | wplog.EquipmentID = EquipmentID; ; |
| | | wplog.Remarks = WorkingProcedure; |
| | | wplog.MonitoringPoint = DataCapturePointCode; |
| | | wplog.WorkPieceID = "DZ045L2309080100181A1A"; |
| | | wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.CreatedUserName = DataCapturePointCode; |
| | | wplog.UpdatedUserName = Environment.MachineName + "自动" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | wplog.IsDeleted = false; |
| | | wplog.QualityOP10To1 = "-500"; |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | //var WorkingProcedure = "OP35"; |
| | | //var EquipmentID = "EOP35"; |
| | | //var DataCapturePointCode = "OP3502A"; |
| | | ////var DataCapturePointCode = "OP3002CH3"; |
| | | //WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | //wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | | //wplog.WorkingProcedure = WorkingProcedure; |
| | | //wplog.EquipmentID = EquipmentID; ; |
| | | //wplog.Remarks = WorkingProcedure; |
| | | //wplog.MonitoringPoint = DataCapturePointCode; |
| | | //wplog.WorkPieceID = "DZ045L2309080100181A1A"; |
| | | //wplog.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | //wplog.CreatedUserName = DataCapturePointCode; |
| | | //wplog.UpdatedUserName = Environment.MachineName + "自动" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | //wplog.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | //wplog.IsDeleted = false; |
| | | //wplog.QualityOP10To1 = "-500"; |
| | | //WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | //string path = ConfigHelper.GetConfigString("OP30QualityDataForStation");//打码机打码二维码路径 |
| | | //if (string.IsNullOrEmpty(path)) |
| | |
| | | { |
| | | switch (config.DataCapturePointCode) |
| | | { |
| | | case "OP3002CH3": |
| | | //case "OP3002CH4": |
| | | //case "OP3002CH5": |
| | | //case "OP3002CH6": |
| | | DataCaptureHandler_02 dc02 = new DataCaptureHandler_02(); |
| | | dc02._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(dc02); |
| | | case "OP7009"://清洗机获取采集数据 |
| | | DataCaptureHandler_OP7009.Instance._dataCaptureConfig = config; |
| | | _dataCaptureHandler.Add(DataCaptureHandler_OP7009.Instance); |
| | | break; |
| | | //case "OP3002CH3": |
| | | // //case "OP3002CH4": |
| | | // //case "OP3002CH5": |
| | | // //case "OP3002CH6": |
| | | // DataCaptureHandler_02 dc02 = new DataCaptureHandler_02(); |
| | | // dc02._dataCaptureConfig = config; |
| | | // _dataCaptureHandler.Add(dc02); |
| | | // break; |
| | | //case "OP2002A": |
| | | // //case "OP2002B": |
| | | // //case "OP2002C": |