编辑页面子功能错误修复,呼叫功能添加
This commit is contained in:
commit
7d88a1887c
10 files changed
+328
-72
No files matched your search
Generated
+9
@@ -645,6 +645,15 @@ namespace DyeingComputer.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Inspect 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Inspect {
|
||||
get {
|
||||
return ResourceManager.GetString("Inspect", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Invalid features 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -588,4 +588,7 @@
|
||||
<data name="Subroutine" xml:space="preserve">
|
||||
<value>Subroutine</value>
|
||||
</data>
|
||||
<data name="Inspect" xml:space="preserve">
|
||||
<value>Waiting For Check</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -588,4 +588,7 @@
|
||||
<data name="Subroutine" xml:space="preserve">
|
||||
<value>Subroutine</value>
|
||||
</data>
|
||||
<data name="Inspect" xml:space="preserve">
|
||||
<value>Inspect</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -286,10 +286,10 @@
|
||||
<value>加注</value>
|
||||
</data>
|
||||
<data name="CallDistribution" xml:space="preserve">
|
||||
<value>呼叫输送</value>
|
||||
<value>呼叫輸送</value>
|
||||
</data>
|
||||
<data name="CallPreparation" xml:space="preserve">
|
||||
<value>呼叫准备</value>
|
||||
<value>等待輸送</value>
|
||||
</data>
|
||||
<data name="CallWorkers" xml:space="preserve">
|
||||
<value>呼叫操作员</value>
|
||||
@@ -588,4 +588,7 @@
|
||||
<data name="Subroutine" xml:space="preserve">
|
||||
<value>副功能</value>
|
||||
</data>
|
||||
<data name="Inspect" xml:space="preserve">
|
||||
<value>等待检查</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -289,7 +289,7 @@
|
||||
<value>呼叫輸送</value>
|
||||
</data>
|
||||
<data name="CallPreparation" xml:space="preserve">
|
||||
<value>呼叫準備</value>
|
||||
<value>等待輸送</value>
|
||||
</data>
|
||||
<data name="CallWorkers" xml:space="preserve">
|
||||
<value>呼叫操作員</value>
|
||||
@@ -588,4 +588,7 @@
|
||||
<data name="Subroutine" xml:space="preserve">
|
||||
<value>副功能</value>
|
||||
</data>
|
||||
<data name="Inspect" xml:space="preserve">
|
||||
<value>等待檢查</value>
|
||||
</data>
|
||||
</root>
|
||||
+33
-9
@@ -16,6 +16,7 @@ namespace DyeingComputer.UserClass
|
||||
{
|
||||
private static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||
private readonly static string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
||||
|
||||
//WorkOrder表检查写入
|
||||
public static bool WorkOrder(string WorkOrder, string ProgramName, string StartTime, string EndTime, string Time, string Remark,string lock_,string state,string ProgramID, string color,string dyelot)
|
||||
{
|
||||
@@ -113,16 +114,39 @@ namespace DyeingComputer.UserClass
|
||||
|
||||
public static bool Dyelot(DataTable Dyelot_)//领料单
|
||||
{
|
||||
DataTable DyelotTable = new DataTable();
|
||||
DyelotTable.Columns.Add("WorkOrder", Type.GetType("System.String"));
|
||||
DyelotTable.Columns.Add("Dyelot", Type.GetType("System.String"));
|
||||
DyelotTable.Columns.Add("Redye", Type.GetType("System.Int"));
|
||||
DyelotTable.Columns.Add("Step", Type.GetType("System.Int"));
|
||||
DyelotTable.Columns.Add("Tank", Type.GetType("System.Int"));
|
||||
DyelotTable.Columns.Add("State", Type.GetType("System.Int"));
|
||||
DyelotTable.Columns.Add("Machine", Type.GetType("System.String"));
|
||||
DyelotTable.Columns.Add("ProductCode", Type.GetType("System.String"));
|
||||
DyelotTable.Columns.Add("ProductName", Type.GetType("System.String"));
|
||||
DyelotTable.Columns.Add("ProductType", Type.GetType("System.Int"));
|
||||
DyelotTable.Columns.Add("Grams", Type.GetType("System.Double"));
|
||||
DyelotTable.Columns.Add("Amount", Type.GetType("System.Double"));
|
||||
string[] columnsToCopy = { "WorkOrder", "Dyelot", "Redye", "Step", "Tank", "State", "Machine",
|
||||
"ProductCode", "ProductName", "ProductType", "Grams", "Amount"};
|
||||
foreach (DataRow sourceRow in Dyelot_.Rows)
|
||||
{
|
||||
DataRow newRow = DyelotTable.NewRow();
|
||||
foreach (string colName in columnsToCopy)
|
||||
{
|
||||
if (Dyelot_.Columns.Contains(colName))
|
||||
{
|
||||
newRow[colName] = sourceRow[colName];
|
||||
}
|
||||
}
|
||||
DyelotTable.Rows.Add(newRow);
|
||||
}
|
||||
DataTable data_t = DyelotTable.Clone();
|
||||
int a = DyelotTable.Rows.Count;
|
||||
if (a < 1) return false;
|
||||
string Dyelot = DyelotTable.Rows[0][0].ToString();
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
DataTable data_t = Dyelot_.Clone();
|
||||
int a = Dyelot_.Rows.Count;
|
||||
if (a < 1)
|
||||
{
|
||||
SQLiteHelpers.Close();
|
||||
return false;
|
||||
}
|
||||
string Dyelot = Dyelot_.Rows[0][0].ToString();
|
||||
object n = SQLiteHelpers.ExecuteScalar("select * from Dyelot where Dyelot = " + Dyelot, null);
|
||||
if (n != null)//如id存在着返回错误状态
|
||||
{
|
||||
@@ -133,7 +157,7 @@ namespace DyeingComputer.UserClass
|
||||
{
|
||||
data_t.Clear();//清空
|
||||
DataRow dr = data_t.NewRow();
|
||||
dr.ItemArray = Dyelot_.Rows[i].ItemArray;
|
||||
dr.ItemArray = DyelotTable.Rows[i].ItemArray;
|
||||
data_t.Rows.InsertAt(dr, 0);
|
||||
SQLiteHelpers.InsertData("Dyelot", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||
}
|
||||
|
||||
@@ -195,8 +195,8 @@
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.Columns>
|
||||
<!--列信息绑定-->
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding Step}" Width="30"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="50" >
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding Step}" Width="80"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="80" >
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Text" Value="{Binding Path=State,Converter={StaticResource StatenConvert}}"/>
|
||||
|
||||
@@ -252,7 +252,8 @@ namespace DyeingComputer.View
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
string sql_script = "select * from Dyelot where WorkOrder = '" + MainWindowViewModel.WorkNumder + "'";
|
||||
Receip.ItemsSource = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0].DefaultView; //转换显示
|
||||
MainWindowViewModel.Dyelot_dat = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0]; //转换显示
|
||||
Receip.ItemsSource = MainWindowViewModel.Dyelot_dat.DefaultView;
|
||||
SQLiteHelpers.Close(); //关闭连接
|
||||
}
|
||||
private void ParameterSet_Click(object sender, RoutedEventArgs e)//参数
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
@@ -38,6 +39,7 @@ using static DyeingComputer.ViewModel.MainWindowViewModel;
|
||||
using static DyeingComputer.Windows.ViewStep;
|
||||
using static System.Net.WebRequestMethods;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
|
||||
|
||||
|
||||
namespace DyeingComputer.ViewModel
|
||||
@@ -76,6 +78,7 @@ namespace DyeingComputer.ViewModel
|
||||
private PID pid = new PID();
|
||||
public static DataTable errTabler = new DataTable();//错误表
|
||||
public static DataTable RUN_DATATABLE = new DataTable();//缓存工作表
|
||||
public static DataTable Dyelot_dat = new DataTable();//物料表
|
||||
public static int RUN_STEPID;//当前步骤
|
||||
public static int SYS_REDYE=0;//当前重燃步
|
||||
public static string SYSKEY;
|
||||
@@ -84,6 +87,7 @@ namespace DyeingComputer.ViewModel
|
||||
public static int UserInfoStart = 900;
|
||||
public static string UserInfo;
|
||||
public static bool UserCall_OK = false;
|
||||
uint TX_t;//中央连接状态判断
|
||||
public ICommand ProgramgroupView_stop { get; }
|
||||
bool _isInteractive;
|
||||
public bool IsInteractive//步骤表交互选择
|
||||
@@ -314,6 +318,18 @@ namespace DyeingComputer.ViewModel
|
||||
public static int SM01;//副缸
|
||||
public static int SM02;//副缸
|
||||
public static int SM03;//副缸
|
||||
public static string SK01;
|
||||
public static string SK02;
|
||||
public static string SK03;
|
||||
public static string SK04;
|
||||
public static string SK05;
|
||||
public static string SK06;
|
||||
public static string SK07;
|
||||
public static string SK08;
|
||||
public static string SK09;
|
||||
public static string SK10;
|
||||
public static string SK11;
|
||||
public static string SK12;
|
||||
public int MI01;//布轮信息
|
||||
public int MI02;//喷射流量信息
|
||||
public int MI03;//动态压力
|
||||
@@ -321,6 +337,19 @@ namespace DyeingComputer.ViewModel
|
||||
private double MS01;//1缸温度偏差
|
||||
private double MS02;//2缸温度偏差
|
||||
private double MS03;//3缸温度偏差
|
||||
public int MS04;
|
||||
public int MS05;
|
||||
public int MS06;
|
||||
public int MS07;
|
||||
public int MS08;
|
||||
public int MS09;
|
||||
public int MS10;
|
||||
public int MS11;
|
||||
public int MS12;
|
||||
public int MS13;
|
||||
public int MS14;
|
||||
public int MS15;
|
||||
private double MS16;//
|
||||
public int MS17;//副缸
|
||||
public int MS18;//副缸
|
||||
public int MS19;//副缸
|
||||
@@ -360,6 +389,19 @@ namespace DyeingComputer.ViewModel
|
||||
MS01 = Convert.ToDouble(Selet_con("MS01"));
|
||||
MS02 = Convert.ToDouble(Selet_con("MS02"));
|
||||
MS03 = Convert.ToDouble(Selet_con("MS03"));
|
||||
MS04 = Convert.ToInt16(Selet_con("MS04"));
|
||||
MS05 = Convert.ToInt16(Selet_con("MS05"));
|
||||
MS06 = Convert.ToInt16(Selet_con("MS06"));
|
||||
MS07 = Convert.ToInt16(Selet_con("MS07"));
|
||||
MS08 = Convert.ToInt16(Selet_con("MS08"));
|
||||
MS09 = Convert.ToInt16(Selet_con("MS09"));
|
||||
MS10 = Convert.ToInt16(Selet_con("MS10"));
|
||||
MS11 = Convert.ToInt16(Selet_con("MS11"));
|
||||
MS12 = Convert.ToInt16(Selet_con("MS12"));
|
||||
MS13 = Convert.ToInt16(Selet_con("MS13"));
|
||||
MS14 = Convert.ToInt16(Selet_con("MS14"));
|
||||
MS15 = Convert.ToInt16(Selet_con("MS15"));
|
||||
MS16 = Convert.ToDouble(Selet_con("MS16"));
|
||||
MS17 = Convert.ToInt16(Selet_con("MS17"));
|
||||
MS18 = Convert.ToInt16(Selet_con("MS18"));
|
||||
MS19 = Convert.ToInt16(Selet_con("MS19"));
|
||||
@@ -380,7 +422,18 @@ namespace DyeingComputer.ViewModel
|
||||
SM02 = Convert.ToInt16(Selet_sys("SM02"));//FG
|
||||
SM03 = Convert.ToInt16(Selet_sys("SM03"));//FG
|
||||
|
||||
SK5 = Selet_sys("SK5");//
|
||||
SK01 = Selet_sys("SK01");
|
||||
SK02 = Selet_sys("SK02");
|
||||
SK03 = Selet_sys("SK03");
|
||||
SK04 = Selet_sys("SK04");
|
||||
SK05 = Selet_sys("SK05");
|
||||
SK06 = Selet_sys("SK06");
|
||||
SK07 = Selet_sys("SK07");
|
||||
SK08 = Selet_sys("SK08");
|
||||
SK09 = Selet_sys("SK09");
|
||||
SK10 = Selet_sys("SK10");
|
||||
SK11 = Selet_sys("SK11");
|
||||
SK12 = Selet_sys("SK12");
|
||||
}
|
||||
private void ProgramgroupView_run_()////运行/暂停
|
||||
{
|
||||
@@ -502,7 +555,6 @@ namespace DyeingComputer.ViewModel
|
||||
if (Selet_dtd("2016")) { ERRinf.ERRinf_w(errTabler, Resources.Fault + ":" + Resources.Pump + "-3", "ERR104-3"); } //加料泵
|
||||
else { ERRinf.ERRinf_d(errTabler, "ERR104-3"); }
|
||||
}
|
||||
uint TX_t;
|
||||
void Tick_Event_5S()//Tick_Event周期执行事件5S
|
||||
{
|
||||
if (TX_t != TX) { _Link_bool = true; TX_t = TX; } else { _Link_bool = false; TX_t = TX; } //中央连接状态判断
|
||||
@@ -623,7 +675,6 @@ namespace DyeingComputer.ViewModel
|
||||
if (timer5s_ >=10) { timer5s_ = 0; Tick_Event_5S(); }
|
||||
if (LINK_OK) IO_data();
|
||||
}
|
||||
|
||||
void Chart()
|
||||
{
|
||||
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
||||
@@ -1685,6 +1736,12 @@ namespace DyeingComputer.ViewModel
|
||||
case "066":
|
||||
if (STEP_P1 == 1)
|
||||
{
|
||||
if (SK10 == "1" && (Convert.ToInt16(Selet_dtm("1017")) < MS06))
|
||||
{
|
||||
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);
|
||||
@@ -1694,6 +1751,12 @@ namespace DyeingComputer.ViewModel
|
||||
} //药缸1
|
||||
else if (STEP_P1 == 2)
|
||||
{
|
||||
if (SK11 == "1" && (Convert.ToInt16(Selet_dtm("1018")) < MS10))
|
||||
{
|
||||
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);
|
||||
@@ -1703,6 +1766,12 @@ namespace DyeingComputer.ViewModel
|
||||
}//药缸2
|
||||
else if (STEP_P1 == 3)
|
||||
{
|
||||
if (SK12 == "1" && (Convert.ToInt16(Selet_dtm("1019")) < MS14))
|
||||
{
|
||||
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);
|
||||
@@ -1713,8 +1782,85 @@ namespace DyeingComputer.ViewModel
|
||||
//STEP_finish = true;
|
||||
break;//呼叫输送
|
||||
case "067":
|
||||
|
||||
STEP_finish = true;
|
||||
double gram = 0;
|
||||
if (STEP_P1 == 1)
|
||||
{
|
||||
DataRow[] rowdat = Dyelot_dat.Select("Step ='" + TANK1_STEP + "'");//行
|
||||
if (rowdat.First().Field<int>("Amount") != 301)//等待输送
|
||||
{
|
||||
TANK1 = Resources.CallPreparation;
|
||||
return;
|
||||
}
|
||||
if (SK07 == "1")//需要确认
|
||||
{
|
||||
foreach (DataRow row in rowdat)//删除指定信息行
|
||||
{
|
||||
gram += row.Field<double>("Amount");
|
||||
row.Delete();
|
||||
row.AcceptChanges();
|
||||
}
|
||||
gram = gram / 1000;
|
||||
if (gram > Convert.ToInt16(Selet_dtm("1017")))//等待确认
|
||||
{
|
||||
TANK1 = Resources.Inspect;
|
||||
return;
|
||||
}
|
||||
}
|
||||
TANK1 = Resources.Finish;
|
||||
STEP_finish = true;
|
||||
} //药缸1
|
||||
else if (STEP_P1 == 2)
|
||||
{
|
||||
DataRow[] rowdat = Dyelot_dat.Select("Step ='" + TANK2_STEP + "'");//行
|
||||
if (rowdat.First().Field<int>("Amount") != 301)
|
||||
{
|
||||
TANK1 = Resources.CallPreparation;
|
||||
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;
|
||||
}//药缸2
|
||||
else if (STEP_P1 == 3)
|
||||
{
|
||||
DataRow[] rowdat = Dyelot_dat.Select("Step ='" + TANK3_STEP + "'");//行
|
||||
if (rowdat.First().Field<int>("Amount") != 301)
|
||||
{
|
||||
TANK1 = Resources.CallPreparation;
|
||||
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;
|
||||
}//药缸3
|
||||
break;//等待输送
|
||||
case "090":
|
||||
if (((STEP_P1-1)<Selet_dtm("1010"))&&(Selet_dtm("1010") < (STEP_P1+1))) PH_start = true;//达到温度开始ph控制
|
||||
@@ -1849,21 +1995,21 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
if (!String.IsNullOrEmpty((string)arrRows[0]["StepID_S2"]))
|
||||
{
|
||||
STEP_IDp1 = (string)arrRows[0]["StepID_S2"];
|
||||
STEP_P1p1 = (double)arrRows[0]["Parameter1_S2"];
|
||||
STEP_P2p1 = (double)arrRows[0]["Parameter2_S2"];
|
||||
STEP_P3p1 = (double)arrRows[0]["Parameter3_S2"];
|
||||
STEP_P4p1 = (double)arrRows[0]["Parameter4_S2"];
|
||||
STEP_P5p1 = (double)arrRows[0]["Parameter5_S2"];
|
||||
STEP_IDp2 = (string)arrRows[0]["StepID_S2"];
|
||||
STEP_P1p2 = (double)arrRows[0]["Parameter1_S2"];
|
||||
STEP_P2p2 = (double)arrRows[0]["Parameter2_S2"];
|
||||
STEP_P3p2 = (double)arrRows[0]["Parameter3_S2"];
|
||||
STEP_P4p2 = (double)arrRows[0]["Parameter4_S2"];
|
||||
STEP_P5p2 = (double)arrRows[0]["Parameter5_S2"];
|
||||
}
|
||||
if (!String.IsNullOrEmpty((string)arrRows[0]["StepID_S2"]))
|
||||
{
|
||||
STEP_IDp1 = (string)arrRows[0]["StepID_S3"];
|
||||
STEP_P1p1 = (double)arrRows[0]["Parameter1_S3"];
|
||||
STEP_P2p1 = (double)arrRows[0]["Parameter2_S3"];
|
||||
STEP_P3p1 = (double)arrRows[0]["Parameter3_S3"];
|
||||
STEP_P4p1 = (double)arrRows[0]["Parameter4_S3"];
|
||||
STEP_P5p1 = (double)arrRows[0]["Parameter5_S3"];
|
||||
STEP_IDp3 = (string)arrRows[0]["StepID_S3"];
|
||||
STEP_P1p3 = (double)arrRows[0]["Parameter1_S3"];
|
||||
STEP_P2p3 = (double)arrRows[0]["Parameter2_S3"];
|
||||
STEP_P3p3 = (double)arrRows[0]["Parameter3_S3"];
|
||||
STEP_P4p3 = (double)arrRows[0]["Parameter4_S3"];
|
||||
STEP_P5p3 = (double)arrRows[0]["Parameter5_S3"];
|
||||
}
|
||||
|
||||
APILog.LOGlog(WorkNumder.ToString(), "Process", "Next", "STEP = " + RUN_STEPID + ";StepID=" +
|
||||
@@ -1904,8 +2050,13 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
}
|
||||
}
|
||||
/**z子功能**/
|
||||
void STEP_RUN_slave_stop() { }
|
||||
/**子功能**/
|
||||
void STEP_RUN_slave_stop()
|
||||
{
|
||||
STEP_IDp1 = "";
|
||||
STEP_IDp2 = "";
|
||||
STEP_IDp3 = "";
|
||||
}
|
||||
void STEP_RUN_slave()
|
||||
{
|
||||
if (WORK_RUN == 2)
|
||||
@@ -2076,6 +2227,12 @@ namespace DyeingComputer.ViewModel
|
||||
case "066":
|
||||
if (STEP_P1p1 == 1)
|
||||
{
|
||||
if (SK10 == "1" && (Convert.ToInt16(Selet_dtm("1017")) < MS06))
|
||||
{
|
||||
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);
|
||||
@@ -2084,6 +2241,12 @@ namespace DyeingComputer.ViewModel
|
||||
} //药缸1
|
||||
else if (STEP_P1p1 == 2)
|
||||
{
|
||||
if (SK11 == "1" && (Convert.ToInt16(Selet_dtm("1018")) < MS10))
|
||||
{
|
||||
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);
|
||||
@@ -2092,6 +2255,12 @@ namespace DyeingComputer.ViewModel
|
||||
}//药缸2
|
||||
else if (STEP_P1p1 == 3)
|
||||
{
|
||||
if (SK12 == "1" && (Convert.ToInt16(Selet_dtm("1019")) < MS14))
|
||||
{
|
||||
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);
|
||||
@@ -2317,6 +2486,12 @@ namespace DyeingComputer.ViewModel
|
||||
case "066":
|
||||
if (STEP_P1p2 == 1)
|
||||
{
|
||||
if (SK10 == "1" && (Convert.ToInt16(Selet_dtm("1017")) < MS06))
|
||||
{
|
||||
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);
|
||||
@@ -2325,6 +2500,12 @@ namespace DyeingComputer.ViewModel
|
||||
} //药缸1
|
||||
else if (STEP_P1p2 == 2)
|
||||
{
|
||||
if (SK11 == "1" && (Convert.ToInt16(Selet_dtm("1018")) < MS10))
|
||||
{
|
||||
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);
|
||||
@@ -2333,6 +2514,12 @@ namespace DyeingComputer.ViewModel
|
||||
}//药缸2
|
||||
else if (STEP_P1p2 == 3)
|
||||
{
|
||||
if (SK12 == "1" && (Convert.ToInt16(Selet_dtm("1019")) < MS14))
|
||||
{
|
||||
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);
|
||||
@@ -2558,6 +2745,12 @@ namespace DyeingComputer.ViewModel
|
||||
case "066":
|
||||
if (STEP_P1p3 == 1)
|
||||
{
|
||||
if (SK10 == "1" && (Convert.ToInt16(Selet_dtm("1017")) < MS06))
|
||||
{
|
||||
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);
|
||||
@@ -2566,6 +2759,12 @@ namespace DyeingComputer.ViewModel
|
||||
} //药缸1
|
||||
else if (STEP_P1p3 == 2)
|
||||
{
|
||||
if (SK11 == "1" && (Convert.ToInt16(Selet_dtm("1018")) < MS10))
|
||||
{
|
||||
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);
|
||||
@@ -2574,6 +2773,12 @@ namespace DyeingComputer.ViewModel
|
||||
}//药缸2
|
||||
else if (STEP_P1p3 == 3)
|
||||
{
|
||||
if (SK12 == "1" && (Convert.ToInt16(Selet_dtm("1019")) < MS14))
|
||||
{
|
||||
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);
|
||||
@@ -2636,7 +2841,6 @@ namespace DyeingComputer.ViewModel
|
||||
}
|
||||
}
|
||||
public static bool CALL_FR = false;//呼叫状态
|
||||
string SK5;
|
||||
void FeedingRecords(string WorkOrder,string Dyelot,int TANK,int STEP,int Type) //呼叫输送
|
||||
{
|
||||
CALL_FR = true;
|
||||
@@ -2650,7 +2854,7 @@ namespace DyeingComputer.ViewModel
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
|
||||
if (SK5 == "1")//是否检查原料类型
|
||||
if (SK05 == "1")//是否检查原料类型
|
||||
{
|
||||
SQLI = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where " +
|
||||
"Dyelot = '" + Dyelot + "' AND Step = '" + STEP + "' AND Redye ='" + SYS_REDYE +
|
||||
@@ -2660,7 +2864,7 @@ namespace DyeingComputer.ViewModel
|
||||
{
|
||||
SQLI = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where " +
|
||||
"Dyelot = '" + Dyelot + "' AND Step = '" + STEP + "' AND Redye ='" + SYS_REDYE +
|
||||
"' AND State = '101'", null).Tables[0].Rows.Count;
|
||||
"'", null).Tables[0].Rows.Count;
|
||||
}
|
||||
if (SQLI > 0) SQLiteHelpers.Update("Dyelot", dat_FR, "Dyelot = '" + Dyelot + "' AND Step = '" +
|
||||
STEP + "' AND Redye ='" + SYS_REDYE + "'", null);//行更新
|
||||
@@ -2819,25 +3023,36 @@ namespace DyeingComputer.ViewModel
|
||||
if (MT18 >= 11) SYSlog = SYSlog + " | " + "11 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1056")));
|
||||
if (MT18 >= 12) SYSlog = SYSlog + " | " + "12 : " + string.Format("{0:D3}", Convert.ToInt16(Selet_dtm("1058")));
|
||||
}//布轮信息
|
||||
|
||||
SYSlog = SYSlog + "\n-------------------------------------------------------";
|
||||
if (SM01 == 1)
|
||||
{
|
||||
SYSlog = SYSlog + "\n" + Resources.Medicine + Resources.Tank + "1 => [" + Resources.WaterLevel + ":" + string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1017"))) + "L][" + Resources.Temperature + ":" + string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1012"))) + "°C]";
|
||||
SYSlog = SYSlog + "\n" + Resources.Dyelot + " : " + TANK1_DYELOT + "_" + TANK1_REDYE + " => " + TANK1_STEP;
|
||||
SYSlog = SYSlog + "\n" + Resources.Medicine + Resources.Tank + "1 [" + Resources.WaterLevel + ":" +
|
||||
string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1017"))) + "L][" + Resources.Temperature + ":" +
|
||||
string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1012"))) + "°C]";
|
||||
SYSlog = SYSlog + "\n" + Resources.Dyelot + ": " + TANK1_DYELOT + "_" + TANK1_REDYE;
|
||||
SYSlog = SYSlog + "\n" + Resources.Step + ": " + TANK1_STEP;
|
||||
SYSlog = SYSlog + "\n" + Resources.WorkingStatus + " : " + TANK1;
|
||||
SYSlog = SYSlog + "\n-------------------------------------------------------";
|
||||
}//附缸1
|
||||
if (SM02 == 1)
|
||||
{
|
||||
SYSlog = SYSlog + "\n" + Resources.Medicine + Resources.Tank + "2 => [" + Resources.WaterLevel + ":" + string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1018"))) + "L][" + Resources.Temperature + ":" + string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1013"))) + "°C]";
|
||||
SYSlog = SYSlog + "\n" + Resources.Dyelot + " : " + TANK2_DYELOT + "_" + TANK1_REDYE + " => " + TANK2_STEP;
|
||||
SYSlog = SYSlog + "\n" + Resources.Medicine + Resources.Tank + "2 [" + Resources.WaterLevel + ":" +
|
||||
string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1018"))) + "L][" + Resources.Temperature + ":" +
|
||||
string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1013"))) + "°C]";
|
||||
SYSlog = SYSlog + "\n" + Resources.Dyelot + ": " + TANK2_DYELOT + "_" + TANK1_REDYE;
|
||||
SYSlog = SYSlog + "\n" + Resources.Step + ": " + TANK2_STEP;
|
||||
SYSlog = SYSlog + "\n" + Resources.WorkingStatus + " : " + TANK2;
|
||||
SYSlog = SYSlog + "\n-------------------------------------------------------";
|
||||
}//附缸2
|
||||
if (SM03 == 1)
|
||||
{
|
||||
SYSlog = SYSlog + "\n" + Resources.Medicine + Resources.Tank + "3 => [" + Resources.WaterLevel + ":" + string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1019"))) + "L][" + Resources.Temperature + ":" + string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1014"))) + "°C]";
|
||||
SYSlog = SYSlog + "\n" + Resources.Dyelot + " : " + TANK3_DYELOT + "_" + TANK1_REDYE + " => " + TANK3_STEP;
|
||||
SYSlog = SYSlog + "\n" + Resources.Medicine + Resources.Tank + "3 [" + Resources.WaterLevel + ":" +
|
||||
string.Format("{0:D4}", Convert.ToInt16(Selet_dtm("1019"))) + "L][" + Resources.Temperature + ":" +
|
||||
string.Format(" {0:###.#}", Convert.ToInt16(Selet_dtm("1014"))) + "°C]";
|
||||
SYSlog = SYSlog + "\n" + Resources.Dyelot + ": " + TANK3_DYELOT + "_" + TANK1_REDYE;
|
||||
SYSlog = SYSlog + "\n" + Resources.Step + ": " + TANK3_STEP;
|
||||
SYSlog = SYSlog + "\n" + Resources.WorkingStatus + " : " + TANK3;
|
||||
SYSlog = SYSlog + "\n-------------------------------------------------------";
|
||||
}//附缸3
|
||||
|
||||
Sys_log = SYSlog;
|
||||
@@ -2852,6 +3067,9 @@ namespace DyeingComputer.ViewModel
|
||||
public static DataTable dt_TP_S3 = new DataTable();
|
||||
public static DataTable dt_ParameterSet = new DataTable();
|
||||
public static DataTable dt_SysSet = new DataTable();
|
||||
public static object D_view = true;
|
||||
public static object A_view = true;
|
||||
public static bool User_Button = false;
|
||||
public static void SQL_data()//获得io表
|
||||
{
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
@@ -2925,10 +3143,6 @@ namespace DyeingComputer.ViewModel
|
||||
for (ushort i = 0; i < DW_L; i++) { DW[i] = Convert.ToUInt16(Seplc_dta((i + 5001).ToString())); }
|
||||
});
|
||||
}
|
||||
|
||||
public static object D_view=true;
|
||||
public static object A_view=true;
|
||||
public static bool User_Button = false;
|
||||
public void IO_view()//IO显示
|
||||
{
|
||||
if (ViewID == 5)
|
||||
|
||||
+20
-24
@@ -253,15 +253,15 @@ namespace DyeingComputer.Windows
|
||||
dat_D.BeginEdit();
|
||||
if (dat_P == 1)
|
||||
{
|
||||
dat_D["Parameter1_S1"] = Convert.ToDouble(P2P.Text);
|
||||
dat_D["Parameter2_S1"] = Convert.ToDouble(P2P.Text);
|
||||
}
|
||||
else if (dat_P == 2)
|
||||
{
|
||||
dat_D["Parameter1_S2"] = Convert.ToDouble(P2P.Text);
|
||||
dat_D["Parameter2_S2"] = Convert.ToDouble(P2P.Text);
|
||||
}
|
||||
else if (dat_P == 3)
|
||||
{
|
||||
dat_D["Parameter1_S3"] = Convert.ToDouble(P2P.Text);
|
||||
dat_D["Parameter2_S3"] = Convert.ToDouble(P2P.Text);
|
||||
}
|
||||
dat_D.EndEdit();
|
||||
}
|
||||
@@ -277,15 +277,15 @@ namespace DyeingComputer.Windows
|
||||
dat_D.BeginEdit();
|
||||
if (dat_P == 1)
|
||||
{
|
||||
dat_D["Parameter1_S1"] = Convert.ToDouble(P3P.Text);
|
||||
dat_D["Parameter3_S1"] = Convert.ToDouble(P3P.Text);
|
||||
}
|
||||
else if (dat_P == 2)
|
||||
{
|
||||
dat_D["Parameter1_S2"] = Convert.ToDouble(P3P.Text);
|
||||
dat_D["Parameter3_S2"] = Convert.ToDouble(P3P.Text);
|
||||
}
|
||||
else if (dat_P == 3)
|
||||
{
|
||||
dat_D["Parameter1_S3"] = Convert.ToDouble(P3P.Text);
|
||||
dat_D["Parameter3_S3"] = Convert.ToDouble(P3P.Text);
|
||||
}
|
||||
dat_D.EndEdit();
|
||||
}
|
||||
@@ -301,15 +301,15 @@ namespace DyeingComputer.Windows
|
||||
dat_D.BeginEdit();
|
||||
if (dat_P == 1)
|
||||
{
|
||||
dat_D["Parameter1_S1"] = Convert.ToDouble(P4P.Text);
|
||||
dat_D["Parameter4_S1"] = Convert.ToDouble(P4P.Text);
|
||||
}
|
||||
else if (dat_P == 2)
|
||||
{
|
||||
dat_D["Parameter1_S2"] = Convert.ToDouble(P4P.Text);
|
||||
dat_D["Parameter4_S2"] = Convert.ToDouble(P4P.Text);
|
||||
}
|
||||
else if (dat_P == 3)
|
||||
{
|
||||
dat_D["Parameter1_S3"] = Convert.ToDouble(P4P.Text);
|
||||
dat_D["Parameter4_S3"] = Convert.ToDouble(P4P.Text);
|
||||
}
|
||||
dat_D.EndEdit();
|
||||
}
|
||||
@@ -325,15 +325,15 @@ namespace DyeingComputer.Windows
|
||||
dat_D.BeginEdit();
|
||||
if (dat_P == 1)
|
||||
{
|
||||
dat_D["Parameter1_S1"] = Convert.ToDouble(P5P.Text);
|
||||
dat_D["Parameter5_S1"] = Convert.ToDouble(P5P.Text);
|
||||
}
|
||||
else if (dat_P == 2)
|
||||
{
|
||||
dat_D["Parameter1_S2"] = Convert.ToDouble(P5P.Text);
|
||||
dat_D["Parameter5_S2"] = Convert.ToDouble(P5P.Text);
|
||||
}
|
||||
else if (dat_P == 3)
|
||||
{
|
||||
dat_D["Parameter1_S3"] = Convert.ToDouble(P5P.Text);
|
||||
dat_D["Parameter5_S3"] = Convert.ToDouble(P5P.Text);
|
||||
}
|
||||
dat_D.EndEdit();
|
||||
}
|
||||
@@ -795,14 +795,12 @@ namespace DyeingComputer.Windows
|
||||
break;
|
||||
case "067":
|
||||
P1N.Text = Properties.Resources.Medicine + Properties.Resources.Tank;
|
||||
P2N.Text = Properties.Resources.Type;
|
||||
P3N.Text = Properties.Resources.Function;
|
||||
P1.Visibility = Visibility.Visible;
|
||||
P1N.Visibility = Visibility.Visible;
|
||||
P2.Visibility = Visibility.Visible;
|
||||
P2N.Visibility = Visibility.Visible;
|
||||
P3.Visibility = Visibility.Visible;
|
||||
P3N.Visibility = Visibility.Visible;
|
||||
P2.Visibility = Visibility.Collapsed;
|
||||
P2N.Visibility = Visibility.Collapsed;
|
||||
P3.Visibility = Visibility.Collapsed;
|
||||
P3N.Visibility = Visibility.Collapsed;
|
||||
P4.Visibility = Visibility.Collapsed;
|
||||
P4N.Visibility = Visibility.Collapsed;
|
||||
P5.Visibility = Visibility.Collapsed;
|
||||
@@ -1494,14 +1492,12 @@ namespace DyeingComputer.Windows
|
||||
break;
|
||||
case "067":
|
||||
P1NP.Text = Properties.Resources.Medicine + Properties.Resources.Tank;
|
||||
P2NP.Text = Properties.Resources.Type;
|
||||
P3NP.Text = Properties.Resources.Function;
|
||||
P1P.Visibility = Visibility.Visible;
|
||||
P1NP.Visibility = Visibility.Visible;
|
||||
P2P.Visibility = Visibility.Visible;
|
||||
P2NP.Visibility = Visibility.Visible;
|
||||
P3P.Visibility = Visibility.Visible;
|
||||
P3NP.Visibility = Visibility.Visible;
|
||||
P2P.Visibility = Visibility.Collapsed;
|
||||
P2NP.Visibility = Visibility.Collapsed;
|
||||
P3P.Visibility = Visibility.Collapsed;
|
||||
P3NP.Visibility = Visibility.Collapsed;
|
||||
P4P.Visibility = Visibility.Collapsed;
|
||||
P4NP.Visibility = Visibility.Collapsed;
|
||||
P5P.Visibility = Visibility.Collapsed;
|
||||
|
||||
Reference in new issue
Block a user