diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/DayWhiteEmbryoInitDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/DayWhiteEmbryoInitDb.cs index 2a7d52c..085fffb 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/DayWhiteEmbryoInitDb.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/DayWhiteEmbryoInitDb.cs @@ -26,16 +26,23 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo private RuntimeParameter _runtime; MCButton btnOk; MCButton selectButton; + MCButton WhiteWork; + MCButton NightWork; + MCDateTimePicker mCDateTimePicker; MCDateTimePicker startDate; MCDateTimePicker startTime; MCDateTimePicker endDate; MCDateTimePicker endTime; + MCDataGridView dataGridView; MCDataGridView moreData; + DataTable dt; DataTable MoreDataTable; + List list; + List listMore; public void Run(RuntimeParameter runtime) { @@ -47,6 +54,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo btnOk = control.FirstOrDefault(x => x.Name == "MCButton1") as MCButton; dataGridView = control.FirstOrDefault(x => x.Name == "MCDataGridView1") as MCDataGridView; selectButton = control.FirstOrDefault(x => x.Name == "SelectButton") as MCButton; + WhiteWork = control.FirstOrDefault(x => x.Name == "WhiteWork") as MCButton; + NightWork = control.FirstOrDefault(x => x.Name == "NightWork") as MCButton; moreData = control.FirstOrDefault(x => x.Name == "MoreData") as MCDataGridView; startDate = control.FirstOrDefault(x => x.Name == "startDate") as MCDateTimePicker; startTime = control.FirstOrDefault(x => x.Name == "startTime") as MCDateTimePicker; @@ -56,10 +65,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo mCDateTimePicker.Value = DateTime.Now.AddDays(0); startDate.Value = DateTime.Now.AddDays(-1); - startTime.Value = Convert.ToDateTime(DateTime.Now.ToString("08:00:00")); + //startTime.Value = Convert.ToDateTime(DateTime.Now.ToString("08:00:00")); - - endTime.Value = Convert.ToDateTime(DateTime.Now.ToString("20:00:00")); + //endTime.Value = Convert.ToDateTime(DateTime.Now.ToString("20:00:00")); dt = new DataTable(); dt.Columns.Add("机台", typeof(string)); @@ -72,7 +80,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo btnOk.Click += BtnOk_Click; selectButton.Click += SelectButton_Click; dataGridView.CellClick += MoreData_Click; - + dataGridView.CellValueChanged += MoreData_Click; + WhiteWork.Click += WhiteWork_Click; + NightWork.Click += NightWork_Click; } private void BtnOk_Click(object sender, EventArgs e) @@ -81,19 +91,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo string time = mCDateTimePicker.Value.ToString("yyyyMMdd"); list = FreeSqlUnit.Instance.Select().Where(x => x.CreateDate == time).ToList(); - for (int i = 1; i <= 8; i++) - { - var dr = dt.NewRow(); - dr[0] = "糊化机" + i; - var totalWeight = list.Where(x => x.DeviceId == i).Sum(x => x.Weight); - dr[1] = totalWeight.ToString(); - - dt.Rows.Add(dr); - } - - dataGridView.DataSource = null; - dataGridView.DataSource = dt; - + DataTableSum(); } private void SelectButton_Click(object sender, EventArgs e) @@ -102,21 +100,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo DateTime starttime = startDate.Value.Date.AddHours(startTime.Value.Hour).AddMinutes(startTime.Value.Minute).AddSeconds(startTime.Value.Second); DateTime endtime = endDate.Value.Date.AddHours(endTime.Value.Hour).AddMinutes(endTime.Value.Minute).AddSeconds(endTime.Value.Second); - list = FreeSqlUnit.Instance.Select().Where(x => (x.CreateTime >= starttime && x.CreateTime <= endtime)).ToList(); - for(int i = 1; i <= 8; i++) - { - var dr = dt.NewRow(); - dr[0] = "糊化机" + i; - var totalWeight = list.Where(x => x.DeviceId == i).Sum(x => x.Weight); - dr[1] = totalWeight.ToString(); - - dt.Rows.Add(dr); - } - - dataGridView.DataSource = null; - dataGridView.DataSource = dt; + DataTableSum(); } private void MoreData_Click(object sender, EventArgs e) @@ -127,6 +113,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo char[] a = dID.ToCharArray(); char chr = a[3]; + if (chr == '和') + { + return; + } int num = int.Parse(chr.ToString()); listMore = list.Where(x => x.DeviceId == num).ToList(); @@ -142,5 +132,77 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo moreData.DataSource = MoreDataTable; } + + private void WhiteWork_Click(object sender, EventArgs e) + { + dt.Rows.Clear(); + + DateTime nowTime = DateTime.Now; + + DateTime starttime; + DateTime endtime; + + //如果大于当天8点 就展示当天的白班 否则展示上一个白班 + if (nowTime >= DateTime.Now.Date.AddHours(8)) + { + starttime = DateTime.Now.Date.AddHours(8); + endtime = DateTime.Now.Date.AddHours(20); + } + else + { + starttime = DateTime.Now.Date.AddHours(-16); + endtime = DateTime.Now.Date.AddHours(-4); + } + + list = FreeSqlUnit.Instance.Select().Where(x => (x.CreateTime >= starttime && x.CreateTime <= endtime)).ToList(); + + DataTableSum(); + } + + private void NightWork_Click(Object sender, EventArgs e) + { + dt.Rows.Clear(); + + DateTime nowTime = DateTime.Now; + + DateTime starttime; + DateTime endtime; + + //如果小于当天20点 就展示当天的前一个晚班 + if (nowTime <= DateTime.Now.Date.AddHours(20)) + { + starttime = DateTime.Now.Date.AddHours(-4); + endtime = DateTime.Now.Date.AddHours(8); + } + else + { + starttime = DateTime.Now.Date.AddHours(20); + endtime = DateTime.Now.Date.AddHours(32); + } + + list = FreeSqlUnit.Instance.Select().Where(x => (x.CreateTime >= starttime && x.CreateTime <= endtime)).ToList(); + + DataTableSum(); + } + + private void DataTableSum() + { + for (int i = 1; i <= 8; i++) + { + var dr = dt.NewRow(); + dr[0] = "糊化机" + i; + var totalWeight = list.Where(x => x.DeviceId == i).Sum(x => x.Weight); + dr[1] = totalWeight.ToString(); + + dt.Rows.Add(dr); + } + var edr = dt.NewRow(); + edr[0] = "生产总和"; + edr[1] = list.Sum(x => x.Weight).ToString(); + dt.Rows.Add(edr); + + dataGridView.DataSource = null; + dataGridView.DataSource = dt; + } } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index f37ca6b..da539ba 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -1266,16 +1266,18 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl if (DB2103.DM2ASF01.Running) { - if (DB2103.DM2ASF01.Polarity) - { - DM2ASF01L_Set = true; - DM2ASF01R_Set = false; - } - else - { - DM2ASF01L_Set = false; - DM2ASF01R_Set = true; - } + //if (DB2103.DM2ASF01.Polarity) + //{ + // DM2ASF01L_Set = true; + // DM2ASF01R_Set = false; + //} + //else + //{ + // DM2ASF01L_Set = false; + // DM2ASF01R_Set = true; + //} + DM2ASF01L_Set = true; + DM2ASF01R_Set = true; } else { @@ -1285,16 +1287,18 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl if (DB2103.DM2BSF01.Running) { - if (DB2103.DM2BSF01.Polarity) - { - DM2BSF01L_Set = true; - DM2BSF01R_Set = false; - } - else - { - DM2BSF01L_Set = false; - DM2BSF01R_Set = true; - } + //if (DB2103.DM2BSF01.Polarity) + //{ + // DM2BSF01L_Set = true; + // DM2BSF01R_Set = false; + //} + //else + //{ + // DM2BSF01L_Set = false; + // DM2BSF01R_Set = true; + //} + DM2BSF01L_Set = true; + DM2BSF01R_Set = true; } else { @@ -1304,16 +1308,18 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl if (DB2103.DM2CSF01.Running) { - if (DB2103.DM2CSF01.Polarity) - { - DM2CSF01L_Set = true; - DM2CSF01R_Set = false; - } - else - { - DM2CSF01L_Set = false; - DM2CSF01R_Set = true; - } + //if (DB2103.DM2CSF01.Polarity) + //{ + // DM2CSF01L_Set = true; + // DM2CSF01R_Set = false; + //} + //else + //{ + // DM2CSF01L_Set = false; + // DM2CSF01R_Set = true; + //} + DM2CSF01L_Set = true; + DM2CSF01R_Set = true; } else { @@ -1323,16 +1329,18 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl if (DB2103.DM2DSF01.Running) { - if (DB2103.DM2DSF01.Polarity) - { - DM2DSF01L_Set = true; - DM2DSF01R_Set = false; - } - else - { - DM2DSF01L_Set = false; - DM2DSF01R_Set = true; - } + //if (DB2103.DM2DSF01.Polarity) + //{ + // DM2DSF01L_Set = true; + // DM2DSF01R_Set = false; + //} + //else + //{ + // DM2DSF01L_Set = false; + // DM2DSF01R_Set = true; + //} + DM2DSF01L_Set = true; + DM2DSF01R_Set = true; } else { @@ -1774,9 +1782,9 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl if (conCurrentCache.Count == 0) { - MesnacServiceManager.Instance.LoggingService.Info("开始"); - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); + //MesnacServiceManager.Instance.LoggingService.Info("开始"); + //Stopwatch stopwatch = new Stopwatch(); + //stopwatch.Start(); conCurrentCache.TryAdd("plc", DateTime.Now); @@ -1784,31 +1792,28 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl // NewThreadDb2102(); // NewThreadDb2103(); // NewThreadDb2107(); - - OperateResult db2102All=PlcConnect.Instance.Read("DB2102.0.0", 214); - OperateResult db2103All=PlcConnect.Instance.Read("DB2103.0.0", 418); - OperateResult db2107All = PlcConnect.Instance.Read("DB2107.0.0", 2057); - - DB2102 = new DB2102Helper(db2102All.Content); - DB2103 = new DB2103Helper(db2103All.Content); + + DB2102 = new DB2102Helper(); + DB2103 = new DB2103Helper(); // DB2107 = new DB2107Helper(); NewThreadDb2102(); NewThreadDb2103(); // DB2103 = new DB2103Helper(); - // DB2107 = new DB2107Helper(); + DB2107 = new DB2107Helper(); + NewThreadDb2107(); conCurrentCache.Clear(); - stopwatch.Stop(); - var send = stopwatch.ElapsedMilliseconds; - MesnacServiceManager.Instance.LoggingService.Info("线束"+ send); + //stopwatch.Stop(); + //var send = stopwatch.ElapsedMilliseconds; + //MesnacServiceManager.Instance.LoggingService.Info("结束"+ send); conCurrentCache.Clear(); } else { - MesnacServiceManager.Instance.LoggingService.Info("被过滤"); + MesnacServiceManager.Instance.LoggingService.Info("设备细节画面读数线程被过滤"); } } catch(Exception ex) @@ -2169,8 +2174,8 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl timer.Dispose(); } - NewThread(""); - // ThreadPool.QueueUserWorkItem(new WaitCallback()); + + ThreadPool.QueueUserWorkItem(new WaitCallback(NewThread)); } diff --git a/DataBlockHelper/DBHelpers/DB2102Helper.cs b/DataBlockHelper/DBHelpers/DB2102Helper.cs index 5be34a0..c4af50e 100644 --- a/DataBlockHelper/DBHelpers/DB2102Helper.cs +++ b/DataBlockHelper/DBHelpers/DB2102Helper.cs @@ -17,114 +17,120 @@ namespace DataBlockHelper.DBHelpers _bytes = bytes; } - public FOR_VALVE_DoubleEntity DV2PCP01 => new FOR_VALVE_DoubleEntity(130,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP02 => new FOR_VALVE_DoubleEntity(132,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP03 => new FOR_VALVE_DoubleEntity(134,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP04 => new FOR_VALVE_DoubleEntity(136,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP05 => new FOR_VALVE_DoubleEntity(138,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP06 => new FOR_VALVE_DoubleEntity(140,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP07 => new FOR_VALVE_DoubleEntity(142,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP08 => new FOR_VALVE_DoubleEntity(144,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP09 => new FOR_VALVE_DoubleEntity(146,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP10 => new FOR_VALVE_DoubleEntity(148,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP11 => new FOR_VALVE_DoubleEntity(150,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP12 => new FOR_VALVE_DoubleEntity(152,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP13 => new FOR_VALVE_DoubleEntity(154,_bytes); - public FOR_VALVE_DoubleEntity DV2PCP14 => new FOR_VALVE_DoubleEntity(156,_bytes); + public DB2102Helper() + { + OperateResult db2102All = PlcConnect.Instance.Read("DB2102.0.0", 214); + _bytes = db2102All.Content; + } + + public FOR_VALVE_DoubleEntity DV2PCP01 => new FOR_VALVE_DoubleEntity(130, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP02 => new FOR_VALVE_DoubleEntity(132, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP03 => new FOR_VALVE_DoubleEntity(134, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP04 => new FOR_VALVE_DoubleEntity(136, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP05 => new FOR_VALVE_DoubleEntity(138, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP06 => new FOR_VALVE_DoubleEntity(140, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP07 => new FOR_VALVE_DoubleEntity(142, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP08 => new FOR_VALVE_DoubleEntity(144, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP09 => new FOR_VALVE_DoubleEntity(146, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP10 => new FOR_VALVE_DoubleEntity(148, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP11 => new FOR_VALVE_DoubleEntity(150, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP12 => new FOR_VALVE_DoubleEntity(152, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP13 => new FOR_VALVE_DoubleEntity(154, _bytes); + public FOR_VALVE_DoubleEntity DV2PCP14 => new FOR_VALVE_DoubleEntity(156, _bytes); - public FOR_VALVE_SingleEntity BU1ASF01 => new FOR_VALVE_SingleEntity(0,_bytes); - public FOR_VALVE_SingleEntity BU1BSF01 => new FOR_VALVE_SingleEntity(2,_bytes); - public FOR_VALVE_SingleEntity BU1CSF01 => new FOR_VALVE_SingleEntity(4,_bytes); - public FOR_VALVE_SingleEntity BU1DSF01 => new FOR_VALVE_SingleEntity(6,_bytes); - public FOR_VALVE_SingleEntity BU1ESF01 => new FOR_VALVE_SingleEntity(8,_bytes); - public FOR_VALVE_SingleEntity BU1FSF01 => new FOR_VALVE_SingleEntity(10,_bytes); - public FOR_VALVE_SingleEntity BU1GSF01 => new FOR_VALVE_SingleEntity(12,_bytes); - public FOR_VALVE_SingleEntity BU1HSF01 => new FOR_VALVE_SingleEntity(14,_bytes); - public FOR_VALVE_SingleEntity BU1ISF01 => new FOR_VALVE_SingleEntity(16,_bytes); - public FOR_VALVE_SingleEntity BU1JSF01 => new FOR_VALVE_SingleEntity(18,_bytes); - public FOR_VALVE_SingleEntity BU1KSF01 => new FOR_VALVE_SingleEntity(20,_bytes); - public FOR_VALVE_SingleEntity BU1LSF01 => new FOR_VALVE_SingleEntity(22,_bytes); - public FOR_VALVE_SingleEntity BU1MSF01 => new FOR_VALVE_SingleEntity(24,_bytes); - public FOR_VALVE_SingleEntity BU1NSF01 => new FOR_VALVE_SingleEntity(26,_bytes); - public FOR_VALVE_SingleEntity BU1OSF01 => new FOR_VALVE_SingleEntity(28,_bytes); - public FOR_VALVE_SingleEntity BU1BLT01 => new FOR_VALVE_SingleEntity(30,_bytes); - public FOR_VALVE_SingleEntity BU1BLT02 => new FOR_VALVE_SingleEntity(32,_bytes); - public FOR_VALVE_SingleEntity BU1BLT03 => new FOR_VALVE_SingleEntity(34,_bytes); - public FOR_VALVE_SingleEntity BU1BLT04 => new FOR_VALVE_SingleEntity(36,_bytes); - public FOR_VALVE_SingleEntity BU1BLT05 => new FOR_VALVE_SingleEntity(38,_bytes); - public FOR_VALVE_SingleEntity BU1BLT06 => new FOR_VALVE_SingleEntity(40,_bytes); - public FOR_VALVE_SingleEntity BU1BLT07 => new FOR_VALVE_SingleEntity(42,_bytes); - public FOR_VALVE_SingleEntity BU2BLT01 => new FOR_VALVE_SingleEntity(44,_bytes); - public FOR_VALVE_SingleEntity BU2BLT02 => new FOR_VALVE_SingleEntity(46,_bytes); - public FOR_VALVE_SingleEntity BU2BLT03 => new FOR_VALVE_SingleEntity(48,_bytes); - public FOR_VALVE_SingleEntity BU2BLT04 => new FOR_VALVE_SingleEntity(50,_bytes); - public FOR_VALVE_SingleEntity BU2BLT05 => new FOR_VALVE_SingleEntity(52,_bytes); - public FOR_VALVE_SingleEntity BU3BLT01 => new FOR_VALVE_SingleEntity(54,_bytes); - public FOR_VALVE_SingleEntity BU3BLT02 => new FOR_VALVE_SingleEntity(56,_bytes); - public FOR_VALVE_SingleEntity BU3BLT03 => new FOR_VALVE_SingleEntity(58,_bytes); - public FOR_VALVE_SingleEntity BU3BLT04 => new FOR_VALVE_SingleEntity(60,_bytes); - public FOR_VALVE_SingleEntity BU3BLT05 => new FOR_VALVE_SingleEntity(62,_bytes); - public FOR_VALVE_SingleEntity BU3BLT06 => new FOR_VALVE_SingleEntity(64,_bytes); - public FOR_VALVE_SingleEntity BU3BLT07 => new FOR_VALVE_SingleEntity(66,_bytes); - public FOR_VALVE_SingleEntity BU4BLT01 => new FOR_VALVE_SingleEntity(68,_bytes); - public FOR_VALVE_SingleEntity BU4BLT02 => new FOR_VALVE_SingleEntity(70,_bytes); - public FOR_VALVE_SingleEntity BU4BLT03 => new FOR_VALVE_SingleEntity(72,_bytes); - public FOR_VALVE_SingleEntity BU4BLT04 => new FOR_VALVE_SingleEntity(74,_bytes); - public FOR_VALVE_SingleEntity BU4BLT05 => new FOR_VALVE_SingleEntity(76,_bytes); - public FOR_VALVE_SingleEntity BU4BLT06 => new FOR_VALVE_SingleEntity(78,_bytes); - public FOR_VALVE_SingleEntity BU4BLT07 => new FOR_VALVE_SingleEntity(80,_bytes); - public FOR_VALVE_SingleEntity BU5BLT01 => new FOR_VALVE_SingleEntity(82,_bytes); - public FOR_VALVE_SingleEntity BU5BLT02 => new FOR_VALVE_SingleEntity(84,_bytes); - public FOR_VALVE_SingleEntity BU5BLT03 => new FOR_VALVE_SingleEntity(86,_bytes); - public FOR_VALVE_SingleEntity BU5BLT04 => new FOR_VALVE_SingleEntity(88,_bytes); - public FOR_VALVE_SingleEntity BU2ASF01 => new FOR_VALVE_SingleEntity(90,_bytes); - public FOR_VALVE_SingleEntity BU2ASF02 => new FOR_VALVE_SingleEntity(92,_bytes); - public FOR_VALVE_SingleEntity BU2BSF01 => new FOR_VALVE_SingleEntity(94,_bytes); - public FOR_VALVE_SingleEntity BU2BSF02 => new FOR_VALVE_SingleEntity(96,_bytes); - public FOR_VALVE_SingleEntity BU2CSF01 => new FOR_VALVE_SingleEntity(98,_bytes); - public FOR_VALVE_SingleEntity BU2CSF02 => new FOR_VALVE_SingleEntity(100,_bytes); - public FOR_VALVE_SingleEntity BU2DSF01 => new FOR_VALVE_SingleEntity(102,_bytes); - public FOR_VALVE_SingleEntity BU2DSF02 => new FOR_VALVE_SingleEntity(104,_bytes); - public FOR_VALVE_SingleEntity BU1ADB01 => new FOR_VALVE_SingleEntity(106,_bytes); - public FOR_VALVE_SingleEntity BU1BDB01 => new FOR_VALVE_SingleEntity(108,_bytes); - public FOR_VALVE_SingleEntity BU1CDB01 => new FOR_VALVE_SingleEntity(110,_bytes); - public FOR_VALVE_SingleEntity BU1DDB01 => new FOR_VALVE_SingleEntity(112,_bytes); - public FOR_VALVE_SingleEntity BU1EDB01 => new FOR_VALVE_SingleEntity(114,_bytes); - public FOR_VALVE_SingleEntity BU1FDB01 => new FOR_VALVE_SingleEntity(116,_bytes); - public FOR_VALVE_SingleEntity BU1GDB01 => new FOR_VALVE_SingleEntity(118,_bytes); - public FOR_VALVE_SingleEntity BU1HDB01 => new FOR_VALVE_SingleEntity(120,_bytes); - public FOR_VALVE_SingleEntity BU1IDB01 => new FOR_VALVE_SingleEntity(122,_bytes); - public FOR_VALVE_SingleEntity BU1JDB01 => new FOR_VALVE_SingleEntity(124,_bytes); - public FOR_VALVE_SingleEntity BU1KDB01 => new FOR_VALVE_SingleEntity(126,_bytes); - public FOR_VALVE_SingleEntity BU1LDB01 => new FOR_VALVE_SingleEntity(128,_bytes); + public FOR_VALVE_SingleEntity BU1ASF01 => new FOR_VALVE_SingleEntity(0, _bytes); + public FOR_VALVE_SingleEntity BU1BSF01 => new FOR_VALVE_SingleEntity(2, _bytes); + public FOR_VALVE_SingleEntity BU1CSF01 => new FOR_VALVE_SingleEntity(4, _bytes); + public FOR_VALVE_SingleEntity BU1DSF01 => new FOR_VALVE_SingleEntity(6, _bytes); + public FOR_VALVE_SingleEntity BU1ESF01 => new FOR_VALVE_SingleEntity(8, _bytes); + public FOR_VALVE_SingleEntity BU1FSF01 => new FOR_VALVE_SingleEntity(10, _bytes); + public FOR_VALVE_SingleEntity BU1GSF01 => new FOR_VALVE_SingleEntity(12, _bytes); + public FOR_VALVE_SingleEntity BU1HSF01 => new FOR_VALVE_SingleEntity(14, _bytes); + public FOR_VALVE_SingleEntity BU1ISF01 => new FOR_VALVE_SingleEntity(16, _bytes); + public FOR_VALVE_SingleEntity BU1JSF01 => new FOR_VALVE_SingleEntity(18, _bytes); + public FOR_VALVE_SingleEntity BU1KSF01 => new FOR_VALVE_SingleEntity(20, _bytes); + public FOR_VALVE_SingleEntity BU1LSF01 => new FOR_VALVE_SingleEntity(22, _bytes); + public FOR_VALVE_SingleEntity BU1MSF01 => new FOR_VALVE_SingleEntity(24, _bytes); + public FOR_VALVE_SingleEntity BU1NSF01 => new FOR_VALVE_SingleEntity(26, _bytes); + public FOR_VALVE_SingleEntity BU1OSF01 => new FOR_VALVE_SingleEntity(28, _bytes); + public FOR_VALVE_SingleEntity BU1BLT01 => new FOR_VALVE_SingleEntity(30, _bytes); + public FOR_VALVE_SingleEntity BU1BLT02 => new FOR_VALVE_SingleEntity(32, _bytes); + public FOR_VALVE_SingleEntity BU1BLT03 => new FOR_VALVE_SingleEntity(34, _bytes); + public FOR_VALVE_SingleEntity BU1BLT04 => new FOR_VALVE_SingleEntity(36, _bytes); + public FOR_VALVE_SingleEntity BU1BLT05 => new FOR_VALVE_SingleEntity(38, _bytes); + public FOR_VALVE_SingleEntity BU1BLT06 => new FOR_VALVE_SingleEntity(40, _bytes); + public FOR_VALVE_SingleEntity BU1BLT07 => new FOR_VALVE_SingleEntity(42, _bytes); + public FOR_VALVE_SingleEntity BU2BLT01 => new FOR_VALVE_SingleEntity(44, _bytes); + public FOR_VALVE_SingleEntity BU2BLT02 => new FOR_VALVE_SingleEntity(46, _bytes); + public FOR_VALVE_SingleEntity BU2BLT03 => new FOR_VALVE_SingleEntity(48, _bytes); + public FOR_VALVE_SingleEntity BU2BLT04 => new FOR_VALVE_SingleEntity(50, _bytes); + public FOR_VALVE_SingleEntity BU2BLT05 => new FOR_VALVE_SingleEntity(52, _bytes); + public FOR_VALVE_SingleEntity BU3BLT01 => new FOR_VALVE_SingleEntity(54, _bytes); + public FOR_VALVE_SingleEntity BU3BLT02 => new FOR_VALVE_SingleEntity(56, _bytes); + public FOR_VALVE_SingleEntity BU3BLT03 => new FOR_VALVE_SingleEntity(58, _bytes); + public FOR_VALVE_SingleEntity BU3BLT04 => new FOR_VALVE_SingleEntity(60, _bytes); + public FOR_VALVE_SingleEntity BU3BLT05 => new FOR_VALVE_SingleEntity(62, _bytes); + public FOR_VALVE_SingleEntity BU3BLT06 => new FOR_VALVE_SingleEntity(64, _bytes); + public FOR_VALVE_SingleEntity BU3BLT07 => new FOR_VALVE_SingleEntity(66, _bytes); + public FOR_VALVE_SingleEntity BU4BLT01 => new FOR_VALVE_SingleEntity(68, _bytes); + public FOR_VALVE_SingleEntity BU4BLT02 => new FOR_VALVE_SingleEntity(70, _bytes); + public FOR_VALVE_SingleEntity BU4BLT03 => new FOR_VALVE_SingleEntity(72, _bytes); + public FOR_VALVE_SingleEntity BU4BLT04 => new FOR_VALVE_SingleEntity(74, _bytes); + public FOR_VALVE_SingleEntity BU4BLT05 => new FOR_VALVE_SingleEntity(76, _bytes); + public FOR_VALVE_SingleEntity BU4BLT06 => new FOR_VALVE_SingleEntity(78, _bytes); + public FOR_VALVE_SingleEntity BU4BLT07 => new FOR_VALVE_SingleEntity(80, _bytes); + public FOR_VALVE_SingleEntity BU5BLT01 => new FOR_VALVE_SingleEntity(82, _bytes); + public FOR_VALVE_SingleEntity BU5BLT02 => new FOR_VALVE_SingleEntity(84, _bytes); + public FOR_VALVE_SingleEntity BU5BLT03 => new FOR_VALVE_SingleEntity(86, _bytes); + public FOR_VALVE_SingleEntity BU5BLT04 => new FOR_VALVE_SingleEntity(88, _bytes); + public FOR_VALVE_SingleEntity BU2ASF01 => new FOR_VALVE_SingleEntity(90, _bytes); + public FOR_VALVE_SingleEntity BU2ASF02 => new FOR_VALVE_SingleEntity(92, _bytes); + public FOR_VALVE_SingleEntity BU2BSF01 => new FOR_VALVE_SingleEntity(94, _bytes); + public FOR_VALVE_SingleEntity BU2BSF02 => new FOR_VALVE_SingleEntity(96, _bytes); + public FOR_VALVE_SingleEntity BU2CSF01 => new FOR_VALVE_SingleEntity(98, _bytes); + public FOR_VALVE_SingleEntity BU2CSF02 => new FOR_VALVE_SingleEntity(100, _bytes); + public FOR_VALVE_SingleEntity BU2DSF01 => new FOR_VALVE_SingleEntity(102, _bytes); + public FOR_VALVE_SingleEntity BU2DSF02 => new FOR_VALVE_SingleEntity(104, _bytes); + public FOR_VALVE_SingleEntity BU1ADB01 => new FOR_VALVE_SingleEntity(106, _bytes); + public FOR_VALVE_SingleEntity BU1BDB01 => new FOR_VALVE_SingleEntity(108, _bytes); + public FOR_VALVE_SingleEntity BU1CDB01 => new FOR_VALVE_SingleEntity(110, _bytes); + public FOR_VALVE_SingleEntity BU1DDB01 => new FOR_VALVE_SingleEntity(112, _bytes); + public FOR_VALVE_SingleEntity BU1EDB01 => new FOR_VALVE_SingleEntity(114, _bytes); + public FOR_VALVE_SingleEntity BU1FDB01 => new FOR_VALVE_SingleEntity(116, _bytes); + public FOR_VALVE_SingleEntity BU1GDB01 => new FOR_VALVE_SingleEntity(118, _bytes); + public FOR_VALVE_SingleEntity BU1HDB01 => new FOR_VALVE_SingleEntity(120, _bytes); + public FOR_VALVE_SingleEntity BU1IDB01 => new FOR_VALVE_SingleEntity(122, _bytes); + public FOR_VALVE_SingleEntity BU1JDB01 => new FOR_VALVE_SingleEntity(124, _bytes); + public FOR_VALVE_SingleEntity BU1KDB01 => new FOR_VALVE_SingleEntity(126, _bytes); + public FOR_VALVE_SingleEntity BU1LDB01 => new FOR_VALVE_SingleEntity(128, _bytes); - public FOR_VALVE_SingleEntity BU1DRB01 => new FOR_VALVE_SingleEntity(158,_bytes); - public FOR_VALVE_SingleEntity BU2DRB01 => new FOR_VALVE_SingleEntity(160,_bytes); - public FOR_VALVE_SingleEntity BU3DRB01 => new FOR_VALVE_SingleEntity(162,_bytes); - public FOR_VALVE_SingleEntity BU4DRB01 => new FOR_VALVE_SingleEntity(164,_bytes); - public FOR_VALVE_SingleEntity BU1GEB01 => new FOR_VALVE_SingleEntity(166,_bytes); - public FOR_VALVE_SingleEntity BU2GEB01 => new FOR_VALVE_SingleEntity(168,_bytes); - public FOR_VALVE_SingleEntity BU3GEB01 => new FOR_VALVE_SingleEntity(170,_bytes); - public FOR_VALVE_SingleEntity BU4GEB01 => new FOR_VALVE_SingleEntity(172,_bytes); - public FOR_VALVE_SingleEntity BU5GEB01 => new FOR_VALVE_SingleEntity(174,_bytes); - public FOR_VALVE_SingleEntity BU6GEB01 => new FOR_VALVE_SingleEntity(176,_bytes); - public FOR_VALVE_SingleEntity BU7GEB01 => new FOR_VALVE_SingleEntity(178,_bytes); - public FOR_VALVE_SingleEntity BU8GEB01 => new FOR_VALVE_SingleEntity(180,_bytes); - public FOR_VALVE_SingleEntity BUWeter1 => new FOR_VALVE_SingleEntity(182,_bytes); - public FOR_VALVE_SingleEntity BUWeter2 => new FOR_VALVE_SingleEntity(184,_bytes); - public FOR_VALVE_SingleEntity BUWeter3 => new FOR_VALVE_SingleEntity(186,_bytes); - public FOR_VALVE_SingleEntity BUWeter4 => new FOR_VALVE_SingleEntity(188,_bytes); - public FOR_VALVE_SingleEntity BUWeter5 => new FOR_VALVE_SingleEntity(190,_bytes); - public FOR_VALVE_SingleEntity BUWeter6 => new FOR_VALVE_SingleEntity(192,_bytes); - public FOR_VALVE_SingleEntity BUWeter7 => new FOR_VALVE_SingleEntity(194,_bytes); - public FOR_VALVE_SingleEntity BUWeter8 => new FOR_VALVE_SingleEntity(196,_bytes); - public FOR_VALVE_SingleEntity BU1GEB02 => new FOR_VALVE_SingleEntity(198,_bytes); - public FOR_VALVE_SingleEntity BU2GEB02 => new FOR_VALVE_SingleEntity(200,_bytes); - public FOR_VALVE_SingleEntity BU3GEB02 => new FOR_VALVE_SingleEntity(202,_bytes); - public FOR_VALVE_SingleEntity BU4GEB02 => new FOR_VALVE_SingleEntity(204,_bytes); - public FOR_VALVE_SingleEntity BU5GEB02 => new FOR_VALVE_SingleEntity(206,_bytes); - public FOR_VALVE_SingleEntity BU6GEB02 => new FOR_VALVE_SingleEntity(208,_bytes); - public FOR_VALVE_SingleEntity BU7GEB02 => new FOR_VALVE_SingleEntity(210,_bytes); - public FOR_VALVE_SingleEntity BU8GEB02 => new FOR_VALVE_SingleEntity(212,_bytes); + public FOR_VALVE_SingleEntity BU1DRB01 => new FOR_VALVE_SingleEntity(158, _bytes); + public FOR_VALVE_SingleEntity BU2DRB01 => new FOR_VALVE_SingleEntity(160, _bytes); + public FOR_VALVE_SingleEntity BU3DRB01 => new FOR_VALVE_SingleEntity(162, _bytes); + public FOR_VALVE_SingleEntity BU4DRB01 => new FOR_VALVE_SingleEntity(164, _bytes); + public FOR_VALVE_SingleEntity BU1GEB01 => new FOR_VALVE_SingleEntity(166, _bytes); + public FOR_VALVE_SingleEntity BU2GEB01 => new FOR_VALVE_SingleEntity(168, _bytes); + public FOR_VALVE_SingleEntity BU3GEB01 => new FOR_VALVE_SingleEntity(170, _bytes); + public FOR_VALVE_SingleEntity BU4GEB01 => new FOR_VALVE_SingleEntity(172, _bytes); + public FOR_VALVE_SingleEntity BU5GEB01 => new FOR_VALVE_SingleEntity(174, _bytes); + public FOR_VALVE_SingleEntity BU6GEB01 => new FOR_VALVE_SingleEntity(176, _bytes); + public FOR_VALVE_SingleEntity BU7GEB01 => new FOR_VALVE_SingleEntity(178, _bytes); + public FOR_VALVE_SingleEntity BU8GEB01 => new FOR_VALVE_SingleEntity(180, _bytes); + public FOR_VALVE_SingleEntity BUWeter1 => new FOR_VALVE_SingleEntity(182, _bytes); + public FOR_VALVE_SingleEntity BUWeter2 => new FOR_VALVE_SingleEntity(184, _bytes); + public FOR_VALVE_SingleEntity BUWeter3 => new FOR_VALVE_SingleEntity(186, _bytes); + public FOR_VALVE_SingleEntity BUWeter4 => new FOR_VALVE_SingleEntity(188, _bytes); + public FOR_VALVE_SingleEntity BUWeter5 => new FOR_VALVE_SingleEntity(190, _bytes); + public FOR_VALVE_SingleEntity BUWeter6 => new FOR_VALVE_SingleEntity(192, _bytes); + public FOR_VALVE_SingleEntity BUWeter7 => new FOR_VALVE_SingleEntity(194, _bytes); + public FOR_VALVE_SingleEntity BUWeter8 => new FOR_VALVE_SingleEntity(196, _bytes); + public FOR_VALVE_SingleEntity BU1GEB02 => new FOR_VALVE_SingleEntity(198, _bytes); + public FOR_VALVE_SingleEntity BU2GEB02 => new FOR_VALVE_SingleEntity(200, _bytes); + public FOR_VALVE_SingleEntity BU3GEB02 => new FOR_VALVE_SingleEntity(202, _bytes); + public FOR_VALVE_SingleEntity BU4GEB02 => new FOR_VALVE_SingleEntity(204, _bytes); + public FOR_VALVE_SingleEntity BU5GEB02 => new FOR_VALVE_SingleEntity(206, _bytes); + public FOR_VALVE_SingleEntity BU6GEB02 => new FOR_VALVE_SingleEntity(208, _bytes); + public FOR_VALVE_SingleEntity BU7GEB02 => new FOR_VALVE_SingleEntity(210, _bytes); + public FOR_VALVE_SingleEntity BU8GEB02 => new FOR_VALVE_SingleEntity(212, _bytes); } } diff --git a/DataBlockHelper/DBHelpers/DB2103Helper.cs b/DataBlockHelper/DBHelpers/DB2103Helper.cs index 8c8ad85..677076f 100644 --- a/DataBlockHelper/DBHelpers/DB2103Helper.cs +++ b/DataBlockHelper/DBHelpers/DB2103Helper.cs @@ -17,94 +17,99 @@ namespace DataBlockHelper.DBHelpers _bytes = bytes; } + public DB2103Helper() + { + OperateResult db2103All = PlcConnect.Instance.Read("DB2103.0.0", 418); + _bytes = db2103All.Content; + } // public OperateResult GetAll=>PlcConnect.Instance.Read("DB2103.0.0", 418,_bytes); - public FOR_MOTOREntity DM1ASI01 => new FOR_MOTOREntity(0,_bytes); - public FOR_MOTOREntity DM1BSI01 => new FOR_MOTOREntity(2,_bytes); - public FOR_MOTOREntity DM1CSI01 => new FOR_MOTOREntity(4,_bytes); - public FOR_MOTOREntity DM1DSI01 => new FOR_MOTOREntity(6,_bytes); - public FOR_MOTOREntity DM1ESI01 => new FOR_MOTOREntity(8,_bytes); - public FOR_MOTOREntity DM1FSI01 => new FOR_MOTOREntity(10,_bytes); - public FOR_MOTOREntity DM1GSI01 => new FOR_MOTOREntity(12,_bytes); - public FOR_MOTOREntity DM1HSI01 => new FOR_MOTOREntity(14,_bytes); - public FOR_MOTOREntity DM1ISI01 => new FOR_MOTOREntity(16,_bytes); - public FOR_MOTOREntity DM1JSI01 => new FOR_MOTOREntity(18,_bytes); - public FOR_MOTOREntity DM1KSI01 => new FOR_MOTOREntity(20,_bytes); - public FOR_MOTOREntity DM1LSI01 => new FOR_MOTOREntity(22,_bytes); - public FOR_MOTOREntity DM1MSI01 => new FOR_MOTOREntity(24,_bytes); - public FOR_MOTOREntity DM1NSI01 => new FOR_MOTOREntity(26,_bytes); - public FOR_MOTOREntity DM1OSI01 => new FOR_MOTOREntity(28,_bytes); - public FOR_MOTOREntity DM1ADB01 => new FOR_MOTOREntity(30,_bytes); - public FOR_MOTOREntity DM1BDB01 => new FOR_MOTOREntity(32,_bytes); - public FOR_MOTOREntity DM1CDB01 => new FOR_MOTOREntity(34,_bytes); - public FOR_MOTOREntity DM1DDB01 => new FOR_MOTOREntity(36,_bytes); - public FOR_MOTOREntity DM1EDB01 => new FOR_MOTOREntity(38,_bytes); - public FOR_MOTOREntity DM1FDB01 => new FOR_MOTOREntity(40,_bytes); - public FOR_MOTOREntity DM1GDB01 => new FOR_MOTOREntity(42,_bytes); - public FOR_MOTOREntity DM1HDB01 => new FOR_MOTOREntity(44,_bytes); - public FOR_MOTOREntity DM1IDB01 => new FOR_MOTOREntity(46,_bytes); - public FOR_MOTOREntity DM1JDB01 => new FOR_MOTOREntity(48,_bytes); - public FOR_MOTOREntity DM1KDB01 => new FOR_MOTOREntity(50,_bytes); - public FOR_MOTOREntity DM1LDB01 => new FOR_MOTOREntity(52,_bytes); - public FOR_MOTOREntity DM1ADF01 => new FOR_MOTOREntity(54,_bytes); - public FOR_MOTOREntity DM1BDF01 => new FOR_MOTOREntity(56,_bytes); - public FOR_MOTOREntity DM1CDF01 => new FOR_MOTOREntity(58,_bytes); - public FOR_MOTOREntity DM1DDF01 => new FOR_MOTOREntity(60,_bytes); - public FOR_MOTOREntity DM1EDF01 => new FOR_MOTOREntity(62,_bytes); - public FOR_MOTOREntity DM1FDF01 => new FOR_MOTOREntity(64,_bytes); - public FOR_MOTOREntity DM1GDF01 => new FOR_MOTOREntity(66,_bytes); - public FOR_MOTOREntity DM1HDF01 => new FOR_MOTOREntity(68,_bytes); - public FOR_MOTOREntity DM1IDF01 => new FOR_MOTOREntity(70,_bytes); - public FOR_MOTOREntity DM1JDF01 => new FOR_MOTOREntity(72,_bytes); - public FOR_MOTOREntity DM1KDF01 => new FOR_MOTOREntity(74,_bytes); - public FOR_MOTOREntity DM1LDF01 => new FOR_MOTOREntity(76,_bytes); - public FOR_MOTOREntity DMFILTER => new FOR_MOTOREntity(78,_bytes); - public FOR_MOTOREntity DM1ASF01 => new FOR_MOTOREntity(80,_bytes); - public FOR_MOTOREntity DM1BSF01 => new FOR_MOTOREntity(82,_bytes); - public FOR_MOTOREntity DM1CSF01 => new FOR_MOTOREntity(84,_bytes); - public FOR_MOTOREntity DM1DSF01 => new FOR_MOTOREntity(86,_bytes); - public FOR_MOTOREntity DM1ESF01 => new FOR_MOTOREntity(88,_bytes); - public FOR_MOTOREntity DM1FSF01 => new FOR_MOTOREntity(90,_bytes); - public FOR_MOTOREntity DM1GSF01 => new FOR_MOTOREntity(92,_bytes); - public FOR_MOTOREntity DM1HSF01 => new FOR_MOTOREntity(94,_bytes); - public FOR_MOTOREntity DM1ISF01 => new FOR_MOTOREntity(96,_bytes); - public FOR_MOTOREntity DM1JSF01 => new FOR_MOTOREntity(98,_bytes); - public FOR_MOTOREntity DM1KSF01 => new FOR_MOTOREntity(100,_bytes); - public FOR_MOTOREntity DM1LSF01 => new FOR_MOTOREntity(102,_bytes); - public FOR_MOTOREntity DM1MSF01 => new FOR_MOTOREntity(104,_bytes); - public FOR_MOTOREntity DM1NSF01 => new FOR_MOTOREntity(106,_bytes); + public FOR_MOTOREntity DM1ASI01 => new FOR_MOTOREntity(0, _bytes); + public FOR_MOTOREntity DM1BSI01 => new FOR_MOTOREntity(2, _bytes); + public FOR_MOTOREntity DM1CSI01 => new FOR_MOTOREntity(4, _bytes); + public FOR_MOTOREntity DM1DSI01 => new FOR_MOTOREntity(6, _bytes); + public FOR_MOTOREntity DM1ESI01 => new FOR_MOTOREntity(8, _bytes); + public FOR_MOTOREntity DM1FSI01 => new FOR_MOTOREntity(10, _bytes); + public FOR_MOTOREntity DM1GSI01 => new FOR_MOTOREntity(12, _bytes); + public FOR_MOTOREntity DM1HSI01 => new FOR_MOTOREntity(14, _bytes); + public FOR_MOTOREntity DM1ISI01 => new FOR_MOTOREntity(16, _bytes); + public FOR_MOTOREntity DM1JSI01 => new FOR_MOTOREntity(18, _bytes); + public FOR_MOTOREntity DM1KSI01 => new FOR_MOTOREntity(20, _bytes); + public FOR_MOTOREntity DM1LSI01 => new FOR_MOTOREntity(22, _bytes); + public FOR_MOTOREntity DM1MSI01 => new FOR_MOTOREntity(24, _bytes); + public FOR_MOTOREntity DM1NSI01 => new FOR_MOTOREntity(26, _bytes); + public FOR_MOTOREntity DM1OSI01 => new FOR_MOTOREntity(28, _bytes); + public FOR_MOTOREntity DM1ADB01 => new FOR_MOTOREntity(30, _bytes); + public FOR_MOTOREntity DM1BDB01 => new FOR_MOTOREntity(32, _bytes); + public FOR_MOTOREntity DM1CDB01 => new FOR_MOTOREntity(34, _bytes); + public FOR_MOTOREntity DM1DDB01 => new FOR_MOTOREntity(36, _bytes); + public FOR_MOTOREntity DM1EDB01 => new FOR_MOTOREntity(38, _bytes); + public FOR_MOTOREntity DM1FDB01 => new FOR_MOTOREntity(40, _bytes); + public FOR_MOTOREntity DM1GDB01 => new FOR_MOTOREntity(42, _bytes); + public FOR_MOTOREntity DM1HDB01 => new FOR_MOTOREntity(44, _bytes); + public FOR_MOTOREntity DM1IDB01 => new FOR_MOTOREntity(46, _bytes); + public FOR_MOTOREntity DM1JDB01 => new FOR_MOTOREntity(48, _bytes); + public FOR_MOTOREntity DM1KDB01 => new FOR_MOTOREntity(50, _bytes); + public FOR_MOTOREntity DM1LDB01 => new FOR_MOTOREntity(52, _bytes); + public FOR_MOTOREntity DM1ADF01 => new FOR_MOTOREntity(54, _bytes); + public FOR_MOTOREntity DM1BDF01 => new FOR_MOTOREntity(56, _bytes); + public FOR_MOTOREntity DM1CDF01 => new FOR_MOTOREntity(58, _bytes); + public FOR_MOTOREntity DM1DDF01 => new FOR_MOTOREntity(60, _bytes); + public FOR_MOTOREntity DM1EDF01 => new FOR_MOTOREntity(62, _bytes); + public FOR_MOTOREntity DM1FDF01 => new FOR_MOTOREntity(64, _bytes); + public FOR_MOTOREntity DM1GDF01 => new FOR_MOTOREntity(66, _bytes); + public FOR_MOTOREntity DM1HDF01 => new FOR_MOTOREntity(68, _bytes); + public FOR_MOTOREntity DM1IDF01 => new FOR_MOTOREntity(70, _bytes); + public FOR_MOTOREntity DM1JDF01 => new FOR_MOTOREntity(72, _bytes); + public FOR_MOTOREntity DM1KDF01 => new FOR_MOTOREntity(74, _bytes); + public FOR_MOTOREntity DM1LDF01 => new FOR_MOTOREntity(76, _bytes); + public FOR_MOTOREntity DMFILTER => new FOR_MOTOREntity(78, _bytes); + public FOR_MOTOREntity DM1ASF01 => new FOR_MOTOREntity(80, _bytes); + public FOR_MOTOREntity DM1BSF01 => new FOR_MOTOREntity(82, _bytes); + public FOR_MOTOREntity DM1CSF01 => new FOR_MOTOREntity(84, _bytes); + public FOR_MOTOREntity DM1DSF01 => new FOR_MOTOREntity(86, _bytes); + public FOR_MOTOREntity DM1ESF01 => new FOR_MOTOREntity(88, _bytes); + public FOR_MOTOREntity DM1FSF01 => new FOR_MOTOREntity(90, _bytes); + public FOR_MOTOREntity DM1GSF01 => new FOR_MOTOREntity(92, _bytes); + public FOR_MOTOREntity DM1HSF01 => new FOR_MOTOREntity(94, _bytes); + public FOR_MOTOREntity DM1ISF01 => new FOR_MOTOREntity(96, _bytes); + public FOR_MOTOREntity DM1JSF01 => new FOR_MOTOREntity(98, _bytes); + public FOR_MOTOREntity DM1KSF01 => new FOR_MOTOREntity(100, _bytes); + public FOR_MOTOREntity DM1LSF01 => new FOR_MOTOREntity(102, _bytes); + public FOR_MOTOREntity DM1MSF01 => new FOR_MOTOREntity(104, _bytes); + public FOR_MOTOREntity DM1NSF01 => new FOR_MOTOREntity(106, _bytes); - public FOR_MOTOR_VFDEntity _24T11A_D => new FOR_MOTOR_VFDEntity(108,_bytes); - public FOR_MOTOR_VFDEntity _64T01G_J => new FOR_MOTOR_VFDEntity(122,_bytes); - public FOR_MOTOR_VFDEntity _64T61E_F => new FOR_MOTOR_VFDEntity(136,_bytes); - public FOR_MOTOR_VFDEntity DM1K_NSF01 => new FOR_MOTOR_VFDEntity(150,_bytes); - public FOR_MOTOR_VFDEntity DM1OSF01 => new FOR_MOTOR_VFDEntity(164,_bytes); - public FOR_MOTOR_VFDEntity DM2ASF01 => new FOR_MOTOR_VFDEntity(178,_bytes); - public FOR_MOTOR_VFDEntity DM2BSF01 => new FOR_MOTOR_VFDEntity(192,_bytes); - public FOR_MOTOR_VFDEntity DM2CSF01 => new FOR_MOTOR_VFDEntity(206,_bytes); - public FOR_MOTOR_VFDEntity DM2DSF01 => new FOR_MOTOR_VFDEntity(220,_bytes); - public FOR_MOTOR_VFDEntity DM1DRY1 => new FOR_MOTOR_VFDEntity(234,_bytes); - public FOR_MOTOR_VFDEntity DM1DRY2 => new FOR_MOTOR_VFDEntity(248,_bytes); - public FOR_MOTOR_VFDEntity DM1DRY3 => new FOR_MOTOR_VFDEntity(262,_bytes); - public FOR_MOTOR_VFDEntity DM1DRY4 => new FOR_MOTOR_VFDEntity(276,_bytes); - public FOR_MOTOR_VFDEntity DM1GEM => new FOR_MOTOR_VFDEntity(290,_bytes); - public FOR_MOTOR_VFDEntity DM2GEM => new FOR_MOTOR_VFDEntity(304,_bytes); - public FOR_MOTOR_VFDEntity DM3GEM => new FOR_MOTOR_VFDEntity(318,_bytes); - public FOR_MOTOR_VFDEntity DM4GEM => new FOR_MOTOR_VFDEntity(332,_bytes); - public FOR_MOTOR_VFDEntity DM5GEM => new FOR_MOTOR_VFDEntity(346,_bytes); - public FOR_MOTOR_VFDEntity DM6GEM => new FOR_MOTOR_VFDEntity(360,_bytes); - public FOR_MOTOR_VFDEntity DM7GEM => new FOR_MOTOR_VFDEntity(374,_bytes); - public FOR_MOTOR_VFDEntity DM8GEM => new FOR_MOTOR_VFDEntity(388,_bytes); + public FOR_MOTOR_VFDEntity _24T11A_D => new FOR_MOTOR_VFDEntity(108, _bytes); + public FOR_MOTOR_VFDEntity _64T01G_J => new FOR_MOTOR_VFDEntity(122, _bytes); + public FOR_MOTOR_VFDEntity _64T61E_F => new FOR_MOTOR_VFDEntity(136, _bytes); + public FOR_MOTOR_VFDEntity DM1K_NSF01 => new FOR_MOTOR_VFDEntity(150, _bytes); + public FOR_MOTOR_VFDEntity DM1OSF01 => new FOR_MOTOR_VFDEntity(164, _bytes); + public FOR_MOTOR_VFDEntity DM2ASF01 => new FOR_MOTOR_VFDEntity(178, _bytes); + public FOR_MOTOR_VFDEntity DM2BSF01 => new FOR_MOTOR_VFDEntity(192, _bytes); + public FOR_MOTOR_VFDEntity DM2CSF01 => new FOR_MOTOR_VFDEntity(206, _bytes); + public FOR_MOTOR_VFDEntity DM2DSF01 => new FOR_MOTOR_VFDEntity(220, _bytes); + public FOR_MOTOR_VFDEntity DM1DRY1 => new FOR_MOTOR_VFDEntity(234, _bytes); + public FOR_MOTOR_VFDEntity DM1DRY2 => new FOR_MOTOR_VFDEntity(248, _bytes); + public FOR_MOTOR_VFDEntity DM1DRY3 => new FOR_MOTOR_VFDEntity(262, _bytes); + public FOR_MOTOR_VFDEntity DM1DRY4 => new FOR_MOTOR_VFDEntity(276, _bytes); + public FOR_MOTOR_VFDEntity DM1GEM => new FOR_MOTOR_VFDEntity(290, _bytes); + public FOR_MOTOR_VFDEntity DM2GEM => new FOR_MOTOR_VFDEntity(304, _bytes); + public FOR_MOTOR_VFDEntity DM3GEM => new FOR_MOTOR_VFDEntity(318, _bytes); + public FOR_MOTOR_VFDEntity DM4GEM => new FOR_MOTOR_VFDEntity(332, _bytes); + public FOR_MOTOR_VFDEntity DM5GEM => new FOR_MOTOR_VFDEntity(346, _bytes); + public FOR_MOTOR_VFDEntity DM6GEM => new FOR_MOTOR_VFDEntity(360, _bytes); + public FOR_MOTOR_VFDEntity DM7GEM => new FOR_MOTOR_VFDEntity(374, _bytes); + public FOR_MOTOR_VFDEntity DM8GEM => new FOR_MOTOR_VFDEntity(388, _bytes); - public FOR_MOTOREntity DMWETER1 => new FOR_MOTOREntity(402,_bytes); - public FOR_MOTOREntity DMWETER2 => new FOR_MOTOREntity(404,_bytes); - public FOR_MOTOREntity DMWETER3 => new FOR_MOTOREntity(406,_bytes); - public FOR_MOTOREntity DMWETER4 => new FOR_MOTOREntity(408,_bytes); - public FOR_MOTOREntity DMWETER5 => new FOR_MOTOREntity(410,_bytes); - public FOR_MOTOREntity DMWETER6 => new FOR_MOTOREntity(412,_bytes); - public FOR_MOTOREntity DMWETER7 => new FOR_MOTOREntity(414,_bytes); - public FOR_MOTOREntity DMWETER8 => new FOR_MOTOREntity(416,_bytes); + public FOR_MOTOREntity DMWETER1 => new FOR_MOTOREntity(402, _bytes); + public FOR_MOTOREntity DMWETER2 => new FOR_MOTOREntity(404, _bytes); + public FOR_MOTOREntity DMWETER3 => new FOR_MOTOREntity(406, _bytes); + public FOR_MOTOREntity DMWETER4 => new FOR_MOTOREntity(408, _bytes); + public FOR_MOTOREntity DMWETER5 => new FOR_MOTOREntity(410, _bytes); + public FOR_MOTOREntity DMWETER6 => new FOR_MOTOREntity(412, _bytes); + public FOR_MOTOREntity DMWETER7 => new FOR_MOTOREntity(414, _bytes); + public FOR_MOTOREntity DMWETER8 => new FOR_MOTOREntity(416, _bytes); } } diff --git a/DataBlockHelper/DBHelpers/DB2104Helper.cs b/DataBlockHelper/DBHelpers/DB2104Helper.cs index 02931b9..0e239f5 100644 --- a/DataBlockHelper/DBHelpers/DB2104Helper.cs +++ b/DataBlockHelper/DBHelpers/DB2104Helper.cs @@ -10,42 +10,48 @@ namespace DataBlockHelper.DBHelpers { public class DB2104Helper { - public RecipeCommEntity RecipeComm => RecipeCom(); + byte[] bytes; - private RecipeCommEntity RecipeCom() + public DB2104Helper() { - return new RecipeCommEntity(); + this.bytes = PlcConnect.Instance.Read("DB2104.0.0", 3578).Content; } + public RecipeCommEntity RecipeComm => RecipeCom(bytes); - public EnableStatusEntity EnableStatus => EnableS(); + private RecipeCommEntity RecipeCom(byte[] bytes) + { + return new RecipeCommEntity(bytes); + } + + public EnableStatusEntity EnableStatus => EnableS(bytes); - private EnableStatusEntity EnableS() + private EnableStatusEntity EnableS(byte[] bytes) { - return new EnableStatusEntity(); + return new EnableStatusEntity(bytes); } - public DryerEntity Dryer_D1 => new DryerEntity(58); - public DryerEntity Dryer_D2 => new DryerEntity(218); - public DryerEntity Dryer_D3 => new DryerEntity(378); - public DryerEntity Dryer_D4 => new DryerEntity(538); - - public GelatEntity Gelat_G1 => new GelatEntity(698); - public GelatEntity Gelat_G2 => new GelatEntity(858); - public GelatEntity Gelat_G3 => new GelatEntity(1018); - public GelatEntity Gelat_G4 => new GelatEntity(1178); - public GelatEntity Gelat_G5 => new GelatEntity(1338); - public GelatEntity Gelat_G6 => new GelatEntity(1498); - public GelatEntity Gelat_G7 => new GelatEntity(1658); - public GelatEntity Gelat_G8 => new GelatEntity(1818); - - public WeterEntity Weter_M1 => new WeterEntity(1978); - public WeterEntity Weter_M2 => new WeterEntity(2178); - public WeterEntity Weter_M3 => new WeterEntity(2378); - public WeterEntity Weter_M4 => new WeterEntity(2578); - public WeterEntity Weter_M5 => new WeterEntity(2778); - public WeterEntity Weter_M6 => new WeterEntity(2978); - public WeterEntity Weter_M7 => new WeterEntity(3178); - public WeterEntity Weter_M8 => new WeterEntity(3378); + public DryerEntity Dryer_D1 => new DryerEntity(58, bytes); + public DryerEntity Dryer_D2 => new DryerEntity(218, bytes); + public DryerEntity Dryer_D3 => new DryerEntity(378, bytes); + public DryerEntity Dryer_D4 => new DryerEntity(538, bytes); + + public GelatEntity Gelat_G1 => new GelatEntity(698, bytes); + public GelatEntity Gelat_G2 => new GelatEntity(858, bytes); + public GelatEntity Gelat_G3 => new GelatEntity(1018, bytes); + public GelatEntity Gelat_G4 => new GelatEntity(1178, bytes); + public GelatEntity Gelat_G5 => new GelatEntity(1338, bytes); + public GelatEntity Gelat_G6 => new GelatEntity(1498, bytes); + public GelatEntity Gelat_G7 => new GelatEntity(1658, bytes); + public GelatEntity Gelat_G8 => new GelatEntity(1818, bytes); + + public WeterEntity Weter_M1 => new WeterEntity(1978, bytes); + public WeterEntity Weter_M2 => new WeterEntity(2178, bytes); + public WeterEntity Weter_M3 => new WeterEntity(2378, bytes); + public WeterEntity Weter_M4 => new WeterEntity(2578, bytes); + public WeterEntity Weter_M5 => new WeterEntity(2778, bytes); + public WeterEntity Weter_M6 => new WeterEntity(2978, bytes); + public WeterEntity Weter_M7 => new WeterEntity(3178, bytes); + public WeterEntity Weter_M8 => new WeterEntity(3378, bytes); } diff --git a/DataBlockHelper/DBHelpers/DB2105Helper.cs b/DataBlockHelper/DBHelpers/DB2105Helper.cs index 8afed87..4dddd87 100644 --- a/DataBlockHelper/DBHelpers/DB2105Helper.cs +++ b/DataBlockHelper/DBHelpers/DB2105Helper.cs @@ -10,9 +10,14 @@ namespace DataBlockHelper.DBHelpers { public class DB2105Helper { - public List Plan => new PlanArrayManager(4, 0, 12).GetList(); - public bool[] Status => new FourBoolArrayManager(48).GetList(); - public bool[] End => new FourBoolArrayManager(50).GetList(); + byte[] bytes; + public DB2105Helper() + { + this.bytes = PlcConnect.Instance.Read("DB2105.0.0", 52).Content; + } + public List Plan => new PlanArrayManager(4, 0, 12, bytes).GetList(); + public bool[] Status => new FourBoolArrayManager(48, bytes).GetList(); + public bool[] End => new FourBoolArrayManager(50, bytes).GetList(); } } diff --git a/DataBlockHelper/DBHelpers/DB2106Helper.cs b/DataBlockHelper/DBHelpers/DB2106Helper.cs index 3d68a78..324ac64 100644 --- a/DataBlockHelper/DBHelpers/DB2106Helper.cs +++ b/DataBlockHelper/DBHelpers/DB2106Helper.cs @@ -10,8 +10,13 @@ namespace DataBlockHelper.DBHelpers { public class DB2106Helper { - public DryerReportEntity DryReport => new DryerReportEntity(0); - public GelReportEntity GelReport => new GelReportEntity(1072); - public WetMixingEntity WetReport => new WetMixingEntity(3568); + byte[] bytes; + public DB2106Helper() + { + this.bytes = PlcConnect.Instance.Read("DB2106.0.0", 5648).Content; + } + public DryerReportEntity DryReport => new DryerReportEntity(0, bytes); + public GelReportEntity GelReport => new GelReportEntity(1072, bytes); + public WetMixingEntity WetReport => new WetMixingEntity(3568, bytes); } } diff --git a/DataBlockHelper/DBHelpers/DB2107Helper.cs b/DataBlockHelper/DBHelpers/DB2107Helper.cs index 9bf9af1..32f700c 100644 --- a/DataBlockHelper/DBHelpers/DB2107Helper.cs +++ b/DataBlockHelper/DBHelpers/DB2107Helper.cs @@ -10,77 +10,81 @@ namespace DataBlockHelper.DBHelpers { public class DB2107Helper { - - - + private byte[] _bytes; + + public DB2107Helper() + { + _bytes = PlcConnect.Instance.Read("DB2107.0.0", 2063).Content; + } + // public OperateResult GetAll=>PlcConnect.Instance.Read("DB2107.0.0", 2057); - - public NormalStatusEntity NormalStatus => NormalS(); - private NormalStatusEntity NormalS() + public NormalStatusEntity NormalStatus => NormalS(_bytes); + + private NormalStatusEntity NormalS(byte[] bytes) { - return new NormalStatusEntity(); + return new NormalStatusEntity(bytes); } - public ControlSignEntity ControlSign => ControlS(); + public ControlSignEntity ControlSign => ControlS(_bytes); - private ControlSignEntity ControlS() + private ControlSignEntity ControlS(byte[] bytes) { - return new ControlSignEntity(); + return new ControlSignEntity(bytes); } - public PressureEntity Pressure => Press(); + public PressureEntity Pressure => Press(_bytes); - private PressureEntity Press() + private PressureEntity Press(byte[] bytes) { - return new PressureEntity(); + return new PressureEntity(bytes); } - public PIDEntity PID => Pid(); + public PIDEntity PID => Pid(_bytes); - private PIDEntity Pid() + private PIDEntity Pid(byte[] bytes) { - return new PIDEntity(); + return new PIDEntity(bytes); } - public WeightEntity Weight => Weigh(); + public WeightEntity Weight => Weigh(_bytes); - private WeightEntity Weigh() + private WeightEntity Weigh(byte[] bytes) { - return new WeightEntity(); + return new WeightEntity(bytes); } - public WeightPraEntity WeightPra => WeightP(); + public WeightPraEntity WeightPra => WeightP(_bytes); - private WeightPraEntity WeightP() + private WeightPraEntity WeightP(byte[] bytes) { - return new WeightPraEntity(); + return new WeightPraEntity(bytes); } - public SpeedEntity Speed => Spee(); + public SpeedEntity Speed => Spee(_bytes); - private SpeedEntity Spee() + private SpeedEntity Spee(byte[] bytes) { - return new SpeedEntity(); + return new SpeedEntity(bytes); } - public List Dryer => new UntiStatusHMIArrayManager(4, 1408, 32).GetList(); - public List Gelater => new UntiStatusHMIArrayManager(8, 1536, 32).GetList(); - public List Weter => new UntiStatusHMIArrayManager(8, 1792, 32).GetList(); + public List Dryer => new UntiStatusHMIArrayManager(4, 1408, 32, _bytes).GetList(); + public List Gelater => new UntiStatusHMIArrayManager(8, 1536, 32, _bytes).GetList(); + public List Weter => new UntiStatusHMIArrayManager(8, 1792, 32, _bytes).GetList(); - public ValveEntity Valve => Val(); + public ValveEntity Valve => Val(_bytes); - private ValveEntity Val() + private ValveEntity Val(byte[] bytes) { - return new ValveEntity(); + return new ValveEntity(bytes); } - public LevelEntity Level => Lev(); + public LevelEntity Level => Lev(_bytes); - private LevelEntity Lev() + private LevelEntity Lev(byte[] bytes) { - return new LevelEntity(); + return new LevelEntity(bytes); } diff --git a/DataBlockHelper/DataBlockHelper.csproj b/DataBlockHelper/DataBlockHelper.csproj index 7e3e0dd..b4790bb 100644 --- a/DataBlockHelper/DataBlockHelper.csproj +++ b/DataBlockHelper/DataBlockHelper.csproj @@ -54,9 +54,9 @@ - + @@ -75,6 +75,12 @@ + + + + + + @@ -85,18 +91,13 @@ - - - - - - +