sc 2 months ago
parent
commit
1069a43cf4
  1. 345
      ViewModel/MainWindowViewModel.cs
  2. 13
      Windows/ViewStep.xaml.cs

345
ViewModel/MainWindowViewModel.cs

@ -1859,242 +1859,239 @@ namespace DyeingComputer.ViewModel
{
if (WORK_RUN == 2)
{
switch (STEP_ID)
{
case "015":
switch (STEP_ID)
{
case "015":
break;//溢流水洗
case "017":
break;//溢流水洗
case "017":
break;//降温水洗
case "064":
if ((STEP_P1 == 1) || (STEP_P1 == 0))
break;//降温水洗
case "064":
if ((STEP_P1 == 1) || (STEP_P1 == 0))
{
if (Selet_dtm("1017") >= STEP_P3)//水位
{
if (Selet_dtm("1017") >= STEP_P3)//水位
TANK1 = Resources.Ready;
Updata_dtd("3036", false);
Updata_dtd("3037", false);
Updata_dtd("3038", false);
if (Selet_dtm("1012") >= STEP_P4)//温度
{
TANK1 = Resources.Ready;
Updata_dtd("3036", false);
Updata_dtd("3037", false);
Updata_dtd("3038", false);
Updata_dtd("3039", false);
if (Selet_dtm("1012") >= STEP_P4)//温度
if (Selet_dtd("2004"))//投料确认
{
Updata_dtd("3039", false);
if (Selet_dtd("2004"))//投料确认
if (STEP_TIME <= 0)//搅拌
{
if (STEP_TIME <= 0)//搅拌
{
TANK1 = Resources.Ready + Resources.Finish;
Updata_dtd("3040", false);
}
else
{
STEP_TIME--;
Updata_dtd("3040", true);
}
Alert_yellow = false;
Alert_bell = false;
TANK1 = Resources.Ready + Resources.Finish;
Updata_dtd("3040", false);
}
else
{
Alert_yellow = true;
STEP_TIME = Convert.ToInt16(STEP_P5);
Alert_bell = true;
STEP_TIME--;
Updata_dtd("3040", true);
}
Alert_yellow = false;
Alert_bell = false;
}
else
{
Updata_dtd("3039", true);
Updata_dtd("3040", true);
Alert_yellow = true;
STEP_TIME = Convert.ToInt16(STEP_P5);
Alert_bell = true;
}
}
else
{
if (STEP_P2 == 0) Updata_dtd("3038", true);
else if (STEP_P2 == 1) Updata_dtd("3036", true);
else if (STEP_P2 == 2) Updata_dtd("3037", true);
Updata_dtd("3039", true);
Updata_dtd("3040", true);
}
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.Ready;
} //药缸1
else if (STEP_P1 == 2)
}
else
{
if (Selet_dtm("1018") >= STEP_P3)//水位
if (STEP_P2 == 0) Updata_dtd("3038", true);
else if (STEP_P2 == 1) Updata_dtd("3036", true);
else if (STEP_P2 == 2) Updata_dtd("3037", true);
}
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.Ready;
} //药缸1
else if (STEP_P1 == 2)
{
if (Selet_dtm("1018") >= STEP_P3)//水位
{
TANK2 = Resources.Ready;
Updata_dtd("3046", false);
Updata_dtd("3047", false);
Updata_dtd("3048", false);
if (Selet_dtm("1013") >= STEP_P4)//温度
{
TANK2 = Resources.Ready;
Updata_dtd("3046", false);
Updata_dtd("3047", false);
Updata_dtd("3048", false);
Updata_dtd("3049", false);
if (Selet_dtm("1013") >= STEP_P4)//温度
if (Selet_dtd("2004"))//投料确认
{
Updata_dtd("3049", false);
if (Selet_dtd("2004"))//投料确认
if (STEP_TIME <= 0)//搅拌
{
if (STEP_TIME <= 0)//搅拌
{
TANK2 = Resources.Ready + Resources.Finish;
Updata_dtd("3050", false);
}
else
{
STEP_TIME--;
Updata_dtd("3050", true);
}
Alert_yellow = false;
Alert_bell = false;
TANK2 = Resources.Ready + Resources.Finish;
Updata_dtd("3050", false);
}
else
{
Alert_yellow = true;
STEP_TIME = Convert.ToInt16(STEP_P5);
Alert_bell = true;
STEP_TIME--;
Updata_dtd("3050", true);
}
Alert_yellow = false;
Alert_bell = false;
}
else
{
Updata_dtd("3049", true);
Updata_dtd("3050", true);
Alert_yellow = true;
STEP_TIME = Convert.ToInt16(STEP_P5);
Alert_bell = true;
}
}
else
{
if (STEP_P2 == 0) Updata_dtd("3048", true);
else if (STEP_P2 == 1) Updata_dtd("3046", true);
else if (STEP_P2 == 2) Updata_dtd("3047", true);
Updata_dtd("3049", true);
Updata_dtd("3050", true);
}
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.Ready;
}//药缸2
else if (STEP_P1 == 3)
}
else
{
if (Selet_dtm("1019") >= STEP_P3)//水位
if (STEP_P2 == 0) Updata_dtd("3048", true);
else if (STEP_P2 == 1) Updata_dtd("3046", true);
else if (STEP_P2 == 2) Updata_dtd("3047", true);
}
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.Ready;
}//药缸2
else if (STEP_P1 == 3)
{
if (Selet_dtm("1019") >= STEP_P3)//水位
{
TANK3 = Resources.Ready;
Updata_dtd("3056", false);
Updata_dtd("3057", false);
Updata_dtd("3058", false);
if (Selet_dtm("1014") >= STEP_P4)//温度
{
TANK3 = Resources.Ready;
Updata_dtd("3056", false);
Updata_dtd("3057", false);
Updata_dtd("3058", false);
Updata_dtd("3059", false);
if (Selet_dtm("1014") >= STEP_P4)//温度
if (Selet_dtd("2004"))//投料确认
{
Updata_dtd("3059", false);
if (Selet_dtd("2004"))//投料确认
if (STEP_TIME <= 0)//搅拌
{
if (STEP_TIME <= 0)//搅拌
{
TANK3 = Resources.Ready + Resources.Finish;
Updata_dtd("3060", false);
}
else
{
STEP_TIME--;
Updata_dtd("3060", true);
}
Alert_yellow = false;
Alert_bell = false;
TANK3 = Resources.Ready + Resources.Finish;
Updata_dtd("3060", false);
}
else
{
Alert_yellow = true;
STEP_TIME = Convert.ToInt16(STEP_P5);
Alert_bell = true;
STEP_TIME--;
Updata_dtd("3060", true);
}
Alert_yellow = false;
Alert_bell = false;
}
else
{
Updata_dtd("3059", true);
Updata_dtd("3060", true);
Alert_yellow = true;
STEP_TIME = Convert.ToInt16(STEP_P5);
Alert_bell = true;
}
}
else
{
if (STEP_P2 == 0) Updata_dtd("3058", true);
else if (STEP_P2 == 1) Updata_dtd("3056", true);
else if (STEP_P2 == 2) Updata_dtd("3057", true);
}
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.Ready;
}//药缸3
break;//药缸备药
case "066":
if (STEP_P1 == 1)
{
TANK1_REDYE = SYS_REDYE;
if (string.IsNullOrEmpty(TANK1_DYELOT)) TANK1_DYELOT = WorkNumder.ToString();
TANK1_STEP = Convert.ToInt16(STEP_P3);
FeedingRecords(work_Numder, TANK1_DYELOT, Convert.ToInt16(STEP_P1), TANK1_STEP, Convert.ToInt16(STEP_P2));//调用呼叫
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.CallDistribution;
STEP_finish = true;
} //药缸1
else if (STEP_P1 == 2)
{
TANK2_REDYE = SYS_REDYE;
if (string.IsNullOrEmpty(TANK2_DYELOT)) TANK2_DYELOT = WorkNumder.ToString();
TANK2_STEP = Convert.ToInt16(STEP_P3);
FeedingRecords(work_Numder, TANK2_DYELOT, Convert.ToInt16(STEP_P1), TANK2_STEP, Convert.ToInt16(STEP_P2));//调用呼叫
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.CallDistribution;
STEP_finish = true;
}//药缸2
else if (STEP_P1 == 3)
{
TANK3_REDYE = SYS_REDYE;
if (string.IsNullOrEmpty(TANK3_DYELOT)) TANK3_DYELOT = WorkNumder.ToString();
TANK3_STEP = Convert.ToInt16(STEP_P3);
FeedingRecords(work_Numder, TANK3_DYELOT, Convert.ToInt16(STEP_P1), TANK3_STEP, Convert.ToInt16(STEP_P2));//调用呼叫
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.CallDistribution;
STEP_finish = true;
}//药缸3
//STEP_finish = true;
break;//呼叫输送
case "067":
break;//等待输送
case "090":
if (((STEP_P1 - 1) < Selet_dtm("1010")) && (Selet_dtm("1010") < (STEP_P1 + 1))) PH_start = true;//达到温度开始ph控制
if (PH_start)
{
if (STEP_P2 >= Selet_dtm("1009"))
{
PH_start = false;
STEP_finish = true;
Updata_dtd("3059", true);
Updata_dtd("3060", true);
}
if (errTabler.Rows.Count == 0) Status_Str = "PH" + Resources.PHControl + "(" + Selet_dtm("1009") + "pH)";
}
else
{
if (errTabler.Rows.Count == 0) Status_Str = "PH" + Resources.PHControl + "(" + Resources.Await + Resources.Temperature + ")";
if (STEP_P2 == 0) Updata_dtd("3058", true);
else if (STEP_P2 == 1) Updata_dtd("3056", true);
else if (STEP_P2 == 2) Updata_dtd("3057", true);
}
break;//快速加酸
case "091":
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.Ready;
}//药缸3
break;//药缸备药
case "066":
if (STEP_P1 == 1)
{
TANK1_REDYE = SYS_REDYE;
if (string.IsNullOrEmpty(TANK1_DYELOT)) TANK1_DYELOT = WorkNumder.ToString();
TANK1_STEP = Convert.ToInt16(STEP_P3);
FeedingRecords(work_Numder, TANK1_DYELOT, Convert.ToInt16(STEP_P1), TANK1_STEP, Convert.ToInt16(STEP_P2));//调用呼叫
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.CallDistribution;
STEP_finish = true;
} //药缸1
else if (STEP_P1 == 2)
{
TANK2_REDYE = SYS_REDYE;
if (string.IsNullOrEmpty(TANK2_DYELOT)) TANK2_DYELOT = WorkNumder.ToString();
TANK2_STEP = Convert.ToInt16(STEP_P3);
FeedingRecords(work_Numder, TANK2_DYELOT, Convert.ToInt16(STEP_P1), TANK2_STEP, Convert.ToInt16(STEP_P2));//调用呼叫
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.CallDistribution;
STEP_finish = true;
}//药缸2
else if (STEP_P1 == 3)
{
TANK3_REDYE = SYS_REDYE;
if (string.IsNullOrEmpty(TANK3_DYELOT)) TANK3_DYELOT = WorkNumder.ToString();
TANK3_STEP = Convert.ToInt16(STEP_P3);
FeedingRecords(work_Numder, TANK3_DYELOT, Convert.ToInt16(STEP_P1), TANK3_STEP, Convert.ToInt16(STEP_P2));//调用呼叫
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.CallDistribution;
STEP_finish = true;
}//药缸3
//STEP_finish = true;
break;//呼叫输送
case "067":
break;//等待输送
case "090":
if (((STEP_P1 - 1) < Selet_dtm("1010")) && (Selet_dtm("1010") < (STEP_P1 + 1))) PH_start = true;//达到温度开始ph控制
if (PH_start)
{
if (STEP_P2 >= Selet_dtm("1009"))
{
PH_start = false;
STEP_finish = true;
}
else
{
PH_start = true;
Status_Str = Status_Str + "(" + Selet_dtm("1009") + "pH)";
}
break;//PH温度控制
case "093":
if (STEP_TIME <= 0)
{
STEP_finish = true;
}
else
{
STEP_TIME--;
}
if (errTabler.Rows.Count == 0) Status_Str = "PH" + Resources.PHDetection + "(" + STEP_TIME + ")";
break;//PH检测
default:
break;
}
}
if (errTabler.Rows.Count == 0) Status_Str = "PH" + Resources.PHControl + "(" + Selet_dtm("1009") + "pH)";
}
else
{
if (errTabler.Rows.Count == 0) Status_Str = "PH" + Resources.PHControl + "(" + Resources.Await + Resources.Temperature + ")";
}
break;//快速加酸
case "091":
if (STEP_P2 >= Selet_dtm("1009"))
{
PH_start = false;
STEP_finish = true;
}
else
{
PH_start = true;
Status_Str = Status_Str + "(" + Selet_dtm("1009") + "pH)";
}
break;//PH温度控制
case "093":
if (STEP_TIME <= 0)
{
STEP_finish = true;
}
else
{
STEP_TIME--;
}
if (errTabler.Rows.Count == 0) Status_Str = "PH" + Resources.PHDetection + "(" + STEP_TIME + ")";
break;//PH检测
default:
break;
}
}
}
public static bool CALL_FR = false;//呼叫状态
string SK5;

