修复一个版本

dep_nodyang
nodyang 1 year ago
parent 8676e8eda5
commit ef86b96e76

@ -29,189 +29,6 @@ namespace Mesnac.Action.ChemicalWeighing.ChemicalWeighingPlc
{
bool flag = false;
List<Int16> writeDataList = new List<Int16>();
#region 读取并处理配方查询请求,并写入。
if (BasePlcHelper.Instance.ChemicalWeighing_HMI_Request_Recipe_Name_ShakeHand.NowValue.ToInt() == 1 && (BasePlcHelper.Instance.ChemicalWeighing_HMI_Request_Recipe_Name_FeedBack.NowValue.ToInt() <= 0 || BasePlcHelper.Instance.ChemicalWeighing_HMI_Request_Recipe_Name_FeedBack.NowValue.ToInt() == 65535))
{
#region 从PLC中获取筛选条件机台号和配方名称
int[] NamedData;
BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.ChemicalWeighing_Plan_Code, out NamedData);
string recipeName = Mesnac.Basic.DataProcessor.ToString1(NamedData);
List<string> recipeNameList = new List<string>();
if (recipeName != null && recipeName != "")
{
#region 从数据库中查询配方名称List
List<Pmt_recipe> allList = Technical.TechnicalHelper.GetPmt_recipeList();
if (allList == null || allList.Count == 0)
{
string msg = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_ChemicalWeighingPlc_PlcRecipeHelper_Mix_msg2")); //HMI请求配方列表:配方数据表为空!
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Error(msg);
}
else
{
foreach (Pmt_recipe pmtRecipe in allList)
{
if (pmtRecipe.Recipe_Name.Contains(recipeName))
{
recipeNameList.Add(pmtRecipe.Recipe_Name);
}
}
}
#endregion
#region 数据整理
if (recipeNameList != null && recipeNameList.Count > 0)
{
#region 待写入PLC项整理
List<PlcWriter> writerList = PlcSchemaHelper.Instance.GetPlcWriter("RecipeNameDataList"); //配方名称数据列表项
if (writerList == null || writerList.Count == 0)
{
string msg = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_ChemicalWeighingPlc_PlcRecipeHelper_Mix_msg4")); //HMI请求配方列表:获取PLC配方名称列表项时出错!
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Error(msg);
}
#endregion
#region 数据组成及下传业务处理
foreach (PlcWriter writer in writerList)
{
writeDataList.Clear();
#region 验证处理
if (writer.EquipRunName != "RecipeNameList_Info")
{
continue;
}
#endregion
#region 获取PLC品牌名称处理西门子与其他PLC差异
string equipBrand = Mesnac.Equips.Factory.Instance.GetEquipBrandByRunName(writer.EquipRunName);
writer.EquipBrand = equipBrand;
#endregion
#region 整理数据
if (writer.EquipRunName == "RecipeNameList_Info")
{
for (int i = 0; i < writer.ThisCount; i++)
{
if (recipeNameList != null && i < recipeNameList.Count)
{
foreach (PlcWriteItem item in writer.SchemaList)
{
item.ClearData();
item.EquipBrand = equipBrand; //设置PLC设备品牌
if (item.EquipRunName == "DownLoad_PlanCode")
{
if (recipeNameList[i] != null)
{
item.SetValue = recipeNameList[i];
writeDataList.AddRange(item.WriteData());
}
}
}
}
}
}
#endregion
if (writeDataList.Count < 400)
{
int fillNum = 400 - writeDataList.Count;
for (int i = 0; i < fillNum; i++)
{
writeDataList.AddRange(new short[]{0});
}
}
#region 下传数据
object[] buff = new object[writeDataList.Count];
Array.Copy(writeDataList.ToArray(), buff, buff.Length);
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Debug(String.Format("[{0}]开始下传计划信息...", writer.EquipRunName));
if (!BasePlcHelper.Instance.PlcWriteByRunName(writer.EquipRunName, buff))
{
string msg = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_ChemicalWeighingPlc_PlcRecipeHelper_Mix_msg5")); //HMI请求配方列表:配方名称列表数据下传失败!
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Error(msg);
}
else
{
flag = true;
}
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Debug(String.Format("[{0}]计划信息下传完毕...", writer.EquipRunName));
#endregion
}
#endregion
}
else
{
#region 下传异常反馈信号
bool result = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_HMI_Request_Recipe_Name_FeedBack, new object[] { 3 });
if (!result)
{
string msg1 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_ChemicalWeighingPlc_PlcPlanHelper_Mix_msg30")); //小料-计划信息下传PLC向PLC下传计划状态请求信号失败!
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Error(msg1);
}
#endregion
string msg = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_ChemicalWeighingPlc_PlcRecipeHelper_Mix_msg3")); //HMI请求配方列表:没有相关的配方数据!
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Error(msg);
}
#endregion
}
else
{
string msg = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_ChemicalWeighingPlc_PlcRecipeHelper_Mix_msg1")); //HMI请求配方列表时关键字为空
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Error(msg);
}
#endregion
}
#endregion
#region 请求交互
if (flag)
{
#region 下传请求信号
bool result = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_HMI_Request_Recipe_Name_FeedBack, new object[] { 1 });
if (!result)
{
string msg = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_ChemicalWeighingPlc_PlcPlanHelper_Mix_msg30")); //小料-计划信息下传PLC向PLC下传计划状态请求信号失败!
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Error(msg);
}
#endregion
}
#endregion
}
catch (Exception ex)
{
@ -228,4 +45,4 @@ namespace Mesnac.Action.ChemicalWeighing.ChemicalWeighingPlc
}
}
}

