Browse Source

锁功能生效,操作锁

master
sc 2 months ago
parent
commit
469d76f9b0
  1. 8
      DyeingComputer.csproj
  2. BIN
      Lmage/IconParkInfo.png
  3. 27
      Properties/Resources.Designer.cs
  4. 9
      Properties/Resources.en-US.resx
  5. 9
      Properties/Resources.resx
  6. 9
      Properties/Resources.zh-CN.resx
  7. 9
      Properties/Resources.zh-TW.resx
  8. 73
      UserClass/AsyncTcpServer.cs
  9. 3
      View/TechnologicalProcessView.xaml
  10. 250
      View/TechnologicalProcessView.xaml.cs
  11. 290
      View/WorkOrderView.xaml.cs
  12. 109
      ViewModel/MainWindowViewModel.cs
  13. 22
      Windows/UserInf.xaml
  14. 48
      Windows/UserInf.xaml.cs

8
DyeingComputer.csproj

@ -201,6 +201,9 @@
<Compile Include="Windows\Sampling.xaml.cs">
<DependentUpon>Sampling.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\UserInf.xaml.cs">
<DependentUpon>UserInf.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\UserCall.xaml.cs">
<DependentUpon>UserCall.xaml</DependentUpon>
</Compile>
@ -282,6 +285,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\UserInf.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Windows\UserCall.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -425,6 +432,7 @@
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.css" />
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.min.css" />
<Content Include="Fonts\font-awesome-4.7.0\fonts\fontawesome-webfont.svg" />
<Resource Include="Lmage\IconParkInfo.png" />
<Resource Include="Lmage\ID051.png" />
<Resource Include="Lmage\ID050.png" />
<Resource Include="Lmage\ADD.jpg" />

BIN
Lmage/IconParkInfo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

27
Properties/Resources.Designer.cs

@ -699,6 +699,15 @@ namespace DyeingComputer.Properties {
}
}
/// <summary>
/// 查找类似 Locked state 的本地化字符串。
/// </summary>
public static string LockedState {
get {
return ResourceManager.GetString("LockedState", resourceCulture);
}
}
/// <summary>
/// 查找类似 Low-water level 的本地化字符串。
/// </summary>
@ -897,6 +906,15 @@ namespace DyeingComputer.Properties {
}
}
/// <summary>
/// 查找类似 please continue after the restriction is lifted 的本地化字符串。
/// </summary>
public static string PCATRIL {
get {
return ResourceManager.GetString("PCATRIL", resourceCulture);
}
}
/// <summary>
/// 查找类似 PHControl 的本地化字符串。
/// </summary>
@ -1338,6 +1356,15 @@ namespace DyeingComputer.Properties {
}
}
/// <summary>
/// 查找类似 The current operation is restricted 的本地化字符串。
/// </summary>
public static string TCOIR {
get {
return ResourceManager.GetString("TCOIR", resourceCulture);
}
}
/// <summary>
/// 查找类似 Process 的本地化字符串。
/// </summary>

9
Properties/Resources.en-US.resx

@ -591,4 +591,13 @@
<data name="Inspect" xml:space="preserve">
<value>Waiting For Check</value>
</data>
<data name="LockedState" xml:space="preserve">
<value>Locked state</value>
</data>
<data name="TCOIR" xml:space="preserve">
<value>The current operation is restricted</value>
</data>
<data name="PCATRIL" xml:space="preserve">
<value>please continue after the restriction is lifted</value>
</data>
</root>

9
Properties/Resources.resx

@ -591,4 +591,13 @@
<data name="Inspect" xml:space="preserve">
<value>Inspect</value>
</data>
<data name="LockedState" xml:space="preserve">
<value>Locked state</value>
</data>
<data name="TCOIR" xml:space="preserve">
<value>The current operation is restricted</value>
</data>
<data name="PCATRIL" xml:space="preserve">
<value>please continue after the restriction is lifted</value>
</data>
</root>

9
Properties/Resources.zh-CN.resx

@ -591,4 +591,13 @@
<data name="Inspect" xml:space="preserve">
<value>等待检查</value>
</data>
<data name="LockedState" xml:space="preserve">
<value>锁定状态</value>
</data>
<data name="TCOIR" xml:space="preserve">
<value>当前操作已限制</value>
</data>
<data name="PCATRIL" xml:space="preserve">
<value>请解除限制后继续</value>
</data>
</root>

9
Properties/Resources.zh-TW.resx

@ -591,4 +591,13 @@
<data name="Inspect" xml:space="preserve">
<value>等待檢查</value>
</data>
<data name="LockedState" xml:space="preserve">
<value>锁定状态</value>
</data>
<data name="TCOIR" xml:space="preserve">
<value>目前操作已限制</value>
</data>
<data name="PCATRIL" xml:space="preserve">
<value>請解除限制後繼續</value>
</data>
</root>

73
UserClass/AsyncTcpServer.cs

