锁功能生效,操作锁
This commit is contained in:
commit
469d76f9b0
14 files changed
+291
-61
No files matched your search
@@ -201,6 +201,9 @@
|
|||||||
<Compile Include="Windows\Sampling.xaml.cs">
|
<Compile Include="Windows\Sampling.xaml.cs">
|
||||||
<DependentUpon>Sampling.xaml</DependentUpon>
|
<DependentUpon>Sampling.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Windows\UserInf.xaml.cs">
|
||||||
|
<DependentUpon>UserInf.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Windows\UserCall.xaml.cs">
|
<Compile Include="Windows\UserCall.xaml.cs">
|
||||||
<DependentUpon>UserCall.xaml</DependentUpon>
|
<DependentUpon>UserCall.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -282,6 +285,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Windows\UserInf.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="Windows\UserCall.xaml">
|
<Page Include="Windows\UserCall.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<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.css" />
|
||||||
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.min.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" />
|
<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\ID051.png" />
|
||||||
<Resource Include="Lmage\ID050.png" />
|
<Resource Include="Lmage\ID050.png" />
|
||||||
<Resource Include="Lmage\ADD.jpg" />
|
<Resource Include="Lmage\ADD.jpg" />
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
Generated
+27
@@ -699,6 +699,15 @@ namespace DyeingComputer.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Locked state 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string LockedState {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("LockedState", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Low-water level 的本地化字符串。
|
/// 查找类似 Low-water level 的本地化字符串。
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// 查找类似 PHControl 的本地化字符串。
|
/// 查找类似 PHControl 的本地化字符串。
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// 查找类似 Process 的本地化字符串。
|
/// 查找类似 Process 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -591,4 +591,13 @@
|
|||||||
<data name="Inspect" xml:space="preserve">
|
<data name="Inspect" xml:space="preserve">
|
||||||
<value>Waiting For Check</value>
|
<value>Waiting For Check</value>
|
||||||
</data>
|
</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>
|
</root>
|
||||||
@@ -591,4 +591,13 @@
|
|||||||
<data name="Inspect" xml:space="preserve">
|
<data name="Inspect" xml:space="preserve">
|
||||||
<value>Inspect</value>
|
<value>Inspect</value>
|
||||||
</data>
|
</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>
|
</root>
|
||||||
@@ -591,4 +591,13 @@
|
|||||||
<data name="Inspect" xml:space="preserve">
|
<data name="Inspect" xml:space="preserve">
|
||||||
<value>等待检查</value>
|
<value>等待检查</value>
|
||||||
</data>
|
</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>
|
</root>
|
||||||
@@ -591,4 +591,13 @@
|
|||||||
<data name="Inspect" xml:space="preserve">
|
<data name="Inspect" xml:space="preserve">
|
||||||
<value>等待檢查</value>
|
<value>等待檢查</value>
|
||||||
</data>
|
</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>
|
</root>
|
||||||
+27
-42
@@ -1,30 +1,31 @@
|
|||||||
using DyeingComputer.UserClass;
|
using DyeingComputer.UserClass;
|
||||||
|
using DyeingComputer.View;
|
||||||
|
using DyeingComputer.ViewModel;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Diagnostics;
|
|
||||||
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;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using TouchSocket.Core;
|
||||||
|
using TouchSocket.Sockets;
|
||||||
|
using static DyeingComputer.UserClass.SqliteHelper;
|
||||||
using static System.Net.WebRequestMethods;
|
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
|
namespace DyeingComputer.UserClass
|
||||||
{/// <summary>
|
{/// <summary>
|
||||||
@@ -242,6 +243,7 @@ namespace DyeingComputer.UserClass
|
|||||||
else if (dat_821.GetValue("INSTRUCTION").ToString() == "PAUSE")
|
else if (dat_821.GetValue("INSTRUCTION").ToString() == "PAUSE")
|
||||||
{
|
{
|
||||||
MainWindowViewModel.WORK_RUN = 1;//暂停
|
MainWindowViewModel.WORK_RUN = 1;//暂停
|
||||||
|
MainWindowViewModel.errTabler.Clear();
|
||||||
|
|
||||||
client.SendAsync("SC821" + SYSKEY + SYSDAT);
|
client.SendAsync("SC821" + SYSKEY + SYSDAT);
|
||||||
}
|
}
|
||||||
@@ -299,20 +301,14 @@ namespace DyeingComputer.UserClass
|
|||||||
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
// SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
// SQLiteHelpers.Open(); //打开数据库
|
// SQLiteHelpers.Open(); //打开数据库
|
||||||
MainWindow.SQLiteHelpers.Delete("RUN", null, null);
|
MainWindow.SQLiteHelpers.Delete("RUN", null, null);
|
||||||
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
|
|
||||||
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
|
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
data_t.Clear();//清空
|
|
||||||
|
|
||||||
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
|
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
|
||||||
DataRow drT = data_t.NewRow();
|
dt.BeginEdit(); //添加订单号
|
||||||
drT.ItemArray = dt.ItemArray;
|
dt["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
data_t.Rows.InsertAt(drT, 0);
|
dt.EndEdit();
|
||||||
drT.BeginEdit(); //添加订单号
|
|
||||||
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
|
|
||||||
drT.EndEdit();
|
|
||||||
|
|
||||||
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
|
||||||
}
|
}
|
||||||
//SQLiteHelpers.Close(); //关闭连接
|
//SQLiteHelpers.Close(); //关闭连接
|
||||||
|
|
||||||
@@ -345,19 +341,13 @@ namespace DyeingComputer.UserClass
|
|||||||
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
|
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
|
||||||
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
|
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
data_t.Clear();//清空
|
|
||||||
|
|
||||||
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
|
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
|
||||||
DataRow drT = data_t.NewRow();
|
dt.BeginEdit(); //添加订单号
|
||||||
drT.ItemArray = dt.ItemArray;
|
dt["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
data_t.Rows.InsertAt(drT, 0);
|
dt.EndEdit();
|
||||||
drT.BeginEdit(); //添加订单号
|
|
||||||
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
|
|
||||||
drT.EndEdit();
|
|
||||||
|
|
||||||
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
|
||||||
}
|
} //SQLiteHelpers.Close(); //关闭连接
|
||||||
//SQLiteHelpers.Close(); //关闭连接
|
|
||||||
|
|
||||||
client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString());
|
client.SendAsync("SC831" + "[" + MainWindowViewModel.S01 + "]" + MainWindowViewModel.dt_TP.ToJsonString());
|
||||||
MainWindowViewModel.TX++;
|
MainWindowViewModel.TX++;
|
||||||
@@ -374,17 +364,12 @@ namespace DyeingComputer.UserClass
|
|||||||
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
|
DataTable data_t = MainWindowViewModel.dt_TP.Clone();
|
||||||
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
|
for (int i = 0; i < MainWindowViewModel.dt_TP.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
data_t.Clear();//清空
|
|
||||||
|
|
||||||
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
|
DataRow dt = MainWindowViewModel.dt_TP.Rows[i];//行转换
|
||||||
DataRow drT = data_t.NewRow();
|
dt.BeginEdit(); //添加订单号
|
||||||
drT.ItemArray = dt.ItemArray;
|
dt["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
data_t.Rows.InsertAt(drT, 0);
|
dt.EndEdit();
|
||||||
drT.BeginEdit(); //添加订单号
|
|
||||||
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
|
|
||||||
drT.EndEdit();
|
|
||||||
|
|
||||||
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
MainWindow.SQLiteHelpers.InsertData("RUN", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
|
||||||
}
|
}
|
||||||
//SQLiteHelpers.Close(); //关闭连接
|
//SQLiteHelpers.Close(); //关闭连接
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,8 @@
|
|||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
<DataGrid x:Name="Parameter_set" Visibility="Collapsed" AutoGenerateColumns="False" FontSize="15" AlternationCount="2"
|
<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 >
|
<DataGrid.RowStyle >
|
||||||
<Style TargetType="{x:Type DataGridRow}">
|
<Style TargetType="{x:Type DataGridRow}">
|
||||||
<Setter Property="Height" Value="30" />
|
<Setter Property="Height" Value="30" />
|
||||||
|
|||||||
@@ -196,6 +196,16 @@ namespace DyeingComputer.View
|
|||||||
Parameter_set.ItemsSource = tblDatas.DefaultView;
|
Parameter_set.ItemsSource = tblDatas.DefaultView;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
private void Parameter_set_BeginningEdit(object sender, DataGridBeginningEditEventArgs e)
|
||||||
|
{
|
||||||
|
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)
|
private void Parameter_set_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
|
||||||
{
|
{
|
||||||
string VID;
|
string VID;
|
||||||
@@ -234,7 +244,7 @@ namespace DyeingComputer.View
|
|||||||
MainWindowViewModel.Updata_dtm(VID, i);
|
MainWindowViewModel.Updata_dtm(VID, i);
|
||||||
}
|
}
|
||||||
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Parameter",
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Parameter",
|
||||||
"ID=" + VID + ";Name=" + Vname + ";Value="+newValue);
|
"ID=" + VID + ";Name=" + Vname + ";Value=" + newValue);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
ParameterSet_d();
|
ParameterSet_d();
|
||||||
@@ -322,17 +332,25 @@ namespace DyeingComputer.View
|
|||||||
// Grid.DataContext = new MainWindowViewModel();
|
// Grid.DataContext = new MainWindowViewModel();
|
||||||
}
|
}
|
||||||
private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)//编辑按钮
|
private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)//编辑按钮
|
||||||
|
{
|
||||||
|
if (!MainWindowViewModel._Lock_bool)
|
||||||
{
|
{
|
||||||
// if (string.IsNullOrEmpty(Numder)) { Numder = null; P1 = "0"; P2 = "0"; P3 = "0"; P4 = "0"; P5 = "0"; }
|
// 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();
|
if (ID == null) return;//ID = sql.Tables[0].Rows.Count.ToString();
|
||||||
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Edit", "STEP = " + ID);
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Edit", "STEP = " + ID);
|
||||||
ViewStep viewstop = new ViewStep(Numder, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First());
|
ViewStep viewstop = new ViewStep(Numder, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First());
|
||||||
viewstop.boxNAME.IsEnabled=false;
|
viewstop.boxNAME.IsEnabled = false;
|
||||||
//viewstop.no.IsEnabled = false;
|
//viewstop.no.IsEnabled = false;
|
||||||
viewstop.data = ID;
|
viewstop.data = ID;
|
||||||
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked);
|
||||||
viewstop.ShowDialog();
|
viewstop.ShowDialog();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
|
||||||
|
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
||||||
{
|
{
|
||||||
int n = Convert.ToInt16(ID);
|
int n = Convert.ToInt16(ID);
|
||||||
@@ -409,6 +427,8 @@ namespace DyeingComputer.View
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)//删除
|
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)//删除
|
||||||
|
{
|
||||||
|
if (!MainWindowViewModel._Lock_bool)
|
||||||
{
|
{
|
||||||
int d = 0;
|
int d = 0;
|
||||||
int a = MainWindowViewModel.dt_TP.Rows.Count;
|
int a = MainWindowViewModel.dt_TP.Rows.Count;
|
||||||
@@ -439,7 +459,16 @@ namespace DyeingComputer.View
|
|||||||
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Delete", "STEP = " + ID);
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Delete", "STEP = " + ID);
|
||||||
MainWindowViewModel.User_Button = true;
|
MainWindowViewModel.User_Button = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
|
||||||
|
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入
|
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入
|
||||||
|
{
|
||||||
|
if (!MainWindowViewModel._Lock_bool)
|
||||||
{
|
{
|
||||||
int d = 0;
|
int d = 0;
|
||||||
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
@@ -488,7 +517,7 @@ namespace DyeingComputer.View
|
|||||||
MainWindowViewModel.dt_TP.Rows.InsertAt(dr, d - 1);
|
MainWindowViewModel.dt_TP.Rows.InsertAt(dr, d - 1);
|
||||||
// ID = null;
|
// ID = null;
|
||||||
Dat();
|
Dat();
|
||||||
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Insert", "STEP = "+ID);
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Insert", "STEP = " + ID);
|
||||||
if (ID == null) return;// ID = MainWindowViewModel.dt_TP.Rows.Count.ToString();
|
if (ID == null) return;// ID = MainWindowViewModel.dt_TP.Rows.Count.ToString();
|
||||||
ViewStep viewstop = new ViewStep(null, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First());
|
ViewStep viewstop = new ViewStep(null, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First());
|
||||||
viewstop.boxNAME.IsEnabled = false;
|
viewstop.boxNAME.IsEnabled = false;
|
||||||
@@ -497,6 +526,12 @@ namespace DyeingComputer.View
|
|||||||
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_InsertClicked);
|
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_InsertClicked);
|
||||||
viewstop.ShowDialog();
|
viewstop.ShowDialog();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
|
||||||
|
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
private void Address_InsertClicked(object sender, AddressUpdateEventArgs e)//插入返回结果
|
private void Address_InsertClicked(object sender, AddressUpdateEventArgs e)//插入返回结果
|
||||||
{
|
{
|
||||||
int n = Convert.ToInt16(ID);
|
int n = Convert.ToInt16(ID);
|
||||||
@@ -562,6 +597,8 @@ namespace DyeingComputer.View
|
|||||||
MainWindowViewModel.User_Button = true;
|
MainWindowViewModel.User_Button = true;
|
||||||
}
|
}
|
||||||
private void ProgramgroupView_Jump_Click(object sender, RoutedEventArgs e)
|
private void ProgramgroupView_Jump_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (!MainWindowViewModel._Lock_bool)
|
||||||
{
|
{
|
||||||
DataRow dr = MainWindowViewModel.dt_TP.Select("Step='" + ID + "'").First();
|
DataRow dr = MainWindowViewModel.dt_TP.Select("Step='" + ID + "'").First();
|
||||||
dr.BeginEdit();
|
dr.BeginEdit();
|
||||||
@@ -573,7 +610,12 @@ namespace DyeingComputer.View
|
|||||||
Convert.ToDouble(P4), Convert.ToDouble(P5));
|
Convert.ToDouble(P4), Convert.ToDouble(P5));
|
||||||
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Jump", "STEP = " + ID +
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Jump", "STEP = " + ID +
|
||||||
";StepID=" + Numder + ";P1=" + P1 + ";P2=" + P2 + ";P3=" + P3 + ";P4=" + P4 + ";P5=" + P5);
|
";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)
|
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
+48
-12
@@ -107,6 +107,8 @@ namespace DyeingComputer.View
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void WorkOrderView_lock_Click(object sender, RoutedEventArgs e)//锁定按钮
|
private void WorkOrderView_lock_Click(object sender, RoutedEventArgs e)//锁定按钮
|
||||||
|
{
|
||||||
|
if (!MainWindowViewModel._Lock_bool)
|
||||||
{
|
{
|
||||||
if (WorkOrder_Numder == null) return;
|
if (WorkOrder_Numder == null) return;
|
||||||
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
//SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
@@ -125,13 +127,27 @@ namespace DyeingComputer.View
|
|||||||
//SQLiteHelpers.Close();
|
//SQLiteHelpers.Close();
|
||||||
Workorder_sql();
|
Workorder_sql();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
|
||||||
|
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void WorkOrderView_new_Click(object sender, RoutedEventArgs e)//新建按钮
|
private void WorkOrderView_new_Click(object sender, RoutedEventArgs e)//新建按钮
|
||||||
|
{
|
||||||
|
if (!MainWindowViewModel._Lock_bool)
|
||||||
{
|
{
|
||||||
ViewProgram viewProgram = new ViewProgram();
|
ViewProgram viewProgram = new ViewProgram();
|
||||||
viewProgram.AddressUpdated += new ViewProgram.AddressUpdateHandler(Address_ButtonClicked);
|
viewProgram.AddressUpdated += new ViewProgram.AddressUpdateHandler(Address_ButtonClicked);
|
||||||
viewProgram.ShowDialog();
|
viewProgram.ShowDialog();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
|
||||||
|
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//新建返回结果
|
private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//新建返回结果
|
||||||
{
|
{
|
||||||
SQL_UPDATE = false;
|
SQL_UPDATE = false;
|
||||||
@@ -162,27 +178,25 @@ namespace DyeingComputer.View
|
|||||||
/*获取转并插入步骤信息*/
|
/*获取转并插入步骤信息*/
|
||||||
DataTable step_dat = MainWindow.SQLiteHelpers.ExecuteDataSet(
|
DataTable step_dat = MainWindow.SQLiteHelpers.ExecuteDataSet(
|
||||||
"select * from ProgramSteps where ProgramID='" + Process_id + "'", null).Tables[0]; //读取表写入缓存
|
"select * from ProgramSteps where ProgramID='" + Process_id + "'", null).Tables[0]; //读取表写入缓存
|
||||||
DataTable _t = step_dat.Clone();
|
step_dat.Columns.Add("WorkOrder", System.Type.GetType("System.String"));
|
||||||
_t.Columns.Add("WorkOrder", System.Type.GetType("System.String"));
|
step_dat.Columns.Add("DYELOT", System.Type.GetType("System.String"));
|
||||||
_t.Columns.Add("DYELOT", System.Type.GetType("System.String"));
|
|
||||||
int a = step_dat.Rows.Count;
|
int a = step_dat.Rows.Count;
|
||||||
for (int i = 0; i < a; i++)
|
for (int i = 0; i < a; i++)
|
||||||
{
|
{
|
||||||
_t.Clear();//清空
|
|
||||||
DataRow dt = step_dat.Rows[i];//行转
|
DataRow dt = step_dat.Rows[i];//行转
|
||||||
DataRow dr = _t.NewRow();
|
dt.BeginEdit(); //添加订单号
|
||||||
dr.ItemArray = dt.ItemArray;
|
dt["WorkOrder"] = WorkOrder_Numder;
|
||||||
dr.BeginEdit(); //添加订单号
|
dt["DYELOT"] = WorkOrder_Numder;
|
||||||
dr["WorkOrder"] = WorkOrder_Numder;
|
dt.EndEdit();
|
||||||
dr["DYELOT"] = WorkOrder_Numder;
|
|
||||||
dr.EndEdit();
|
|
||||||
_t.Rows.InsertAt(dr, 0); //行转换
|
|
||||||
|
|
||||||
MainWindow.SQLiteHelpers.InsertData("WorkorderSteps", MainWindow.SQLiteHelpers.DataTableToDictionary(_t));//行插入
|
MainWindow.SQLiteHelpers.InsertData("WorkorderSteps", MainWindow.SQLiteHelpers.ToDictionary(dt));//行插入
|
||||||
}
|
}
|
||||||
//SQLiteHelpers.Close();
|
//SQLiteHelpers.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WorkOrderView_del_Click(object sender, RoutedEventArgs e)//删除按钮
|
private void WorkOrderView_del_Click(object sender, RoutedEventArgs e)//删除按钮
|
||||||
|
{
|
||||||
|
if (!MainWindowViewModel._Lock_bool)
|
||||||
{
|
{
|
||||||
if (WorkOrder_Numder == null) return;
|
if (WorkOrder_Numder == null) return;
|
||||||
///弹窗提示确认删除
|
///弹窗提示确认删除
|
||||||
@@ -200,8 +214,16 @@ namespace DyeingComputer.View
|
|||||||
}
|
}
|
||||||
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)//重染按钮
|
private void WorkOrderView_redy_Click(object sender, RoutedEventArgs e)//重染按钮
|
||||||
|
{
|
||||||
|
if (!MainWindowViewModel._Lock_bool)
|
||||||
{
|
{
|
||||||
string WorkNum = MainWindowViewModel.WorkNumder.ToString();
|
string WorkNum = MainWindowViewModel.WorkNumder.ToString();
|
||||||
if (WorkNum != null)
|
if (WorkNum != null)
|
||||||
@@ -216,6 +238,12 @@ namespace DyeingComputer.View
|
|||||||
}
|
}
|
||||||
SQL_UPDATE = false;
|
SQL_UPDATE = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
|
||||||
|
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
|
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
|
||||||
{
|
{
|
||||||
@@ -329,6 +357,8 @@ namespace DyeingComputer.View
|
|||||||
((System.Windows.Controls.Image)sender).RenderTransform = new ScaleTransform(0.9, 0.9);
|
((System.Windows.Controls.Image)sender).RenderTransform = new ScaleTransform(0.9, 0.9);
|
||||||
}
|
}
|
||||||
private void Image_MouseLeftButtonUp1(object sender, MouseButtonEventArgs e)
|
private void Image_MouseLeftButtonUp1(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (!MainWindowViewModel._Lock_bool)
|
||||||
{
|
{
|
||||||
SQL_UPDATE = false;
|
SQL_UPDATE = false;
|
||||||
((System.Windows.Controls.Image)sender).RenderTransform = Transform.Identity;
|
((System.Windows.Controls.Image)sender).RenderTransform = Transform.Identity;
|
||||||
@@ -418,6 +448,12 @@ namespace DyeingComputer.View
|
|||||||
var _mainWindow = Application.Current.Windows.Cast<Window>().FirstOrDefault(window => window is MainWindow) as MainWindow;//跨页面
|
var _mainWindow = Application.Current.Windows.Cast<Window>().FirstOrDefault(window => window is MainWindow) as MainWindow;//跨页面
|
||||||
_mainWindow.container.Content = new TechnologicalProcessView();//获取控件
|
_mainWindow.container.Content = new TechnologicalProcessView();//获取控件
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindowViewModel.USERinf(Properties.Resources.LockedState + "\n" +
|
||||||
|
Properties.Resources.TCOIR + "\n" + Properties.Resources.PCATRIL);
|
||||||
|
}
|
||||||
}//开始
|
}//开始
|
||||||
|
|
||||||
private void TEMP()
|
private void TEMP()
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ using static DyeingComputer.UserClass.SqliteHelper;
|
|||||||
using static DyeingComputer.ViewModel.MainWindowViewModel;
|
using static DyeingComputer.ViewModel.MainWindowViewModel;
|
||||||
using static DyeingComputer.Windows.ViewStep;
|
using static DyeingComputer.Windows.ViewStep;
|
||||||
using static System.Net.WebRequestMethods;
|
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.Button;
|
||||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
|
||||||
|
|
||||||
@@ -442,6 +443,8 @@ namespace DyeingComputer.ViewModel
|
|||||||
SK12 = Selet_sys("SK12");
|
SK12 = Selet_sys("SK12");
|
||||||
}
|
}
|
||||||
private void ProgramgroupView_run_()////运行/暂停
|
private void ProgramgroupView_run_()////运行/暂停
|
||||||
|
{
|
||||||
|
if (!_Lock_bool)
|
||||||
{
|
{
|
||||||
if (WORK_RUN == 2)
|
if (WORK_RUN == 2)
|
||||||
{
|
{
|
||||||
@@ -467,8 +470,15 @@ namespace DyeingComputer.ViewModel
|
|||||||
IsInteractive = true;
|
IsInteractive = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
USERinf(Resources.LockedState+"\n"+ Resources.TCOIR+"\n"+Resources.PCATRIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
public ICommand ProgramgroupView_run { get; }
|
public ICommand ProgramgroupView_run { get; }
|
||||||
private void ProgramgroupView_stop_()//结束
|
private void ProgramgroupView_stop_()//结束
|
||||||
|
{
|
||||||
|
if (!_Lock_bool)
|
||||||
{
|
{
|
||||||
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", WORK_RUN.ToString());
|
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", WORK_RUN.ToString());
|
||||||
|
|
||||||
@@ -494,6 +504,11 @@ namespace DyeingComputer.ViewModel
|
|||||||
WorkNumder = "----------";
|
WorkNumder = "----------";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
USERinf(Resources.LockedState + "\n" + Resources.TCOIR + "\n" + Resources.PCATRIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
public void CountDown()
|
public void CountDown()
|
||||||
{
|
{
|
||||||
//设置定时器
|
//设置定时器
|
||||||
@@ -742,8 +757,18 @@ namespace DyeingComputer.ViewModel
|
|||||||
public static bool Alert_bell = false; //警报铃声
|
public static bool Alert_bell = false; //警报铃声
|
||||||
static Dictionary<string, object> updata_RUN = new Dictionary<string, object>();//
|
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 UserCall userCall = null;
|
||||||
static Sampling sampling = null;
|
static Sampling sampling = null;
|
||||||
public static void USERcall(string ID, string DAT)
|
public static void USERcall(string ID, string DAT)
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -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(); //关闭窗口
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user