锁功能生效,操作锁

This commit is contained in:
sc committed 2025-08-30 21:52:00 +08:00
commit 469d76f9b0
14 files changed
+547 -317

No files matched your search

+65 -40
View File
@@ -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)
if (!_Lock_bool)
{
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(); //关闭连接
APILog.LOGlog(WorkNumder.ToString(), "UserActions", "WORK_RUN = STOP", WORK_RUN.ToString());
UserButton = false;
IsInteractive = false;
ProgramName = null;
WorkNumder = "----------";
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)