jiangjy 1 month ago
parent
commit
92c5563303

+ 16 - 6
FrameworkLocal/UIClient/CenterViews/Configs/SystemConfig/ShutDonwControlViewModel.cs

@@ -41,6 +41,16 @@ namespace MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig
             }
         }
         private bool _allControlVisibility = false;
+        private string _path = "";
+        public ShutDonwControlViewModel()
+        {
+            _path = Path.GetDirectoryName(PathManager.GetAppDir());
+            if (_path.Contains("FurnaceUI"))
+            {
+                _path = _path.Replace("FurnaceUI", "FurnaceRT");
+            }
+        }
+
         public bool AllControlVisibility
         {
             get => _allControlVisibility;
@@ -54,22 +64,22 @@ namespace MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig
         public void ReStartRTAndUI()
         {
             if (DialogBox.Confirm("Are you sure you want to Restart UI and RT?"))
-                Process.Start($"{Path.GetDirectoryName(PathManager.GetAppDir())}\\FurnaceBat\\startFurnace.bat");
+                Process.Start($"{_path}\\FurnaceBat\\startFurnace.bat");
         }
         public void ShutDownUIAndRT()
         {
             if (DialogBox.Confirm("Are you sure you want to shut down UI and RT?"))
-                Process.Start($"{Path.GetDirectoryName(PathManager.GetAppDir())}\\FurnaceBat\\stopFurnace.bat");
+                Process.Start($"{_path}\\FurnaceBat\\stopFurnace.bat");
         }
         public void ReStartUI()
         {
             if (DialogBox.Confirm("Are you sure you want to ReStart UI?"))
-                Process.Start($"{Path.GetDirectoryName(PathManager.GetAppDir())}\\FurnaceBat\\restartUI.bat");
+                Process.Start($"{_path}\\FurnaceBat\\restartUI.bat");
         }
         public void ShutDownUI()
         {
             if (DialogBox.Confirm("Are you sure you want to shut down UI?"))
-                Process.Start($"{Path.GetDirectoryName(PathManager.GetAppDir())}\\FurnaceBat\\shutDownUI.bat");
+                Process.Start($"{_path}\\FurnaceBat\\shutDownUI.bat");
         }
         public void AllControlPowerOff()
         {
@@ -86,7 +96,7 @@ namespace MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig
         {
             if (DialogBox.Confirm("Are you sure you want to restart All Control ?"))
             {
-                Process.Start($"{Path.GetDirectoryName(PathManager.GetAppDir())}\\FurnaceBat\\startFurnace.bat");
+                Process.Start($"{_path}\\FurnaceBat\\startFurnace.bat");
             }
 
         }
@@ -94,7 +104,7 @@ namespace MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig
         {
             if (DialogBox.Confirm("Are you sure you want to restart All ShutDown ?"))
             {
-                Process.Start($"{Path.GetDirectoryName(PathManager.GetAppDir())}\\FurnaceBat\\stopFurnace.bat");
+                Process.Start($"{_path}\\FurnaceBat\\stopFurnace.bat");
             }
 
         }