Zixuan 2 天之前
父節點
當前提交
6f6dae5863

+ 26 - 23
Data/DataService/DBProcessData.cs

@@ -1,56 +1,61 @@
 namespace DataService;
 
-public class DBProcessData<T_Output, T_PrimaryKey, T_DicValue>(Func<object, T_PrimaryKey?> KeyConverter, char spilter, string keyName)
+public class DBProcessData<T_Hierarchy, T_PrimaryKey, T_Value>(Func<object, T_PrimaryKey?> KeyConverter, char spilter, string keyName, int skip)
     where T_PrimaryKey : unmanaged
-    where T_Output : IDictionary<string, object>, new()
-    where T_DicValue : IDictionary<T_PrimaryKey, object>, new()
+    where T_Hierarchy : IDictionary<string, object>, new()
+    where T_Value : IDictionary<T_PrimaryKey, object>, new()
 {
 
-    public bool ToDictionary(IEnumerable<dynamic> inputs, out T_Output? output)
+    public bool ToDictionary(IEnumerable<dynamic> inputs, out T_Hierarchy? output)
     {
         output = default;
 
         if (inputs is null)
             return false;
 
-        T_Output cache = [];
+        T_Hierarchy cache = [];
 
         foreach (dynamic input in inputs)
         {
             if (input is null)
                 return false;
 
-            if ((input as IDictionary<string, object>)?.TryGetValue(keyName, out object? primaryKeyValue) != true || primaryKeyValue is null)
+            if (input is not IDictionary<string, object> inputPair)
                 return false;
 
-            if (KeyConverter?.Invoke(primaryKeyValue) is not T_PrimaryKey primaryKey)
+            if (!inputPair.TryGetValue(keyName, out object? primaryKeyValue) || primaryKeyValue is null)
                 return false;
 
-            (input as IDictionary<string, object>)?.Remove(keyName);
+            if (KeyConverter?.Invoke(primaryKeyValue) is not T_PrimaryKey primaryKey)
+                return false;
 
+            if (!inputPair.Remove(keyName))
+                return false;
             foreach (KeyValuePair<string, object> rawData in input)
-                ColumAnalizer(cache, rawData.Key.Split(spilter), primaryKey, rawData.Value);
+                ColumAnalizer(cache, rawData.Key.Split(spilter).AsSpan()[skip..], primaryKey, rawData.Value);
         }
 
         output = cache;
         return true;
     }
 
-    private static bool ColumAnalizer(/*ref*/ T_Output cache, Span<string> seprated, T_PrimaryKey key, object value)
+    private static void ColumAnalizer(/*ref*/ T_Hierarchy cache, Span<string> seprated, T_PrimaryKey key, object value)
     {
-        cache = TryGetValueElseCreateNew<T_Output>(cache, seprated[0]);
-
-        _ = seprated.Length switch
+        if (seprated.Length == 1)
         {
-            1 => TryGetValueElseCreateNew<T_DicValue>(cache, seprated[0]).TryAdd(key, value),//Recursion End
-            _ => ColumAnalizer(cache, seprated[1..], key, value),//Recursion
-        };
+            TryGetValueElseCreateNew<T_Value>(cache, seprated[0]).TryAdd(key, value);
+            Console.Write($"{seprated[0]},{value}");
+            Console.WriteLine();
+            return;
+        }
 
-        return true;
+        cache = TryGetValueElseCreateNew<T_Hierarchy>(cache, seprated[0]);
+        Console.Write($"{seprated[0]},");
+        ColumAnalizer(cache, seprated[1..], key, value);
     }
 
 