@ -26,331 +26,7 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch
{
try
{
#region 0 存盘信号读取
//if (BasePlcHelper.Instance.ChemicalWeighing_PLC_Request_Save_ShakeHand.NowValue.ToInt() == 1 && (BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack.NowValue.ToInt() <= 0 || BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack.NowValue.ToInt() == 65535 || BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack.NowValue.ToInt() == -1))
if (false)
{
#region 1 变量定义
int offset = 0; //保存偏移量
string reportHeadEquipRunName = String.Empty; //报表头基本信息设备变量别名
string materialEquipRunName = String.Empty; //物料信息设备变量别名
int[] reportHeaddataValue = null; //保存报表头基本信息设备变量别名的PLC数据
int[] materialDataValue = null; //保存物料信息设备变量别名的PLC数据
System.Reflection.PropertyInfo[] pis = null; //实体类型属性信息
Entity.LR_lot lRlotData = null; //报表头数据类
List<Entity.LR_weigh> lrWeighList = new List<Entity.LR_weigh>(); //物料数据类List
#endregion
#region 1.1 读取PlcSchema.xml中相应的存盘配置节并根据配置节对应的设备变量别名读取PLC数据
List<PlcRecipeReader> readerList = PlcSchemaHelper.Instance.GetCWSSPlcReader("WeighDataInfo");
if (readerList == null || readerList.Count == 0)
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Warn(String.Format("基础报表数据读取失败PlcSchema.xml中没有对应WeighDataInfo的配置节!"));
#region 保存异常下传save=3
if (!BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 }))
{
BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 });
}
#endregion
return;
}
reportHeadEquipRunName = readerList[0].PlcFiledName;
for (int i = 1; i < readerList.Count; i++)
{
if (reportHeadEquipRunName != readerList[i].PlcFiledName)
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Warn(String.Format("基础报表数据读取失败PlcSchema.xml中相同配置节的equip={0}属性与第一个不相同!", readerList[i].PlcFiledName));
#region 保存异常下传save=3
if (!BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 }))
{
BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 });
}
#endregion
return;
}
}
List<PlcRecipeReader> materialReaderList = PlcSchemaHelper.Instance.GetCWSSPlcReader("MaterialDataInfo");
if (materialReaderList == null || materialReaderList.Count == 0)
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Warn(String.Format("物料数据读取失败PlcSchema.xml中没有对应MaterialDataInfo的配置节!"));
#region 保存异常下传save=3
if (!BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 }))
{
BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 });
}
#endregion
return;
}
materialEquipRunName = materialReaderList[0].PlcFiledName;
for (int i = 1; i < materialReaderList.Count; i++)
{
if (materialEquipRunName != materialReaderList[i].PlcFiledName)
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Warn(String.Format("物料数据读取失败PlcSchema.xml中相同配置节的equip={0}属性与第一个不相同!", readerList[i].PlcFiledName));
#region 保存异常下传save=3
if (!BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 }))
{
BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 });
}
#endregion
return;
}
}
#endregion
#region 1.2 获取PLC品牌名称处理西门子与其他PLC差异
foreach (PlcRecipeReader reader in readerList)
{
string equipBrand = Mesnac.Equips.Factory.Instance.GetEquipBrandByRunName(reader.PlcFiledName);
reader.EquipBrand = equipBrand;
foreach (PlcRecipeReaderItem readerItem in reader.ItemList)
{
readerItem.EquipBrand = equipBrand;
}
}
foreach (PlcRecipeReader materialReader in materialReaderList)
{
string equipBrand = Mesnac.Equips.Factory.Instance.GetEquipBrandByRunName(materialReader.PlcFiledName);
materialReader.EquipBrand = equipBrand;
foreach (PlcRecipeReaderItem materialReaderItem in materialReader.ItemList)
{
materialReaderItem.EquipBrand = equipBrand;
}
}
#endregion
#region 2 存盘业务处理
#region 2.1 根据配置节对应的设备变量别名读取PLC基础报表存盘数据
if (!BasePlcHelper.Instance.PlcReadByRunName(reportHeadEquipRunName, out reportHeaddataValue))
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Warn(String.Format("基础报表数据存盘失败读取对应的PLC设备变量[{0}]数据失败!", reportHeadEquipRunName));
return;
}
else
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Debug(String.Format("基础报表数据存盘_读取PLC设备变量[{0}]成功,长度={1}", reportHeadEquipRunName, reportHeaddataValue.Length));
}
#endregion
#region 2.2 根据配置节对应的设备变量别名读取PLC物料存盘数据
if (!BasePlcHelper.Instance.PlcReadByRunName(materialEquipRunName, out materialDataValue))
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Warn(String.Format("物料数据存盘失败读取对应的PLC设备变量[{0}]数据失败!", materialEquipRunName));
return;
}
else
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Debug(String.Format("物料数据存盘_读取PLC设备变量[{0}]成功,长度={1}", materialEquipRunName, materialDataValue.Length));
}
#endregion
#region 2.3 把读取的PLC报表头基本信息数据进行实体映射处理并写入数据库
lRlotData = new Entity.LR_lot();
foreach (PlcRecipeReader reader in readerList)
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Debug(String.Format("targetTable={0}, runName={1}", reader.TargetTable, reader.PlcFiledName));
#region 3.1 数据处理
if (reader.TargetTable == "LR_lot")
{
if (reader.ThisCount != 1)
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Warn(String.Format("上辅机称量数据存盘失败PlcSchema.xml中对应targetTable={0}的配置节count属性值不为1!", reader.TargetTable));
#region 保存异常下传save=3
if (!BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 }))
{
BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 3 });
}
#endregion
return;
}
#region 3.2 配置项赋值
pis = typeof(Entity.LR_lot).GetProperties();
foreach (PlcRecipeReaderItem readerItem in reader.ItemList)
{
int[] value = new int[readerItem.ValueLen];
Array.Copy(reportHeaddataValue, offset, value, 0, value.Length);
readerItem.SetValue = value;
offset += value.Length;
foreach (System.Reflection.PropertyInfo pi in pis)
{
if (pi.Name == readerItem.DataFieldName)
{
object objValue = null;
try
{
if (readerItem.DataType.Equals("Int32", StringComparison.CurrentCultureIgnoreCase))
{
if (readerItem.SetValue[0] > 32767)
{
readerItem.SetValue[0] = Math.Abs(readerItem.SetValue[0] - 65536);
}
if (readerItem.SetValue[1] > 32767)
{
readerItem.SetValue[1] = Math.Abs(readerItem.SetValue[1] - 65536);
}
}
objValue = Mesnac.Basic.DataProcessor.ChangeType(readerItem.GetValue(), pi.PropertyType);
if (readerItem.DataFieldName == "Prd_date")
{
objValue = DateTime.Now.ToString();
}
}
catch
{
objValue = readerItem.GetValue();
}
pi.SetValue(lRlotData, objValue, null);
}
}
}
#endregion
SaveHelper.LotSaveHelper.InsertLRLotData(lRlotData);
break;
}
#endregion
}
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Debug("数据存盘_PLC报表基本数据进行实体映射处理完毕!");
#endregion
#region 2.4 把读取的PLC物料信息数据进行实体映射处理并写入数据库
foreach (PlcRecipeReader reader in materialReaderList)
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Debug(String.Format("targetTable={0}, runName={1}", reader.TargetTable, reader.PlcFiledName));
if (reader.TargetTable == "LR_weigh")
{
offset = 0;
pis = typeof(Entity.LR_weigh).GetProperties();
for (int i = 0; i < reader.ThisCount; i++)
{
Entity.LR_weigh tempLRweigh = new Entity.LR_weigh();
bool isCanAddFlag = false;
foreach (PlcRecipeReaderItem readerItem in reader.ItemList)
{
int[] value = new int[readerItem.ValueLen];
Array.Copy(materialDataValue, offset, value, 0, value.Length);
readerItem.SetValue = value;
offset += value.Length;
if (readerItem.PlcFiledName == "Read_BinNo" && readerItem.ValueLen == 1 && readerItem.SetValue[0] != 0)
{
isCanAddFlag = true;
}
}
if (isCanAddFlag)
{
tempLRweigh.Dosing_id = 0;
tempLRweigh.Plan_id = lRlotData.Plan_id;
tempLRweigh.Equip_Code = lRlotData.Equip_Code;
tempLRweigh.Serial_Num = lRlotData.Serial_Num;
foreach (PlcRecipeReaderItem readerItem in reader.ItemList)
{
foreach (System.Reflection.PropertyInfo pi in pis)
{
if (pi.Name == readerItem.DataFieldName)
{
object objValue = null;
try
{
objValue = Mesnac.Basic.DataProcessor.ChangeType(readerItem.GetValue(), pi.PropertyType);
if (readerItem.DataFieldName == "Weight_Time")
{
objValue = DateTime.Now.ToString();
}
}
catch
{
objValue = readerItem.GetValue();
}
pi.SetValue(tempLRweigh, objValue, null);
}
}
}
lrWeighList.Add(tempLRweigh);
SaveHelper.LotSaveHelper.InsertLRweighData(tempLRweigh);
}
}
}
}
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Debug("数据存盘_PLC物料数据写入数据库处理完毕!");
#endregion
#region 2.5 反馈信号
bool result = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Request_Save_FeedBack, new object[] { 1 });
if (!result)
{
ICSharpCode.Core.LoggingService<FinishBatchHelper>.Debug("数据存盘后写入反馈信号失败!");
}
#endregion
#endregion
}
else
{
return;
}
#endregion
}
catch (Exception ex)
{

@ -1,324 +0,0 @@
using Mesnac.Action.ChemicalWeighing.Entity.Report;
using Mesnac.Codd.Session;
using System;
using System.Collections.Generic;
using System.Data;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper
{
public sealed class ReportGelDoserSaveHelper
{
private static readonly Lazy<ReportGelDoserSaveHelper> lazy = new Lazy<ReportGelDoserSaveHelper>(() => new ReportGelDoserSaveHelper());
public static ReportGelDoserSaveHelper Instance
{
get
{
return lazy.Value;
}
}
private ReportGelDoserSaveHelper() { }
/// <summary>
/// 糊化机报表数据保存
/// </summary>
public void SaveGelDoserReport()
{
try
{
ICSharpCode.Core.LoggingService<ReportGelDoserSaveHelper>.Debug("糊化机报表数据保存开始!!!");
//准备信号读取
//if (BasePlcHelper.Instance.RdyRpt_D1.NowValue.ToInt() == 1)
//{
// Report_GelDoser gelDoser_dos0 = readGelDoser("A"); //读取报表数据
// SaveReportDb(gelDoser_dos0); //保存报表数据
//}
//else if (BasePlcHelper.Instance.RdyRpt_D1.NowValue.ToInt() == 2)
//{
// Report_GelDoser gelDoser_dos0 = readGelDoser("B"); //读取报表数据
// SaveReportDb(gelDoser_dos0); //保存报表数据
//}
//else if (BasePlcHelper.Instance.RdyRpt_D1.NowValue.ToInt() == 3)
//{
// Report_GelDoser gelDoser_dos0 = readGelDoser("C"); //读取报表数据
// SaveReportDb(gelDoser_dos0); //保存报表数据
//}
//else if (BasePlcHelper.Instance.RdyRpt_D1.NowValue.ToInt() == 4)
//{
// Report_GelDoser gelDoser_dos0 = readGelDoser("D"); //读取报表数据
// SaveReportDb(gelDoser_dos0); //保存报表数据
//}
Report_GelDoser gelDoser_dos0 = readGelDoser("A"); //读取报表数据
SaveReportDb(gelDoser_dos0); //保存报表数据
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<ReportGelDoserSaveHelper>.Error(String.Format("糊化机报表数据保存异常:{0}", ex.Message), ex);
}
}
/// <summary>
/// 通过PLC读取糊化机报表数据
/// </summary>
/// <param name="machineType">糊化机A、糊化机B</param>
/// <param name="dos">操作步骤Dos[0]、Dos[1]、Dos[2]、Dos[3]</param>
/// <returns></returns>
private Report_GelDoser readGelDoser(string machineType)
{
Report_GelDoser _gelDoser = null;
try
{
_gelDoser = new Report_GelDoser();
_gelDoser.dos = readGelDoserDos(machineType, 6);
_gelDoser.mix = readGelDoserMix(machineType, 10);
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<ReportGelDoserSaveHelper>.Error(String.Format("通过PLC读取糊化机报表数读取异常{0}", ex.Message), ex);
}
return _gelDoser;
}
/// <summary>
/// 读取糊化机Dos数据
/// </summary>
/// <param name="machineType"></param>
/// <param name="amount"></param>
/// <returns></returns>
private List<GelDoserDos_Water> readGelDoserDos(string machineType, int amount)
{
List<GelDoserDos_Water> gelDoserDoes = new List<GelDoserDos_Water>();
for (int dos = 0; dos < amount; dos++)
{
#region 实例化参数
if (dos < 4)
{
BasePlcHelper.Instance.geler_dos_eqNo = new Entity.DataKeyValue($"gelDosing{machineType}_dos{dos}_eqNo");
BasePlcHelper.Instance.geler_dos_batch = new Entity.DataKeyValue($"gelDosing{machineType}_dos{dos}_batch");
BasePlcHelper.Instance.geler_dos_matCode = new Entity.DataKeyValue($"gelDosing{machineType}_dos{dos}_matCode");
BasePlcHelper.Instance.geler_dos_setValue = new Entity.DataKeyValue($"gelDosing{machineType}_dos{dos}_setValue");
BasePlcHelper.Instance.geler_dos_setToler = new Entity.DataKeyValue($"gelDosing{machineType}_dos{dos}_setToler");
BasePlcHelper.Instance.geler_dos_actValue = new Entity.DataKeyValue($"gelDosing{machineType}_dos{dos}_actValue");
BasePlcHelper.Instance.geler_dos_actToLer = new Entity.DataKeyValue($"gelDosing{machineType}_dos{dos}_actToLer");
}
else if (dos == 4)
{
BasePlcHelper.Instance.geler_dos_eqNo = new Entity.DataKeyValue($"gelDosing{machineType}_hotWater_eqNo");
BasePlcHelper.Instance.geler_dos_batch = new Entity.DataKeyValue($"gelDosing{machineType}_hotWater_batch");
BasePlcHelper.Instance.geler_dos_matCode = new Entity.DataKeyValue($"gelDosing{machineType}_hotWater_matCode");
BasePlcHelper.Instance.geler_dos_setValue = new Entity.DataKeyValue($"gelDosing{machineType}_hotWater_setValue");
BasePlcHelper.Instance.geler_dos_setToler = new Entity.DataKeyValue($"gelDosing{machineType}_hotWater_setToler");
BasePlcHelper.Instance.geler_dos_actValue = new Entity.DataKeyValue($"gelDosing{machineType}_hotWater_actValue");
BasePlcHelper.Instance.geler_dos_actToLer = new Entity.DataKeyValue($"gelDosing{machineType}_hotWater_actToLer");
}
else if(dos == 5)
{
BasePlcHelper.Instance.geler_dos_eqNo = new Entity.DataKeyValue($"gelDosing{machineType}_coolWater_eqNo");
BasePlcHelper.Instance.geler_dos_batch = new Entity.DataKeyValue($"gelDosing{machineType}_coolWater_batch");
BasePlcHelper.Instance.geler_dos_matCode = new Entity.DataKeyValue($"gelDosing{machineType}_coolWater_matCode");
BasePlcHelper.Instance.geler_dos_setValue = new Entity.DataKeyValue($"gelDosing{machineType}_coolWater_setValue");
BasePlcHelper.Instance.geler_dos_setToler = new Entity.DataKeyValue($"gelDosing{machineType}_coolWater_setToler");
BasePlcHelper.Instance.geler_dos_actValue = new Entity.DataKeyValue($"gelDosing{machineType}_coolWater_actValue");
BasePlcHelper.Instance.geler_dos_actToLer = new Entity.DataKeyValue($"gelDosing{machineType}_coolWater_actToLer");
}
#endregion
GelDoserDos_Water gelDoserDos = new GelDoserDos_Water()
{
eqNo = BasePlcHelper.Instance.geler_dos_eqNo.NowValue.ToInt(),
batch = BasePlcHelper.Instance.geler_dos_batch.NowValue.ToInt(),
matCode = BasePlcHelper.Instance.geler_dos_matCode.NowValue.ToInt(),
setValue = BasePlcHelper.Instance.geler_dos_setValue.NowValue.ToDouble(),
setToler = BasePlcHelper.Instance.geler_dos_setToler.NowValue.ToDouble(),
actValue = BasePlcHelper.Instance.geler_dos_actValue.NowValue.ToDouble(),
actToLer = BasePlcHelper.Instance.geler_dos_actToLer.NowValue.ToDouble(),
dos = dos,
recordTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
};
gelDoserDoes.Add(gelDoserDos);
}
return gelDoserDoes;
}
/// <summary>
/// 读取糊化机Mix数据
/// </summary>
/// <param name="machineType"></param>
/// <param name="amount"></param>
/// <returns></returns>
private List<GelDoserMix> readGelDoserMix(string machineType, int amount)
{
List<GelDoserMix> gelDoserMixes = new List<GelDoserMix>();
for (int mix = 0; mix < amount; mix++)
{
#region 实例化参数
var eqNo = new Entity.DataKeyValue($"gelDosing{machineType}_gelMixing{mix}_eqNo");
var mixBatch = new Entity.DataKeyValue($"gelDosing{machineType}_gelMixing{mix}_mixBatch");
var mixStep = new Entity.DataKeyValue($"gelDosing{machineType}_gelMixing{mix}_mixStep");
var actCode = new Entity.DataKeyValue($"gelDosing{machineType}_gelMixing{mix}_actCode");
var mixTime = new Entity.DataKeyValue($"gelDosing{machineType}_gelMixing{mix}_mixTime");
var mixTemp = new Entity.DataKeyValue($"gelDosing{machineType}_gelMixing{mix}_mixTemp");
var mixSpeed = new Entity.DataKeyValue($"gelDosing{machineType}_gelMixing{mix}_mixSpeed");
#endregion
GelDoserMix gelDoserMix = new GelDoserMix()
{
eqNo = eqNo.NowValue.ToInt(),
mixBatch = mixBatch.NowValue.ToInt(),
mixStep = mixStep.NowValue.ToInt(),
actCode = actCode.NowValue.ToInt(),
mixTime = mixTime.NowValue.ToInt(),
mixTemp = mixTemp.NowValue.ToDouble(),
mixSpeed = mixSpeed.NowValue.ToDouble(),
mix = mix,
recordTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
};
gelDoserMixes.Add(gelDoserMix);
}
return gelDoserMixes;
}
/// <summary>
/// 保存糊化机报表数据至数据库
/// </summary>
/// <param name="_gelDoser"></param>
private void SaveReportDb(Report_GelDoser _gelDoser)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
try
{
string str = serializer.Serialize(_gelDoser);
if (_gelDoser != null)
{
if (_gelDoser.dos != null)
{
InsertReportGelDoser(_gelDoser.report_Id, _gelDoser.dos);
}
if (_gelDoser.mix != null)
{
InsertReportGelDoserDetail(_gelDoser.report_Id, _gelDoser.mix);
}
}
ICSharpCode.Core.LoggingService<ReportGelDoserSaveHelper>.Warn($"报表数据打印:{str}");
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<ReportGelDoserSaveHelper>.Error(String.Format("保存报表数据至数据库异常:{0}", ex.Message), ex);
}
}
/// <summary>
/// 保存糊化机报表数据
/// </summary>
/// <param name="reportId"></param>
/// <param name="_gelDoserDos"></param>
private void InsertReportGelDoser(Guid reportId, List<GelDoserDos_Water> gelDosers)
{
try
{
Task.Run(() =>
{
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
if (dbHelper == null)
{
throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError);
}
string sqlStr = @"insert into Report_GelDoser
(reportId, eqNo, batch, matCode, setValue, setToler, actValue, actToLer, dos)
values
(@reportId, @eqNo, @batch, @matCode, @setValue, @setToler, @actValue, @actToLer, @dos)";
foreach (GelDoserDos_Water _gelDoserDos in gelDosers)
{
if (_gelDoserDos.actValue == 0) continue;
dbHelper.ClearParameter();
dbHelper.CommandType = CommandType.Text;
dbHelper.CommandText = sqlStr;
dbHelper.AddParameter("@reportId", reportId);
dbHelper.AddParameter("@eqNo", _gelDoserDos.eqNo);
dbHelper.AddParameter("@batch", _gelDoserDos.batch);
dbHelper.AddParameter("@matCode", _gelDoserDos.matCode);
dbHelper.AddParameter("@setValue", _gelDoserDos.setValue);
dbHelper.AddParameter("@setToler", _gelDoserDos.setToler);
dbHelper.AddParameter("@actValue", _gelDoserDos.actValue);
dbHelper.AddParameter("@actToLer", _gelDoserDos.actToLer);
dbHelper.AddParameter("@dos", _gelDoserDos.dos);
dbHelper.ExecuteNonQuery();
}
});
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<ReportGelDoserSaveHelper>.Error(String.Format("保存糊化机报表数据异常:{0}", ex.Message), ex);
}
}
/// <summary>
/// 保存糊化机报表明细数据
/// </summary>
/// <param name="reportId"></param>
/// <param name="_gelDoserMix"></param>
private void InsertReportGelDoserDetail(Guid reportId, List<GelDoserMix> gelDosers)
{
try
{
Task.Run(() =>
{
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
if (dbHelper == null)
{
throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError);
}
string sqlStr = @"insert into Report_GelDoser_Detail
(reportId, eqNo, mixBatch, mixStep, actCode, mixTime, mixTemp, mixSpeed, mix)
values
(@reportId, @eqNo, @mixBatch, @mixStep, @actCode, @mixTime, @mixTemp, @mixSpeed, @mix)";
foreach (GelDoserMix _gelDoserMix in gelDosers)
{
if (_gelDoserMix.actCode == 0) continue;
dbHelper.ClearParameter();
dbHelper.CommandType = CommandType.Text;
dbHelper.CommandText = sqlStr;
dbHelper.AddParameter("@reportId", reportId);
dbHelper.AddParameter("@eqNo", _gelDoserMix.eqNo);
dbHelper.AddParameter("@mixBatch", _gelDoserMix.mixBatch);
dbHelper.AddParameter("@mixStep", _gelDoserMix.mixStep);
dbHelper.AddParameter("@actCode", _gelDoserMix.actCode);
dbHelper.AddParameter("@mixTime", _gelDoserMix.mixTime);
dbHelper.AddParameter("@mixTemp", _gelDoserMix.mixTemp);
dbHelper.AddParameter("@mixSpeed", _gelDoserMix.mixSpeed);
dbHelper.AddParameter("@mix", _gelDoserMix.mix);
dbHelper.ExecuteNonQuery();
}
});
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<ReportGelDoserSaveHelper>.Error(String.Format("保存糊化机报表明细数据异常:{0}", ex.Message), ex);
}
}
}
}