@ -1,30 +1,31 @@
using DyeingComputer.UserClass;
using DyeingComputer.View;
using DyeingComputer.ViewModel;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Sockets;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using TouchSocket.Core;
using TouchSocket.Sockets;
using DyeingComputer.ViewModel;
using System.Runtime.InteropServices;
using static System.Windows.Forms.AxHost;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Newtonsoft.Json;
using static DyeingComputer.UserClass.SqliteHelper;
using DyeingComputer.View;
using System.Windows;
using System.Windows.Controls;
using static System.Net.WebRequestMethods;
using System.Collections;
using static System.Windows.Forms.AxHost;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace DyeingComputer.UserClass
{/// <summary>
@ -242,6 +243,7 @@ namespace DyeingComputer.UserClass
else if (dat_821.GetValue("INSTRUCTION").ToString() == "PAUSE")
{
MainWindowViewModel.WORK_RUN = 1;//暂停
MainWindowViewModel.errTabler.Clear();
client.SendAsync("SC821" + SYSKEY + SYSDAT);
}
@ -299,20 +301,14 @@ namespace DyeingComputer.UserClass
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
MainWindow.SQLiteHelpers.Delete("RUN", null, null);
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
{
data_t.Clear();//清空
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
DataRow drT = data_t.NewRow();
drT.ItemArray = dt.ItemArray;
data_t.Rows.InsertAt(drT, 0);
drT.BeginEdit(); //添加订单号
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
drT.EndEdit();
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
dt.BeginEdit(); //添加订单号
dt["DYELOT"] = MainWindowViewModel.WorkNumder;
dt.EndEdit();
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
}
//SQLiteHelpers.Close(); //关闭连接
@ -345,19 +341,13 @@ namespace DyeingComputer.UserClass
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
{
data_t.Clear();//清空
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
DataRow drT = data_t.NewRow();
drT.ItemArray = dt.ItemArray;
data_t.Rows.InsertAt(drT, 0);
drT.BeginEdit(); //添加订单号
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
drT.EndEdit();
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
}
//SQLiteHelpers.Close(); //关闭连接
dt.BeginEdit(); //添加订单号
dt["DYELOT"] = MainWindowViewModel.WorkNumder;
dt.EndEdit();
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
} //SQLiteHelpers.Close(); //关闭连接
client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString());
MainWindowViewModel.TX++;
@ -374,17 +364,12 @@ namespace DyeingComputer.UserClass
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
{
data_t.Clear();//清空
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
DataRow drT = data_t.NewRow();
drT.ItemArray = dt.ItemArray;
data_t.Rows.InsertAt(drT, 0);
drT.BeginEdit(); //添加订单号
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
drT.EndEdit();
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
dt.BeginEdit(); //添加订单号
dt["DYELOT"] = MainWindowViewModel.WorkNumder;
dt.EndEdit();
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
}
//SQLiteHelpers.Close(); //关闭连接

3
View/TechnologicalProcessView.xaml

@ -209,7 +209,8 @@
</DataGrid.Columns>
</DataGrid>
<DataGrid x:Name="Parameter_set" Visibility="Collapsed" AutoGenerateColumns="False" FontSize="15" AlternationCount="2"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" ColumnHeaderHeight="40" CellEditEnding="Parameter_set_CellEditEnding">
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" ColumnHeaderHeight="40"
CellEditEnding="Parameter_set_CellEditEnding" BeginningEdit="Parameter_set_BeginningEdit" >
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Height" Value="30" />

250
View/TechnologicalProcessView.xaml.cs

