Merge branch 'dep_yangw' into wangsr

# Conflicts:
#	Main/MCEdit/Data/MCProject/nodeDataSource.xml
#	Main/MCEdit/Data/MCProject/nodeDevice.xml
master
wangsr 1 year ago
commit cc10602c3f

@ -957,130 +957,7 @@ namespace Mesnac.Action.ChemicalWeighing
#endregion
#region 冠合上位机计划下传
public List<Entity.DataKeyValue> dataKeyValues = new List<Entity.DataKeyValue>();
//下位机准备信号(上位机下传时读取)
/// <summary>
/// 下位机在线
/// </summary>
public DataKeyValue GH_PC_ConfirmOnline = new DataKeyValue("Sign_Confirm_ConfirmOnline"); //下位机在线
/// <summary>
/// 下位机遥控
/// </summary>
public DataKeyValue GH_PC_ConfirmRemote = new DataKeyValue("Sign_Confirm_ConfirmRemote"); //下位机遥控
/// <summary>
/// 下位机准备好
/// </summary>
public DataKeyValue GH_PC_ConfirmReady = new DataKeyValue("Sign_Confirm_ConfirmReady"); //下位机准备好
/// <summary>
/// 下位机配方运行
/// </summary>
public DataKeyValue GH_PC_ConfirmRun = new DataKeyValue("Sign_Confirm_ConfirmRun"); //下位机配方运行
/// <summary>
/// 调试模式允许
/// </summary>
public DataKeyValue GH_PC_ConfirmForc = new DataKeyValue("Sign_Confirm_ConfirmForc"); // 调试模式允许
//配方编号、名称
public DataKeyValue ChemicalWeighing_PC_RecipeCode = new DataKeyValue("Recipe_Code");
public DataKeyValue ChemicalWeighing_PC_RecipeName = new DataKeyValue("recipe_name");
//设定车数、格数、层数
public DataKeyValue ChemicalWeighing_PC_SetCarNumber = new DataKeyValue("set_carnumber");
public DataKeyValue ChemicalWeighing_PC_SetGeNumber = new DataKeyValue("set_genumber");
public DataKeyValue ChemicalWeighing_PC_SetLineNumber = new DataKeyValue("set_linenumber");
//混料速度
public DataKeyValue ChemicalWeighing_PC_Hlsd1 = new DataKeyValue("hlsd1");
public DataKeyValue ChemicalWeighing_PC_Hlsd2 = new DataKeyValue("hlsd2");
public DataKeyValue ChemicalWeighing_PC_Hlsd3 = new DataKeyValue("hlsd3");
//进料时间、混料时间
public DataKeyValue ChemicalWeighing_PC_Jlsj = new DataKeyValue("jl_sj");
public DataKeyValue ChemicalWeighing_PC_Hlsj = new DataKeyValue("hl_sj");
//VCC、GFA、树脂进料、进料误差
public DataKeyValue ChemicalWeighing_PC_VCCJl = new DataKeyValue("vcc_jl");
public DataKeyValue ChemicalWeighing_PC_VCCJlWc = new DataKeyValue("vcc_jlwc");
public DataKeyValue ChemicalWeighing_PC_GFAJl = new DataKeyValue("gfa_jl");
public DataKeyValue ChemicalWeighing_PC_GFAJlWc = new DataKeyValue("gfa_jlwc");
public DataKeyValue ChemicalWeighing_PC_SZJl = new DataKeyValue("sz_jl");
public DataKeyValue ChemicalWeighing_PC_SZJlWc = new DataKeyValue("sz_jlwc");
public DataKeyValue ChemicalWeighing_PC_VCC_2th = new DataKeyValue("vcc2th_jl");
public DataKeyValue ChemicalWeighing_PC_GFA_2th = new DataKeyValue("GFA2th_jl");
//配方下传完成信号
public DataKeyValue ChemicalWeighing_PC_RpFinished = new DataKeyValue("PlanDownLoad");
//计划完成车数
public DataKeyValue ChemicalWeighing_PC_RecipeNum = new DataKeyValue("RecipeNum");
//计划编号PlanNo
public DataKeyValue ChemicalWeighing_PC_PlanNo = new DataKeyValue("PlanNo");
//计划终止
public DataKeyValue ChemicalWeighing_PC_RpCancel = new DataKeyValue("RpCancel");
public DataKeyValue TestWriteBool1 = new DataKeyValue("TestWriteBool1");
public DataKeyValue TestWriteBool2 = new DataKeyValue("TestWriteBool2");
#region 冠合存盘数据
/// <summary>
/// 存盘数据准备好
/// </summary>
public DataKeyValue GH_PC_ConfirmSDReady = new DataKeyValue("Sign_Confirm_ConfirmSDReady");
/// <summary>
/// 配方编号
/// </summary>
public DataKeyValue GH_PC_SaveCode = new DataKeyValue("SaveCode");
public DataKeyValue GH_PC_SaveFinishedNum = new DataKeyValue("SaveFinishedNum");
public DataKeyValue GH_PC_SaveRow = new DataKeyValue("SaveRow");
public DataKeyValue GH_PC_SaveCol = new DataKeyValue("SaveCol");
public DataKeyValue GH_PC_SaveVCCSet = new DataKeyValue("SaveVCCSet");
public DataKeyValue GH_PC_SaveVCCAct = new DataKeyValue("SaveVCCAct");
public DataKeyValue GH_PC_SaveGFASet = new DataKeyValue("SaveGFASet");
public DataKeyValue GH_PC_SaveGFAAct = new DataKeyValue("SaveGFAAct");
public DataKeyValue GH_PC_Save3thSet = new DataKeyValue("Save3thSet");
public DataKeyValue GH_PC_Save3thAct = new DataKeyValue("Save3thAct");
public DataKeyValue GH_PC_SaveLevel = new DataKeyValue("SaveLevel");
public DataKeyValue GH_PC_SaveFillTime = new DataKeyValue("SaveFillTime");
public DataKeyValue GH_PC_SaveSpeed1 = new DataKeyValue("SaveSpeed1");
public DataKeyValue GH_PC_SaveSpeed2 = new DataKeyValue("SaveSpeed2");
public DataKeyValue GH_PC_SaveTime = new DataKeyValue("SaveTime");
public DataKeyValue GH_PC_SavePlanId = new DataKeyValue("SavePlanId");
public DataKeyValue GH_PC_SaveVCC2thSet = new DataKeyValue("SaveVCC2thSet");
public DataKeyValue GH_PC_SaveVCC2thAct = new DataKeyValue("SaveVCC2thAct");
public DataKeyValue GH_PC_SaveGFA2thSet = new DataKeyValue("SaveGFA2thSet");
public DataKeyValue GH_PC_SaveGFA2thAct = new DataKeyValue("SaveGFA2thAct");
/// <summary>
/// 存盘数据保存完成
/// </summary>
public DataKeyValue ChemicalWeighing_PC_RpSaved = new DataKeyValue("RpSaved");
#endregion
#endregion
@ -3156,12 +3033,6 @@ namespace Mesnac.Action.ChemicalWeighing
public DataKeyValue Weter_M8Step9_setValue { get; set; }
public DataKeyValue Weter_M8Step9_tolerance { get; set; }
public DataKeyValue test { get; set; }
public DataKeyValue tst0 { get; set; }
public DataKeyValue tst1 { get; set; }
public DataKeyValue tst2 { get; set; }
#region 干混机报表参数 Add By wenjy 2023-08-08 15:40:00
#region 注释代码
/*/// <summary>
@ -3655,6 +3526,6 @@ namespace Mesnac.Action.ChemicalWeighing
#endregion
}
}

@ -39,170 +39,8 @@ namespace Mesnac.Action.ChemicalWeighing.ChemicalWeighingPlc
#endregion
#region 冠合计划自动下传
public static bool GHDownloadPlanData()
{
try
{
//查询PLC状态确认是否可以下发计划
if (!(BasePlcHelper.Instance.GH_PC_ConfirmOnline.NowValue.ToInt() == 1 && BasePlcHelper.Instance.GH_PC_ConfirmRemote.NowValue.ToInt() == 1 && BasePlcHelper.Instance.GH_PC_ConfirmReady.NowValue.ToInt() == 1 && BasePlcHelper.Instance.GH_PC_ConfirmRun.NowValue.ToInt() == 0))
{
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Debug("{生产计划-自动计划下传} 下位机信号未准备好...");
}
else
{
//扫描计划表中的最先执行的计划
List<Product.PptPlan.entity.Base_PlanInfo> base_PlanListInfos = Product.PptPlan.GhPlanHelper.GetPlanEntityListByNum(1);
if (base_PlanListInfos != null && base_PlanListInfos.Count > 0)
{
if(base_PlanListInfos[0].run_Type == 1) //0-自动运行1-手动运行,手动方式需要操作人点击“执行”按钮方可下达计划执行
{
return false;
}
else
{
//写入配方数据
//通过配方ID关联配方数据
if (WriteRecipeInfoToPLC(base_PlanListInfos[0])) //配方下发成功
{
//更新计划界面
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Debug("{生产计划-自动计划下传} 自动计划下传成功...");
}
else //配方下发失败
{
ICSharpCode.Core.LoggingService<PlcPlanHelper>.Error("{生产计划-自动计划下传} 自动计划下传失败...");
}
}
}
}
return true;
}
catch (Exception ex)
{
return false;
}
}
#endregion
public static bool WriteRecipeInfoToPLC(Product.PptPlan.entity.Base_PlanInfo base_PlanInfo)
{
try
{
Base_RecipeInfo info = Technical.PmtRecipe.RecipeHelper.GetRecipeById(base_PlanInfo.recipe_Id);
var plan_Id = Convert.ToInt32(base_PlanInfo.plan_Id);
object[] recipeidArray = Mesnac.Basic.DataProcessor.ToSiemensPLCDataArray(plan_Id);
//计划编号
bool resultPlanNoPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_PlanNo, recipeidArray);
//配方编号
bool resultFromPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeCode, new object[] {int.Parse(base_PlanInfo.recipe_Id) });
//配方名称,测试暂用配方编号代替
bool writeResult = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeName, new object[] { int.Parse(base_PlanInfo.recipe_Id) });
//设定车数
var writeResult1 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetCarNumber, new object[] { base_PlanInfo.car_Amount });
//格数
var writeResult2 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetGeNumber, new object[] { base_PlanInfo.grid_Amount });
//层数
var writeResult3 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetLineNumber, new object[] { base_PlanInfo.line_Amount });
//通过配方编号获取物料信息、参数信息
List<Base_RecipeMaterial> recipeMaterials = Technical.PmtRecipe.RecipeHelper.GetRecipeMaterialInfoByRecipeId(info.recipeId);
//罐1
//VCC加料
//Base_RecipeMaterial recipeMaterial = recipeMaterials.Where(x => x.materialName.Contains("VCC")).FirstOrDefault();
Base_RecipeMaterial recipeMaterial = recipeMaterials[0];
decimal vccJl = recipeMaterial.materialWeight;
var writeResult9 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJl, (float)vccJl);
////GFA加料
//Base_RecipeMaterial recipeMaterial2 = recipeMaterials.Where(x => x.materialName.Contains("GFA")).FirstOrDefault();
Base_RecipeMaterial recipeMaterial2 = recipeMaterials[1];
decimal gfajl = recipeMaterial2.materialWeight;
var writeResult10 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJl, (float)gfajl);
////树脂加料
//Base_RecipeMaterial recipeMaterial3 = recipeMaterials.Where(x => x.materialName.Contains("树脂")).FirstOrDefault();
Base_RecipeMaterial recipeMaterial3 = recipeMaterials[2];
decimal szjl = recipeMaterial3.materialWeight;
var writeResult11 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJl, (float)szjl);
//罐A2次加料
Base_RecipeMaterial recipeMaterial4 = recipeMaterials[3];
decimal vcc2th = recipeMaterial4.materialWeight;
var writeResult20 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCC_2th, (float)vcc2th);
//罐B2次加料
Base_RecipeMaterial recipeMaterial5 = recipeMaterials[4];
decimal gfa2th = recipeMaterial5.materialWeight;
var writeResult21 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFA_2th, (float)gfa2th);
//通过配方编号获取工艺参数信息
List<Base_RecipeCratParam> recipeCratParams = Technical.PmtRecipe.RecipeHelper.GerCratParamListByRecipeAndMaterial(info.recipeId, string.Empty);
//混料速度1
Base_RecipeCratParam base_RecipeCratParam1 = recipeCratParams.Where(x => x.paramName.Contains("混料速度1")).FirstOrDefault();
int hlsd1 = int.Parse(base_RecipeCratParam1.paramValue);
var writeResult4 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd1, new object[] { hlsd1 });
//混料速度2
Base_RecipeCratParam base_RecipeCratParam2 = recipeCratParams.Where(x => x.paramName.Contains("混料速度2")).FirstOrDefault();
int hlsd2 = int.Parse(base_RecipeCratParam2.paramValue);
var writeResult5 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd2, new object[] { hlsd2 });
//混料速度3
Base_RecipeCratParam base_RecipeCratParam3 = recipeCratParams.Where(x => x.paramName.Contains("混料速度3")).FirstOrDefault();
int hlsd3 = int.Parse(base_RecipeCratParam3.paramValue);
var writeResult6 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd3, new object[] { hlsd3 });
//进料时间
Base_RecipeCratParam base_RecipeCratParam4 = recipeCratParams.Where(x => x.paramName.Contains("进料时间")).FirstOrDefault();
int jlsj = int.Parse(base_RecipeCratParam4.paramValue);
var writeResult7 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Jlsj, new object[] { jlsj });
//混料时间
Base_RecipeCratParam base_RecipeCratParam5 = recipeCratParams.Where(x => x.paramName.Contains("混料时间")).FirstOrDefault();
int hlsj = int.Parse(base_RecipeCratParam5.paramValue);
var writeResult8 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsj, new object[] { hlsj });
//VCC加料误差
Base_RecipeCratParam base_RecipeCratParam6 = recipeCratParams.Where(x => x.paramName.Contains("罐A加料误差")).FirstOrDefault();
decimal vccjlwc = decimal.Parse(base_RecipeCratParam6.paramValue);
var writeResult12 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJlWc, (float)vccjlwc );
//GFA加料误差
Base_RecipeCratParam base_RecipeCratParam7 = recipeCratParams.Where(x => x.paramName.Contains("罐B加料误差")).FirstOrDefault();
decimal gfajlwc = decimal.Parse(base_RecipeCratParam7.paramValue);
var writeResult13 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJlWc, (float)gfajlwc);
//树脂加料误差
Base_RecipeCratParam base_RecipeCratParam8 = recipeCratParams.Where(x => x.paramName.Contains("树脂加料误差")).FirstOrDefault();
decimal szjlwc = decimal.Parse(base_RecipeCratParam8.paramValue);
var writeResult14 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJlWc, (float)szjlwc);
//配方下传完成
var writeResult15 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RpFinished, new object[] { true });
//计划下传成功后需要修改计划状态为执行中
base_PlanInfo.plan_State = 1;
base_PlanInfo.plan_beginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Product.PptPlan.PlanHelper.UpdateBasePlanStateInfo(base_PlanInfo);
if (GHAutoDownloadPlan != null)
{
GHAutoDownloadPlan(sender, System.EventArgs.Empty);
}
return true;
}
catch (Exception ex)
{
return false;
}
}
#region 下传计划列表至PLC

@ -15,100 +15,7 @@ namespace Mesnac.Action.ChemicalWeighing.DeviceParamManage
public static bool IsFirstRun = true; //是否首次运行
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用
if(IsFirstRun)
{
IsFirstRun = false;
ICSharpCode.Core.LoggingService<InitDeviceParamInfo>.Debug("设备参数管理-窗体初始化业务...");
DataKeyValue ConFeq = new DataKeyValue("ConFeq");
BasePlcHelper.Instance.dataKeyValues.Add(ConFeq);
DataKeyValue FanDelay = new DataKeyValue("FanDelay");
BasePlcHelper.Instance.dataKeyValues.Add(FanDelay);
DataKeyValue DisSpeed = new DataKeyValue("DisSpeed");
BasePlcHelper.Instance.dataKeyValues.Add(DisSpeed);
DataKeyValue DisTime = new DataKeyValue("DisTime");
BasePlcHelper.Instance.dataKeyValues.Add(DisTime);
DataKeyValue JZJDisDelay = new DataKeyValue("JZJDisDelay");
BasePlcHelper.Instance.dataKeyValues.Add(JZJDisDelay);
DataKeyValue VccHighFrq = new DataKeyValue("VccHighFrq");
BasePlcHelper.Instance.dataKeyValues.Add(VccHighFrq);
DataKeyValue VccMidFrq = new DataKeyValue("VccMidFrq");
BasePlcHelper.Instance.dataKeyValues.Add(VccMidFrq);
DataKeyValue VccLoeFrq = new DataKeyValue("VccLoeFrq");
BasePlcHelper.Instance.dataKeyValues.Add(VccLoeFrq);
DataKeyValue VccHighWei = new DataKeyValue("VccHighWei");
BasePlcHelper.Instance.dataKeyValues.Add(VccHighWei);
DataKeyValue VccLowWei = new DataKeyValue("VccLowWei");
BasePlcHelper.Instance.dataKeyValues.Add(VccLowWei);
DataKeyValue VccJogWei = new DataKeyValue("VccJogWei");
BasePlcHelper.Instance.dataKeyValues.Add(VccJogWei);
DataKeyValue VccExcWei = new DataKeyValue("VccExcWei");
BasePlcHelper.Instance.dataKeyValues.Add(VccExcWei);
DataKeyValue VccTimeout = new DataKeyValue("VccTimeout");
BasePlcHelper.Instance.dataKeyValues.Add(VccTimeout);
DataKeyValue VccHco = new DataKeyValue("VccHco");
BasePlcHelper.Instance.dataKeyValues.Add(VccHco);
DataKeyValue GFAHighFrq = new DataKeyValue("GFAHighFrq");
BasePlcHelper.Instance.dataKeyValues.Add(GFAHighFrq);
DataKeyValue GFAMidFrq = new DataKeyValue("GFAMidFrq");
BasePlcHelper.Instance.dataKeyValues.Add(GFAMidFrq);
DataKeyValue GFALoeFrq = new DataKeyValue("GFALoeFrq");
BasePlcHelper.Instance.dataKeyValues.Add(GFALoeFrq);
DataKeyValue GFAHighWei = new DataKeyValue("GFAHighWei");
BasePlcHelper.Instance.dataKeyValues.Add(GFAHighWei);
DataKeyValue GFALowWei = new DataKeyValue("GFALowWei");
BasePlcHelper.Instance.dataKeyValues.Add(GFALowWei);
DataKeyValue GFAJogWei = new DataKeyValue("GFAJogWei");
BasePlcHelper.Instance.dataKeyValues.Add(GFAJogWei);
DataKeyValue GFAExcWei = new DataKeyValue("GFAExcWei");
BasePlcHelper.Instance.dataKeyValues.Add(GFAExcWei);
DataKeyValue GFATimeout = new DataKeyValue("GFATimeout");
BasePlcHelper.Instance.dataKeyValues.Add(GFATimeout);
DataKeyValue GFAHco = new DataKeyValue("GFAHco");
BasePlcHelper.Instance.dataKeyValues.Add(GFAHco);
DataKeyValue ResinHighFrq = new DataKeyValue("ResinHighFrq");
BasePlcHelper.Instance.dataKeyValues.Add(ResinHighFrq);
DataKeyValue ResinMidFrq = new DataKeyValue("ResinMidFrq");
BasePlcHelper.Instance.dataKeyValues.Add(ResinMidFrq);
DataKeyValue ResinLoeFrq = new DataKeyValue("ResinLoeFrq");
BasePlcHelper.Instance.dataKeyValues.Add(ResinLoeFrq);
DataKeyValue ResinHighWei = new DataKeyValue("ResinHighWei");
BasePlcHelper.Instance.dataKeyValues.Add(ResinHighWei);
DataKeyValue ResinLowWei = new DataKeyValue("ResinLowWei");
BasePlcHelper.Instance.dataKeyValues.Add(ResinLowWei);
DataKeyValue ResinJogWei = new DataKeyValue("ResinJogWei");
BasePlcHelper.Instance.dataKeyValues.Add(ResinJogWei);
DataKeyValue ResinExcWei = new DataKeyValue("ResinExcWei");
BasePlcHelper.Instance.dataKeyValues.Add(ResinExcWei);
DataKeyValue ResinTimeout = new DataKeyValue("ResinTimeout");
BasePlcHelper.Instance.dataKeyValues.Add(ResinTimeout);
}
foreach (var item in BasePlcHelper.Instance.dataKeyValues)
{
if (item.Name == "VccHighWei" || item.Name == "VccLowWei" || item.Name == "VccJogWei" || item.Name == "VccExcWei" || item.Name == "GFAHighWei" || item.Name == "GFALowWei" || item.Name == "GFAJogWei" || item.Name == "GFAExcWei" || item.Name == "ResinHighWei" || item.Name == "ResinLowWei" || item.Name == "ResinJogWei" || item.Name == "ResinExcWei")
{
TextBox comboBox = base.GetControlById(item.Name) as TextBox;
comboBox.Text = item.NowValue.ToFloat().ToString();
}
else
{
TextBox comboBox = base.GetControlById(item.Name) as TextBox;
comboBox.Text = item.NowValue.ToInt().ToString();
}
}
}
}
}

@ -16,19 +16,7 @@ namespace Mesnac.Action.ChemicalWeighing.DeviceParamManage
{
base.RunIni(runtime); //必须要调用
this._runtime = runtime;
foreach (var item in BasePlcHelper.Instance.dataKeyValues)
{
if (item.Name == "VccHighWei" || item.Name == "VccLowWei" || item.Name == "VccJogWei"|| item.Name == "VccExcWei" || item.Name == "GFAHighWei" || item.Name == "GFALowWei" || item.Name == "GFAJogWei" || item.Name == "GFAExcWei" || item.Name == "ResinHighWei" || item.Name == "ResinLowWei" || item.Name == "ResinJogWei" || item.Name == "ResinExcWei")
{
TextBox comboBox = base.GetControlById(item.Name) as TextBox;
comboBox.Text = item.NowValue.ToFloat().ToString();
}
else
{
TextBox comboBox = base.GetControlById(item.Name) as TextBox;
comboBox.Text = item.NowValue.ToInt().ToString();
}
}
}
}

@ -15,21 +15,7 @@ namespace Mesnac.Action.ChemicalWeighing.DeviceParamManage
try
{
base.RunIni(runtime); //必须要调用
foreach (var item in BasePlcHelper.Instance.dataKeyValues)
{
if (item.Name == "VccHighWei" || item.Name == "VccLowWei" || item.Name == "VccJogWei" || item.Name == "VccExcWei" || item.Name == "GFAHighWei" || item.Name == "GFALowWei" || item.Name == "GFAJogWei" || item.Name == "GFAExcWei" || item.Name == "ResinHighWei" || item.Name == "ResinLowWei" || item.Name == "ResinJogWei" || item.Name == "ResinExcWei")
{
TextBox comboBox = base.GetControlById(item.Name) as TextBox;
decimal WriteValue = decimal.Parse(comboBox.Text);
var writeResult10 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(item, (float)WriteValue);
}
else
{
TextBox comboBox = base.GetControlById(item.Name) as TextBox;
int WriteValue = int.Parse(comboBox.Text);
var writeResult4 = BasePlcHelper.Instance.PlcWriteByDataKey(item, new object[] { WriteValue });
}
}
MessageBox.Show("修改成功!", Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)

@ -359,159 +359,7 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch
}
#endregion
#region 冠合存盘数据保存
/// <summary>
/// 冠合存盘数据保存
/// </summary>
public static void SaveGHData()
{
try
{
#region 存盘信号读取
if (BasePlcHelper.Instance.GH_PC_ConfirmSDReady.NowValue.ToInt() == 1)
{
Entity.RecordSaveDataInfo recordSaveDataInfo = new Entity.RecordSaveDataInfo();
bool PlanId = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SavePlanId, out int[] GH_PC_SavePlanId);
bool SaveCode = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveCode, out int[] GH_PC_SaveCode);
bool SaveFinishedNum = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveFinishedNum, out int[] GH_PC_SaveFinishedNum);
bool SaveRow = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveRow, out int[] GH_PC_SaveRow);
bool SaveCol = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveCol, out int[] GH_PC_SaveCol);
bool SaveVCCSet = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveVCCSet, out int[] GH_PC_SaveVCCSet);
bool SaveVCCAct = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveVCCAct, out int[] GH_PC_SaveVCCAct);
bool SaveGFASet = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveGFASet, out int[] GH_PC_SaveGFASet);
bool SaveGFAAct = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveGFAAct, out int[] GH_PC_SaveGFAAct);
bool Save3thSet = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_Save3thSet, out int[] GH_PC_Save3thSet);
bool Save3thAct = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_Save3thAct, out int[] GH_PC_Save3thAct);
bool SaveLevel = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveLevel, out int[] GH_PC_SaveLevel);
bool SaveFillTime = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveFillTime, out int[] GH_PC_SaveFillTime);
bool SaveSpeed1 = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveSpeed1, out int[] GH_PC_SaveSpeed1);
bool SaveSpeed2 = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveSpeed2, out int[] GH_PC_SaveSpeed2);
bool SaveTime = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveTime, out int[] GH_PC_SaveTime);
bool SaveVCC2thSet = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveVCC2thSet, out int[] GH_PC_SaveVCC2thSet);
bool SaveVCC2thAct = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveVCC2thAct, out int[] GH_PC_SaveVCC2thAct);
bool SaveGFA2thSet = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveGFA2thSet, out int[] GH_PC_SaveGFA2thSet);
bool SaveGFA2thAct = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveGFA2thAct, out int[] GH_PC_SaveGFA2thAct);
recordSaveDataInfo.PlanId = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SavePlanId).ToString();
recordSaveDataInfo.SaveCode = GH_PC_SaveCode[0].ToString();
recordSaveDataInfo.SaveFinishedNum = GH_PC_SaveFinishedNum[0];
recordSaveDataInfo.SaveRow = GH_PC_SaveRow[0];
recordSaveDataInfo.SaveCol = GH_PC_SaveCol[0];
recordSaveDataInfo.SaveVCCSet = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveVCCSet);
recordSaveDataInfo.SaveVCCAct = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveVCCAct);
recordSaveDataInfo.SaveGFASet = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveGFASet);
recordSaveDataInfo.SaveGFAAct = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveGFAAct);
recordSaveDataInfo.Save3thSet = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_Save3thSet);
recordSaveDataInfo.Save3thAct = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_Save3thAct);
recordSaveDataInfo.SaveLevel = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveLevel);
recordSaveDataInfo.SaveFillTime = GH_PC_SaveFillTime[0];
recordSaveDataInfo.SaveSpeed1 = GH_PC_SaveSpeed1[0];
recordSaveDataInfo.SaveSpeed2 = GH_PC_SaveSpeed2[0];
recordSaveDataInfo.SaveTime = GH_PC_SaveTime[0];
recordSaveDataInfo.RecordTime = DateTime.Now;
recordSaveDataInfo.SaveVCC2thSet = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveVCC2thSet);
recordSaveDataInfo.SaveVCC2thAct = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveVCC2thAct);
recordSaveDataInfo.SaveGFA2thSet = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveGFA2thSet);
recordSaveDataInfo.SaveGFA2thAct = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveGFA2thAct);
//将实体保存至数据库
SaveHelper.LotSaveHelper.InsertGHSaveData(recordSaveDataInfo);
#region 物料称量结果
try
{
List<Technical.PmtRecipe.entity.Base_MaterialInfo> MaterInfolist = MaterialManage.MaterialHelper.getMaterialList();
Entity.LR_weigh tempLRweigh1 = new Entity.LR_weigh();
tempLRweigh1.Plan_id = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SavePlanId).ToString();
tempLRweigh1.Equip_Code = "01";
tempLRweigh1.Weight_ID = 1;
tempLRweigh1.Serial_Num = GH_PC_SaveFinishedNum[0];
tempLRweigh1.Batch_Number = GH_PC_SaveCol[0].ToString();
//获取包含所有物料对象的集合
tempLRweigh1.Material_Code = MaterInfolist[0].materialId;
tempLRweigh1.Real_Weight = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveVCCAct);
tempLRweigh1.Real_Error = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveVCCSet) - tempLRweigh1.Real_Weight;
tempLRweigh1.Waste_Time = GH_PC_SaveTime[0];
tempLRweigh1.Weight_Time = DateTime.Now.ToString();
tempLRweigh1.Recipe_code = GH_PC_SaveCode[0].ToString();
SaveHelper.LotSaveHelper.InsertLRweighData(tempLRweigh1);
Entity.LR_weigh tempLRweigh2 = new Entity.LR_weigh();
tempLRweigh2.Plan_id = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SavePlanId).ToString();
tempLRweigh2.Equip_Code = "01";
tempLRweigh1.Weight_ID = 2;
tempLRweigh2.Serial_Num = GH_PC_SaveFinishedNum[0];
tempLRweigh2.Batch_Number = GH_PC_SaveCol[0].ToString();
//获取包含所有物料对象的集合
tempLRweigh2.Material_Code = MaterInfolist[1].materialId;
tempLRweigh2.Real_Weight = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveGFAAct);
tempLRweigh2.Real_Error = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveGFASet) - tempLRweigh1.Real_Weight;
tempLRweigh2.Waste_Time = GH_PC_SaveTime[0];
tempLRweigh2.Weight_Time = DateTime.Now.ToString();
tempLRweigh2.Recipe_code = GH_PC_SaveCode[0].ToString();
SaveHelper.LotSaveHelper.InsertLRweighData(tempLRweigh2);
Entity.LR_weigh tempLRweigh3 = new Entity.LR_weigh();
tempLRweigh3.Plan_id = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SavePlanId).ToString();
tempLRweigh3.Equip_Code = "01";
tempLRweigh1.Weight_ID = 3;
tempLRweigh3.Serial_Num = GH_PC_SaveFinishedNum[0];
tempLRweigh3.Batch_Number = GH_PC_SaveCol[0].ToString();
//获取包含所有物料对象的集合
tempLRweigh3.Material_Code = MaterInfolist[2].materialId;
tempLRweigh3.Real_Weight = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_Save3thAct);
tempLRweigh3.Real_Error = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_Save3thSet) - tempLRweigh1.Real_Weight;
tempLRweigh3.Waste_Time = GH_PC_SaveTime[0];
tempLRweigh3.Weight_Time = DateTime.Now.ToString();
tempLRweigh3.Recipe_code = GH_PC_SaveCode[0].ToString();
SaveHelper.LotSaveHelper.InsertLRweighData(tempLRweigh3);
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<GHFinshBatchHelper>.Error(String.Format("物料称量存盘异常:{1}", ex.Message), ex);
}
#endregion
//存盘数据保存完成,写入反馈信号
ICSharpCode.Core.LoggingService<GHFinshBatchHelper>.Debug("数据存盘_PLC物料数据写入数据库处理完毕!");
bool result = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RpSaved, new object[] { 1 });
if (!result)
{
ICSharpCode.Core.LoggingService<GHFinshBatchHelper>.Debug("数据存盘后写入反馈信号失败!");
}
//将车次与计划表中的数量比对,更新计划数量中的完成数量
if (recordSaveDataInfo.PlanId != "")
{
Product.PptPlan.entity.Base_PlanInfo planInfo = Product.PptPlan.PlanHelper.getPlanInfoByPlanId(recordSaveDataInfo.PlanId);
//不相等则更新计划中的完成数量
planInfo.real_Amount = recordSaveDataInfo.SaveFinishedNum * recordSaveDataInfo.SaveCol;
planInfo.update_Time = DateTime.Now;
if (planInfo.plan_Amount != recordSaveDataInfo.SaveFinishedNum * recordSaveDataInfo.SaveCol)
{
Product.PptPlan.PlanHelper.UpdatePlanInfo(planInfo);
}
else //本次计划完成
{
planInfo.plan_endTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
planInfo.plan_State = 2;
Product.PptPlan.PlanHelper.UpdatePlanInfo(planInfo);
}
if (GHOnUpdatePlanStateFromPlc != null)
{
GHOnUpdatePlanStateFromPlc(sender, System.EventArgs.Empty);
}
}
}
#endregion
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<GHFinshBatchHelper>.Error(String.Format("生产数据存盘异常:{1}", ex.Message), ex);
}
}
#endregion
}
}

@ -52,165 +52,8 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch
#endregion
#region 启动服务
public void Start()
{
try
{
if (this.runState)
{
return;
}
lock (String.Empty)
{
Mesnac.Equips.Factory.Instance.SetMinHZReadDataEvent(ReadData);
this.runState = true;
}
}
catch(Exception ex)
{
ICSharpCode.Core.LoggingService<FinishBatchService>.Error("自动更新计划状态服务异常:" + ex.Message, ex);
}
}
#endregion
#region 停止服务
public void Stop()
{
try
{
if (!this.runState)
{
return;
}
lock (String.Empty)
{
ICSharpCode.Core.LoggingService<FinishBatchService>.Debug("开始停止生产数据存盘服务...");
Mesnac.Equips.Factory.Instance.ClearMinHZReadDataEvent(ReadData);
ICSharpCode.Core.LoggingService<FinishBatchService>.Debug("停止生产数据存盘服务完毕!");
this.runState = false;
}
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<FinishBatchService>.Error("停止生产数据存盘业务服务异常:" + ex.Message, ex);
}
}
#endregion
#region 事件处理
private void ReadData(object sender, Mesnac.Equips.ReadEventArgs e)
{
try
{
lock(String.Empty)
{
#region 0、实时刷新自动保存报警
SaveHelper.AlarmSaveHelper.Instance.Save();
#endregion
#region 1、自动下传计划
ChemicalWeighingPlc.PlcPlanHelper.GHDownloadPlanData();
//List<string> msgList = new List<string>();
//ChemicalWeighingPlc.PlcPlanHelper.AutoDownloadPlanData(msgList);
#endregion
#region 2、将等待计划数写入PLC
//ChemicalWeighingPlc.PlcPlanHelper.WaitPlanNumToPLC();
#endregion
#region 3、更新计划状态
//ChemicalWeighingPlc.PlcPlanHelper.UpdatePlanStateFromPlc();
#endregion
#region 4、HMI配方列表请求处理
//ChemicalWeighingPlc.PlcRecipeHelper.DownloadRecipeNameListToPLC();
#endregion
#region 5、HMI计划添加请求处理
//ChemicalWeighingPlc.PlcPlanHelper.AutoAddPlan();
#endregion
#region 6、HMI计划修改请求处理
//ChemicalWeighingPlc.PlcPlanHelper.ChangePlan();
#endregion
#region 7、自动存盘处理
//FinishBatchHelper.SaveGHData();
//ReportDryMixerSaveHelper.Instance.Save();
ReportWetMixerSaveHelper.Instance.SaveWetMixerReport();
//ReportGelDoserSaveHelper.Instance.SaveGelDoserReport();
#endregion
#region 8、更新物料名称
//ChemicalWeighingPlc.PlcPlanHelper.UpdateMaterialNameToPlc();
#endregion
#region 9、修改PC心跳信号
//ChemicalWeighingPlc.PlcPlanHelper.HeartBeatChange();
#endregion
#region 10、自动换班
ChemicalWeighingPlc.PlcPlanHelper.shiftIDAutoChange();
#endregion
}
}
catch(Exception ex)
{
ICSharpCode.Core.LoggingService<FinishBatchService>.Error(ex.Message, ex);
}
finally
{
#region 6、设置PCok信号为空闲
//#region 保存存盘
//BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ReportSave_MixWeight_PC_PCok, new object[] { 1 }, false);
//BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ReportSave_Mix_PC_PCok, new object[] { 1 }, false);
//BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ReportSave_MillWeight_PC_PCok, new object[] { 1 }, false);
//BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ReportSave_Mill_PC_PCok, new object[] { 1 }, false);
//#endregion
//#region 配方交互
//BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.Mix_RecipeDL_PC_PCok, new object[] { 1 }, false);
//#endregion
#endregion
}
}
#endregion
}
}

@ -8,87 +8,6 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch
{
public class GHFinshBatchHelper
{
#region 冠合项目存盘数据
/// <summary>
/// 冠合项目数据存盘
/// </summary>
public static void SaveData()
{
try
{
#region 存盘信号读取
if (BasePlcHelper.Instance.GH_PC_ConfirmSDReady.NowValue.ToInt() == 1)
{
Entity.RecordSaveDataInfo recordSaveDataInfo = new Entity.RecordSaveDataInfo();
bool PlanId = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SavePlanId, out int[] GH_PC_SavePlanId);
bool SaveCode = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveCode, out int[] GH_PC_SaveCode);
bool SaveFinishedNum = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveFinishedNum, out int[] GH_PC_SaveFinishedNum);
bool SaveRow = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveRow, out int[] GH_PC_SaveRow);
bool SaveCol = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveCol, out int[] GH_PC_SaveCol);
bool SaveVCCSet = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveVCCSet, out int[] GH_PC_SaveVCCSet);
bool SaveVCCAct = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveVCCAct, out int[] GH_PC_SaveVCCAct);
bool SaveGFASet = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveGFASet, out int[] GH_PC_SaveGFASet);
bool SaveGFAAct = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveGFAAct, out int[] GH_PC_SaveGFAAct);
bool Save3thSet = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_Save3thSet, out int[] GH_PC_Save3thSet);
bool Save3thAct = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_Save3thAct, out int[] GH_PC_Save3thAct);
bool SaveLevel = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveLevel, out int[] GH_PC_SaveLevel);
bool SaveFillTime = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveFillTime, out int[] GH_PC_SaveFillTime);
bool SaveSpeed1 = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveSpeed1, out int[] GH_PC_SaveSpeed1);
bool SaveSpeed2 = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveSpeed2, out int[] GH_PC_SaveSpeed2);
bool SaveTime = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_SaveTime, out int[] GH_PC_SaveTime);
recordSaveDataInfo.PlanId = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SavePlanId).ToString();
recordSaveDataInfo.SaveCode = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SavePlanId).ToString();
recordSaveDataInfo.SaveFinishedNum = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SaveFinishedNum);
recordSaveDataInfo.SaveRow = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SaveRow);
recordSaveDataInfo.SaveCol = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SaveCol);
recordSaveDataInfo.SaveVCCSet = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveVCCSet);
recordSaveDataInfo.SaveVCCAct = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveVCCAct);
recordSaveDataInfo.SaveGFASet = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveGFASet);
recordSaveDataInfo.Save3thSet = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_Save3thSet);
recordSaveDataInfo.Save3thAct = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_Save3thAct);
recordSaveDataInfo.SaveLevel = Mesnac.Basic.DataProcessor.ToSiemensFloat(GH_PC_SaveLevel);
recordSaveDataInfo.SaveFillTime = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SaveFillTime);
recordSaveDataInfo.SaveSpeed1 = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SaveSpeed1);
recordSaveDataInfo.SaveSpeed2 = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SaveSpeed2);
recordSaveDataInfo.SaveTime = Mesnac.Basic.DataProcessor.ToSiemensInt32(GH_PC_SaveTime);
recordSaveDataInfo.RecordTime = DateTime.Now;
//将实体保存至数据库
SaveHelper.LotSaveHelper.InsertGHSaveData(recordSaveDataInfo);
//存盘数据保存完成,写入反馈信号
ICSharpCode.Core.LoggingService<GHFinshBatchHelper>.Debug("数据存盘_PLC物料数据写入数据库处理完毕!");
bool result = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RpSaved, new object[] { 1 });
if (!result)
{
ICSharpCode.Core.LoggingService<GHFinshBatchHelper>.Debug("数据存盘后写入反馈信号失败!");
}
//将车次与计划表中的数量比对,更新计划数量中的完成数量
if (recordSaveDataInfo.PlanId != "")
{
Product.PptPlan.entity.Base_PlanInfo planInfo = Product.PptPlan.PlanHelper.getPlanInfoByPlanId(recordSaveDataInfo.PlanId);
//不相等则更新计划中的完成数量
planInfo.real_Amount = recordSaveDataInfo.SaveFinishedNum;
planInfo.update_Time = DateTime.Now;
if (planInfo.real_Amount != recordSaveDataInfo.SaveFinishedNum)
{
Product.PptPlan.PlanHelper.UpdateBasePlanStateInfo(planInfo);
}
else //本次计划完成
{
planInfo.plan_endTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
planInfo.plan_State = 2;
Product.PptPlan.PlanHelper.UpdateBasePlanStateInfo(planInfo);
}
}
}
#endregion
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<GHFinshBatchHelper>.Error(String.Format("数据存盘异常:{1}", ex.Message), ex);
}
}
#endregion
}
}

@ -58,7 +58,7 @@ namespace Mesnac.Action.ChemicalWeighing
}
}
private PublicVar()
private PublicVar()
{
}

@ -122,10 +122,23 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
LjMixManagerPlc.DownG2Recipe(rG1,rG2, recipeSteps);
break;
case 3 :
LjMixManagerPlc.DownG2Recipe(rG1,rG2, recipeSteps);
LjMixManagerPlc.DownG3Recipe(rG1,rG2, recipeSteps);
break;
case 4 :
LjMixManagerPlc.DownG2Recipe(rG1,rG2, recipeSteps);
LjMixManagerPlc.DownG4Recipe(rG1,rG2, recipeSteps);
break;
case 5 :
LjMixManagerPlc.DownG5Recipe(rG1,rG2, recipeSteps);
break;
case 6 :
LjMixManagerPlc.DownG6Recipe(rG1,rG2, recipeSteps);
break;
case 7 :
LjMixManagerPlc.DownG7Recipe(rG1,rG2, recipeSteps);
break;
case 8 :
LjMixManagerPlc.DownG8Recipe(rG1,rG2, recipeSteps);
break;
}

@ -4,12 +4,7 @@ using Mesnac.Action.ChemicalWeighing.LjPlanning;
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.LjMixManager
@ -70,6 +65,43 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
_view.MixCName = DrpMixC.Text;
LjMixManagerDb.UpdateMixC(_view);
List<MixStep> recipeSteps = new List<MixStep>();
recipeSteps=LjMixManagerDb.GetMixStep( _view.MixBId);
// 第一台干混机
switch (_id)
{
case 1 :
LjMixManagerPlc.DownM1Recipe(recipeSteps);
break;
case 2 :
LjMixManagerPlc.DownM2Recipe(recipeSteps);
break;
case 3 :
LjMixManagerPlc.DownM3Recipe(recipeSteps);
break;
case 4 :
LjMixManagerPlc.DownM4Recipe(recipeSteps);
break;
case 5 :
LjMixManagerPlc.DownM5Recipe(recipeSteps);
break;
case 6 :
LjMixManagerPlc.DownM6Recipe(recipeSteps);
break;
case 7 :
LjMixManagerPlc.DownM7Recipe(recipeSteps);
break;
case 8 :
LjMixManagerPlc.DownM8Recipe(recipeSteps);
break;
}
this.DialogResult = DialogResult.OK;
}
}

@ -280,7 +280,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
return list;
}
public static List<Step> GetStep(string metageId)
{
string sql =
@ -301,6 +301,38 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
step.MixTemp = Convert.ToInt32(tableRow["SecondTime"]);
//速度
step.MixSpeed = Convert.ToInt32(tableRow["SecondTime"]);
list.Add(step);
}
return list;
}
public static List<MixStep> GetMixStep(string metageId)
{
string sql =
$" select Id, MixId, ActionId, ActionName, SecondTime, Temperature, Speed, Weight, Difference, Remark "
+ $" from lj_mix_detail where MixId='{metageId}'";
var table = GetTable(sql);
List<MixStep> list = new List<MixStep>();
foreach (DataRow tableRow in table.Rows)
{
MixStep step = new MixStep();
//代码
step.MixCode = Convert.ToInt32(tableRow["ActionId"]);
//时间
step.MixTime = Convert.ToInt32(tableRow["SecondTime"]);
//温度
step.MixTemp = Convert.ToInt32(tableRow["SecondTime"]);
//速度
step.MixSpeed = Convert.ToInt32(tableRow["SecondTime"]);
step.SetValue = Convert.ToSingle(tableRow["Weight"]);
step.Tolerance = Convert.ToSingle(tableRow["Difference"]);
list.Add(step);
}

@ -2,8 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Interop.Excel;
namespace Mesnac.Action.ChemicalWeighing.LjMixManager
{
@ -2262,7 +2261,7 @@ if (i == 9)
}
public static void DownM1Recipe(List<Step> recipeSteps)
public static void DownM1Recipe(List<MixStep> recipeSteps)
{
var basePlcHelper = BasePlcHelper.Instance;
for (int i = 0; i < recipeSteps.Count; i++)
@ -2278,6 +2277,9 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step0_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step0_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step0_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step0_tolerance, view.Tolerance);
}
if (i == 1)
{
@ -2289,6 +2291,10 @@ if (i == 1)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step1_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step1_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step1_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step1_tolerance, view.Tolerance);
}
if (i == 2)
{
@ -2300,6 +2306,10 @@ if (i == 2)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step2_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step2_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step2_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step2_tolerance, view.Tolerance);
}
if (i == 3)
{
@ -2311,6 +2321,10 @@ if (i == 3)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step3_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step3_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step3_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step3_tolerance, view.Tolerance);
}
if (i == 4)
{
@ -2322,6 +2336,10 @@ if (i == 4)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step4_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step4_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step4_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step4_tolerance, view.Tolerance);
}
if (i == 5)
{
@ -2333,6 +2351,10 @@ if (i == 5)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step5_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step5_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step5_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step5_tolerance, view.Tolerance);
}
if (i == 6)
{
@ -2344,6 +2366,11 @@ if (i == 6)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step6_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step6_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step6_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step6_tolerance, view.Tolerance);
}
if (i == 7)
{
@ -2355,6 +2382,10 @@ if (i == 7)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step7_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step7_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step7_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step7_tolerance, view.Tolerance);
}
if (i == 8)
{
@ -2366,6 +2397,9 @@ if (i == 8)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step8_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step8_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step8_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step8_tolerance, view.Tolerance);
}
if (i == 9)
{
@ -2377,6 +2411,9 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step9_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step9_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step9_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M1Step9_tolerance, view.Tolerance);
}
@ -2385,7 +2422,7 @@ if (i == 9)
public static void DownM2Recipe(List<Step> recipeSteps)
public static void DownM2Recipe(List<MixStep> recipeSteps)
{
var basePlcHelper = BasePlcHelper.Instance;
for (int i = 0; i < recipeSteps.Count; i++)
@ -2401,6 +2438,10 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step0_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step0_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step0_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step0_tolerance, view.Tolerance);
}
if (i == 1)
{
@ -2412,6 +2453,10 @@ if (i == 1)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step1_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step1_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step1_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step1_tolerance, view.Tolerance);
}
if (i == 2)
{
@ -2423,6 +2468,10 @@ if (i == 2)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step2_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step2_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step2_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step2_tolerance, view.Tolerance);
}
if (i == 3)
{
@ -2434,6 +2483,10 @@ if (i == 3)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step3_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step3_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step3_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step3_tolerance, view.Tolerance);
}
if (i == 4)
{
@ -2445,6 +2498,10 @@ if (i == 4)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step4_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step4_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step4_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step4_tolerance, view.Tolerance);
}
if (i == 5)
{
@ -2456,6 +2513,10 @@ if (i == 5)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step5_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step5_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step5_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step5_tolerance, view.Tolerance);
}
if (i == 6)
{
@ -2467,6 +2528,10 @@ if (i == 6)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step6_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step6_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step6_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step6_tolerance, view.Tolerance);
}
if (i == 7)
{
@ -2478,6 +2543,8 @@ if (i == 7)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step7_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step7_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step7_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step7_tolerance, view.Tolerance);
}
if (i == 8)
{
@ -2489,6 +2556,10 @@ if (i == 8)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step8_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step8_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step8_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step8_tolerance, view.Tolerance);
}
if (i == 9)
{
@ -2500,10 +2571,13 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step9_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step9_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step9_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M2Step9_tolerance, view.Tolerance);
}
}
}
public static void DownM3Recipe(List<Step> recipeSteps)
public static void DownM3Recipe(List<MixStep> recipeSteps)
{
var basePlcHelper = BasePlcHelper.Instance;
for (int i = 0; i < recipeSteps.Count; i++)
@ -2519,6 +2593,8 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step0_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step0_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step0_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step0_tolerance, view.Tolerance);
}
if (i == 1)
{
@ -2530,6 +2606,8 @@ if (i == 1)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step1_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step1_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step1_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step1_tolerance, view.Tolerance);
}
if (i == 2)
{
@ -2541,6 +2619,9 @@ if (i == 2)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step2_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step2_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step2_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step2_tolerance, view.Tolerance);
}
if (i == 3)
{
@ -2552,6 +2633,9 @@ if (i == 3)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step3_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step3_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step3_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step3_tolerance, view.Tolerance);
}
if (i == 4)
{
@ -2563,6 +2647,8 @@ if (i == 4)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step4_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step4_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step4_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step4_tolerance, view.Tolerance);
}
if (i == 5)
{
@ -2574,6 +2660,8 @@ if (i == 5)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step5_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step5_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step5_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step5_tolerance, view.Tolerance);
}
if (i == 6)
{
@ -2585,6 +2673,9 @@ if (i == 6)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step6_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step6_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step6_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step6_tolerance, view.Tolerance);
}
if (i == 7)
{
@ -2596,6 +2687,9 @@ if (i == 7)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step7_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step7_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step7_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step7_tolerance, view.Tolerance);
}
if (i == 8)
{
@ -2607,6 +2701,8 @@ if (i == 8)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step8_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step8_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step8_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step8_tolerance, view.Tolerance);
}
if (i == 9)
{
@ -2618,12 +2714,15 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step9_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step9_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step9_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M3Step9_tolerance, view.Tolerance);
}
}
}
public static void DownM4Recipe(List<Step> recipeSteps)
public static void DownM4Recipe(List<MixStep> recipeSteps)
{
var basePlcHelper = BasePlcHelper.Instance;
for (int i = 0; i < recipeSteps.Count; i++)
@ -2639,6 +2738,9 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step0_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step0_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step0_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step0_tolerance, view.Tolerance);
}
if (i == 1)
{
@ -2650,6 +2752,9 @@ if (i == 1)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step1_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step1_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step1_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step1_tolerance, view.Tolerance);
}
if (i == 2)
{
@ -2661,6 +2766,9 @@ if (i == 2)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step2_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step2_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step2_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step2_tolerance, view.Tolerance);
}
if (i == 3)
{
@ -2672,6 +2780,8 @@ if (i == 3)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step3_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step3_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step3_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step3_tolerance, view.Tolerance);
}
if (i == 4)
{
@ -2683,6 +2793,9 @@ if (i == 4)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step4_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step4_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step4_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step4_tolerance, view.Tolerance);
}
if (i == 5)
{
@ -2694,6 +2807,8 @@ if (i == 5)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step5_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step5_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step5_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step5_tolerance, view.Tolerance);
}
if (i == 6)
{
@ -2705,6 +2820,9 @@ if (i == 6)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step6_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step6_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step6_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step6_tolerance, view.Tolerance);
}
if (i == 7)
{
@ -2716,6 +2834,9 @@ if (i == 7)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step7_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step7_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step7_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step7_tolerance, view.Tolerance);
}
if (i == 8)
{
@ -2727,6 +2848,9 @@ if (i == 8)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step8_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step8_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step8_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step8_tolerance, view.Tolerance);
}
if (i == 9)
{
@ -2738,11 +2862,14 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step9_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step9_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step9_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M4Step9_tolerance, view.Tolerance);
}
}
}
public static void DownM5Recipe(List<Step> recipeSteps)
public static void DownM5Recipe(List<MixStep> recipeSteps)
{
var basePlcHelper = BasePlcHelper.Instance;
for (int i = 0; i < recipeSteps.Count; i++)
@ -2758,6 +2885,9 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step0_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step0_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step0_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step0_tolerance, view.Tolerance);
}
if (i == 1)
{
@ -2769,6 +2899,8 @@ if (i == 1)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step1_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step1_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step1_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step1_tolerance, view.Tolerance);
}
if (i == 2)
{
@ -2780,6 +2912,8 @@ if (i == 2)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step2_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step2_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step2_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step2_tolerance, view.Tolerance);
}
if (i == 3)
{
@ -2791,6 +2925,9 @@ if (i == 3)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step3_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step3_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step3_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step3_tolerance, view.Tolerance);
}
if (i == 4)
{
@ -2802,6 +2939,8 @@ if (i == 4)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step4_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step4_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step4_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step4_tolerance, view.Tolerance);
}
if (i == 5)
{
@ -2813,6 +2952,8 @@ if (i == 5)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step5_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step5_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step5_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step5_tolerance, view.Tolerance);
}
if (i == 6)
{
@ -2824,6 +2965,10 @@ if (i == 6)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step6_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step6_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step6_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step6_tolerance, view.Tolerance);
}
if (i == 7)
{
@ -2835,6 +2980,8 @@ if (i == 7)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step7_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step7_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step7_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step7_tolerance, view.Tolerance);
}
if (i == 8)
{
@ -2846,6 +2993,8 @@ if (i == 8)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step8_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step8_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step8_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step8_tolerance, view.Tolerance);
}
if (i == 9)
{
@ -2857,11 +3006,13 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step9_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step9_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step9_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M5Step9_tolerance, view.Tolerance);
}
}
}
public static void DownM6Recipe(List<Step> recipeSteps)
public static void DownM6Recipe(List<MixStep> recipeSteps)
{
var basePlcHelper = BasePlcHelper.Instance;
for (int i = 0; i < recipeSteps.Count; i++)
@ -2878,6 +3029,9 @@ if (i == 0)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step0_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step0_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step0_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step0_tolerance, view.Tolerance);
}
if (i == 1)
{
@ -2889,6 +3043,8 @@ if (i == 1)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step1_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step1_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step1_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step1_tolerance, view.Tolerance);
}
if (i == 2)
{
@ -2900,6 +3056,9 @@ if (i == 2)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step2_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step2_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step2_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step2_tolerance, view.Tolerance);
}
if (i == 3)
{
@ -2911,6 +3070,9 @@ if (i == 3)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step3_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step3_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step3_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step3_tolerance, view.Tolerance);
}
if (i == 4)
{
@ -2922,6 +3084,8 @@ if (i == 4)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step4_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step4_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step4_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step4_tolerance, view.Tolerance);
}
if (i == 5)
{
@ -2933,6 +3097,8 @@ if (i == 5)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step5_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step5_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step5_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step5_tolerance, view.Tolerance);
}
if (i == 6)
{
@ -2944,6 +3110,8 @@ if (i == 6)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step6_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step6_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step6_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step6_tolerance, view.Tolerance);
}
if (i == 7)
{
@ -2955,6 +3123,9 @@ if (i == 7)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step7_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step7_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step7_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step7_tolerance, view.Tolerance);
}
if (i == 8)
{
@ -2966,6 +3137,8 @@ if (i == 8)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step8_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step8_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step8_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step8_tolerance, view.Tolerance);
}
if (i == 9)
{
@ -2977,12 +3150,15 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step9_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step9_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step9_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M6Step9_tolerance, view.Tolerance);
}
}
}
public static void DownM7Recipe(List<Step> recipeSteps)
public static void DownM7Recipe(List<MixStep> recipeSteps)
{
var basePlcHelper = BasePlcHelper.Instance;
for (int i = 0; i < recipeSteps.Count; i++)
@ -2998,6 +3174,8 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step0_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step0_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step0_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step0_tolerance, view.Tolerance);
}
if (i == 1)
{
@ -3009,6 +3187,9 @@ if (i == 1)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step1_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step1_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step1_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step1_tolerance, view.Tolerance);
}
if (i == 2)
{
@ -3020,6 +3201,9 @@ if (i == 2)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step2_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step2_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step2_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step2_tolerance, view.Tolerance);
}
if (i == 3)
{
@ -3031,6 +3215,8 @@ if (i == 3)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step3_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step3_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step3_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step3_tolerance, view.Tolerance);
}
if (i == 4)
{
@ -3042,6 +3228,8 @@ if (i == 4)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step4_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step4_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step4_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step4_tolerance, view.Tolerance);
}
if (i == 5)
{
@ -3053,6 +3241,8 @@ if (i == 5)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step5_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step5_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step5_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step5_tolerance, view.Tolerance);
}
if (i == 6)
{
@ -3064,6 +3254,8 @@ if (i == 6)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step6_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step6_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step6_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step6_tolerance, view.Tolerance);
}
if (i == 7)
{
@ -3075,6 +3267,8 @@ if (i == 7)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step7_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step7_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step7_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step7_tolerance, view.Tolerance);
}
if (i == 8)
{
@ -3086,6 +3280,8 @@ if (i == 8)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step8_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step8_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step8_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step8_tolerance, view.Tolerance);
}
if (i == 9)
{
@ -3097,10 +3293,13 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step9_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step9_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step9_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M7Step9_tolerance, view.Tolerance);
}
}
}
public static void DownM8Recipe(List<Step> recipeSteps)
public static void DownM8Recipe(List<MixStep> recipeSteps)
{
var basePlcHelper = BasePlcHelper.Instance;
for (int i = 0; i < recipeSteps.Count; i++)
@ -3116,6 +3315,9 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step0_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step0_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step0_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step0_tolerance, view.Tolerance);
}
if (i == 1)
{
@ -3127,6 +3329,8 @@ if (i == 1)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step1_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step1_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step1_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step1_tolerance, view.Tolerance);
}
if (i == 2)
{
@ -3138,6 +3342,9 @@ if (i == 2)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step2_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step2_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step2_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step2_tolerance, view.Tolerance);
}
if (i == 3)
{
@ -3149,6 +3356,8 @@ if (i == 3)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step3_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step3_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step3_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step3_tolerance, view.Tolerance);
}
if (i == 4)
{
@ -3160,6 +3369,8 @@ if (i == 4)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step4_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step4_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step4_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step4_tolerance, view.Tolerance);
}
if (i == 5)
{
@ -3171,6 +3382,8 @@ if (i == 5)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step5_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step5_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step5_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step5_tolerance, view.Tolerance);
}
if (i == 6)
{
@ -3182,6 +3395,8 @@ if (i == 6)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step6_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step6_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step6_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step6_tolerance, view.Tolerance);
}
if (i == 7)
{
@ -3193,6 +3408,8 @@ if (i == 7)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step7_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step7_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step7_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step7_tolerance, view.Tolerance);
}
if (i == 8)
{
@ -3204,6 +3421,8 @@ if (i == 8)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step8_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step8_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step8_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step8_tolerance, view.Tolerance);
}
if (i == 9)
{
@ -3215,6 +3434,8 @@ if (i == 9)
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step9_mixTemp, view.MixTemp);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step9_mixSpeed, view.MixSpeed);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step9_setValue, view.SetValue);
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.Weter_M8Step9_tolerance, view.Tolerance);
}
}
}

@ -14,4 +14,18 @@
public float MixTemp { get; set; }
public float MixSpeed { get; set; }
}
public class MixStep : Step
{
/// <summary>
/// 设定重量
/// </summary>
public float SetValue { get; set; }
/// <summary>
/// 设定公差
/// </summary>
public float Tolerance { get; set; }
}
}

@ -0,0 +1,7 @@
namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{
public class DownloadAction
{
}
}

@ -0,0 +1,45 @@
using System;
using System.Linq;
using System.Windows.Forms;
using Mesnac.Action.Base;
namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{
public class PauseAction:ChemicalWeighingAction, IAction
{
private DbMCControl _materialGridControl = null; //物料列表控件
private RuntimeParameter _runtime;
public static event EventHandler OnPause;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
this._runtime = runtime;
DbMCControl materialGridControl =
this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "lj_planning")
.FirstOrDefault(); //获取物料数据控件
this._materialGridControl = materialGridControl;
DataGridView clientGridView = this._materialGridControl.BaseControl as DataGridView;
//验证是否选中某物料
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);
}
}
}

@ -0,0 +1,45 @@
using System;
using System.Linq;
using System.Windows.Forms;
using Mesnac.Action.Base;
namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{
public class RestartAction:ChemicalWeighingAction, IAction
{
private DbMCControl _materialGridControl = null; //物料列表控件
private RuntimeParameter _runtime;
public static event EventHandler OnRestart;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
this._runtime = runtime;
DbMCControl materialGridControl =
this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "lj_planning")
.FirstOrDefault(); //获取物料数据控件
this._materialGridControl = materialGridControl;
DataGridView clientGridView = this._materialGridControl.BaseControl as DataGridView;
//验证是否选中某物料
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);
}
}
}

@ -828,15 +828,6 @@
<Folder Include="Product\PptShift\" />
</ItemGroup>
<ItemGroup>
<COMReference Include="Microsoft.Office.Core">
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>8</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="Microsoft.Office.Interop.Excel">
<Guid>{00020813-0000-0000-C000-000000000046}</Guid>
<VersionMajor>1</VersionMajor>

@ -60,39 +60,7 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
return;
}
}
if (BasePlcHelper.Instance.GH_PC_ConfirmOnline.NowValue.ToInt() == 1 && BasePlcHelper.Instance.GH_PC_ConfirmRemote.NowValue.ToInt() == 1 && BasePlcHelper.Instance.GH_PC_ConfirmReady.NowValue.ToInt() == 1 && BasePlcHelper.Instance.GH_PC_ConfirmRun.NowValue.ToInt() == 0)
//if(true)
{
//获取当前选中计划
Base_PlanInfo planInfo = PlanHelper.getPlanInfoByPlanId(this.selectedPlanId);
//调试时注释
if (WriteRecipeInfoToPLC(planInfo))
//if(true)
{
ICSharpCode.Core.LoggingService<StopAction>.Debug("{生产计划-计划下传} 计划下传成功...");
planInfo.plan_State = 1;
planInfo.plan_beginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Product.PptPlan.PlanHelper.UpdateBasePlanStateInfo(planInfo);
}
else
{
MessageBox.Show("计划下传失败!!!");
}
#region 触发事件
if (DownloadPlan != null)
{
DownloadPlan(runtime.BaseControl.MCRoot, System.EventArgs.Empty);
}
#endregion
}
else
{
MessageBox.Show("下位机信号未准备好!!!");
return;
}
//判断下位机准备好信号,正式调试时需取消注释
/*if (!(BasePlcHelper.Instance.GH_PC_ConfirmRemote.NowValue.ToInt() == 1 && BasePlcHelper.Instance.GH_PC_ConfirmReady.NowValue.ToInt() == 1))
{
@ -126,201 +94,17 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
/// 读取PLC执行的配方编号
/// </summary>
/// <returns></returns>
public string readRecipeId()
{
bool readResult = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeCode, out int[] res);
string readRecipeId = intArrayToStr(res);
return readRecipeId;
}
/// <summary>
/// 读取plc计划执行状态
/// </summary>
public void readPlanState()
{
while (true)
{
var writeResult1 = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.ChemicalWeighing_PC_SetCarNumber, out int[] setAmount);
//读取完成数量,测试采用设定数量
//bool finishAmount = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeNum, out int[] res);
bool finishAmount = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.ChemicalWeighing_PC_SetCarNumber, out int[] res);
bool planNoResult = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.ChemicalWeighing_PC_PlanNo, out int[] planNo);
bool confirmRunResult = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.GH_PC_ConfirmRun, out int[] confirmRun);
string planNoStr = intArrayToStr(planNo) == "" ? "030aabf32dbe4f4e8f9eb8bb65b59b69" : intArrayToStr(planNo);
if (planNoStr != "")
{
//根据计划编号修改计划状态、完成数量
Base_PlanInfo planInfo = PlanHelper.getPlanInfoByPlanId(planNoStr);
planInfo.real_Amount = Convert.ToInt32(intArrayToStr(res));
if (planInfo.plan_Amount == planInfo.real_Amount)
{
planInfo.plan_State = 2;
PlanHelper.UpdateBasePlanInfo(planInfo);
//判断完成信号,正式环境需要判断完成状态
/*if (confirmRun[1] == 1)
{
ICSharpCode.Core.LoggingService<StopAction>.Info("{生产计划-计划下传} 计划" + planNoStr + "执行完成...");
//判断下一计划的运行方式
Base_PlanInfo nextPlanInfo = PlanHelper.getNextPlanInfoByOrder(planInfo.plan_order);
if (nextPlanInfo.run_Type == 0)
{
writeToPlc(nextPlanInfo.recipe_Id, nextPlanInfo.plan_Id);
}
else
{
return;
}
}*/
ICSharpCode.Core.LoggingService<StopAction>.Info("{生产计划-计划下传} 计划" + planNoStr + "执行完成...");
//判断下一计划的运行方式
Base_PlanInfo nextPlanInfo = PlanHelper.getNextPlanInfoByPlanOrder(planInfo.plan_order);
if (nextPlanInfo.run_Type == 0)
{
writeToPlc(nextPlanInfo.recipe_Id, nextPlanInfo.plan_Id);
}
else
{
return;
}
}
else
{
planInfo.plan_State = 1;
PlanHelper.UpdateBasePlanInfo(planInfo);
}
}
Thread.Sleep(1000 * 3);
}
}
public static bool WriteRecipeInfoToPLC(Product.PptPlan.entity.Base_PlanInfo base_PlanInfo)
{
try
{
Base_RecipeInfo info = Technical.PmtRecipe.RecipeHelper.GetRecipeById(base_PlanInfo.recipe_Id);
//配方编号
var plan_Id = Convert.ToInt32(base_PlanInfo.plan_Id);
object[] recipeidArray = Mesnac.Basic.DataProcessor.ToSiemensPLCDataArray(plan_Id);
//计划编号
bool resultPlanNoPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_PlanNo, recipeidArray);
//配方编号
bool resultFromPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeCode, new object[] { int.Parse(base_PlanInfo.recipe_Id) });
//配方名称,测试暂用配方编号代替
bool writeResult = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeName, new object[] { int.Parse(base_PlanInfo.recipe_Id) });
//设定车数
var writeResult1 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetCarNumber, new object[] { base_PlanInfo.car_Amount });
//格数
var writeResult2 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetGeNumber, new object[] { base_PlanInfo.grid_Amount });
//层数
var writeResult3 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetLineNumber, new object[] { base_PlanInfo.line_Amount });
//通过配方编号获取物料信息、参数信息
List<Base_RecipeMaterial> recipeMaterials = Technical.PmtRecipe.RecipeHelper.GetRecipeMaterialInfoByRecipeId(info.recipeId);
//罐1
//VCC加料
//Base_RecipeMaterial recipeMaterial = recipeMaterials.Where(x => x.materialName.Contains("VCC")).FirstOrDefault();
Base_RecipeMaterial recipeMaterial = recipeMaterials[0];
decimal vccJl = recipeMaterial.materialWeight;
var writeResult9 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJl, (float)vccJl);
//罐2
////GFA加料
//Base_RecipeMaterial recipeMaterial2 = recipeMaterials.Where(x => x.materialName.Contains("GFA")).FirstOrDefault();
Base_RecipeMaterial recipeMaterial2 = recipeMaterials[1];
decimal gfajl = recipeMaterial2.materialWeight;
var writeResult10 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJl, (float)gfajl);
//罐3
////树脂加料
//Base_RecipeMaterial recipeMaterial3 = recipeMaterials.Where(x => x.materialName.Contains("树脂")).FirstOrDefault();
Base_RecipeMaterial recipeMaterial3 = recipeMaterials[2];
decimal szjl = recipeMaterial3.materialWeight;
var writeResult11 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJl, (float)szjl);
//罐A2次加料
Base_RecipeMaterial recipeMaterial4 = recipeMaterials[3];
decimal vcc2th = recipeMaterial4.materialWeight;
var writeResult20 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCC_2th, (float)vcc2th);
//罐B2次加料
Base_RecipeMaterial recipeMaterial5 = recipeMaterials[4];
decimal gfa2th = recipeMaterial5.materialWeight;
var writeResult21 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFA_2th, (float)gfa2th);
//通过配方编号获取工艺参数信息
List<Base_RecipeCratParam> recipeCratParams = Technical.PmtRecipe.RecipeHelper.GerCratParamListByRecipeAndMaterial(info.recipeId, string.Empty);
//混料速度1
Base_RecipeCratParam base_RecipeCratParam1 = recipeCratParams.Where(x => x.paramName.Contains("混料速度1")).FirstOrDefault();
int hlsd1 = int.Parse(base_RecipeCratParam1.paramValue);
var writeResult4 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd1, new object[] { hlsd1 });
//混料速度2
Base_RecipeCratParam base_RecipeCratParam2 = recipeCratParams.Where(x => x.paramName.Contains("混料速度2")).FirstOrDefault();
int hlsd2 = int.Parse(base_RecipeCratParam2.paramValue);
var writeResult5 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd2, new object[] { hlsd2 });
//混料速度3
Base_RecipeCratParam base_RecipeCratParam3 = recipeCratParams.Where(x => x.paramName.Contains("混料速度3")).FirstOrDefault();
int hlsd3 = int.Parse(base_RecipeCratParam3.paramValue);
var writeResult6 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd3, new object[] { hlsd3 });
//进料时间
Base_RecipeCratParam base_RecipeCratParam4 = recipeCratParams.Where(x => x.paramName.Contains("进料时间")).FirstOrDefault();
int jlsj = int.Parse(base_RecipeCratParam4.paramValue);
var writeResult7 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Jlsj, new object[] { jlsj });
//混料时间
Base_RecipeCratParam base_RecipeCratParam5 = recipeCratParams.Where(x => x.paramName.Contains("混料时间")).FirstOrDefault();
int hlsj = int.Parse(base_RecipeCratParam5.paramValue);
var writeResult8 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsj, new object[] { hlsj });
//VCC加料误差
Base_RecipeCratParam base_RecipeCratParam6 = recipeCratParams.Where(x => x.paramName.Contains("罐A加料误差")).FirstOrDefault();
decimal vccjlwc = decimal.Parse(base_RecipeCratParam6.paramValue);
var writeResult12 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJlWc, (float)vccjlwc);
//GFA加料误差
Base_RecipeCratParam base_RecipeCratParam7 = recipeCratParams.Where(x => x.paramName.Contains("罐B加料误差")).FirstOrDefault();
decimal gfajlwc = decimal.Parse(base_RecipeCratParam7.paramValue);
var writeResult13 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJlWc, (float)gfajlwc);
//树脂加料误差
Base_RecipeCratParam base_RecipeCratParam8 = recipeCratParams.Where(x => x.paramName.Contains("树脂加料误差")).FirstOrDefault();
decimal szjlwc = decimal.Parse(base_RecipeCratParam8.paramValue);
var writeResult14 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJlWc, (float)szjlwc);
//配方下传完成
bool SaveTime = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.ChemicalWeighing_PC_RpFinished, out int[] GH_PC_SaveTime);
object[] flag = new object[1] {1};
var writeResult15 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RpFinished, flag);
return true;
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<PlanDownloadAction>.Error("{生产计划-计划下传} 计划下传失败..."+ ex);
return false;
}
}
/// <summary>
/// 将配方数据写入PLC地址
@ -335,86 +119,7 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
//通过计划编号获取选中计划
Base_PlanInfo planInfo = PlanHelper.getPlanInfoByPlanId(planId);
#region 下传配方参数
//配方编号info.recipeId
string recipeName = info.recipeName;
var plan_Id = Convert.ToInt32(planId);
object[] recipeidArray = Mesnac.Basic.DataProcessor.ToSiemensPLCDataArray(plan_Id);
//计划编号
bool resultPlanNoPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_PlanNo, new object[] { recipeidArray });
//配方编号
bool resultFromPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeCode, recipeidArray);
//配方名称
bool writeResult = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeName, recipeName);
//设定车数
var writeResult1 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetCarNumber, new object[] { planInfo.car_Amount });
//格数
var writeResult2 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetGeNumber, new object[] { planInfo.grid_Amount });
//层数
var writeResult3 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetLineNumber, new object[] { planInfo.line_Amount });
//通过配方编号获取物料信息、参数信息
List<Base_RecipeMaterial> recipeMaterials = RecipeHelper.GetRecipeMaterialInfoByRecipeId(info.recipeId);
//混料速度1
var writeResult4 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd1, new object[] { 18 });
//混料速度2
var writeResult5 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd2, new object[] { 20 });
//混料速度3
var writeResult6 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd3, new object[] { 22 });
//进料时间
var writeResult13 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Jlsj, new object[] { 12 });
//混料时间
var writeResult14 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsj, new object[] { 17 });
//VCC加料
Base_RecipeMaterial recipeMaterial = recipeMaterials.Where(x => x.materialId.Contains("202205280001")).FirstOrDefault();
decimal vccJl = recipeMaterial.materialWeight;
var writeResult7 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJl, (float)vccJl);
////VCC加料误差
List<Base_RecipeCratParam> recipeCratParams1 = RecipeHelper.GerCratParamListByRecipeAndMaterial(info.recipeId, "202205280001");
Base_RecipeCratParam recipeCratParam = recipeCratParams1.Where(x => x.materialId.Equals(recipeMaterial.materialId) && x.paramName.Contains("VCC加料误差")).FirstOrDefault();
decimal vccjlwc = Convert.ToDecimal(recipeCratParam.paramValue);
var writeResult8 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJlWc, (float)vccjlwc);
////GFA加料
Base_RecipeMaterial recipeMaterial2 = recipeMaterials.Where(x => x.materialId.Contains("202205280002")).FirstOrDefault();
decimal gfajl = recipeMaterial2.materialWeight;
var writeResult9 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJl, (float)gfajl);
////GFA加料误差
List<Base_RecipeCratParam> recipeCratParams2 = RecipeHelper.GerCratParamListByRecipeAndMaterial(info.recipeId, "202205280002");
Base_RecipeCratParam recipeCratParam2 = recipeCratParams2.Where(x => x.materialId.Equals(recipeMaterial2.materialId) && x.paramName.Contains("GFA加料误差")).FirstOrDefault();
decimal gfajlwc = Convert.ToDecimal(recipeCratParam2.paramValue);
var writeResult10 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJlWc, (float)gfajlwc);
////树脂加料
Base_RecipeMaterial recipeMaterial3 = recipeMaterials.Where(x => x.materialId.Contains("202205280003")).FirstOrDefault();
decimal szjl = recipeMaterial3.materialWeight;
var writeResult11 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJl, (float)szjl);
////树脂加料误差
List<Base_RecipeCratParam> recipeCratParams3 = RecipeHelper.GerCratParamListByRecipeAndMaterial(info.recipeId, "202205280003");
Base_RecipeCratParam recipeCratParam3 = recipeCratParams3.Where(x => x.materialId.Equals(recipeMaterial3.materialId) && x.paramName.Contains("树脂加料误差")).FirstOrDefault();
decimal szjlwc = Convert.ToDecimal(recipeCratParam3.paramValue);
var writeResult12 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJlWc, (float)szjlwc);
#endregion
}

