diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index 2db2a61..99e7578 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -1,12 +1,18 @@ using DataBlockHelper; using DataBlockHelper.DBHelpers; + +using DevExpress.XtraEditors.Filtering.Templates; + using Mesnac.Action.Base; using Mesnac.Controls.Base; using Mesnac.Controls.ChemicalWeighing; using Mesnac.Controls.Default; using Mesnac.Controls.Feeding; using Mesnac.Core.Service; +using Microsoft.Office.Interop.Excel; + using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -14,6 +20,8 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; + +using IAction = Mesnac.Action.Base.IAction; using Timer = System.Windows.Forms.Timer; namespace Mesnac.Action.ChemicalWeighing.MainDetailControl @@ -25,7 +33,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl DB2102Helper DB2102; DB2103Helper DB2103; DB2107Helper DB2107; - + ConcurrentDictionary conCurrentCache = new ConcurrentDictionary(); Timer timer; #region 控件声明 @@ -845,11 +853,8 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl Controls = GetAllControls(); SetControl(); - - - NewThread(); - - + + timer = new Timer(); timer.Interval = 1000; timer.Enabled = true; @@ -857,135 +862,245 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl } - private void NewThread() + + private void NewThreadDb2102() { - MesnacServiceManager.Instance.LoggingService.Info("开始"); + BU1ASF01_Set = DB2102.BU1ASF01.Set; + BU1BSF01_Set = DB2102.BU1BSF01.Set; + BU1CSF01_Set = DB2102.BU1CSF01.Set; + BU1DSF01_Set = DB2102.BU1DSF01.Set; + BU1ESF01_Set = DB2102.BU1ESF01.Set; + BU1FSF01_Set = DB2102.BU1FSF01.Set; + BU1GSF01_Set = DB2102.BU1GSF01.Set; + BU1HSF01_Set = DB2102.BU1HSF01.Set; + BU1ISF01_Set = DB2102.BU1ISF01.Set; + BU1JSF01_Set = DB2102.BU1JSF01.Set; + BU1KSF01_Set = DB2102.BU1KSF01.Set; + BU1LSF01_Set = DB2102.BU1LSF01.Set; + BU1MSF01_Set = DB2102.BU1MSF01.Set; + BU1NSF01_Set = DB2102.BU1NSF01.Set; + BU1OSF01_Set = DB2102.BU1OSF01.Set; + BU1BLT01_Set = DB2102.BU1BLT01.Set; + BU1BLT02_Set = DB2102.BU1BLT02.Set; + BU1BLT03_Set = DB2102.BU1BLT03.Set; + BU1BLT04_Set = DB2102.BU1BLT04.Set; + BU1BLT05_Set = DB2102.BU1BLT05.Set; + BU1BLT06_Set = DB2102.BU1BLT06.Set; + BU1BLT07_Set = DB2102.BU1BLT07.Set; + BU2BLT01_Set = DB2102.BU2BLT01.Set; + BU2BLT02_Set = DB2102.BU2BLT02.Set; + BU2BLT03_Set = DB2102.BU2BLT03.Set; + BU2BLT04_Set = DB2102.BU2BLT04.Set; + BU2BLT05_Set = DB2102.BU2BLT05.Set; + BU3BLT01_Set = DB2102.BU3BLT01.Set; + BU3BLT02_Set = DB2102.BU3BLT02.Set; + BU3BLT03_Set = DB2102.BU3BLT03.Set; + BU3BLT04_Set = DB2102.BU3BLT04.Set; + BU3BLT05_Set = DB2102.BU3BLT05.Set; + BU3BLT06_Set = DB2102.BU3BLT06.Set; + BU3BLT07_Set = DB2102.BU3BLT07.Set; + BU4BLT01_Set = DB2102.BU4BLT01.Set; + BU4BLT02_Set = DB2102.BU4BLT02.Set; + BU4BLT03_Set = DB2102.BU4BLT03.Set; + BU4BLT04_Set = DB2102.BU4BLT04.Set; + BU4BLT05_Set = DB2102.BU4BLT05.Set; + BU4BLT06_Set = DB2102.BU4BLT06.Set; + BU4BLT07_Set = DB2102.BU4BLT07.Set; + BU5BLT01_Set = DB2102.BU5BLT01.Set; + BU5BLT02_Set = DB2102.BU5BLT02.Set; + BU5BLT03_Set = DB2102.BU5BLT03.Set; + BU5BLT04_Set = DB2102.BU5BLT04.Set; + BU1ADB01_Set = DB2102.BU1ADB01.Set; + BU1BDB01_Set = DB2102.BU1BDB01.Set; + BU1CDB01_Set = DB2102.BU1CDB01.Set; + BU1DDB01_Set = DB2102.BU1DDB01.Set; + BU1EDB01_Set = DB2102.BU1EDB01.Set; + BU1FDB01_Set = DB2102.BU1FDB01.Set; + BU1GDB01_Set = DB2102.BU1GDB01.Set; + BU1HDB01_Set = DB2102.BU1HDB01.Set; + BU1IDB01_Set = DB2102.BU1IDB01.Set; + BU1JDB01_Set = DB2102.BU1JDB01.Set; + BU1KDB01_Set = DB2102.BU1KDB01.Set; + BU1LDB01_Set = DB2102.BU1LDB01.Set; - WatchDog_Set = DB2107.NormalStatus.WatchDog >= 1 ? true : false; - EMStop_Set = DB2107.NormalStatus.EMStop; - Vessel_1_HighLevel_Set = DB2107.Weight.Vessel_1.HighLevel; - Vessel_2_HighLevel_Set = DB2107.Weight.Vessel_2.HighLevel; - Vessel_3_HighLevel_Set = DB2107.Weight.Vessel_3.HighLevel; - Vessel_4_HighLevel_Set = DB2107.Weight.Vessel_4.HighLevel; - Vessel_5_HighLevel_Set = DB2107.Weight.Vessel_5.HighLevel; - Vessel_1_LowLevel_Set = DB2107.Weight.Vessel_1.Lowlevel; - Vessel_2_LowLevel_Set = DB2107.Weight.Vessel_2.Lowlevel; - Vessel_3_LowLevel_Set = DB2107.Weight.Vessel_3.Lowlevel; - Vessel_4_LowLevel_Set = DB2107.Weight.Vessel_4.Lowlevel; - Vessel_5_LowLevel_Set = DB2107.Weight.Vessel_5.Lowlevel; - highLevel_D1_Set = DB2107.Level.HighLevel_D1; - highLevel_D2_Set = DB2107.Level.HighLevel_D2; - highLevel_D3_Set = DB2107.Level.HighLevel_D3; - highLevel_D4_Set = DB2107.Level.HighLevel_D4; - highLevel_D5_Set = DB2107.Level.HighLevel_D5; - highLevel_D6_Set = DB2107.Level.HighLevel_D6; - highLevel_D7_Set = DB2107.Level.HighLevel_D7; - highLevel_D8_Set = DB2107.Level.HighLevel_D8; - highLevel_D9_Set = DB2107.Level.HighLevel_D9; - highLevel_D10_Set = DB2107.Level.HighLevel_D10; - highLevel_D11_Set = DB2107.Level.HighLevel_D11; - highLevel_D12_Set = DB2107.Level.HighLevel_D12; - lowLevel_D1_Set = DB2107.Level.LowLevel_D1; - lowLevel_D2_Set = DB2107.Level.LowLevel_D2; - lowLevel_D3_Set = DB2107.Level.LowLevel_D3; - lowLevel_D4_Set = DB2107.Level.LowLevel_D4; - lowLevel_D5_Set = DB2107.Level.LowLevel_D5; - lowLevel_D6_Set = DB2107.Level.LowLevel_D6; - lowLevel_D7_Set = DB2107.Level.LowLevel_D7; - lowLevel_D8_Set = DB2107.Level.LowLevel_D8; - lowLevel_D9_Set = DB2107.Level.LowLevel_D9; - lowLevel_D10_Set = DB2107.Level.LowLevel_D10; - lowLevel_D11_Set = DB2107.Level.LowLevel_D11; - lowLevel_D12_Set = DB2107.Level.LowLevel_D12; - Hopper_1_HighLevel_Set = DB2107.Weight.Hopper_1.HighLevel; - Hopper_2_HighLevel_Set = DB2107.Weight.Hopper_2.HighLevel; - Hopper_3_HighLevel_Set = DB2107.Weight.Hopper_3.HighLevel; - Hopper_4_HighLevel_Set = DB2107.Weight.Hopper_4.HighLevel; - Hopper_1_LowLevel_Set = DB2107.Weight.Hopper_1.Lowlevel; - Hopper_2_LowLevel_Set = DB2107.Weight.Hopper_2.Lowlevel; - Hopper_3_LowLevel_Set = DB2107.Weight.Hopper_3.Lowlevel; - Hopper_4_LowLevel_Set = DB2107.Weight.Hopper_4.Lowlevel; - WScale_1_HighLevel_Set = DB2107.Weight.WScale_1.HighLevel; - WScale_2_HighLevel_Set = DB2107.Weight.WScale_2.HighLevel; - WScale_3_HighLevel_Set = DB2107.Weight.WScale_3.HighLevel; - WScale_4_HighLevel_Set = DB2107.Weight.WScale_4.HighLevel; - WScale_1_LowLevel_Set = DB2107.Weight.WScale_1.Lowlevel; - WScale_2_LowLevel_Set = DB2107.Weight.WScale_2.Lowlevel; - WScale_3_LowLevel_Set = DB2107.Weight.WScale_3.Lowlevel; - WScale_4_LowLevel_Set = DB2107.Weight.WScale_4.Lowlevel; + BU1GEB02_Set = DB2102.BU1GEB02.Set; + BU2GEB02_Set = DB2102.BU2GEB02.Set; + BU3GEB02_Set = DB2102.BU3GEB02.Set; + BU4GEB02_Set = DB2102.BU4GEB02.Set; + BU5GEB02_Set = DB2102.BU5GEB02.Set; + BU6GEB02_Set = DB2102.BU6GEB02.Set; + BU7GEB02_Set = DB2102.BU7GEB02.Set; + BU8GEB02_Set = DB2102.BU8GEB02.Set; + BU1DRB01_Set = DB2102.BU1DRB01.Set; + BU2DRB01_Set = DB2102.BU2DRB01.Set; + BU3DRB01_Set = DB2102.BU3DRB01.Set; + BU4DRB01_Set = DB2102.BU4DRB01.Set; + BU1GEB01_Set = DB2102.BU1GEB01.Set; + BU2GEB01_Set = DB2102.BU2GEB01.Set; + BU3GEB01_Set = DB2102.BU3GEB01.Set; + BU4GEB01_Set = DB2102.BU4GEB01.Set; + BU5GEB01_Set = DB2102.BU5GEB01.Set; + BU6GEB01_Set = DB2102.BU6GEB01.Set; + BU7GEB01_Set = DB2102.BU7GEB01.Set; + BU8GEB01_Set = DB2102.BU8GEB01.Set; + BU2ASF01_Set = DB2102.BU2ASF01.Set; + BU2ASF02_Set = DB2102.BU2ASF02.Set; + BU2BSF01_Set = DB2102.BU2BSF01.Set; + BU2BSF02_Set = DB2102.BU2BSF02.Set; + BU2CSF01_Set = DB2102.BU2CSF01.Set; + BU2CSF02_Set = DB2102.BU2CSF02.Set; + BU2DSF01_Set = DB2102.BU2DSF01.Set; + BU2DSF02_Set = DB2102.BU2DSF02.Set; + BUWeter1_Set = DB2102.BUWeter1.Set; + BUWeter2_Set = DB2102.BUWeter2.Set; + BUWeter3_Set = DB2102.BUWeter3.Set; + BUWeter4_Set = DB2102.BUWeter4.Set; + BUWeter5_Set = DB2102.BUWeter5.Set; + BUWeter6_Set = DB2102.BUWeter6.Set; + BUWeter7_Set = DB2102.BUWeter7.Set; + BUWeter8_Set = DB2102.BUWeter8.Set; - topPressure_V1_Set = DB2107.Pressure.TopPressure_V1.ActualValue; - topPressure_V2_Set = DB2107.Pressure.TopPressure_V2.ActualValue; - topPressure_V3_Set = DB2107.Pressure.TopPressure_V3.ActualValue; - topPressure_V4_Set = DB2107.Pressure.TopPressure_V4.ActualValue; - topPressure_V5_Set = DB2107.Pressure.TopPressure_V5.ActualValue; - Vessel_1_ActWeight_Set = DB2107.Weight.Vessel_1.ActWeight; - Vessel_2_ActWeight_Set = DB2107.Weight.Vessel_2.ActWeight; - Vessel_3_ActWeight_Set = DB2107.Weight.Vessel_3.ActWeight; - Vessel_4_ActWeight_Set = DB2107.Weight.Vessel_4.ActWeight; - Vessel_5_ActWeight_Set = DB2107.Weight.Vessel_5.ActWeight; - conveyV1_PV_Set = DB2107.PID.Convey_V1.PV; - conveyV2_PV_Set = DB2107.PID.Convey_V2.PV; - conveyV3_PV_Set = DB2107.PID.Convey_V3.PV; - conveyV5_PV_Set = DB2107.PID.Convey_V5.PV; - mainPress_V1_ActualValue_Set = DB2107.Pressure.MainPress_V1.ActualValue; - mainPress_V2_ActualValue_Set = DB2107.Pressure.MainPress_V2.ActualValue; - mainPress_V3_ActualValue_Set = DB2107.Pressure.MainPress_V3.ActualValue; - mainPress_V5_ActualValue_Set = DB2107.Pressure.MainPress_V5.ActualValue; - purgeV1_PV_Set = DB2107.PID.Purge_V1.PV; - purgeV2_PV_Set = DB2107.PID.Purge_V2.PV; - purgeV3_PV_Set = DB2107.PID.Purge_V3.PV; - purgeV5_PV_Set = DB2107.PID.Purge_V5.PV; - WScale_1_ActWeight_Set = DB2107.Weight.WScale_1.ActWeight; - WScale_2_ActWeight_Set = DB2107.Weight.WScale_2.ActWeight; - WScale_3_ActWeight_Set = DB2107.Weight.WScale_3.ActWeight; - WScale_4_ActWeight_Set = DB2107.Weight.WScale_4.ActWeight; - DM1DRY1_ACT_Speed_Set = DB2103.DM1DRY1.ACT_Speed; - DM1DRY2_ACT_Speed_Set = DB2103.DM1DRY2.ACT_Speed; - DM1DRY3_ACT_Speed_Set = DB2103.DM1DRY3.ACT_Speed; - DM1DRY4_ACT_Speed_Set = DB2103.DM1DRY4.ACT_Speed; - Hopper_1_ActWeight_Set = DB2107.Weight.Hopper_1.ActWeight; - Hopper_2_ActWeight_Set = DB2107.Weight.Hopper_2.ActWeight; - Hopper_3_ActWeight_Set = DB2107.Weight.Hopper_3.ActWeight; - Hopper_4_ActWeight_Set = DB2107.Weight.Hopper_4.ActWeight; - DM1GEM_Set = DB2103.DM1GEM.ACT_Speed; - DM2GEM_Set = DB2103.DM2GEM.ACT_Speed; - DM3GEM_Set = DB2103.DM3GEM.ACT_Speed; - DM4GEM_Set = DB2103.DM4GEM.ACT_Speed; - DM5GEM_Set = DB2103.DM5GEM.ACT_Speed; - DM6GEM_Set = DB2103.DM6GEM.ACT_Speed; - DM7GEM_Set = DB2103.DM7GEM.ACT_Speed; - DM8GEM_Set = DB2103.DM8GEM.ACT_Speed; - DM2ASF01_Set = DB2103.DM2ASF01.ACT_Speed; - DM2BSF01_Set = DB2103.DM2BSF01.ACT_Speed; - DM2CSF01_Set = DB2103.DM2CSF01.ACT_Speed; - DM2DSF01_Set = DB2103.DM2DSF01.ACT_Speed; + BU1GEB02_Alarm = DB2102.BU1GEB02.Alarm; + BU2GEB02_Alarm = DB2102.BU2GEB02.Alarm; + BU3GEB02_Alarm = DB2102.BU3GEB02.Alarm; + BU4GEB02_Alarm = DB2102.BU4GEB02.Alarm; + BU5GEB02_Alarm = DB2102.BU5GEB02.Alarm; + BU6GEB02_Alarm = DB2102.BU6GEB02.Alarm; + BU7GEB02_Alarm = DB2102.BU7GEB02.Alarm; + BU8GEB02_Alarm = DB2102.BU8GEB02.Alarm; + BU1DRB01_Alarm = DB2102.BU1DRB01.Alarm; + BU2DRB01_Alarm = DB2102.BU2DRB01.Alarm; + BU3DRB01_Alarm = DB2102.BU3DRB01.Alarm; + BU4DRB01_Alarm = DB2102.BU4DRB01.Alarm; + BU1GEB01_Alarm = DB2102.BU1GEB01.Alarm; + BU2GEB01_Alarm = DB2102.BU2GEB01.Alarm; + BU3GEB01_Alarm = DB2102.BU3GEB01.Alarm; + BU4GEB01_Alarm = DB2102.BU4GEB01.Alarm; + BU5GEB01_Alarm = DB2102.BU5GEB01.Alarm; + BU6GEB01_Alarm = DB2102.BU6GEB01.Alarm; + BU7GEB01_Alarm = DB2102.BU7GEB01.Alarm; + BU8GEB01_Alarm = DB2102.BU8GEB01.Alarm; + BU2ASF01_Alarm = DB2102.BU2ASF01.Alarm; + BU2ASF02_Alarm = DB2102.BU2ASF02.Alarm; + BU2BSF01_Alarm = DB2102.BU2BSF01.Alarm; + BU2BSF02_Alarm = DB2102.BU2BSF02.Alarm; + BU2CSF01_Alarm = DB2102.BU2CSF01.Alarm; + BU2CSF02_Alarm = DB2102.BU2CSF02.Alarm; + BU2DSF01_Alarm = DB2102.BU2DSF01.Alarm; + BU2DSF02_Alarm = DB2102.BU2DSF02.Alarm; + BUWeter1_Alarm = DB2102.BUWeter1.Alarm; + BUWeter2_Alarm = DB2102.BUWeter2.Alarm; + BUWeter3_Alarm = DB2102.BUWeter3.Alarm; + BUWeter4_Alarm = DB2102.BUWeter4.Alarm; + BUWeter5_Alarm = DB2102.BUWeter5.Alarm; + BUWeter6_Alarm = DB2102.BUWeter6.Alarm; + BUWeter7_Alarm = DB2102.BUWeter7.Alarm; + BUWeter8_Alarm = DB2102.BUWeter8.Alarm; - DM1ASF01_Set = DB2103.DM1ASF01.Run; - DM1BSF01_Set = DB2103.DM1BSF01.Run; - DM1CSF01_Set = DB2103.DM1CSF01.Run; - DM1DSF01_Set = DB2103.DM1DSF01.Run; - DM1ESF01_Set = DB2103.DM1ESF01.Run; - DM1FSF01_Set = DB2103.DM1FSF01.Run; - DM1GSF01_Set = DB2103.DM1GSF01.Run; - DM1HSF01_Set = DB2103.DM1HSF01.Run; - DM1ISF01_Set = DB2103.DM1ISF01.Run; - DM1JSF01_Set = DB2103.DM1JSF01.Run; - DM1KSF01_Set = DB2103.DM1KSF01.Run; - DM1LSF01_Set = DB2103.DM1LSF01.Run; - DM1MSF01_Set = DB2103.DM1MSF01.Run; - DM1NSF01_Set = DB2103.DM1NSF01.Run; - DM1OSF01_Set = DB2103.DM1OSF01.Running; - if (DB2103.DM2ASF01.Running) - { - if (DB2103.DM2ASF01.Polarity) - { - DM2ASF01L_Set = true; - DM2ASF01R_Set = false; - } - else + + DV2PCP01_SetL = DB2102.DV2PCP01.SetLeft; + DV2PCP02_SetL = DB2102.DV2PCP02.SetLeft; + DV2PCP03_SetL = DB2102.DV2PCP03.SetLeft; + DV2PCP04_SetL = DB2102.DV2PCP04.SetLeft; + DV2PCP05_SetL = DB2102.DV2PCP05.SetLeft; + DV2PCP06_SetL = DB2102.DV2PCP06.SetLeft; + DV2PCP07_SetL = DB2102.DV2PCP07.SetLeft; + DV2PCP08_SetL = DB2102.DV2PCP08.SetLeft; + DV2PCP09_SetL = DB2102.DV2PCP09.SetLeft; + DV2PCP10_SetL = DB2102.DV2PCP10.SetLeft; + DV2PCP11_SetL = DB2102.DV2PCP11.SetLeft; + DV2PCP12_SetL = DB2102.DV2PCP12.SetLeft; + DV2PCP13_SetL = DB2102.DV2PCP13.SetLeft; + + DV2PCP01_SetR = DB2102.DV2PCP01.SetRight; + DV2PCP02_SetR = DB2102.DV2PCP02.SetRight; + DV2PCP03_SetR = DB2102.DV2PCP03.SetRight; + DV2PCP04_SetR = DB2102.DV2PCP04.SetRight; + DV2PCP05_SetR = DB2102.DV2PCP05.SetRight; + DV2PCP06_SetR = DB2102.DV2PCP06.SetRight; + DV2PCP07_SetR = DB2102.DV2PCP07.SetRight; + DV2PCP08_SetR = DB2102.DV2PCP08.SetRight; + DV2PCP09_SetR = DB2102.DV2PCP09.SetRight; + DV2PCP10_SetR = DB2102.DV2PCP10.SetRight; + DV2PCP11_SetR = DB2102.DV2PCP11.SetRight; + DV2PCP12_SetR = DB2102.DV2PCP12.SetRight; + DV2PCP13_SetR = DB2102.DV2PCP13.SetRight; + + DV2PCP01_AlarmL = DB2102.DV2PCP01.AlarmLeftPosition; + DV2PCP02_AlarmL = DB2102.DV2PCP02.AlarmLeftPosition; + DV2PCP03_AlarmL = DB2102.DV2PCP03.AlarmLeftPosition; + DV2PCP04_AlarmL = DB2102.DV2PCP04.AlarmLeftPosition; + DV2PCP05_AlarmL = DB2102.DV2PCP05.AlarmLeftPosition; + DV2PCP06_AlarmL = DB2102.DV2PCP06.AlarmLeftPosition; + DV2PCP07_AlarmL = DB2102.DV2PCP07.AlarmLeftPosition; + DV2PCP08_AlarmL = DB2102.DV2PCP08.AlarmLeftPosition; + DV2PCP09_AlarmL = DB2102.DV2PCP09.AlarmLeftPosition; + DV2PCP10_AlarmL = DB2102.DV2PCP10.AlarmLeftPosition; + DV2PCP11_AlarmL = DB2102.DV2PCP11.AlarmLeftPosition; + DV2PCP12_AlarmL = DB2102.DV2PCP12.AlarmLeftPosition; + DV2PCP13_AlarmL = DB2102.DV2PCP13.AlarmLeftPosition; + + DV2PCP01_AlarmR = DB2102.DV2PCP01.AlarmRightPosition; + DV2PCP02_AlarmR = DB2102.DV2PCP02.AlarmRightPosition; + DV2PCP03_AlarmR = DB2102.DV2PCP03.AlarmRightPosition; + DV2PCP04_AlarmR = DB2102.DV2PCP04.AlarmRightPosition; + DV2PCP05_AlarmR = DB2102.DV2PCP05.AlarmRightPosition; + DV2PCP06_AlarmR = DB2102.DV2PCP06.AlarmRightPosition; + DV2PCP07_AlarmR = DB2102.DV2PCP07.AlarmRightPosition; + DV2PCP08_AlarmR = DB2102.DV2PCP08.AlarmRightPosition; + DV2PCP09_AlarmR = DB2102.DV2PCP09.AlarmRightPosition; + DV2PCP10_AlarmR = DB2102.DV2PCP10.AlarmRightPosition; + DV2PCP11_AlarmR = DB2102.DV2PCP11.AlarmRightPosition; + DV2PCP12_AlarmR = DB2102.DV2PCP12.AlarmRightPosition; + DV2PCP13_AlarmR = DB2102.DV2PCP13.AlarmRightPosition; + } + + private void NewThreadDb2103() + { + DM1DRY1_ACT_Speed_Set = DB2103.DM1DRY1.ACT_Speed; + DM1DRY2_ACT_Speed_Set = DB2103.DM1DRY2.ACT_Speed; + DM1DRY3_ACT_Speed_Set = DB2103.DM1DRY3.ACT_Speed; + DM1DRY4_ACT_Speed_Set = DB2103.DM1DRY4.ACT_Speed; + + DM1GEM_Set = DB2103.DM1GEM.ACT_Speed; + DM2GEM_Set = DB2103.DM2GEM.ACT_Speed; + DM3GEM_Set = DB2103.DM3GEM.ACT_Speed; + DM4GEM_Set = DB2103.DM4GEM.ACT_Speed; + DM5GEM_Set = DB2103.DM5GEM.ACT_Speed; + DM6GEM_Set = DB2103.DM6GEM.ACT_Speed; + DM7GEM_Set = DB2103.DM7GEM.ACT_Speed; + DM8GEM_Set = DB2103.DM8GEM.ACT_Speed; + DM2ASF01_Set = DB2103.DM2ASF01.ACT_Speed; + DM2BSF01_Set = DB2103.DM2BSF01.ACT_Speed; + DM2CSF01_Set = DB2103.DM2CSF01.ACT_Speed; + DM2DSF01_Set = DB2103.DM2DSF01.ACT_Speed; + + DM1ASF01_Set = DB2103.DM1ASF01.Run; + DM1BSF01_Set = DB2103.DM1BSF01.Run; + DM1CSF01_Set = DB2103.DM1CSF01.Run; + DM1DSF01_Set = DB2103.DM1DSF01.Run; + DM1ESF01_Set = DB2103.DM1ESF01.Run; + DM1FSF01_Set = DB2103.DM1FSF01.Run; + DM1GSF01_Set = DB2103.DM1GSF01.Run; + DM1HSF01_Set = DB2103.DM1HSF01.Run; + DM1ISF01_Set = DB2103.DM1ISF01.Run; + DM1JSF01_Set = DB2103.DM1JSF01.Run; + DM1KSF01_Set = DB2103.DM1KSF01.Run; + DM1LSF01_Set = DB2103.DM1LSF01.Run; + DM1MSF01_Set = DB2103.DM1MSF01.Run; + DM1NSF01_Set = DB2103.DM1NSF01.Run; + DM1OSF01_Set = DB2103.DM1OSF01.Running; + + if (DB2103.DM2ASF01.Running) + { + if (DB2103.DM2ASF01.Polarity) + { + DM2ASF01L_Set = true; + DM2ASF01R_Set = false; + } + else { DM2ASF01L_Set = false; DM2ASF01R_Set = true; @@ -1054,6 +1169,123 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl DM2DSF01R_Set = false; } + DM1ADF01_Set = DB2103.DM1ADF01.Run; + DM1BDF01_Set = DB2103.DM1BDF01.Run; + DM1CDF01_Set = DB2103.DM1CDF01.Run; + DM1DDF01_Set = DB2103.DM1DDF01.Run; + DM1EDF01_Set = DB2103.DM1EDF01.Run; + DM1FDF01_Set = DB2103.DM1FDF01.Run; + DM1GDF01_Set = DB2103.DM1GDF01.Run; + DM1HDF01_Set = DB2103.DM1HDF01.Run; + DM1IDF01_Set = DB2103.DM1IDF01.Run; + DM1JDF01_Set = DB2103.DM1JDF01.Run; + DM1KDF01_Set = DB2103.DM1KDF01.Run; + DM1LDF01_Set = DB2103.DM1LDF01.Run; + DM1ADB01_Set = DB2103.DM1ADB01.Run; + DM1BDB01_Set = DB2103.DM1BDB01.Run; + DM1CDB01_Set = DB2103.DM1CDB01.Run; + DM1DDB01_Set = DB2103.DM1DDB01.Run; + DM1EDB01_Set = DB2103.DM1EDB01.Run; + DM1FDB01_Set = DB2103.DM1FDB01.Run; + DM1GDB01_Set = DB2103.DM1GDB01.Run; + DM1HDB01_Set = DB2103.DM1HDB01.Run; + DM1IDB01_Set = DB2103.DM1IDB01.Run; + DM1JDB01_Set = DB2103.DM1JDB01.Run; + DM1KDB01_Set = DB2103.DM1KDB01.Run; + DM1LDB01_Set = DB2103.DM1LDB01.Run; + DM1DRY1_Running_Set = DB2103.DM1DRY1.Running; + DM1DRY2_Running_Set = DB2103.DM1DRY2.Running; + DM1DRY3_Running_Set = DB2103.DM1DRY3.Running; + DM1DRY4_Running_Set = DB2103.DM1DRY4.Running; + + } + + + private void NewThreadDb2107() + { + WatchDog_Set = DB2107.NormalStatus.WatchDog >= 1 ? true : false; + EMStop_Set = DB2107.NormalStatus.EMStop; + + Vessel_1_HighLevel_Set = DB2107.Weight.Vessel_1.HighLevel; + Vessel_2_HighLevel_Set = DB2107.Weight.Vessel_2.HighLevel; + Vessel_3_HighLevel_Set = DB2107.Weight.Vessel_3.HighLevel; + Vessel_4_HighLevel_Set = DB2107.Weight.Vessel_4.HighLevel; + Vessel_5_HighLevel_Set = DB2107.Weight.Vessel_5.HighLevel; + Vessel_1_LowLevel_Set = DB2107.Weight.Vessel_1.Lowlevel; + Vessel_2_LowLevel_Set = DB2107.Weight.Vessel_2.Lowlevel; + Vessel_3_LowLevel_Set = DB2107.Weight.Vessel_3.Lowlevel; + Vessel_4_LowLevel_Set = DB2107.Weight.Vessel_4.Lowlevel; + Vessel_5_LowLevel_Set = DB2107.Weight.Vessel_5.Lowlevel; + highLevel_D1_Set = DB2107.Level.HighLevel_D1; + highLevel_D2_Set = DB2107.Level.HighLevel_D2; + highLevel_D3_Set = DB2107.Level.HighLevel_D3; + highLevel_D4_Set = DB2107.Level.HighLevel_D4; + highLevel_D5_Set = DB2107.Level.HighLevel_D5; + highLevel_D6_Set = DB2107.Level.HighLevel_D6; + highLevel_D7_Set = DB2107.Level.HighLevel_D7; + highLevel_D8_Set = DB2107.Level.HighLevel_D8; + highLevel_D9_Set = DB2107.Level.HighLevel_D9; + highLevel_D10_Set = DB2107.Level.HighLevel_D10; + highLevel_D11_Set = DB2107.Level.HighLevel_D11; + highLevel_D12_Set = DB2107.Level.HighLevel_D12; + lowLevel_D1_Set = DB2107.Level.LowLevel_D1; + lowLevel_D2_Set = DB2107.Level.LowLevel_D2; + lowLevel_D3_Set = DB2107.Level.LowLevel_D3; + lowLevel_D4_Set = DB2107.Level.LowLevel_D4; + lowLevel_D5_Set = DB2107.Level.LowLevel_D5; + lowLevel_D6_Set = DB2107.Level.LowLevel_D6; + lowLevel_D7_Set = DB2107.Level.LowLevel_D7; + lowLevel_D8_Set = DB2107.Level.LowLevel_D8; + lowLevel_D9_Set = DB2107.Level.LowLevel_D9; + lowLevel_D10_Set = DB2107.Level.LowLevel_D10; + lowLevel_D11_Set = DB2107.Level.LowLevel_D11; + lowLevel_D12_Set = DB2107.Level.LowLevel_D12; + Hopper_1_HighLevel_Set = DB2107.Weight.Hopper_1.HighLevel; + Hopper_2_HighLevel_Set = DB2107.Weight.Hopper_2.HighLevel; + Hopper_3_HighLevel_Set = DB2107.Weight.Hopper_3.HighLevel; + Hopper_4_HighLevel_Set = DB2107.Weight.Hopper_4.HighLevel; + Hopper_1_LowLevel_Set = DB2107.Weight.Hopper_1.Lowlevel; + Hopper_2_LowLevel_Set = DB2107.Weight.Hopper_2.Lowlevel; + Hopper_3_LowLevel_Set = DB2107.Weight.Hopper_3.Lowlevel; + Hopper_4_LowLevel_Set = DB2107.Weight.Hopper_4.Lowlevel; + WScale_1_HighLevel_Set = DB2107.Weight.WScale_1.HighLevel; + WScale_2_HighLevel_Set = DB2107.Weight.WScale_2.HighLevel; + WScale_3_HighLevel_Set = DB2107.Weight.WScale_3.HighLevel; + WScale_4_HighLevel_Set = DB2107.Weight.WScale_4.HighLevel; + WScale_1_LowLevel_Set = DB2107.Weight.WScale_1.Lowlevel; + WScale_2_LowLevel_Set = DB2107.Weight.WScale_2.Lowlevel; + WScale_3_LowLevel_Set = DB2107.Weight.WScale_3.Lowlevel; + WScale_4_LowLevel_Set = DB2107.Weight.WScale_4.Lowlevel; + + topPressure_V1_Set = DB2107.Pressure.TopPressure_V1.ActualValue; + topPressure_V2_Set = DB2107.Pressure.TopPressure_V2.ActualValue; + topPressure_V3_Set = DB2107.Pressure.TopPressure_V3.ActualValue; + topPressure_V4_Set = DB2107.Pressure.TopPressure_V4.ActualValue; + topPressure_V5_Set = DB2107.Pressure.TopPressure_V5.ActualValue; + Vessel_1_ActWeight_Set = DB2107.Weight.Vessel_1.ActWeight; + Vessel_2_ActWeight_Set = DB2107.Weight.Vessel_2.ActWeight; + Vessel_3_ActWeight_Set = DB2107.Weight.Vessel_3.ActWeight; + Vessel_4_ActWeight_Set = DB2107.Weight.Vessel_4.ActWeight; + Vessel_5_ActWeight_Set = DB2107.Weight.Vessel_5.ActWeight; + conveyV1_PV_Set = DB2107.PID.Convey_V1.PV; + conveyV2_PV_Set = DB2107.PID.Convey_V2.PV; + conveyV3_PV_Set = DB2107.PID.Convey_V3.PV; + conveyV5_PV_Set = DB2107.PID.Convey_V5.PV; + mainPress_V1_ActualValue_Set = DB2107.Pressure.MainPress_V1.ActualValue; + mainPress_V2_ActualValue_Set = DB2107.Pressure.MainPress_V2.ActualValue; + mainPress_V3_ActualValue_Set = DB2107.Pressure.MainPress_V3.ActualValue; + mainPress_V5_ActualValue_Set = DB2107.Pressure.MainPress_V5.ActualValue; + purgeV1_PV_Set = DB2107.PID.Purge_V1.PV; + purgeV2_PV_Set = DB2107.PID.Purge_V2.PV; + purgeV3_PV_Set = DB2107.PID.Purge_V3.PV; + purgeV5_PV_Set = DB2107.PID.Purge_V5.PV; + WScale_1_ActWeight_Set = DB2107.Weight.WScale_1.ActWeight; + WScale_2_ActWeight_Set = DB2107.Weight.WScale_2.ActWeight; + WScale_3_ActWeight_Set = DB2107.Weight.WScale_3.ActWeight; + WScale_4_ActWeight_Set = DB2107.Weight.WScale_4.ActWeight; + + + AS1BLT01_Set = DB2107.Valve.AS1BLT01; AS1BLT02_Set = DB2107.Valve.AS1BLT02; AS1BLT03_Set = DB2107.Valve.AS1BLT03; @@ -1108,34 +1340,6 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl AS8GET01_Set = DB2107.Valve.AS8GET01; AS8GET02_Set = DB2107.Valve.AS8GET02; - DM1ADF01_Set = DB2103.DM1ADF01.Run; - DM1BDF01_Set = DB2103.DM1BDF01.Run; - DM1CDF01_Set = DB2103.DM1CDF01.Run; - DM1DDF01_Set = DB2103.DM1DDF01.Run; - DM1EDF01_Set = DB2103.DM1EDF01.Run; - DM1FDF01_Set = DB2103.DM1FDF01.Run; - DM1GDF01_Set = DB2103.DM1GDF01.Run; - DM1HDF01_Set = DB2103.DM1HDF01.Run; - DM1IDF01_Set = DB2103.DM1IDF01.Run; - DM1JDF01_Set = DB2103.DM1JDF01.Run; - DM1KDF01_Set = DB2103.DM1KDF01.Run; - DM1LDF01_Set = DB2103.DM1LDF01.Run; - DM1ADB01_Set = DB2103.DM1ADB01.Run; - DM1BDB01_Set = DB2103.DM1BDB01.Run; - DM1CDB01_Set = DB2103.DM1CDB01.Run; - DM1DDB01_Set = DB2103.DM1DDB01.Run; - DM1EDB01_Set = DB2103.DM1EDB01.Run; - DM1FDB01_Set = DB2103.DM1FDB01.Run; - DM1GDB01_Set = DB2103.DM1GDB01.Run; - DM1HDB01_Set = DB2103.DM1HDB01.Run; - DM1IDB01_Set = DB2103.DM1IDB01.Run; - DM1JDB01_Set = DB2103.DM1JDB01.Run; - DM1KDB01_Set = DB2103.DM1KDB01.Run; - DM1LDB01_Set = DB2103.DM1LDB01.Run; - DM1DRY1_Running_Set = DB2103.DM1DRY1.Running; - DM1DRY2_Running_Set = DB2103.DM1DRY2.Running; - DM1DRY3_Running_Set = DB2103.DM1DRY3.Running; - DM1DRY4_Running_Set = DB2103.DM1DRY4.Running; PM1ADF01_Set = DB2107.Valve.PM1ADF01; PM1BDF01_Set = DB2107.Valve.PM1BDF01; @@ -1149,201 +1353,45 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl PM1JDF01_Set = DB2107.Valve.PM1JDF01; PM1KDF01_Set = DB2107.Valve.PM1KDF01; PM1LDF01_Set = DB2107.Valve.PM1LDF01; + } - BU1ASF01_Set = DB2102.BU1ASF01.Set; - BU1BSF01_Set = DB2102.BU1BSF01.Set; - BU1CSF01_Set = DB2102.BU1CSF01.Set; - BU1DSF01_Set = DB2102.BU1DSF01.Set; - BU1ESF01_Set = DB2102.BU1ESF01.Set; - BU1FSF01_Set = DB2102.BU1FSF01.Set; - BU1GSF01_Set = DB2102.BU1GSF01.Set; - BU1HSF01_Set = DB2102.BU1HSF01.Set; - BU1ISF01_Set = DB2102.BU1ISF01.Set; - BU1JSF01_Set = DB2102.BU1JSF01.Set; - BU1KSF01_Set = DB2102.BU1KSF01.Set; - BU1LSF01_Set = DB2102.BU1LSF01.Set; - BU1MSF01_Set = DB2102.BU1MSF01.Set; - BU1NSF01_Set = DB2102.BU1NSF01.Set; - BU1OSF01_Set = DB2102.BU1OSF01.Set; - BU1BLT01_Set = DB2102.BU1BLT01.Set; - BU1BLT02_Set = DB2102.BU1BLT02.Set; - BU1BLT03_Set = DB2102.BU1BLT03.Set; - BU1BLT04_Set = DB2102.BU1BLT04.Set; - BU1BLT05_Set = DB2102.BU1BLT05.Set; - BU1BLT06_Set = DB2102.BU1BLT06.Set; - BU1BLT07_Set = DB2102.BU1BLT07.Set; - BU2BLT01_Set = DB2102.BU2BLT01.Set; - BU2BLT02_Set = DB2102.BU2BLT02.Set; - BU2BLT03_Set = DB2102.BU2BLT03.Set; - BU2BLT04_Set = DB2102.BU2BLT04.Set; - BU2BLT05_Set = DB2102.BU2BLT05.Set; - BU3BLT01_Set = DB2102.BU3BLT01.Set; - BU3BLT02_Set = DB2102.BU3BLT02.Set; - BU3BLT03_Set = DB2102.BU3BLT03.Set; - BU3BLT04_Set = DB2102.BU3BLT04.Set; - BU3BLT05_Set = DB2102.BU3BLT05.Set; - BU3BLT06_Set = DB2102.BU3BLT06.Set; - BU3BLT07_Set = DB2102.BU3BLT07.Set; - BU4BLT01_Set = DB2102.BU4BLT01.Set; - BU4BLT02_Set = DB2102.BU4BLT02.Set; - BU4BLT03_Set = DB2102.BU4BLT03.Set; - BU4BLT04_Set = DB2102.BU4BLT04.Set; - BU4BLT05_Set = DB2102.BU4BLT05.Set; - BU4BLT06_Set = DB2102.BU4BLT06.Set; - BU4BLT07_Set = DB2102.BU4BLT07.Set; - BU5BLT01_Set = DB2102.BU5BLT01.Set; - BU5BLT02_Set = DB2102.BU5BLT02.Set; - BU5BLT03_Set = DB2102.BU5BLT03.Set; - BU5BLT04_Set = DB2102.BU5BLT04.Set; - BU1ADB01_Set = DB2102.BU1ADB01.Set; - BU1BDB01_Set = DB2102.BU1BDB01.Set; - BU1CDB01_Set = DB2102.BU1CDB01.Set; - BU1DDB01_Set = DB2102.BU1DDB01.Set; - BU1EDB01_Set = DB2102.BU1EDB01.Set; - BU1FDB01_Set = DB2102.BU1FDB01.Set; - BU1GDB01_Set = DB2102.BU1GDB01.Set; - BU1HDB01_Set = DB2102.BU1HDB01.Set; - BU1IDB01_Set = DB2102.BU1IDB01.Set; - BU1JDB01_Set = DB2102.BU1JDB01.Set; - BU1KDB01_Set = DB2102.BU1KDB01.Set; - BU1LDB01_Set = DB2102.BU1LDB01.Set; - - - BU1GEB02_Set = DB2102.BU1GEB02.Set; - BU2GEB02_Set = DB2102.BU2GEB02.Set; - BU3GEB02_Set = DB2102.BU3GEB02.Set; - BU4GEB02_Set = DB2102.BU4GEB02.Set; - BU5GEB02_Set = DB2102.BU5GEB02.Set; - BU6GEB02_Set = DB2102.BU6GEB02.Set; - BU7GEB02_Set = DB2102.BU7GEB02.Set; - BU8GEB02_Set = DB2102.BU8GEB02.Set; - BU1DRB01_Set = DB2102.BU1DRB01.Set; - BU2DRB01_Set = DB2102.BU2DRB01.Set; - BU3DRB01_Set = DB2102.BU3DRB01.Set; - BU4DRB01_Set = DB2102.BU4DRB01.Set; - BU1GEB01_Set = DB2102.BU1GEB01.Set; - BU2GEB01_Set = DB2102.BU2GEB01.Set; - BU3GEB01_Set = DB2102.BU3GEB01.Set; - BU4GEB01_Set = DB2102.BU4GEB01.Set; - BU5GEB01_Set = DB2102.BU5GEB01.Set; - BU6GEB01_Set = DB2102.BU6GEB01.Set; - BU7GEB01_Set = DB2102.BU7GEB01.Set; - BU8GEB01_Set = DB2102.BU8GEB01.Set; - BU2ASF01_Set = DB2102.BU2ASF01.Set; - BU2ASF02_Set = DB2102.BU2ASF02.Set; - BU2BSF01_Set = DB2102.BU2BSF01.Set; - BU2BSF02_Set = DB2102.BU2BSF02.Set; - BU2CSF01_Set = DB2102.BU2CSF01.Set; - BU2CSF02_Set = DB2102.BU2CSF02.Set; - BU2DSF01_Set = DB2102.BU2DSF01.Set; - BU2DSF02_Set = DB2102.BU2DSF02.Set; - BUWeter1_Set = DB2102.BUWeter1.Set; - BUWeter2_Set = DB2102.BUWeter2.Set; - BUWeter3_Set = DB2102.BUWeter3.Set; - BUWeter4_Set = DB2102.BUWeter4.Set; - BUWeter5_Set = DB2102.BUWeter5.Set; - BUWeter6_Set = DB2102.BUWeter6.Set; - BUWeter7_Set = DB2102.BUWeter7.Set; - BUWeter8_Set = DB2102.BUWeter8.Set; - - BU1GEB02_Alarm = DB2102.BU1GEB02.Alarm; - BU2GEB02_Alarm = DB2102.BU2GEB02.Alarm; - BU3GEB02_Alarm = DB2102.BU3GEB02.Alarm; - BU4GEB02_Alarm = DB2102.BU4GEB02.Alarm; - BU5GEB02_Alarm = DB2102.BU5GEB02.Alarm; - BU6GEB02_Alarm = DB2102.BU6GEB02.Alarm; - BU7GEB02_Alarm = DB2102.BU7GEB02.Alarm; - BU8GEB02_Alarm = DB2102.BU8GEB02.Alarm; - BU1DRB01_Alarm = DB2102.BU1DRB01.Alarm; - BU2DRB01_Alarm = DB2102.BU2DRB01.Alarm; - BU3DRB01_Alarm = DB2102.BU3DRB01.Alarm; - BU4DRB01_Alarm = DB2102.BU4DRB01.Alarm; - BU1GEB01_Alarm = DB2102.BU1GEB01.Alarm; - BU2GEB01_Alarm = DB2102.BU2GEB01.Alarm; - BU3GEB01_Alarm = DB2102.BU3GEB01.Alarm; - BU4GEB01_Alarm = DB2102.BU4GEB01.Alarm; - BU5GEB01_Alarm = DB2102.BU5GEB01.Alarm; - BU6GEB01_Alarm = DB2102.BU6GEB01.Alarm; - BU7GEB01_Alarm = DB2102.BU7GEB01.Alarm; - BU8GEB01_Alarm = DB2102.BU8GEB01.Alarm; - BU2ASF01_Alarm = DB2102.BU2ASF01.Alarm; - BU2ASF02_Alarm = DB2102.BU2ASF02.Alarm; - BU2BSF01_Alarm = DB2102.BU2BSF01.Alarm; - BU2BSF02_Alarm = DB2102.BU2BSF02.Alarm; - BU2CSF01_Alarm = DB2102.BU2CSF01.Alarm; - BU2CSF02_Alarm = DB2102.BU2CSF02.Alarm; - BU2DSF01_Alarm = DB2102.BU2DSF01.Alarm; - BU2DSF02_Alarm = DB2102.BU2DSF02.Alarm; - BUWeter1_Alarm = DB2102.BUWeter1.Alarm; - BUWeter2_Alarm = DB2102.BUWeter2.Alarm; - BUWeter3_Alarm = DB2102.BUWeter3.Alarm; - BUWeter4_Alarm = DB2102.BUWeter4.Alarm; - BUWeter5_Alarm = DB2102.BUWeter5.Alarm; - BUWeter6_Alarm = DB2102.BUWeter6.Alarm; - BUWeter7_Alarm = DB2102.BUWeter7.Alarm; - BUWeter8_Alarm = DB2102.BUWeter8.Alarm; - - - - DV2PCP01_SetL = DB2102.DV2PCP01.SetLeft; - DV2PCP02_SetL = DB2102.DV2PCP02.SetLeft; - DV2PCP03_SetL = DB2102.DV2PCP03.SetLeft; - DV2PCP04_SetL = DB2102.DV2PCP04.SetLeft; - DV2PCP05_SetL = DB2102.DV2PCP05.SetLeft; - DV2PCP06_SetL = DB2102.DV2PCP06.SetLeft; - DV2PCP07_SetL = DB2102.DV2PCP07.SetLeft; - DV2PCP08_SetL = DB2102.DV2PCP08.SetLeft; - DV2PCP09_SetL = DB2102.DV2PCP09.SetLeft; - DV2PCP10_SetL = DB2102.DV2PCP10.SetLeft; - DV2PCP11_SetL = DB2102.DV2PCP11.SetLeft; - DV2PCP12_SetL = DB2102.DV2PCP12.SetLeft; - DV2PCP13_SetL = DB2102.DV2PCP13.SetLeft; - - DV2PCP01_SetR = DB2102.DV2PCP01.SetRight; - DV2PCP02_SetR = DB2102.DV2PCP02.SetRight; - DV2PCP03_SetR = DB2102.DV2PCP03.SetRight; - DV2PCP04_SetR = DB2102.DV2PCP04.SetRight; - DV2PCP05_SetR = DB2102.DV2PCP05.SetRight; - DV2PCP06_SetR = DB2102.DV2PCP06.SetRight; - DV2PCP07_SetR = DB2102.DV2PCP07.SetRight; - DV2PCP08_SetR = DB2102.DV2PCP08.SetRight; - DV2PCP09_SetR = DB2102.DV2PCP09.SetRight; - DV2PCP10_SetR = DB2102.DV2PCP10.SetRight; - DV2PCP11_SetR = DB2102.DV2PCP11.SetRight; - DV2PCP12_SetR = DB2102.DV2PCP12.SetRight; - DV2PCP13_SetR = DB2102.DV2PCP13.SetRight; + private void NewThread(object obj) + { + try + { - DV2PCP01_AlarmL = DB2102.DV2PCP01.AlarmLeftPosition; - DV2PCP02_AlarmL = DB2102.DV2PCP02.AlarmLeftPosition; - DV2PCP03_AlarmL = DB2102.DV2PCP03.AlarmLeftPosition; - DV2PCP04_AlarmL = DB2102.DV2PCP04.AlarmLeftPosition; - DV2PCP05_AlarmL = DB2102.DV2PCP05.AlarmLeftPosition; - DV2PCP06_AlarmL = DB2102.DV2PCP06.AlarmLeftPosition; - DV2PCP07_AlarmL = DB2102.DV2PCP07.AlarmLeftPosition; - DV2PCP08_AlarmL = DB2102.DV2PCP08.AlarmLeftPosition; - DV2PCP09_AlarmL = DB2102.DV2PCP09.AlarmLeftPosition; - DV2PCP10_AlarmL = DB2102.DV2PCP10.AlarmLeftPosition; - DV2PCP11_AlarmL = DB2102.DV2PCP11.AlarmLeftPosition; - DV2PCP12_AlarmL = DB2102.DV2PCP12.AlarmLeftPosition; - DV2PCP13_AlarmL = DB2102.DV2PCP13.AlarmLeftPosition; + if (conCurrentCache.Count == 0) + { + MesnacServiceManager.Instance.LoggingService.Info("开始"); + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + + + conCurrentCache.TryAdd("plc", DateTime.Now); + NewThreadDb2102(); + NewThreadDb2107(); + NewThreadDb2103(); + SetControlValue(); + conCurrentCache.Clear(); + stopwatch.Stop(); + var send = stopwatch.ElapsedMilliseconds; + MesnacServiceManager.Instance.LoggingService.Info("线束"+ send); + + + conCurrentCache.Clear(); + } + else + { + MesnacServiceManager.Instance.LoggingService.Info("被过滤"); + } + } + catch(Exception) + { + conCurrentCache.Clear(); + } - DV2PCP01_AlarmR = DB2102.DV2PCP01.AlarmRightPosition; - DV2PCP02_AlarmR = DB2102.DV2PCP02.AlarmRightPosition; - DV2PCP03_AlarmR = DB2102.DV2PCP03.AlarmRightPosition; - DV2PCP04_AlarmR = DB2102.DV2PCP04.AlarmRightPosition; - DV2PCP05_AlarmR = DB2102.DV2PCP05.AlarmRightPosition; - DV2PCP06_AlarmR = DB2102.DV2PCP06.AlarmRightPosition; - DV2PCP07_AlarmR = DB2102.DV2PCP07.AlarmRightPosition; - DV2PCP08_AlarmR = DB2102.DV2PCP08.AlarmRightPosition; - DV2PCP09_AlarmR = DB2102.DV2PCP09.AlarmRightPosition; - DV2PCP10_AlarmR = DB2102.DV2PCP10.AlarmRightPosition; - DV2PCP11_AlarmR = DB2102.DV2PCP11.AlarmRightPosition; - DV2PCP12_AlarmR = DB2102.DV2PCP12.AlarmRightPosition; - DV2PCP13_AlarmR = DB2102.DV2PCP13.AlarmRightPosition; - SetControlValue(); - } /// @@ -1695,7 +1743,10 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl timer.Dispose(); } - Task.Factory.StartNew(NewThread); + ThreadPool.QueueUserWorkItem(new WaitCallback(NewThread)); + + + } @@ -2041,7 +2092,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl SetThreeWayValve(DV2PCP12, DV2PCP12_AlarmR, DV2PCP12_SetR, DV2PCP12_AlarmL, DV2PCP12_SetL); SetThreeWayValve(DV2PCP13, DV2PCP13_AlarmR, DV2PCP13_SetR, DV2PCP13_AlarmL, DV2PCP13_SetL); - MesnacServiceManager.Instance.LoggingService.Info("结束"); + }