@ -196,11 +196,21 @@ namespace DyeingComputer.View
Parameter_set.ItemsSource = tblDatas.DefaultView;
}
private void Parameter_set_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
private void Parameter_set_BeginningEdit(object sender, DataGridBeginningEditEventArgs e)
{
string VID;
if (MainWindowViewModel._Lock_bool)
{
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
return;
}
}
private void Parameter_set_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
string VID;
string newValue = (e.EditingElement as TextBox).Text;//获得输入单元格信息
int rownum = Parameter_set.SelectedIndex;//获取鼠标选中行并定义变量
if (rownum != -1)//判断鼠标定位是否有效
{
@ -233,8 +243,8 @@ namespace DyeingComputer.View
}
MainWindowViewModel.Updata_dtm(VID, i);
}
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Parameter",
"ID=" + VID + ";Name=" + Vname + ";Value="+newValue);
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Parameter",
"ID=" + VID + ";Name=" + Vname + ";Value=" + newValue);
}
catch { }
ParameterSet_d();
@ -320,18 +330,26 @@ namespace DyeingComputer.View
{
// FocusManager.SetFocusedElement(Grid, Grid);
// Grid.DataContext = new MainWindowViewModel();
}
}
private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)//编辑按钮
{
// if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; }
if (ID == null) return;//ID = sql.Tables[0].Rows.Count.ToString();
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Edit", "STEP = " + ID);
ViewStep viewstop = new ViewStep(Numder, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First());
viewstop.boxNAME.IsEnabled=false;
//viewstop.no.IsEnabled = false;
viewstop.data = ID;
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
viewstop.ShowDialog();
if (!MainWindowViewModel._Lock_bool)
{
// if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; }
if (ID == null) return;//ID = sql.Tables[0].Rows.Count.ToString();
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Edit", "STEP = " + ID);
ViewStep viewstop = new ViewStep(Numder, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First());
viewstop.boxNAME.IsEnabled = false;
//viewstop.no.IsEnabled = false;
viewstop.data = ID;
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
viewstop.ShowDialog();
}
else
{
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
}
}
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
{
@ -410,92 +428,109 @@ namespace DyeingComputer.View
}
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)//删除
{
int d = 0;
int a = MainWindowViewModel.dt_TP.Rows.Count;
if (!MainWindowViewModel._Lock_bool)
{
int d = 0;
int a = MainWindowViewModel.dt_TP.Rows.Count;
if (ID != null) { d = Convert.ToInt16(ID); } else { return; }
MainWindowViewModel.dt_TP.Rows.RemoveAt(d - 1);
Dat();
GridSTEP.SelectedIndex = -1;
if (ID != null) { d = Convert.ToInt16(ID); } else { return; }
MainWindowViewModel.dt_TP.Rows.RemoveAt(d - 1);
Dat();
GridSTEP.SelectedIndex = -1;
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
MainWindow.SQLiteHelpers.Delete("RUN", null, null);
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
a = MainWindowViewModel.dt_TP.Rows.Count;
for (int i = 0; i < a; i++)
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
MainWindow.SQLiteHelpers.Delete("RUN", null, null);
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
a = MainWindowViewModel.dt_TP.Rows.Count;
for (int i = 0; i < a; i++)
{
data_t.Clear();//清空
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
DataRow drT = data_t.NewRow();
drT.ItemArray = dt.ItemArray;
data_t.Rows.InsertAt(drT, 0);
drT.BeginEdit(); //添加订单号
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
drT.EndEdit();
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
}
//SQLiteHelpers.Close(); //关闭连接
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Delete", "STEP = " + ID);
MainWindowViewModel.User_Button = true;
}
else
{
data_t.Clear();//清空
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
DataRow drT = data_t.NewRow();
drT.ItemArray = dt.ItemArray;
data_t.Rows.InsertAt(drT, 0);
drT.BeginEdit(); //添加订单号
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
drT.EndEdit();
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
}
//SQLiteHelpers.Close(); //关闭连接
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Delete", "STEP = " + ID);
MainWindowViewModel.User_Button = true;
}
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入
{
int d = 0;
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
//SQLiteHelpers.Open(); //打开数据库
string ProgramID = MainWindow.SQLiteHelpers.ExecuteScalar("select ProgramID from RUN where Step = '1'", null).ToString();
string ProgramNAME = MainWindow.SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
// SQLiteHelpers.Close();
if (!MainWindowViewModel._Lock_bool)
{
int d = 0;
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
//SQLiteHelpers.Open(); //打开数据库
string ProgramID = MainWindow.SQLiteHelpers.ExecuteScalar("select ProgramID from RUN where Step = '1'", null).ToString();
string ProgramNAME = MainWindow.SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
// SQLiteHelpers.Close();
if (ID != null) { d = Convert.ToInt16(ID); } else { return; }
DataRow dr = MainWindowViewModel.dt_TP.NewRow();//添加表数据
//
dr["WorkOrder"] = MainWindowViewModel.WorkNumder;
dr["ProgramID"] = ProgramID;
dr["Program"] = ProgramNAME;
dr["Parameter1"] = 0;
dr["Parameter2"] = 0;
dr["Parameter3"] = 0;
dr["Parameter4"] = 0;
dr["Parameter5"] = 0;
dr["Parameter6"] = 0;
dr["Parameter7"] = 0;
dr["Parameter8"] = 0;
dr["Parameter9"] = 0;
dr["Parameter10"] = 0;
dr["Parameter1_S1"] = 0;
dr["Parameter2_S1"] = 0;
dr["Parameter3_S1"] = 0;
dr["Parameter4_S1"] = 0;
dr["Parameter5_S1"] = 0;
dr["Parameter1_S2"] = 0;
dr["Parameter2_S2"] = 0;
dr["Parameter3_S2"] = 0;
dr["Parameter4_S2"] = 0;
dr["Parameter5_S2"] = 0;
dr["Parameter1_S3"] = 0;
dr["Parameter2_S3"] = 0;
dr["Parameter3_S3"] = 0;
dr["Parameter4_S3"] = 0;
dr["Parameter5_S3"] = 0;
dr["StepName_S1"] = " ";
dr["StepName_S2"] = " ";
dr["StepName_S3"] = " ";
dr["StepID_S1"] = "000";
dr["StepID_S2"] = "000";
dr["StepID_S3"] = "000";
MainWindowViewModel.dt_TP.Rows.InsertAt(dr, d - 1);
// ID = null;
Dat();
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Insert", "STEP = "+ID);
if (ID == null) return;// ID = MainWindowViewModel.dt_TP.Rows.Count.ToString();
ViewStep viewstop = new ViewStep(null, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First());
viewstop.boxNAME.IsEnabled = false;
//viewstop.no.IsEnabled = false;
viewstop.data = ID;
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_InsertClicked);
viewstop.ShowDialog();
if (ID != null) { d = Convert.ToInt16(ID); } else { return; }
DataRow dr = MainWindowViewModel.dt_TP.NewRow();//添加表数据
//
dr["WorkOrder"] = MainWindowViewModel.WorkNumder;
dr["ProgramID"] = ProgramID;
dr["Program"] = ProgramNAME;
dr["Parameter1"] = 0;
dr["Parameter2"] = 0;
dr["Parameter3"] = 0;
dr["Parameter4"] = 0;
dr["Parameter5"] = 0;
dr["Parameter6"] = 0;
dr["Parameter7"] = 0;
dr["Parameter8"] = 0;
dr["Parameter9"] = 0;
dr["Parameter10"] = 0;
dr["Parameter1_S1"] = 0;
dr["Parameter2_S1"] = 0;
dr["Parameter3_S1"] = 0;
dr["Parameter4_S1"] = 0;
dr["Parameter5_S1"] = 0;
dr["Parameter1_S2"] = 0;
dr["Parameter2_S2"] = 0;
dr["Parameter3_S2"] = 0;
dr["Parameter4_S2"] = 0;
dr["Parameter5_S2"] = 0;
dr["Parameter1_S3"] = 0;
dr["Parameter2_S3"] = 0;
dr["Parameter3_S3"] = 0;
dr["Parameter4_S3"] = 0;
dr["Parameter5_S3"] = 0;
dr["StepName_S1"] = " ";
dr["StepName_S2"] = " ";
dr["StepName_S3"] = " ";
dr["StepID_S1"] = "000";
dr["StepID_S2"] = "000";
dr["StepID_S3"] = "000";
MainWindowViewModel.dt_TP.Rows.InsertAt(dr, d - 1);
// ID = null;
Dat();
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Insert", "STEP = " + ID);
if (ID == null) return;// ID = MainWindowViewModel.dt_TP.Rows.Count.ToString();
ViewStep viewstop = new ViewStep(null, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First());
viewstop.boxNAME.IsEnabled = false;
//viewstop.no.IsEnabled = false;
viewstop.data = ID;
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_InsertClicked);
viewstop.ShowDialog();
}
else
{
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
}
}
private void Address_InsertClicked(object sender, AddressUpdateEventArgs e)//插入返回结果
{
@ -563,17 +598,24 @@ namespace DyeingComputer.View
}
private void ProgramgroupView_Jump_Click(object sender, RoutedEventArgs e)
{
DataRow dr = MainWindowViewModel.dt_TP.Select("Step='" + ID + "'").First();
dr.BeginEdit();
dr["RUN"] = 2;
dr.EndEdit();
MainWindowViewModel.User_Button = true;
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(ID);//插入步骤号
MainWindowViewModel.STEP_START(Numder, Convert.ToDouble(P1), Convert.ToDouble(P2), Convert.ToDouble(P3),
Convert.ToDouble(P4), Convert.ToDouble(P5));
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Jump", "STEP = " + ID +
";StepID=" + Numder + ";P1=" + P1 + ";P2=" + P2 + ";P3=" + P3 + ";P4=" + P4 + ";P5=" + P5);
if (!MainWindowViewModel._Lock_bool)
{
DataRow dr = MainWindowViewModel.dt_TP.Select("Step='" + ID + "'").First();
dr.BeginEdit();
dr["RUN"] = 2;
dr.EndEdit();
MainWindowViewModel.User_Button = true;
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(ID);//插入步骤号
MainWindowViewModel.STEP_START(Numder, Convert.ToDouble(P1), Convert.ToDouble(P2), Convert.ToDouble(P3),
Convert.ToDouble(P4), Convert.ToDouble(P5));
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Jump", "STEP = " + ID +
";StepID=" + Numder + ";P1=" + P1 + ";P2=" + P2 + ";P3=" + P3 + ";P4=" + P4 + ";P5=" + P5);
}
else
{
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
}
}//跳步
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