@ -98,89 +98,7 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
object[] recipeidArray = Mesnac.Basic.DataProcessor.ToSiemensPLCDataArray(plan_Id);
bool resultPlanNoPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_PlanNo, new object[] { recipeidArray });
//配方编号
bool resultFromPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeCode, new object[] { int.Parse(base_PlanInfo.recipe_Id) });
//配方名称,测试暂用配方编号代替
bool writeResult = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeName, new object[] { int.Parse(base_PlanInfo.recipe_Id) });
//设定车数
var writeResult1 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetCarNumber, new object[] { base_PlanInfo.car_Amount });
//格数
var writeResult2 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetGeNumber, new object[] { base_PlanInfo.grid_Amount });
//层数
var writeResult3 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetLineNumber, new object[] { base_PlanInfo.line_Amount });
//通过配方编号获取物料信息、参数信息
List<Base_RecipeMaterial> recipeMaterials = Technical.PmtRecipe.RecipeHelper.GetRecipeMaterialInfoByRecipeId(info.recipeId);
//VCC加料
Base_RecipeMaterial recipeMaterial = recipeMaterials.Where(x => x.materialName.Contains("VCC")).FirstOrDefault();
decimal vccJl = recipeMaterial.materialWeight;
var writeResult9 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJl, (float)vccJl);
////GFA加料
Base_RecipeMaterial recipeMaterial2 = recipeMaterials.Where(x => x.materialName.Contains("GFA")).FirstOrDefault();
decimal gfajl = recipeMaterial2.materialWeight;
var writeResult10 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJl, (float)gfajl);
////树脂加料
Base_RecipeMaterial recipeMaterial3 = recipeMaterials.Where(x => x.materialName.Contains("树脂")).FirstOrDefault();
decimal szjl = recipeMaterial3.materialWeight;
var writeResult11 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJl, (float)szjl);
//通过配方编号获取工艺参数信息
List<Base_RecipeCratParam> recipeCratParams = Technical.PmtRecipe.RecipeHelper.GerCratParamListByRecipeAndMaterial(info.recipeId, string.Empty);
//混料速度1
Base_RecipeCratParam base_RecipeCratParam1 = recipeCratParams.Where(x => x.paramName.Contains("混料速度1")).FirstOrDefault();
int hlsd1 = int.Parse(base_RecipeCratParam1.paramValue);
var writeResult4 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd1, new object[] { hlsd1 });
//混料速度2
Base_RecipeCratParam base_RecipeCratParam2 = recipeCratParams.Where(x => x.paramName.Contains("混料速度2")).FirstOrDefault();
int hlsd2 = int.Parse(base_RecipeCratParam2.paramValue);
var writeResult5 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd2, new object[] { hlsd2 });
//混料速度3
Base_RecipeCratParam base_RecipeCratParam3 = recipeCratParams.Where(x => x.paramName.Contains("混料速度3")).FirstOrDefault();
int hlsd3 = int.Parse(base_RecipeCratParam3.paramValue);
var writeResult6 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd3, new object[] { hlsd3 });
//进料时间
Base_RecipeCratParam base_RecipeCratParam4 = recipeCratParams.Where(x => x.paramName.Contains("进料时间")).FirstOrDefault();
int jlsj = int.Parse(base_RecipeCratParam4.paramValue);
var writeResult7 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Jlsj, new object[] { jlsj });
//混料时间
Base_RecipeCratParam base_RecipeCratParam5 = recipeCratParams.Where(x => x.paramName.Contains("混料时间")).FirstOrDefault();
int hlsj = int.Parse(base_RecipeCratParam5.paramValue);
var writeResult8 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsj, new object[] { hlsj });
//VCC加料误差
Base_RecipeCratParam base_RecipeCratParam6 = recipeCratParams.Where(x => x.paramName.Contains("VCC加料误差")).FirstOrDefault();
decimal vccjlwc = decimal.Parse(base_RecipeCratParam6.paramValue);
var writeResult12 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJlWc, (float)vccjlwc);
//GFA加料误差
Base_RecipeCratParam base_RecipeCratParam7 = recipeCratParams.Where(x => x.paramName.Contains("GFA加料误差")).FirstOrDefault();
decimal gfajlwc = decimal.Parse(base_RecipeCratParam7.paramValue);
var writeResult13 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJlWc, (float)gfajlwc);
//树脂加料误差
Base_RecipeCratParam base_RecipeCratParam8 = recipeCratParams.Where(x => x.paramName.Contains("树脂加料误差")).FirstOrDefault();
decimal szjlwc = decimal.Parse(base_RecipeCratParam8.paramValue);
var writeResult14 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJlWc, (float)szjlwc);
//配方下传完成
object[] flag = Mesnac.Basic.DataProcessor.ToPLCDataArray("1");
var writeResult15 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RpFinished, flag);
//计划下传成功后需要修改计划状态为执行中
return true;
}
catch (Exception ex)

