From 82d36c2b63a3f00514012b8054d7308d73e5350b Mon Sep 17 00:00:00 2001 From: hhsung Date: Mon, 11 Aug 2025 14:23:45 +0900 Subject: [PATCH 1/2] ef setting --- SmartAquaViewer/DataAnalisys/AppDbContext.cs | 22 +++-- .../20250811050443_InitialCreate.Designer.cs | 80 +++++++++++++++++++ .../20250811050443_InitialCreate.cs | 53 ++++++++++++ .../Migrations/AppDbContextModelSnapshot.cs | 77 ++++++++++++++++++ SmartAquaViewer/SmartAquaViewer.csproj | 11 ++- 5 files changed, 233 insertions(+), 10 deletions(-) create mode 100644 SmartAquaViewer/Migrations/20250811050443_InitialCreate.Designer.cs create mode 100644 SmartAquaViewer/Migrations/20250811050443_InitialCreate.cs create mode 100644 SmartAquaViewer/Migrations/AppDbContextModelSnapshot.cs diff --git a/SmartAquaViewer/DataAnalisys/AppDbContext.cs b/SmartAquaViewer/DataAnalisys/AppDbContext.cs index 6ad3331..52c178d 100644 --- a/SmartAquaViewer/DataAnalisys/AppDbContext.cs +++ b/SmartAquaViewer/DataAnalisys/AppDbContext.cs @@ -2,16 +2,19 @@ using System.Collections.Generic; using static Microsoft.EntityFrameworkCore.DbLoggerCategory; + namespace SmartAquaViewer.DataAnalisys { public class AppDbContext : DbContext { - //dotnet ef migrations add InitialCreate - //dotnet ef database update - //dotnet ef migrations add AddMultipleTables - //dotnet ef database update + //dotnet tool install --global dotnet-ef + //dotnet ef migrations add InitialCreate --project SmartAquaViewer + //dotnet ef database update --project SmartAquaViewer + + //dotnet ef migrations add AddMultipleTables --project SmartAquaViewer + //dotnet ef database update --project SmartAquaViewer @@ -19,9 +22,14 @@ namespace SmartAquaViewer.DataAnalisys protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - // SQL Server 예시 (필요에 맞게 변경) - optionsBuilder.UseSqlServer( - "Server=localhost;Database=SmartAquaDB;Trusted_Connection=True;TrustServerCertificate=True;"); + // MySQL 연결 문자열 (일반적인 형태) + var connectionString = "Server=192.168.10.143;Port=3306;Database=smart_aqua;User=root;Password=znqk123!;"; + + // MySQL Server Version 설정 (버전에 맞춰 변경) + var serverVersion = new MySqlServerVersion(new Version(8, 0, 36)); + + optionsBuilder.UseMySql(connectionString, serverVersion); } + } } diff --git a/SmartAquaViewer/Migrations/20250811050443_InitialCreate.Designer.cs b/SmartAquaViewer/Migrations/20250811050443_InitialCreate.Designer.cs new file mode 100644 index 0000000..2faa9b3 --- /dev/null +++ b/SmartAquaViewer/Migrations/20250811050443_InitialCreate.Designer.cs @@ -0,0 +1,80 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SmartAquaViewer.DataAnalisys; + +#nullable disable + +namespace SmartAquaViewer.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20250811050443_InitialCreate")] + partial class InitialCreate + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("SmartAquaViewer.DataAnalisys.WaterQualityVO", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("DO") + .HasColumnType("double"); + + b.Property("ElectricalConductivity") + .HasColumnType("double"); + + b.Property("FlowRate") + .HasColumnType("double"); + + b.Property("ORP") + .HasColumnType("double"); + + b.Property("PH") + .HasColumnType("double"); + + b.Property("Salinity") + .HasColumnType("double"); + + b.Property("TSS") + .HasColumnType("double"); + + b.Property("Temperature") + .HasColumnType("double"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalNitrogen") + .HasColumnType("double"); + + b.Property("TotalPhosphorus") + .HasColumnType("double"); + + b.Property("Turbidity") + .HasColumnType("double"); + + b.Property("WaterLevel") + .HasColumnType("double"); + + b.Property("WaterTankNum") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("WaterQuality"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/SmartAquaViewer/Migrations/20250811050443_InitialCreate.cs b/SmartAquaViewer/Migrations/20250811050443_InitialCreate.cs new file mode 100644 index 0000000..c1b4a46 --- /dev/null +++ b/SmartAquaViewer/Migrations/20250811050443_InitialCreate.cs @@ -0,0 +1,53 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SmartAquaViewer.Migrations +{ + /// + public partial class InitialCreate : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "WaterQuality", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + WaterTankNum = table.Column(type: "int", nullable: false), + DO = table.Column(type: "double", nullable: false), + PH = table.Column(type: "double", nullable: false), + Temperature = table.Column(type: "double", nullable: false), + WaterLevel = table.Column(type: "double", nullable: false), + FlowRate = table.Column(type: "double", nullable: false), + ElectricalConductivity = table.Column(type: "double", nullable: false), + Turbidity = table.Column(type: "double", nullable: false), + Salinity = table.Column(type: "double", nullable: false), + ORP = table.Column(type: "double", nullable: false), + TSS = table.Column(type: "double", nullable: false), + TotalNitrogen = table.Column(type: "double", nullable: false), + TotalPhosphorus = table.Column(type: "double", nullable: false), + Timestamp = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_WaterQuality", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "WaterQuality"); + } + } +} diff --git a/SmartAquaViewer/Migrations/AppDbContextModelSnapshot.cs b/SmartAquaViewer/Migrations/AppDbContextModelSnapshot.cs new file mode 100644 index 0000000..ad78d1d --- /dev/null +++ b/SmartAquaViewer/Migrations/AppDbContextModelSnapshot.cs @@ -0,0 +1,77 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SmartAquaViewer.DataAnalisys; + +#nullable disable + +namespace SmartAquaViewer.Migrations +{ + [DbContext(typeof(AppDbContext))] + partial class AppDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("SmartAquaViewer.DataAnalisys.WaterQualityVO", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("DO") + .HasColumnType("double"); + + b.Property("ElectricalConductivity") + .HasColumnType("double"); + + b.Property("FlowRate") + .HasColumnType("double"); + + b.Property("ORP") + .HasColumnType("double"); + + b.Property("PH") + .HasColumnType("double"); + + b.Property("Salinity") + .HasColumnType("double"); + + b.Property("TSS") + .HasColumnType("double"); + + b.Property("Temperature") + .HasColumnType("double"); + + b.Property("Timestamp") + .HasColumnType("datetime(6)"); + + b.Property("TotalNitrogen") + .HasColumnType("double"); + + b.Property("TotalPhosphorus") + .HasColumnType("double"); + + b.Property("Turbidity") + .HasColumnType("double"); + + b.Property("WaterLevel") + .HasColumnType("double"); + + b.Property("WaterTankNum") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("WaterQuality"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/SmartAquaViewer/SmartAquaViewer.csproj b/SmartAquaViewer/SmartAquaViewer.csproj index 4f73c26..542ad02 100644 --- a/SmartAquaViewer/SmartAquaViewer.csproj +++ b/SmartAquaViewer/SmartAquaViewer.csproj @@ -10,12 +10,17 @@ - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + From fbcf495dce06c99f59cd74e26d568240ee29b2ef Mon Sep 17 00:00:00 2001 From: hj615 Date: Mon, 11 Aug 2025 16:28:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20field=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataAnalisys/AquarDataControl.cs | 2 +- .../DataAnalisys/WaterQualityVO.cs | 347 +++++++++++++----- SmartAquaViewer/MainWindow.xaml.cs | 3 + 3 files changed, 259 insertions(+), 93 deletions(-) diff --git a/SmartAquaViewer/DataAnalisys/AquarDataControl.cs b/SmartAquaViewer/DataAnalisys/AquarDataControl.cs index 68de21b..d8b0174 100644 --- a/SmartAquaViewer/DataAnalisys/AquarDataControl.cs +++ b/SmartAquaViewer/DataAnalisys/AquarDataControl.cs @@ -63,7 +63,7 @@ namespace SmartAquaViewer.DataAnalisys // TODO: 라인 파싱 로직 WaterQualityVO vo = new(); - vo.PH = 10.5; + //vo.PH = 10.5; vo.Timestamp = DateTime.Now; iwaterQuality.OnParsed(vo); diff --git a/SmartAquaViewer/DataAnalisys/WaterQualityVO.cs b/SmartAquaViewer/DataAnalisys/WaterQualityVO.cs index 5af359b..01afa1e 100644 --- a/SmartAquaViewer/DataAnalisys/WaterQualityVO.cs +++ b/SmartAquaViewer/DataAnalisys/WaterQualityVO.cs @@ -11,6 +11,7 @@ namespace SmartAquaViewer.DataAnalisys using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; + using System.Security.Policy; [Table("WaterQuality")] public class WaterQualityVO @@ -21,69 +22,19 @@ namespace SmartAquaViewer.DataAnalisys public int Id { get; set; } // PK, Auto Increment /// - /// 저수조 번호 - /// - public int WaterTankNum { get; set; } - - /// - /// Dissolved Oxygen (mg/L) - /// - public double DO { get; set; } - - /// - /// pH (산도) - /// - public double PH { get; set; } - - /// - /// 수온 (°C) - /// - public double Temperature { get; set; } - - /// - /// 수위 (m) - /// - public double WaterLevel { get; set; } - - /// - /// 유량 (m³/s) - /// - public double FlowRate { get; set; } - - /// - /// 전기전도도 (µS/cm) - /// - public double ElectricalConductivity { get; set; } - - /// - /// 탁도 (NTU) - /// - public double Turbidity { get; set; } - - /// - /// 염도 (ppt) - /// - public double Salinity { get; set; } - - /// - /// 산화환원전위 (mV) - /// - public double ORP { get; set; } - - /// - /// 총부유물질 (mg/L) + /// 저수조 /// - public double TSS { get; set; } + public WaterTank WaterTank { get; set; } /// - /// 총질소 (mg/L) + /// 여과 시스템 /// - public double TotalNitrogen { get; set; } + public FilteringSystem FilteringSystem { get; set; } /// - /// 총인 (mg/L) + /// 살균 시스템 /// - public double TotalPhosphorus { get; set; } + public SterilizingSystem SterilizingSystem { get; set; } /// /// 측정 시각 @@ -92,32 +43,42 @@ namespace SmartAquaViewer.DataAnalisys public WaterQualityVO() { } - public WaterQualityVO(int waterTankNum, double doValue, double ph, double temperature, double waterLevel, double flowRate, - double electricalConductivity, double turbidity, double salinity, double orp, - double tss, double totalNitrogen, double totalPhosphorus, DateTime timestamp) + public WaterQualityVO( + int waterTankNum, double waterTankDOValue, double waterTankPh, double waterTankORP, double waterTankTemperature, double waterTankFlowRate, + bool sandFilterPower, + double sumpPH, double sumpORP, double sumpWaterLevel, double sumpFlowRate, double sumpTemperature, + bool circulationPumpPower, string? inverterControllerStatus, double flowRate, + bool heatPumpPower, double heatPumpTemperature, bool airBlowerPower, + bool ozoneGeneratorPower, + string uvSterilizerId, bool uvSterilizerPower, + bool ozoneDissolverPower, double ozoneDissolverPressure, + bool excessOzoneDestroyerPower, + DateTime timestamp) { - WaterTankNum = waterTankNum; - DO = doValue; - PH = ph; - Temperature = temperature; - WaterLevel = waterLevel; - FlowRate = flowRate; - ElectricalConductivity = electricalConductivity; - Turbidity = turbidity; - Salinity = salinity; - ORP = orp; - TSS = tss; - TotalNitrogen = totalNitrogen; - TotalPhosphorus = totalPhosphorus; - Timestamp = timestamp; + WaterTank = new WaterTank(waterTankNum, waterTankDOValue, waterTankPh, waterTankORP, waterTankTemperature, waterTankFlowRate); + FilteringSystem = new FilteringSystem(sandFilterPower, sumpPH, sumpORP, sumpWaterLevel, sumpFlowRate, sumpTemperature, + circulationPumpPower, inverterControllerStatus, flowRate, + heatPumpPower, heatPumpTemperature, airBlowerPower); + SterilizingSystem = new SterilizingSystem(ozoneGeneratorPower, uvSterilizerId, uvSterilizerPower, + ozoneDissolverPower, ozoneDissolverPressure, excessOzoneDestroyerPower); } public override string ToString() { - return $"Tank#{WaterTankNum} [{Timestamp}] DO: {DO} mg/L, pH: {PH}, Temp: {Temperature}°C, " + - $"Level: {WaterLevel} m, Flow: {FlowRate} m³/s, EC: {ElectricalConductivity} µS/cm, " + - $"Turbidity: {Turbidity} NTU, Salinity: {Salinity} ppt, ORP: {ORP} mV, " + - $"TSS: {TSS} mg/L, TN: {TotalNitrogen} mg/L, TP: {TotalPhosphorus} mg/L"; + //return $"Tank#{WaterTankNum} [{Timestamp}] DO: {DO} mg/L, pH: {PH}, Temp: {Temperature}°C, " + + // $"Level: {WaterLevel} m, Flow: {FlowRate} m³/s, EC: {ElectricalConductivity} µS/cm, " + + // $"Turbidity: {Turbidity} NTU, Salinity: {Salinity} ppt, ORP: {ORP} mV, " + + // $"TSS: {TSS} mg/L, TN: {TotalNitrogen} mg/L, TP: {TotalPhosphorus} mg/L"; + + return $"[{Timestamp}] " + + $"[Tank#{WaterTank.WaterTankNum}, DO: {WaterTank.DO} mg/L, pH: {WaterTank.PH}, ORP: {WaterTank.ORP} mV, Temp: {WaterTank.Temperature}°C, FlowRate: {WaterTank.FlowRate} m³/s]" + + $"[SandFilter: {(FilteringSystem.SandFilterPower ? "ON" : "OFF")}, " + + $"(SumpTank) pH: {FilteringSystem.SumpPH}, ORP: {FilteringSystem.SumpORP} mV, WaterLevel: {FilteringSystem.SumpWaterLevel} m, FlowRate: {FilteringSystem.SumpFlowRate} m³/s, Temperature: {FilteringSystem.SumpTemperature}°C," + + $"HeatPump: {(FilteringSystem.HeatPumpPower ? "ON" : "OFF")}, HeatPumpTemperature: {FilteringSystem.HeatPumpTemperature}°C, AirBlower: {(FilteringSystem.AirBlowerPower ? "ON" : "OFF")}]" + + $"[OzoneGenerator: {(SterilizingSystem.OzoneGeneratorPower ? "ON" : "OFF")}," + + $"UVSterilizerId: {SterilizingSystem.UVSterilizerId}, UVSterilizer: {(SterilizingSystem.UVSterilizerPower ? "ON" : "OFF")}," + + $"OzoneDissolver: {SterilizingSystem.OzoneDissolverPower}, OzoneDissolverPressure: {SterilizingSystem.OzoneDissolverPressure} kPa," + + $"ExcessOzoneDestroyer: {(SterilizingSystem.ExcessOzoneDestroyerPower ? "ON" : "OFF")}]"; } /// @@ -149,24 +110,57 @@ namespace SmartAquaViewer.DataAnalisys { DateTime ts = start.AddSeconds(stepSeconds * i); + //var vo = new WaterQualityVO + //{ + // WaterTankNum = rand.Next(1, 6), // 1~5번 탱크 + // DO = Math.Round(rand.NextDouble() * 5 + 5, 2), // 5~10 mg/L + // PH = Math.Round(rand.NextDouble() * 2 + 6, 2), // 6~8 + // Temperature = Math.Round(rand.NextDouble() * 10 + 15, 2), // 15~25°C + // WaterLevel = Math.Round(rand.NextDouble() * 2 + 1, 2), // 1~3 m + // FlowRate = Math.Round(rand.NextDouble() * 5 + 1, 2), // 1~6 m³/s + // ElectricalConductivity = Math.Round(rand.NextDouble() * 500 + 200, 2), // 200~700 µS/cm + // Turbidity = Math.Round(rand.NextDouble() * 5 + 1, 2), // 1~6 NTU + // Salinity = Math.Round(rand.NextDouble() * 5, 2), // 0~5 ppt + // ORP = Math.Round(rand.NextDouble() * 200 + 100, 2), // 100~300 mV + // TSS = Math.Round(rand.NextDouble() * 20 + 5, 2), // 5~25 mg/L + // TotalNitrogen = Math.Round(rand.NextDouble() * 2 + 0.5, 2), // 0.5~2.5 mg/L + // TotalPhosphorus = Math.Round(rand.NextDouble() * 0.5 + 0.05, 3), // 0.05~0.55 mg/L + // Timestamp = ts + //}; + var vo = new WaterQualityVO { - WaterTankNum = rand.Next(1, 6), // 1~5번 탱크 - DO = Math.Round(rand.NextDouble() * 5 + 5, 2), // 5~10 mg/L - PH = Math.Round(rand.NextDouble() * 2 + 6, 2), // 6~8 - Temperature = Math.Round(rand.NextDouble() * 10 + 15, 2), // 15~25°C - WaterLevel = Math.Round(rand.NextDouble() * 2 + 1, 2), // 1~3 m - FlowRate = Math.Round(rand.NextDouble() * 5 + 1, 2), // 1~6 m³/s - ElectricalConductivity = Math.Round(rand.NextDouble() * 500 + 200, 2), // 200~700 µS/cm - Turbidity = Math.Round(rand.NextDouble() * 5 + 1, 2), // 1~6 NTU - Salinity = Math.Round(rand.NextDouble() * 5, 2), // 0~5 ppt - ORP = Math.Round(rand.NextDouble() * 200 + 100, 2), // 100~300 mV - TSS = Math.Round(rand.NextDouble() * 20 + 5, 2), // 5~25 mg/L - TotalNitrogen = Math.Round(rand.NextDouble() * 2 + 0.5, 2), // 0.5~2.5 mg/L - TotalPhosphorus = Math.Round(rand.NextDouble() * 0.5 + 0.05, 3), // 0.05~0.55 mg/L - Timestamp = ts + WaterTank = new WaterTank( + waterTankNum: rand.Next(1, 6), // 1~5번 탱크 + doValue: Math.Round(rand.NextDouble() * 5 + 5, 2), // 5~10 mg/L + ph: Math.Round(rand.NextDouble() * 2 + 6, 2), // 6~8 + orp: Math.Round(rand.NextDouble() * 200 + 100, 2), // 100~300 mV + temperature: Math.Round(rand.NextDouble() * 10 + 15, 2), // 15~25°C + flowRate: Math.Round(rand.NextDouble() * 5 + 1, 2) // 1~6 m³/s + ), + FilteringSystem = new FilteringSystem( + sandFilterPower: rand.Next(0, 2) == 1, // true or false + sumpPH: Math.Round(rand.NextDouble() * 2 + 6, 2), // 6~8 + sumpORP: Math.Round(rand.NextDouble() * 200 + 100, 2), // 100~300 mV + sumpWaterLevel: Math.Round(rand.NextDouble() * 2 + 1, 2), // 1~3 m + sumpFlowRate: Math.Round(rand.NextDouble() * 5 + 1, 2), // 1~6 m³/s + sumpTemperature: Math.Round(rand.NextDouble() * 10 + 15, 2), // 15~25°C + circulationPumpPower: rand.Next(0, 2) == 1, // true or false + inverterControllerStatus: rand.Next(0, 2) == 1 ? "Normal" : "Error", // "Normal" or "Error" + flowRate: Math.Round(rand.NextDouble() * 5 + 1, 2), // 1~6 m³/s + heatPumpPower: rand.Next(0, 2) == 1, // true or false + heatPumpTemperature: Math.Round(rand.NextDouble() * 10 + 15, 2), // 15~25°C + airBlowerPower: rand.Next(0, 2) == 1 // true or false + ), + SterilizingSystem = new SterilizingSystem( + ozoneGeneratorPower: rand.Next(0, 2) == 1, // true or false + uvSterilizerId: "UV" + rand.Next(1, 100), // UV1, UV2, ... + uvSterilizerPower: rand.Next(0, 2) == 1, // true or false + ozoneDissolverPower: rand.Next(0, 2) == 1, // true or false + ozoneDissolverPressure: Math.Round(rand.NextDouble() * 100 + 50, 2), // 50~150 kPa + excessOzoneDestroyerPower: rand.Next(0, 2) == 1 // true or false + ) }; - list.Add(vo); } @@ -175,6 +169,175 @@ namespace SmartAquaViewer.DataAnalisys } + public class WaterTank + { + /// + /// 저수조 번호 + /// + public int WaterTankNum { get; set; } + /// + /// Dissolved Oxygen (mg/L) + /// + public double DO { get; set; } + /// + /// pH (산도) + /// + public double PH { get; set; } + + /// + /// 산화환원전위 (mV) + /// + public double ORP { get; set; } + + /// + /// 수온 (°C) + /// + public double Temperature { get; set; } + + /// + /// 유량 (m³/s) + /// + public double FlowRate { get; set; } + + public WaterTank(int waterTankNum, double doValue, double ph, double orp, double temperature, double flowRate) + { + WaterTankNum = waterTankNum; + DO = doValue; + PH = ph; + ORP = orp; + Temperature = temperature; + FlowRate = flowRate; + } + } + + public class FilteringSystem + { + /// + /// 모래여과기 전원 (true: ON, false: OFF) + /// + public bool SandFilterPower { get; set; } + + + /// + /// 섬프탱크 pH (산도) + /// + public double SumpPH { get; set; } + + /// + /// 섬프탱크 산화환원전위 (mV) + /// + public double SumpORP { get; set; } + + /// + /// 섬프탱크 수위 (m) + /// + public double SumpWaterLevel { get; set; } + + /// + /// 섬프탱크 유량 (m³/s) + /// + public double SumpFlowRate { get; set; } + + /// + /// 섬프탱크 수온 (°C) + /// + public double SumpTemperature { get; set; } + + /// + /// 순환펌프 전원 (true: ON, false: OFF) + /// + public bool CirculationPumpPower { get; set; } + + /// + /// 인버터 제어기 상태 + /// + public string? InverterControllerStatus { get; set; } + + /// + /// 순환펌프 유량 (m³/s) + /// + public double FlowRate { get; set; } + + /// + /// 히트펌프 전원 (true: ON, false: OFF) + /// + public bool HeatPumpPower { get; set; } + + /// + /// 히트펌프 온도 (°C) + /// + public double HeatPumpTemperature { get; set; } + + /// + /// 에어브로와 전원 (true: ON, false: OFF) + /// + public bool AirBlowerPower { get; set; } + + public FilteringSystem(bool sandFilterPower, + double sumpPH, double sumpORP, double sumpWaterLevel, double sumpFlowRate, double sumpTemperature, + bool circulationPumpPower, string? inverterControllerStatus, double flowRate, + bool heatPumpPower, double heatPumpTemperature, bool airBlowerPower) + { + SandFilterPower = sandFilterPower; + SumpPH = sumpPH; + SumpORP = sumpORP; + SumpWaterLevel = sumpWaterLevel; + SumpFlowRate = sumpFlowRate; + SumpTemperature = sumpTemperature; + CirculationPumpPower = circulationPumpPower; + InverterControllerStatus = inverterControllerStatus; + FlowRate = flowRate; + HeatPumpPower = heatPumpPower; + HeatPumpTemperature = heatPumpTemperature; + AirBlowerPower = airBlowerPower; + } + } + + public class SterilizingSystem + { + /// + /// 오존 발생기 전원 (true: ON, false: OFF) + /// + public bool OzoneGeneratorPower { get; set; } + + /// + /// 자외선 살균기 ID + /// + public string UVSterilizerId { get; set; } + + /// + /// 자외선 살균기 전원 (true: ON, false: OFF) + /// + public bool UVSterilizerPower { get; set; } + + /// + /// 오존용해장치 전원 (true: ON, false: OFF) + /// + public bool OzoneDissolverPower { get; set; } + + /// + /// 오존용해장치 압력 (kPa) + /// + public double OzoneDissolverPressure { get; set; } + + /// + /// 배오존장치 전원 (true: ON, false: OFF) + /// + public bool ExcessOzoneDestroyerPower { get; set; } + + public SterilizingSystem(bool ozoneGeneratorPower, + string uvSterilizerId, bool uvSterilizerPower, + bool ozoneDissolverPower, double ozoneDissolverPressure, + bool excessOzoneDestroyerPower) + { + OzoneGeneratorPower = ozoneGeneratorPower; + UVSterilizerId = uvSterilizerId; + UVSterilizerPower = uvSterilizerPower; + OzoneDissolverPower = ozoneDissolverPower; + OzoneDissolverPressure = ozoneDissolverPressure; + ExcessOzoneDestroyerPower = excessOzoneDestroyerPower; + } + } } diff --git a/SmartAquaViewer/MainWindow.xaml.cs b/SmartAquaViewer/MainWindow.xaml.cs index ca382bc..5211df0 100644 --- a/SmartAquaViewer/MainWindow.xaml.cs +++ b/SmartAquaViewer/MainWindow.xaml.cs @@ -8,6 +8,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using SmartAquaViewer.DataAnalisys; namespace SmartAquaViewer { @@ -19,6 +20,8 @@ namespace SmartAquaViewer public MainWindow() { InitializeComponent(); + + var data = WaterQualityVO.GetSampleData(new DateTime(2025, 8, 1), new DateTime(2025, 8, 5), 10); } } } \ No newline at end of file