通讯修改,温控增加主泵检查
This commit is contained in:
commit
5750ff7ce1
1 file changed
+69
-34
@@ -527,7 +527,7 @@ namespace DyeingComputer.ViewModel
|
||||
Work_Numder = WorkNumder.ToString();
|
||||
StatusStr = Status_Str;
|
||||
Program_Name = ProgramName;
|
||||
if (dt_TP.Rows.Count>0) Process_step = dt_TP.Select("Step=" + RUN_STEPID).First().Field<string>("ParameterName");
|
||||
if (dt_TP.Rows.Count>= RUN_STEPID+1) Process_step = dt_TP.Select("Step=" + RUN_STEPID).First().Field<string>("ParameterName");
|
||||
if (set_) { set_ = false; SYS_SET(); }//设置更新
|
||||
if (!SETP_runtime) DIDETime++;
|
||||
|
||||
@@ -814,12 +814,14 @@ namespace DyeingComputer.ViewModel
|
||||
case "007":
|
||||
STEP_P1 = Convert.ToDouble(P1);
|
||||
STEP_P2 = Convert.ToDouble(P2);
|
||||
STEP_TIME = 0;
|
||||
SETP_runtime = true;
|
||||
STEP_finish = false;
|
||||
break;
|
||||
case "008":
|
||||
STEP_P1 = Convert.ToDouble(P1);
|
||||
STEP_P2 = Convert.ToDouble(P2);
|
||||
STEP_TIME = 0;
|
||||
SETP_runtime = true;
|
||||
STEP_finish = false;
|
||||
break;
|
||||
@@ -985,7 +987,6 @@ namespace DyeingComputer.ViewModel
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
// SQLiteHelpers.Open(); //打开数据库
|
||||
updata_RUN.Clear();
|
||||
@@ -1025,6 +1026,7 @@ namespace DyeingComputer.ViewModel
|
||||
STEP_P4p3 = (double)arrRows[0]["Parameter4_S3"];
|
||||
STEP_P5p3 = (double)arrRows[0]["Parameter5_S3"];
|
||||
}
|
||||
User_Button = true;
|
||||
}
|
||||
|
||||
TimeSpan ts = new TimeSpan(00,00,01);//1秒间隔
|
||||
@@ -1035,6 +1037,11 @@ namespace DyeingComputer.ViewModel
|
||||
private string TANK1, TANK2, TANK3;//料桶信息
|
||||
public static string TANK1_DYELOT, TANK2_DYELOT, TANK3_DYELOT;//料单号
|
||||
private int TANK1_REDYE,TANK1_STEP, TANK2_REDYE, TANK2_STEP, TANK3_REDYE, TANK3_STEP;
|
||||
int TIME_H;
|
||||
int TIME_M;
|
||||
int TIME_S;
|
||||
double TO = 0;
|
||||
double T = 0;
|
||||
void STEP_RUN_master()
|
||||
{
|
||||
WORK_run = WORK_RUN;
|
||||
@@ -1045,11 +1052,10 @@ namespace DyeingComputer.ViewModel
|
||||
switch (STEP_ID)
|
||||
{
|
||||
case "001":
|
||||
int TIME_H;
|
||||
int TIME_M;
|
||||
int TIME_S;
|
||||
double TO = 0;
|
||||
double T = Selet_dtm("1010"); //实际温度
|
||||
if (Selet_dtd("3011"))
|
||||
{
|
||||
ERRinf.ERRinf_d(errTabler, "103");//
|
||||
T = Selet_dtm("1010"); //实际温度
|
||||
if (THL_mode == 0) //保温
|
||||
{
|
||||
TO = pid.PID_iterate(STEP_P1, T, ts);
|
||||
@@ -1079,7 +1085,7 @@ namespace DyeingComputer.ViewModel
|
||||
TO = 0;
|
||||
pid.ResetController();
|
||||
}
|
||||
if (STEP_P1 < T)
|
||||
if (STEP_P1 <= T)
|
||||
{
|
||||
Updata_dta("5001", 0);
|
||||
Updata_dtm("1004", 0);
|
||||
@@ -1111,7 +1117,7 @@ namespace DyeingComputer.ViewModel
|
||||
TO = pid.PID_iterate(TEMP_co, T, ts);
|
||||
if (TO > 0) TO = 0;
|
||||
TO = Math.Abs(TO);
|
||||
if (STEP_P1 > T)
|
||||
if (STEP_P1 >= T)
|
||||
{
|
||||
Updata_dta("5002", 0);
|
||||
Updata_dtm("1005", 0);
|
||||
@@ -1194,6 +1200,11 @@ namespace DyeingComputer.ViewModel
|
||||
Updata_dta("5001", 0);
|
||||
Updata_dta("5002", 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERRinf.ERRinf_w(errTabler, Resources.PumpStops , "");//写入
|
||||
}
|
||||
break;//功能模块001温度控制
|
||||
case "007":
|
||||
if (STEP_P1.ToString() == "1")
|
||||
@@ -1367,7 +1378,7 @@ namespace DyeingComputer.ViewModel
|
||||
"[" + STEP_P4 + "]" + ":" + Resources.Drainage + "3";
|
||||
}
|
||||
|
||||
if (Selet_dtm("1015") <= STEP_P2) //排水状态完成
|
||||
if (Selet_dtm("1015") <= MT43) //排水状态完成
|
||||
{
|
||||
if (STEP_TIME <= 0)//排水延时
|
||||
{
|
||||
@@ -1387,7 +1398,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
}
|
||||
}
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Washing + "(" + Properties.Resources.WaterLevel + ")";
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Washing + "(" + Properties.Resources.WaterLevel + ")";
|
||||
}
|
||||
else { STEP_finish = true; }
|
||||
break;//批次水位水洗
|
||||
@@ -1508,7 +1519,6 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
break;//运转时间
|
||||
case "035":
|
||||
USERcall("035", Resources.ClothIntake);
|
||||
if (Selet_dtd("2004")|| UserCall_OK)
|
||||
{
|
||||
UserCall_OK = false;
|
||||
@@ -1517,6 +1527,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
USERcall("035", Resources.ClothIntake);
|
||||
Alert_yellow = true;
|
||||
if (STEP_TIME <= 0)
|
||||
{
|
||||
@@ -1531,7 +1542,6 @@ namespace DyeingComputer.ViewModel
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.ClothIntake;
|
||||
break;//准备入布
|
||||
case "036":
|
||||
USERcall("036", Resources.OutTheCloth);
|
||||
if (Selet_dtd("2004")|| UserCall_OK)
|
||||
{
|
||||
UserCall_OK=false;
|
||||
@@ -1540,6 +1550,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
USERcall("036", Resources.OutTheCloth);
|
||||
Alert_yellow = true;
|
||||
if (STEP_TIME <= 0)
|
||||
{
|
||||
@@ -1554,7 +1565,6 @@ namespace DyeingComputer.ViewModel
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.OutTheCloth;
|
||||
break;//准备出布
|
||||
case "039":
|
||||
USERcall("039", Resources.CallWorkers);
|
||||
if (Selet_dtd("2004")|| UserCall_OK)
|
||||
{
|
||||
UserCall_OK = false;
|
||||
@@ -1563,6 +1573,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
USERcall("039", Resources.CallWorkers);
|
||||
Alert_yellow = true;
|
||||
if (STEP_TIME <= 0)
|
||||
{
|
||||
@@ -1577,13 +1588,6 @@ namespace DyeingComputer.ViewModel
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.CallWorkers;
|
||||
break;//呼叫人工
|
||||
case "040":
|
||||
if (sampling == null || !sampling.IsLoaded)
|
||||
{
|
||||
sampling = new Sampling();
|
||||
sampling.Topmost = true;
|
||||
sampling.CALL_time = S20;
|
||||
sampling.Show();
|
||||
}//取样提示
|
||||
if (Selet_dtd("2004")|| UserCall_OK)
|
||||
{
|
||||
UserCall_OK = false;
|
||||
@@ -1592,6 +1596,14 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sampling == null || !sampling.IsLoaded)
|
||||
{
|
||||
sampling = new Sampling();
|
||||
sampling.Topmost = true;
|
||||
sampling.CALL_time = S20;
|
||||
sampling.Show();
|
||||
}//取样提示
|
||||
|
||||
Alert_yellow = true;
|
||||
if (STEP_TIME <= 0)
|
||||
{
|
||||
@@ -1606,11 +1618,16 @@ namespace DyeingComputer.ViewModel
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Sampling;
|
||||
break;//取样
|
||||
case "041":
|
||||
STEP_finish = true;
|
||||
STEP_RUN_slave_stop();
|
||||
Updata_dtm("1004", 0);
|
||||
Updata_dtm("1005", Selet_dtm("1010"));
|
||||
for (int i = 1; i < 128; i++)
|
||||
{
|
||||
Updata_dtd((3000 + i).ToString(), false);
|
||||
}
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.End;
|
||||
break;//结束
|
||||
case "049":
|
||||
USERcall("035", Resources.Await);
|
||||
if (Selet_dtd("2004")|| UserCall_OK)
|
||||
{
|
||||
UserCall_OK = false;
|
||||
@@ -1619,6 +1636,7 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
USERcall("035", Resources.Await);
|
||||
Alert_yellow = true;
|
||||
STEP_TIME--;
|
||||
if (STEP_TIME <= 0)
|
||||
@@ -2155,6 +2173,8 @@ namespace DyeingComputer.ViewModel
|
||||
{
|
||||
if (STEP_finish)
|
||||
{
|
||||
STEP_finish = false;
|
||||
UserCall_OK = false;
|
||||
RUN_STEPID = dt_TP.Select("RUN ='1'").First().Field<int>("Step") +1;
|
||||
DataRow[] arrRows = dt_TP.Select("STEP ='" + RUN_STEPID + "'");
|
||||
string T_ID = arrRows[0]["StepID"].ToString();
|
||||
@@ -2418,7 +2438,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (string.IsNullOrEmpty(TANK1_DYELOT)) TANK1_DYELOT = WorkNumder.ToString();
|
||||
TANK1_STEP = Convert.ToInt16(STEP_P3p1);
|
||||
FeedingRecords(work_Numder, TANK1_DYELOT, Convert.ToInt16(STEP_P1p1), TANK1_STEP, Convert.ToInt16(STEP_P2p1));//调用呼叫
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.CallDistribution;
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.CallDistribution;
|
||||
} //药缸1
|
||||
else if (STEP_P1p1 == 2)
|
||||
{
|
||||
@@ -2431,7 +2451,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (string.IsNullOrEmpty(TANK2_DYELOT)) TANK2_DYELOT = WorkNumder.ToString();
|
||||
TANK2_STEP = Convert.ToInt16(STEP_P3p1);
|
||||
FeedingRecords(work_Numder, TANK2_DYELOT, Convert.ToInt16(STEP_P1p1), TANK2_STEP, Convert.ToInt16(STEP_P2p1));//调用呼叫
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.CallDistribution;
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.CallDistribution;
|
||||
}//药缸2
|
||||
else if (STEP_P1p1 == 3)
|
||||
{
|
||||
@@ -2444,7 +2464,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (string.IsNullOrEmpty(TANK3_DYELOT)) TANK3_DYELOT = WorkNumder.ToString();
|
||||
TANK3_STEP = Convert.ToInt16(STEP_P3p1);
|
||||
FeedingRecords(work_Numder, TANK3_DYELOT, Convert.ToInt16(STEP_P1p1), TANK3_STEP, Convert.ToInt16(STEP_P2p1));//调用呼叫
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.CallDistribution;
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.CallDistribution;
|
||||
}//药缸3
|
||||
//STEP_finish = true;
|
||||
break;//呼叫输送
|
||||
@@ -2674,7 +2694,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (string.IsNullOrEmpty(TANK1_DYELOT)) TANK1_DYELOT = WorkNumder.ToString();
|
||||
TANK1_STEP = Convert.ToInt16(STEP_P3p2);
|
||||
FeedingRecords(work_Numder, TANK1_DYELOT, Convert.ToInt16(STEP_P1p2), TANK1_STEP, Convert.ToInt16(STEP_P2p2));//调用呼叫
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.CallDistribution;
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.CallDistribution;
|
||||
} //药缸1
|
||||
else if (STEP_P1p2 == 2)
|
||||
{
|
||||
@@ -2687,7 +2707,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (string.IsNullOrEmpty(TANK2_DYELOT)) TANK2_DYELOT = WorkNumder.ToString();
|
||||
TANK2_STEP = Convert.ToInt16(STEP_P3p2);
|
||||
FeedingRecords(work_Numder, TANK2_DYELOT, Convert.ToInt16(STEP_P1p2), TANK2_STEP, Convert.ToInt16(STEP_P2p2));//调用呼叫
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.CallDistribution;
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.CallDistribution;
|
||||
}//药缸2
|
||||
else if (STEP_P1p2 == 3)
|
||||
{
|
||||
@@ -2700,7 +2720,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (string.IsNullOrEmpty(TANK3_DYELOT)) TANK3_DYELOT = WorkNumder.ToString();
|
||||
TANK3_STEP = Convert.ToInt16(STEP_P3p2);
|
||||
FeedingRecords(work_Numder, TANK3_DYELOT, Convert.ToInt16(STEP_P1p2), TANK3_STEP, Convert.ToInt16(STEP_P2p2));//调用呼叫
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.CallDistribution;
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.CallDistribution;
|
||||
}//药缸3
|
||||
//STEP_finish = true;
|
||||
break;//呼叫输送
|
||||
@@ -2930,7 +2950,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (string.IsNullOrEmpty(TANK1_DYELOT)) TANK1_DYELOT = WorkNumder.ToString();
|
||||
TANK1_STEP = Convert.ToInt16(STEP_P3p3);
|
||||
FeedingRecords(work_Numder, TANK1_DYELOT, Convert.ToInt16(STEP_P1p3), TANK1_STEP, Convert.ToInt16(STEP_P2p3));//调用呼叫
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.CallDistribution;
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 1 :" + Resources.CallDistribution;
|
||||
} //药缸1
|
||||
else if (STEP_P1p3 == 2)
|
||||
{
|
||||
@@ -2943,7 +2963,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (string.IsNullOrEmpty(TANK2_DYELOT)) TANK2_DYELOT = WorkNumder.ToString();
|
||||
TANK2_STEP = Convert.ToInt16(STEP_P3p3);
|
||||
FeedingRecords(work_Numder, TANK2_DYELOT, Convert.ToInt16(STEP_P1p3), TANK2_STEP, Convert.ToInt16(STEP_P2p3));//调用呼叫
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.CallDistribution;
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 2 :" + Resources.CallDistribution;
|
||||
}//药缸2
|
||||
else if (STEP_P1p3 == 3)
|
||||
{
|
||||
@@ -2956,7 +2976,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (string.IsNullOrEmpty(TANK3_DYELOT)) TANK3_DYELOT = WorkNumder.ToString();
|
||||
TANK3_STEP = Convert.ToInt16(STEP_P3p3);
|
||||
FeedingRecords(work_Numder, TANK3_DYELOT, Convert.ToInt16(STEP_P1p3), TANK3_STEP, Convert.ToInt16(STEP_P2p3));//调用呼叫
|
||||
if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.CallDistribution;
|
||||
// if (errTabler.Rows.Count == 0) Status_Str = Resources.Tank + " 3 :" + Resources.CallDistribution;
|
||||
}//药缸3
|
||||
//STEP_finish = true;
|
||||
break;//呼叫输送
|
||||
@@ -3266,7 +3286,15 @@ namespace DyeingComputer.ViewModel
|
||||
private void Simulate()//模拟
|
||||
{
|
||||
double _rd = (double)_random.Next(1, 5) / 10;
|
||||
if (THL_mode == 1 || THL_mode == 0)
|
||||
if (THL_mode == 0)
|
||||
{
|
||||
if (Selet_dta("4001") > 16)
|
||||
{
|
||||
Updata_dta("4001", (int)(Selet_dta("4001") - _rd / 100));
|
||||
}
|
||||
Updata_dta("4001", (int)(Selet_dta("4001") + Selet_dta("5001") / 50 * _rd));
|
||||
}
|
||||
else if(THL_mode == 1 )
|
||||
{
|
||||
if (Selet_dta("4001") > 16)
|
||||
{
|
||||
@@ -3277,7 +3305,14 @@ namespace DyeingComputer.ViewModel
|
||||
else if (THL_mode == 2)
|
||||
{ Updata_dta("4001", (int)(Selet_dta("4001") - Selet_dta("5002") / 100*_rd)); }
|
||||
|
||||
|
||||
if (Selet_dtd("3013") || Selet_dtd("3014") || Selet_dtd("3015") || Selet_dtd("3016"))
|
||||
{
|
||||
Updata_dta("4007", (int)(Selet_dta("4007") + _rd * 20));
|
||||
}
|
||||
if (Selet_dtd("3017") || Selet_dtd("3018") || Selet_dtd("3019"))
|
||||
{
|
||||
Updata_dta("4007", (int)(Selet_dta("4007") - _rd * 20));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user