呼叫功能通讯
This commit is contained in:
commit
f4109ecfe1
3 files changed
+45
-26
No files matched your search
@@ -208,7 +208,7 @@
|
||||
<value>計量</value>
|
||||
</data>
|
||||
<data name="LineUp" xml:space="preserve">
|
||||
<value>轉入</value>
|
||||
<value />
|
||||
</data>
|
||||
<data name="Notimplementation" xml:space="preserve">
|
||||
<value>未執行</value>
|
||||
|
||||
+13
-13
@@ -426,30 +426,30 @@ namespace DyeingComputer.UserClass
|
||||
{
|
||||
try
|
||||
{
|
||||
DataTable Dyelot_dat;
|
||||
Dyelot_dat = SerializeConvert.JsonDeserializeFromString<DataTable>(SYSDAT);
|
||||
Dictionary<string, object> Dyelot_dat;
|
||||
Dyelot_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(SYSDAT);
|
||||
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
Dictionary<string, object> Product_data = new Dictionary<string, object>();//缓存函数
|
||||
for (int i=0;i<=Dyelot_dat.Rows.Count;i++)
|
||||
{
|
||||
DataRow drEmployee = Dyelot_dat.Rows[i];
|
||||
Product_data.Add("State", drEmployee.Field<int>("State"));
|
||||
Product_data.Add("Amount", drEmployee.Field<float>("Amount"));
|
||||
Product_data.Add("DispenseEndTime", drEmployee.Field<string>("DispenseEndTime"));
|
||||
|
||||
SQLiteHelpers.Update("Dyelot", Product_data, "Dyelot ='" + drEmployee.Field<string>("Dyelot")
|
||||
+ "' AND Step ='"+ drEmployee.Field<int>("Step") + "' AND ProductCode='"+
|
||||
drEmployee.Field<string>("ProductCode") + "'", null);
|
||||
Product_data.Add("State", Dyelot_dat.GetValue("State"));
|
||||
if (Dyelot_dat.GetValue("State").ToString() == "301")
|
||||
{
|
||||
Product_data.Add("Amount", Dyelot_dat.GetValue("Amount"));
|
||||
Product_data.Add("DispenseEndTime", Dyelot_dat.GetValue("DispenseEndTime"));
|
||||
}
|
||||
SQLiteHelpers.Update("Dyelot", Product_data, "Dyelot ='" + Dyelot_dat.GetValue("Dyelot")
|
||||
+ "' AND Step ='" + Dyelot_dat.GetValue("Step") + "' AND ProductCode='" +
|
||||
Dyelot_dat.GetValue("ProductCode") + "'", null);
|
||||
Product_data.Clear();
|
||||
MainWindowViewModel.Dyelot_dat = SQLiteHelpers.ExecuteDataSet(
|
||||
"select * from Dyelot where WorkOrder = '" +
|
||||
MainWindowViewModel.WorkNumder + "'", null).Tables[0];
|
||||
int dt = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where Dyelot='" +
|
||||
drEmployee.Field<string>("Dyelot") + "' AND State ='201'", null).Tables[0].Rows.Count;
|
||||
Dyelot_dat.GetValue("Dyelot") + "' AND State ='201'", null).Tables[0].Rows.Count;
|
||||
if (dt == 0) MainWindowViewModel.CALL_FR = false;
|
||||
}
|
||||
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
client.SendAsync("SC828" + SYSKEY + SYSDAT);
|
||||
|
||||
|
||||
@@ -565,6 +565,7 @@ namespace DyeingComputer.ViewModel
|
||||
if (TX_t != TX) { _Link_bool = true; TX_t = TX; } else { _Link_bool = false; TX_t = TX; } //中央连接状态判断
|
||||
if(WORK_RUN !=0) Chart();//写入记录
|
||||
if(!UserButton) TechnologicalProcess_view();//刷新步骤页面
|
||||
FeedingRecords_inf();
|
||||
|
||||
if ((Selet_dtm("1025") > 0) && (Selet_dtd("3021") || Selet_dtd("3022")))
|
||||
{
|
||||
@@ -1746,7 +1747,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK1 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK1 = Resources.CallDistribution;
|
||||
TANK1_REDYE = SYS_REDYE;
|
||||
if(string.IsNullOrEmpty(TANK1_DYELOT)) TANK1_DYELOT = WorkNumder.ToString();
|
||||
TANK1_STEP =Convert.ToInt16(STEP_P3);
|
||||
@@ -1761,7 +1761,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK2 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK2 = Resources.CallDistribution;
|
||||
TANK2_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK2_DYELOT)) TANK2_DYELOT = WorkNumder.ToString();
|
||||
TANK2_STEP = Convert.ToInt16(STEP_P3);
|
||||
@@ -1776,7 +1775,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK3 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK3 = Resources.CallDistribution;
|
||||
TANK3_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK3_DYELOT)) TANK3_DYELOT = WorkNumder.ToString();
|
||||
TANK3_STEP = Convert.ToInt16(STEP_P3);
|
||||
@@ -2237,7 +2235,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK1 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK1 = Resources.CallDistribution;
|
||||
TANK1_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK1_DYELOT)) TANK1_DYELOT = WorkNumder.ToString();
|
||||
TANK1_STEP = Convert.ToInt16(STEP_P3p1);
|
||||
@@ -2251,7 +2248,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK2 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK2 = Resources.CallDistribution;
|
||||
TANK2_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK2_DYELOT)) TANK2_DYELOT = WorkNumder.ToString();
|
||||
TANK2_STEP = Convert.ToInt16(STEP_P3p1);
|
||||
@@ -2265,7 +2261,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK3 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK3 = Resources.CallDistribution;
|
||||
TANK3_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK3_DYELOT)) TANK3_DYELOT = WorkNumder.ToString();
|
||||
TANK3_STEP = Convert.ToInt16(STEP_P3p1);
|
||||
@@ -2496,7 +2491,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK1 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK1 = Resources.CallDistribution;
|
||||
TANK1_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK1_DYELOT)) TANK1_DYELOT = WorkNumder.ToString();
|
||||
TANK1_STEP = Convert.ToInt16(STEP_P3p2);
|
||||
@@ -2510,7 +2504,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK2 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK2 = Resources.CallDistribution;
|
||||
TANK2_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK2_DYELOT)) TANK2_DYELOT = WorkNumder.ToString();
|
||||
TANK2_STEP = Convert.ToInt16(STEP_P3p2);
|
||||
@@ -2524,7 +2517,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK3 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK3 = Resources.CallDistribution;
|
||||
TANK3_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK3_DYELOT)) TANK3_DYELOT = WorkNumder.ToString();
|
||||
TANK3_STEP = Convert.ToInt16(STEP_P3p2);
|
||||
@@ -2755,7 +2747,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK1 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK1 = Resources.CallDistribution;
|
||||
TANK1_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK1_DYELOT)) TANK1_DYELOT = WorkNumder.ToString();
|
||||
TANK1_STEP = Convert.ToInt16(STEP_P3p3);
|
||||
@@ -2769,7 +2760,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK2 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK2 = Resources.CallDistribution;
|
||||
TANK2_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK2_DYELOT)) TANK2_DYELOT = WorkNumder.ToString();
|
||||
TANK2_STEP = Convert.ToInt16(STEP_P3p3);
|
||||
@@ -2783,7 +2773,6 @@ namespace DyeingComputer.ViewModel
|
||||
TANK3 = "High Water Level";
|
||||
return;
|
||||
}
|
||||
TANK3 = Resources.CallDistribution;
|
||||
TANK3_REDYE = SYS_REDYE;
|
||||
if (string.IsNullOrEmpty(TANK3_DYELOT)) TANK3_DYELOT = WorkNumder.ToString();
|
||||
TANK3_STEP = Convert.ToInt16(STEP_P3p3);
|
||||
@@ -2875,6 +2864,36 @@ namespace DyeingComputer.ViewModel
|
||||
STEP + "' AND Redye ='" + SYS_REDYE + "'", null);//行更新
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
}
|
||||
void FeedingRecords_inf()
|
||||
{
|
||||
for (int i = 0; Dyelot_dat.Rows.Count > i; i++)
|
||||
{
|
||||
if (Dyelot_dat.Rows[i]["State"].ToString() == "201")
|
||||
{
|
||||
if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "1")&&(Dyelot_dat.Rows[i]["Step"].ToString() == TANK1_STEP.ToString())) TANK1 = Resources.CallDistribution;
|
||||
else if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "2") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK2_STEP.ToString())) TANK2 = Resources.CallDistribution;
|
||||
else if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "3") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK3_STEP.ToString())) TANK3 = Resources.CallDistribution;
|
||||
}
|
||||
else if (Dyelot_dat.Rows[i]["State"].ToString() == "202")
|
||||
{
|
||||
if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "1") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK1_STEP.ToString())) TANK1 = Resources.LineUp;
|
||||
else if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "2") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK2_STEP.ToString())) TANK2 = Resources.LineUp;
|
||||
else if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "3") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK3_STEP.ToString())) TANK3 = Resources.LineUp;
|
||||
}
|
||||
else if (Dyelot_dat.Rows[i]["State"].ToString() == "301")
|
||||
{
|
||||
if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "1") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK1_STEP.ToString())) TANK1 = Resources.Finish;
|
||||
else if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "2") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK2_STEP.ToString())) TANK2 = Resources.Finish;
|
||||
else if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "3") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK3_STEP.ToString())) TANK3 = Resources.Finish;
|
||||
}
|
||||
else if (Dyelot_dat.Rows[i]["State"].ToString() == "309")
|
||||
{
|
||||
if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "1") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK1_STEP.ToString())) TANK1 = Resources.Abnormal;
|
||||
else if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "2") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK2_STEP.ToString())) TANK2 = Resources.Abnormal;
|
||||
else if ((Dyelot_dat.Rows[i]["Tank"].ToString() == "3") && (Dyelot_dat.Rows[i]["Step"].ToString() == TANK3_STEP.ToString())) TANK3 = Resources.Abnormal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static SerialPort port = new SerialPort();//创建串口
|
||||
static ModbusFactory factory = new ModbusFactory();
|
||||
|
||||
Reference in new issue
Block a user