@ -1,297 +0,0 @@
using Mesnac.Action.ChemicalWeighing.Entity.Report;
using Mesnac.Codd.Session;
using System;
using System.Collections.Generic;
using System.Data;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper
{
public sealed class ReportDryMixerSaveHelper
{
private static readonly Lazy<ReportDryMixerSaveHelper> lazy = new Lazy<ReportDryMixerSaveHelper>(() => new ReportDryMixerSaveHelper());
public static ReportDryMixerSaveHelper Instance
{
get
{
return lazy.Value;
}
}
private ReportDryMixerSaveHelper() { }
/// <summary>
/// 干混机报表数据保存
/// </summary>
public void Save()
{
try
{
ICSharpCode.Core.LoggingService<ReportDryMixerSaveHelper>.Debug("干混机报表数据保存开始!!!");
//准备信号读取
//if (BasePlcHelper.Instance.RdyRpt_D1.NowValue.ToInt() == 1)
//{
// Report_DryMixer dryMixer_dos0 = readDryMixer("A"); //读取报表数据
// SaveReportDb(dryMixer_dos0); //保存报表数据
//}
//else if (BasePlcHelper.Instance.RdyRpt_D1.NowValue.ToInt() == 2)
//{
// Report_DryMixer dryMixer_dos0 = readDryMixer("B"); //读取报表数据
// SaveReportDb(dryMixer_dos0); //保存报表数据
//}
//else if (BasePlcHelper.Instance.RdyRpt_D1.NowValue.ToInt() == 3)
//{
// Report_DryMixer dryMixer_dos0 = readDryMixer("C"); //读取报表数据
// SaveReportDb(dryMixer_dos0); //保存报表数据
//}
//else if (BasePlcHelper.Instance.RdyRpt_D1.NowValue.ToInt() == 4)
//{
// Report_DryMixer dryMixer_dos0 = readDryMixer("D"); //读取报表数据
// SaveReportDb(dryMixer_dos0); //保存报表数据
//}
Report_DryMixer dryMixer_dos0 = readDryMixer("A"); //读取报表数据
SaveReportDb(dryMixer_dos0); //保存报表数据
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<ReportDryMixerSaveHelper>.Error(String.Format("干混机报表数据保存异常:{0}", ex.Message), ex);
}
}
/// <summary>
/// 通过PLC读取干混机报表数据
/// </summary>
/// <param name="machineType">干混机A、干混机B</param>
/// <param name="dos">操作步骤Dos[0]、Dos[1]、Dos[2]、Dos[3]</param>
/// <returns></returns>
private Report_DryMixer readDryMixer( string machineType)
{
Report_DryMixer _dryMixer = null;
try
{
_dryMixer = new Report_DryMixer();
_dryMixer.dos = readDryMixerDos(machineType, 4);
_dryMixer.mix = readDryMixerMix(machineType, 10);
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<ReportDryMixerSaveHelper>.Error(String.Format("通过PLC读取干混机报表数读取异常{0}", ex.Message), ex);
}
return _dryMixer;
}
/// <summary>
/// 读取干混机Dos数据
/// </summary>
/// <param name="machineType"></param>
/// <param name="amount"></param>
/// <returns></returns>
private List<DryMixerDos> readDryMixerDos(string machineType,int amount)
{
List<DryMixerDos> dryMixerDoes = new List<DryMixerDos>();
for (int dos = 0; dos < amount; dos++)
{
#region 实例化参数
BasePlcHelper.Instance.dryer_eqNo = new Entity.DataKeyValue($"dryer{machineType}_dos{dos}_eqNo");
BasePlcHelper.Instance.dryer_batch = new Entity.DataKeyValue($"dryer{machineType}_dos{dos}_batch");
BasePlcHelper.Instance.dryer_matCode = new Entity.DataKeyValue($"dryer{machineType}_dos{dos}_matCode");
BasePlcHelper.Instance.dryer_setValue = new Entity.DataKeyValue($"dryer{machineType}_dos{dos}_setValue");
BasePlcHelper.Instance.dryer_setToler = new Entity.DataKeyValue($"dryer{machineType}_dos{dos}_setToler");
BasePlcHelper.Instance.dryer_actValue = new Entity.DataKeyValue($"dryer{machineType}_dos{dos}_actValue");
BasePlcHelper.Instance.dryer_actToLer = new Entity.DataKeyValue($"dryer{machineType}_dos{dos}_actToLer");
#endregion
DryMixerDos dryMixerDos = new DryMixerDos()
{
eqNo = BasePlcHelper.Instance.dryer_eqNo.NowValue.ToInt(),
batch = BasePlcHelper.Instance.dryer_batch.NowValue.ToInt(),
matCode = BasePlcHelper.Instance.dryer_matCode.NowValue.ToInt(),
setValue = BasePlcHelper.Instance.dryer_setValue.NowValue.ToDouble(),
setToler = BasePlcHelper.Instance.dryer_setToler.NowValue.ToDouble(),
actValue = BasePlcHelper.Instance.dryer_actValue.NowValue.ToDouble(),
actToLer = BasePlcHelper.Instance.dryer_actToLer.NowValue.ToDouble(),
dos = dos,
recordTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
};
dryMixerDoes.Add(dryMixerDos);
}
return dryMixerDoes;
}
/// <summary>
/// 读取干混机Mix数据
/// </summary>
/// <param name="machineType"></param>
/// <param name="amount"></param>
/// <returns></returns>
private List<DryMixerMix> readDryMixerMix(string machineType, int amount)
{
List<DryMixerMix> dryMixerMixes = new List<DryMixerMix>();
for (int mix = 0; mix < 10; mix++)
{
#region 实例化参数
BasePlcHelper.Instance.dryer_mixBatch = new Entity.DataKeyValue($"dryer{machineType}_mix{mix}_mixBatch");
BasePlcHelper.Instance.dryer_mixStep = new Entity.DataKeyValue($"dryer{machineType}_mix{mix}_mixStep");
BasePlcHelper.Instance.dryer_actCode = new Entity.DataKeyValue($"dryer{machineType}_mix{mix}_actCode");
BasePlcHelper.Instance.dryer_mixTime = new Entity.DataKeyValue($"dryer{machineType}_mix{mix}_mixTime");
BasePlcHelper.Instance.dryer_mixTemp = new Entity.DataKeyValue($"dryer{machineType}_mix{mix}_mixTemp");
BasePlcHelper.Instance.dryer_mixSpeed = new Entity.DataKeyValue($"dryer{machineType}_mix{mix}_mixSpeed");
#endregion
DryMixerMix dryMixerMix = new DryMixerMix()
{
eqNo = BasePlcHelper.Instance.dryer_eqNo.NowValue.ToInt(),
mixBatch = BasePlcHelper.Instance.dryer_mixBatch.NowValue.ToInt(),
mixStep = BasePlcHelper.Instance.dryer_matCode.NowValue.ToInt(),
actCode = BasePlcHelper.Instance.dryer_actCode.NowValue.ToInt(),
mixTime = BasePlcHelper.Instance.dryer_mixTime.NowValue.ToInt(),
mixTemp = BasePlcHelper.Instance.dryer_mixTemp.NowValue.ToDouble(),
mixSpeed = BasePlcHelper.Instance.dryer_mixSpeed.NowValue.ToDouble(),
mix = mix,
recordTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
};
dryMixerMixes.Add(dryMixerMix);
}
return dryMixerMixes;
}
/// <summary>
/// 保存干混机报表数据至数据库
/// </summary>
/// <param name="_dryMixer"></param>
private void SaveReportDb(Report_DryMixer _dryMixer)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
try
{
string str = serializer.Serialize(_dryMixer);
if(_dryMixer != null)
{
if(_dryMixer.dos != null)
{
InsertReportDryMixer(_dryMixer.report_Id,_dryMixer.dos);
}else if(_dryMixer.mix != null)
{
InsertReportDryMixerDetail(_dryMixer.report_Id, _dryMixer.mix);
}
}
ICSharpCode.Core.LoggingService<ReportDryMixerSaveHelper>.Warn($"报表数据打印:{str}");
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<ReportDryMixerSaveHelper>.Error(String.Format("保存报表数据至数据库异常:{0}", ex.Message), ex);
}
}
/// <summary>
/// 保存干混机报表数据
/// </summary>
/// <param name="reportId"></param>
/// <param name="_dryMixerDos"></param>
private void InsertReportDryMixer(Guid reportId,List<DryMixerDos> dryMixers)
{
try
{
Task.Run(() =>
{
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
if (dbHelper == null)
{
throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError);
}
string sqlStr = @"insert into Report_DryMixer
(reportId, eqNo, batch, matCode, setValue, setToler, actValue, actToLer, dos)
values
(@reportId, @eqNo, @batch, @matCode, @setValue, @setToler, @actValue, @actToLer, @dos)";
foreach (DryMixerDos _dryMixerDos in dryMixers)
{
if (_dryMixerDos.actValue == 0) continue;
dbHelper.ClearParameter();
dbHelper.CommandType = CommandType.Text;
dbHelper.CommandText = sqlStr;
dbHelper.AddParameter("@reportId", reportId);
dbHelper.AddParameter("@eqNo", _dryMixerDos.eqNo);
dbHelper.AddParameter("@batch", _dryMixerDos.batch);
dbHelper.AddParameter("@matCode", _dryMixerDos.matCode);
dbHelper.AddParameter("@setValue", _dryMixerDos.setValue);
dbHelper.AddParameter("@setToler", _dryMixerDos.setToler);
dbHelper.AddParameter("@actValue", _dryMixerDos.actValue);
dbHelper.AddParameter("@actToLer", _dryMixerDos.actToLer);
dbHelper.AddParameter("@dos", _dryMixerDos.dos);
dbHelper.ExecuteNonQuery();
}
});
}catch (Exception ex)
{
ICSharpCode.Core.LoggingService<ReportDryMixerSaveHelper>.Error(String.Format("保存干混机报表数据异常:{0}", ex.Message), ex);
}
}
/// <summary>
/// 保存干混机报表明细数据
/// </summary>
/// <param name="reportId"></param>
/// <param name="_dryMixerMix"></param>
private void InsertReportDryMixerDetail(Guid reportId, List<DryMixerMix> dryMixers)
{
try
{
Task.Run(() =>
{
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
if (dbHelper == null)
{
throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError);
}
string sqlStr = @"insert into Report_DryMixer_Detail
(reportId, eqNo, mixBatch, mixStep, actCode, mixTime, mixTemp, mixSpeed, mix)
values
(@reportId, @eqNo, @mixBatch, @mixStep, @actCode, @mixTime, @mixTemp, @mixSpeed, @mix)";
foreach (DryMixerMix _dryMixerMix in dryMixers)
{
if (_dryMixerMix.actCode == 0) continue;
dbHelper.ClearParameter();
dbHelper.CommandType = CommandType.Text;
dbHelper.CommandText = sqlStr;
dbHelper.AddParameter("@reportId", reportId);
dbHelper.AddParameter("@eqNo", _dryMixerMix.eqNo);
dbHelper.AddParameter("@mixBatch", _dryMixerMix.mixBatch);
dbHelper.AddParameter("@mixStep", _dryMixerMix.mixStep);
dbHelper.AddParameter("@actCode", _dryMixerMix.actCode);
dbHelper.AddParameter("@mixTime", _dryMixerMix.mixTime);
dbHelper.AddParameter("@mixTemp", _dryMixerMix.mixTemp);
dbHelper.AddParameter("@mixSpeed", _dryMixerMix.mixSpeed);
dbHelper.AddParameter("@mix", _dryMixerMix.mix);
dbHelper.ExecuteNonQuery();
}
});
}catch(Exception ex)
{
ICSharpCode.Core.LoggingService<ReportDryMixerSaveHelper>.Error(String.Format("保存干混机报表明细数据异常:{0}", ex.Message), ex);
}
}
}
}

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
using FreeSql.DataAnnotations;
namespace Mesnac.Action.ChemicalWeighing.FreeDb.DBEntity
@ -116,6 +117,9 @@ namespace Mesnac.Action.ChemicalWeighing.FreeDb.DBEntity
public double Weight { get; set; }
public int PlanId { get; set; }
}
}

@ -0,0 +1,102 @@
namespace Mesnac.Action.ChemicalWeighing.LjClick
{
partial class FormClientManager
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox8 = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox8
//
this.textBox8.Location = new System.Drawing.Point(145, 180);
this.textBox8.Margin = new System.Windows.Forms.Padding(5);
this.textBox8.MaxLength = 100;
this.textBox8.Name = "textBox8";
this.textBox8.Size = new System.Drawing.Size(148, 21);
this.textBox8.TabIndex = 70;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(42, 183);
this.label8.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(59, 12);
this.label8.TabIndex = 67;
this.label8.Text = "点击重量:";
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(195, 225);
this.btnCancel.Margin = new System.Windows.Forms.Padding(5);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(98, 45);
this.btnCancel.TabIndex = 69;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(44, 225);
this.btnOK.Margin = new System.Windows.Forms.Padding(5);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(98, 45);
this.btnOK.TabIndex = 68;
this.btnOK.Text = "确认";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// FormClientManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(334, 450);
this.Controls.Add(this.textBox8);
this.Controls.Add(this.label8);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Name = "FormClientManager";
this.Text = "点击参数";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox8;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOK;
}
}

@ -0,0 +1,47 @@
using DataBlockHelper.DBHelpers;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.LjClick
{
public partial class FormClientManager : Form
{
int index = 0;
public FormClientManager(int id)
{
InitializeComponent();
this.index = id;
var ls = DB2108Helper.GetClickEntities();
this.textBox8.Text = ls[id].ClickValue.ToString();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Dispose();
}
private void btnOK_Click(object sender, EventArgs e)
{
string str = textBox8.Text;
DB2108Helper.WriteClick(index, new DataBlockHelper.Entity.ClickEntity()
{
ClickValue = Convert.ToSingle(str)
});
this.Dispose();
}
}
}

@ -0,0 +1,82 @@
using DataBlockHelper.DBHelpers;
using Mesnac.Action.Base;
using Mesnac.Controls.Default;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.LjClick
{
internal class InitFormAction : ChemicalWeighingAction,IAction
{
private RuntimeParameter _runtime;
private DataGridView _materialGridControl = null; //物料列表控件
DataTable dataTable;
MCButton MCButton5;
MCButton MCButton1;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
this._runtime = runtime;
dataTable = new DataTable("dt");
dataTable.Columns.Add(new DataColumn("名称", typeof(string)));
dataTable.Columns.Add(new DataColumn("点动数", typeof(string)));
var list= this.GetAllControls();
_materialGridControl = (list.FirstOrDefault(x => x.Name == "MCDataGridView1") as DataGridView);
MCButton5 = (list.FirstOrDefault(x => x.Name== "MCButton5") as MCButton);
MCButton1 = (list.FirstOrDefault(x => x.Name == "MCButton1") as MCButton);
MCButton5.Click += MCButton5_Click;
MCButton1.Click += MCButton1_Click;
Init();
}
private void MCButton1_Click(object sender, EventArgs e)
{
Init();
}
private void MCButton5_Click(object sender, EventArgs e)
{
var index= _materialGridControl.CurrentRow.Index;
FormClientManager form=new FormClientManager(index);
form.ShowDialog();
Init();
}
private void Init()
{
var ls= DB2108Helper.GetClickEntities();
dataTable.Rows.Clear();
for (int i = 0; i < 8; i++)
{
int num = i + 1;
DataRow dr = dataTable.NewRow();
dr[0] = "湿混机" + num;
dr[1] = ls[i].ClickValue;
dataTable.Rows.Add(dr);
}
_materialGridControl.AutoGenerateColumns = true;
_materialGridControl.DataSource = null ;
_materialGridControl.DataSource = dataTable;
}
}
}

@ -1,4 +1,9 @@
using System.Collections;
using DataBlockHelper;
using DataBlockHelper.DBHelpers;
using Mesnac.Action.ChemicalWeighing.LjWeight;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Mesnac.Action.ChemicalWeighing.LjElectrical
@ -7,13 +12,23 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
private static BasePlcHelper GetPlcHelper => BasePlcHelper.Instance;
private static DB2107Helper _db2107Helper = new DB2107Helper();
private static void DownElectricalView(int start, ElectricalView view)
{
PlcConnect.Instance.Write($"DB2107.{start}.0",view.Speed);
}
private static void Down1324(ElectricalView view)
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedD1,
view.Speed);
DownElectricalView(1324,view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedD1,
// view.Speed);
}
}
@ -21,8 +36,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 1;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedD1.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedD1.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_D1;
return view;
}
@ -39,8 +55,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 2;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedD2.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedD2.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_D2;
return view;
}
@ -49,9 +67,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedD2,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedD2,
// view.Speed);
DownElectricalView(1328, view);
}
}
@ -60,8 +80,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 3;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedD3.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedD3.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_D3;
return view;
}
@ -70,9 +92,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedD3,
view.Speed);
DownElectricalView(1332, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedD3,
// view.Speed);
}
}
@ -81,8 +104,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 4;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedD3.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedD3.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_D4;
return view;
}
@ -91,9 +116,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedD4,
view.Speed);
DownElectricalView(1336, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedD4,
// view.Speed);
}
}
@ -102,8 +128,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 5;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedG1.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedG1.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_G1;
return view;
}
@ -112,9 +140,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG1,
view.Speed);
DownElectricalView(1340, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG1,
// view.Speed);
}
}
@ -123,8 +153,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 6;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedG2.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedG2.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_G2;
return view;
}
@ -133,9 +165,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG2,
view.Speed);
DownElectricalView(1344, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG2,
// view.Speed);
}
}
@ -143,8 +176,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 7;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedG3.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedG3.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_G3;
return view;
}
@ -153,9 +188,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG3,
view.Speed);
DownElectricalView(1348, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG3,
// view.Speed);
}
}
@ -163,8 +199,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 8;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedG4.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedG4.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_G4;
return view;
}
@ -173,9 +211,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG4,
view.Speed);
DownElectricalView(1352, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG4,
// view.Speed);
}
}
@ -184,8 +223,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 9;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedG5.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedG5.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_G5;
return view;
}
@ -194,9 +235,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG5,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG5,
// view.Speed);
DownElectricalView(1356, view);
}
}
@ -205,8 +248,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 10;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedG6.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedG6.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_G6;
return view;
}
@ -215,9 +260,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG6,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG6,
// view.Speed);
DownElectricalView(1360, view);
}
}
@ -225,8 +272,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 11;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedG7.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedG7.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_G7;
return view;
}
@ -235,9 +284,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG7,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG7,
// view.Speed);
DownElectricalView(1364, view);
}
}
@ -246,8 +297,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 12;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedG8.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedG8.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_G8;
return view;
}
@ -256,9 +309,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG8,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedG8,
// view.Speed);
DownElectricalView(1368, view);
}
}
@ -266,8 +320,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 13;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedH1.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedH1.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_H1;
return view;
}
@ -276,9 +332,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedH1,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedH1,
// view.Speed);
DownElectricalView(1372, view);
}
}
@ -286,8 +344,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 14;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedH2.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedH2.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_H2;
return view;
}
@ -296,9 +356,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedH2,
view.Speed);
DownElectricalView(1376, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedH2,
// view.Speed);
}
}
@ -307,8 +368,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 15;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedH3.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedH3.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_H3;
return view;
}
@ -317,9 +380,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedH3,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedH3,
// view.Speed);
DownElectricalView(1380, view);
}
}
@ -327,8 +391,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 16;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedH4.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedH4.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_H4;
return view;
}
@ -337,9 +403,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedH4,
view.Speed);
DownElectricalView(1384, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedH4,
// view.Speed);
}
}
@ -347,8 +414,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 17;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedS1.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedS1.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_S1;
return view;
}
@ -357,9 +426,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS1,
view.Speed);
DownElectricalView(1388, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS1,
// view.Speed);
}
}
@ -368,8 +438,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 18;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedS5.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedS5.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_S5;
return view;
}
@ -378,9 +450,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS5,
view.Speed);
DownElectricalView(1392, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS5,
// view.Speed);
}
}
@ -389,8 +462,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 19;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedS7.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedS7.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_S7;
return view;
}
@ -399,9 +475,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS7,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS7,
// view.Speed);
DownElectricalView(1396, view);
}
}
@ -409,8 +487,12 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 20;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedS11.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedS11.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_S11;
return view;
}
@ -419,9 +501,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS11,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS11,
// view.Speed);
DownElectricalView(1400, view);
}
}
@ -430,8 +514,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
ElectricalView view = new ElectricalView();
view.Id = 21;
var basePlcHelper = GetPlcHelper;
view.Speed = basePlcHelper.SpeedS15.NowValue.ToFloat();
//var basePlcHelper = GetPlcHelper;
//view.Speed = basePlcHelper.SpeedS15.NowValue.ToFloat();
view.Speed = _db2107Helper.Speed.ManSpeed_S15;
return view;
}
@ -440,9 +526,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjElectrical
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS15,
view.Speed);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.SpeedS15,
// view.Speed);
DownElectricalView(1404, view);
}
}

@ -1,5 +1,7 @@
using HslCommunication;
using Mesnac.Action.ChemicalWeighing.Pl;
using DataBlockHelper;
using HslCommunication;
namespace Mesnac.Action.ChemicalWeighing
{
@ -11,13 +13,25 @@ namespace Mesnac.Action.ChemicalWeighing
{
get
{
OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2107.2.0", 2);
var content = read.Content;
try
{
OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2107.2.0", 2);
var content = read.Content;
if (read.IsSuccess)
{
return PlcConnect.Instance.ByteTransform.TransInt16(content, 0);
}
return 0;
}
catch (System.Exception)
{
return PlcConnect.Instance.ByteTransform.TransInt16(content, 0);
return 0;
}
}
}
//BasePlcHelper.Instance.WatchDog.LastValue.ToInt();
}
}