290
View/WorkOrderView.xaml.cs

@ -105,32 +105,48 @@ namespace DyeingComputer.View
// Process_id = null;
// _lock = null;
}
private void WorkOrderView_lock_Click(object sender, RoutedEventArgs e)//锁定按钮
{
if (WorkOrder_Numder == null) return;
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
updata_temp.Clear();//使用前清理缓存
if (_lock == "0") //改变lock的状态
if (!MainWindowViewModel._Lock_bool)
{
updata_temp.Add("lock", 1);
MainWindow.SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + WorkOrder_Numder + "'", null);
if (WorkOrder_Numder == null) return;
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
updata_temp.Clear();//使用前清理缓存
if (_lock == "0") //改变lock的状态
{
updata_temp.Add("lock", 1);
MainWindow.SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + WorkOrder_Numder + "'", null);
}
else
{
updata_temp.Add("lock", 0);
MainWindow.SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + WorkOrder_Numder + "'", null);
}
//SQLiteHelpers.Close();
Workorder_sql();
}
else
{
updata_temp.Add("lock", 0);
MainWindow.SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + WorkOrder_Numder + "'", null);
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
}
//SQLiteHelpers.Close();
Workorder_sql();
}
private void WorkOrderView_new_Click(object sender, RoutedEventArgs e)//新建按钮
{
ViewProgram viewProgram = new ViewProgram();
viewProgram.AddressUpdated += new ViewProgram.AddressUpdateHandler(Address_ButtonClicked);
viewProgram.ShowDialog();
if (!MainWindowViewModel._Lock_bool)
{
ViewProgram viewProgram = new ViewProgram();
viewProgram.AddressUpdated += new ViewProgram.AddressUpdateHandler(Address_ButtonClicked);
viewProgram.ShowDialog();
}
else
{
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
}
}
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//新建返回结果
{
@ -161,60 +177,72 @@ namespace DyeingComputer.View
MainWindow.SQLiteHelpers.InsertData("WorkOrder", WorkOrder_new);//
/*获取转并插入步骤信息*/
DataTable step_dat = MainWindow.SQLiteHelpers.ExecuteDataSet(
"select * from ProgramSteps where ProgramID='" + Process_id + "'", null).Tables[0]; //读取表写入缓存
DataTable _t = step_dat.Clone();
_t.Columns.Add("WorkOrder", System.Type.GetType("System.String"));
_t.Columns.Add("DYELOT", System.Type.GetType("System.String"));
"select * from ProgramSteps where ProgramID='" + Process_id + "'", null).Tables[0]; //读取表写入缓存
step_dat.Columns.Add("WorkOrder", System.Type.GetType("System.String"));
step_dat.Columns.Add("DYELOT", System.Type.GetType("System.String"));
int a = step_dat.Rows.Count;
for (int i = 0; i < a; i++)
{
_t.Clear();//清空
DataRow dt = step_dat.Rows[i];//行转
DataRow dr = _t.NewRow();
dr.ItemArray = dt.ItemArray;
dr.BeginEdit(); //添加订单号
dr["WorkOrder"] = WorkOrder_Numder;
dr["DYELOT"] = WorkOrder_Numder;
dr.EndEdit();
_t.Rows.InsertAt(dr, 0); //行转换
MainWindow.SQLiteHelpers.InsertData("WorkorderSteps", MainWindow.SQLiteHelpers.DataTableToDictionary(_t));//行插入
dt.BeginEdit(); //添加订单号
dt["WorkOrder"] = WorkOrder_Numder;
dt["DYELOT"] = WorkOrder_Numder;
dt.EndEdit();
MainWindow.SQLiteHelpers.InsertData("WorkorderSteps", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
}
//SQLiteHelpers.Close();
}
private void WorkOrderView_del_Click(object sender, RoutedEventArgs e)//删除按钮
{
if (WorkOrder_Numder == null) return;
///弹窗提示确认删除
if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm +
Properties.Resources.Delete + WorkOrder_Numder, "Delete ",
System.Windows.Forms.MessageBoxButtons.OKCancel,
System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
{
if (!MainWindowViewModel._Lock_bool)
{
///执行删除
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
MainWindow.SQLiteHelpers.Delete("WorkOrder", "WorkOrder='" + WorkOrder_Numder + "'", null);
//SQLiteHelpers.Close();
Workorder_sql();
if (WorkOrder_Numder == null) return;
///弹窗提示确认删除
if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm +
Properties.Resources.Delete + WorkOrder_Numder, "Delete ",
System.Windows.Forms.MessageBoxButtons.OKCancel,
System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
{
///执行删除
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
MainWindow.SQLiteHelpers.Delete("WorkOrder", "WorkOrder='" + WorkOrder_Numder + "'", null);
//SQLiteHelpers.Close();
Workorder_sql();
}
SQL_UPDATE = false;
}
SQL_UPDATE = false;
}
else
{
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
}
}
private void WorkOrderView_redy_Click(object sender, RoutedEventArgs e)//重染按钮
{
string WorkNum = MainWindowViewModel.WorkNumder.ToString();
if (WorkNum != null)
if (!MainWindowViewModel._Lock_bool)
{
if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm +
Properties.Resources.Redye + WorkNum, "Redye ",
System.Windows.Forms.MessageBoxButtons.OKCancel,
System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
string WorkNum = MainWindowViewModel.WorkNumder.ToString();
if (WorkNum != null)
{
///执行重染
if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm +
Properties.Resources.Redye + WorkNum, "Redye ",
System.Windows.Forms.MessageBoxButtons.OKCancel,
System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
{
///执行重染
}
}
SQL_UPDATE = false;
}
else
{
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
}
SQL_UPDATE = false;
}
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
@ -330,93 +358,101 @@ namespace DyeingComputer.View
}
private void Image_MouseLeftButtonUp1(object sender, MouseButtonEventArgs e)
{
SQL_UPDATE = false;
((System.Windows.Controls.Image)sender).RenderTransform = Transform.Identity;
if (string.IsNullOrEmpty(WorkOrder_Numder)) return;
if (_lock == "1")
if (!MainWindowViewModel._Lock_bool)
{
MessageBoxResult messageBox = System.Windows.MessageBox.Show(
Properties.Resources.Process_lock, "800", MessageBoxButton.OK);
return;
}
DataTable WorkorderSteps = new DataTable();
int a;
SQL_UPDATE = false;
((System.Windows.Controls.Image)sender).RenderTransform = Transform.Identity;
if (string.IsNullOrEmpty(WorkOrder_Numder)) return;
if (_lock == "1")
{
MessageBoxResult messageBox = System.Windows.MessageBox.Show(
Properties.Resources.Process_lock, "800", MessageBoxButton.OK);
return;
}
/*检查并写入run信息*/
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
DataTable WorkorderSteps = new DataTable();
int a;
int R_D = MainWindow.SQLiteHelpers.ExecuteDataSet("select * from RUN", null).Tables[0].Rows.Count; //读取表写入缓存
if (R_D > 0)//判断是否有运行中工艺
{
//SQLiteHelpers.Close(); //关闭连接
/*检查并写入run信息*/
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(
Properties.Resources.RunningProcess, "800", MessageBoxButton.YesNo);
if (messageBoxResult == MessageBoxResult.No) return;
if (messageBoxResult == MessageBoxResult.Yes)
int R_D = MainWindow.SQLiteHelpers.ExecuteDataSet("select * from RUN", null).Tables[0].Rows.Count; //读取表写入缓存
if (R_D > 0)//判断是否有运行中工艺
{
if (MainWindowViewModel.S17 == 1) //拒绝操作
//SQLiteHelpers.Close(); //关闭连接
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(
Properties.Resources.RunningProcess, "800", MessageBoxButton.YesNo);
if (messageBoxResult == MessageBoxResult.No) return;
if (messageBoxResult == MessageBoxResult.Yes)
{
System.Windows.MessageBox.Show(Properties.Resources.refuse, "800", MessageBoxButton.OK);
return;
if (MainWindowViewModel.S17 == 1) //拒绝操作
{
System.Windows.MessageBox.Show(Properties.Resources.refuse, "800", MessageBoxButton.OK);
return;
}
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
}
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
// SQLiteHelpers.Open(); //打开数据库
}
}
updata_temp.Clear(); //使用前清缓存
updata_temp.Add("State", 205);
MainWindow.SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + WorkOrder_Numder + "'", null);
MainWindowViewModel.Dyelot_dat = MainWindow.SQLiteHelpers.ExecuteDataSet("select * from Dyelot where Dyelot = '" +
Dyelot + "'", null).Tables[0];
WorkorderSteps = MainWindow.SQLiteHelpers.ExecuteDataSet(
"select * from WorkorderSteps where WorkOrder='" + WorkOrder_Numder + "'", null).Tables[0]; //读取表写入缓存
MainWindowViewModel.ProgramName = Process_Name;
MainWindowViewModel.Dyelot = Dyelot;
MainWindow.SQLiteHelpers.Delete("RUN", null, null); //删除run信息
a = WorkorderSteps.Rows.Count;
for (int i = 0; i < a; i++)
{
DataRow dr = WorkorderSteps.Rows[i];//行转
dr.BeginEdit(); //添加订单号
dr["ProgramID"] = Process_id;
dr["Program"] = MainWindowViewModel.ProgramName;
dr.EndEdit();
updata_temp.Clear(); //使用前清缓存
updata_temp.Add("State", 205);
MainWindow.SQLiteHelpers.Update("WorkOrder", updata_temp, "WorkOrder='" + WorkOrder_Numder + "'", null);
MainWindowViewModel.Dyelot_dat = MainWindow.SQLiteHelpers.ExecuteDataSet("select * from Dyelot where Dyelot = '" +
Dyelot + "'", null).Tables[0];
WorkorderSteps = MainWindow.SQLiteHelpers.ExecuteDataSet(
"select * from WorkorderSteps where WorkOrder='" + WorkOrder_Numder + "'", null).Tables[0]; //读取表写入缓存
MainWindowViewModel.ProgramName = Process_Name;
MainWindowViewModel.Dyelot = Dyelot;
MainWindow.SQLiteHelpers.Delete("RUN", null, null); //删除run信息
a = WorkorderSteps.Rows.Count;
for (int i = 0; i < a; i++)
{
DataRow dr = WorkorderSteps.Rows[i];//行转
dr.BeginEdit(); //添加订单号
dr["ProgramID"] = Process_id;
dr["Program"] = MainWindowViewModel.ProgramName;
dr.EndEdit();
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dr));//行插入
}
updata_temp.Clear(); //使用前清缓存
updata_temp.Add("RUN", 1);
MainWindow.SQLiteHelpers.Update("RUN", updata_temp, "Step=1", null);
//SQLiteHelpers.Close(); //关闭连接
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dr));//行插入
}
updata_temp.Clear(); //使用前清缓存
updata_temp.Add("RUN", 1);
MainWindow.SQLiteHelpers.Update("RUN", updata_temp, "Step=1", null);
//SQLiteHelpers.Close(); //关闭连接
/*触发启动*/
string Numder = WorkorderSteps.Select("Step = 1").First().Field<string>("StepID");//
double P1 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter1");
double P2 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter2");
double P3 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter3");
double P4 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter4");
double P5 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter5");
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(1);//插入步骤号
MainWindowViewModel.STEP_START(Numder, Convert.ToDouble(P1), Convert.ToDouble(P2), Convert.ToDouble(P3),
Convert.ToDouble(P4), Convert.ToDouble(P5));
MainWindowViewModel.WORK_RUN = 2;
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Jump", "STEP = " +
MainWindowViewModel.RUN_STEPID + ";StepID=" + Numder + ";P1=" + P1 + ";P2=" + P2 + ";P3=" + P3 + ";P4=" + P4 + ";P5=" + P5);
/*选定工艺有效跳转准备 */
if (Process_id != null) //选定工艺有效跳转准备
{
MainWindowViewModel.WorkNumder = WorkOrder_Numder;
TechnologicalProcessView.workName = Process_id;
MainWindowViewModel.SYS_REDYE = 0;
/*触发启动*/
string Numder = WorkorderSteps.Select("Step = 1").First().Field<string>("StepID");//
double P1 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter1");
double P2 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter2");
double P3 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter3");
double P4 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter4");
double P5 = WorkorderSteps.Select("Step = 1").First().Field<double>("Parameter5");
MainWindowViewModel.RUN_STEPID = Convert.ToInt16(1);//插入步骤号
MainWindowViewModel.STEP_START(Numder, Convert.ToDouble(P1), Convert.ToDouble(P2), Convert.ToDouble(P3),
Convert.ToDouble(P4), Convert.ToDouble(P5));
MainWindowViewModel.WORK_RUN = 2;
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Jump", "STEP = " +
MainWindowViewModel.RUN_STEPID + ";StepID=" + Numder + ";P1=" + P1 + ";P2=" + P2 + ";P3=" + P3 + ";P4=" + P4 + ";P5=" + P5);
/*选定工艺有效跳转准备 */
if (Process_id != null) //选定工艺有效跳转准备
{
MainWindowViewModel.WorkNumder = WorkOrder_Numder;
TechnologicalProcessView.workName = Process_id;
MainWindowViewModel.SYS_REDYE = 0;
MainWindowViewModel.ViewID = 1;
var _mainWindow = Application.Current.Windows.Cast<Window>().FirstOrDefault(window => window is MainWindow) as MainWindow;//跨页面
_mainWindow.container.Content = new TechnologicalProcessView();//获取控件
MainWindowViewModel.ViewID = 1;
var _mainWindow = Application.Current.Windows.Cast<Window>().FirstOrDefault(window => window is MainWindow) as MainWindow;//跨页面
_mainWindow.container.Content = new TechnologicalProcessView();//获取控件
}
}
else
{
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
}
}//开始

