sc 1 year ago
parent
commit
fa3df5c22a
  1. 3
      ConvertMoels/StatenConvert.cs
  2. 24
      Properties/Resources.Designer.cs
  3. 12
      Properties/Resources.en-US.resx
  4. 10
      Properties/Resources.resx
  5. 12
      Properties/Resources.zh-CN.resx
  6. 12
      Properties/Resources.zh-TW.resx
  7. 2
      View/TechnologicalProcessView.xaml
  8. 6
      View/TechnologicalProcessView.xaml.cs
  9. 2
      View/WorkOrderView.xaml
  10. 54
      View/WorkOrderView.xaml.cs

3
ConvertMoels/StatenConvert.cs

@ -28,7 +28,8 @@ namespace DyeingComputer.ConvertMoels
else if (i == "203") Staten = Properties.Resources.Await; else if (i == "203") Staten = Properties.Resources.Await;
else if (i == "301") Staten = Properties.Resources.Finish; else if (i == "301") Staten = Properties.Resources.Finish;
else if (i == "309") Staten = Properties.Resources.Abnormal; else if (i == "309") Staten = Properties.Resources.Abnormal;
else if (i == "800") Staten = Properties.Resources.NotxEcuted; else if (i == "800") Staten = Properties.Resources.Notimplementation;
else if (i == "801") Staten = Properties.Resources.Implementation;
else Staten = "null"; else Staten = "null";
return Staten; return Staten;

24
Properties/Resources.Designer.cs

