Browse Source

呼叫输送相关

master
sc 4 months ago
parent
commit
4a8eab7692
  1. 9
      Properties/Resources.Designer.cs
  2. 5
      Properties/Resources.en-US.resx
  3. 3
      Properties/Resources.resx
  4. 3
      Properties/Resources.zh-CN.resx
  5. 3
      Properties/Resources.zh-TW.resx
  6. 1
      UserClass/AsyncTcpServer.cs
  7. 15
      View/TechnologicalProcessView.xaml
  8. 46
      ViewModel/MainWindowViewModel.cs

9
Properties/Resources.Designer.cs

@ -915,6 +915,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 ProductName 的本地化字符串。
/// </summary>
public static string ProductName {
get {
return ResourceManager.GetString("ProductName", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 ProgramGroup 的本地化字符串。 /// 查找类似 ProgramGroup 的本地化字符串。
/// </summary> /// </summary>

5
Properties/Resources.en-US.resx

@ -511,7 +511,7 @@
<value>Jump</value> <value>Jump</value>
</data> </data>
<data name="ProductCode" xml:space="preserve"> <data name="ProductCode" xml:space="preserve">
<value>ProductCode</value> <value>Product Code</value>
</data> </data>
<data name="Grams" xml:space="preserve"> <data name="Grams" xml:space="preserve">
<value>Grams</value> <value>Grams</value>
@ -543,4 +543,7 @@
<data name="refuse" xml:space="preserve"> <data name="refuse" xml:space="preserve">
<value>Refuse</value> <value>Refuse</value>
</data> </data>
<data name="ProductName" xml:space="preserve">
<value>Product Name</value>
</data>
</root> </root>

3
Properties/Resources.resx

@ -543,4 +543,7 @@
<data name="refuse" xml:space="preserve"> <data name="refuse" xml:space="preserve">
<value>Refuse</value> <value>Refuse</value>
</data> </data>
<data name="ProductName" xml:space="preserve">
<value>ProductName</value>
</data>
</root> </root>

3
Properties/Resources.zh-CN.resx

@ -543,4 +543,7 @@
<data name="refuse" xml:space="preserve"> <data name="refuse" xml:space="preserve">
<value>拒绝</value> <value>拒绝</value>
</data> </data>
<data name="ProductName" xml:space="preserve">
<value>原料名</value>
</data>
</root> </root>

3
Properties/Resources.zh-TW.resx

@ -543,4 +543,7 @@
<data name="refuse" xml:space="preserve"> <data name="refuse" xml:space="preserve">
<value>拒絕</value> <value>拒絕</value>
</data> </data>
<data name="ProductName" xml:space="preserve">
<value>原料名</value>
</data>
</root> </root>

1
UserClass/AsyncTcpServer.cs

@ -434,6 +434,7 @@ namespace DyeingComputer.UserClass
{ {
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数 Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
Chart_new.Add("LOCK", MainWindowViewModel._Lock_bool); Chart_new.Add("LOCK", MainWindowViewModel._Lock_bool);
Chart_new.Add("CALL", MainWindowViewModel.CALL_FR);
Chart_new.Add("Status", MainWindowViewModel.StatusStr); Chart_new.Add("Status", MainWindowViewModel.StatusStr);
Chart_new.Add("Machine", MainWindowViewModel.S01); Chart_new.Add("Machine", MainWindowViewModel.S01);
Chart_new.Add("WorkNumder", MainWindowViewModel.WorkNumder); Chart_new.Add("WorkNumder", MainWindowViewModel.WorkNumder);

15
View/TechnologicalProcessView.xaml

@ -6,10 +6,14 @@
xmlns:local="clr-namespace:DyeingComputer.View" xmlns:local="clr-namespace:DyeingComputer.View"
xmlns:lang="clr-namespace:DyeingComputer.Properties" xmlns:lang="clr-namespace:DyeingComputer.Properties"
xmlns:viewmodel="clr-namespace:DyeingComputer.ViewModel" xmlns:viewmodel="clr-namespace:DyeingComputer.ViewModel"
xmlns:ConvertMoels="clr-namespace:DyeingComputer.ConvertMoels"
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}" d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
mc:Ignorable="d" Loaded="UserControl_Loaded" mc:Ignorable="d" Loaded="UserControl_Loaded"
KeyDown="UserControl_KeyDown" KeyDown="UserControl_KeyDown"
d:DesignHeight="630" d:DesignWidth="1280"> d:DesignHeight="630" d:DesignWidth="1280">
<UserControl.Resources>
<ConvertMoels:StatenConvert x:Key="StatenConvert"/>
</UserControl.Resources>
<Grid> <Grid>
<DataGrid x:Name="GridSTEP" AlternationCount="2" IsReadOnly="True" SelectionChanged="Grid_SelectionChanged" <DataGrid x:Name="GridSTEP" AlternationCount="2" IsReadOnly="True" SelectionChanged="Grid_SelectionChanged"
Margin="630,40,0,0" d:ItemsSource="{d:SampleData ItemCount=90}" AutoGenerateColumns="False" MinColumnWidth="30" Margin="630,40,0,0" d:ItemsSource="{d:SampleData ItemCount=90}" AutoGenerateColumns="False" MinColumnWidth="30"
@ -109,7 +113,7 @@
<DataTrigger Binding="{Binding Amount}" Value="{x:Null}"> <DataTrigger Binding="{Binding Amount}" Value="{x:Null}">
<Setter Property="Foreground" Value="#FFADADAD"/> <Setter Property="Foreground" Value="#FFADADAD"/>
</DataTrigger> </DataTrigger>
<DataTrigger Binding="{Binding Amount}" Value="0"> <DataTrigger Binding="{Binding State}" Value="309">
<Setter Property="Foreground" Value="Red"/> <Setter Property="Foreground" Value="Red"/>
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
@ -130,10 +134,11 @@
</DataGrid.CellStyle> </DataGrid.CellStyle>
<DataGrid.Columns> <DataGrid.Columns>
<!--列信息绑定--> <!--列信息绑定-->
<DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding Step}" Width="60"/> <DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding Step}" Width="30"/>
<DataGridTextColumn Header="{x:Static lang:Resources.Directives}" Width="200" Binding="{Binding ProductCode}"/> <DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="50" Binding="{Binding State}"/>
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="*" Binding="{Binding Grams}"/> <DataGridTextColumn Header="{x:Static lang:Resources.ProductName}" Width="180" Binding="{Binding ProductName}"/>
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="*" Binding="{Binding Amount}"/> <DataGridTextColumn Header="{x:Static lang:Resources.Grams}" Width="*" Binding="{Binding Grams}"/>
<DataGridTextColumn Header="{x:Static lang:Resources.Amount}" Width="*" Binding="{Binding Amount}"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<DataGrid x:Name="Parameter_set" Visibility="Collapsed" <DataGrid x:Name="Parameter_set" Visibility="Collapsed"

46
ViewModel/MainWindowViewModel.cs

@ -124,7 +124,6 @@ namespace DyeingComputer.ViewModel
execute: ProgramgroupView_stop_);//结束事件 execute: ProgramgroupView_stop_);//结束事件
} }
DataTable dt_con = new DataTable(); DataTable dt_con = new DataTable();
DataTable dt_sys = new DataTable(); DataTable dt_sys = new DataTable();
public string Selet_con(string key)//配置缓存 public string Selet_con(string key)//配置缓存
@ -267,16 +266,16 @@ namespace DyeingComputer.ViewModel
public ICommand ProgramgroupView_run { get; } public ICommand ProgramgroupView_run { get; }
private void ProgramgroupView_stop_()//结束 private void ProgramgroupView_stop_()//结束
{ {
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", MainWindowViewModel.WORK_RUN.ToString()); APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", WORK_RUN.ToString());
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.StopProcess, "800", MessageBoxButton.OKCancel); MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.StopProcess, "800", MessageBoxButton.OKCancel);
if (messageBoxResult == MessageBoxResult.OK) if (messageBoxResult == MessageBoxResult.OK)
{ {
MainWindowViewModel.WORK_RUN = 0;// 运行时停止键为 WORK_RUN = 0;// 运行时停止键为
MainWindowViewModel.DIDETime = 0; DIDETime = 0;
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "PROCESS_END", MainWindowViewModel.WORK_RUN.ToString()); APILog.LOGlog(WorkNumder.ToString(), "UserActions", "PROCESS_END", WORK_RUN.ToString());
MainWindowViewModel.dt_TP.Rows.Clear(); dt_TP.Rows.Clear();
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.Delete("RUN", null, null); SQLiteHelpers.Delete("RUN", null, null);
@ -1496,7 +1495,7 @@ namespace DyeingComputer.ViewModel
case "067": case "067":
STEP_finish = true; STEP_finish = true;
break;//呼叫输送准备 break;//等待输送
case "090": case "090":
if (((STEP_P1-1)<Selet_dtm("1010"))&&(Selet_dtm("1010") < (STEP_P1+1))) PH_start = true;//达到温度开始ph控制 if (((STEP_P1-1)<Selet_dtm("1010"))&&(Selet_dtm("1010") < (STEP_P1+1))) PH_start = true;//达到温度开始ph控制
if (PH_start) if (PH_start)
@ -1659,35 +1658,20 @@ namespace DyeingComputer.ViewModel
} }
} }
public static bool CALL_FR = false;
void FeedingRecords(string WorkOrder,string Dyelot,int TANK,int STEP,int Type) //呼叫输送 void FeedingRecords(string WorkOrder,string Dyelot,int TANK,int STEP,int Type) //呼叫输送
{ {
DataTable data_t = new DataTable(); Dictionary<string, object> dat_FR = new Dictionary<string, object>();
data_t.Columns.Add("Dyelot", typeof(string)); //添加列 dat_FR.Add("State", "201");
data_t.Columns.Add("Machine", typeof(string)); dat_FR.Add("Tank", TANK.ToString());
data_t.Columns.Add("WorkOrder", typeof(string)); dat_FR.Add("Machine", S01);
data_t.Columns.Add("TIME", typeof(string)); dat_FR.Add("CALL_TIME", sys_Time);
data_t.Columns.Add("Tank", typeof(int));
data_t.Columns.Add("STEP", typeof(int));
data_t.Columns.Add("Type", typeof(int));
data_t.Columns.Add("State", typeof(int));
data_t.Columns.Add("Redye", typeof(int));
DataRow dr = data_t.NewRow();
dr.BeginEdit(); //添加订单号
dr["Dyelot"] = Dyelot;
dr["Machine"] = S01;
dr["WorkOrder"] = WorkOrder;
dr["TIME"] = sys_Time;
dr["Tank"] = TANK;
dr["STEP"] = STEP;
dr["Type"] = Type;
dr["State"] = 201;
dr["Redye"] = SYS_REDYE;
dr.EndEdit();
data_t.Rows.InsertAt(dr, 0); //行转换
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.InsertData("FeedingRecords", SQLiteHelpers.DataTableToDictionary(data_t));//行插入 int SQLI = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where " +
"Dyelot = '"+Dyelot+ "' AND Step = '"+STEP+ "' AND Redye ='"+SYS_REDYE+"' AND State = '101'", null).Tables[0].Rows.Count;
if(SQLI>0) SQLiteHelpers.Update("Dyelot", dat_FR, "Dyelot = '"+Dyelot+ "' AND Step = '"+STEP+ "' AND Redye ='"+SYS_REDYE+"'", null);//行更新
SQLiteHelpers.Close(); //关闭连接 SQLiteHelpers.Close(); //关闭连接
} }

Loading…
Cancel
Save