109
ViewModel/MainWindowViewModel.cs

@ -38,6 +38,7 @@ using static DyeingComputer.UserClass.SqliteHelper;
using static DyeingComputer.ViewModel.MainWindowViewModel;
using static DyeingComputer.Windows.ViewStep;
using static System.Net.WebRequestMethods;
using static System.Windows.Forms.AxHost;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
@ -443,55 +444,69 @@ namespace DyeingComputer.ViewModel
}
private void ProgramgroupView_run_()////运行/暂停
{
if (WORK_RUN == 2)
if (!_Lock_bool)
{
UserButton = true;
IsInteractive = true;
WORK_RUN = 1;// 运行时停止键为暂停
errTabler.Clear();
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = Pause", WORK_RUN.ToString());
if (WORK_RUN == 2)
{
UserButton = true;
IsInteractive = true;
WORK_RUN = 1;// 运行时停止键为暂停
errTabler.Clear();
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = Pause", WORK_RUN.ToString());
}
else
if (WORK_RUN == 1)
{
UserButton = false;
IsInteractive = false;
WORK_RUN = 2;//
SETP_runtime = true;
TechnologicalProcess_view();
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = RUN", WORK_RUN.ToString());
}
else
{
UserButton = true;
IsInteractive = true;
}
}
else
if (WORK_RUN == 1)
{
UserButton = false;
IsInteractive = false;
WORK_RUN = 2;//
SETP_runtime = true;
TechnologicalProcess_view();
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = RUN", WORK_RUN.ToString());
}
else
{
UserButton = true;
IsInteractive = true;
USERinf(Resources.LockedState+"\n"+ Resources.TCOIR+"\n"+Resources.PCATRIL);
}
}
public ICommand ProgramgroupView_run { get; }
private void ProgramgroupView_stop_()//结束
{
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", WORK_RUN.ToString());
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.StopProcess, "800", MessageBoxButton.OKCancel);
if (messageBoxResult == MessageBoxResult.OK)
{
Dictionary<string, object> _temp = new Dictionary<string, object>();//缓存函数
_temp.Clear(); //使用前清缓存
_temp.Add("State", 301);
WORK_RUN = 0;// 运行时停止键为
DIDETime = 0;
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "PROCESS_END", WORK_RUN.ToString());
dt_TP.Rows.Clear();
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
//SQLiteHelpers.Open(); //打开数据库
MainWindow.SQLiteHelpers.Delete("RUN", null, null);
MainWindow.SQLiteHelpers.Update("WorkOrder", _temp, "WorkOrder='" + WorkNumder + "'", null);
//SQLiteHelpers.Close(); //关闭连接
UserButton = false;
IsInteractive = false;
ProgramName = null;
WorkNumder = "----------";
if (!_Lock_bool)
{
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", WORK_RUN.ToString());
MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(Properties.Resources.StopProcess, "800", MessageBoxButton.OKCancel);
if (messageBoxResult == MessageBoxResult.OK)
{
Dictionary<string, object> _temp = new Dictionary<string, object>();//缓存函数
_temp.Clear(); //使用前清缓存
_temp.Add("State", 301);
WORK_RUN = 0;// 运行时停止键为
DIDETime = 0;
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "PROCESS_END", WORK_RUN.ToString());
dt_TP.Rows.Clear();
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
//SQLiteHelpers.Open(); //打开数据库
MainWindow.SQLiteHelpers.Delete("RUN", null, null);
MainWindow.SQLiteHelpers.Update("WorkOrder", _temp, "WorkOrder='" + WorkNumder + "'", null);
//SQLiteHelpers.Close(); //关闭连接
UserButton = false;
IsInteractive = false;
ProgramName = null;
WorkNumder = "----------";
}
}
else
{
USERinf(Resources.LockedState + "\n" + Resources.TCOIR + "\n" + Resources.PCATRIL);
}
}
public void CountDown()
@ -742,8 +757,18 @@ namespace DyeingComputer.ViewModel
public static bool Alert_bell = false; //警报铃声
static Dictionary<string, object> updata_RUN = new Dictionary<string, object>();//
/**提示页面信息**/
/**提示步骤页面信息**/
static UserInf userInf = null;
public static void USERinf(string DAT)
{
if (userInf == null || !userInf.IsLoaded)
{
userInf = new UserInf();
userInf.Inf_DAT = DAT;
userInf.Show();
}
}
/**提示步骤页面信息**/
static UserCall userCall = null;
static Sampling sampling = null;
public static void USERcall(string ID, string DAT)

