杨威 5 months ago
parent 6bb0d54999
commit df8ed10407

@ -301,69 +301,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
MessageBox.Show("数据下传成功!"); MessageBox.Show("数据下传成功!");
} }
private static bool GWComparePLC(List<RecipePlcView> recipes, List<Step> steps, List<MixStep> mixSteps, MCRadioButtonEntity RadioE)
{
var getGelatG1 = LjPlanningPlcHelp.GetGelatG1;
var getWeterM1 = LjPlanningPlcHelp.GetWeterM1;
var getGelatG2 = LjPlanningPlcHelp.GetGelatG2;
var getWeterM2 = LjPlanningPlcHelp.GetWeterM2;
var getGelatG3 = LjPlanningPlcHelp.GetGelatG3;
var getWeterM3 = LjPlanningPlcHelp.GetWeterM3;
var getGelatG4 = LjPlanningPlcHelp.GetGelatG4;
var getWeterM4 = LjPlanningPlcHelp.GetWeterM4;
var getGelatG5 = LjPlanningPlcHelp.GetGelatG5;
var getWeterM5 = LjPlanningPlcHelp.GetWeterM5;
var getGelatG6 = LjPlanningPlcHelp.GetGelatG6;
var getWeterM6 = LjPlanningPlcHelp.GetWeterM6;
var getGelatG7 = LjPlanningPlcHelp.GetGelatG7;
var getWeterM7 = LjPlanningPlcHelp.GetWeterM7;
var getGelatG8 = LjPlanningPlcHelp.GetGelatG8;
var getWeterM8 = LjPlanningPlcHelp.GetWeterM8;
string j1 = ControlsHelper.JsonSerialize(recipes);
string j2 = ControlsHelper.JsonSerialize(steps);
string j3 = ControlsHelper.JsonSerialize(mixSteps);
switch (ControlsHelper.SingleSelect(RadioE))
{
case 1:
return j1 == ControlsHelper.JsonSerialize(getGelatG1.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getGelatG1.RecipeSteps)
&& j3 == ControlsHelper.JsonSerialize(getWeterM1);
case 2:
return j1 == ControlsHelper.JsonSerialize(getGelatG2.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getGelatG2.RecipeSteps)
&& j3 == ControlsHelper.JsonSerialize(getWeterM2);
case 3:
return j1 == ControlsHelper.JsonSerialize(getGelatG3.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getGelatG3.RecipeSteps)
&& j3 == ControlsHelper.JsonSerialize(getWeterM3);
case 4:
return j1 == ControlsHelper.JsonSerialize(getGelatG4.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getGelatG4.RecipeSteps)
&& j3 == ControlsHelper.JsonSerialize(getWeterM4);
case 5:
return j1 == ControlsHelper.JsonSerialize(getGelatG5.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getGelatG5.RecipeSteps)
&& j3 == ControlsHelper.JsonSerialize(getWeterM5);
case 6:
return j1 == ControlsHelper.JsonSerialize(getGelatG6.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getGelatG6.RecipeSteps)
&& j3 == ControlsHelper.JsonSerialize(getWeterM6);
case 7:
return j1 == ControlsHelper.JsonSerialize(getGelatG7.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getGelatG7.RecipeSteps)
&& j3 == ControlsHelper.JsonSerialize(getWeterM7);
case 8:
return j1 == ControlsHelper.JsonSerialize(getGelatG8.RecipePlcViews)
&& j2 == ControlsHelper.JsonSerialize(getGelatG8.RecipeSteps)
&& j3 == ControlsHelper.JsonSerialize(getWeterM8);
default:
MessageBox.Show("未选择产线!");
return true;
}
}
#endregion #endregion
@ -493,35 +431,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
} }
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.DrySelect(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 #endregion

@ -44,7 +44,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{ {
recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList();
int begin = 58; int begin = 128;
DownCleanD1Recipe(begin); DownCleanD1Recipe(begin);
for (int i = 0; i < recipePlcViews.Count(); i++) for (int i = 0; i < recipePlcViews.Count(); i++)
{ {
@ -54,7 +54,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
} }
begin = 178; begin = 278;
for (int i = 0; i < recipeSteps.Count(); i++) for (int i = 0; i < recipeSteps.Count(); i++)
{ {
var view = recipeSteps[i]; var view = recipeSteps[i];
@ -72,7 +72,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
public static void DownD2Recipe(List<RecipePlcView> recipePlcViews, List<Step> recipeSteps) public static void DownD2Recipe(List<RecipePlcView> recipePlcViews, List<Step> recipeSteps)
{ {
recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList();
int begin = 298; int begin = 398;
DownCleanD1Recipe(begin); DownCleanD1Recipe(begin);
for (int i = 0; i < recipePlcViews.Count(); i++) for (int i = 0; i < recipePlcViews.Count(); i++)
{ {
@ -82,7 +82,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
} }
begin = 418; begin = 548;
for (int i = 0; i < recipeSteps.Count(); i++) for (int i = 0; i < recipeSteps.Count(); i++)
{ {
var view = recipeSteps[i]; var view = recipeSteps[i];
@ -99,7 +99,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
public static void DownD3Recipe(List<RecipePlcView> recipePlcViews, List<Step> recipeSteps) public static void DownD3Recipe(List<RecipePlcView> recipePlcViews, List<Step> recipeSteps)
{ {
recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList();
int begin = 538; int begin = 668;
DownCleanD1Recipe(begin); DownCleanD1Recipe(begin);
for (int i = 0; i < recipePlcViews.Count(); i++) for (int i = 0; i < recipePlcViews.Count(); i++)
{ {
@ -109,7 +109,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
} }
begin = 658; begin = 818;
for (int i = 0; i < recipeSteps.Count(); i++) for (int i = 0; i < recipeSteps.Count(); i++)
{ {
var view = recipeSteps[i]; var view = recipeSteps[i];
@ -124,7 +124,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
public static void DownD4Recipe(List<RecipePlcView> recipePlcViews, List<Step> recipeSteps) public static void DownD4Recipe(List<RecipePlcView> recipePlcViews, List<Step> recipeSteps)
{ {
recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList(); recipePlcViews = recipePlcViews.Where(x => x.Bin != -1).ToList();
int begin = 778; int begin = 938;
DownCleanD1Recipe(begin); DownCleanD1Recipe(begin);
for (int i = 0; i < recipePlcViews.Count(); i++) for (int i = 0; i < recipePlcViews.Count(); i++)
{ {
@ -134,7 +134,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
} }
begin = 898; begin = 1088;
for (int i = 0; i < recipeSteps.Count(); i++) for (int i = 0; i < recipeSteps.Count(); i++)
{ {
var view = recipeSteps[i]; var view = recipeSteps[i];
@ -610,7 +610,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
} }
private static void DownCleanD1Recipe(int begin) private static void DownCleanD1Recipe(int begin)
{ {
List<RecipePlcView> recipePlcViews = GetClean(12); List<RecipePlcView> recipePlcViews = GetClean(15);
List<Step> recipeSteps = GetCleanStep(10); List<Step> recipeSteps = GetCleanStep(10);
for (int i = 0; i < recipePlcViews.Count(); i++) for (int i = 0; i < recipePlcViews.Count(); i++)
@ -674,26 +674,26 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
private static void Dowd(int start, RecipePlcView view) private static void Dowd(int start, RecipePlcView view)
{ {
int bin = start; int bin = start;
PlcConnect.Instance.Write($"DB2104.{bin}.0", view.Bin); PlcConnect.Instance.Write($"DB2108.{bin}.0", view.Bin);
int set = start + 2; int set = start + 2;
PlcConnect.Instance.Write($"DB2104.{set}.0", view.Set); PlcConnect.Instance.Write($"DB2108.{set}.0", view.Set);
int tolerance = start + 6; int tolerance = start + 6;
PlcConnect.Instance.Write($"DB2104.{tolerance}.0", view.Tolerance); PlcConnect.Instance.Write($"DB2108.{tolerance}.0", view.Tolerance);
} }
private static void DowSteps(int start, Step step) private static void DowSteps(int start, Step step)
{ {
int mixCode = start; int mixCode = start;
var info= PlcConnect.Instance.Write($"DB2104.{mixCode}.0", step.MixCode); var info= PlcConnect.Instance.Write($"DB2108.{mixCode}.0", step.MixCode);
int mixTime = start + 2; int mixTime = start + 2;
PlcConnect.Instance.Write($"DB2104.{mixTime}.0", step.MixTime); PlcConnect.Instance.Write($"DB2108.{mixTime}.0", step.MixTime);
int mixTemp = start + 4; int mixTemp = start + 4;
PlcConnect.Instance.Write($"DB2104.{mixTemp}.0", step.MixTemp); PlcConnect.Instance.Write($"DB2108.{mixTemp}.0", step.MixTemp);
int mixSpeed = start + 8; int mixSpeed = start + 8;
PlcConnect.Instance.Write($"DB2104.{mixSpeed}.0", step.MixSpeed); PlcConnect.Instance.Write($"DB2108.{mixSpeed}.0", step.MixSpeed);
} }

@ -1,3 +1,3 @@
<DataSources> <DataSources>
<DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="172.18.4.130" UserName="sa" Password="123456" DataBase="CWSSHG" ConnectionTimeout="20" 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="172.18.4.130" UserName="sa" Password="123456" DataBase="yw" ConnectionTimeout="20" 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" />
</DataSources> </DataSources>
Loading…
Cancel
Save