@ -89,83 +89,6 @@ namespace Mesnac.Action.ChemicalWeighing.Product
{
recipeidArray[i] = base_PlanInfo.plan_Id.Substring(i, 1);
}
bool resultPlanNoPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_PlanNo, new object[] { recipeidArray });
//配方编号
bool resultFromPlc = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeCode, new object[] { int.Parse(base_PlanInfo.recipe_Id) });
//配方名称,测试暂用配方编号代替
bool writeResult = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeName, new object[] { int.Parse(base_PlanInfo.recipe_Id) });
//设定车数
var writeResult1 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetCarNumber, new object[] { base_PlanInfo.car_Amount });
//格数
var writeResult2 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetGeNumber, new object[] { base_PlanInfo.grid_Amount });
//层数
var writeResult3 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SetLineNumber, new object[] { base_PlanInfo.line_Amount });
//通过配方编号获取物料信息、参数信息
List<Base_RecipeMaterial> recipeMaterials = Technical.PmtRecipe.RecipeHelper.GetRecipeMaterialInfoByRecipeId(info.recipeId);
//VCC加料
Base_RecipeMaterial recipeMaterial = recipeMaterials.Where(x => x.materialName.Contains("VCC")).FirstOrDefault();
decimal vccJl = recipeMaterial.materialWeight;
var writeResult9 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJl, (float)vccJl);
////GFA加料
Base_RecipeMaterial recipeMaterial2 = recipeMaterials.Where(x => x.materialName.Contains("GFA")).FirstOrDefault();
decimal gfajl = recipeMaterial2.materialWeight;
var writeResult10 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJl, (float)gfajl);
////树脂加料
Base_RecipeMaterial recipeMaterial3 = recipeMaterials.Where(x => x.materialName.Contains("树脂")).FirstOrDefault();
decimal szjl = recipeMaterial3.materialWeight;
var writeResult11 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJl, (float)szjl);
//通过配方编号获取工艺参数信息
List<Base_RecipeCratParam> recipeCratParams = Technical.PmtRecipe.RecipeHelper.GerCratParamListByRecipeAndMaterial(info.recipeId, string.Empty);
//混料速度1
Base_RecipeCratParam base_RecipeCratParam1 = recipeCratParams.Where(x => x.paramName.Contains("混料速度1")).FirstOrDefault();
int hlsd1 = int.Parse(base_RecipeCratParam1.paramValue);
var writeResult4 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd1, new object[] { hlsd1 });
//混料速度2
Base_RecipeCratParam base_RecipeCratParam2 = recipeCratParams.Where(x => x.paramName.Contains("混料速度2")).FirstOrDefault();
int hlsd2 = int.Parse(base_RecipeCratParam2.paramValue);
var writeResult5 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd2, new object[] { hlsd2 });
//混料速度3
Base_RecipeCratParam base_RecipeCratParam3 = recipeCratParams.Where(x => x.paramName.Contains("混料速度3")).FirstOrDefault();
int hlsd3 = int.Parse(base_RecipeCratParam3.paramValue);
var writeResult6 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsd3, new object[] { hlsd3 });
//进料时间
Base_RecipeCratParam base_RecipeCratParam4 = recipeCratParams.Where(x => x.paramName.Contains("进料时间")).FirstOrDefault();
int jlsj = int.Parse(base_RecipeCratParam4.paramValue);
var writeResult7 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Jlsj, new object[] { jlsj });
//混料时间
Base_RecipeCratParam base_RecipeCratParam5 = recipeCratParams.Where(x => x.paramName.Contains("混料时间")).FirstOrDefault();
int hlsj = int.Parse(base_RecipeCratParam5.paramValue);
var writeResult8 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_Hlsj, new object[] { hlsj });
//VCC加料误差
Base_RecipeCratParam base_RecipeCratParam6 = recipeCratParams.Where(x => x.paramName.Contains("VCC加料误差")).FirstOrDefault();
decimal vccjlwc = decimal.Parse(base_RecipeCratParam6.paramValue);
var writeResult12 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_VCCJlWc, (float)vccjlwc);
//GFA加料误差
Base_RecipeCratParam base_RecipeCratParam7 = recipeCratParams.Where(x => x.paramName.Contains("GFA加料误差")).FirstOrDefault();
decimal gfajlwc = decimal.Parse(base_RecipeCratParam7.paramValue);
var writeResult13 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_GFAJlWc, (float)gfajlwc);
//树脂加料误差
Base_RecipeCratParam base_RecipeCratParam8 = recipeCratParams.Where(x => x.paramName.Contains("树脂加料误差")).FirstOrDefault();
decimal szjlwc = decimal.Parse(base_RecipeCratParam8.paramValue);
var writeResult14 = BasePlcHelper.Instance.PlcWriteFloatByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_SZJlWc, (float)szjlwc);
//配方下传完成
var writeResult15 = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RpFinished, new object[] { true });
//计划下传成功后需要修改计划状态为执行中
return true;
}