@ -15,30 +15,38 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
public DownToDatabase() { }
public DownToDatabase(DbMCControl _materialGridControl)
public DownToDatabase(int id)
{
DataGridView clientGridView = _materialGridControl.BaseControl as DataGridView;
//计划Id
LjPlanningEntity ljPlanningEntity = FreeSqlUnit.Instance.Select<LjPlanningEntity>().
Where(x => x.Id == id).ToOne();
// 配方
LjFormulaEntity ljFormulaEntity = FreeSqlUnit.Instance.Select<LjFormulaEntity>().Where(x => x.Id ==
ljPlanningEntity.FormulaId).ToOne();
//配方详情
List<LjFormulaDetailEntity> ljFormulaDetailEntity =
FreeSqlUnit.Instance.Select<LjFormulaDetailEntity>().
Where(x => x.FormulaId == ljFormulaEntity.Id).ToList();
//验证是否选中某物料
if (clientGridView.SelectedRows.Count != 1)
{
//MessageBox.Show("请选择要修改的数据", Mesnac.Basic.LanguageHelper.Caption,
// MessageBoxButtons.OK, MessageBoxIcon.Information);
//this._runtime.IsReturn = true;
return;
}
var dataGridViewRow = clientGridView.SelectedRows[0];
var id = Convert.ToInt32(dataGridViewRow.Cells["Id"].Value);
LjPlanningEntity ljPlanningEntity = FreeSqlUnit.Instance.Select<LjPlanningEntity>().Where(x => x.Id == id).ToOne();
LjFormulaEntity ljFormulaEntity = FreeSqlUnit.Instance.Select<LjFormulaEntity>().Where(x => x.Id == ljPlanningEntity.FormulaId).ToOne();
List<LjFormulaDetailEntity> ljFormulaDetailEntity = FreeSqlUnit.Instance.Select<LjFormulaDetailEntity>().Where(x => x.FormulaId == ljFormulaEntity.Id).ToList();
FreeSqlUnit.Instance.Delete<LjFormulaDownEntity>().Where(x => x.PlanId == ljPlanningEntity.Id && x.FormulaId == ljFormulaEntity.Id).ExecuteDeleted();
FreeSqlUnit.Instance.Delete<LjFormulaDownEntity>().
Where(x => x.PlanId == ljPlanningEntity.Id
&& x.FormulaId == ljFormulaEntity.Id).ExecuteDeleted();
LjFormulaDownEntity ljFormulaDownEntity = new LjFormulaDownEntity()
FreeSqlUnit.Instance.Delete<LjFormulaDetailDownEntity>()
.Where(x => x.PlanId == ljPlanningEntity.Id
&& x.FormulaId == ljFormulaEntity.Id).ExecuteDeleted();
LjFormulaDownEntity ljFormulaDownEntity = new LjFormulaDownEntity()
{
CbSiloC = ljFormulaEntity.CbSiloC,
CbSiloH = ljFormulaEntity.CbSiloH,
@ -61,11 +69,13 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
List<LjFormulaDetailDownEntity> ljFormulaDetailDownEntity = new List<LjFormulaDetailDownEntity>();
LjFormulaDetailDownEntity singleEntity;
foreach (LjFormulaDetailEntity Entity in ljFormulaDetailEntity)
{
singleEntity = new LjFormulaDetailDownEntity()
LjFormulaDetailDownEntity singleEntity = new LjFormulaDetailDownEntity()
{
ActionCode = Entity.ActionCode,
ActionId = Entity.ActionId,
@ -74,8 +84,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
CbCopyC = Entity.CbCopyC,
CbCopyH = Entity.CbCopyH,
CpSiloH = Entity.CpSiloH,
FormulaId = Entity.FormulaId,
FormulaType = Entity.FormulaType,
PlanId = ljPlanningEntity.Id,
FormulaType = Entity.FormulaType,
Machine = Entity.Machine,
MachineType = Entity.MachineType,
MId = Entity.MId,

@ -13,8 +13,7 @@ using Mesnac.Action.ChemicalWeighing.LjPlanning.Db;
using Mesnac.Action.ChemicalWeighing.LjPlanning.Entity;
using Mesnac.Action.ChemicalWeighing.LjProdcutLine;
using DataBlockHelper.DBHelpers;
using DataBlockHelper;
namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{
@ -31,7 +30,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
this._runtime = runtime;
_materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "lj_planning").FirstOrDefault(); //获取物料数据控件
DownToDatabase downToDatabase = new DownToDatabase(_materialGridControl);
DataGridView clientGridView = this._materialGridControl.BaseControl as DataGridView;
@ -121,7 +120,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
//配方名称
var formulaId = ljPlanningView.FormulaId;
var unit = ljPlanningView.Unit;
var plc = BasePlcHelper.Instance;
var formulDetail = LjFormulaDb.GetDetail(formulaId);
Clean(unit);
@ -139,53 +138,60 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
if (dataDry1.H1 != null && dataDry1.H1.Count>0)
{
WriteEnbale(plc.EnableDryD1);
PlcConnect.Instance.Write($"DB2104.53.6",true);
}
else
{
WriteCanel(plc.EnableDryD1);
PlcConnect.Instance.Write($"DB2104.53.6", false);
}
var dataSilo1A = GetUnitSiloView(formulDetail, "A");
LjPlanningPlcHelp.DownG1Recipe(dataSilo1A.H1, dataSilo1A.H2, dataSilo1A.R1);
if (dataSilo1A.H1 != null && dataSilo1A.H1.Count > 0)
//1#糊化机使能
if (dataSilo1A.H2 != null && dataSilo1A.H2.Count > 0)
{
WriteEnbale(plc.EnableDryG1);
PlcConnect.Instance.Write($"DB2104.54.2", true);
}
else
{
WriteCanel(plc.EnableDryG1);
PlcConnect.Instance.Write($"DB2104.54.2", false);
}
var dataSilo1B = GetUnitSiloView(formulDetail, "B");
LjPlanningPlcHelp.DownG2Recipe(dataSilo1B.H1, dataSilo1B.H2, dataSilo1B.R1);
if (dataSilo1B.H1 != null && dataSilo1B.H1.Count > 0)
{
WriteEnbale(plc.EnableDryG2);
//2#糊化机使能
if (dataSilo1B.H2 != null && dataSilo1B.H2.Count > 0)
{
PlcConnect.Instance.Write($"DB2104.54.3", true);
}
else
{
WriteCanel(plc.EnableDryG2);
PlcConnect.Instance.Write($"DB2104.54.3", false);
}
// 1#湿混机使能
var dataWeter1A = GetUnitWeterView(formulDetail, "A");
LjPlanningPlcHelp.DownM1Recipe(dataWeter1A.R2);
if (dataWeter1A.R2 != null && dataWeter1A.R2.Count>0)
{
WriteEnbale(plc.EnableDryM1);
PlcConnect.Instance.Write($"DB2104.55.2", true);
}
else
{
WriteCanel(plc.EnableDryM1);
PlcConnect.Instance.Write($"DB2104.55.2", false);
}
@ -195,19 +201,21 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
if (dataWeter1B.R2 != null && dataWeter1B.R2.Count > 0)
{
WriteEnbale(plc.EnableDryM2);
PlcConnect.Instance.Write($"DB2104.55.3", true);
}
else
{
WriteCanel(plc.EnableDryM2);
PlcConnect.Instance.Write($"DB2104.55.3", false);
}
PlcConnect.Instance.Write($"DB2105.0.0", Convert.ToUInt16(formulaId));
PlcConnect.Instance.Write($"DB2105.2.0", Convert.ToUInt16(ljPlanningView.Id));
PlcConnect.Instance.Write($"DB2105.4.0", Convert.ToUInt16(ljPlanningView.NumCar));
var sss= PlcConnect.Instance.Write($"DB2105.6.0", Convert.ToUInt16(1));
PlcConnect.Instance.Write($"DB2105.8.0", Convert.ToUInt16(0));
PlcConnect.Instance.Write($"DB2105.10.0", Convert.ToUInt16(0));
plc.PlcWriteByDataKey(plc.Plan0_RecipeCode, new object[] { formulaId });
plc.PlcWriteByDataKey(plc.Plan0_PlanCode, new object[] { ljPlanningView.Id });
plc.PlcWriteByDataKey(plc.Plan0_Batch, new object[] { ljPlanningView.NumCar });
plc.PlcWriteByDataKey(plc.Plan0_Start, new object[] { 1 });
//把状态变成执行
@ -225,64 +233,76 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
var dataDry2 = GetUnitDryView(formulDetail);
LjPlanningPlcHelp.DownD2Recipe(dataDry2.H1, dataDry2.R1);
if (dataDry2.H1 != null)
if (dataDry2.H1 != null && dataDry2.H1.Count>0)
{
WriteEnbale(plc.EnableDryD2);
PlcConnect.Instance.Write($"DB2104.53.7", true);
}
else
{
WriteCanel(plc.EnableDryD2);
PlcConnect.Instance.Write($"DB2104.53.7", false);
}
//3#糊化机使能
var dataSilo2A = GetUnitSiloView(formulDetail, "A");
LjPlanningPlcHelp.DownG3Recipe(dataSilo2A.H1, dataSilo2A.H2, dataSilo2A.R1);
if (dataSilo2A.H1 != null)
if (dataSilo2A.H1 != null && dataSilo2A.H1.Count>0)
{
WriteEnbale(plc.EnableDryG3);
PlcConnect.Instance.Write($"DB2104.54.4", true);
}
else
{
WriteCanel(plc.EnableDryG3);
PlcConnect.Instance.Write($"DB2104.54.4", false);
}
var dataSilo2B = GetUnitSiloView(formulDetail, "B");
//4#糊化机使能
LjPlanningPlcHelp.DownG4Recipe(dataSilo2B.H1, dataSilo2B.H2, dataSilo2B.R1);
if (dataSilo2B.H1 != null)
if (dataSilo2B.H1 != null && dataSilo2B.H1.Count>0)
{
WriteEnbale(plc.EnableDryG4);
PlcConnect.Instance.Write($"DB2104.54.5", true);
}
else
{
WriteCanel(plc.EnableDryG4);
PlcConnect.Instance.Write($"DB2104.54.5", false);
}
var dataWeter2A = GetUnitWeterView(formulDetail, "A");
LjPlanningPlcHelp.DownM3Recipe(dataWeter2A.R2);
if (dataWeter2A.R2 != null)
if (dataWeter2A.R2 != null && dataWeter2A.R2.Count>0)
{
PlcConnect.Instance.Write($"DB2104.55.4", true);
}
else
{
WriteEnbale(plc.EnableDryM3);
PlcConnect.Instance.Write($"DB2104.55.4", false);
}
var dataWeter2B = GetUnitWeterView(formulDetail, "B");
LjPlanningPlcHelp.DownM4Recipe(dataWeter2B.R2);
if (dataWeter2B.R2 != null)
if (dataWeter2B.R2 != null && dataWeter2B.R2.Count > 0)
{
PlcConnect.Instance.Write($"DB2104.55.5", true);
}
else
{
WriteEnbale(plc.EnableDryM4);
PlcConnect.Instance.Write($"DB2104.55.5", false);
}
plc.PlcWriteByDataKey(plc.Plan1_RecipeCode, new object[] { formulaId });
plc.PlcWriteByDataKey(plc.Plan1_RecipeCode, new object[] { ljPlanningView.Id });
plc.PlcWriteByDataKey(plc.Plan1_Batch, new object[] { ljPlanningView.NumCar });
PlcConnect.Instance.Write($"DB2105.12.0", Convert.ToUInt16(formulaId));
PlcConnect.Instance.Write($"DB2105.14.0", Convert.ToUInt16(ljPlanningView.Id));
PlcConnect.Instance.Write($"DB2105.16.0", Convert.ToUInt16(ljPlanningView.NumCar));
PlcConnect.Instance.Write($"DB2105.18.0", Convert.ToUInt16(1));
PlcConnect.Instance.Write($"DB2105.20.0", Convert.ToUInt16(0));
PlcConnect.Instance.Write($"DB2105.22.0", Convert.ToUInt16(0));
plc.PlcWriteByDataKey(plc.Plan1_Start, new object[] { 1 });
//把状态变成执行
LjPlanningDb.UpdateStatus(1, ljPlanningView.Id);
LjPlanningDb.UpdateBeginTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ljPlanningView.Id);
@ -293,52 +313,77 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
var dataDry3 = GetUnitDryView(formulDetail);
LjPlanningPlcHelp.DownD3Recipe(dataDry3.H1, dataDry3.R1);
if (dataDry3.H1 != null)
if (dataDry3.H1 != null && dataDry3.H1.Count>0)
{
WriteEnbale(plc.EnableDryD3);
PlcConnect.Instance.Write($"DB2104.54.0", true);
}
else
{
PlcConnect.Instance.Write($"DB2104.54.0", false);
}
//5#糊化机使能
var dataSilo3A = GetUnitSiloView(formulDetail, "A");
LjPlanningPlcHelp.DownG5Recipe(dataSilo3A.H1, dataSilo3A.H2, dataSilo3A.R1);
if (dataSilo3A.H1 != null)
if (dataSilo3A.H1 != null && dataSilo3A.H1.Count > 0)
{
PlcConnect.Instance.Write($"DB2104.54.6", true);
}
else
{
WriteEnbale(plc.EnableDryG5);
PlcConnect.Instance.Write($"DB2104.54.6", false);
}
//6#糊化机使能
var dataSilo3B = GetUnitSiloView(formulDetail, "B");
LjPlanningPlcHelp.DownG6Recipe(dataSilo3B.H1, dataSilo3B.H2, dataSilo3B.R1);
if (dataSilo3B.H1 != null)
if (dataSilo3B.H1 != null && dataSilo3B.H1.Count > 0)
{
PlcConnect.Instance.Write($"DB2104.54.7", true);
}
else
{
WriteEnbale(plc.EnableDryG6);
PlcConnect.Instance.Write($"DB2104.54.7", false);
}
var dataWeter3A = GetUnitWeterView(formulDetail, "A");
LjPlanningPlcHelp.DownM5Recipe(dataWeter3A.R2);
if (dataWeter3A.R2 != null)
if (dataWeter3A.R2 != null && dataWeter3A.R2.Count>0)
{
WriteEnbale(plc.EnableDryM5);
PlcConnect.Instance.Write($"DB2104.55.6", true);
}
else
{
PlcConnect.Instance.Write($"DB2104.55.6", false);
}
var dataWeter3B = GetUnitWeterView(formulDetail, "B");
LjPlanningPlcHelp.DownM6Recipe(dataWeter3B.R2);
if (dataWeter3B.R2 != null)
if (dataWeter3B.R2 != null && dataWeter3B.R2.Count>0)
{
WriteEnbale(plc.EnableDryM6);
PlcConnect.Instance.Write($"DB2104.55.7", true);
}
else
{
PlcConnect.Instance.Write($"DB2104.55.7", false);
}
plc.PlcWriteByDataKey(plc.Plan2_RecipeCode, new object[] { formulaId });
plc.PlcWriteByDataKey(plc.Plan2_RecipeCode, new object[] { ljPlanningView.Id });
plc.PlcWriteByDataKey(plc.Plan2_Batch, new object[] { ljPlanningView.NumCar });
plc.PlcWriteByDataKey(plc.Plan2_Start, new object[] { 1 });
PlcConnect.Instance.Write($"DB2105.24.0", Convert.ToUInt16(formulaId));
PlcConnect.Instance.Write($"DB2105.26.0", Convert.ToUInt16(ljPlanningView.Id));
PlcConnect.Instance.Write($"DB2105.28.0", Convert.ToUInt16(ljPlanningView.NumCar));
PlcConnect.Instance.Write($"DB2105.30.0", Convert.ToUInt16(1));
PlcConnect.Instance.Write($"DB2105.32.0", Convert.ToUInt16(0));
PlcConnect.Instance.Write($"DB2105.34.0", Convert.ToUInt16(0));
//把状态变成执行
LjPlanningDb.UpdateStatus(1, ljPlanningView.Id);
LjPlanningDb.UpdateBeginTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ljPlanningView.Id);
@ -351,9 +396,13 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
var dataDry4 = GetUnitDryView(formulDetail);
LjPlanningPlcHelp.DownD4Recipe(dataDry4.H1, dataDry4.R1);
if (dataDry4.H1 != null)
if (dataDry4.H1 != null && dataDry4.H1.Count>0)
{
PlcConnect.Instance.Write($"DB2104.54.1", true);
}
else
{
WriteEnbale(plc.EnableDryD4);
PlcConnect.Instance.Write($"DB2104.54.1", false);
}
@ -362,18 +411,29 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
var dataSilo4A = GetUnitSiloView(formulDetail, "A");
LjPlanningPlcHelp.DownG7Recipe(dataSilo4A.H1, dataSilo4A.H2, dataSilo4A.R1);
if (dataSilo4A.H1 != null)
if (dataSilo4A.H1 != null && dataSilo4A.H1.Count > 0)
{
PlcConnect.Instance.Write($"DB2104.55.0", true);
}
else
{
WriteEnbale(plc.EnableDryG7);
PlcConnect.Instance.Write($"DB2104.55.0", false);
}
// 8#糊化机使能
var dataSilo4B = GetUnitSiloView(formulDetail, "B");
LjPlanningPlcHelp.DownG8Recipe(dataSilo4B.H1, dataSilo4B.H2, dataSilo4B.R1);
if (dataSilo4B.H1 != null)
if (dataSilo4B.H1 != null && dataSilo4B.H1.Count > 0)
{
WriteEnbale(plc.EnableDryG8);
PlcConnect.Instance.Write($"DB2104.55.1", true);
}
else
{
PlcConnect.Instance.Write($"DB2104.55.1", false);
}
@ -381,25 +441,34 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
LjPlanningPlcHelp.DownM7Recipe(dataWeter4A.R2);
if (dataWeter4A.R2 != null)
if (dataWeter4A.R2 != null && dataWeter4A.R2.Count>0)
{
WriteEnbale(plc.EnableDryM7);
PlcConnect.Instance.Write($"DB2104.56.0", true);
}
else
{
PlcConnect.Instance.Write($"DB2104.56.0", false);
}
var dataWeter4B = GetUnitWeterView(formulDetail, "B");
LjPlanningPlcHelp.DownM8Recipe(dataWeter4B.R2);
if (dataWeter4B.R2 != null)
if (dataWeter4B.R2 != null && dataWeter4B.R2.Count>0)
{
WriteEnbale(plc.EnableDryM8);
PlcConnect.Instance.Write($"DB2104.56.1", true);
}
else
{
PlcConnect.Instance.Write($"DB2104.56.1", false);
}
plc.PlcWriteByDataKey(plc.Plan3_RecipeCode, new object[] { formulaId });
plc.PlcWriteByDataKey(plc.Plan3_RecipeCode, new object[] { ljPlanningView.Id });
plc.PlcWriteByDataKey(plc.Plan3_Batch, new object[] { ljPlanningView.NumCar });
plc.PlcWriteByDataKey(plc.Plan3_Start, new object[] { 1 });
PlcConnect.Instance.Write($"DB2105.36.0", Convert.ToUInt16(formulaId));
PlcConnect.Instance.Write($"DB2105.38.0", Convert.ToUInt16(ljPlanningView.Id));
PlcConnect.Instance.Write($"DB2105.40.0", Convert.ToUInt16(ljPlanningView.NumCar));
PlcConnect.Instance.Write($"DB2105.42.0", Convert.ToUInt16(1));
PlcConnect.Instance.Write($"DB2105.44.0", Convert.ToUInt16(0));
PlcConnect.Instance.Write($"DB2105.46.0", Convert.ToUInt16(0));
//把状态变成执行
LjPlanningDb.UpdateStatus(1, ljPlanningView.Id);
LjPlanningDb.UpdateBeginTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ljPlanningView.Id);
@ -407,7 +476,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
}
DownToDatabase downToDatabase = new DownToDatabase(ljPlanningView.Id);
}
else
@ -556,20 +627,28 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
public void Clean(int unit)
public List<RecipePlcView> GetRecipePlcViews(int num)
{
List<RecipePlcView> H1 = new List<RecipePlcView>();
List< Step > sto = new List< Step >();
List < MixStep > mixSteps=new List<MixStep> ();
for (int i = 0; i < 12; i++) {
for (int i = 0; i < num; i++)
{
H1.Add(new RecipePlcView()
{
Bin = 0,
Set = 0,
TolErance = 0
});
}
return H1;
}
public List<Step> GetStep(int num)
{
List< Step > sto = new List< Step >();
for (int i = 0; i < num; i++)
{
sto.Add(new Step()
{
MixCode = 0,
@ -578,55 +657,70 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
MixTime = 0
});
}
mixSteps.Add(new MixStep()
return sto;
}
public List<MixStep> GetMixStep(int num)
{
List< MixStep > sto = new List< MixStep >();
for (int i = 0; i < num; i++)
{
sto.Add(new MixStep()
{
MixCode = 0,
MixSpeed = 0,
MixTemp = 0,
MixTime = 0,
SetTolerance = 0,
SetValue = 0
MixTime = 0
});
}
return sto;
}
private void Clean(int unit)
{
if(unit == 1)
{
LjPlanningPlcHelp.DownD1Recipe(H1, sto);
LjPlanningPlcHelp.DownG1Recipe(H1, H1, sto);
LjPlanningPlcHelp.DownG2Recipe(H1, H1, sto);
LjPlanningPlcHelp.DownM1Recipe(mixSteps);
LjPlanningPlcHelp.DownM2Recipe(mixSteps);
LjPlanningPlcHelp.DownD1Recipe(GetRecipePlcViews(4), GetStep(10));
LjPlanningPlcHelp.DownG1Recipe(GetRecipePlcViews(2),GetRecipePlcViews(2), GetStep(10));
LjPlanningPlcHelp.DownG2Recipe(GetRecipePlcViews(2),GetRecipePlcViews(2), GetStep(10));
LjPlanningPlcHelp.DownM1Recipe(GetMixStep(10));
LjPlanningPlcHelp.DownM2Recipe(GetMixStep(10));
}
if (unit == 2)
{
LjPlanningPlcHelp.DownD2Recipe(H1, sto);
LjPlanningPlcHelp.DownG3Recipe(H1, H1, sto);
LjPlanningPlcHelp.DownG4Recipe(H1, H1, sto);
LjPlanningPlcHelp.DownM3Recipe(mixSteps);
LjPlanningPlcHelp.DownM4Recipe(mixSteps);
LjPlanningPlcHelp.DownD2Recipe(GetRecipePlcViews(4), GetStep(10));
LjPlanningPlcHelp.DownG3Recipe(GetRecipePlcViews(2),GetRecipePlcViews(2), GetStep(10));
LjPlanningPlcHelp.DownG4Recipe(GetRecipePlcViews(2),GetRecipePlcViews(2), GetStep(10));
LjPlanningPlcHelp.DownM3Recipe(GetMixStep(10));
LjPlanningPlcHelp.DownM4Recipe(GetMixStep(10));
}
if (unit == 3)
{
LjPlanningPlcHelp.DownD3Recipe(H1, sto);
LjPlanningPlcHelp.DownG5Recipe(H1, H1, sto);
LjPlanningPlcHelp.DownG6Recipe(H1, H1, sto);
LjPlanningPlcHelp.DownD3Recipe(GetRecipePlcViews(4), GetStep(10));
LjPlanningPlcHelp.DownG5Recipe(GetRecipePlcViews(2),GetRecipePlcViews(2), GetStep(10));
LjPlanningPlcHelp.DownG6Recipe(GetRecipePlcViews(2),GetRecipePlcViews(2), GetStep(10));
LjPlanningPlcHelp.DownM5Recipe(mixSteps);
LjPlanningPlcHelp.DownM6Recipe(mixSteps);
LjPlanningPlcHelp.DownM5Recipe(GetMixStep(10));
LjPlanningPlcHelp.DownM6Recipe(GetMixStep(10));
}
if (unit == 4)
{
LjPlanningPlcHelp.DownD4Recipe(H1, sto);
LjPlanningPlcHelp.DownG7Recipe(H1, H1, sto);
LjPlanningPlcHelp.DownG8Recipe(H1, H1, sto);
LjPlanningPlcHelp.DownD4Recipe(GetRecipePlcViews(4), GetStep(10));
LjPlanningPlcHelp.DownG7Recipe(GetRecipePlcViews(2),GetRecipePlcViews(2), GetStep(10));
LjPlanningPlcHelp.DownG8Recipe(GetRecipePlcViews(2),GetRecipePlcViews(2), GetStep(10));
LjPlanningPlcHelp.DownM7Recipe(mixSteps);
LjPlanningPlcHelp.DownM8Recipe(mixSteps);
LjPlanningPlcHelp.DownM7Recipe(GetMixStep(10));
LjPlanningPlcHelp.DownM8Recipe(GetMixStep(10));
}
}

@ -1,6 +1,9 @@
using System;
using System.Linq;
using System.Windows.Forms;
using DataBlockHelper;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.LjPlanning.Db;
@ -42,10 +45,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
//Pause
var i = BasePlcHelper.Instance.RecipePause.LastValue.ToInt();
string message = "是否暂停系统";
var formul = LjFormulaDb.GetById(id);
var plc = BasePlcHelper.Instance;
if (MessageBox.Show(message, "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) ==
DialogResult.OK)
{
@ -53,18 +56,24 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
switch (unit)
{
case 1:
plc.PlcWriteByDataKey(plc.Plan0_Pause, new object[] { 1 });
PlcConnect.Instance.Write($"DB2105.8.0", Convert.ToUInt16(1));
// plc.PlcWriteByDataKey(plc.Plan0_Pause, new object[] { 1 });
break;
case 2:
plc.PlcWriteByDataKey(plc.Plan1_Pause, new object[] { 1 });
PlcConnect.Instance.Write($"DB2105.20.0", Convert.ToUInt16(1));
// plc.PlcWriteByDataKey(plc.Plan1_Pause, new object[] { 1 });
break;
case 3:
plc.PlcWriteByDataKey(plc.Plan2_Pause, new object[] { 1 });
PlcConnect.Instance.Write($"DB2105.32.0", Convert.ToUInt16(1));
// plc.PlcWriteByDataKey(plc.Plan2_Pause, new object[] { 1 });
break;
case 4:
plc.PlcWriteByDataKey(plc.Plan3_Pause, new object[] { 1 });
PlcConnect.Instance.Write($"DB2105.44.0", Convert.ToUInt16(1));
// plc.PlcWriteByDataKey(plc.Plan3_Pause, new object[] { 1 });
break;
default:
break;

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using DataBlockHelper.DBHelpers;
using DataBlockHelper.DbWrite;
using DataBlockHelper.Entity.DB2107Entity;
using DevExpress.XtraGauges.Core.Model;
using DevExpress.XtraRichEdit.API.Layout;
@ -16,31 +18,28 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
private static void DownDbw12(PressureSettingView view)
{
if (view != null)
{
// var basePlcHelper = GetPlcHelper;
// basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V1_LowLimit, view.LowLimit);
// basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V1_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V1_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
}
PlcWriteUtil plcWriter = new PlcWriteUtil();
if (view != null)
{
// var basePlcHelper = GetPlcHelper;
var ss= plcWriter.Write(PlcDbEnum.Db2107,"16.0",PlcDbType.PlcFloat,view.LowLimit);
ss= plcWriter.Write(PlcDbEnum.Db2107,"20.0",PlcDbType.PlcFloat,view.HighLimit);
DownDbPressureSettingView(16,view);
}
}
static PlcWriteUtil plcWriter = new PlcWriteUtil();
private static void DownDbPressureSettingView(int start, PressureSettingView view)
{
int begin = start;
int end = begin + 4;
plcWriter.Write(PlcDbEnum.Db2107, $"{begin}.0", PlcDbType.PlcFloat, view.LowLimit);
plcWriter.Write(PlcDbEnum.Db2107, $"{end}.0", PlcDbType.PlcFloat, view.HighLimit);
}
private static DB2107Helper _db2107Helper = new DB2107Helper();
@ -66,45 +65,51 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V1_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V1_HighLimit, view.HighLimit);
DownDbPressureSettingView(30, view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V1_LowLimit, view.LowLimit);
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V1_HighLimit, view.HighLimit);
}
}
private static PressureSettingView UpDbw26()
{
var basePlcHelper = GetPlcHelper;
var v1 = _db2107Helper.Pressure.TopPressure_V1;
return GetSettingView(2, v1);
}
static PressureSettingView GetSettingView(int id, Pressure_HMI v1)
{
PressureSettingView view = new PressureSettingView();
view.Id = 2;
view.LowLimit = basePlcHelper.topPressure_V1_LowLimit.NowValue.ToFloat();
view.HighLimit = basePlcHelper.topPressure_V1_HighLimit.NowValue.ToFloat();
view.Alarm = basePlcHelper.topPressure_V1_Alarm.NowValue.ToInt();
view.Id = id;
view.LowLimit = v1.LowLimit;
view.HighLimit = v1.HighLimit;
return view;
}
private static void DownDbw40(PressureSettingView view)
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V1_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V1_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePressure_V1_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(44, view);
}
}
private static PressureSettingView UpDbw40()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView();
view.Id = 3;
view.LowLimit = basePlcHelper.linePressure_V1_LowLimit.NowValue.ToFloat();
view.HighLimit = basePlcHelper.linePressure_V1_HighLimit.NowValue.ToFloat();
view.Alarm = basePlcHelper.linePressure_V1_Alarm.NowValue.ToInt();
PressureSettingView view = GetSettingView(3, _db2107Helper.Pressure.LinePressure_V1);
//view.Id = 3;
//view.LowLimit = basePlcHelper.linePressure_V1_LowLimit.NowValue.ToFloat();
//view.HighLimit = basePlcHelper.linePressure_V1_HighLimit.NowValue.ToFloat();
return view;
}
@ -113,22 +118,18 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V2_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V2_HighLimit, view.HighLimit);
basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V2_Alarm,
new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(58, view);
}
}
private static PressureSettingView UpDbw54()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView();
view.Id = 4;
view.LowLimit = basePlcHelper.mainPress_V2_LowLimit.NowValue.ToFloat();
view.HighLimit = basePlcHelper.mainPress_V2_HighLimit.NowValue.ToFloat();
view.Alarm = basePlcHelper.mainPress_V2_Alarm.NowValue.ToInt();
PressureSettingView view = GetSettingView(4, _db2107Helper.Pressure.MainPress_V2);
//view.Id = 4;
//view.LowLimit = basePlcHelper.mainPress_V2_LowLimit.NowValue.ToFloat();
//view.HighLimit = basePlcHelper.mainPress_V2_HighLimit.NowValue.ToFloat();
//view.Alarm = basePlcHelper.mainPress_V2_Alarm.NowValue.ToInt();
return view;
}
@ -137,22 +138,18 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V2_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V2_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.topPressure_V2_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(72, view);
}
}
private static PressureSettingView UpDbw68()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView();
view.Id = 5;
view.LowLimit = basePlcHelper.topPressure_V2_LowLimit.NowValue.ToFloat();
view.HighLimit = basePlcHelper.topPressure_V2_HighLimit.NowValue.ToFloat();
view.Alarm = basePlcHelper.topPressure_V2_Alarm.NowValue.ToInt();
PressureSettingView view = GetSettingView(5, _db2107Helper.Pressure.TopPressure_V2);
//view.Id = 5;
//view.LowLimit = basePlcHelper.topPressure_V2_LowLimit.NowValue.ToFloat();
//view.HighLimit = basePlcHelper.topPressure_V2_HighLimit.NowValue.ToFloat();
//view.Alarm = basePlcHelper.topPressure_V2_Alarm.NowValue.ToInt();
return view;
}
@ -161,22 +158,18 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V2_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V2_HighLimit, view.HighLimit);
basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePressure_V2_Alarm,
new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(86, view);
}
}
private static PressureSettingView UpDbw82()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView();
view.Id = 6;
view.LowLimit = basePlcHelper.linePressure_V2_LowLimit.NowValue.ToFloat();
view.HighLimit = basePlcHelper.linePressure_V2_HighLimit.NowValue.ToFloat();
view.Alarm = basePlcHelper.linePressure_V2_Alarm.NowValue.ToInt();
PressureSettingView view = GetSettingView(6, _db2107Helper.Pressure.LinePressure_V2);
//view.Id = 6;
//view.LowLimit = basePlcHelper.linePressure_V2_LowLimit.NowValue.ToFloat();
//view.HighLimit = basePlcHelper.linePressure_V2_HighLimit.NowValue.ToFloat();
//view.Alarm = basePlcHelper.linePressure_V2_Alarm.NowValue.ToInt();
return view;
}
@ -184,22 +177,18 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V3_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V3_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V3_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(100, view);
}
}
private static PressureSettingView UpDbw96()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView();
view.Id = 7;
view.LowLimit = basePlcHelper.mainPress_V3_LowLimit.NowValue.ToFloat();
view.HighLimit = basePlcHelper.mainPress_V3_HighLimit.NowValue.ToFloat();
view.Alarm = basePlcHelper.mainPress_V3_Alarm.NowValue.ToInt();
PressureSettingView view = GetSettingView(7, _db2107Helper.Pressure.MainPress_V3);
//view.Id = 7;
//view.LowLimit = basePlcHelper.mainPress_V3_LowLimit.NowValue.ToFloat();
//view.HighLimit = basePlcHelper.mainPress_V3_HighLimit.NowValue.ToFloat();
//view.Alarm = basePlcHelper.mainPress_V3_Alarm.NowValue.ToInt();
return view;
}
@ -208,22 +197,18 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V3_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V3_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.topPressure_V3_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(114, view);
}
}
private static PressureSettingView UpDbw110()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView();
view.Id = 8;
view.LowLimit = basePlcHelper.topPressure_V3_LowLimit.NowValue.ToFloat();
view.HighLimit = basePlcHelper.topPressure_V3_HighLimit.NowValue.ToFloat();
view.Alarm = basePlcHelper.topPressure_V3_Alarm.NowValue.ToInt();
PressureSettingView view = GetSettingView(8, _db2107Helper.Pressure.TopPressure_V3);
//view.Id = 8;
//view.LowLimit = basePlcHelper.topPressure_V3_LowLimit.NowValue.ToFloat();
//view.HighLimit = basePlcHelper.topPressure_V3_HighLimit.NowValue.ToFloat();
//view.Alarm = basePlcHelper.topPressure_V3_Alarm.NowValue.ToInt();
return view;
}
@ -231,24 +216,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V3_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V3_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePressure_V3_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(128, view);
}
}
private static PressureSettingView UpDbw124()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 9,
LowLimit = basePlcHelper.linePressure_V3_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.linePressure_V3_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.linePressure_V3_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(9, _db2107Helper.Pressure.LinePressure_V3);
//{
// Id = 9,
// LowLimit = basePlcHelper.linePressure_V3_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.linePressure_V3_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.linePressure_V3_Alarm.NowValue.ToInt()
//};
return view;
}
@ -257,23 +238,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V4_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V4_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V4_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(142, view);
}
}
private static PressureSettingView UpDbw138()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 10,
LowLimit = basePlcHelper.mainPress_V4_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.mainPress_V4_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.mainPress_V4_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(10, _db2107Helper.Pressure.MainPress_V4);
//{
// Id = 10,
// LowLimit = basePlcHelper.mainPress_V4_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.mainPress_V4_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.mainPress_V4_Alarm.NowValue.ToInt()
//};
return view;
}
@ -282,24 +259,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V4_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V4_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.topPressure_V4_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(156, view);
}
}
private static PressureSettingView UpDbw152()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 11,
LowLimit = basePlcHelper.topPressure_V4_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.topPressure_V4_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.topPressure_V4_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(11, _db2107Helper.Pressure.TopPressure_V4);
//{
// Id = 11,
// LowLimit = basePlcHelper.topPressure_V4_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.topPressure_V4_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.topPressure_V4_Alarm.NowValue.ToInt()
//};
return view;
}
@ -307,24 +280,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V4_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V4_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePressure_V4_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(170, view);
}
}
private static PressureSettingView UpDbw166()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 12,
LowLimit = basePlcHelper.linePressure_V4_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.linePressure_V4_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.linePressure_V4_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(12, _db2107Helper.Pressure.LinePressure_V4);
//{
// Id = 12,
// LowLimit = basePlcHelper.linePressure_V4_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.linePressure_V4_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.linePressure_V4_Alarm.NowValue.ToInt()
//};
return view;
}
@ -333,24 +302,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V5_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V5_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V5_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(184, view);
}
}
private static PressureSettingView UpDbw180()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 13,
LowLimit = basePlcHelper.mainPress_V5_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.mainPress_V5_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.mainPress_V5_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(13, _db2107Helper.Pressure.MainPress_V5);
//{
// Id = 13,
// LowLimit = basePlcHelper.mainPress_V5_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.mainPress_V5_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.mainPress_V5_Alarm.NowValue.ToInt()
//};
return view;
}
@ -359,24 +324,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V5_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPressure_V5_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.topPressure_V5_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(198, view);
}
}
private static PressureSettingView UpDbw194()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 14,
LowLimit = basePlcHelper.topPressure_V5_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.topPressure_V5_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.topPressure_V5_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(14, _db2107Helper.Pressure.TopPressure_V5);
//{
// Id = 14,
// LowLimit = basePlcHelper.topPressure_V5_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.topPressure_V5_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.topPressure_V5_Alarm.NowValue.ToInt()
//};
return view;
}
@ -384,24 +345,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V5_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePressure_V5_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePressure_V5_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(212, view);
}
}
private static PressureSettingView UpDbw208()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 15,
LowLimit = basePlcHelper.linePressure_V5_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.linePressure_V5_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.linePressure_V5_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(15, _db2107Helper.Pressure.LinePressure_V5);
//{
// Id = 15,
// LowLimit = basePlcHelper.linePressure_V5_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.linePressure_V5_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.linePressure_V5_Alarm.NowValue.ToInt()
//};
return view;
}
@ -411,24 +368,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B1_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B1_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B1_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(226, view);
}
}
private static PressureSettingView UpDbw222()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 16,
LowLimit = basePlcHelper.presDaybin_B1_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B1_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B1_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(16, _db2107Helper.Pressure.PressDaybin_B1);
//{
// Id = 16,
// LowLimit = basePlcHelper.presDaybin_B1_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B1_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B1_Alarm.NowValue.ToInt()
//};
return view;
}
@ -436,24 +389,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B2_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B2_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B2_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(240, view);
}
}
private static PressureSettingView UpDbw236()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 17,
LowLimit = basePlcHelper.presDaybin_B2_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B2_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B2_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(17, _db2107Helper.Pressure.PressDaybin_B2);
//{
// Id = 17,
// LowLimit = basePlcHelper.presDaybin_B2_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B2_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B2_Alarm.NowValue.ToInt()
//};
return view;
}
@ -461,24 +410,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B3_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B3_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B3_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(254, view);
}
}
private static PressureSettingView UpDbw250()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 18,
LowLimit = basePlcHelper.presDaybin_B3_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B3_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B3_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(18, _db2107Helper.Pressure.PressDaybin_B3);
//{
// Id = 18,
// LowLimit = basePlcHelper.presDaybin_B3_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B3_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B3_Alarm.NowValue.ToInt()
//};
return view;
}
@ -486,24 +431,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B4_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B4_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B4_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(268, view);
}
}
private static PressureSettingView UpDbw264()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 19,
LowLimit = basePlcHelper.presDaybin_B4_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B4_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B4_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(19, _db2107Helper.Pressure.PressDaybin_B4);
//{
// Id = 19,
// LowLimit = basePlcHelper.presDaybin_B4_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B4_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B4_Alarm.NowValue.ToInt()
//};
return view;
}
@ -511,24 +452,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B5_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B5_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B5_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(282, view);
}
}
private static PressureSettingView UpDbw278()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 20,
LowLimit = basePlcHelper.presDaybin_B5_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B5_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B5_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(20, _db2107Helper.Pressure.PressDaybin_B5);
//{
// Id = 20,
// LowLimit = basePlcHelper.presDaybin_B5_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B5_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B5_Alarm.NowValue.ToInt()
//};
return view;
}
@ -536,23 +473,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B6_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B6_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B6_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(296, view);
}
}
private static PressureSettingView UpDbw292()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 21,
LowLimit = basePlcHelper.presDaybin_B6_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B6_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B6_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(21, _db2107Helper.Pressure.PressDaybin_B6);
//{
// Id = 21,
// LowLimit = basePlcHelper.presDaybin_B6_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B6_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B6_Alarm.NowValue.ToInt()
//};
return view;
}
@ -560,24 +493,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B7_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B7_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B7_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(310, view);
}
}
private static PressureSettingView UpDbw306()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 22,
LowLimit = basePlcHelper.presDaybin_B7_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B7_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B7_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(22, _db2107Helper.Pressure.PressDaybin_B7);
//{
// Id = 22,
// LowLimit = basePlcHelper.presDaybin_B7_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B7_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B7_Alarm.NowValue.ToInt()
//};
return view;
}
@ -585,24 +514,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B8_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B8_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B8_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(324, view);
}
}
private static PressureSettingView UpDbw320()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 23,
LowLimit = basePlcHelper.presDaybin_B8_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B8_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B8_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(23, _db2107Helper.Pressure.PressDaybin_B8);
//{
// Id = 23,
// LowLimit = basePlcHelper.presDaybin_B8_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B8_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B8_Alarm.NowValue.ToInt()
//};
return view;
}
@ -610,24 +535,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B9_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B9_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B9_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(338, view);
}
}
private static PressureSettingView UpDbw334()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 24,
LowLimit = basePlcHelper.presDaybin_B9_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B9_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B9_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(24, _db2107Helper.Pressure.PressDaybin_B9);
//{
// Id = 24,
// LowLimit = basePlcHelper.presDaybin_B9_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B9_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B9_Alarm.NowValue.ToInt()
//};
return view;
}
@ -635,24 +556,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B10_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B10_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B10_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(352, view);
}
}
private static PressureSettingView UpDbw348()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 25,
LowLimit = basePlcHelper.presDaybin_B10_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B10_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B10_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(25, _db2107Helper.Pressure.PressDaybin_B10);
//{
// Id = 25,
// LowLimit = basePlcHelper.presDaybin_B10_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B10_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B10_Alarm.NowValue.ToInt()
//};
return view;
}
@ -660,24 +577,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B11_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B11_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B11_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(366, view);
}
}
private static PressureSettingView UpDbw362()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 26,
LowLimit = basePlcHelper.presDaybin_B11_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B11_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B11_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(26, _db2107Helper.Pressure.PressDaybin_B11);
//{
// Id = 26,
// LowLimit = basePlcHelper.presDaybin_B11_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B11_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B11_Alarm.NowValue.ToInt()
//};
return view;
}
@ -685,24 +598,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B12_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDaybin_B12_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDaybin_B12_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(380, view);
}
}
private static PressureSettingView UpDbw376()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 27,
LowLimit = basePlcHelper.presDaybin_B12_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.presDaybin_B12_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.presDaybin_B12_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(27, _db2107Helper.Pressure.PressDaybin_B12);
//{
// Id = 27,
// LowLimit = basePlcHelper.presDaybin_B12_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.presDaybin_B12_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.presDaybin_B12_Alarm.NowValue.ToInt()
//};
return view;
}
@ -711,24 +620,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP01_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP01_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.PR2PCP01_B12_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(394, view);
}
}
private static PressureSettingView UpDbw390()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 28,
LowLimit = basePlcHelper.PR2PCP01_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.PR2PCP01_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.PR2PCP01_B12_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(28, _db2107Helper.Pressure.PR2PCP01);
//{
// Id = 28,
// LowLimit = basePlcHelper.PR2PCP01_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.PR2PCP01_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.PR2PCP01_B12_Alarm.NowValue.ToInt()
//};
return view;
}
@ -737,24 +642,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP02_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP02_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.PR2PCP02_B12_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(408, view);
}
}
private static PressureSettingView UpDbw404()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 29,
LowLimit = basePlcHelper.PR2PCP02_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.PR2PCP02_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.PR2PCP02_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(29, _db2107Helper.Pressure.PR2PCP02);
//{
// Id = 29,
// LowLimit = basePlcHelper.PR2PCP02_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.PR2PCP02_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.PR2PCP02_Alarm.NowValue.ToInt()
//};
return view;
}
@ -763,24 +664,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure
{
if (view != null)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP03_LowLimit, view.LowLimit);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP03_HighLimit, view.HighLimit);
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.PR2PCP03_B12_Alarm,
// new object[] { Convert.ToBoolean(view.Alarm) });
DownDbPressureSettingView(422, view);
}
}
private static PressureSettingView UpDbw418()
{
var basePlcHelper = GetPlcHelper;
PressureSettingView view = new PressureSettingView
{
Id = 30,
LowLimit = basePlcHelper.PR2PCP03_LowLimit.NowValue.ToFloat(),
HighLimit = basePlcHelper.PR2PCP03_HighLimit.NowValue.ToFloat(),
Alarm = basePlcHelper.PR2PCP03_Alarm.NowValue.ToInt()
};
PressureSettingView view = GetSettingView(30, _db2107Helper.Pressure.PR2PCP03);
//{
// Id = 30,
// LowLimit = basePlcHelper.PR2PCP03_LowLimit.NowValue.ToFloat(),
// HighLimit = basePlcHelper.PR2PCP03_HighLimit.NowValue.ToFloat(),
// Alarm = basePlcHelper.PR2PCP03_Alarm.NowValue.ToInt()
//};
return view;
}

