Zixuan 1 неделя назад
Родитель
Сommit
a9af942784

+ 5 - 0
Communicators/RTCommunicator/RTCommunicatorBase/Data.cs

@@ -32,6 +32,7 @@ public struct ST_ALARM
     public float PV { get; set; }
     public float Caps { get; set; }
     public float Floor { get; set; }
+    public float WorkingOutput { get; set; }
     public AlarmType AlarmType { get; set; }
 }
 
@@ -42,6 +43,7 @@ public struct ST_CHANNEL
     public float PV { get; set; }
     public float Caps { get; set; }
     public float Floor { get; set; }
+    public float WorkingOutput { get; set; }
 }
 
 public class ST_CHANNEL_Notify
@@ -51,6 +53,8 @@ public class ST_CHANNEL_Notify
     public float PV { get; set; }
     public float Caps { get; set; }
     public float Floor { get; set; }
+    public float WorkingOutput { get; set; }
+
 }
 
 
@@ -61,6 +65,7 @@ public class ST_ALARM_Notify
     public float PV { get; set; }
     public float Caps { get; set; }
     public float Floor { get; set; }
+    public float WorkingOutput { get; set; }
     public AlarmType AlarmType { get; set; }
     public HeaterType HeaterType { get; set; }
 }

+ 4 - 0
Communicators/RTCommunicator/RTCommunicatorTLV/RTCommunicator_TLV.cs

@@ -127,6 +127,7 @@ public class RTCommunicator_TLV : IRTMini8Sender, ITlvProvider
                         PV = alarm.Value.PV,
                         Caps = alarm.Value.Caps,
                         Floor = alarm.Value.Floor,
+                        WorkingOutput = alarm.Value.WorkingOutput,
                         AlarmType = alarm.Value.AlarmType,
                         HeaterType = heaterType,
                     };
@@ -174,6 +175,8 @@ public class RTCommunicator_TLV : IRTMini8Sender, ITlvProvider
                             PV = channel.Value.PV,
                             Caps = channel.Value.Caps,
                             Floor = channel.Value.Floor,
+                            WorkingOutput = channel.Value.WorkingOutput,
+
                         };
                         this.ChannelData[key] = notify;
                     }
@@ -184,6 +187,7 @@ public class RTCommunicator_TLV : IRTMini8Sender, ITlvProvider
                         notify.PV = channel.Value.PV;
                         notify.Caps = channel.Value.Caps;
                         notify.Floor = channel.Value.Floor;
+                        notify.WorkingOutput = channel.Value.WorkingOutput;
                     }
 
                     try

Разница между файлами не показана из-за своего большого размера
+ 1 - 13
Configs/ConfigFile/Base/BasicInfo.xml


+ 18 - 0
Configs/ConfigFile/ConfigFile.csproj

@@ -12,9 +12,27 @@
     <None Update="Base\BasicInfo.xml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Update="ConfigFiles\1.mc">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="ConfigFiles\F2 CLEAN.mc">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="ConfigFiles\M1.mc">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="ConfigFiles\Memery1.mc">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="ConfigFiles\Memery2-3.mc">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="ConfigFiles\Minics Config 1.mc">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Update="ConfigFiles\PROCESS.mc">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="Hardwares\HTR1 - U1.xml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>

Разница между файлами не показана из-за своего большого размера
+ 2224 - 0
Configs/ConfigFile/ConfigFiles/1.mc


Разница между файлами не показана из-за своего большого размера
+ 2224 - 0
Configs/ConfigFile/ConfigFiles/F2 CLEAN.mc


Разница между файлами не показана из-за своего большого размера
+ 1947 - 0
Configs/ConfigFile/ConfigFiles/M1.mc


Разница между файлами не показана из-за своего большого размера
+ 2224 - 0
Configs/ConfigFile/ConfigFiles/Memery1.mc


Разница между файлами не показана из-за своего большого размера
+ 2224 - 0
Configs/ConfigFile/ConfigFiles/Memery2-3.mc


Разница между файлами не показана из-за своего большого размера
+ 0 - 2070
Configs/ConfigFile/ConfigFiles/Minics Config 1.mc