@ -366,6 +366,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 Implementation 的本地化字符串。
/// </summary>
public static string Implementation {
get {
return ResourceManager.GetString("Implementation", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 I/O 的本地化字符串。 /// 查找类似 I/O 的本地化字符串。
/// </summary> /// </summary>
@ -457,11 +466,11 @@ namespace DyeingComputer.Properties {
} }
/// <summary> /// <summary>
/// 查找类似 NotExecuted 的本地化字符串。 /// 查找类似 Notimplementation 的本地化字符串。
/// </summary> /// </summary>
public static string NotxEcuted { public static string Notimplementation {
get { get {
return ResourceManager.GetString("NotxEcuted", resourceCulture); return ResourceManager.GetString("Notimplementation", resourceCulture);
} }
} }
@ -573,6 +582,15 @@ namespace DyeingComputer.Properties {
} }
} }
/// <summary>
/// 查找类似 The process does not exist 的本地化字符串。
/// </summary>
public static string process_not {
get {
return ResourceManager.GetString("process_not", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 ProcessName 的本地化字符串。 /// 查找类似 ProcessName 的本地化字符串。
/// </summary> /// </summary>

12
Properties/Resources.en-US.resx

@ -210,9 +210,6 @@
<data name="LineUp" xml:space="preserve"> <data name="LineUp" xml:space="preserve">
<value>Line Up</value> <value>Line Up</value>
</data> </data>
<data name="NotxEcuted" xml:space="preserve">
<value>Not Executed</value>
</data>
<data name="State" xml:space="preserve"> <data name="State" xml:space="preserve">
<value>State</value> <value>State</value>
</data> </data>
@ -396,4 +393,13 @@
<data name="Overflow" xml:space="preserve"> <data name="Overflow" xml:space="preserve">
<value>Overflow</value> <value>Overflow</value>
</data> </data>
<data name="process_not" xml:space="preserve">
<value>The process does not exist</value>
</data>
<data name="Implementation" xml:space="preserve">
<value>Implementation</value>
</data>
<data name="Notimplementation" xml:space="preserve">
<value>Not Implementation</value>
</data>
</root> </root>

10
Properties/Resources.resx

@ -210,8 +210,8 @@
<data name="LineUp" xml:space="preserve"> <data name="LineUp" xml:space="preserve">
<value>LineUp</value> <value>LineUp</value>
</data> </data>
<data name="NotxEcuted" xml:space="preserve"> <data name="Notimplementation" xml:space="preserve">
<value>NotExecuted</value> <value>Notimplementation</value>
</data> </data>
<data name="Confirm" xml:space="preserve"> <data name="Confirm" xml:space="preserve">
<value>Confirm</value> <value>Confirm</value>
@ -396,4 +396,10 @@
<data name="Wiggle" xml:space="preserve"> <data name="Wiggle" xml:space="preserve">
<value>Wiggle</value> <value>Wiggle</value>
</data> </data>
<data name="Implementation" xml:space="preserve">
<value>Implementation</value>
</data>
<data name="process_not" xml:space="preserve">
<value>The process does not exist</value>
</data>
</root> </root>

12
Properties/Resources.zh-CN.resx

@ -210,9 +210,6 @@
<data name="Ready" xml:space="preserve"> <data name="Ready" xml:space="preserve">
<value>准备</value> <value>准备</value>
</data> </data>
<data name="NotxEcuted" xml:space="preserve">
<value>未执行</value>
</data>
<data name="State" xml:space="preserve"> <data name="State" xml:space="preserve">
<value>状态</value> <value>状态</value>
</data> </data>
@ -396,4 +393,13 @@
<data name="Overflow" xml:space="preserve"> <data name="Overflow" xml:space="preserve">
<value>溢流</value> <value>溢流</value>
</data> </data>
<data name="process_not" xml:space="preserve">
<value>工艺不存在</value>
</data>
<data name="Notimplementation" xml:space="preserve">
<value>未执行</value>
</data>
<data name="Implementation" xml:space="preserve">
<value>执行</value>
</data>
</root> </root>

12
Properties/Resources.zh-TW.resx

@ -210,9 +210,6 @@
<data name="Measure" xml:space="preserve"> <data name="Measure" xml:space="preserve">
<value>計量</value> <value>計量</value>
</data> </data>
<data name="NotxEcuted" xml:space="preserve">
<value>未執行</value>
</data>
<data name="State" xml:space="preserve"> <data name="State" xml:space="preserve">
<value>狀態</value> <value>狀態</value>
</data> </data>
@ -396,4 +393,13 @@
<data name="Overflow" xml:space="preserve"> <data name="Overflow" xml:space="preserve">
<value>溢流</value> <value>溢流</value>
</data> </data>
<data name="process_not" xml:space="preserve">
<value>流程不存在</value>
</data>
<data name="Notimplementation" xml:space="preserve">
<value>未執行</value>
</data>
<data name="Implementation" xml:space="preserve">
<value>執行</value>
</data>
</root> </root>

2
View/TechnologicalProcessView.xaml

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DyeingComputer.View" xmlns:local="clr-namespace:DyeingComputer.View"
xmlns:lang="clr-namespace:DyeingComputer.Properties" xmlns:lang="clr-namespace:DyeingComputer.Properties"
mc:Ignorable="d" mc:Ignorable="d" Loaded="UserControl_Loaded"
d:DesignHeight="630" d:DesignWidth="1280"> d:DesignHeight="630" d:DesignWidth="1280">
<Grid> <Grid>
<TextBlock x:Name="log" HorizontalAlignment="Left" Margin="0,0,0,0" TextWrapping="Wrap" Width="600" FontSize="20" Background="White"/> <TextBlock x:Name="log" HorizontalAlignment="Left" Margin="0,0,0,0" TextWrapping="Wrap" Width="600" FontSize="20" Background="White"/>

6
View/TechnologicalProcessView.xaml.cs

@ -27,7 +27,6 @@ namespace DyeingComputer.View
public TechnologicalProcessView() public TechnologicalProcessView()
{ {
InitializeComponent(); InitializeComponent();
TechnologicalProcess_sql();
} }
public static object workName; public static object workName;
@ -50,5 +49,10 @@ namespace DyeingComputer.View
SQLiteHelpers.Close(); //关闭连接 SQLiteHelpers.Close(); //关闭连接
if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表 if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
} }
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
if(workName !=null) TechnologicalProcess_sql();
}
} }
} }

2
View/WorkOrderView.xaml

@ -70,7 +70,7 @@
<DataGridTextColumn Header="{x:Static lang:Resources.ProcessName}" Width="300" Binding="{Binding ProcessName}" IsReadOnly="True"/> <DataGridTextColumn Header="{x:Static lang:Resources.ProcessName}" Width="300" Binding="{Binding ProcessName}" IsReadOnly="True"/>
<DataGridTextColumn Header="ProcessID" Binding="{Binding ProcessID}" Width="0" MinWidth="0" MaxWidth="0"/> <DataGridTextColumn Header="ProcessID" Binding="{Binding ProcessID}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Header="lock" Binding="{Binding lock}" Width="0" MinWidth="0" MaxWidth="0"/> <DataGridTextColumn Header="lock" Binding="{Binding lock}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="90" IsReadOnly="True"> <DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="120" IsReadOnly="True">
<DataGridTextColumn.ElementStyle> <DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}"> <Style TargetType="{x:Type TextBlock}">
<Setter Property="Text" Value="{Binding Path=State,Converter={StaticResource StatenConvert}}"/> <Setter Property="Text" Value="{Binding Path=State,Converter={StaticResource StatenConvert}}"/>