@ -1,53 +1,83 @@
using System.Collections.Generic;
using DataBlockHelper;
using DataBlockHelper.DBHelpers;
using DataBlockHelper.Entity.DB2107Entity;
using Mesnac.Action.ChemicalWeighing.LjWeight;
using System;
using System.Collections.Generic;
namespace Mesnac.Action.ChemicalWeighing.LjProportional
{
public class ProportionalPlc
{
private static BasePlcHelper GetPlcHelper => BasePlcHelper.Instance;
private static DB2107Helper _db2107Helper = new DB2107Helper();
private static void DownProportionalSettingView(int start, ProportionalSettingView view)
{
int sv = start + 4;
PlcConnect.Instance.Write($"DB2107.{sv}.0", Convert.ToSingle(view.SV));
}
private static void Down614(ProportionalSettingView view)
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.conveyV1_SV, view.SV);
DownProportionalSettingView(614,view);
//var basePlcHelper = GetPlcHelper;
//basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.conveyV1_SV, view.SV);
}
}
private static ProportionalSettingView Up614()
private static ProportionalSettingView GetProportionalSettingView(int id, PID_HMI pID)
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 1,
PV = basePlcHelper.conveyV1_PV.NowValue.ToFloat(),
SV = basePlcHelper.conveyV1_SV.NowValue.ToFloat()
Id = id,
PV = pID.PV,
SV =pID.SV
};
return vi;
}
private static ProportionalSettingView Up614()
{
//
ProportionalSettingView vi = GetProportionalSettingView(1, _db2107Helper.PID.Convey_V1);
//{
// Id = 1,
// PV = basePlcHelper.conveyV1_PV.NowValue.ToFloat(),
// SV = basePlcHelper.conveyV1_SV.NowValue.ToFloat()
//};
return vi;
}
private static void Down622(ProportionalSettingView view)
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.purgeV1_SV, view.SV);
DownProportionalSettingView(622, view);
}
}
private static ProportionalSettingView Up622()
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 2,
PV = basePlcHelper.purgeV1_PV.NowValue.ToFloat(),
SV = basePlcHelper.purgeV1_SV.NowValue.ToFloat()
};
ProportionalSettingView vi = GetProportionalSettingView(2, _db2107Helper.PID.Purge_V1);
//{
// Id = 2,
// PV = basePlcHelper.purgeV1_PV.NowValue.ToFloat(),
// SV = basePlcHelper.purgeV1_SV.NowValue.ToFloat()
//};
return vi;
}
@ -57,21 +87,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.conveyV2_SV, view.SV);
DownProportionalSettingView(630, view);
}
}
private static ProportionalSettingView Up630()
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 3,
PV = basePlcHelper.conveyV2_PV.NowValue.ToFloat(),
SV = basePlcHelper.conveyV2_SV.NowValue.ToFloat()
};
ProportionalSettingView vi = GetProportionalSettingView(3, _db2107Helper.PID.Convey_V2);
//{
// Id = 3,
// PV = basePlcHelper.conveyV2_PV.NowValue.ToFloat(),
// SV = basePlcHelper.conveyV2_SV.NowValue.ToFloat()
//};
return vi;
}
@ -79,21 +108,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.purgeV2_SV, view.SV);
DownProportionalSettingView(638, view);
}
}
private static ProportionalSettingView Up638()
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 4,
PV = basePlcHelper.purgeV2_PV.NowValue.ToFloat(),
SV = basePlcHelper.purgeV2_SV.NowValue.ToFloat()
};
ProportionalSettingView vi = GetProportionalSettingView(4, _db2107Helper.PID.Purge_V2);
//{
// Id = 4,
// PV = basePlcHelper.purgeV2_PV.NowValue.ToFloat(),
// SV = basePlcHelper.purgeV2_SV.NowValue.ToFloat()
//};
return vi;
}
@ -106,21 +134,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.conveyV3_SV, view.SV);
DownProportionalSettingView(646, view);
}
}
private static ProportionalSettingView Up646()
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 5,
PV = basePlcHelper.conveyV3_PV.NowValue.ToFloat(),
SV = basePlcHelper.conveyV3_SV.NowValue.ToFloat()
};
ProportionalSettingView vi = GetProportionalSettingView(5, _db2107Helper.PID.Convey_V3);
//{
// Id = 5,
// PV = basePlcHelper.conveyV3_PV.NowValue.ToFloat(),
// SV = basePlcHelper.conveyV3_SV.NowValue.ToFloat()
//};
return vi;
}
@ -129,21 +156,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.purgeV3_SV, view.SV);
DownProportionalSettingView(654, view);
}
}
private static ProportionalSettingView Up654()
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 6,
PV = basePlcHelper.purgeV3_PV.NowValue.ToFloat(),
SV = basePlcHelper.purgeV3_SV.NowValue.ToFloat()
};
ProportionalSettingView vi = GetProportionalSettingView(6, _db2107Helper.PID.Purge_V3);
//{
// Id = 6,
// PV = basePlcHelper.purgeV3_PV.NowValue.ToFloat(),
// SV = basePlcHelper.purgeV3_SV.NowValue.ToFloat()
//};
return vi;
}
@ -155,21 +181,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.conveyV4_SV, view.SV);
DownProportionalSettingView(662, view);
}
}
private static ProportionalSettingView Up662()
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 7,
PV = basePlcHelper.conveyV4_PV.NowValue.ToFloat(),
SV = basePlcHelper.conveyV4_SV.NowValue.ToFloat()
};
ProportionalSettingView vi = GetProportionalSettingView(7, _db2107Helper.PID.Convey_V4);
//{
// Id = 7,
// PV = basePlcHelper.conveyV4_PV.NowValue.ToFloat(),
// SV = basePlcHelper.conveyV4_SV.NowValue.ToFloat()
//};
return vi;
}
@ -178,21 +203,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.purgeV4_SV, view.SV);
DownProportionalSettingView(670, view);
}
}
private static ProportionalSettingView Up670()
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 8,
PV = basePlcHelper.purgeV4_PV.NowValue.ToFloat(),
SV = basePlcHelper.purgeV4_SV.NowValue.ToFloat()
};
ProportionalSettingView vi = GetProportionalSettingView(8, _db2107Helper.PID.Purge_V4);
//{
// Id = 8,
// PV = basePlcHelper.purgeV4_PV.NowValue.ToFloat(),
// SV = basePlcHelper.purgeV4_SV.NowValue.ToFloat()
//};
return vi;
}
@ -204,21 +228,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.conveyV5_SV, view.SV);
DownProportionalSettingView(678, view);
}
}
private static ProportionalSettingView Up678()
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 9,
PV = basePlcHelper.conveyV5_PV.NowValue.ToFloat(),
SV = basePlcHelper.conveyV5_SV.NowValue.ToFloat()
};
ProportionalSettingView vi = GetProportionalSettingView(9, _db2107Helper.PID.Convey_V5);
//{
// Id = 9,
// PV = basePlcHelper.conveyV5_PV.NowValue.ToFloat(),
// SV = basePlcHelper.conveyV5_SV.NowValue.ToFloat()
//};
return vi;
}
@ -227,21 +250,20 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.purgeV5_SV, view.SV);
DownProportionalSettingView(686, view);
}
}
private static ProportionalSettingView Up686()
{
var basePlcHelper = GetPlcHelper;
ProportionalSettingView vi = new ProportionalSettingView()
{
Id = 10,
PV = basePlcHelper.purgeV5_PV.NowValue.ToFloat(),
SV = basePlcHelper.purgeV5_SV.NowValue.ToFloat()
};
ProportionalSettingView vi = GetProportionalSettingView(10, _db2107Helper.PID.Purge_V5);
//{
// Id = 10,
// PV = basePlcHelper.purgeV5_PV.NowValue.ToFloat(),
// SV = basePlcHelper.purgeV5_SV.NowValue.ToFloat()
//};
return vi;
}

