You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
504 lines
24 KiB
504 lines
24 KiB
using Newtonsoft.Json.Linq;
|
|
using nGantt.GanttChart;
|
|
using SunlightCentralizedControlManagement_SCCM_.UserClass;
|
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
|
using SunlightCentralizedControlManagement_SCCM_.WindowsView;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
using System.Xml.Linq;
|
|
using TouchSocket.Core;
|
|
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
|
|
using static SunlightCentralizedControlManagement_SCCM_.WindowsView.ViewStep;
|
|
using static System.Windows.Forms.AxHost;
|
|
|
|
namespace SunlightCentralizedControlManagement_SCCM_.View
|
|
{
|
|
/// <summary>
|
|
/// ProductionPlanningEdit.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class DyeingPlanView : UserControl
|
|
{
|
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
|
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
|
DataTable ProgramName = new DataTable();
|
|
DataTable WorkOrder =new DataTable();
|
|
DataTable dat = new DataTable();
|
|
DataTable TEMPTable = new DataTable();
|
|
public string WorkOrder_n;
|
|
public DyeingPlanView()
|
|
{
|
|
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<string>("name")).ToList();//转换机台
|
|
comboBoxProgram.ItemsSource = ProgramName.AsEnumerable().Select(rowdata => rowdata.Field<string>("ProgramName")).ToList();//转换工艺代码
|
|
TEXTUSER.Text = MainWindow.user_;
|
|
|
|
TEMPTable.Columns.Add("Time", Type.GetType("System.String"));
|
|
TEMPTable.Columns.Add("MST", Type.GetType("System.Double"));
|
|
}
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
|
|
}
|
|
private void comboBoxMachine_DropDownClosed(object sender, EventArgs e)//机台选择
|
|
{
|
|
string[] sArray = Regex.Split(comboBoxMachine.Text, @"\+", RegexOptions.IgnoreCase);
|
|
if (sArray.Length <= 1)
|
|
{
|
|
comboBoxDyelot.IsEnabled = true;
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
DataTable DatDyelot = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where Machine='" + comboBoxMachine.Text + "' and State='101' order by Dyelot desc", null).Tables[0]; //读取计划表写入缓存
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
comboBoxDyelot.ItemsSource = DatDyelot.AsEnumerable().Select(rowdata => rowdata.Field<string>("Dyelot")).ToList();//转换代码
|
|
}
|
|
}
|
|
private void Multi_Click(object sender, RoutedEventArgs e)//机台组
|
|
{
|
|
MachineSelection machineSelection = new MachineSelection();
|
|
machineSelection.AddressUpdated += new MachineSelection.AddressUpdateHandler(Address_Multi_Click);
|
|
//machineSelection.data = "ID";
|
|
machineSelection.ShowDialog();
|
|
}
|
|
private void Address_Multi_Click(object sender, MachineSelection.AddressUpdateEventArgs e)//机台组返回结果
|
|
{
|
|
if(!string.IsNullOrEmpty(e.Groups)) comboBoxMachine.Text = e.Groups;
|
|
comboBoxDyelot.Text = null;
|
|
comboBoxDyelot.IsEnabled = false;
|
|
}
|
|
|
|
string color_ = "#FF336FA8";
|
|
private void Button_Click(object sender, RoutedEventArgs e)//保存按钮
|
|
{
|
|
if (string.IsNullOrEmpty(comboBoxMachine.Text))
|
|
{
|
|
MessageBox.Show("Not Machine", "SCCM", MessageBoxButton.OK, MessageBoxImage.Question);
|
|
return;
|
|
}
|
|
if (string.IsNullOrEmpty(comboBoxProgram.Text))
|
|
{
|
|
MessageBox.Show("Not Program", "SCCM", MessageBoxButton.OK, MessageBoxImage.Question);
|
|
return;
|
|
}
|
|
string[] pArray = Regex.Split(comboBoxProgram.Text, @"\+", RegexOptions.IgnoreCase);
|
|
|
|
|
|
//单机器信息写入
|
|
string sTime;
|
|
string StartTime_;
|
|
string WorkOrder_ = comboBoxMachine.Text + "_" + DateTime.Now.ToString("yyMMddHHmmss");
|
|
if (!string.IsNullOrEmpty(WorkOrder_n)) WorkOrder_ = WorkOrder_n;
|
|
string ProgramName_ = comboBoxProgram.Text;
|
|
string ProgramID_ = null;
|
|
for (int j = 0; j < pArray.Length; j++)
|
|
{
|
|
try
|
|
{
|
|
if (j == 0)
|
|
{
|
|
ProgramID_ = ProgramName.Select("ProgramName='" + pArray[j] + "'").
|
|
First().Field<object>("ProgramID").ToString();
|
|
}
|
|
else
|
|
{
|
|
ProgramID_ = ProgramID_ + "+" + ProgramName.Select("ProgramName='" + pArray[j] + "'").
|
|
First().Field<object>("ProgramID").ToString();
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
MessageBox.Show("Not Program", "SCCM", MessageBoxButton.OK, MessageBoxImage.Question);
|
|
return;
|
|
}
|
|
}
|
|
string Machines_ = comboBoxMachine.Text;
|
|
string State_ = "100";
|
|
string Dyelot_ = comboBoxDyelot.Text;
|
|
// string color_ = color_color.Background.ToString();
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
try
|
|
{
|
|
sTime = SQLiteHelpers.ExecuteDataSet(
|
|
"select * from WorkOrder where Machines='" + comboBoxMachine.Text + "' order by EndTime desc", null).
|
|
Tables[0].Select().First().Field<object>("EndTime").ToString(); //读取计划表写入缓存
|
|
if (DateTime.Now < DateTime.Parse(sTime))
|
|
{
|
|
StartTime_ = DateTime.Parse(sTime).AddMinutes(1).ToString("yyyy/MM/dd HH:mm:ss");
|
|
}
|
|
else
|
|
{
|
|
StartTime_ = DateTime.Now.AddMinutes(1).ToString("yyyy/MM/dd HH:mm:ss");
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
StartTime_ = DateTime.Now.AddMinutes(1).ToString("yyyy/MM/dd HH:mm:ss");
|
|
}
|
|
|
|
string Time_ = "0:00";
|
|
for (int k = 0; k < pArray.Length; k++)
|
|
{
|
|
string t = ProgramName.Select("ProgramName='" + pArray[k] + "'").
|
|
First().Field<object>("Time").ToString();
|
|
Time_ = (DateTime.Parse(Time_) + DateTime.Parse(t).TimeOfDay).ToString("HH:mm:ss");
|
|
}
|
|
string EndTime_ = (DateTime.Parse(StartTime_) + DateTime.Parse(Time_).TimeOfDay).ToString("yyyy/MM/dd HH:mm:ss");
|
|
|
|
//插入数据信息
|
|
Dictionary<string, object> WorkOrder_new = new Dictionary<string, object>();//缓存函数
|
|
WorkOrder_new.Add("StartTime", StartTime_);
|
|
WorkOrder_new.Add("EndTime", EndTime_);
|
|
WorkOrder_new.Add("Time", Time_);
|
|
WorkOrder_new.Add("WorkOrder", WorkOrder_);
|
|
WorkOrder_new.Add("ProgramName", ProgramName_);
|
|
WorkOrder_new.Add("ProgramID", ProgramID_);
|
|
WorkOrder_new.Add("Machines", Machines_);
|
|
WorkOrder_new.Add("State", State_);
|
|
WorkOrder_new.Add("Dyelot", Dyelot_);
|
|
WorkOrder_new.Add("Remark", null);
|
|
WorkOrder_new.Add("lock", 0);
|
|
WorkOrder_new.Add("color", color_);
|
|
WorkOrder_new.Add("ColorNumber", TEXTColorNumber.Text);
|
|
WorkOrder_new.Add("Client", TEXTClient.Text);
|
|
WorkOrder_new.Add("ClothWeight", TEXTClothWeight.Text);
|
|
WorkOrder_new.Add("ClothSpecies", TEXTClothSpecies.Text);
|
|
WorkOrder_new.Add("BathRatio", TEXTBathRatio.Text);
|
|
WorkOrder_new.Add("Total", TEXTTotal.Text);
|
|
WorkOrder_new.Add("USER", TEXTUSER.Text);
|
|
WorkOrder_new.Add("ColorName", TEXTColorName.Text);
|
|
SQLiteHelpers.InsertData("WorkOrder", WorkOrder_new);// 执行插入
|
|
|
|
Dictionary<string, object> WorkOrder_DAT = new Dictionary<string, object>();//缓存函数
|
|
for (int x = 0; x < dat.Rows.Count; x++)
|
|
{
|
|
WorkOrder_DAT.Add("WorkOrder", WorkOrder_);
|
|
WorkOrder_DAT.Add("Dyelot", Dyelot_);
|
|
WorkOrder_DAT.Add("ProgramID", dat.Rows[x]["ProgramID"]);
|
|
WorkOrder_DAT.Add("Program", dat.Rows[x]["Program"]);
|
|
WorkOrder_DAT.Add("Step", dat.Rows[x]["Step"]);
|
|
WorkOrder_DAT.Add("StepID", dat.Rows[x]["StepID"]);
|
|
WorkOrder_DAT.Add("StepName", dat.Rows[x]["StepName"]);
|
|
WorkOrder_DAT.Add("ParameterName", dat.Rows[x]["ParameterName"]);
|
|
WorkOrder_DAT.Add("Parameter1", dat.Rows[x]["Parameter1"]);
|
|
WorkOrder_DAT.Add("Parameter2", dat.Rows[x]["Parameter2"]);
|
|
WorkOrder_DAT.Add("Parameter3", dat.Rows[x]["Parameter3"]);
|
|
WorkOrder_DAT.Add("Parameter4", dat.Rows[x]["Parameter4"]);
|
|
WorkOrder_DAT.Add("Parameter5", dat.Rows[x]["Parameter5"]);
|
|
WorkOrder_DAT.Add("Parameter6", dat.Rows[x]["Parameter6"]);
|
|
WorkOrder_DAT.Add("Parameter7", dat.Rows[x]["Parameter7"]);
|
|
WorkOrder_DAT.Add("Parameter8", dat.Rows[x]["Parameter8"]);
|
|
WorkOrder_DAT.Add("Parameter9", dat.Rows[x]["Parameter9"]);
|
|
WorkOrder_DAT.Add("Parameter10", dat.Rows[x]["Parameter10"]);
|
|
SQLiteHelpers.InsertData("WorkorderSteps", WorkOrder_DAT);//行插入
|
|
WorkOrder_DAT.Clear();
|
|
}
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
this.Visibility = Visibility.Collapsed;
|
|
ProductionPlanningView.UI = true;
|
|
}
|
|
private void Button_Quit(object sender, RoutedEventArgs e)//退出
|
|
{
|
|
this.Visibility = Visibility.Collapsed;
|
|
}
|
|
public void DatSteps(DataTable db)//行号刷新
|
|
{
|
|
int a = db.Rows.Count;
|
|
for (int i = 0; i < a; i++)
|
|
{
|
|
DataRow dr = db.Rows[i];
|
|
dr.BeginEdit();
|
|
dr["Step"] = i + 1;
|
|
dr.EndEdit();
|
|
}
|
|
}
|
|
private void comboBoxProgram_DropDownClosed(object sender, EventArgs e)//工艺选择事件
|
|
{
|
|
if (!string.IsNullOrEmpty(comboBoxProgram.Text))
|
|
{
|
|
dat.Clear();
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
dat = SQLiteHelpers.ExecuteDataSet(
|
|
"select * from ProgramSteps where Program='" + comboBoxProgram.SelectedValue + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
DatSteps(dat);
|
|
Grid_data.ItemsSource = dat.DefaultView;
|
|
}
|
|
}
|
|
|
|
private void comboBoxProgram_TextChanged(object sender, TextChangedEventArgs e)
|
|
{
|
|
dat.Clear();
|
|
string text = comboBoxProgram.Text;
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
try
|
|
{
|
|
string[] sArray = Regex.Split(text, @"\+", RegexOptions.IgnoreCase);
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
for (int i = 0; i < sArray.Length; i++)
|
|
{
|
|
DataTable temp = SQLiteHelpers.ExecuteDataSet(
|
|
"select * from ProgramSteps where Program='" + sArray[i] + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
|
|
if (dat.Columns.Count == 0) dat = temp.Clone();
|
|
foreach (DataRow drT in temp.Rows)
|
|
{
|
|
dat.Rows.Add(drT.ItemArray);
|
|
}
|
|
}//以工艺名组合工艺细节
|
|
if (!string.IsNullOrEmpty(WorkOrder_n))
|
|
{
|
|
dat = SQLiteHelpers.ExecuteDataSet(
|
|
"select * from WorkorderSteps where WorkOrder='" + WorkOrder_n + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
|
|
}//插入工单不为空时载入细节信息
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
DatSteps(dat);
|
|
Grid_data.ItemsSource = dat.DefaultView;
|
|
|
|
TEMP();
|
|
}
|
|
catch (Exception) { }
|
|
}
|
|
|
|
}//工艺修改事件
|
|
|
|
string Numder = null;
|
|
string ID = null;
|
|
string P1, P2, P3, P4, P5;
|
|
|
|
private void MenuItem_edit(object sender, RoutedEventArgs e)
|
|
{
|
|
int rownum = Grid_data.SelectedIndex;//获取鼠标选中行并定义变量
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
{
|
|
ID = (Grid_data.Columns[2].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第0列,
|
|
Numder = (Grid_data.Columns[3].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第1列,
|
|
P1 = (Grid_data.Columns[6].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第6列,
|
|
P2 = (Grid_data.Columns[7].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第7列,
|
|
P3 = (Grid_data.Columns[8].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第8列,
|
|
P4 = (Grid_data.Columns[9].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第9列,
|
|
P5 = (Grid_data.Columns[10].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第10列,
|
|
|
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; }
|
|
if (ID == null) ID = dat.Rows.Count.ToString();
|
|
ViewStep viewstop = new ViewStep(Numder, P1, P2, P3, P4, P5);
|
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
|
|
viewstop.data = ID;
|
|
viewstop.ShowDialog();
|
|
}
|
|
}
|
|
private void MenuItem_Insert(object sender, RoutedEventArgs e)//右键插入
|
|
{
|
|
int rownum = Grid_data.SelectedIndex;//获取鼠标选中行并定义变量
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
{
|
|
ID = (Grid_data.Columns[2].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位列,
|
|
|
|
int d = 0;
|
|
if (ID != null) { d = Convert.ToInt32(ID); } else { return; }
|
|
string ProgramID = dat.Select().First().Field<string>("ProgramID").ToString();
|
|
string ProgramNAME = dat.Select().First().Field<string>("Program").ToString();
|
|
DataRow dr = dat.NewRow();//添加表数据
|
|
dr["ProgramID"] = ProgramID;
|
|
dr["Program"] = ProgramNAME;
|
|
dat.Rows.InsertAt(dr, d - 1);
|
|
|
|
DatSteps(dat);
|
|
Grid_data.ItemsSource = dat.DefaultView;
|
|
|
|
if (ID == null) ID = dat.Rows.Count.ToString();
|
|
ViewStep viewstop = new ViewStep(null, null, null, null, null, null);
|
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
|
|
viewstop.data = ID;
|
|
viewstop.ShowDialog();
|
|
}
|
|
}
|
|
private void MenuItem_Delete(object sender, RoutedEventArgs e)//右键删除
|
|
{
|
|
int rownum = Grid_data.SelectedIndex;//获取鼠标选中行并定义变量
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
{
|
|
ID = (Grid_data.Columns[2].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第0列,
|
|
dat.Rows.RemoveAt( Convert.ToInt32(ID)-1);
|
|
|
|
DatSteps(dat);
|
|
Grid_data.ItemsSource = dat.DefaultView;
|
|
}
|
|
}
|
|
private void Grid_data_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
|
{
|
|
int rownum = Grid_data.SelectedIndex;//获取鼠标选中行并定义变量
|
|
if (rownum != -1)//判断鼠标定位是否有效
|
|
{
|
|
ID = (Grid_data.Columns[2].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第0列,
|
|
Numder = (Grid_data.Columns[3].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第1列,
|
|
P1 = (Grid_data.Columns[6].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第6列,
|
|
P2 = (Grid_data.Columns[7].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第7列,
|
|
P3 = (Grid_data.Columns[8].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第8列,
|
|
P4 = (Grid_data.Columns[9].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第9列,
|
|
P5 = (Grid_data.Columns[10].GetCellContent(Grid_data.Items[rownum]) as TextBlock).Text;//定位第10列,
|
|
|
|
if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; }
|
|
if (ID == null) ID = dat.Rows.Count.ToString();
|
|
ViewStep viewstop = new ViewStep(Numder, P1, P2, P3, P4, P5);
|
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
|
|
viewstop.data = ID;
|
|
viewstop.ShowDialog();
|
|
}
|
|
}
|
|
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
|
{
|
|
int i = dat.Rows.Count;
|
|
int n = StrToInt.To16Convert10(ID);
|
|
if (e.Mode)
|
|
{
|
|
DataRow dr = dat.Rows[n - 1];
|
|
dr.BeginEdit();
|
|
dr["StepID"] = e.StepID;
|
|
dr["StepName"] = e.StepNAME;
|
|
dr["ParameterName"] = e.PNAME;
|
|
dr["Parameter1"] = e.P1;
|
|
dr["Parameter2"] = e.P2;
|
|
dr["Parameter3"] = e.P3;
|
|
dr["Parameter4"] = e.P4;
|
|
dr["Parameter5"] = e.P5;
|
|
dr.EndEdit();
|
|
}
|
|
else
|
|
{
|
|
dat.Rows.RemoveAt(Convert.ToInt32(ID) - 1);
|
|
DatSteps(dat);
|
|
}
|
|
Grid_data.ItemsSource = dat.DefaultView;
|
|
}
|
|
|
|
private void TEMP()
|
|
{
|
|
//处理计划温度图表
|
|
TEMPTable.Clear();
|
|
DataRow nrow = TEMPTable.NewRow();
|
|
string TIMET = "00:00:00";
|
|
Double MSTT = 30.0;
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
for (int i = 0; i < dat.Rows.Count; i++)
|
|
{
|
|
switch (dat.Rows[i][3].ToString())//步骤用时计算
|
|
{
|
|
case "001":
|
|
Double TT = MSTT;
|
|
Double TC;
|
|
TC = (Double)dat.Rows[i][7];
|
|
if (TC > 9.9 || TC < 0.1) TC = 9.9;//计算限制
|
|
MSTT = (Double)dat.Rows[i][6];
|
|
TT = Math.Abs(MSTT - TT) / TC * 60;
|
|
TIMET = Convert.ToDateTime(TIMET).AddSeconds(TT).ToString("HH:mm:ss");
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
TIMET = Convert.ToDateTime(TIMET).AddMinutes((Double)dat.Rows[i][8]).ToString("HH:mm:ss");
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
break;
|
|
case "007":
|
|
TIMET = Convert.ToDateTime(TIMET).AddMinutes(5).ToString("HH:mm:ss");
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
break;
|
|
case "008":
|
|
TIMET = Convert.ToDateTime(TIMET).AddMinutes(5).ToString("HH:mm:ss");
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
break;
|
|
case "013":
|
|
break;
|
|
case "015":
|
|
break;
|
|
case "017":
|
|
break;
|
|
case "020":
|
|
TIMET = Convert.ToDateTime(TIMET).AddMinutes(5).ToString("HH:mm:ss");
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
break;
|
|
case "022":
|
|
TIMET = Convert.ToDateTime(TIMET).AddMinutes(5).ToString("HH:mm:ss");
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
break;
|
|
case "031":
|
|
TIMET = Convert.ToDateTime(TIMET).AddMinutes((int)dat.Rows[i][6]).ToString("HH:mm:ss");
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
break;
|
|
case "065":
|
|
TIMET = Convert.ToDateTime(TIMET).AddMinutes((int)dat.Rows[i][8]).ToString("HH:mm:ss");
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
break;
|
|
case "091":
|
|
break;
|
|
case "093":
|
|
TIMET = Convert.ToDateTime(TIMET).AddMinutes((int)dat.Rows[i][6]).ToString("HH:mm:ss");
|
|
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
Picture.Content = new View.CurveTemp(TEMPTable);
|
|
}
|
|
|
|
private void comboBoxWorkOrder_KeyDown(object sender, KeyEventArgs e)//工单输入
|
|
{
|
|
if (e.Key == Key.Enter)
|
|
{
|
|
try
|
|
{
|
|
//do what you want
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|
|
private void Tb_KeyTEXTClothWeight(object sender, TextCompositionEventArgs e)//输入事件
|
|
{
|
|
Regex numbeRegex = new Regex("^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$");
|
|
e.Handled =
|
|
!numbeRegex.IsMatch(
|
|
TEXTClothWeight.Text.Insert(
|
|
TEXTClothWeight.SelectionStart, e.Text));
|
|
TEXTClothWeight.Text = TEXTClothWeight.Text.Trim();
|
|
}
|
|
private void Tb_KeyTEXTBathRatio(object sender, TextCompositionEventArgs e)//输入事件
|
|
{
|
|
Regex numbeRegex = new Regex("^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$");
|
|
e.Handled =
|
|
!numbeRegex.IsMatch(
|
|
TEXTBathRatio.Text.Insert(
|
|
TEXTBathRatio.SelectionStart, e.Text));
|
|
TEXTBathRatio.Text = TEXTBathRatio.Text.Trim();
|
|
}
|
|
private void Tb_KeyTEXTTotal(object sender, TextCompositionEventArgs e)//输入事件
|
|
{
|
|
Regex numbeRegex = new Regex("^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$");
|
|
e.Handled =
|
|
!numbeRegex.IsMatch(
|
|
TEXTTotal.Text.Insert(
|
|
TEXTTotal.SelectionStart, e.Text));
|
|
TEXTTotal.Text = TEXTTotal.Text.Trim();
|
|
}
|
|
}
|
|
}
|
|
|