-    private static T TryGetValueElseCreateNew<T>(T_Output cache, string key) where T : new()
+    private static T TryGetValueElseCreateNew<T>(T_Hierarchy cache, string key) where T : new()
     {
         if (!cache.TryGetValue(key, out object? output) || output is not T dic)
         {
@@ -62,7 +67,7 @@ public class DBProcessData<T_Output, T_PrimaryKey, T_DicValue>(Func<object, T_Pr
     }
 }
 
-class GeneralHeaderAnalizer
+public class GeneralHeaderAnalizer
 {
     public static DateTime? LongToDateTime(object o)
     {
@@ -72,9 +77,7 @@ class GeneralHeaderAnalizer
     }
 }
 
-public class GeneralProcessData : DBProcessData<Dictionary<string, object>, DateTime, Dictionary<DateTime, object>>
+public class GeneralProcessData(int skip = 0)
+    : DBProcessData<Dictionary<string, object>, DateTime, Dictionary<DateTime, object>>(GeneralHeaderAnalizer.LongToDateTime, '.', "time", skip)
 {
-    public GeneralProcessData() : base(GeneralHeaderAnalizer.LongToDateTime, '.', "time")
-    {
-    }
 }

+ 9 - 0
DataBase/DB_Proxima/DB_Proxima.csproj

@@ -0,0 +1,9 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+</Project>

+ 18 - 0
DataBase/DB_Proxima/Data.cs

@@ -0,0 +1,18 @@
+namespace DB_Proxima;
+
+public class DataCollection<T> : GeneralDB
+{
+    public Dictionary<string, T>? ValueCollection { get; set; }
+}
+
+public class PairValue<T> where T : unmanaged
+{
+    public T? SetPoint { get; set; }
+    public T? Value { get; set; }
+}
+
+public class GeneralDB
+{
+    public Guid UID { get; set; }
+    public DateTime Time { get; set; }
+}

+ 217 - 0
DataBase/DB_Proxima/ProximaPM.cs

@@ -0,0 +1,217 @@
+namespace DB_Proxima;
+
+public class PM1
+{
+    public APC? APC { get; set; }
+    public Shutter? Shutter { get; set; }
+    public APCVATGV? APCVATGV { get; set; }
+    public LeakCheck? LeakCheck { get; set; }
+    public BoatElevatorServo? BoatElevatorServo { get; set; }
+    public BoatRotationServo? BoatRotationServo { get; set; }
+    public Recipe? RecipeInfo { get; set; }
+
+    public DataCollection<float>? FS { get; set; }
+    public DataCollection<float>? VG { get; set; }
+    public DataCollection<float>? PGPS { get; set; }
+    public DataCollection<bool>? Sensor { get; set; }
+    public DataCollection<float>? AOValue { get; set; }
+    public DataCollection<FFU>? FFU { get; set; }
+    public DataCollection<BufferFoup>? BufferFoup{ get; set; }
+    public DataCollection<MFC>? MFC { get; set; }
+    public DataCollection<PairValue<bool>>? AVValve { get; set; }
+    public DataCollection<PairValue<float>>? IoValve { get; set; }
+    public DataCollection<PairValue<float>>? GaslineHeater { get; set; }
+}
+
+public class APC : GeneralDB
+{
+    public bool IsError { get; set; }
+    public float HomingStatus { get; set; }
+    public float Interlock1 { get; set; }
+    public float Interlock2 { get; set; }
+    public float Interlock3 { get; set; }
+    public float InterlockConstantOfInterlock3 { get; set; }
+    public float ModeFeedback { get; set; }
+    public float ModeSetPoint { get; set; }
+    public float P1SensorOffsetSetting { get; set; }
+    public float PositionFeedback { get; set; }
+    public float PositionSetPoint { get; set; }
+    public float PosMonOffsetSetting { get; set; }
+    public float Pressure1Feedback { get; set; }
+    public float Pressure2Feedback { get; set; }
+    public float PressureSetPoint { get; set; }
+    public float SelectedControllerFeedback { get; set; }
+    public float SlowRateSetPoint { get; set; }
+    public float SlowVacuumModeSetting { get; set; }
+    public float ValveStatusThreshold { get; set; }
+
+}
+
+public class APCVATGV : GeneralDB
+{
+    public bool IsError { get; set; }
+    public float InterlockConstantOfInterlock3 { get; set; }
+    public float ModeSetPoint { get; set; }
+    public float P1SensorOffsetSetting { get; set; }
+    public float PositionFeedback { get; set; }
+    public float PositionSetPoint { get; set; }
+    public float PosMonOffsetSetting { get; set; }
+    public float Pressure1Feedback { get; set; }
+    public float Pressure2Feedback { get; set; }
+    public float PressureSetPoint { get; set; }
+    public float SlowRateSetPoint { get; set; }
+    public float SlowVacuumModeSetting { get; set; }
+    public float ValveStatusThreshold { get; set; }
+
+}
+
+public class BoatElevatorServo : GeneralDB
+{
+    public bool AtHomePosition { get; set; }
+    public bool AtPosition1 { get; set; }
+    public bool AtPosition2 { get; set; }
+    public bool AtPosition3 { get; set; }
+    public bool CurrentPosition { get; set; }
+    public bool CurrentSpeed { get; set; }
+    public bool IsAlarm { get; set; }
+    public bool IsMoving { get; set; }
+    public bool IsReady { get; set; }
+    public bool IsServoOn { get; set; }
+    public bool TargetPosition { get; set; }
+    public bool TargetPositionFb { get; set; }
+
+
+}
+
+public class BoatRotationServo : GeneralDB
+{
+    public bool AtHomePosition { get; set; }
+    public bool CurrentSpeed { get; set; }
+    public bool IsAlarm { get; set; }
+    public bool IsHomeDone { get; set; }
+    public bool IsHoming { get; set; }
+    public bool IsMoving { get; set; }
+    public bool IsReady { get; set; }
+}
+
+public class BufferFoup
+{
+    public float N2Flow { get; set; }
+    public float N2Pressure { get; set; }
+}
+
+public class BufferServo
+{
+    public bool AtPositionA1 { get; set; }
+    public bool AtPositionA2 { get; set; }
+    public bool AtPositionA3 { get; set; }
+    public bool AtPositionA4 { get; set; }
+    public bool AtPositionB1 { get; set; }
+    public bool AtPositionB2 { get; set; }
+    public bool AtPositionB3 { get; set; }
+    public bool AtPositionB4 { get; set; }
+    public bool AtPositionC1 { get; set; }
+    public bool AtPositionC2 { get; set; }
+    public bool AtPositionC3 { get; set; }
+    public bool AtPositionC4 { get; set; }
+    public bool AtPositionD1 { get; set; }
+    public bool AtPositionD2 { get; set; }
+    public bool AtPositionD3 { get; set; }
+    public bool AtPositionD4 { get; set; }
+    public float CurrentPosition { get; set; }
+    public float CurrentSpeed { get; set; }
+    public float CurrentTorque { get; set; }
+    public bool IsAlarm { get; set; }
+    public bool IsInPosition { get; set; }
+    public bool IsMotorRun { get; set; }
+    public bool IsReady { get; set; }
+    public bool IsServoOn { get; set; }
+    public bool IsServoOnBufferAxis { get; set; }
+    public float TargetPosition { get; set; }
+}
+
+public class FFU
+{
+    public float CurrentSpeed { get; set; }
+    public bool IsSwitch { get; set; }
+    public float SetSpeed { get; set; }
+}
+
+public class LeakCheck : GeneralDB
+{
+    public float ActualLeak { get; set; }
+    public float BasePressure { get; set; }
+    public float BasePressureLimit { get; set; }
+    public float CheckTime { get; set; }
+    public float DelayElapseTime { get; set; }
+    public float DelayMonitorPressure { get; set; }
+    public float DelayStartPressure { get; set; }
+    public float DelayTime { get; set; }
+    public float ElapseTime { get; set; }
+    public float HighLimit { get; set; }
+    public float LeakLimit { get; set; }
+    public float LowLimit { get; set; }
+    public float MonitorPressure { get; set; }
+    public float RetryCurrentCount { get; set; }
+    public float RetryLimit { get; set; }
+    public float StartPressure { get; set; }
+
+}
+
+public class MFC
+{
+    public float Feedback { get; set; }
+    public float LastSetPoint { get; set; }
+    public float MFCUnitEnum { get; set; }
+}
+
+public class Shutter : GeneralDB
+{
+    public bool DiClose { get; set; }
+    public bool DiOpen { get; set; }
+    public bool DoClose { get; set; }
+    public bool DoOpen { get; set; }
+}
+
+public class Recipe : GeneralDB
+{
+    public bool IsError { get; set; }
+    public bool IsExecuteSubRecipe { get; set; }
+    public bool IsInMaintainMode { get; set; }
+    public bool IsLooping { get; set; }
+    public bool IsOnline { get; set; }
+    public bool IsProcessing { get; set; }
+
+
+    public bool AGVEnable { get; set; }
+    public float DG1 { get; set; }
+    public bool DPEnable { get; set; }
+    public bool DPR1Enable { get; set; }
+    public bool DPR2Enable { get; set; }
+    public bool ECOEnable { get; set; }
+    public bool F2ClnEnable { get; set; }
+    public bool FNEnable { get; set; }
+    public bool MBPEnable { get; set; }
+    public float MP21_PS { get; set; }
+    public bool NDIREnable { get; set; }
+    public float NewShowTime { get; set; }
+    public bool NF3ClnEnable { get; set; }
+    public bool PZEROEnable { get; set; }
+    public bool RecipeHold { get; set; }
+    public bool RecipeHolded { get; set; }
+    public float RecipeHoldTime { get; set; }
+    public float RecipeStepElapseTime { get; set; }
+    public float RecipeStepNumber { get; set; }
+    public float RecipeStepTime { get; set; }
+    public float RecipeTotalElapseTime { get; set; }
+    public float RecipeTotalTime { get; set; }
+    public bool RecipeWait { get; set; }
+    public bool SP1Enable { get; set; }
+    public float SubRecipeCurrentLoopCount { get; set; }
+    public float SubRecipeLoopCount { get; set; }
+    public bool TADJEnable { get; set; }
+    public bool TMNTEnable { get; set; }
+    public bool WAT1Enable { get; set; }
+    public bool WAT2Enable { get; set; }
+
+}

+ 161 - 0
DataBase/DB_Proxima/ProximaSystem.cs

@@ -0,0 +1,161 @@
+namespace DB_Proxima;
+
+public class ProximaSystem
+{
+    public Boat? Boat { get; set; }
+    public System? System { get; set; } 
+    public Schedule? Schedule { get; set; }
+    public CarrierRobot? CarrierRobot { get; set; }
+    public WaferRobot? WaferRobot { get; set; }
+    public DataCollection<FIMS>? Fims { get; set; }
+    public DataCollection<LoadPort>? LPs { get; set; }
+    public DataCollection<Stocker>? Stockers { get; set; }
+    public DataCollection<Heater>? Heaters { get; set; }
+}
+
+public class Boat : GeneralDB
+{
+    public float BoatTestCycledCount { get; set; }
+    public bool IsError { get; set; }
+    public bool IsOnline { get; set; }
+    public float ShutterCycledCount { get; set; }
+}
+
+public class CarrierRobot : GeneralDB
+{
+    public float CurrentExtensionPosition { get; set; }
+    public float CurrentThetaPosition { get; set; }
+    public float CycleSwapCycledCount { get; set; }
+    public bool IsCommandExecutionReady { get; set; }
+    public bool IsControllerBatteryLow { get; set; }
+    public bool IsError { get; set; }
+    public bool IsErrorOccurred { get; set; }
+    public bool IsManipulatorBatteryLow { get; set; }
+    public bool IsOnline { get; set; }
+    public bool IsPause { get; set; }
+    public bool IsServoON { get; set; }
+    public bool IsWaferPresenceOnBlade1 { get; set; }
+    public float SwapCycledCount { get; set; }
+    public bool TPStatus { get; set; }
+}
+
+public class WaferRobot : GeneralDB
+{
+    public bool CurrentArm1Position { get; set; }
+    public bool CurrentArm2Position { get; set; }
+    public bool CurrentExtensionPosition { get; set; }
+    public bool CurrentThetaPosition { get; set; }
+    public bool CurrentZPosition { get; set; }
+    public bool IsCommandExecutionReady { get; set; }
+    public bool IsControllerBatteryLow { get; set; }
+    public bool IsErrorOccurred { get; set; }
+    public bool IsManipulatorBatteryLow { get; set; }
+    public bool IsOnline { get; set; }
+    public bool IsPause { get; set; }
+    public bool IsServoON { get; set; }
+    public bool IsWaferPresenceOnBlade1 { get; set; }
+    public bool IsWaferPresenceOnBlade2 { get; set; }
+    public bool IsWaferPresenceOnBlade3 { get; set; }
+    public bool IsWaferPresenceOnBlade4 { get; set; }
+    public bool IsWaferPresenceOnBlade5 { get; set; }
+    public bool SwapCycledCount { get; set; }
+    public bool TPStatus { get; set; }
+
+}
+
+public class FIMS
+{
+    public float FIMSCycledCount { get; set; }
+    public bool IsError { get; set; }
+    public bool IsOnline { get; set; }
+}
+
+public class LoadPort
+{
+    public float CasstleType { get; set; }
+    public float InfoPadCarrierIndex { get; set; }
+    public float IntAccessMode { get; set; }
+    public float IntAccessStatus { get; set; }
+    public float IntAssociationState { get; set; }
+    public float IntCarrierIDStatus { get; set; }
+    public float IntReserveState { get; set; }
+    public float IntSlotMapStatus { get; set; }
+    public float IntTransferState { get; set; }
+    public bool IsAccessSwPressed { get; set; }
+    public bool IsAutoDetectCarrierType { get; set; }
+    public bool IsClamped { get; set; }
+    public bool IsDocked { get; set; }
+    public bool IsDoorOpen { get; set; }
+    public bool IsError { get; set; }
+    public bool IsFoupPresent { get; set; }
+    public bool IsMapped { get; set; }
+    public bool IsOnline { get; set; }
+    public bool IsPlaced { get; set; }
+    public bool IsPresent { get; set; }
+    public bool IsVerifyPreDefineWaferCount { get; set; }
+    public float PreDefineWaferCount { get; set; }
+}
+
+public class Schedule : GeneralDB
+{
+    public bool CoolingRemainTime { get; set; }
+    public bool CoolingTime { get; set; }
+    public bool CycledCount { get; set; }
+    public bool CycledTotalWafer { get; set; }
+    public bool CycledWafer { get; set; }
+    public bool CycleSetPoint { get; set; }
+}
+
+public class Stocker
+{
+    public bool CassetteHasWafer { get; set; }
+    public bool FoupPresent { get; set; }
+    public bool IsError { get; set; }
+    public bool IsOnline { get; set; }
+    public bool StatusAbnormal { get; set; }
+}
+
+public class Heater
+{
+    public float CascadeControlModeSV { get; set; }
+    public float CascadePID_D { get; set; }
+    public float CascadePID_I { get; set; }
+    public float CascadePID_P { get; set; }
+    public float CascadePV { get; set; }
+    public float ControlMode { get; set; }
+    public float DownRate { get; set; }
+    public float HeaterControlModeSV { get; set; }
+    public float HeaterPID_D { get; set; }
+    public float HeaterPID_I { get; set; }
+    public float HeaterPID_P { get; set; }
+    public float HeaterPV { get; set; }
+    public bool IsAutoManual { get; set; }
+    public bool IsCascadeMode { get; set; }
+    public bool IsCascadePVBreak { get; set; }
+    public bool IsEnableIn { get; set; }
+    public bool IsEnableOutput { get; set; }
+    public bool IsHeaterPVBreak { get; set; }
+    public bool IsSelect { get; set; }
+    public float OverTemp { get; set; }
+    public float TCOpenOffsetOffset { get; set; }
+    public float TempFeedback { get; set; }
+    public float TempOffset { get; set; }
+    public float TempSetPoint { get; set; }
+    public float UpRate { get; set; }
+    public float WorkingOutput { get; set; }
+
+}
+
+public class System : GeneralDB
+{
+    public bool HasActiveAlarm { get; set; }
+    public bool IsAlarm { get; set; }
+    public bool IsAlarmConditionBuzzerOn { get; set; }
+    public bool IsAutoRunning { get; set; }
+    public bool IsBusy { get; set; }
+    public bool IsIdle { get; set; }
+    public bool IsInitialized { get; set; }
+    public bool IsRecipeEditView { get; set; }
+    public bool IsSpoolingEnable { get; set; }
+    public bool SpoolingState { get; set; }
+}

+ 7 - 0
EEMSMain.sln

@@ -53,6 +53,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeplerCommunicator_DB", "Co
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataService", "Data\DataService\DataService.csproj", "{DC93F4C8-DCF1-42FD-9373-DA7121BDAD2C}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DB_Proxima", "DataBase\DB_Proxima\DB_Proxima.csproj", "{2F2D4070-6595-47DE-BE17-1EB7516E22C4}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -135,6 +137,10 @@ Global
 		{DC93F4C8-DCF1-42FD-9373-DA7121BDAD2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{DC93F4C8-DCF1-42FD-9373-DA7121BDAD2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DC93F4C8-DCF1-42FD-9373-DA7121BDAD2C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{2F2D4070-6595-47DE-BE17-1EB7516E22C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{2F2D4070-6595-47DE-BE17-1EB7516E22C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{2F2D4070-6595-47DE-BE17-1EB7516E22C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{2F2D4070-6595-47DE-BE17-1EB7516E22C4}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -155,6 +161,7 @@ Global
 		{3696975D-6327-4EBB-ABE5-8CE26DB699A6} = {664E8B6F-4E97-4592-B7CA-F608871592CD}
 		{BE3A768B-A520-4DB9-91FD-3B1C1B79145A} = {2225F0CF-790B-4C48-A9F3-247DF1B8DE1C}
 		{DC93F4C8-DCF1-42FD-9373-DA7121BDAD2C} = {F81EF7E9-27B9-4DE0-95C9-CD1E7B58BA89}
+		{2F2D4070-6595-47DE-BE17-1EB7516E22C4} = {664E8B6F-4E97-4592-B7CA-F608871592CD}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {331844F6-59F5-4D02-BFA4-2329C0EAB6EF}

+ 0 - 9
Test/DBAnalizer.cs

@@ -1,9 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Text.Json;
-using System.Threading.Tasks;
-
-namespace Test;
-

+ 20 - 0
Test/DBGeneral.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Test;
+
+public class DataCollection<T>
+{
+    public Guid UID { get; set; }
+    public DateTime Time { get; set; }
+    public Dictionary<string, T> ValueCollection { get; set; }
+}
+
+public class PairValue<T>
+{
+    public T SetPoint { get; set; }
+    public T Value { get; set; }
+}

+ 39 - 0
Test/DBTest.cs

@@ -0,0 +1,39 @@
+using DataService;
+using SqlSugar;
+using SqlSugarORM;
+using System.Text.Json;
+
+namespace Test
+{
+    internal class DBTest
+    {
+        public static void Test()
+        {
+            SqlSugarCustom orm = new();
+
+            orm.Initialize(null);
+            string dbString = "Database=thermaldb;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True";
+            //string dbString = "Database=Kepler;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True";
+            if (!orm.Open(dbString, DbType.PostgreSQL, true))
+                return;
+
+            dynamic[] t = orm._Client!.Queryable<dynamic>().AS("\"20250627.System\"").Take(1).ToArray();
+            //dynamic[] t = orm._Client!.Queryable<dynamic>().AS("\"20250626.Data\"").Take(1).ToArray();
+
+            GeneralProcessData processData = new(0);
+            if (!processData.ToDictionary(t, out Dictionary<string, object>? outputs) || outputs is null)
+                return;
+
+            
+            foreach (var item in outputs)
+            {
+                //string s = JsonSerializer.Serialize(item);
+                //Console.WriteLine(s);
+     
+            }
+            //int totalCount = 0;
+            //int totalPages = 0;
+            //dynamic[] page = orm._Client!.Queryable<dynamic>().AS("\"20250626.Data\"").ToPageList(1, 1000, ref totalCount, ref totalPages).ToArray();
+        }
+    }
+}

+ 0 - 13
Test/KeplerData.cs

@@ -8,19 +8,6 @@ using System.Threading.Tasks;
 
 namespace Test;
 
-internal class DataCollection<T>
-{
-    public Guid UID { get; set; }
-    public DateTime Time { get; set; }
-    public Dictionary<string, T> ValueCollection { get; set; }
-}
-
-internal class PairValue<T>
-{
-    public T SetPoint { get; set; }
-    public T Value { get; set; }
-}
-
 
 internal class PM
 {

+ 3 - 39
Test/Program.cs

@@ -1,47 +1,11 @@
-
-using SqlSugar;
-using SqlSugarORM;
-using System.Collections.Concurrent;
-using System.Diagnostics;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Text;
-using System.Text.Json;
-using Universal;
-using Universal.IO;
-
-namespace Test;
+namespace Test;
 
 internal class Program
 {
     static void Main()
     {
-        SqlSugarCustom orm = new();
+        DBTest.Test();
 
-        orm.Initialize(null);
-        string dbString = "Database=thermaldb;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True";
-        //string dbString = "Database=Kepler;Password=123456;Host=localhost;Username=postgres;Persist Security Info=True";
-        if (!orm.Open(dbString, DbType.PostgreSQL, true))
-        {
-            Console.WriteLine("Connect Failed");
-            return;
-        }
 
-        dynamic[] t = orm._Client!.Queryable<dynamic>().AS("\"20250627.PM1\"").Take(10).ToArray();
-        //dynamic[] t = orm._Client!.Queryable<dynamic>().AS("\"20250626.Data\"").Take(1).ToArray();
-        //KeplerData processData = new();
-        GeneralProcessData processData = new();
-        processData.ToDictionary(t, out Dictionary<string, object>? outputs);
-        foreach (var item in outputs)
-        {
-            string s = JsonSerializer.Serialize(item);
-            Console.WriteLine(s);
-            Console.WriteLine();
-        }
-        //int totalCount = 0;
-        //int totalPages = 0;
-        //dynamic[] page = orm._Client!.Queryable<dynamic>().AS("\"20250626.Data\"").ToPageList(1, 1000, ref totalCount, ref totalPages).ToArray();
     }
-}
-
-
+}

+ 210 - 0
Test/ProximaPM.cs

@@ -0,0 +1,210 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection.Metadata.Ecma335;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Test;
+
+public class PM1
+{
+    public APC APC { get; set; }
+    public Shutter Shutter { get; set; }
+    public APCVATGV APCVATGV { get; set; }
+    public LeakCheck LeakCheck { get; set; }
+    public BoatElevatorServo BoatElevatorServo { get; set; }
+    public BoatRotationServo BoatRotationServo { get; set; }
+    public Recipe RecipeInfo { get; set; }
+
+    public DataCollection<float> FS { get; set; }
+    public DataCollection<float> VG { get; set; }
+    public DataCollection<float> PGPS { get; set; }
+    public DataCollection<bool> Sensor { get; set; }
+    public DataCollection<float> AOValue { get; set; }
+    public DataCollection<PairValue<FFU>> FFU { get; set; }
+    public DataCollection<PairValue<MFC>> MFC { get; set; }
+    public DataCollection<PairValue<bool>> AVValve { get; set; }
+    public DataCollection<PairValue<float>> IoValve { get; set; }
+    public DataCollection<PairValue<float>> GaslineHeater { get; set; }
+}
+
+public class APC
+{
+    public bool IsError { get; set; }
+    public float HomingStatus { get; set; }
+    public float Interlock1 { get; set; }
+    public float Interlock2 { get; set; }
+    public float Interlock3 { get; set; }
+    public float InterlockConstantOfInterlock3 { get; set; }
+    public float ModeFeedback { get; set; }
+    public float ModeSetPoint { get; set; }
+    public float P1SensorOffsetSetting { get; set; }
+    public float PositionFeedback { get; set; }
+    public float PositionSetPoint { get; set; }
+    public float PosMonOffsetSetting { get; set; }
+    public float Pressure1Feedback { get; set; }
+    public float Pressure2Feedback { get; set; }
+    public float PressureSetPoint { get; set; }
+    public float SelectedControllerFeedback { get; set; }
+    public float SlowRateSetPoint { get; set; }
+    public float SlowVacuumModeSetting { get; set; }
+    public float ValveStatusThreshold { get; set; }
+
+}
+
+public class APCVATGV
+{
+    public bool IsError { get; set; }
+    public float InterlockConstantOfInterlock3 { get; set; }
+    public float ModeSetPoint { get; set; }
+    public float P1SensorOffsetSetting { get; set; }
+    public float PositionFeedback { get; set; }
+    public float PositionSetPoint { get; set; }
+    public float PosMonOffsetSetting { get; set; }
+    public float Pressure1Feedback { get; set; }
+    public float Pressure2Feedback { get; set; }
+    public float PressureSetPoint { get; set; }
+    public float SlowRateSetPoint { get; set; }
+    public float SlowVacuumModeSetting { get; set; }
+    public float ValveStatusThreshold { get; set; }
+
+}
+
+public class BoatElevatorServo
+{
+    public bool AtHomePosition { get; set; }
+    public bool AtPosition1 { get; set; }
+    public bool AtPosition2 { get; set; }
+    public bool AtPosition3 { get; set; }
+    public bool CurrentPosition { get; set; }
+    public bool CurrentSpeed { get; set; }
+    public bool IsAlarm { get; set; }
+    public bool IsMoving { get; set; }
+    public bool IsReady { get; set; }
+    public bool IsServoOn { get; set; }
+    public bool TargetPosition { get; set; }
+    public bool TargetPositionFb { get; set; }
+
+
+}
+
+public class BoatRotationServo
+{
+    public bool AtHomePosition { get; set; }
+    public bool CurrentSpeed { get; set; }
+    public bool IsAlarm { get; set; }
+    public bool IsHomeDone { get; set; }
+    public bool IsHoming { get; set; }
+    public bool IsMoving { get; set; }
+    public bool IsReady { get; set; }
+}
+
+public class BufferFoup
+{
+    public float N2Flow { get; set; }
+    public float N2Pressure { get; set; }
+}
+
+public class BufferServo
+{
+    public bool AtPositionA1 { get; set; }
+    public bool AtPositionA2 { get; set; }
+    public bool AtPositionA3 { get; set; }
+    public bool AtPositionA4 { get; set; }
+    public bool AtPositionB1 { get; set; }
+    public bool AtPositionB2 { get; set; }
+    public bool AtPositionB3 { get; set; }
+    public bool AtPositionB4 { get; set; }
+    public bool AtPositionC1 { get; set; }
+    public bool AtPositionC2 { get; set; }
+    public bool AtPositionC3 { get; set; }
+    public bool AtPositionC4 { get; set; }
+    public bool AtPositionD1 { get; set; }
+    public bool AtPositionD2 { get; set; }
+    public bool AtPositionD3 { get; set; }
+    public bool AtPositionD4 { get; set; }
+    public float CurrentPosition { get; set; }
+    public float CurrentSpeed { get; set; }
+    public float CurrentTorque { get; set; }
+    public bool IsAlarm { get; set; }
+    public bool IsInPosition { get; set; }
+    public bool IsMotorRun { get; set; }
+    public bool IsReady { get; set; }
+    public bool IsServoOn { get; set; }
+    public bool IsServoOnBufferAxis { get; set; }
+    public float TargetPosition { get; set; }
+}
+
+public class FFU
+{
+    public float CurrentSpeed { get; set; }
+    public bool IsSwitch { get; set; }
+    public float SetSpeed { get; set; }
+}
+
+public class LeakCheck
+{
+    public float ActualLeak { get; set; }
+    public float BasePressure { get; set; }
+    public float BasePressureLimit { get; set; }
+    public float CheckTime { get; set; }
+    public float DelayElapseTime { get; set; }
+    public float DelayMonitorPressure { get; set; }
+    public float DelayStartPressure { get; set; }
+    public float DelayTime { get; set; }
+    public float ElapseTime { get; set; }
+    public float HighLimit { get; set; }
+    public float LeakLimit { get; set; }
+    public float LowLimit { get; set; }
+    public float MonitorPressure { get; set; }
+    public float RetryCurrentCount { get; set; }
+    public float RetryLimit { get; set; }
+    public float StartPressure { get; set; }
+
+}
+
+public class MFC
+{
+    public float Feedback { get; set; }
+    public float LastSetPoint { get; set; }
+    public float MFCUnitEnum { get; set; }
+}
+
+public class Shutter
+{
+    public bool DiClose { get; set; }
+    public bool DiOpen { get; set; }
+    public bool DoClose { get; set; }
+    public bool DoOpen { get; set; }
+}
+
+public class Recipe
+{
+    public float ChamberPressure { get; set; }
+    public bool IsError { get; set; }
+    public bool IsExecuteSubRecipe { get; set; }
+    public bool IsInMaintainMode { get; set; }
+    public bool IsLooping { get; set; }
+    public bool IsOnline { get; set; }
+    public bool IsProcessing { get; set; }
+    public float LoopCountCurrent { get; set; }
+    public float LoopCountSet { get; set; }
+    public bool MBPEnable { get; set; }
+    public bool NDIREnable { get; set; }
+    public float NewShowTime { get; set; }
+    public bool RecipeHold { get; set; }
+    public float RecipeHolded { get; set; }
+    public float RecipeHoldTime { get; set; }
+    public float RecipeStepElapseTime { get; set; }
+    public float RecipeStepNumber { get; set; }
+    public float RecipeStepTime { get; set; }
+    public float RecipeTotalElapseTime { get; set; }
+    public float RecipeTotalTime { get; set; }
+    public bool RecipeWait { get; set; }
+    public bool SensorMini8OffLine { get; set; }
+    public bool SP1Enable { get; set; }
+    public float SubRecipeCurrentLoopCount { get; set; }
+    public float SubRecipeLoopCount { get; set; }
+}

+ 160 - 0
Test/ProximaSystem.cs

@@ -0,0 +1,160 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection.Metadata;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Test;
+
+public class ProximaSystem
+{
+    public Boat Boat { get; set; }
+}
+
+public class Boat
+{
+    public float BoatTestCycledCount { get; set; }
+    public bool IsError { get; set; }
+    public bool IsOnline { get; set; }
+    public float ShutterCycledCount { get; set; }
+}
+
+public class CarrierRobot
+{
+    public float CurrentExtensionPosition { get; set; }
+    public float CurrentThetaPosition { get; set; }
+    public float CycleSwapCycledCount { get; set; }
+    public bool IsCommandExecutionReady { get; set; }
+    public bool IsControllerBatteryLow { get; set; }
+    public bool IsError { get; set; }
+    public bool IsErrorOccurred { get; set; }
+    public bool IsManipulatorBatteryLow { get; set; }
+    public bool IsOnline { get; set; }
+    public bool IsPause { get; set; }
+    public bool IsServoON { get; set; }
+    public bool IsWaferPresenceOnBlade1 { get; set; }
+    public float SwapCycledCount { get; set; }
+    public bool TPStatus { get; set; }
+}
+
+public class WaferRobot
+{
+    public bool CurrentArm1Position { get; set; }
+    public bool CurrentArm2Position { get; set; }
+    public bool CurrentExtensionPosition { get; set; }
+    public bool CurrentThetaPosition { get; set; }
+    public bool CurrentZPosition { get; set; }
+    public bool IsCommandExecutionReady { get; set; }
+    public bool IsControllerBatteryLow { get; set; }
+    public bool IsErrorOccurred { get; set; }
+    public bool IsManipulatorBatteryLow { get; set; }
+    public bool IsOnline { get; set; }
+    public bool IsPause { get; set; }
+    public bool IsServoON { get; set; }
+    public bool IsWaferPresenceOnBlade1 { get; set; }
+    public bool IsWaferPresenceOnBlade2 { get; set; }
+    public bool IsWaferPresenceOnBlade3 { get; set; }
+    public bool IsWaferPresenceOnBlade4 { get; set; }
+    public bool IsWaferPresenceOnBlade5 { get; set; }
+    public bool SwapCycledCount { get; set; }
+    public bool TPStatus { get; set; }
+
+}
+
+public class FIMS
+{
+    public float FIMSCycledCount { get; set; }
+    public bool IsError { get; set; }
+    public bool IsOnline { get; set; }
+}
+
+public class LoadPort
+{
+    public float CasstleType { get; set; }
+    public float InfoPadCarrierIndex { get; set; }
+    public float intAccessMode { get; set; }
+    public float intAccessStatus { get; set; }
+    public float intAssociationState { get; set; }
+    public float intCarrierIDStatus { get; set; }
+    public float intReserveState { get; set; }
+    public float intSlotMapStatus { get; set; }
+    public float intTransferState { get; set; }
+    public bool IsAccessSwPressed { get; set; }
+    public bool IsAutoDetectCarrierType { get; set; }
+    public bool IsClamped { get; set; }
+    public bool IsDocked { get; set; }
+    public bool IsDoorOpen { get; set; }
+    public bool IsError { get; set; }
+    public bool IsFoupPresent { get; set; }
+    public bool IsMapped { get; set; }
+    public bool IsOnline { get; set; }
+    public bool IsPlaced { get; set; }
+    public bool IsPresent { get; set; }
+    public bool IsVerifyPreDefineWaferCount { get; set; }
+    public float PreDefineWaferCount { get; set; }
+}
+
+public class Schedule
+{
+    public bool CoolingRemainTime { get; set; }
+    public bool CoolingTime { get; set; }
+    public bool CycledCount { get; set; }
+    public bool CycledTotalWafer { get; set; }
+    public bool CycledWafer { get; set; }
+    public bool CycleSetPoint { get; set; }
+}
+
+public class Stocker
+{
+    public bool CassetteHasWafer { get; set; }
+    public bool FoupPresent { get; set; }
+    public bool IsError { get; set; }
+    public bool IsOnline { get; set; }
+    public bool StatusAbnormal { get; set; }
+}
+
+public class Heater_
+{
+    public float CascadeControlModeSV { get; set; }
+    public float CascadePID_D { get; set; }
+    public float CascadePID_I { get; set; }
+    public float CascadePID_P { get; set; }
+    public float CascadePV { get; set; }
+    public float ControlMode { get; set; }
+    public float DownRate { get; set; }
+    public float HeaterControlModeSV { get; set; }
+    public float HeaterPID_D { get; set; }
+    public float HeaterPID_I { get; set; }
+    public float HeaterPID_P { get; set; }
+    public float HeaterPV { get; set; }
+    public bool IsAutoManual { get; set; }
+    public bool IsCascadeMode { get; set; }
+    public bool IsCascadePVBreak { get; set; }
+    public bool IsEnableIn { get; set; }
+    public bool IsEnableOutput { get; set; }
+    public bool IsHeaterPVBreak { get; set; }
+    public bool IsSelect { get; set; }
+    public float OverTemp { get; set; }
+    public float TCOpenOffsetOffset { get; set; }
+    public float TempFeedback { get; set; }
+    public float TempOffset { get; set; }
+    public float TempSetPoint { get; set; }
+    public float UpRate { get; set; }
+    public float WorkingOutput { get; set; }
+
+}
+
+public class System
+{
+    public bool HasActiveAlarm { get; set; }
+    public bool IsAlarm { get; set; }
+    public bool IsAlarmConditionBuzzerOn { get; set; }
+    public bool IsAutoRunning { get; set; }
+    public bool IsBusy { get; set; }
+    public bool IsIdle { get; set; }
+    public bool IsInitialized { get; set; }
+    public bool IsRecipeEditView { get; set; }
+    public bool IsSpoolingEnable { get; set; }
+    public bool SpoolingState { get; set; }
+}

+ 1 - 0
Test/Test.csproj

@@ -17,6 +17,7 @@
 
   <ItemGroup>
     <ProjectReference Include="..\DataBase\SqlSugarORM\SqlSugarORM.csproj" />
+    <ProjectReference Include="..\Data\DataService\DataService.csproj" />
   </ItemGroup>
 
 </Project>