diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/AddWaterLogEntity.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/AddWaterLogEntity.cs new file mode 100644 index 0000000..ce69b14 --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/AddWaterLogEntity.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// Website: http://www.freesql.net +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; +using FreeSql.DataAnnotations; + +namespace Mesnac.Action.ChemicalWeighing.ManualControl +{ + + + public partial class AddWaterLog + { + + [Column(IsPrimary = true, IsIdentity = true)] + public int Id { get; set; } + + + public DateTime CreateTime { get; set; } + + + public int DeviceId { get; set; } + + /// + /// 1是热水 2是冷水 0为空 + /// + + public int Hot { get; set; } + + } + +} diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ManualControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ManualControlAction.cs index ad79a28..ac2fa6f 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ManualControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/ManualControlAction.cs @@ -23,6 +23,7 @@ using System.Threading.Tasks; using System.Windows.Forms; using Mesnac.Action.ChemicalWeighing.LjMaterial; using Mesnac.Action.ChemicalWeighing.MinAn; +using System.Xml.Serialization; namespace Mesnac.Action.ChemicalWeighing.ManualControl { @@ -139,7 +140,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl base.RunIni(runtime); //必须要调用 materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ManualLogGridView").FirstOrDefault(); - LogInsertToDatabase(""); + ManualLogSelect(""); ControlImport(); SingleSelect(); @@ -484,27 +485,59 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl switch (GelChooseA) { case 1: + if(SelectAddWaterControl(1) == 2) + { + if (MessageBox.Show("上次糊化锅1已经加过冷水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.26.0", 1); PlcControl("DB2119.28.4", true); MesnacServiceManager.Instance.LoggingService.Info("冷水称A开始向糊化锅1排水"); + AdddWaterLogControl(1, 2); ManualLogControl("冷水称A开始向糊化锅1排水"); break; case 2: + if (SelectAddWaterControl(2) == 2) + { + if (MessageBox.Show("上次糊化锅2已经加过冷水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.26.0", 2); PlcControl("DB2119.28.4", true); MesnacServiceManager.Instance.LoggingService.Info("冷水称A开始向糊化锅2排水"); + AdddWaterLogControl(2, 2); ManualLogControl("冷水称A开始向糊化锅2排水"); break; case 3: + if (SelectAddWaterControl(3) == 2) + { + if (MessageBox.Show("上次糊化锅3已经加过冷水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.26.0", 3); PlcControl("DB2119.28.4", true); MesnacServiceManager.Instance.LoggingService.Info("冷水称A开始向糊化锅3排水"); + AdddWaterLogControl(3, 2); ManualLogControl("冷水称A开始向糊化锅3排水"); break; case 4: + if (SelectAddWaterControl(4) == 2) + { + if (MessageBox.Show("上次糊化锅4已经加过冷水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.26.0", 4); PlcControl("DB2119.28.4", true); MesnacServiceManager.Instance.LoggingService.Info("冷水称A开始向糊化锅4排水"); + AdddWaterLogControl(4, 2); ManualLogControl("冷水称A开始向糊化锅4排水"); break; default: @@ -523,27 +556,59 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl switch (GelChooseA) { case 1: + if (SelectAddWaterControl(1) == 0 || SelectAddWaterControl(1) == 1) + { + if (MessageBox.Show("上次糊化锅1已经加过热水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.6.0", 1); PlcControl("DB2119.8.4", true); MesnacServiceManager.Instance.LoggingService.Info("热水称A开始向糊化锅1排水"); + AdddWaterLogControl(1, 1); ManualLogControl("热水称A开始向糊化锅1排水"); break; case 2: + if (SelectAddWaterControl(2) == 0 || SelectAddWaterControl(2) == 1) + { + if (MessageBox.Show("上次糊化锅2已经加过热水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.6.0", 2); PlcControl("DB2119.8.4", true); MesnacServiceManager.Instance.LoggingService.Info("热水称A开始向糊化锅2排水"); + AdddWaterLogControl(2, 1); ManualLogControl("热水称A开始向糊化锅2排水"); break; case 3: + if (SelectAddWaterControl(3) == 0 || SelectAddWaterControl(3) == 1) + { + if (MessageBox.Show("上次糊化锅3已经加过热水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.6.0", 3); PlcControl("DB2119.8.4", true); MesnacServiceManager.Instance.LoggingService.Info("热水称A开始向糊化锅3排水"); + AdddWaterLogControl(3, 1); ManualLogControl("热水称A开始向糊化锅3排水"); break; case 4: + if (SelectAddWaterControl(4) == 0 || SelectAddWaterControl(4) == 1) + { + if (MessageBox.Show("上次糊化锅4已经加过热水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.6.0", 4); PlcControl("DB2119.8.4", true); MesnacServiceManager.Instance.LoggingService.Info("热水称A开始向糊化锅4排水"); + AdddWaterLogControl(4, 1); ManualLogControl("热水称A开始向糊化锅4排水"); break; default: @@ -562,27 +627,59 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl switch (GelChooseB) { case 5: + if (SelectAddWaterControl(5) == 2) + { + if (MessageBox.Show("上次糊化锅5已经加过冷水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.36.0", 1); PlcControl("DB2119.38.4", true); MesnacServiceManager.Instance.LoggingService.Info("冷水称B开始向糊化锅5排水"); + AdddWaterLogControl(5, 2); ManualLogControl("冷水称B开始向糊化锅5排水"); break; case 6: + if (SelectAddWaterControl(6) == 2) + { + if (MessageBox.Show("上次糊化锅6已经加过冷水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.36.0", 2); PlcControl("DB2119.38.4", true); MesnacServiceManager.Instance.LoggingService.Info("冷水称B开始向糊化锅6排水"); + AdddWaterLogControl(6, 2); ManualLogControl("冷水称B开始向糊化锅6排水"); break; case 7: + if (SelectAddWaterControl(7) == 2) + { + if (MessageBox.Show("上次糊化锅7已经加过冷水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.36.0", 3); PlcControl("DB2119.38.4", true); MesnacServiceManager.Instance.LoggingService.Info("冷水称B开始向糊化锅7排水"); + AdddWaterLogControl(7, 2); ManualLogControl("冷水称B开始向糊化锅7排水"); break; case 8: + if (SelectAddWaterControl(8) == 2) + { + if (MessageBox.Show("上次糊化锅8已经加过冷水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.36.0", 4); PlcControl("DB2119.38.4", true); MesnacServiceManager.Instance.LoggingService.Info("冷水称B开始向糊化锅8排水"); + AdddWaterLogControl(8, 2); ManualLogControl("冷水称B开始向糊化锅8排水"); break; default: @@ -601,27 +698,59 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl switch (GelChooseB) { case 5: + if (SelectAddWaterControl(5) == 0 || SelectAddWaterControl(5) == 1) + { + if (MessageBox.Show("上次糊化锅5已经加过热水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.16.0", 1); PlcControl("DB2119.18.4", true); MesnacServiceManager.Instance.LoggingService.Info("热水称B开始向糊化锅5排水"); + AdddWaterLogControl(5, 1); ManualLogControl("热水称B开始向糊化锅5排水"); break; case 6: + if (SelectAddWaterControl(6) == 0 || SelectAddWaterControl(6) == 1) + { + if (MessageBox.Show("上次糊化锅6已经加过热水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.16.0", 2); PlcControl("DB2119.18.4", true); MesnacServiceManager.Instance.LoggingService.Info("热水称B开始向糊化锅6排水"); + AdddWaterLogControl(6, 1); ManualLogControl("热水称B开始向糊化锅6排水"); break; case 7: + if (SelectAddWaterControl(7) == 0 || SelectAddWaterControl(7) == 1) + { + if (MessageBox.Show("上次糊化锅7已经加过热水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.16.0", 3); PlcControl("DB2119.18.4", true); MesnacServiceManager.Instance.LoggingService.Info("热水称B开始向糊化锅7排水"); + AdddWaterLogControl(7, 1); ManualLogControl("热水称B开始向糊化锅7排水"); break; case 8: + if (SelectAddWaterControl(8) == 0 || SelectAddWaterControl(8) == 1) + { + if (MessageBox.Show("上次糊化锅8已经加过热水,确认再次添加?", "排水确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + return; + } + } PlcControl("DB2119.16.0", 4); PlcControl("DB2119.18.4", true); MesnacServiceManager.Instance.LoggingService.Info("热水称B开始向糊化锅8排水"); + AdddWaterLogControl(8, 1); ManualLogControl("热水称B开始向糊化锅8排水"); break; default: @@ -1063,7 +1192,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl if (WetRequest1 == runtime.Sender) { string key = keywords.MCValue.ToString(); - LogInsertToDatabase(key); + ManualLogSelect(key); } @@ -1154,13 +1283,13 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl #endregion - #region 日志控制 + #region 数据库日志控制 /// /// 日志查询 /// /// 查询关键字 - private void LogInsertToDatabase(string txt) + private void ManualLogSelect(string txt) { string sql = "select top 500 id, logtext, logtime, value from Manual_Log "; @@ -1206,8 +1335,8 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl }; FreeSqlUnit.Instance.Insert(Log).ExecuteIdentity(); - - LogInsertToDatabase(""); + + ManualLogSelect(""); } private void ManualLogControl(string logName, int deviceno, int devicekind) @@ -1226,7 +1355,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl FreeSqlUnit.Instance.Insert(Log).ExecuteIdentity(); - LogInsertToDatabase(""); + ManualLogSelect(""); } private void ManualLogControl(string logName) @@ -1245,9 +1374,38 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl FreeSqlUnit.Instance.Insert(Log).ExecuteIdentity(); - LogInsertToDatabase(""); + ManualLogSelect(""); } + /// + /// + /// + /// + /// 1是热水 2是冷水 0为空 + private void AdddWaterLogControl(int deviceNo, int isHot) + { + var log = new AddWaterLog() + { + DeviceId = deviceNo, + Hot = isHot, + CreateTime = DateTime.Now, + }; + + FreeSqlUnit.Instance.Insert(log).ExecuteIdentity(); + } + + private int SelectAddWaterControl(int deviceNo) + { + var list = FreeSqlUnit.Instance.Select().Where(x => x.DeviceId == deviceNo).ToList(); + if (list.Count == 0) + { + return 0; + } + return Convert.ToInt32(list.LastOrDefault().Hot); + } + + + #endregion } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj index 16eeb6d..0617c9d 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj @@ -176,9 +176,6 @@ False ..\..\..\PlugInPlatform\Mesnac.PlugIn.dll - - ..\..\Microsoft.Office.Interop.Excel.dll - @@ -516,6 +513,7 @@ + diff --git a/DataBlockHelper/DBHelpers/DB1Helper.cs b/DataBlockHelper/DBHelpers/DB1Helper.cs index 2307827..ddd5a58 100644 --- a/DataBlockHelper/DBHelpers/DB1Helper.cs +++ b/DataBlockHelper/DBHelpers/DB1Helper.cs @@ -7,79 +7,85 @@ using System.Threading.Tasks; namespace DataBlockHelper.DBHelpers { - public class DB1Helper + public class DB1Helper : DBHelper { - public ForAoaLogInFC3005Entity PR1DBT01 => new ForAoaLogInFC3005Entity(0); - public ForAoaLogInFC3005Entity PR1DBT02 => new ForAoaLogInFC3005Entity(8); - public ForAoaLogInFC3005Entity PR1DBT03 => new ForAoaLogInFC3005Entity(16); - public ForAoaLogInFC3005Entity PR1DBT04 => new ForAoaLogInFC3005Entity(24); - public ForAoaLogInFC3005Entity PR2DBT01 => new ForAoaLogInFC3005Entity(32); - public ForAoaLogInFC3005Entity PR2DBT02 => new ForAoaLogInFC3005Entity(40); - public ForAoaLogInFC3005Entity PR2DBT03 => new ForAoaLogInFC3005Entity(48); - public ForAoaLogInFC3005Entity PR2DBT04 => new ForAoaLogInFC3005Entity(56); - public ForAoaLogInFC3005Entity PR3DBT01 => new ForAoaLogInFC3005Entity(64); - public ForAoaLogInFC3005Entity PR3DBT02 => new ForAoaLogInFC3005Entity(72); - public ForAoaLogInFC3005Entity PR3DBT03 => new ForAoaLogInFC3005Entity(80); - public ForAoaLogInFC3005Entity PR3DBT04 => new ForAoaLogInFC3005Entity(88); - public ForAoaLogInFC3005Entity PR1ASI01 => new ForAoaLogInFC3005Entity(96); - public ForAoaLogInFC3005Entity PR1BSI01 => new ForAoaLogInFC3005Entity(104); - public ForAoaLogInFC3005Entity PR1CSI01 => new ForAoaLogInFC3005Entity(112); - public ForAoaLogInFC3005Entity PR1DSI01 => new ForAoaLogInFC3005Entity(120); - public ForAoaLogInFC3005Entity PR1ESI01 => new ForAoaLogInFC3005Entity(128); - public ForAoaLogInFC3005Entity PR1FSI01 => new ForAoaLogInFC3005Entity(136); - public ForAoaLogInFC3005Entity PR1GSI01 => new ForAoaLogInFC3005Entity(144); - public ForAoaLogInFC3005Entity PR1HSI01 => new ForAoaLogInFC3005Entity(152); - public ForAoaLogInFC3005Entity PR1ISI01 => new ForAoaLogInFC3005Entity(160); - public ForAoaLogInFC3005Entity PR1JSI01 => new ForAoaLogInFC3005Entity(168); - public ForAoaLogInFC3005Entity PR1OSI01 => new ForAoaLogInFC3005Entity(176); - public ForAoaLogInFC3005Entity PR1PCP01 => new ForAoaLogInFC3005Entity(184); - public ForAoaLogInFC3005Entity PR1PCP02 => new ForAoaLogInFC3005Entity(192); - public ForAoaLogInFC3005Entity PR1PCP03 => new ForAoaLogInFC3005Entity(200); - public ForAoaLogInFC3005Entity LS1ASI01 => new ForAoaLogInFC3005Entity(208); - public ForAoaLogInFC3005Entity LS1BSI01 => new ForAoaLogInFC3005Entity(216); - public ForAoaLogInFC3005Entity LS1CSI01 => new ForAoaLogInFC3005Entity(224); - public ForAoaLogInFC3005Entity LS1DSI01 => new ForAoaLogInFC3005Entity(232); - public ForAoaLogInFC3005Entity LS1ESI01 => new ForAoaLogInFC3005Entity(240); - public ForAoaLogInFC3005Entity LS1FSI01 => new ForAoaLogInFC3005Entity(248); - public ForAoaLogInFC3005Entity LS1GSI01 => new ForAoaLogInFC3005Entity(256); - public ForAoaLogInFC3005Entity LS1HSI01 => new ForAoaLogInFC3005Entity(264); - public ForAoaLogInFC3005Entity LS1ISI01 => new ForAoaLogInFC3005Entity(272); - public ForAoaLogInFC3005Entity LS1JSI01 => new ForAoaLogInFC3005Entity(280); - public ForAoaLogInFC3005Entity LS1OSI01 => new ForAoaLogInFC3005Entity(288); - public ForAoaLogInFC3005Entity HR1ASI01 => new ForAoaLogInFC3005Entity(296); - public ForAoaLogInFC3005Entity HR1BSI01 => new ForAoaLogInFC3005Entity(304); - public ForAoaLogInFC3005Entity HR1CSI01 => new ForAoaLogInFC3005Entity(312); - public ForAoaLogInFC3005Entity HR1DSI01 => new ForAoaLogInFC3005Entity(320); - public ForAoaLogInFC3005Entity HR1ESI01 => new ForAoaLogInFC3005Entity(328); - public ForAoaLogInFC3005Entity HR1FSI01 => new ForAoaLogInFC3005Entity(336); - public ForAoaLogInFC3005Entity HR1GSI01 => new ForAoaLogInFC3005Entity(344); - public ForAoaLogInFC3005Entity HR1HSI01 => new ForAoaLogInFC3005Entity(352); - public ForAoaLogInFC3005Entity HR1ISI01 => new ForAoaLogInFC3005Entity(360); - public ForAoaLogInFC3005Entity HR1JSI01 => new ForAoaLogInFC3005Entity(368); - public ForAoaLogInFC3005Entity HR1OSI01 => new ForAoaLogInFC3005Entity(376); - public ForAoaLogInFC3006Entity SPV1DBT01 => new ForAoaLogInFC3006Entity(384); - public ForAoaLogInFC3006Entity SPV1DBT02 => new ForAoaLogInFC3006Entity(392); - public ForAoaLogInFC3006Entity SPV2DBT01 => new ForAoaLogInFC3006Entity(400); - public ForAoaLogInFC3006Entity SPV2DBT02 => new ForAoaLogInFC3006Entity(408); - public ForAoaLogInFC3006Entity SPV3DBT01 => new ForAoaLogInFC3006Entity(416); - public ForAoaLogInFC3006Entity SPV3DBT02 => new ForAoaLogInFC3006Entity(424); + public DB1Helper() + { + bytes = PlcConnect.Instance.Read("DB1.0.0", 552).Content; + } - public ForAoaLogInFC3005Entity From_SiloA => new ForAoaLogInFC3005Entity(432); - public ForAoaLogInFC3005Entity From_SiloB => new ForAoaLogInFC3005Entity(440); - public ForAoaLogInFC3005Entity From_SiloC => new ForAoaLogInFC3005Entity(448); - public ForAoaLogInFC3005Entity From_SiloD => new ForAoaLogInFC3005Entity(456); - public ForAoaLogInFC3005Entity From_SiloE => new ForAoaLogInFC3005Entity(464); - public ForAoaLogInFC3005Entity From_SiloF => new ForAoaLogInFC3005Entity(472); - public ForAoaLogInFC3005Entity From_SiloG => new ForAoaLogInFC3005Entity(480); - public ForAoaLogInFC3005Entity From_SiloH => new ForAoaLogInFC3005Entity(488); - public ForAoaLogInFC3005Entity From_SiloI => new ForAoaLogInFC3005Entity(496); - public ForAoaLogInFC3005Entity From_SiloJ => new ForAoaLogInFC3005Entity(504); - public ForAoaLogInFC3005Entity From_SiloK => new ForAoaLogInFC3005Entity(512); - public ForAoaLogInFC3005Entity From_SiloL => new ForAoaLogInFC3005Entity(520); - public ForAoaLogInFC3005Entity From_SiloM => new ForAoaLogInFC3005Entity(528); - public ForAoaLogInFC3005Entity From_SiloN => new ForAoaLogInFC3005Entity(536); - public ForAoaLogInFC3005Entity From_SiloO => new ForAoaLogInFC3005Entity(544); + public ForAoaLogInFC3005Entity PR1DBT01 => new ForAoaLogInFC3005Entity(0, bytes); + public ForAoaLogInFC3005Entity PR1DBT02 => new ForAoaLogInFC3005Entity(8, bytes); + public ForAoaLogInFC3005Entity PR1DBT03 => new ForAoaLogInFC3005Entity(16, bytes); + public ForAoaLogInFC3005Entity PR1DBT04 => new ForAoaLogInFC3005Entity(24, bytes); + public ForAoaLogInFC3005Entity PR2DBT01 => new ForAoaLogInFC3005Entity(32, bytes); + public ForAoaLogInFC3005Entity PR2DBT02 => new ForAoaLogInFC3005Entity(40, bytes); + public ForAoaLogInFC3005Entity PR2DBT03 => new ForAoaLogInFC3005Entity(48, bytes); + public ForAoaLogInFC3005Entity PR2DBT04 => new ForAoaLogInFC3005Entity(56, bytes); + public ForAoaLogInFC3005Entity PR3DBT01 => new ForAoaLogInFC3005Entity(64, bytes); + public ForAoaLogInFC3005Entity PR3DBT02 => new ForAoaLogInFC3005Entity(72, bytes); + public ForAoaLogInFC3005Entity PR3DBT03 => new ForAoaLogInFC3005Entity(80, bytes); + public ForAoaLogInFC3005Entity PR3DBT04 => new ForAoaLogInFC3005Entity(88, bytes); + public ForAoaLogInFC3005Entity PR1ASI01 => new ForAoaLogInFC3005Entity(96, bytes); + public ForAoaLogInFC3005Entity PR1BSI01 => new ForAoaLogInFC3005Entity(104, bytes); + public ForAoaLogInFC3005Entity PR1CSI01 => new ForAoaLogInFC3005Entity(112, bytes); + public ForAoaLogInFC3005Entity PR1DSI01 => new ForAoaLogInFC3005Entity(120, bytes); + public ForAoaLogInFC3005Entity PR1ESI01 => new ForAoaLogInFC3005Entity(128, bytes); + public ForAoaLogInFC3005Entity PR1FSI01 => new ForAoaLogInFC3005Entity(136, bytes); + public ForAoaLogInFC3005Entity PR1GSI01 => new ForAoaLogInFC3005Entity(144, bytes); + public ForAoaLogInFC3005Entity PR1HSI01 => new ForAoaLogInFC3005Entity(152, bytes); + public ForAoaLogInFC3005Entity PR1ISI01 => new ForAoaLogInFC3005Entity(160, bytes); + public ForAoaLogInFC3005Entity PR1JSI01 => new ForAoaLogInFC3005Entity(168, bytes); + public ForAoaLogInFC3005Entity PR1OSI01 => new ForAoaLogInFC3005Entity(176, bytes); + public ForAoaLogInFC3005Entity PR1PCP01 => new ForAoaLogInFC3005Entity(184, bytes); + public ForAoaLogInFC3005Entity PR1PCP02 => new ForAoaLogInFC3005Entity(192, bytes); + public ForAoaLogInFC3005Entity PR1PCP03 => new ForAoaLogInFC3005Entity(200, bytes); + public ForAoaLogInFC3005Entity LS1ASI01 => new ForAoaLogInFC3005Entity(208, bytes); + public ForAoaLogInFC3005Entity LS1BSI01 => new ForAoaLogInFC3005Entity(216, bytes); + public ForAoaLogInFC3005Entity LS1CSI01 => new ForAoaLogInFC3005Entity(224, bytes); + public ForAoaLogInFC3005Entity LS1DSI01 => new ForAoaLogInFC3005Entity(232, bytes); + public ForAoaLogInFC3005Entity LS1ESI01 => new ForAoaLogInFC3005Entity(240, bytes); + public ForAoaLogInFC3005Entity LS1FSI01 => new ForAoaLogInFC3005Entity(248, bytes); + public ForAoaLogInFC3005Entity LS1GSI01 => new ForAoaLogInFC3005Entity(256, bytes); + public ForAoaLogInFC3005Entity LS1HSI01 => new ForAoaLogInFC3005Entity(264, bytes); + public ForAoaLogInFC3005Entity LS1ISI01 => new ForAoaLogInFC3005Entity(272, bytes); + public ForAoaLogInFC3005Entity LS1JSI01 => new ForAoaLogInFC3005Entity(280, bytes); + public ForAoaLogInFC3005Entity LS1OSI01 => new ForAoaLogInFC3005Entity(288, bytes); + public ForAoaLogInFC3005Entity HR1ASI01 => new ForAoaLogInFC3005Entity(296, bytes); + public ForAoaLogInFC3005Entity HR1BSI01 => new ForAoaLogInFC3005Entity(304, bytes); + public ForAoaLogInFC3005Entity HR1CSI01 => new ForAoaLogInFC3005Entity(312, bytes); + public ForAoaLogInFC3005Entity HR1DSI01 => new ForAoaLogInFC3005Entity(320, bytes); + public ForAoaLogInFC3005Entity HR1ESI01 => new ForAoaLogInFC3005Entity(328, bytes); + public ForAoaLogInFC3005Entity HR1FSI01 => new ForAoaLogInFC3005Entity(336, bytes); + public ForAoaLogInFC3005Entity HR1GSI01 => new ForAoaLogInFC3005Entity(344, bytes); + public ForAoaLogInFC3005Entity HR1HSI01 => new ForAoaLogInFC3005Entity(352, bytes); + public ForAoaLogInFC3005Entity HR1ISI01 => new ForAoaLogInFC3005Entity(360, bytes); + public ForAoaLogInFC3005Entity HR1JSI01 => new ForAoaLogInFC3005Entity(368, bytes); + public ForAoaLogInFC3005Entity HR1OSI01 => new ForAoaLogInFC3005Entity(376, bytes); + + public ForAoaLogInFC3006Entity SPV1DBT01 => new ForAoaLogInFC3006Entity(384, bytes); + public ForAoaLogInFC3006Entity SPV1DBT02 => new ForAoaLogInFC3006Entity(392, bytes); + public ForAoaLogInFC3006Entity SPV2DBT01 => new ForAoaLogInFC3006Entity(400, bytes); + public ForAoaLogInFC3006Entity SPV2DBT02 => new ForAoaLogInFC3006Entity(408, bytes); + public ForAoaLogInFC3006Entity SPV3DBT01 => new ForAoaLogInFC3006Entity(416, bytes); + public ForAoaLogInFC3006Entity SPV3DBT02 => new ForAoaLogInFC3006Entity(424, bytes); + + public ForAoaLogInFC3005Entity From_SiloA => new ForAoaLogInFC3005Entity(432, bytes); + public ForAoaLogInFC3005Entity From_SiloB => new ForAoaLogInFC3005Entity(440, bytes); + public ForAoaLogInFC3005Entity From_SiloC => new ForAoaLogInFC3005Entity(448, bytes); + public ForAoaLogInFC3005Entity From_SiloD => new ForAoaLogInFC3005Entity(456, bytes); + public ForAoaLogInFC3005Entity From_SiloE => new ForAoaLogInFC3005Entity(464, bytes); + public ForAoaLogInFC3005Entity From_SiloF => new ForAoaLogInFC3005Entity(472, bytes); + public ForAoaLogInFC3005Entity From_SiloG => new ForAoaLogInFC3005Entity(480, bytes); + public ForAoaLogInFC3005Entity From_SiloH => new ForAoaLogInFC3005Entity(488, bytes); + public ForAoaLogInFC3005Entity From_SiloI => new ForAoaLogInFC3005Entity(496, bytes); + public ForAoaLogInFC3005Entity From_SiloJ => new ForAoaLogInFC3005Entity(504, bytes); + public ForAoaLogInFC3005Entity From_SiloK => new ForAoaLogInFC3005Entity(512, bytes); + public ForAoaLogInFC3005Entity From_SiloL => new ForAoaLogInFC3005Entity(520, bytes); + public ForAoaLogInFC3005Entity From_SiloM => new ForAoaLogInFC3005Entity(528, bytes); + public ForAoaLogInFC3005Entity From_SiloN => new ForAoaLogInFC3005Entity(536, bytes); + public ForAoaLogInFC3005Entity From_SiloO => new ForAoaLogInFC3005Entity(544, bytes); } diff --git a/DataBlockHelper/DBHelpers/DB90Helper.cs b/DataBlockHelper/DBHelpers/DB90Helper.cs index e12f3c8..610cacd 100644 --- a/DataBlockHelper/DBHelpers/DB90Helper.cs +++ b/DataBlockHelper/DBHelpers/DB90Helper.cs @@ -2,93 +2,101 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; +using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace DataBlockHelper.DBHelpers { - public class DB90Helper + public class DB90Helper : DBHelper { - public ForValveSingleEntity BU3DBT06 => new ForValveSingleEntity(0); - public ForValveSingleEntity BU3DBT07 => new ForValveSingleEntity(2); - public ForValveSingleEntity BU1DBT01 => new ForValveSingleEntity(4); - public ForValveSingleEntity BU1DBT03 => new ForValveSingleEntity(6); - public ForValveSingleEntity BU1DBT02 => new ForValveSingleEntity(8); - public ForValveSingleEntity BU1DBT04 => new ForValveSingleEntity(10); - public ForValveSingleEntity BU2DBT01 => new ForValveSingleEntity(12); - public ForValveSingleEntity BU2DBT03 => new ForValveSingleEntity(14); - public ForValveSingleEntity BU2DBT02 => new ForValveSingleEntity(16); - public ForValveSingleEntity BU2DBT04 => new ForValveSingleEntity(18); - public ForValveSingleEntity BU3DBT01 => new ForValveSingleEntity(20); - public ForValveSingleEntity BU3DBT03 => new ForValveSingleEntity(22); - public ForValveSingleEntity BU3DBT02 => new ForValveSingleEntity(24); - public ForValveSingleEntity BU3DBT04 => new ForValveSingleEntity(26); - public ForValveSingleEntity BU1DBT06 => new ForValveSingleEntity(28); - public ForValveSingleEntity BU1DBT07 => new ForValveSingleEntity(30); - public ForValveSingleEntity BU2DBT06 => new ForValveSingleEntity(32); - public ForValveSingleEntity BU2DBT07 => new ForValveSingleEntity(34); - public ForValveSingleEntity AS1DBT01 => new ForValveSingleEntity(36); - public ForValveSingleEntity AS1DBT02 => new ForValveSingleEntity(38); - public ForValveSingleEntity AS1DBT03 => new ForValveSingleEntity(40); - public ForValveSingleEntity AS1DBT04 => new ForValveSingleEntity(42); - public ForValveSingleEntity AS1DBT05 => new ForValveSingleEntity(44); - public ForValveSingleEntity AS1DBT06 => new ForValveSingleEntity(46); - public ForValveSingleEntity AS1DBT07 => new ForValveSingleEntity(48); - public ForValveSingleEntity AS2DBT01 => new ForValveSingleEntity(50); - public ForValveSingleEntity AS2DBT02 => new ForValveSingleEntity(52); - public ForValveSingleEntity AS2DBT03 => new ForValveSingleEntity(54); - public ForValveSingleEntity AS2DBT04 => new ForValveSingleEntity(56); - public ForValveSingleEntity AS2DBT05 => new ForValveSingleEntity(58); - public ForValveSingleEntity AS2DBT06 => new ForValveSingleEntity(60); - public ForValveSingleEntity AS2DBT07 => new ForValveSingleEntity(62); - public ForValveSingleEntity AS3DBT01 => new ForValveSingleEntity(64); - public ForValveSingleEntity AS3DBT02 => new ForValveSingleEntity(66); - public ForValveSingleEntity AS3DBT03 => new ForValveSingleEntity(68); - public ForValveSingleEntity AS3DBT04 => new ForValveSingleEntity(70); - public ForValveSingleEntity AS3DBT05 => new ForValveSingleEntity(72); - public ForValveSingleEntity AS3DBT06 => new ForValveSingleEntity(74); - public ForValveSingleEntity AS3DBT07 => new ForValveSingleEntity(76); - public ForValveSingleEntity AS1PCP01 => new ForValveSingleEntity(78); - public ForValveSingleEntity AS1PCP02 => new ForValveSingleEntity(80); - public ForValveSingleEntity AS1PCP03 => new ForValveSingleEntity(82); - public ForValveSingleEntity AS1ASI01 => new ForValveSingleEntity(84); - public ForValveSingleEntity AS1BSI01 => new ForValveSingleEntity(86); - public ForValveSingleEntity AS1CSI01 => new ForValveSingleEntity(88); - public ForValveSingleEntity AS1DSI01 => new ForValveSingleEntity(90); - public ForValveSingleEntity AS1ESI01 => new ForValveSingleEntity(92); - public ForValveSingleEntity AS1FSI01 => new ForValveSingleEntity(94); - public ForValveSingleEntity AS1GSI01 => new ForValveSingleEntity(96); - public ForValveSingleEntity AS1HSI01 => new ForValveSingleEntity(98); - public ForValveSingleEntity AS1ISI01 => new ForValveSingleEntity(100); - public ForValveSingleEntity AS1JSI01 => new ForValveSingleEntity(102); - public ForValveSingleEntity AS1OSI01 => new ForValveSingleEntity(104); - public ForValveSingleEntity SV1DSM01 => new ForValveSingleEntity(106); - public ForValveSingleEntity SV1DSM02 => new ForValveSingleEntity(108); - public ForValveSingleEntity SV2DSM01 => new ForValveSingleEntity(110); - public ForValveSingleEntity SV2DSM02 => new ForValveSingleEntity(112); - public ForValveSingleEntity SV3DSM01 => new ForValveSingleEntity(114); - public ForValveSingleEntity SV3DSM02 => new ForValveSingleEntity(116); - public ForValveSingleEntity PV1GDC01 => new ForValveSingleEntity(118); - public ForValveSingleEntity PV1GDC02 => new ForValveSingleEntity(120); - public ForValveDoubleEntity DV1PCP01 => new ForValveDoubleEntity(122); - public ForValveDoubleEntity DV1PCP02 => new ForValveDoubleEntity(124); - public ForValveDoubleEntity DV1PCP03 => new ForValveDoubleEntity(126); - public ForValveDoubleEntity DV1PCP04 => new ForValveDoubleEntity(128); - public ForValveDoubleEntity DV1PCP05 => new ForValveDoubleEntity(130); - public ForValveDoubleEntity DV1PCP06 => new ForValveDoubleEntity(132); - public ForValveDoubleEntity DV1PCP07 => new ForValveDoubleEntity(134); - public ForValveDoubleEntity DV1PCP08 => new ForValveDoubleEntity(136); - public ForValveDoubleEntity DV1PCP09 => new ForValveDoubleEntity(138); - public ForValveDoubleEntity DV1PCP10 => new ForValveDoubleEntity(140); - public ForValveDoubleEntity DV1PCP11 => new ForValveDoubleEntity(142); - public ForValveDoubleEntity DV1PCP12 => new ForValveDoubleEntity(144); - public ForValveDoubleEntity DV1PCP13 => new ForValveDoubleEntity(146); - public ForValveDoubleEntity DV1PCP14 => new ForValveDoubleEntity(148); - public ForValveDoubleEntity DV1PCP15 => new ForValveDoubleEntity(150); + public DB90Helper() + { + bytes = PlcConnect.Instance.Read("DB90.0.0", 154).Content; + } + public ForValveSingleEntity BU3DBT06 => new ForValveSingleEntity(0, bytes); + public ForValveSingleEntity BU3DBT07 => new ForValveSingleEntity(2, bytes); + public ForValveSingleEntity BU1DBT01 => new ForValveSingleEntity(4, bytes); + public ForValveSingleEntity BU1DBT03 => new ForValveSingleEntity(6, bytes); + public ForValveSingleEntity BU1DBT02 => new ForValveSingleEntity(8, bytes); + public ForValveSingleEntity BU1DBT04 => new ForValveSingleEntity(10, bytes); + public ForValveSingleEntity BU2DBT01 => new ForValveSingleEntity(12, bytes); + public ForValveSingleEntity BU2DBT03 => new ForValveSingleEntity(14, bytes); + public ForValveSingleEntity BU2DBT02 => new ForValveSingleEntity(16, bytes); + public ForValveSingleEntity BU2DBT04 => new ForValveSingleEntity(18, bytes); + public ForValveSingleEntity BU3DBT01 => new ForValveSingleEntity(20, bytes); + public ForValveSingleEntity BU3DBT03 => new ForValveSingleEntity(22, bytes); + public ForValveSingleEntity BU3DBT02 => new ForValveSingleEntity(24, bytes); + public ForValveSingleEntity BU3DBT04 => new ForValveSingleEntity(26, bytes); + public ForValveSingleEntity BU1DBT06 => new ForValveSingleEntity(28, bytes); + public ForValveSingleEntity BU1DBT07 => new ForValveSingleEntity(30, bytes); + public ForValveSingleEntity BU2DBT06 => new ForValveSingleEntity(32, bytes); + public ForValveSingleEntity BU2DBT07 => new ForValveSingleEntity(34, bytes); + public ForValveSingleEntity AS1DBT01 => new ForValveSingleEntity(36, bytes); + public ForValveSingleEntity AS1DBT02 => new ForValveSingleEntity(38, bytes); + public ForValveSingleEntity AS1DBT03 => new ForValveSingleEntity(40, bytes); + public ForValveSingleEntity AS1DBT04 => new ForValveSingleEntity(42, bytes); + public ForValveSingleEntity AS1DBT05 => new ForValveSingleEntity(44, bytes); + public ForValveSingleEntity AS1DBT06 => new ForValveSingleEntity(46, bytes); + public ForValveSingleEntity AS1DBT07 => new ForValveSingleEntity(48, bytes); + public ForValveSingleEntity AS2DBT01 => new ForValveSingleEntity(50, bytes); + public ForValveSingleEntity AS2DBT02 => new ForValveSingleEntity(52, bytes); + public ForValveSingleEntity AS2DBT03 => new ForValveSingleEntity(54, bytes); + public ForValveSingleEntity AS2DBT04 => new ForValveSingleEntity(56, bytes); + public ForValveSingleEntity AS2DBT05 => new ForValveSingleEntity(58, bytes); + public ForValveSingleEntity AS2DBT06 => new ForValveSingleEntity(60, bytes); + public ForValveSingleEntity AS2DBT07 => new ForValveSingleEntity(62, bytes); + public ForValveSingleEntity AS3DBT01 => new ForValveSingleEntity(64, bytes); + public ForValveSingleEntity AS3DBT02 => new ForValveSingleEntity(66, bytes); + public ForValveSingleEntity AS3DBT03 => new ForValveSingleEntity(68, bytes); + public ForValveSingleEntity AS3DBT04 => new ForValveSingleEntity(70, bytes); + public ForValveSingleEntity AS3DBT05 => new ForValveSingleEntity(72, bytes); + public ForValveSingleEntity AS3DBT06 => new ForValveSingleEntity(74, bytes); + public ForValveSingleEntity AS3DBT07 => new ForValveSingleEntity(76, bytes); + public ForValveSingleEntity AS1PCP01 => new ForValveSingleEntity(78, bytes); + public ForValveSingleEntity AS1PCP02 => new ForValveSingleEntity(80, bytes); + public ForValveSingleEntity AS1PCP03 => new ForValveSingleEntity(82, bytes); + public ForValveSingleEntity AS1ASI01 => new ForValveSingleEntity(84, bytes); + public ForValveSingleEntity AS1BSI01 => new ForValveSingleEntity(86, bytes); + public ForValveSingleEntity AS1CSI01 => new ForValveSingleEntity(88, bytes); + public ForValveSingleEntity AS1DSI01 => new ForValveSingleEntity(90, bytes); + public ForValveSingleEntity AS1ESI01 => new ForValveSingleEntity(92, bytes); + public ForValveSingleEntity AS1FSI01 => new ForValveSingleEntity(94, bytes); + public ForValveSingleEntity AS1GSI01 => new ForValveSingleEntity(96, bytes); + public ForValveSingleEntity AS1HSI01 => new ForValveSingleEntity(98, bytes); + public ForValveSingleEntity AS1ISI01 => new ForValveSingleEntity(100, bytes); + public ForValveSingleEntity AS1JSI01 => new ForValveSingleEntity(102, bytes); + public ForValveSingleEntity AS1OSI01 => new ForValveSingleEntity(104, bytes); + public ForValveSingleEntity SV1DSM01 => new ForValveSingleEntity(106, bytes); + public ForValveSingleEntity SV1DSM02 => new ForValveSingleEntity(108, bytes); + public ForValveSingleEntity SV2DSM01 => new ForValveSingleEntity(110, bytes); + public ForValveSingleEntity SV2DSM02 => new ForValveSingleEntity(112, bytes); + public ForValveSingleEntity SV3DSM01 => new ForValveSingleEntity(114, bytes); + public ForValveSingleEntity SV3DSM02 => new ForValveSingleEntity(116, bytes); + public ForValveSingleEntity PV1GDC01 => new ForValveSingleEntity(118, bytes); + public ForValveSingleEntity PV1GDC02 => new ForValveSingleEntity(120, bytes); - public ForValveSingleEntity SV1GDS01 => new ForValveSingleEntity(152); + public ForValveDoubleEntity DV1PCP01 => new ForValveDoubleEntity(122, bytes); + public ForValveDoubleEntity DV1PCP02 => new ForValveDoubleEntity(124, bytes); + public ForValveDoubleEntity DV1PCP03 => new ForValveDoubleEntity(126, bytes); + public ForValveDoubleEntity DV1PCP04 => new ForValveDoubleEntity(128, bytes); + public ForValveDoubleEntity DV1PCP05 => new ForValveDoubleEntity(130, bytes); + public ForValveDoubleEntity DV1PCP06 => new ForValveDoubleEntity(132, bytes); + public ForValveDoubleEntity DV1PCP07 => new ForValveDoubleEntity(134, bytes); + public ForValveDoubleEntity DV1PCP08 => new ForValveDoubleEntity(136, bytes); + public ForValveDoubleEntity DV1PCP09 => new ForValveDoubleEntity(138, bytes); + public ForValveDoubleEntity DV1PCP10 => new ForValveDoubleEntity(140, bytes); + public ForValveDoubleEntity DV1PCP11 => new ForValveDoubleEntity(142, bytes); + public ForValveDoubleEntity DV1PCP12 => new ForValveDoubleEntity(144, bytes); + public ForValveDoubleEntity DV1PCP13 => new ForValveDoubleEntity(146, bytes); + public ForValveDoubleEntity DV1PCP14 => new ForValveDoubleEntity(148, bytes); + public ForValveDoubleEntity DV1PCP15 => new ForValveDoubleEntity(150, bytes); + + + public ForValveSingleEntity SV1GDS01 => new ForValveSingleEntity(152, bytes); } } diff --git a/DataBlockHelper/DBHelpers/DB91Helper.cs b/DataBlockHelper/DBHelpers/DB91Helper.cs index 6c75e93..66aa55a 100644 --- a/DataBlockHelper/DBHelpers/DB91Helper.cs +++ b/DataBlockHelper/DBHelpers/DB91Helper.cs @@ -7,23 +7,29 @@ using System.Threading.Tasks; namespace DataBlockHelper.DBHelpers { - public class DB91Helper + public class DB91Helper : DBHelper { - public ForMotorEntity DM1GDP01 => new ForMotorEntity(0); - public ForMotorEntity DM1ASIG01 => new ForMotorEntity(2); - public ForMotorEntity DM1BSIG01 => new ForMotorEntity(4); - public ForMotorEntity DM1CSIG01 => new ForMotorEntity(6); - public ForMotorEntity DM1DSIG01 => new ForMotorEntity(8); - public ForMotorEntity DM1GDS01 => new ForMotorEntity(10); - public ForMotorEntity DM1GDS02 => new ForMotorEntity(12); - public ForMotorEntity DM1GDS03 => new ForMotorEntity(14); - public ForMotorEntity DM1GDS04 => new ForMotorEntity(16); - public ForMotorEntity DM1GDS05 => new ForMotorEntity(18); - public ForMotorSToTEntity DM1GDS06 => new ForMotorSToTEntity(20); - public ForMotorSToTEntity DM1GDS07 => new ForMotorSToTEntity(28); - public ForMotorVFD DM1DSM01 => new ForMotorVFD(36); - public ForMotorVFD DM2DSM01 => new ForMotorVFD(50); - public ForMotorVFD DM3DSM01 => new ForMotorVFD(64); - public ForMotorVFD DM1GDS12 => new ForMotorVFD(78); + + public DB91Helper() + { + bytes = PlcConnect.Instance.Read("DB91.0.0", 92).Content; + } + + public ForMotorEntity DM1GDP01 => new ForMotorEntity(0, bytes); + public ForMotorEntity DM1ASIG01 => new ForMotorEntity(2, bytes); + public ForMotorEntity DM1BSIG01 => new ForMotorEntity(4, bytes); + public ForMotorEntity DM1CSIG01 => new ForMotorEntity(6, bytes); + public ForMotorEntity DM1DSIG01 => new ForMotorEntity(8, bytes); + public ForMotorEntity DM1GDS01 => new ForMotorEntity(10, bytes); + public ForMotorEntity DM1GDS02 => new ForMotorEntity(12, bytes); + public ForMotorEntity DM1GDS03 => new ForMotorEntity(14, bytes); + public ForMotorEntity DM1GDS04 => new ForMotorEntity(16, bytes); + public ForMotorEntity DM1GDS05 => new ForMotorEntity(18, bytes); + public ForMotorSToTEntity DM1GDS06 => new ForMotorSToTEntity(20, bytes); + public ForMotorSToTEntity DM1GDS07 => new ForMotorSToTEntity(28, bytes); + public ForMotorVFD DM1DSM01 => new ForMotorVFD(36, bytes); + public ForMotorVFD DM2DSM01 => new ForMotorVFD(50, bytes); + public ForMotorVFD DM3DSM01 => new ForMotorVFD(64, bytes); + public ForMotorVFD DM1GDS12 => new ForMotorVFD(78, bytes); } } diff --git a/DataBlockHelper/Entity/DB1Entity/ForAoaLogInFC3005Entity.cs b/DataBlockHelper/Entity/DB1Entity/ForAoaLogInFC3005Entity.cs index 24a5f8d..3d5c43e 100644 --- a/DataBlockHelper/Entity/DB1Entity/ForAoaLogInFC3005Entity.cs +++ b/DataBlockHelper/Entity/DB1Entity/ForAoaLogInFC3005Entity.cs @@ -1,15 +1,15 @@ using HslCommunication; - +using System.Linq; namespace DataBlockHelper.Entity.DB1Entity { public class ForAoaLogInFC3005Entity { - public ForAoaLogInFC3005Entity(ushort startSet) + public ForAoaLogInFC3005Entity(ushort startSet, byte[] bytes) { - OperateResult read = PlcConnect.Instance.Read("DB1." + startSet + ".0", 8); + //OperateResult read = PlcConnect.Instance.Read("DB1." + startSet + ".0", 8); - var content = read.Content; + var content = bytes.Skip(startSet).Take(8).ToArray(); byte byt = content[6]; diff --git a/DataBlockHelper/Entity/DB1Entity/ForAoaLogInFC3006Entity.cs b/DataBlockHelper/Entity/DB1Entity/ForAoaLogInFC3006Entity.cs index fb9c817..1ea0451 100644 --- a/DataBlockHelper/Entity/DB1Entity/ForAoaLogInFC3006Entity.cs +++ b/DataBlockHelper/Entity/DB1Entity/ForAoaLogInFC3006Entity.cs @@ -1,15 +1,15 @@ using HslCommunication; - +using System.Linq; namespace DataBlockHelper.Entity.DB1Entity { public class ForAoaLogInFC3006Entity { - public ForAoaLogInFC3006Entity(ushort startSet) + public ForAoaLogInFC3006Entity(ushort startSet, byte[] bytes) { - OperateResult read = PlcConnect.Instance.Read("DB1." + startSet + ".0", 8); + //OperateResult read = PlcConnect.Instance.Read("DB1." + startSet + ".0", 8); - var content = read.Content; + var content = bytes.Skip(startSet).Take(8).ToArray(); byte byt = content[6]; diff --git a/DataBlockHelper/Entity/DB90Entity/ForValveDoubleEntity.cs b/DataBlockHelper/Entity/DB90Entity/ForValveDoubleEntity.cs index 09b1e82..9b10d88 100644 --- a/DataBlockHelper/Entity/DB90Entity/ForValveDoubleEntity.cs +++ b/DataBlockHelper/Entity/DB90Entity/ForValveDoubleEntity.cs @@ -1,14 +1,15 @@ using HslCommunication; +using System.Linq; namespace DataBlockHelper.Entity.DB90Entity { public class ForValveDoubleEntity { - public ForValveDoubleEntity(ushort startSet) + public ForValveDoubleEntity(ushort startSet, byte[] bytes) { - OperateResult read = PlcConnect.Instance.Read("DB90." + startSet + ".0", 2); + //OperateResult read = PlcConnect.Instance.Read("DB90." + startSet + ".0", 2); - var content = read.Content; + var content = bytes.Skip(startSet).Take(2).ToArray(); byte byt = content[0]; diff --git a/DataBlockHelper/Entity/DB90Entity/ForValveSingleEntity.cs b/DataBlockHelper/Entity/DB90Entity/ForValveSingleEntity.cs index 0c94a3f..5e327e2 100644 --- a/DataBlockHelper/Entity/DB90Entity/ForValveSingleEntity.cs +++ b/DataBlockHelper/Entity/DB90Entity/ForValveSingleEntity.cs @@ -1,16 +1,17 @@ using HslCommunication; +using System.Linq; namespace DataBlockHelper.Entity.DB90Entity { public class ForValveSingleEntity { - public ForValveSingleEntity(ushort startSet) + public ForValveSingleEntity(ushort startSet, byte[] bytes) { - OperateResult read = PlcConnect.Instance.Read("DB90." + startSet + ".0", 2); + //OperateResult read = PlcConnect.Instance.Read("DB90." + startSet + ".0", 2); - var content = read.Content; + var content = bytes.Skip(startSet).Take(2).ToArray(); - byte byt = content[0]; + byte byt = content[0]; ManualMode = byt.GetBit(0); AutoMode = byt.GetBit(1); diff --git a/DataBlockHelper/Entity/DB91Entity/ForMotorEntity.cs b/DataBlockHelper/Entity/DB91Entity/ForMotorEntity.cs index 5cd4f39..9c761f4 100644 --- a/DataBlockHelper/Entity/DB91Entity/ForMotorEntity.cs +++ b/DataBlockHelper/Entity/DB91Entity/ForMotorEntity.cs @@ -1,15 +1,15 @@ using HslCommunication; - +using System.Linq; namespace DataBlockHelper.Entity.DB91Entity { public class ForMotorEntity { - public ForMotorEntity(ushort startSet) + public ForMotorEntity(ushort startSet, byte[] bytes) { - OperateResult read = PlcConnect.Instance.Read("DB91." + startSet + ".0", 2); + //OperateResult read = PlcConnect.Instance.Read("DB91." + startSet + ".0", 2); - var content = read.Content; + var content = bytes.Skip(startSet).Take(2).ToArray(); byte byt = content[0]; diff --git a/DataBlockHelper/Entity/DB91Entity/ForMotorSToTEntity.cs b/DataBlockHelper/Entity/DB91Entity/ForMotorSToTEntity.cs index f2fd493..a7cad3e 100644 --- a/DataBlockHelper/Entity/DB91Entity/ForMotorSToTEntity.cs +++ b/DataBlockHelper/Entity/DB91Entity/ForMotorSToTEntity.cs @@ -1,15 +1,15 @@ using HslCommunication; - +using System.Linq; namespace DataBlockHelper.Entity.DB91Entity { public class ForMotorSToTEntity { - public ForMotorSToTEntity(ushort startSet) + public ForMotorSToTEntity(ushort startSet, byte[] bytes) { - OperateResult read = PlcConnect.Instance.Read("DB91." + startSet + ".0", 8); + //OperateResult read = PlcConnect.Instance.Read("DB91." + startSet + ".0", 8); - var content = read.Content; + var content = bytes.Skip(startSet).Take(8).ToArray(); byte byt = content[0]; diff --git a/DataBlockHelper/Entity/DB91Entity/ForMotorVFD.cs b/DataBlockHelper/Entity/DB91Entity/ForMotorVFD.cs index cf3b1fe..76d836d 100644 --- a/DataBlockHelper/Entity/DB91Entity/ForMotorVFD.cs +++ b/DataBlockHelper/Entity/DB91Entity/ForMotorVFD.cs @@ -1,15 +1,15 @@ using HslCommunication; - +using System.Linq; namespace DataBlockHelper.Entity.DB91Entity { public class ForMotorVFD { - public ForMotorVFD(ushort startSet) + public ForMotorVFD(ushort startSet, byte[] bytes) { - OperateResult read = PlcConnect.Instance.Read("DB91." + startSet + ".0", 14); + //OperateResult read = PlcConnect.Instance.Read("DB91." + startSet + ".0", 14); - var content = read.Content; + var content = bytes.Skip(startSet).Take(14).ToArray(); byte byt = content[0];