@ -1,55 +1,82 @@
using System.Collections.Generic;
using DevExpress.PivotGrid.CriteriaVisitors;
using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using DataBlockHelper;
using DataBlockHelper.DBHelpers;
using DataBlockHelper.DbWrite;
using DataBlockHelper.Entity.DB2107Entity;
namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
public class WeightSettingPlc
{
private static BasePlcHelper GetPlcHelper => BasePlcHelper.Instance;
private static void Down432(WeightSettingView view)
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Hopper_1_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Hopper_1_LowWeight, view.LowWeight);
DownWeightSettingView(432, view);
}
}
private static WeightSettingView Up432()
static PlcWriteUtil plcWriter = new PlcWriteUtil();
private static DB2107Helper _db2107Helper = new DB2107Helper();
private static void DownWeightSettingView(int start, WeightSettingView view)
{
int hight = start + 4;
int low = start + 8;
PlcConnect.Instance.Write($"DB2107.{hight}.0", Convert.ToSingle(view.HighWeight));
PlcConnect.Instance.Write($"DB2107.{low}.0", Convert.ToSingle(view.LowWeight));
}
private static WeightSettingView GetWeightSettingView(int id, Silo_HMI silo)
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 1,
HighWeight = basePlcHelper.Hopper_1_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.Hopper_1_LowWeight.NowValue.ToFloat()
HighWeight = silo.HighWeight,
LowWeight = silo.LowWeight
};
return view;
}
private static WeightSettingView Up432()
{
WeightSettingView view = GetWeightSettingView(1, _db2107Helper.Weight.Hopper_1);
return view;
}
private static void Down446(WeightSettingView view)
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Hopper_2_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Hopper_2_LowWeight, view.LowWeight);
DownWeightSettingView(446, view);
}
}
private static WeightSettingView Up446()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 2,
HighWeight = basePlcHelper.Hopper_2_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.Hopper_2_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(2, _db2107Helper.Weight.Hopper_2);
//{
// Id = 2,
// HighWeight = basePlcHelper.Hopper_2_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.Hopper_2_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -58,21 +85,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Hopper_3_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Hopper_3_LowWeight, view.LowWeight);
DownWeightSettingView(460, view);
}
}
private static WeightSettingView Up460()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 3,
HighWeight = basePlcHelper.Hopper_3_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.Hopper_3_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(3, _db2107Helper.Weight.Hopper_3);
//{
// Id = 3,
// HighWeight = basePlcHelper.Hopper_3_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.Hopper_3_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -80,21 +105,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Hopper_4_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Hopper_4_LowWeight, view.LowWeight);
DownWeightSettingView(474, view);
}
}
private static WeightSettingView Up474()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 4,
HighWeight = basePlcHelper.Hopper_4_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.Hopper_4_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(4, _db2107Helper.Weight.Hopper_4);
//{
// Id = 4,
// HighWeight = basePlcHelper.Hopper_4_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.Hopper_4_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -103,21 +126,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_1_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_1_LowWeight, view.LowWeight);
DownWeightSettingView(488, view);
}
}
private static WeightSettingView Up488()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 5,
HighWeight = basePlcHelper.Vessel_1_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.Vessel_1_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(5, _db2107Helper.Weight.Vessel_1);
//{
// Id = 5,
// HighWeight = basePlcHelper.Vessel_1_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.Vessel_1_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -127,21 +148,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_2_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_2_LowWeight, view.LowWeight);
DownWeightSettingView(502, view);
}
}
private static WeightSettingView Up502()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 6,
HighWeight = basePlcHelper.Vessel_2_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.Vessel_2_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(6, _db2107Helper.Weight.Vessel_2);
//{
// Id = 6,
// HighWeight = basePlcHelper.Vessel_2_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.Vessel_2_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -149,21 +168,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_3_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_3_LowWeight, view.LowWeight);
DownWeightSettingView(516, view);
}
}
private static WeightSettingView Up516()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 7,
HighWeight = basePlcHelper.Vessel_3_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.Vessel_3_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(7, _db2107Helper.Weight.Vessel_3);
//{
// Id = 7,
// HighWeight = basePlcHelper.Vessel_3_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.Vessel_3_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -172,21 +189,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_4_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_4_LowWeight, view.LowWeight);
DownWeightSettingView(530, view);
}
}
private static WeightSettingView Up530()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 8,
HighWeight = basePlcHelper.Vessel_4_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.Vessel_4_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(8, _db2107Helper.Weight.Vessel_4);
//{
// Id = 8,
// HighWeight = basePlcHelper.Vessel_4_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.Vessel_4_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -195,21 +210,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_5_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Vessel_5_LowWeight, view.LowWeight);
DownWeightSettingView(544, view);
}
}
private static WeightSettingView Up544()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 9,
HighWeight = basePlcHelper.Vessel_5_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.Vessel_5_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(9, _db2107Helper.Weight.Vessel_5);
//{
// Id = 9,
// HighWeight = basePlcHelper.Vessel_5_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.Vessel_5_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -219,21 +232,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.WScale_1_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.WScale_1_LowWeight, view.LowWeight);
DownWeightSettingView(558, view);
}
}
private static WeightSettingView Up558()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 10,
HighWeight = basePlcHelper.WScale_1_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.WScale_1_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(10, _db2107Helper.Weight.WScale_1);
//{
// Id = 10,
// HighWeight = basePlcHelper.WScale_1_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.WScale_1_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -242,21 +253,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.WScale_2_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.WScale_2_LowWeight, view.LowWeight);
DownWeightSettingView(572, view);
}
}
private static WeightSettingView Up572()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 11,
HighWeight = basePlcHelper.WScale_2_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.WScale_2_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(11, _db2107Helper.Weight.WScale_2);
//{
// Id = 11,
// HighWeight = basePlcHelper.WScale_2_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.WScale_2_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -264,21 +273,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.WScale_3_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.WScale_3_LowWeight, view.LowWeight);
DownWeightSettingView(586, view);
}
}
private static WeightSettingView Up586()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 12,
HighWeight = basePlcHelper.WScale_3_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.WScale_3_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(12, _db2107Helper.Weight.WScale_3);
//{
// Id = 12,
// HighWeight = basePlcHelper.WScale_3_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.WScale_3_LowWeight.NowValue.ToFloat()
//};
return view;
}
@ -286,21 +293,19 @@ namespace Mesnac.Action.ChemicalWeighing.LjWeight
{
if (null != view)
{
var basePlcHelper = GetPlcHelper;
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.WScale_4_HighWeight, view.HighWeight);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.WScale_4_LowWeight, view.LowWeight);
DownWeightSettingView(600, view);
}
}
private static WeightSettingView Up600()
{
var basePlcHelper = GetPlcHelper;
WeightSettingView view = new WeightSettingView()
{
Id = 13,
HighWeight = basePlcHelper.WScale_4_HighWeight.NowValue.ToFloat(),
LowWeight = basePlcHelper.WScale_4_LowWeight.NowValue.ToFloat()
};
WeightSettingView view = GetWeightSettingView(13, _db2107Helper.Weight.WScale_4);
//{
// Id = 13,
// HighWeight = basePlcHelper.WScale_4_HighWeight.NowValue.ToFloat(),
// LowWeight = basePlcHelper.WScale_4_LowWeight.NowValue.ToFloat()
//};
return view;
}