54
View/WorkOrderView.xaml.cs

@ -41,6 +41,7 @@ namespace DyeingComputer.View
private SQLiteHelper SQLiteHelpers = null; //定义数据库 private SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径 private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
DataSet sql; //内存数据缓存 DataSet sql; //内存数据缓存
Dictionary<string, object> updata_temp = new Dictionary<string, object>();//缓存函数
string WorkOrder_Numder; string WorkOrder_Numder;
string Process_Name; string Process_Name;
@ -89,21 +90,19 @@ namespace DyeingComputer.View
private void WorkOrderView_lock_Click(object sender, RoutedEventArgs e)//锁定按钮 private void WorkOrderView_lock_Click(object sender, RoutedEventArgs e)//锁定按钮
{ {
if (WorkOrder_Numder == null) return; if (WorkOrder_Numder == null) return;
Dictionary<string, object> lock_v = new Dictionary<string, object>();//缓存函数
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库 SQLiteHelpers.Open(); //打开数据库
updata_temp.Clear();//使用前清理缓存
if (_lock == "0") //改变lock的状态 if (_lock == "0") //改变lock的状态
{ {
lock_v.Add("lock", 1); updata_temp.Add("lock", 1);
SQLiteHelpers.Update("WorkOrder", lock_v, "WorkOrder='" + WorkOrder_Numder + "'", null); SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + WorkOrder_Numder + "'", null);
} }
else else
{ {
lock_v.Add("lock", 0); updata_temp.Add("lock", 0);
SQLiteHelpers.Update("WorkOrder", lock_v, "WorkOrder='" + WorkOrder_Numder + "'", null); SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + WorkOrder_Numder + "'", null);
} }
SQLiteHelpers.Close(); SQLiteHelpers.Close();
Workorder_sql(); Workorder_sql();
} }
@ -152,27 +151,34 @@ namespace DyeingComputer.View
Process_id = (Grid.Columns[2].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第0列, Process_id = (Grid.Columns[2].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第0列,
_lock = (Grid.Columns[3].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第1列, _lock = (Grid.Columns[3].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第1列,
} }
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
string sql_script = "select * from ProgramName where ProgramID = '" + Process_id + "'";
int i = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0].Rows.Count; //读取工艺表返回0工艺不存在
SQLiteHelpers.Close(); //关闭连接
if(i == 0) //工艺不存在提示
{
WorkOrder_Numder = null;
Process_id = null;
Process_Name = null;
}
} }
private void UserControl_KeyDown(object sender, KeyEventArgs e) private void UserControl_KeyDown(object sender, KeyEventArgs e) //键盘监控
{ {
if (e.Key == Key.K) if (e.Key == Key.Y) //按键y
{ {
if (Process_id != null) SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
string sql_script = "select * from ProgramName where ProgramID = '" + Process_id + "'";
int i = SQLiteHelpers.ExecuteDataSet(sql_script, null).Tables[0].Rows.Count; //读取工艺表返回0工艺不存在
if (i == 0) //工艺不存在提示
{
SQLiteHelpers.Close(); //关闭连接
WorkOrder_Numder = null;
Process_id = null;
if (System.Windows.Forms.MessageBox.Show("["+Process_Name+"] "+ Properties.Resources.process_not, "800 ",
System.Windows.Forms.MessageBoxButtons.OK) == System.Windows.Forms.DialogResult.OK) return;
}
else //否则修改工艺执行状态
{
updata_temp.Clear(); //使用前清缓存
updata_temp.Add("State", 101);
SQLiteHelpers.Update("WorkOrder", updata_temp, "ProcessID='" + Process_id + "'", null);
SQLiteHelpers.Close(); //关闭连接
}
if (Process_id != null) //选定工艺有效跳转准备
{ {
MainWindowViewModel.WorkNumder = WorkOrder_Numder; MainWindowViewModel.WorkNumder = WorkOrder_Numder;
TechnologicalProcessView.workName = Process_id; TechnologicalProcessView.workName = Process_id;

Loading…
Cancel
Save