13
Windows/ViewStep.xaml.cs

@ -340,10 +340,9 @@ namespace DyeingComputer.Windows
}
private readonly string[] id_dat = {"001","007","008","013","015" ,"017", "020", "022", "031", "035",
"036", "039", "040", "041", "049", "050", "051", "054", "055", "056","064","065","066","067","090",
"091","093","094" };
private readonly string[] id_datp = {" ","015" ,"017", "050", "051", "064", "066","067","090","091",
private readonly string[] id_dat = {"001","007","008","013","015" , "020", "022", "031", "035",
"036", "039", "040", "041", "049", "050", "051", "054", "055", "056","064","065","066","067"};
private readonly string[] id_datp = {" " ,"017", "050", "051", "064", "066","067","090","091",
"093","094" };
private void Form1_Load()
@ -353,7 +352,6 @@ namespace DyeingComputer.Windows
this.boxID.Items.Add(Properties.Resources.AddWater + "(" + Properties.Resources.Flowmeter + ")");//流量进水008
this.boxID.Items.Add(Properties.Resources.Washing + "(" + Properties.Resources.WaterLevel + ")");//水位水洗013
this.boxID.Items.Add(Properties.Resources.Washing + "(" + Properties.Resources.Overflow + ")");//溢流水洗015
this.boxID.Items.Add(Properties.Resources.Washing + "(" + Properties.Resources.Cooling + ")");//降温水洗017
this.boxID.Items.Add(Properties.Resources.Drainage);//排水020
this.boxID.Items.Add(Properties.Resources.PumpDrainage);//主泵排水022
this.boxID.Items.Add(Properties.Resources.RunningTime);//运转031
@ -372,14 +370,9 @@ namespace DyeingComputer.Windows
this.boxID.Items.Add(Properties.Resources.AddTheMedicine);//加药065
this.boxID.Items.Add(Properties.Resources.CallDistribution);//呼叫输送066
this.boxID.Items.Add(Properties.Resources.CallPreparation);//呼叫准备067
this.boxID.Items.Add(Properties.Resources.RapidAcidAddition);//快速加酸090
this.boxID.Items.Add(Properties.Resources.PHTemperatureControl);//ph温度控制091
this.boxID.Items.Add(Properties.Resources.PHDetection);//ph检测093
this.boxID.Items.Add(Properties.Resources.PHControl);//ph控制094
this.boxIDp.Items.Add("");//
this.boxIDp.Items.Add(Properties.Resources.Washing + "(" + Properties.Resources.Overflow + ")");//溢流水洗015
this.boxIDp.Items.Add(Properties.Resources.Washing + "(" + Properties.Resources.Cooling + ")");//降温水洗017
this.boxIDp.Items.Add(Properties.Resources.Pressurized);//加压050
this.boxIDp.Items.Add(Properties.Resources.Depressurized);//减压051

Loading…
Cancel
Save