@ -176,6 +176,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\PlugInPlatform\Mesnac.PlugIn.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel">
<HintPath>E:\mesnac\化工项目源码\源码\Actions\Microsoft.Office.Interop.Excel.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
@ -250,8 +253,6 @@
<Compile Include="Entity\SimplePstRole.cs" />
<Compile Include="Entity\SimplePstUser.cs" />
<Compile Include="FinishBatch\GHFinshBatchHelper.cs" />
<Compile Include="FinishBatch\SaveHelper\ReportGelDoserHelper.cs" />
<Compile Include="FinishBatch\SaveHelper\ReportSaveHelper.cs" />
<Compile Include="FinishBatch\SaveHelper\ReportWetMixerSaveHelper.cs" />
<Compile Include="FinishBatch\SCADAHelper\AlarmRefreshActionForExtend.cs" />
<Compile Include="FreeDb\DBEntity\LjFormulaDownEntity.cs" />
@ -268,6 +269,13 @@
<Compile Include="InterfaceDocking\HttpResponse.cs" />
<Compile Include="InterfaceDocking\MiniJson.cs" />
<Compile Include="LjAction\InitDbAction.cs" />
<Compile Include="LjClick\FormClientManager.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LjClick\FormClientManager.Designer.cs">
<DependentUpon>FormClientManager.cs</DependentUpon>
</Compile>
<Compile Include="LjClick\InitFormAction.cs" />
<Compile Include="LjDevice\DeviceHelp.cs" />
<Compile Include="LjDevice\DeviceModel.cs" />
<Compile Include="LjDevice\FrmDevice.cs">
@ -525,39 +533,9 @@
<Compile Include="MaterialManage\MaterialHelper.cs" />
<Compile Include="MaterialManage\ModifyMaterialAction.cs" />
<Compile Include="OliveEQSetting\InItDbAction.cs" />
<Compile Include="PlcAddressUtil.cs" />
<Compile Include="Pl\PlcConnect.cs" />
<Compile Include="Product\PptPlan\entity\Base_PlanInfo.cs" />
<Compile Include="Product\PptPlan\FrmBudget.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Product\PptPlan\FrmBudget.designer.cs">
<DependentUpon>FrmBudget.cs</DependentUpon>
</Compile>
<Compile Include="Product\PptPlan\FrmModifyPlanNum.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Product\PptPlan\FrmModifyPlanNum.Designer.cs">
<DependentUpon>FrmModifyPlanNum.cs</DependentUpon>
</Compile>
<Compile Include="Product\PptPlan\FrmPlan.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Product\PptPlan\FrmPlan.Designer.cs">
<DependentUpon>FrmPlan.cs</DependentUpon>
</Compile>
<Compile Include="Product\PptPlan\FrmProPlan.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Product\PptPlan\FrmProPlan.Designer.cs">
<DependentUpon>FrmProPlan.cs</DependentUpon>
</Compile>
<Compile Include="Product\PptPlan\GhPlanHelper.cs" />
<Compile Include="Product\PptPlan\ModifyPlanInfoAction.cs" />
<Compile Include="Product\PptPlan\PlanDownloadAction.cs" />
<Compile Include="Product\PptPlan\ProductionBudgetAction.cs" />
<Compile Include="Product\PptPlan\UpdatePlanStateClick.cs" />
<Compile Include="Product\ProductHelper.cs" />
<Compile Include="Product\PptPlan\ReloadPlanInfo.cs" />
<Compile Include="ProjectDebug\OpenProjectDebug.cs" />
<Compile Include="ProjectDebug\XC_DebugAction.cs" />
<Compile Include="ProjectDebug\FrmSpeedProjectDebug.cs">
@ -703,20 +681,7 @@
<Compile Include="PlcSchema\PlcSchemaHelper.cs" />
<Compile Include="PlcSchema\PlcWriteItem.cs" />
<Compile Include="PlcSchema\PlcWriter.cs" />
<Compile Include="Product\PptPlan\AbstractMoveAction.cs" />
<Compile Include="Product\PptPlan\AutoDownloadAction.cs" />
<Compile Include="Product\PptPlan\DeleteAction.cs" />
<Compile Include="Product\PptPlan\DownloadAction.cs" />
<Compile Include="Product\PptPlan\FrmProPlanViewAction.cs" />
<Compile Include="Entity\PptPlan\Pmt_Shiftime.cs" />
<Compile Include="Product\PptPlan\InitFormAction.cs" />
<Compile Include="Product\PptPlan\InsertAction.cs" />
<Compile Include="Product\PptPlan\ModifyPlanNumAction.cs" />
<Compile Include="Product\PptPlan\MoveDownAction.cs" />
<Compile Include="Product\PptPlan\MoveUpAction.cs" />
<Compile Include="Product\PptPlan\PlanHelper.cs" />
<Compile Include="Product\PptPlan\RefreshAction.cs" />
<Compile Include="Product\PptPlan\StopAction.cs" />
<Compile Include="Product\StorageBinViewDio\SBVSetFromViewAction.cs" />
<Compile Include="Product\StorageBinViewDio\StorageBinViewSetForm.cs">
<SubType>Form</SubType>
@ -809,18 +774,6 @@
<DependentUpon>BarcodeReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MaterialManage\FrmMaterial.resx" />
<EmbeddedResource Include="Product\PptPlan\FrmBudget.resx">
<DependentUpon>FrmBudget.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Product\PptPlan\FrmModifyPlanNum.resx">
<DependentUpon>FrmModifyPlanNum.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Product\PptPlan\FrmPlan.resx">
<DependentUpon>FrmPlan.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Product\PptPlan\FrmProPlan.resx">
<DependentUpon>FrmProPlan.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ProjectDebug\FrmProjectDebug.resx">
<DependentUpon>FrmProjectDebug.cs</DependentUpon>
</EmbeddedResource>

@ -28,8 +28,8 @@ namespace Mesnac.Action.ChemicalWeighing.Pl
{
SiemensPLCS siemensPLCS = SiemensPLCS.S1500;
SiemensS7Net s7 = new SiemensS7Net(siemensPLCS);
s7.IpAddress ="172.18.4.100";
s7.Port =102;
s7.IpAddress = PlcAddressUtil.IpAddress;
s7.Port = PlcAddressUtil.Port;
s7.ConnectServer();
return s7;
}

