change - 自动控制plc校验

wangsr
wangsr 1 year ago
parent 9d14708a28
commit 9057fb6d9b

@ -1,24 +1,13 @@
using DataBlockHelper.DBHelpers;
using DevExpress.Utils.Serializing.Helpers;
using DevExpress.XtraEditors.Filtering.Templates;
using Mesnac.Action.ChemicalWeighing.AutoControl.DB;
using Mesnac.Action.ChemicalWeighing.AutoControl.DB;
using Mesnac.Action.ChemicalWeighing.AutoControl.Entity;
using Mesnac.Action.ChemicalWeighing.FreeDb;
using Mesnac.Action.ChemicalWeighing.LjMixManager;
using Mesnac.Action.ChemicalWeighing.LjPlanning;
using Mesnac.Action.ChemicalWeighing.Util;
using Mesnac.Controls.Base;
using Mesnac.Controls.ChemicalWeighing;
using Mesnac.Controls.Default;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.AutoControl
{

@ -1,7 +1,5 @@
using DataBlockHelper.DBHelpers;
using DataBlockHelper.Entity.DB2104Entity;
using DevExpress.DataAccess.Native.Web;
using DevExpress.XtraEditors.Filtering.Templates;
using Mesnac.Action.ChemicalWeighing.AutoControl.DB;
using Mesnac.Action.ChemicalWeighing.AutoControl.Entity;
using Mesnac.Action.ChemicalWeighing.LjMixManager;
@ -11,14 +9,8 @@ using Mesnac.Controls.Default;
using Mesnac.Core.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Serialization;
using static Mesnac.Action.ChemicalWeighing.AutoControl.AutoLogHelper;
using Newtonsoft.Json;
using DevExpress.DataAccess.Native.Json;
namespace Mesnac.Action.ChemicalWeighing.AutoControl
{
@ -259,14 +251,13 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
if (!GWComparePLC(recipes, steps, mixSteps, RadioE))
{
MessageBox.Show("下传数据不完整,请重新下传数据!");
MessageBox.Show("湿混糊化产线下传数据不完整,请重新下传数据!");
}
}
private static bool GWComparePLC(List<RecipePlcView> recipes, List<Step> steps, List<MixStep> mixSteps, MCRadioButtonEntity RadioE)
{
bool flag = false;
var getGelatG1 = LjPlanningPlcHelp.GetGelatG1;
var getWeterM1 = LjPlanningPlcHelp.GetWeterM1;
var getGelatG2 = LjPlanningPlcHelp.GetGelatG2;
@ -380,6 +371,41 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
DeviceMaterrialService.Save(materials);
break;
}
if (!DYComparePLC(recipes, steps, RadioE))
{
MessageBox.Show("干混产线下传数据不完整,请重新下传数据!");
}
}
private static bool DYComparePLC(List<RecipePlcView> recipes, List<Step> steps, MCRadioButtonEntity RadioE)
{
var getDryerD1 = LjPlanningPlcHelp.GetDryerD1;
var getDryerD2 = LjPlanningPlcHelp.GetDryerD2;
var getDryerD3 = LjPlanningPlcHelp.GetDryerD3;
var getDryerD4 = LjPlanningPlcHelp.GetDryerD4;
string j1 = ControlsHelper.JsonSerialize(recipes);
string j2 = ControlsHelper.JsonSerialize(steps);
switch (ControlsHelper.SingleSelect(RadioE))
{
case 1:
return j1 == ControlsHelper.JsonSerialize(getDryerD1.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getDryerD1.RecipeSteps);
case 2:
return j1 == ControlsHelper.JsonSerialize(getDryerD2.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getDryerD2.RecipeSteps);
case 3:
return j1 == ControlsHelper.JsonSerialize(getDryerD3.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getDryerD3.RecipeSteps);
case 4:
return j1 == ControlsHelper.JsonSerialize(getDryerD4.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getDryerD4.RecipeSteps);
default:
MessageBox.Show("未选择产线!");
return true;
}
}
#endregion

@ -1,4 +1,5 @@
using DevExpress.Data.Filtering.Helpers;
using DevExpress.Utils.FormShadow;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.LjDeliver.Entity;
using Mesnac.Controls.ChemicalWeighing;
@ -27,10 +28,40 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
ControlsHelper.ControlImport<HslBottle>(bottleE, Controls);
wangsr();
//wangsr();
}
//测试程序
private void wangsr()
{
Random rd = new Random();
@ -62,8 +93,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
}
int num;
while (Application.OpenForms["LjDeliver"] != null)
var obj = Application.OpenForms["LjDeliver"];
while (obj != null)
{
num = 0;
@ -96,6 +127,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
num++;
}
Thread.Sleep(1);
obj = Application.OpenForms["LjDeliver"];
}
});
Thread thread = new Thread(threadStart);

@ -4689,7 +4689,7 @@
<Property name="Dock">Fill</Property>
<Property name="Location">0, 0</Property>
<Property name="Name">Panel15</Property>
<Property name="Size">1736, 917</Property>
<Property name="Size">1738, 925</Property>
</Object>
<Property name="LoadActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAACAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDcxODhEMjExMkM4NTQ1NEI5OEIyQTFDMjk2RDBCQzU3BgYAAAAV6L6T6YCB55WM6Z2i5Yid5aeL5YyWBgcAAAAV6L6T6YCB55WM6Z2i5Yid5aeL5YyWCw==</Binary>

Loading…
Cancel
Save