22
Windows/UserInf.xaml

@ -0,0 +1,22 @@
<Window x:Class="DyeingComputer.Windows.UserInf"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DyeingComputer.Windows"
xmlns:lang="clr-namespace:DyeingComputer.Properties"
WindowStartupLocation="CenterScreen"
Loaded ="Window_Loaded"
ResizeMode="NoResize"
mc:Ignorable="d"
Title="SUNLIGHT 800" Height="400" Width="400">
<Grid>
<TextBox x:Name="INF_DATA" Margin="5,5,5,150" TextWrapping="Wrap" FontSize="30" IsReadOnly="True" />
<Image Height="100" Width="100" VerticalAlignment="Bottom" FlowDirection="LeftToRight"
HorizontalAlignment="Left" Margin="25,0,0,27" Source="/Lmage/IconParkInfo.png"/>
<Button Content="{x:Static lang:Resources.YES}" HorizontalAlignment="Right" Height="35" Margin="50,70,20,20"
VerticalAlignment="Bottom" Width="80" Click="YES_Click"/>
</Grid>
</Window>

48
Windows/UserInf.xaml.cs

@ -0,0 +1,48 @@
using DyeingComputer.ViewModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
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.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Xml.Linq;
using static DyeingComputer.UserClass.SqliteHelper;
using static DyeingComputer.Windows.ViewStep;
namespace DyeingComputer.Windows
{
/// <summary>
/// ViewProgram.xaml 的交互逻辑
/// </summary>
public partial class UserInf : Window
{
public string Inf_DAT;//信息
public UserInf()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
INF_DATA.Text = Inf_DAT;
}
private void YES_Click(object sender, RoutedEventArgs e)//确认
{
this.Close(); //关闭窗口
}
}
}
Loading…
Cancel
Save