diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 65b4349..a5c1fe8 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -1302,6 +1302,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties { } } + /// + /// 查找类似 Multi 的本地化字符串。 + /// + public static string Multi { + get { + return ResourceManager.GetString("Multi", resourceCulture); + } + } + /// /// 查找类似 New 的本地化字符串。 /// diff --git a/Properties/Resources.en-US.resx b/Properties/Resources.en-US.resx index 0f66e96..264c930 100644 --- a/Properties/Resources.en-US.resx +++ b/Properties/Resources.en-US.resx @@ -933,4 +933,7 @@ Delayed + + Multi + \ No newline at end of file diff --git a/Properties/Resources.resx b/Properties/Resources.resx index a771db2..6b7f391 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -933,4 +933,7 @@ Delayed + + Multi + \ No newline at end of file diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index deaea11..dc1e303 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -933,4 +933,7 @@ 延后 + + 多机 + \ No newline at end of file diff --git a/Properties/Resources.zh-TW.resx b/Properties/Resources.zh-TW.resx index 9de8e42..2db90e9 100644 --- a/Properties/Resources.zh-TW.resx +++ b/Properties/Resources.zh-TW.resx @@ -927,4 +927,13 @@ 跳步 + + 考量 + + + 延遲 + + + 多机 + \ No newline at end of file diff --git a/View/MachinesSet.xaml.cs b/View/MachinesSet.xaml.cs index a9fbfb3..19b045a 100644 --- a/View/MachinesSet.xaml.cs +++ b/View/MachinesSet.xaml.cs @@ -37,6 +37,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View string[] ports = System.IO.Ports.SerialPort.GetPortNames(); comboBoxCOM0.ItemsSource = ports; comboBoxCOM0.Text = Configini.IniReadvalue("SYS", "COM"); + comboBoxMachine.ItemsSource = MainWindowViewModel.Machines.AsEnumerable().Select(rowdata => rowdata.Field("name")).ToList();//转换机台 + } private SQLiteHelper SQLiteHelpers = null; //定义数据库 diff --git a/View/ProductionPlanningEdit.xaml b/View/ProductionPlanningEdit.xaml index 2d590f7..a9a8dd4 100644 --- a/View/ProductionPlanningEdit.xaml +++ b/View/ProductionPlanningEdit.xaml @@ -7,15 +7,72 @@ xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="900" d:DesignWidth="600"> - - - - - diff --git a/View/ProductionPlanningEdit.xaml.cs b/View/ProductionPlanningEdit.xaml.cs index 85dc9ef..9e66bd5 100644 --- a/View/ProductionPlanningEdit.xaml.cs +++ b/View/ProductionPlanningEdit.xaml.cs @@ -1,5 +1,7 @@ -using System; +using SunlightCentralizedControlManagement_SCCM_.ViewModel; +using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -12,6 +14,8 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using TouchSocket.Core; +using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper; namespace SunlightCentralizedControlManagement_SCCM_.View { @@ -20,9 +24,24 @@ namespace SunlightCentralizedControlManagement_SCCM_.View /// public partial class ProductionPlanningEdit : UserControl { + private SQLiteHelper SQLiteHelpers = null; //定义数据库 + private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径 + DataTable ProgramName; public ProductionPlanningEdit() { InitializeComponent(); + + SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 + SQLiteHelpers.Open(); //打开数据库 + ProgramName = SQLiteHelpers.ExecuteDataSet("select * from ProgramName order by ProgramID desc", null).Tables[0]; //读取计划表写入缓存 + SQLiteHelpers.Close(); //关闭连接 + + comboBoxMachine.ItemsSource = MainWindowViewModel.Machines.AsEnumerable().Select(rowdata => rowdata.Field("name")).ToList();//转换机台 + comboBoxProgram.ItemsSource = ProgramName.AsEnumerable().Select(rowdata => rowdata.Field("ProgramID")).ToList();//转换工艺代码 + } + private void Multi_Click(object sender, RoutedEventArgs e) + { + } private void Button_Click(object sender, RoutedEventArgs e) @@ -33,5 +52,19 @@ namespace SunlightCentralizedControlManagement_SCCM_.View { this.Visibility = Visibility.Collapsed; } + + + private void comboBoxProgram_DropDownClosed(object sender, EventArgs e)//工艺选择事件 + { + if (!string.IsNullOrEmpty(comboBoxProgram.SelectedValue.ToString())) + { + SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 + SQLiteHelpers.Open(); //打开数据库 + DataTable dat = SQLiteHelpers.ExecuteDataSet( + "select * from ProgramSteps where ProgramID='" + comboBoxProgram.SelectedValue + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存 + SQLiteHelpers.Close(); //关闭连接 + Grid_data.ItemsSource = dat.DefaultView; + } + } } } diff --git a/View/ProductionPlanningView.xaml b/View/ProductionPlanningView.xaml index 4a73f08..0b84953 100644 --- a/View/ProductionPlanningView.xaml +++ b/View/ProductionPlanningView.xaml @@ -23,6 +23,7 @@ + diff --git a/View/ProductionPlanningView.xaml.cs b/View/ProductionPlanningView.xaml.cs index 92c1bcd..e753aee 100644 --- a/View/ProductionPlanningView.xaml.cs +++ b/View/ProductionPlanningView.xaml.cs @@ -169,12 +169,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.View } private void ListViewItem_New(object sender, System.Windows.Input.MouseButtonEventArgs e)//新建事件 { - + Picture.Width = 600; + Picture.Content = new ProductionPlanningEdit(); } - - - - private void WorkOrderNumder_Click(object sender, RoutedEventArgs e) { // Select_WorkOrderNumder.Text;