@ -209,7 +209,7 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
#endregion
//下传终止信号
bool writeRpCancel = BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.ChemicalWeighing_PC_RpCancel, new object[] { 1 });
bool writeRpCancel = false;
if (writeRpCancel)
{

@ -66,7 +66,7 @@ namespace Mesnac.Action.ChemicalWeighing.Sys
//SetDateTimeFormat();
//首次运行启动更新计划状态和自动下传计划服务
FinishBatch.FinishBatchService.Instance.Start();
// FinishBatch.FinishBatchService.Instance.Start();
//首次运行时启动定时器运行服务其中包含Socket通讯连接
Sys.TimerRunService.Instance.Start();
@ -81,7 +81,7 @@ namespace Mesnac.Action.ChemicalWeighing.Sys
protected void Workbench_ShutDown(object sender, EventArgs e)
{
FinishBatch.FinishBatchService.Instance.Stop(); //停止生产记录存盘服务
// FinishBatch.FinishBatchService.Instance.Stop(); //停止生产记录存盘服务
Sys.TimerRunService.Instance.Stop();
}

@ -28,7 +28,7 @@ namespace Mesnac.Action.Default.Purview
{
return;//窗体不验证权限
}
if (UserInfo.Instance.RoleGUID == "-mesnac")
if (UserInfo.Instance.RoleGUID == "-99")
{
return;//超级用户
}

@ -206,7 +206,7 @@ namespace Mesnac.Action.Default.Purview
#region 如果是强制登录则放行
if (Mesnac.Basic.UserInfo.Instance.RoleGUID.Equals("-mesnac") || _ower == Mesnac.Gui.Workbench.WorkbenchSingleton.Workbench)
if (Mesnac.Basic.UserInfo.Instance.RoleGUID.Equals("-99") || _ower == Mesnac.Gui.Workbench.WorkbenchSingleton.Workbench)
{
return true;
}
@ -306,7 +306,7 @@ namespace Mesnac.Action.Default.Purview
private bool superLogin()
{
bool bResult = false;
if (this.txtPWD.Text == "-mesnac")
if (this.txtPWD.Text == "-99")
{
UserInfo.Instance.RoleGUID = "-99";
UserInfo.Instance.UserGUID = "-";

@ -41,6 +41,8 @@
<Node Name="FormDeviceDetail2" Text="设备细节2" ToolTipText="FormDeviceDetail2" Tag="FormDeviceDetail2" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="FormPlan" Text="榄菊计划管理" ToolTipText="FormPlan" Tag="FormPlan" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="FormSheBei" Text="榄菊设备配方" ToolTipText="FormSheBei" Tag="FormSheBei" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="Report_DryMixer" Text="干混机报表" ToolTipText="Report_DryMixer" Tag="Report_DryMixer" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="湿混机报表" Text="湿混机报表" ToolTipText="湿混机报表" Tag="湿混机报表" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="糊化机报表" Text="糊化机报表" ToolTipText="糊化机报表" Tag="糊化机报表" ImageIndex="3" SelectedImageIndex="3" />

@ -1,3 +1,7 @@
<DataSources>
<<<<<<< HEAD
<DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="192.168.0.125" UserName="sa" Password="123456" DataBase="CWSSHG" ConnectionTimeout="5" DriverAssembly="ICSharpCode.Data.SQLServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DriverClass="ICSharpCode.Data.Core.DatabaseDrivers.SQLServer.SQLServerDatabaseDriver" DataSourceClass="ICSharpCode.Data.Core.DatabaseObjects.Database" />
=======
<DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="10.11.41.1" UserName="sa" Password="123456" DataBase="CWSSHG" ConnectionTimeout="5" DriverAssembly="ICSharpCode.Data.SQLServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DriverClass="ICSharpCode.Data.Core.DatabaseDrivers.SQLServer.SQLServerDatabaseDriver" DataSourceClass="ICSharpCode.Data.Core.DatabaseObjects.Database" />
>>>>>>> dep_yangw
</DataSources>

File diff suppressed because it is too large Load Diff

@ -627,7 +627,7 @@
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel153" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.B1.WatchDog</Property>
<Property name="TextName">ParametersWithPc.Tst3.recipeName</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />

@ -246,7 +246,7 @@ namespace Mesnac.Gui.Run.ViewContent
public bool IsValid(object owner, ICSharpCode.Core.Condition condition)
{
//如果是超级管理员或没经过登录(独立运行)则可用
if (UserInfo.Instance.RoleGUID == "-mesnac" || UserInfo.Instance.RoleGUID == "-1")
if (UserInfo.Instance.RoleGUID == "-99" || UserInfo.Instance.RoleGUID == "-1")
{
return true;
}

@ -17,13 +17,7 @@ namespace Mesnac.DoUtils
{
public SerialPort serialPort = new SerialPort("COM5");
private static readonly Lazy<DoControl> lazy = new Lazy<DoControl>(() => new DoControl());
public static DoControl Instance
{
get
{
return lazy.Value;
}
}
public static DoControl Instance => lazy.Value;
private DoControl()
{

@ -100,6 +100,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Actions", "Actions", "{8F6E
ProjectSection(SolutionItems) = preProject
Actions\Mesnac.Action.Base.dll = Actions\Mesnac.Action.Base.dll
Actions\Mesnac.ActionService.dll = Actions\Mesnac.ActionService.dll
Actions\ChemicalWeighing\Microsoft.Office.Interop.Excel.dll = Actions\ChemicalWeighing\Microsoft.Office.Interop.Excel.dll
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Default", "Default", "{66F3B234-E56C-4EF4-AB6D-BB6D91467855}"

Loading…
Cancel
Save