Разница между файлами не показана из-за своего большого размера
+ 1947 - 0
Configs/ConfigFile/ConfigFiles/PROCESS.mc


Разница между файлами не показана из-за своего большого размера
+ 1 - 106
Configs/ConfigFile/Hardwares/HTR1 - U1.xml


Разница между файлами не показана из-за своего большого размера
+ 1 - 106
Configs/ConfigFile/Hardwares/HTR1 - U2.xml


Разница между файлами не показана из-за своего большого размера
+ 1 - 106
Configs/ConfigFile/Hardwares/HTR1 - U3.xml


Разница между файлами не показана из-за своего большого размера
+ 1 - 106
Configs/ConfigFile/Hardwares/HTR1 - U8.xml


Разница между файлами не показана из-за своего большого размера
+ 1 - 106
Configs/ConfigFile/Hardwares/HTR2 - U4.xml


Разница между файлами не показана из-за своего большого размера
+ 1 - 106
Configs/ConfigFile/Hardwares/HTR2 - U6.xml


Разница между файлами не показана из-за своего большого размера
+ 1 - 106
Configs/ConfigFile/Hardwares/HTR2 - U7.xml


+ 1 - 1
Configs/ConfigFile/IOList/Mini8-1.xml

@@ -2,7 +2,7 @@
 <AddressSaveXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 	<Mini8>
 		<Index>1</Index>
-		<Address>127.0.0.1</Address>
+		<Address>192.168.250.11</Address>
 		<Port>502</Port>
 		<Interval>200</Interval>
 		<GroupeCount>125</GroupeCount>

+ 1 - 1
Configs/ConfigFile/PLCIOList/PLCChannel/PLC_Channel-1.xml

@@ -3,7 +3,7 @@
 	<ChannelAddressPLC>
 		<Mini8Index>1</Mini8Index>
 		<ChannelIndex>1</ChannelIndex>
-		<PV>D14022</PV>
+		<PV/>
 		<WorkingOutput/>
 		<AutoTuneStatus/>
 		<AutoTune_P/>

+ 3 - 2
ConsoleData/RealtimeData/ConfigFiles.cs

@@ -1,4 +1,5 @@
-using TemperatureConfigFile;
+using System.Collections.Concurrent;
+using TemperatureConfigFile;
 
 namespace RealtimeData;
 
@@ -6,5 +7,5 @@ public class ConfigFiles
 {
     public TemperatureConfig? CurrentConfigFile { get; set; }
 
-    public Dictionary<string, TemperatureConfig> Files { get; } = [];
+    public ConcurrentDictionary<string, TemperatureConfig> Files { get; } = [];
 }

+ 2 - 0
MinicsConsole/Connector/RTNotifier.cs

@@ -41,6 +41,7 @@ public class RTNotifier(Hardwares hardwares) : IMini8DataNotifier, IDisposable
             PV = channelData.PV,
             Caps = channelData.Caps,
             Floor = channelData.Floor,
+            WorkingOutput = channelData.WorkingOutput,
         };
 
         this._server?.Send(Tags.ChannelRealtimeDataNotify, data);
@@ -66,6 +67,7 @@ public class RTNotifier(Hardwares hardwares) : IMini8DataNotifier, IDisposable
             PV = temperature,
             Caps = channelData.Caps,
             Floor = channelData.Floor,
+            WorkingOutput = channelData.WorkingOutput,
             AlarmType = alarmType
         };
         Task.Factory.StartNew(() =>

+ 3 - 14
MinicsConsole/Helper/ConfigUpdater.cs

@@ -127,7 +127,7 @@ public class ConfigUpdater(Hardwares hardwares, ConfigFiles configFiles, HardWar
                 ChannelConfig channelConfig = new();
                 channelRealTime.Value.Adapt(channelConfig);
                 channelConfig.Index = channelRealTime.Key;
-                config.ChannelConfig[channelRealTime.Key] = channelConfig;
+                config.ChannelConfig[channelRealTime.Key] = channelConfig;  
 
                 if (channels is null)
                     continue;
@@ -139,7 +139,8 @@ public class ConfigUpdater(Hardwares hardwares, ConfigFiles configFiles, HardWar
                 channelConfig.ChannelMode = hardwareChannel.ChannelMode;
             }
 
-            cache.Mini8sConfig[mini8Index] = config;
+            lock (cache.Mini8sConfig)
+                cache.Mini8sConfig[mini8Index] = config;
         });
 
 