@ -0,0 +1,12 @@
namespace Mesnac.Action.ChemicalWeighing
{
public class PlcAddressUtil
{
// public static string IpAddress = "172.18.4.100";
// public static int Port = 102;
public static string IpAddress = "192.168.0.100";
public static int Port = 7788;
}
}

@ -36,40 +36,9 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
// return;
//}
#region 读取应答信号
if (!(BasePlcHelper.Instance.ChemicalWeighing_PLC_LoadingStatus.NowValue.ToInt() == 1 && BasePlcHelper.Instance.ChemicalWeighing_PC_LoadingStatus.NowValue.ToInt() == 0))
{
return;
}
#endregion
string msg = String.Empty;
string planDate = DateTime.Now.ToString();
bool result = PlanHelper.DownloadPlanInfo(planDate, Global.PublicVar.Instance.globalShiftID, out msg);
if (result)
{
msg = StringParser.Parse(ResourceService.GetString("Mesnac_Dialog_Msg_Success")); //执行成功!
#region 记录操作日志
//base.DBLog(msg);
#endregion
MessageBox.Show(msg, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
#region 记录操作日志
//base.DBLog(msg);
#endregion
MessageBox.Show(msg, Mesnac.Basic.LanguageHelper.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
}
}

@ -146,8 +146,7 @@ namespace Mesnac.Action.ChemicalWeighing.Sys
//判断 当接收到服务器端发送的有效信息时
if (!string.IsNullOrEmpty(socketClientTest.receiveStr))
{
//处理下传
bool downFlag = ChemicalWeighingPlc.PlcPlanHelper.ScanCodeDown(socketClientTest.receiveStr);
socketClientTest.receiveStr = null;
}

@ -54,121 +54,11 @@ namespace Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe
}
this._clientGridControl = recipeTreeGridControl;
this.DoWork();
}
#endregion
#region 方法定义
/// <summary>
/// 删除计划
/// </summary>
protected void DoWork()
{
this._runtime.BaseControl.MCEnabled = false;
try
{
TreeView clientGridView = this._clientGridControl.BaseControl as TreeView;
#region 1 变量定义
string selectRecipeName = null;
string selectRecipeId = null;
Base_RecipeInfo pmt_Recipe = null;
#endregion
#region 2 判断是否选择了要修改的配方
if (clientGridView.SelectedNode == null)
{
MessageBox.Show("请选择一条要删除的配方!", Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
this._runtime.IsReturn = true;
return;
}
#endregion
#region 3 判断该配方是否可进行删除如果配方正在RT_Plan表中查不允许删除
selectRecipeName = clientGridView.SelectedNode.Text as string;
selectRecipeId = clientGridView.SelectedNode.Name as string;
if (Product.PptPlan.PlanHelper.PlanExistsRecipeName(selectRecipeName))
{
MessageBox.Show("该配方正在计划列表中,不能进行删除!", Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
this._runtime.IsReturn = true;
return;
}
#endregion
//删除配方前询问
string msg1 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Technical_PmtRecipe_DeleteAction_msg1")); //确认删除当前配方(配方名:{0})吗?
msg1 = String.Format(msg1, selectRecipeName);
DialogResult result = MessageBox.Show(msg1, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
#region 4 获取配方实体
pmt_Recipe = RecipeHelper.GetRecipeById(selectRecipeId);
#endregion
#region 5 执行删除操作
if (pmt_Recipe != null)
{
#region 5.1 删除配方信息
RecipeHelper.DeleteRecipe(pmt_Recipe.recipeId);
#endregion
#region 5.2 删除配方对应物料信息
RecipeHelper.DelWeighByRecipeID(pmt_Recipe.recipeId);
//删除配方对应的工艺参数
RecipeHelper.DelCratParamByRecipeId(pmt_Recipe.recipeId);
#endregion
#region 5.3 触发事件
if (OnDeleteRecipe != null)
{
OnDeleteRecipe(this._runtime.BaseControl.MCRoot, System.EventArgs.Empty);
}
#endregion
MessageBox.Show("配方删除成功!");
}
#endregion
}
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<InsertAction>.Error("删除计划异常:" + ex.Message, ex);
#region 记录操作日志
base.DBLog(ex.Message);
#endregion
MessageBox.Show(ex.Message, Mesnac.Basic.LanguageHelper.WarnCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
finally
{
this._runtime.BaseControl.MCEnabled = true;
}
}
#endregion
}
}

@ -88,7 +88,7 @@ namespace Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe
/// </summary>
public void InitCombox()
{
pmt_Materials = Product.PptPlan.PlanHelper.GetAllPmt_material();
}
public void InitRecipeTypeInfo()
{

@ -78,18 +78,7 @@ namespace Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe
#endregion
#region 3 判断该配方是否可进行修改如果配方正在RT_Plan表中查不允许修改
selectRecipeName = clientGridView.SelectedNode.Name as string;
if (Product.PptPlan.PlanHelper.PlanExistsRecipeName(selectRecipeName))
{
MessageBox.Show("该配方正在计划列表中,不能进行修改!", Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
this._runtime.IsReturn = true;
return;
}
#endregion
#region 4 获取配方实体
pmt_Recipe = RecipeHelper.GetRecipeById(selectRecipeName);

@ -126,15 +126,8 @@ namespace Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe
{
DataRow dataRow = dataTable.NewRow();
Base_MaterialInfo pmt_Material = Product.PptPlan.PlanHelper.GetPmt_material(pmt_Weighs[i].Material_ID);
if (pmt_Material != null&& pmt_Material.materialName != null)
{
dataRow["Material_Name"] = pmt_Material.materialName;
}
else
{
continue;
}
dataRow["Set_Weight"] = pmt_Weighs[i].Set_Weight.ToString();
dataRow["Set_Error"] = pmt_Weighs[i].Set_Error.ToString();
dataTable.Rows.Add(dataRow);

@ -64,12 +64,7 @@ namespace Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe
//判断该配方是否可进行修改如果配方正在RT_Plan表中查不允许修改
selectRecipeId = recipeGridView.SelectedNode.Name as string;
if (Product.PptPlan.PlanHelper.PlanExistsRecipeName(selectRecipeId))
{
MessageBox.Show("该配方正在计划列表中,不能进行修改!", Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
this._runtime.IsReturn = true;
return;
}
//获取物料编号
string materialId = materialGridView.SelectedRows[0].Cells["material_Id"].Value as string;

@ -46,7 +46,7 @@ namespace Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe
public void InitCombox()
{
//获取工艺参数
pmt_Materials = Product.PptPlan.PlanHelper.GetAllBaseCratParamInfo();
}
public void InitUi()

@ -49,7 +49,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test
base.RunIni(runtime); //必须调用
//int adsa = BasePlcHelper.Instance.BU1BLT01_Alarm.NowValue.ToInt();
int value = BasePlcHelper.Instance.BU1BLT01_Set.NowValue.ToInt();
string sql = "insert into ActionCode values (13,'test','',1) select @@IDENTITY";
@ -61,7 +61,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test
// dbHelper.ClearParameter();
// dbHelper.CommandType = CommandType.Text;
// dbHelper.CommandText = sql;
var s1 = BasePlcHelper.Instance.dryerA_dos0_eqNo.LastValue.ToInt();
int[] ssss = new int [] { };
var ss2s = BasePlcHelper.Instance.PlcReadByRunName("BU1BLT01_Set", out ssss);

@ -58,6 +58,7 @@
<Compile Include="DBHelpers\DB90Helper.cs" />
<Compile Include="DBHelpers\DB91Helper.cs" />
<Compile Include="DbWrite\PlcWriteUtil.cs" />
<Compile Include="Entity\ClickEntity.cs" />
<Compile Include="Entity\DB1Entity\ForAoaLogInFC3005Entity.cs" />
<Compile Include="Entity\DB1Entity\ForAoaLogInFC3006Entity.cs" />
<Compile Include="Entity\DB2102Entity\FOR_VALVE_DoubleEntity.cs" />
@ -84,6 +85,7 @@
<Compile Include="Entity\DB2107Entity\ValveEntity.cs" />
<Compile Include="Entity\DB2107Entity\WeightEntity.cs" />
<Compile Include="Entity\DB2107Entity\WeightPraEntity.cs" />
<Compile Include="Entity\DB2108Helper.cs" />
<Compile Include="Entity\DB90Entity\ForValveDoubleEntity.cs" />
<Compile Include="Entity\DB90Entity\ForValveSingleEntity.cs" />
<Compile Include="Entity\DB91Entity\ForMotorEntity.cs" />

@ -0,0 +1,9 @@
namespace DataBlockHelper.Entity
{
public class ClickEntity
{
public bool Mixok { get; set; }
public float ClickValue { get; set; }
}
}

@ -0,0 +1,43 @@
using DataBlockHelper.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataBlockHelper.DBHelpers
{
public class DB2108Helper
{
//
public static List<ClickEntity> GetClickEntities()
{
List<ClickEntity> ls = new List<ClickEntity>();
for (int i = 0; i < 8; i++) {
var entity=new ClickEntity();
entity.ClickValue= PlcConnect.Instance.ReadFloat($"DB2108.{(i * 6)+2}.0").Content;
ls.Add(entity);
}
return ls;
}
public static void WriteClick(int no, ClickEntity click)
{
int start=(no * 6) + 2;
var sss= PlcConnect.Instance.Write($"DB2108.{start}.0", click.ClickValue);
}
}
}

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<ActionService>
<Design>
<Path path="榄菊糊化机点击参数">
<Action action="483129C0945C256509C24F147A132A36">
<Caption>窗体初始化</Caption>
<Remark>窗体初始化</Remark>
</Action>
</Path>
</Design>
<DesignToRuntime>
<Design action="483129C0945C256509C24F147A132A36">
<Runtime action="85A5171A3E4A4836F185FF08438B5403"/>
</Design>
</DesignToRuntime>
<Runtime>
<Import assembly = "Data/Action/ChemicalWeighing/Mesnac.Action.ChemicalWeighing.dll">
<Action action="85A5171A3E4A4836F185FF08438B5403" class="Mesnac.Action.ChemicalWeighing.LjClick.InitFormAction"/>
</Import>
</Runtime>
</ActionService>

@ -26,6 +26,7 @@
<Node Name="FormOliveEQSetting" Text="榄菊设备参数" ToolTipText="FormOliveEQSetting" Tag="FormOliveEQSetting" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="FormLJRecipeData" Text="榄菊配方管理" ToolTipText="FormLJRecipeData" Tag="FormLJRecipeData" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="ManualWaterControl" Text="手动控制" ToolTipText="ManualControl" Tag="ManualWaterControl" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="FormClient" Text="点击重量设置" ToolTipText="FormClient" Tag="FormClient" ImageIndex="3" SelectedImageIndex="3" />
</Node>
<Node Name="nodeDevice" Text="设备" ToolTipText="" Tag="nodeDevice" ImageIndex="2" SelectedImageIndex="2">
<Node Name="ParametersWithPc" Text="ParametersWithPc" ToolTipText="" Tag="ParametersWithPc" ImageIndex="5" SelectedImageIndex="5" />

@ -0,0 +1,126 @@
<Object type="Mesnac.Gui.Common.FrmRunTemplate, Mesnac.Gui.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="FormClient" children="Controls">
<Object type="System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="GroupBox1" children="Controls">
<Object type="Mesnac.Controls.Default.MCDataGridView, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCDataGridView1" children="Controls">
<Property name="DisplayAllColumn">True</Property>
<Property name="DgvColumn">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAAAAAAAJUAAAAHAwAAAAABAAAACAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAANCAs=</Binary>
</Property>
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAACAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="DoubleClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAACAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="SelectionChangedActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAACAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="MCKey">Client</Property>
<Property name="MCDataSourceID" />
<Property name="IsDbControl">True</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABVTeXN0ZW0uRGF0YS5EYXRhVGFibGUDAAAAGURhdGFUYWJsZS5SZW1vdGluZ1ZlcnNpb24JWG1sU2NoZW1hC1htbERpZmZHcmFtAwEBDlN5c3RlbS5WZXJzaW9uAgAAAAkDAAAABgQAAACFBDw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9InV0Zi0xNiI/Pg0KPHhzOnNjaGVtYSB4bWxucz0iIiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOm1zZGF0YT0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp4bWwtbXNkYXRhIj4NCiAgPHhzOmVsZW1lbnQgbmFtZT0iTUNEYXRhR3JpZFZpZXciPg0KICAgIDx4czpjb21wbGV4VHlwZT4NCiAgICA8L3hzOmNvbXBsZXhUeXBlPg0KICA8L3hzOmVsZW1lbnQ+DQogIDx4czplbGVtZW50IG5hbWU9InRtcERhdGFTZXQiIG1zZGF0YTpJc0RhdGFTZXQ9InRydWUiIG1zZGF0YTpNYWluRGF0YVRhYmxlPSJNQ0RhdGFHcmlkVmlldyIgbXNkYXRhOlVzZUN1cnJlbnRMb2NhbGU9InRydWUiPg0KICAgIDx4czpjb21wbGV4VHlwZT4NCiAgICAgIDx4czpjaG9pY2UgbWluT2NjdXJzPSIwIiBtYXhPY2N1cnM9InVuYm91bmRlZCIgLz4NCiAgICA8L3hzOmNvbXBsZXhUeXBlPg0KICA8L3hzOmVsZW1lbnQ+DQo8L3hzOnNjaGVtYT4GBQAAAIABPGRpZmZncjpkaWZmZ3JhbSB4bWxuczptc2RhdGE9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206eG1sLW1zZGF0YSIgeG1sbnM6ZGlmZmdyPSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOnhtbC1kaWZmZ3JhbS12MSIgLz4EAwAAAA5TeXN0ZW0uVmVyc2lvbgQAAAAGX01ham9yBl9NaW5vcgZfQnVpbGQJX1JldmlzaW9uAAAAAAgICAgCAAAAAAAAAP//////////Cw==</Binary>
</Property>
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="AutoGenerateColumns">False</Property>
<Property name="BackgroundColor">ControlLightLight</Property>
<Property name="ColumnHeadersHeight">30</Property>
<Property name="MultiSelect">False</Property>
<Property name="Location">3, 87</Property>
<Property name="Name">MCDataGridView1</Property>
<Property name="Size">355, 338</Property>
<Property name="TabIndex">9</Property>
</Object>
<Object type="System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Panel12" children="Controls">
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCButton1" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAQAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAANBAs=</Binary>
</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">True</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">刷新</Property>
<Property name="Font">宋体, 14.25pt, style=Bold</Property>
<Property name="Location">162, 17</Property>
<Property name="Name">MCButton1</Property>
<Property name="Size">144, 47</Property>
<Property name="TabIndex">3</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCButton5" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAARAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAANBAs=</Binary>
</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">True</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">修改</Property>
<Property name="Font">宋体, 14.25pt, style=Bold</Property>
<Property name="Location">37, 17</Property>
<Property name="Name">MCButton5</Property>
<Property name="Size">83, 42</Property>
<Property name="TabIndex">1</Property>
</Object>
<Property name="Location">3, 17</Property>
<Property name="Name">Panel12</Property>
<Property name="Size">355, 70</Property>
</Object>
<Property name="TabStop">False</Property>
<Property name="Text">点击参数设置</Property>
<Property name="Dock">Left</Property>
<Property name="Location">0, 0</Property>
<Property name="Name">GroupBox1</Property>
<Property name="Size">406, 544</Property>
<Property name="TabIndex">2</Property>
</Object>
<Property name="LoadActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAACAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDQ4MzEyOUMwOTQ1QzI1NjUwOUMyNEYxNDdBMTMyQTM2BgYAAAAP56qX5L2T5Yid5aeL5YyWBgcAAAAP56qX5L2T5Yid5aeL5YyWCw==</Binary>
</Property>
<Property name="ActivatedActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="ReloadActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="RefreshDataActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property>
<Property name="BHaveAction">False</Property>
<Property name="MCPurview">False</Property>
<Property name="AllowOriginalSizeShow">False</Property>
<Property name="BackColor">Control</Property>
<Property name="Size">564, 583</Property>
<Property name="StartPosition">WindowsDefaultLocation</Property>
<Property name="Text">点击重量设置</Property>
<Property name="WindowState">Normal</Property>
<Property name="BackgroundImage" />
<Property name="BackgroundImageLayout">Tile</Property>
<Property name="Font">宋体, 9pt</Property>
<Property name="ForeColor">ControlText</Property>
<Property name="Name">FormClient</Property>
</Object>

@ -222,6 +222,9 @@
<Content Include="Data\EventConfig\小料称量\手动控制.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Data\EventConfig\小料称量\榄菊糊化机点击参数.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Data\EventConfig\小料称量\设备细节报表.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

Loading…
Cancel
Save