Browse Source

等待输送功能

master
sc 2 months ago
parent
commit
6ab8ebb4d9
  1. 141
      ViewModel/MainWindowViewModel.cs

141
ViewModel/MainWindowViewModel.cs

@ -1787,14 +1787,36 @@ namespace DyeingComputer.ViewModel
break;//呼叫输送
case "067":
double gram = 0;
if( Dyelot_dat.Rows.Count==0) STEP_finish = true;
if (STEP_P1 == 1)
{
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.CallPreparation;
DataRow[] rowdat = Dyelot_dat.Select("Step ='" + TANK1_STEP + "'");//行
if (rowdat.First().Field<int>("Amount") != 301)//等待输送
if (rowdat.Length == 0) { STEP_finish = true; } else {
if (rowdat.First().Field<int>("State") <= 202)//等待输送
{
TANK1 = Resources.CallPreparation;
if (rowdat.First().Field<int>("State") == 202) TANK1 = Resources.CallPreparation;
return;
}
else if (rowdat.First().Field<int>("State") == 309)//异常时呼叫人工
{
if (Selet_dtd("2004") || UserCall_OK)
{
ERRinf.ERRinf_d(errTabler, "301");//
UserCall_OK = false;
Alert_yellow = false;
Alert_bell = false;
}
else
{
ERRinf.ERRinf_w(errTabler, Resources.Tank + " 1 :" + Resources.CallPreparation +
"[" + Resources.Abnormal + "]", "301");//写入
Alert_yellow = true;
Alert_bell = true;
return;
}
}
if (SK07 == "1")//需要确认
{
foreach (DataRow row in rowdat)//删除指定信息行
@ -1810,60 +1832,109 @@ namespace DyeingComputer.ViewModel
return;
}
}
TANK1 = Resources.Finish;
TANK1 = Resources.Finish;
STEP_finish = true;
}
} //药缸1
else if (STEP_P1 == 2)
{
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.CallPreparation;
DataRow[] rowdat = Dyelot_dat.Select("Step ='" + TANK2_STEP + "'");//行
if (rowdat.First().Field<int>("Amount") != 301)
{
TANK1 = Resources.CallPreparation;
return;
}
if (SK08 == "1")
if (rowdat.Length == 0) { STEP_finish = true; }
else
{
foreach (DataRow row in rowdat)//删除指定信息行
if (rowdat.First().Field<int>("State") <= 202)
{
gram += row.Field<double>("Amount");
row.Delete();
row.AcceptChanges();
if (rowdat.First().Field<int>("State") == 202) TANK2 = Resources.CallPreparation;
return;
}
gram = gram / 1000;
if (gram > Convert.ToInt16(Selet_dtm("1018")))
else if (rowdat.First().Field<int>("State") == 309)//异常时呼叫人工
{
TANK2 = Resources.Inspect;
return;
if (Selet_dtd("2004") || UserCall_OK)
{
ERRinf.ERRinf_d(errTabler, "302");//
UserCall_OK = false;
Alert_yellow = false;
Alert_bell = false;
}
else
{
ERRinf.ERRinf_w(errTabler, Resources.Tank + " 2 :" + Resources.CallPreparation +
"[" + Resources.Abnormal + "]", "302");//写入
Alert_yellow = true;
Alert_bell = true;
return;
}
}
if (SK08 == "1")
{
foreach (DataRow row in rowdat)//删除指定信息行
{
gram += row.Field<double>("Amount");
row.Delete();
row.AcceptChanges();
}
gram = gram / 1000;
if (gram > Convert.ToInt16(Selet_dtm("1018")))
{
TANK2 = Resources.Inspect;
return;
}
}
TANK2 = Resources.Finish;
STEP_finish = true;
}
TANK2 = Resources.Finish;
STEP_finish = true;
}//药缸2
else if (STEP_P1 == 3)
{
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.CallPreparation;
DataRow[] rowdat = Dyelot_dat.Select("Step ='" + TANK3_STEP + "'");//行
if (rowdat.First().Field<int>("Amount") != 301)
{
TANK1 = Resources.CallPreparation;
return;
}
if (SK09 == "1")
if (rowdat.Length == 0) { STEP_finish = true; }
else
{
foreach (DataRow row in rowdat)//删除指定信息行
if (rowdat.First().Field<int>("State") <= 202)
{
gram += row.Field<double>("Amount");
row.Delete();
row.AcceptChanges();
if (rowdat.First().Field<int>("State") == 202) TANK3 = Resources.CallPreparation;
return;
}
gram = gram / 1000;
if (gram > Convert.ToInt16(Selet_dtm("1019")))
else if (rowdat.First().Field<int>("State") == 309)//异常时呼叫人工
{
TANK3 = Resources.Inspect;
return;
if (Selet_dtd("2004") || UserCall_OK)
{
ERRinf.ERRinf_d(errTabler, "303");//
UserCall_OK = false;
Alert_yellow = false;
Alert_bell = false;
}
else
{
ERRinf.ERRinf_w(errTabler, Resources.Tank + " 3 :" + Resources.CallPreparation +
"[" + Resources.Abnormal + "]", "303");//写入
Alert_yellow = true;
Alert_bell = true;
return;
}
}
if (SK09 == "1")
{
foreach (DataRow row in rowdat)//删除指定信息行
{
gram += row.Field<double>("Amount");
row.Delete();
row.AcceptChanges();
}
gram = gram / 1000;
if (gram > Convert.ToInt16(Selet_dtm("1019")))
{
TANK3 = Resources.Inspect;
return;
}
}
TANK3 = Resources.Finish;
STEP_finish = true;
}
TANK3 = Resources.Finish;
STEP_finish = true;
}//药缸3
break;//等待输送
case "090":

Loading…
Cancel
Save