Przeglądaj źródła

Fix start path setting to exe local

Zixuan 1 tydzień temu
rodzic
commit
ee195bc0c0

+ 1 - 1
Communicators/RTCommunicator/RTCommunicatorTLV/RTCommunicator_TLV.cs

@@ -27,7 +27,7 @@ public class RTCommunicator_TLV : IRTMini8Sender, ITlvProvider
 
         if (this._provider is not null)
             return false;
-        string path = Path.Combine(Environment.CurrentDirectory, "HeaterType.csv");
+        string path = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "HeaterType.csv");
         if (!HeaterTypeAnalizer.Analize(path, out _HeaterTypes) || _HeaterTypes is null)
             return false;
 

+ 1 - 1
Configs/CofigOperator/Paths.cs

@@ -2,7 +2,7 @@
 
 public class Paths
 {
-    public static string LocalPath { get; } = Environment.CurrentDirectory;
+    public static string LocalPath { get; } = AppDomain.CurrentDomain.SetupInformation.ApplicationBase!;
     private static string MainFolder { get; } = new DirectoryInfo(LocalPath!)!.Parent!.FullName;
 
     public static string ConfigFileFolder { get; } = Path.Combine(MainFolder, "Settings", "ConfigFiles");

+ 6 - 6
MinicsConsole/HostLifetime.cs

@@ -78,18 +78,18 @@ class HostLifetime(
         await Task.CompletedTask;
     }
 
-    private AutoResetEvent _AutoResetEvent = new(true);
+    private readonly AutoResetEvent _AutoResetEvent = new(true);
     async Task IHostedService.StopAsync(CancellationToken cancellationToken)
     {
         if (!_AutoResetEvent.WaitOne(0))
             await Task.CompletedTask;
 
         log.Info("Minics Console has been shutted down by UI request");
-        log.Info("Saving setting files..");
-        hardwareFileLoader.Save();
-        configFileLoader.Save();
-        addressFileLoader.Save();
-        BaseConfigFileLoader.Save(basicInfo);
+        //log.Info("Saving setting files..");
+        //hardwareFileLoader.Save();
+        //configFileLoader.Save();
+        //addressFileLoader.Save();
+        //BaseConfigFileLoader.Save(basicInfo);
         log.Info("Closing all mini8 connections..");
         hardWareMonitor.CloseConnections();
         log.Info("Closing RT server connections..");

BIN
MinicsUI/Resources/JACKET HEATER ASSM-1.JPG


BIN
MinicsUI/Resources/JACKET HEATER ASSM.JPG