子程序优化
This commit is contained in:
@@ -154,6 +154,24 @@ namespace ADP.ViewModels
|
||||
public ICommand MonitorValueSettingCommand { get; set; }
|
||||
public ICommand GetFileStringCommand { get; set; }
|
||||
public ICommand SilenceBuzzerCommand { get; set; }
|
||||
public ICommand GoBackCommand { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 子程序导航
|
||||
|
||||
public bool CanGoBack =>
|
||||
(CurrentContext?.MainNav.CanGoBack ?? false) ||
|
||||
(CurrentContext?.ErrorNav.CanGoBack ?? false);
|
||||
|
||||
private void OnGoBack()
|
||||
{
|
||||
var ctx = CurrentContext;
|
||||
if (ctx == null) return;
|
||||
// 工具栏按钮同时重置两个 Tab 的导航
|
||||
ctx.MainNav.Reset(ctx.Program, "主程序");
|
||||
ctx.ErrorNav.Reset(ctx.Program, "错误程序");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public ShellViewModel(IContainerProvider containerProvider)
|
||||
@@ -188,6 +206,7 @@ namespace ADP.ViewModels
|
||||
MonitorValueSettingCommand = new DelegateCommand(MonitorValueSetting);
|
||||
GetFileStringCommand = new DelegateCommand(GetFileString);
|
||||
SilenceBuzzerCommand = new AsyncDelegateCommand(SilenceBuzzer);
|
||||
GoBackCommand = new DelegateCommand(OnGoBack);
|
||||
|
||||
_globalInfo.ContextDic.Add("default", new ScopedContext());
|
||||
|
||||
@@ -457,6 +476,9 @@ namespace ADP.ViewModels
|
||||
|
||||
LoggerHelper.InfoWithNotify(runningScope, $"{_globalInfo.UserName} 执行工位 [{runningScope}] 复位命令");
|
||||
|
||||
// 重置导航栈,回到根程序界面
|
||||
targetContext.ResetNavigation();
|
||||
|
||||
_executionTasks.TryGetValue(runningScope, out var currentTask);
|
||||
_errorExecutionTasks.TryGetValue(runningScope, out var errorTask);
|
||||
|
||||
@@ -573,6 +595,7 @@ namespace ADP.ViewModels
|
||||
targetContext.Program.Parameters.Clear();
|
||||
targetContext.Program.StepCollection.Clear();
|
||||
targetContext.Program.ErrorStepCollection.Clear();
|
||||
targetContext.ResetNavigation();
|
||||
foreach (var item in CurrentConfig.ParameterList)
|
||||
{
|
||||
var param = CurrentConfig.SharedParameterList.FirstOrDefault(x => x.ParameterName == item.Name);
|
||||
|
||||
Reference in New Issue
Block a user