@@ -171,18 +172,6 @@ public class ConfigUpdater(Hardwares hardwares, ConfigFiles configFiles, HardWar
                 channelConfig.Floor = limit.Floor;
                 channelConfig.CapsWarning = limit.CapsWarning;
                 channelConfig.FloorWarning = limit.FloorWarning;
-
-                //if (channelConfig.SetPoint.InRange(limit.Floor, limit.Caps))
-                //{
-                //    channelConfig.CapsWarning = (limit.Caps + channelConfig.SetPoint) / 2;
-                //    channelConfig.FloorWarning = (limit.Floor + channelConfig.SetPoint) / 2;
-                //}
-                //else
-                //{
-                //    float spilt = (limit.Caps - limit.Floor) / 4;
-                //    channelConfig.CapsWarning = limit.Caps - spilt;
-                //    channelConfig.FloorWarning = limit.Floor + spilt;
-                //}
             }
         }
         );

+ 0 - 2
MinicsConsole/HostLifetime.cs

@@ -61,8 +61,6 @@ class HostLifetime(
         dataDispatcher.TryAddNotifier("RT", rtNotifer);
         dataDispatcher.TryAddNotifier("Kanban", kanbanNotifier);
 
-
-
         log.Info($"Start RT Server  {basicInfo.RTServerAddress}:{basicInfo.RTServerPort} success");
 
         //Connect to Mini8s

+ 9 - 1
MinicsConsole/Program.cs

@@ -86,6 +86,14 @@ internal class Program
 
     private static void TaskScheduler_UnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
     {
-        //_expLog.Fatal(e.Exception!.ToString()!);
+        try
+        {
+            var s = e.Exception is null ? "Unknow" : e.Exception.ToString();
+            _expLog.Error(s);
+        }
+        catch
+        {
+
+        }
     }
 }

+ 1 - 1
Test/Program.cs

@@ -189,7 +189,7 @@ public class TestClass : IRTMini8Provider
 
     public void ChannelRealtimeNotify(ST_CHANNEL_Notify channel)
     {
-        Console.WriteLine($"{DateTime.Now:HH:mm:ss.f} Mini8 {channel.Mini8Index} Channel {channel.ChannelIndex} {channel.PV}");
+        Console.WriteLine($"{DateTime.Now:HH:mm:ss.f} Mini8 {channel.Mini8Index} Channel {channel.ChannelIndex} {channel.PV} {channel.WorkingOutput}");
     }
 }
 

+ 10 - 10
Universal/DierctoryHelper.cs

@@ -12,21 +12,21 @@ public class DierctoryHelper
         {
             DirectoryInfo folder = new(folderPath);
             fileInfo = [.. folder.GetFiles()];
+
+            if (fileInfo is null || fileInfo.Count == 0)
+                return true;
+
+            if (!string.IsNullOrEmpty(extenionType))
+                fileInfo = [.. fileInfo.Where(file => string.Equals(file.Extension.Replace(".", ""), extenionType.Replace(".", "")))];
+
+            fileInfo.ForEach(t => tempFiles.Add(t.FullName));
+            files = tempFiles;
+
         }
         catch
         {
             return false;
         }
-
-        if (fileInfo is null || fileInfo.Count == 0)
-            return true;
-
-        if (!string.IsNullOrEmpty(extenionType))
-            fileInfo = [.. fileInfo.Where(file => string.Equals(file.Extension.Replace(".", ""), extenionType.Replace(".", "")))];
-
-        fileInfo.ForEach(t => tempFiles.Add(t.FullName));
-        files = tempFiles;
-
         return true;
     }