diff --git a/SolarPower/Controllers/AnalysisInverterController.cs b/SolarPower/Controllers/AnalysisInverterController.cs index e2c4ff8..4905b0d 100644 --- a/SolarPower/Controllers/AnalysisInverterController.cs +++ b/SolarPower/Controllers/AnalysisInverterController.cs @@ -38,7 +38,7 @@ namespace SolarPower.Controllers } else { - powerStations = await powerStationRepository.GetPowerStationsByCompanyId(myUser.CompanyId); + powerStations = await powerStationRepository.GetPowerStationsByCompanyId(myUser); } var siteDBNamePowerStationId = new Dictionary>(); diff --git a/SolarPower/Controllers/AnalysisStationInfoController.cs b/SolarPower/Controllers/AnalysisStationInfoController.cs index 07e99fe..b502bc0 100644 --- a/SolarPower/Controllers/AnalysisStationInfoController.cs +++ b/SolarPower/Controllers/AnalysisStationInfoController.cs @@ -37,7 +37,7 @@ namespace SolarPower.Controllers } else { - powerStations = await powerStationRepository.GetPowerStationsByCompanyId(myUser.CompanyId); + powerStations = await powerStationRepository.GetPowerStationsByCompanyId(myUser); } var siteDBNamePowerStationId = new Dictionary>(); @@ -51,7 +51,7 @@ namespace SolarPower.Controllers var powerStationDevices = await powerStationRepository.GetPowerStationDevice(siteDBNamePowerStationId, filter); - powerStationDevices = powerStationDevices.Where(x => x.DeviceId != null).ToList(); + //powerStationDevices = powerStationDevices.Where(x => x.DeviceId != null).ToList(); var powerStationDevice_cityName_Group = powerStationDevices.GroupBy(x => x.CityName).ToList(); @@ -79,7 +79,10 @@ namespace SolarPower.Controllers temp.Add(powerStation); foreach (var device in psName_Group) { - temp.Add(device); + if(!string.IsNullOrEmpty(device.DeviceId)) + { + temp.Add(device); + } } deviceDic.Add(psName_Group.Key, temp); } diff --git a/SolarPower/Controllers/PowerStationController.cs b/SolarPower/Controllers/PowerStationController.cs index bb70699..ac02bae 100644 --- a/SolarPower/Controllers/PowerStationController.cs +++ b/SolarPower/Controllers/PowerStationController.cs @@ -2033,7 +2033,23 @@ namespace SolarPower.Controllers foreach (var solar in solaramount) { - solar.MainDisplay = Path.Combine(stationImageFilePath, solar.Id.ToString()) + "/" + solar.MainDisplay; + //判斷該檔案是否存在 + if (!string.IsNullOrEmpty(solar.MainDisplay)) + { + var fullFilePath = Directory.GetCurrentDirectory() + "/wwwroot" + Path.Combine(stationImageFilePath, solar.Id.ToString()) + "/" + solar.MainDisplay; + if (System.IO.File.Exists(fullFilePath)) + { + solar.MainDisplay = Path.Combine(stationImageFilePath, solar.Id.ToString()) + "/" + solar.MainDisplay; + } + else + { + solar.MainDisplay = Path.Combine("img", "blank.gif"); + } + } + else + { + solar.MainDisplay = Path.Combine("img", "blank.gif"); + } List deviceControllerid = await powerStationRepository.GetAllDeviceControllerId(solar.Id, solar.SiteDB); var InverterTable = await powerStationRepository.InverterTable(deviceControllerid, solar.SiteDB); solar.InverterAmount = InverterTable.Count; diff --git a/SolarPower/Controllers/StationOverviewController.cs b/SolarPower/Controllers/StationOverviewController.cs index bc5d830..4660c69 100644 --- a/SolarPower/Controllers/StationOverviewController.cs +++ b/SolarPower/Controllers/StationOverviewController.cs @@ -6,11 +6,11 @@ using SolarPower.Models.PowerStation; using SolarPower.Repository.Interface; using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; using System.Threading.Tasks; -using System.Globalization; namespace SolarPower.Controllers { @@ -52,7 +52,23 @@ namespace SolarPower.Controllers foreach (var solar in solaramount) { - solar.MainDisplay = Path.Combine(stationImageFilePath, solar.Id.ToString()) + "/" + solar.MainDisplay; + //判斷該檔案是否存在 + if (!string.IsNullOrEmpty(solar.MainDisplay)) + { + var fullFilePath = Directory.GetCurrentDirectory() + "/wwwroot" + Path.Combine(stationImageFilePath, solar.Id.ToString()) + "/" + solar.MainDisplay; + if (System.IO.File.Exists(fullFilePath)) + { + solar.MainDisplay = Path.Combine(stationImageFilePath, solar.Id.ToString()) + "/" + solar.MainDisplay; + } + else + { + solar.MainDisplay = Path.Combine("img", "blank.gif"); + } + } + else + { + solar.MainDisplay = Path.Combine("img", "blank.gif"); + } } apiResult.Data = solaramount; @@ -215,6 +231,7 @@ namespace SolarPower.Controllers powerIrradianceTodayChart.Labels = powerIrradianceToday.Select(x => x.Label).ToList(); powerIrradianceTodayChart.PowerDatas = powerIrradianceToday.Select(x => x.PowerData).ToList(); powerIrradianceTodayChart.IrradianceDatas = powerIrradianceToday.Select(x => x.IrradianceData).ToList(); + powerIrradianceTodayChart.TemperatureDatas = powerIrradianceToday.Select(x => x.TemperatureData).ToList(); chartUptoDate.ChartToday = powerIrradianceTodayChart; //7日發電量日照度List @@ -224,24 +241,27 @@ namespace SolarPower.Controllers powerIrradiance7dayChart.Labels = powerIrradiance7day.Select(x => x.Label).ToList(); powerIrradiance7dayChart.PowerDatas = powerIrradiance7day.Select(x => x.PowerData).ToList(); powerIrradiance7dayChart.IrradianceDatas = powerIrradiance7day.Select(x => x.IrradianceData).ToList(); + powerIrradiance7dayChart.TemperatureDatas = powerIrradiance7day.Select(x => x.TemperatureData).ToList(); chartUptoDate.Chart7day = powerIrradiance7dayChart; //本月發電量日照度List var powerIrradianceMonth = await overviewRepository.GetListPowerIrradianceMonthByPowerStationId(id, nowDay); - //今日資料轉換 + //本月資料轉換 PowerIrradianceChart powerIrradianceMonthChart = new PowerIrradianceChart(); powerIrradianceMonthChart.Labels = powerIrradianceMonth.Select(x => x.Label).ToList(); powerIrradianceMonthChart.PowerDatas = powerIrradianceMonth.Select(x => x.PowerData).ToList(); powerIrradianceMonthChart.IrradianceDatas = powerIrradianceMonth.Select(x => x.IrradianceData).ToList(); + powerIrradianceMonthChart.TemperatureDatas = powerIrradianceMonth.Select(x => x.TemperatureData).ToList(); chartUptoDate.ChartMonth = powerIrradianceMonthChart; //本年發電量日照度List var powerIrradianceYear = await overviewRepository.GetListPowerIrradianceYearByPowerStationId(id, nowDay); - //今日資料轉換 + //本月資料轉換 PowerIrradianceChart powerIrradianceYearChart = new PowerIrradianceChart(); powerIrradianceYearChart.Labels = powerIrradianceYear.Select(x => x.Label).ToList(); powerIrradianceYearChart.PowerDatas = powerIrradianceYear.Select(x => x.PowerData).ToList(); powerIrradianceYearChart.IrradianceDatas = powerIrradianceYear.Select(x => x.IrradianceData).ToList(); + powerIrradianceYearChart.TemperatureDatas = powerIrradianceYear.Select(x => x.TemperatureData).ToList(); chartUptoDate.ChartYear = powerIrradianceYearChart; apiResult.Code = "0000"; @@ -434,7 +454,7 @@ namespace SolarPower.Controllers { a.Function = @$"{a.FormId}"; } - if(a.NormalTime == "1970-01-01 08:00:00") + if (a.NormalTime == "1970-01-01 08:00:00") { a.NormalTime = ""; } @@ -487,12 +507,12 @@ namespace SolarPower.Controllers { List values = new List(); - foreach(var lable in inverterkwhBar.Labels) + foreach (var lable in inverterkwhBar.Labels) { var find = false; foreach (var value in inverterHistory) { - if(value.TIMESTAMP == lable) + if (value.TIMESTAMP == lable) { values.Add(value.KWH); find = true; diff --git a/SolarPower/Controllers/StationReportController.cs b/SolarPower/Controllers/StationReportController.cs index 5c6976b..7819911 100644 --- a/SolarPower/Controllers/StationReportController.cs +++ b/SolarPower/Controllers/StationReportController.cs @@ -7,6 +7,7 @@ using NPOI.SS.Util; using NPOI.XSSF.UserModel; using SolarPower.Models; using SolarPower.Models.PowerStation; +using SolarPower.Models.Role; using SolarPower.Repository.Interface; using System; using System.Collections.Generic; @@ -49,7 +50,7 @@ namespace SolarPower.Controllers } else { - powerStations = await powerStationRepository.GetPowerStationsByCompanyIdWithfilter(myUser.CompanyId,filter); + powerStations = await powerStationRepository.GetPowerStationsByCompanyIdWithfilter(myUser,filter); } var siteDBNamePowerStationId = new Dictionary>(); diff --git a/SolarPower/DBSchema/solar_power_schema.sql b/SolarPower/DBSchema/solar_power_schema.sql index 7ad62a7..e9d2291 100644 --- a/SolarPower/DBSchema/solar_power_schema.sql +++ b/SolarPower/DBSchema/solar_power_schema.sql @@ -428,12 +428,12 @@ INSERT INTO `auth_page` (`AuthCode`, `MainName`, `SubName`, `TagName`, `ControlN ('L', '交叉分析', '合併電站', NULL, 'AnalysisStationCombine'), ('M', '交叉分析', '電站交叉分析', NULL, 'AnalysisStationInfo'), ('N', '交叉分析', '逆變器交叉分析', NULL, 'AnalysisInverter'), - ('P', '報表查詢', '電站報表', NULL, 'CCC'), + ('P', '報表查詢', '電站報表', NULL, 'StationReport'), ('Q', '報表查詢', '電廠發電效能統計', NULL, 'HHH'), - ('R', '報表查詢', '輸入台電售電紀錄', NULL, 'JJJ'), + ('R', '報表查詢', '輸入台電售電紀錄', NULL, 'ElectricitySoldRecord'), ('S', '報表查詢', '報告發送設定', NULL, 'JJJ'), ('T', '即時告警', '異常事件查詢', NULL, 'KKK'), - ('U', '運維管理', '電站管理', NULL, 'PowerStationManager'), + ('U', '運維管理', '電站管理', NULL, 'PowerStation'), ('V', '運維管理', '定期計畫建立', NULL, 'Operation'), ('W', '運維管理', '運維作業記錄', NULL, 'OperationRecord'), ('X', '系統管理', '公司管理', NULL, 'Company'), @@ -1262,7 +1262,7 @@ CREATE TABLE IF NOT EXISTS `weather_description` ( `WeatherValue` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分類代碼', `WeatherKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'icon代號', PRIMARY KEY (`Id`) -) ENGINE=InnoDB AUTO_INCREMENT=355 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='天氣描述分類'; +) ENGINE=InnoDB AUTO_INCREMENT=355 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='天氣描述分類'; -- 正在傾印表格 solar_power_test.weather_description 的資料:~0 rows (近似值) DELETE FROM `weather_description`; @@ -1636,7 +1636,7 @@ CREATE TABLE IF NOT EXISTS `weather_forecast` ( `CreatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`Id`), KEY `IDX_01` (`LocationName`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='天氣預報'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='天氣預報'; @@ -1648,7 +1648,7 @@ CREATE TABLE IF NOT EXISTS `weather_observation` ( `Temp` double DEFAULT NULL COMMENT '溫度', PRIMARY KEY (`Id`), KEY `IDX_01` (`PowerStationId`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='天氣觀測'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='天氣觀測'; diff --git a/SolarPower/Models/AnalysisStationCombine.cs b/SolarPower/Models/AnalysisStationCombine.cs index 2c480ce..d78b9f0 100644 --- a/SolarPower/Models/AnalysisStationCombine.cs +++ b/SolarPower/Models/AnalysisStationCombine.cs @@ -27,6 +27,7 @@ namespace SolarPower.Models public class Chartoutput { public double Irradiance { get; set; } + public double Temperature { get; set; } public double KWH { get; set; } public string Time { get; set; } } diff --git a/SolarPower/Models/NoticeSchedule.cs b/SolarPower/Models/NoticeSchedule.cs index f80d5a7..e121f95 100644 --- a/SolarPower/Models/NoticeSchedule.cs +++ b/SolarPower/Models/NoticeSchedule.cs @@ -16,6 +16,7 @@ namespace SolarPower.Models public string Attachment { get; set; } public byte IsDelivery { get; set; } public string DeliveryAt { get; set; } + public string Reason { get; set; } } public class OperationPersonnel diff --git a/SolarPower/Models/Overview.cs b/SolarPower/Models/Overview.cs index 640e473..e8abc06 100644 --- a/SolarPower/Models/Overview.cs +++ b/SolarPower/Models/Overview.cs @@ -77,6 +77,7 @@ namespace SolarPower.Models public string Label { get; set; } public double PowerData { get; set; } public double IrradianceData { get; set; } + public double TemperatureData { get; set; } } public class PowerIrradianceChart @@ -84,6 +85,7 @@ namespace SolarPower.Models public List Labels { get; set; } public List PowerDatas { get; set; } public List IrradianceDatas { get; set; } + public List TemperatureDatas { get; set; } } public class ExceptionSent diff --git a/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs b/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs index a37afa6..748b33a 100644 --- a/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs +++ b/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs @@ -42,7 +42,7 @@ namespace SolarPower.Quartz.Jobs if (this.environment.IsDevelopment()) { - dateTime = DateTimeNow.AddHours(-1).ToString("yyyy-MM-dd HH"); + dateTime = "2021-08-06 10"; } logger.LogInformation("【CalcPowerStationJob】【任務開始】"); @@ -170,10 +170,22 @@ namespace SolarPower.Quartz.Jobs history.CARBON = history.KWH * carbonRate; //總減碳量(總發電量 * (0.554/1000)[抓資料庫值] calcPowerStation.Total_Carbon = history.TotalKWH * carbonRate; - history.TODAYCARBON = lastmoneyhistorybyhour.TODAYCARBON + history.KWH * carbonRate; - history.TOTALCARBON = lastmoneyhistorybyhour.TOTALCARBON + history.KWH * carbonRate; - history.TODAYMONEY = lastmoneyhistorybyhour.TODAYMONEY + history.KWH * powerStation.PowerRate; - history.TOTALMONEY = lastmoneyhistorybyhour.TOTALMONEY + history.KWH * powerStation.PowerRate; + + if(lastmoneyhistorybyhour != null) + { + history.TODAYCARBON = lastmoneyhistorybyhour.TODAYCARBON + history.KWH * carbonRate; + history.TOTALCARBON = lastmoneyhistorybyhour.TOTALCARBON + history.KWH * carbonRate; + history.TODAYMONEY = lastmoneyhistorybyhour.TODAYMONEY + history.KWH * powerStation.PowerRate; + history.TOTALMONEY = lastmoneyhistorybyhour.TOTALMONEY + history.KWH * powerStation.PowerRate; + } + else + { + history.TODAYCARBON = history.KWH * carbonRate; + history.TOTALCARBON = history.KWH * carbonRate; + history.TODAYMONEY = history.KWH * powerStation.PowerRate; + history.TOTALMONEY = history.KWH * powerStation.PowerRate; + } + #endregion #region 發電時間 @@ -194,7 +206,7 @@ namespace SolarPower.Quartz.Jobs logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的日照計設備資訊】", powerStation.Code, dateTime); logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的日照計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(deviceInfos)); - if (deviceInfos != null) + if (deviceInfos != null && deviceInfos.Count() > 0) { //2. 計算該電站所有日照計設的每小時的平均在依照日照計數量平均 logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的日照計的日照度】", powerStation.Code, dateTime); @@ -216,7 +228,7 @@ namespace SolarPower.Quartz.Jobs var tempdeviceInfos = await powerStationRepository.GetListTempByPowerStationId(powerStation.Id, powerStation.SiteDB); logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的溫度計設備資訊】", powerStation.Code, dateTime); logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的溫度計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(tempdeviceInfos)); - if (tempdeviceInfos != null) + if (tempdeviceInfos != null && tempdeviceInfos.Count() > 0) { logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的溫度計的平均溫度】", powerStation.Code, dateTime); var tempHistory = await powerStationRepository.GetPyrheliometerHistoryPerHour(dateTime, tempdeviceInfos, 1); @@ -244,7 +256,7 @@ namespace SolarPower.Quartz.Jobs var full_inverter_table_name = String.Format("`{0}`.`{1}`", powerStation.SiteDB, inverter_table_name); var exist_inverter_table = await powerStationRepository.ExistTable(powerStation.SiteDB, inverter_table_name); - if (!string.IsNullOrEmpty(exist_inverter_table)) + if (!string.IsNullOrEmpty(exist_inverter_table) && inverterIds !=null && inverterIds.Count() > 0) { logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的逆變器的資訊】", powerStation.Code, dateTime); inverterHistories = await powerStationRepository.CalcInverterHisyortHourData(dateTime, powerStation.SiteDB, full_inverter_table_name, inverterIds); @@ -322,10 +334,11 @@ namespace SolarPower.Quartz.Jobs { if (Location.StationId == powerStation.WeathersStationId) { + calcPowerStation.TodayWeatherTemp = Convert.ToDouble(Location.WeatherElement[0].ElementValue); weatherObservation.PowerStationId = powerStation.Id; weatherObservation.Temp = Convert.ToDouble(Location.WeatherElement[0].ElementValue); - weatherObservation.ObsTime = Location.Time.ObsTime.ToString(); + weatherObservation.ObsTime = Convert.ToInt32(Location.Time.ObsTime.Substring(0, 4)) < 1970? null : Location.Time.ObsTime; calcPowerStation.WeathersStationId = powerStation.WeathersStationId; break; } @@ -346,206 +359,213 @@ namespace SolarPower.Quartz.Jobs } #endregion - #region step3. 將historiers INSERT 到 power_station_history_hour 資料表 - List history_properties = new List() + if (!this.environment.IsDevelopment()) { - "PowerStationId", - "TIMESTAMP", - "SITEID", - "SITETYPE", - "KWH", - "TODAYKWH", - "TOTALKWH", - "KWHKWP", - "PR", - "MP", - "SolarHour", - "MONEY", - "CARBON", - "TODAYMONEY", - "TOTALMONEY", - "TODAYCARBON", - "TOTALCARBON" - }; + #region step3. 將historiers INSERT 到 power_station_history_hour 資料表 + List history_properties = new List() + { + "PowerStationId", + "TIMESTAMP", + "SITEID", + "SITETYPE", + "KWH", + "TODAYKWH", + "TOTALKWH", + "KWHKWP", + "PR", + "MP", + "SolarHour", + "MONEY", + "CARBON", + "TODAYMONEY", + "TOTALMONEY", + "TODAYCARBON", + "TOTALCARBON" + }; - await powerStationRepository.AddPowerStationHistory(powerStationHistoriesHour, history_properties); - #endregion + await powerStationRepository.AddPowerStationHistory(powerStationHistoriesHour, history_properties); + #endregion - #region step4. 將Pyrheliometer History INSERT 到 sensor_history_hour 資料表 - List pyrheliometer_history_properties = new List() - { - "PowerStationId", - "TIMESTAMP", - "Irradiance" - }; + #region step4. 將Pyrheliometer History INSERT 到 sensor_history_hour 資料表 + List pyrheliometer_history_properties = new List() + { + "PowerStationId", + "TIMESTAMP", + "Irradiance" + }; - await powerStationRepository.AddPyrheliometerHistory(pyrheliometerHistoriesHour, pyrheliometer_history_properties); + await powerStationRepository.AddPyrheliometerHistory(pyrheliometerHistoriesHour, pyrheliometer_history_properties); - List Temp_history_properties = new List() - { - "PowerStationId", - "TIMESTAMP", - "Temperature" - }; + List Temp_history_properties = new List() + { + "PowerStationId", + "TIMESTAMP", + "Temperature" + }; - await powerStationRepository.AddTempHistory(TempHistoriesHour, Temp_history_properties); - #endregion + await powerStationRepository.AddTempHistory(TempHistoriesHour, Temp_history_properties); + #endregion - #region step5. calcPowerStations UPDATE 到 power_station 資料表 - List power_station_properties = new List() - { - "Id", - "kwh", - "Today_kwh", - "Total_kwh", - "today_kwhkwp", - "today_money", - "total_money", - "today_PR", - "today_carbon", - "total_carbon", - "today_irradiance", - "SolarHour", - "WeathersStationId", - "TodayWeatherTemp", - "TodayWeather", - "RateOfRain" - }; + #region step5. calcPowerStations UPDATE 到 power_station 資料表 + List power_station_properties = new List() + { + "Id", + "kwh", + "Today_kwh", + "Total_kwh", + "today_kwhkwp", + "today_money", + "total_money", + "today_PR", + "today_carbon", + "total_carbon", + "today_irradiance", + "SolarHour", + "WeathersStationId", + "TodayWeatherTemp", + "TodayWeather", + "RateOfRain" + }; - await powerStationRepository.UpdateList(calcPowerStations, power_station_properties); - #endregion + await powerStationRepository.UpdateList(calcPowerStations, power_station_properties); + #endregion - #region step6. 將 inverter INSERT 到 inverter_history_hour 資料表 - List inverter_history_properties = new List() - { - "PowerStationId", - "INVERTERID", - "TIMESTAMP", - "Irradiance", - "AC1V", - "AC1A", - "AC1W", - "AC1F", - "AC1WH", - "AC2V", - "AC2A", - "AC2W", - "AC2F", - "AC2WH", - "AC3V", - "AC3A", - "AC3W", - "AC3F", - "AC3WH", - "DC1V", - "DC1A", - "DC1W", - "DC1KW", - "DC1WH", - "DC2V", - "DC2A", - "DC2W", - "DC2KW", - "DC2WH", - "DC3V", - "DC3A", - "DC3W", - "DC3KW", - "DC3WH", - "DC4V", - "DC4A", - "DC4W", - "DC4KW", - "DC4WH", - "DC5V", - "DC5A", - "DC5W", - "DC5KW", - "DC5WH", - "PR", - "RA1", - "RA2", - "RA3", - "RA4", - "RA5", - "DCKW", - "ACKW", - "KWH", - "TODAYKWH", - "TOTALKWH", - "KWHKWP", - }; + #region step6. 將 inverter INSERT 到 inverter_history_hour 資料表 + List inverter_history_properties = new List() + { + "PowerStationId", + "INVERTERID", + "TIMESTAMP", + "Irradiance", + "AC1V", + "AC1A", + "AC1W", + "AC1F", + "AC1WH", + "AC2V", + "AC2A", + "AC2W", + "AC2F", + "AC2WH", + "AC3V", + "AC3A", + "AC3W", + "AC3F", + "AC3WH", + "DC1V", + "DC1A", + "DC1W", + "DC1KW", + "DC1WH", + "DC2V", + "DC2A", + "DC2W", + "DC2KW", + "DC2WH", + "DC3V", + "DC3A", + "DC3W", + "DC3KW", + "DC3WH", + "DC4V", + "DC4A", + "DC4W", + "DC4KW", + "DC4WH", + "DC5V", + "DC5A", + "DC5W", + "DC5KW", + "DC5WH", + "PR", + "RA1", + "RA2", + "RA3", + "RA4", + "RA5", + "DCKW", + "ACKW", + "KWH", + "TODAYKWH", + "TOTALKWH", + "KWHKWP", + }; - await powerStationRepository.AddInverterHistory(inverterHistories, inverter_history_properties); - #endregion + await powerStationRepository.AddInverterHistory(inverterHistories, inverter_history_properties); + #endregion - #region step6. 將 sensoravg INSERT 到 sensoravg_history_hour 資料表 - List sensoravg_history_properties = new List() - { - "PowerStationId", - "TIMESTAMP", - "SENSORAVG01", - "SENSORAVG02", - "SENSORAVG03", - "SENSORAVG04", - "SENSORAVG05", - "SENSORAVG06", - "SENSORAVG07", - "SENSORAVG08", - "SENSORAVG09", - "SENSORAVG10", - "SENSORAVG11", - "SENSORAVG12", - "SENSORAVG13", - "SENSORAVG14", - "SENSORAVG15", - "SENSORAVG16", - "SENSORAVG17", - "SENSORAVG18", - "SENSORAVG19", - "SENSORAVG20", - "SENSORAVG21", - "SENSORAVG22", - "SENSORAVG23", - "SENSORAVG24", - "SENSORAVG25", - "SENSORAVG26", - "SENSORAVG27", - "SENSORAVG28", - "SENSORAVG29", - "SENSORAVG30", - "SENSORAVG31", - "SENSORAVG32", - "SENSORAVG33", - "SENSORAVG34", - "SENSORAVG35", - "SENSORAVG36", - "SENSORAVG37", - "SENSORAVG38", - "SENSORAVG39", - "SENSORAVG40", - "SENSORAVG41", - "SENSORAVG42", - "SENSORAVG43", - "SENSORAVG44", - "SENSORAVG45", - "SENSORAVG46", - "SENSORAVG47", - "SENSORAVG48", - "SENSORAVG49", - "SENSORAVG50", - }; + #region step7. 將 sensoravg INSERT 到 sensoravg_history_hour 資料表 + List sensoravg_history_properties = new List() + { + "PowerStationId", + "TIMESTAMP", + "SENSORAVG01", + "SENSORAVG02", + "SENSORAVG03", + "SENSORAVG04", + "SENSORAVG05", + "SENSORAVG06", + "SENSORAVG07", + "SENSORAVG08", + "SENSORAVG09", + "SENSORAVG10", + "SENSORAVG11", + "SENSORAVG12", + "SENSORAVG13", + "SENSORAVG14", + "SENSORAVG15", + "SENSORAVG16", + "SENSORAVG17", + "SENSORAVG18", + "SENSORAVG19", + "SENSORAVG20", + "SENSORAVG21", + "SENSORAVG22", + "SENSORAVG23", + "SENSORAVG24", + "SENSORAVG25", + "SENSORAVG26", + "SENSORAVG27", + "SENSORAVG28", + "SENSORAVG29", + "SENSORAVG30", + "SENSORAVG31", + "SENSORAVG32", + "SENSORAVG33", + "SENSORAVG34", + "SENSORAVG35", + "SENSORAVG36", + "SENSORAVG37", + "SENSORAVG38", + "SENSORAVG39", + "SENSORAVG40", + "SENSORAVG41", + "SENSORAVG42", + "SENSORAVG43", + "SENSORAVG44", + "SENSORAVG45", + "SENSORAVG46", + "SENSORAVG47", + "SENSORAVG48", + "SENSORAVG49", + "SENSORAVG50", + }; + + await powerStationRepository.AddSensorAvgHistory(sensorAvgHistoryHour, sensoravg_history_properties); + #endregion + + #region step8. 新增天氣資訊 + List weather_observation_properties = new List() + { + "PowerStationId", + "ObsTime", + "Temp" + }; + await powerStationRepository.AddWeatherObservation(weatherObservations, weather_observation_properties); + #endregion + } - await powerStationRepository.AddSensorAvgHistory(sensorAvgHistoryHour, sensoravg_history_properties); - #endregion - List weather_observation_properties = new List() - { - "PowerStationId", - "ObsTime", - "Temp" - }; - await powerStationRepository.AddWeatherObservation(weatherObservations, weather_observation_properties); logger.LogInformation("【CalcPowerStationJob】【任務完成】"); } diff --git a/SolarPower/Quartz/Jobs/SendEmailJob.cs b/SolarPower/Quartz/Jobs/SendEmailJob.cs index e5fb2df..3808b40 100644 --- a/SolarPower/Quartz/Jobs/SendEmailJob.cs +++ b/SolarPower/Quartz/Jobs/SendEmailJob.cs @@ -55,7 +55,7 @@ namespace SolarPower.Quartz.Jobs var result = Send(recipientEmails, notice.Subject, notice.Content, attachments); - if(result) + if (result.CompareTo("成功") == 0) { NoticeSchedule noticeSchedule = new NoticeSchedule(); noticeSchedule.Id = notice.Id; @@ -64,6 +64,16 @@ namespace SolarPower.Quartz.Jobs updateNoticeSchedules.Add(noticeSchedule); } + else + { + NoticeSchedule noticeSchedule = new NoticeSchedule(); + noticeSchedule.Id = notice.Id; + noticeSchedule.IsDelivery = 2; + noticeSchedule.DeliveryAt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + noticeSchedule.Reason = result; + + updateNoticeSchedules.Add(noticeSchedule); + } List properties = new List() { @@ -83,8 +93,10 @@ namespace SolarPower.Quartz.Jobs } } - private bool Send(List recipientEmails, string subject, string content, List attachments) + private string Send(List recipientEmails, string subject, string content, List attachments) { + var reason = string.Empty; + var CanDoSend = true; MailMessage MyMail = new MailMessage(); MyMail.SubjectEncoding = System.Text.Encoding.UTF8;//郵件標題編碼 @@ -100,37 +112,53 @@ namespace SolarPower.Quartz.Jobs MyMail.Subject = subject; //主題 MyMail.Body = content; //設定信件內容 - foreach(var attachment in attachments) + foreach (var attachment in attachments) { var directoryBase = Directory.GetCurrentDirectory(); var filePath = @$"{directoryBase}\wwwroot{attachment}"; - var data = new Attachment(filePath); - MyMail.Attachments.Add(data); + if (File.Exists(filePath)) + { + var data = new Attachment(filePath); + MyMail.Attachments.Add(data); + } + else + { + CanDoSend = false; + reason = "失敗 - 檔案遺失"; + break; + } } //讀取 SMTP Config - SmtpClient MySMTP = new SmtpClient(smtp.Host, smtp.Port); - MySMTP.EnableSsl = smtp.EnableSsl; - MySMTP.Credentials = new System.Net.NetworkCredential(smtp.UserName, smtp.Password); - try + if (CanDoSend) { - MySMTP.Send(MyMail); - MySMTP.Dispose(); - MyMail.Dispose(); //釋放資源 + SmtpClient MySMTP = new SmtpClient(smtp.Host, smtp.Port); + MySMTP.EnableSsl = smtp.EnableSsl; + MySMTP.Credentials = new System.Net.NetworkCredential(smtp.UserName, smtp.Password); + try + { + MySMTP.Send(MyMail); + MySMTP.Dispose(); + MyMail.Dispose(); //釋放資源 - return true; + return "成功"; + } + catch (Exception ex) + { + string json = System.Text.Json.JsonSerializer.Serialize(recipientEmails); + logger.LogError("【SendEmailJob】 " + "寄送信件失敗"); + logger.LogError("【SendEmailJob】 - Emails:" + json); + logger.LogError("【SendEmailJob】 - Exception:" + ex.Message); + + return "失敗 - " + ex.Message; + } } - catch (Exception ex) + else { - string json = System.Text.Json.JsonSerializer.Serialize(recipientEmails); - logger.LogError("【SendEmailJob】 " + "寄送信件失敗"); - logger.LogError("【SendEmailJob】 - Emails:" + json); - logger.LogError("【SendEmailJob】 - Exception:" + ex.Message); - - return false; + return reason; } - + } } } diff --git a/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs b/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs index 5571d49..800b4d2 100644 --- a/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs +++ b/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs @@ -159,7 +159,10 @@ namespace SolarPower.Repository.Implement switch (post.SeacrhType) { case 0: - sql = $@"SELECT DATE_FORMAT(ps.TIMESTAMP,'%h %p') AS `Time`,SUM(ps.KWH) AS KWH,SUM(sh.Irradiance) AS Irradiance + sql = $@"SELECT DATE_FORMAT(ps.TIMESTAMP,'%h %p') AS `Time`, + SUM(ps.KWH) AS KWH, + SUM(sh.Irradiance) AS Irradiance, + AVG(sh.Temperature) AS Temperature FROM power_station_history_hour ps LEFT JOIN sensor_history_hour sh ON sh.TIMESTAMP = ps.TIMESTAMP AND sh.PowerStationId = ps.PowerStationId @@ -171,7 +174,8 @@ namespace SolarPower.Repository.Implement sql = $@"SELECT DATE_FORMAT(ps.TIMESTAMP,'%Y-%m-%d') AS `Time`, SUM(ps.TODAYKWH) AS KWH, - SUM(sh.Irradiance) AS Irradiance + SUM(sh.Irradiance) AS Irradiance, + AVG(sh.Temperature) AS Temperature FROM power_station_history_day ps LEFT JOIN sensor_history_day sh ON sh.TIMESTAMP = ps.TIMESTAMP @@ -182,7 +186,8 @@ namespace SolarPower.Repository.Implement sql = $@"SELECT DATE_FORMAT(ps.TIMESTAMP,'%Y-%m-%d') AS `Time`, SUM(ps.TODAYKWH) AS KWH, - SUM(sh.Irradiance) AS Irradiance + SUM(sh.Irradiance) AS Irradiance, + AVG(sh.Temperature) AS Temperature FROM power_station_history_day ps LEFT JOIN sensor_history_day sh ON sh.TIMESTAMP = ps.TIMESTAMP @@ -193,7 +198,8 @@ namespace SolarPower.Repository.Implement sql = $@"SELECT DATE_FORMAT(ps.TIMESTAMP,'%Y-%m') AS `Time`, SUM(ps.MONTHKWH) AS KWH, - SUM(sh.Irradiance) AS Irradiance + SUM(sh.Irradiance) AS Irradiance, + AVG(sh.Temperature) AS Temperature FROM power_station_history_month ps LEFT JOIN sensor_history_month sh ON sh.TIMESTAMP = ps.TIMESTAMP diff --git a/SolarPower/Repository/Implement/OverviewRepository.cs b/SolarPower/Repository/Implement/OverviewRepository.cs index 8eaf39e..d9ecd60 100644 --- a/SolarPower/Repository/Implement/OverviewRepository.cs +++ b/SolarPower/Repository/Implement/OverviewRepository.cs @@ -110,11 +110,16 @@ namespace SolarPower.Repository.Implement var dateNow = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); var sql = @$"SELECT - w.Wx, + wf.Wx, ps.* FROM power_station ps LEFT JOIN city c ON ps.CityId = c.Id - LEFT JOIN weather_forecast w ON c.Name = w.LocationName AND w.StartTime < @DateNow AND w.EndTime > @DateNow + LEFT JOIN (SELECT * FROM ( + SELECT MAX(w.Id) AS aa FROM weather_forecast w + WHERE w.StartTime < @DateNow AND w.EndTime > @DateNow + GROUP BY w.LocationName + ) A + LEFT JOIN weather_forecast B ON A.aa = B.Id) wf ON c.Name = wf.LocationName WHERE ps.Id IN @PowerStationIds "; @@ -206,7 +211,7 @@ namespace SolarPower.Repository.Implement { try { - var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp,'%H %p') AS Label, ps.KWH AS PowerData, pyr.Irradiance AS IrradianceData + var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp,'%H %p') AS Label, ps.KWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData FROM power_station_history_hour ps LEFT JOIN sensor_history_hour pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d %H') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d %H') WHERE ps.PowerStationId = @PowerStationId @@ -231,7 +236,7 @@ namespace SolarPower.Repository.Implement { var startDay = Convert.ToDateTime(nowDay).AddDays(-7).ToString("yyyy-MM-dd"); - var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData + var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData FROM power_station_history_day ps LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d') WHERE ps.PowerStationId = @PowerStationId @@ -256,7 +261,7 @@ namespace SolarPower.Repository.Implement { var startDay = Convert.ToDateTime(nowDay).ToString("yyyy-MM-01"); - var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData + var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData FROM power_station_history_day ps LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d') WHERE ps.PowerStationId = @PowerStationId @@ -282,7 +287,7 @@ namespace SolarPower.Repository.Implement { var startyear = Convert.ToDateTime(nowDay).ToString("yyyy"); - var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m') AS Label, ps.MONTHKWH AS PowerData, pyr.Irradiance AS IrradianceData + var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m') AS Label, ps.MONTHKWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData FROM power_station_history_month ps LEFT JOIN sensor_history_month pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m') = DATE_FORMAT(pyr.timestamp, '%Y-%m') WHERE ps.PowerStationId = @PowerStationId diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index b67b99f..c6233f1 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -3287,7 +3287,7 @@ namespace SolarPower.Repository.Implement FROM city c LEFT JOIN weather_forecast wf ON wf.LocationName = c.`Name` LEFT JOIN weather_description wd ON wd.WeatherName = wf.Wx - WHERE c.Priority = {CityId} AND '{now}' BETWEEN wf.StartTime AND wf.EndTime ORDER BY wf.CreatedAt desc"; + WHERE c.Id = {CityId} AND '{now}' BETWEEN wf.StartTime AND wf.EndTime ORDER BY wf.CreatedAt desc"; result = await conn.QueryFirstOrDefaultAsync(sql); } @@ -3710,16 +3710,26 @@ namespace SolarPower.Repository.Implement } } - public async Task> GetPowerStationsByCompanyId(int companyId) + public async Task> GetPowerStationsByCompanyId(MyUser myUser) { List result; using (IDbConnection conn = this._databaseHelper.GetConnection()) { try { - var sql = $"SELECT * FROM {tableName} WHERE Deleted = 0 AND CompanyId = @CompanyId"; + var sql = $"SELECT * FROM {tableName} ps"; - result = (await conn.QueryAsync(sql, new { CompanyId = companyId })).ToList(); + if (myUser.Role.Layer == 2) + { + sql += " WHERE ps.Deleted = 0 AND ps.CompanyId = @CompanyId "; + } + else + { + sql += @" LEFT JOIN power_station_operation_personnel op ON ps.Id = op.PowerStationId + WHERE ps.Deleted = 0 AND op.Deleted = 0 AND op.UserId = @UserId "; + } + + result = (await conn.QueryAsync(sql, new { CompanyId = myUser.CompanyId, UserId = myUser.Id })).ToList(); } catch (Exception exception) { @@ -3754,7 +3764,7 @@ namespace SolarPower.Repository.Implement FROM power_station ps LEFT JOIN `city` c ON ps.CityId = c.Id LEFT JOIN {powerStationDic.Key}.controller con ON ps.Id = con.PowerStationId - LEFT JOIN {powerStationDic.Key}.inverter inv ON con.Id = inv.ControllerId + LEFT JOIN {powerStationDic.Key}.inverter inv ON con.Id = inv.ControllerId AND inv.Enabled = 1 AND inv.status != 0 WHERE ps.Deleted = 0 AND ps.Id IN ({powerStationIds})"; if (!string.IsNullOrEmpty(filter)) @@ -4010,7 +4020,7 @@ namespace SolarPower.Repository.Implement } - public async Task> GetPowerStationsByCompanyIdWithfilter(int companyId, string filter) + public async Task> GetPowerStationsByCompanyIdWithfilter(MyUser myUser, string filter) { List result; using (IDbConnection conn = this._databaseHelper.GetConnection()) @@ -4018,14 +4028,23 @@ namespace SolarPower.Repository.Implement try { var sql = $@"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,city.Name AS CityName FROM {tableName} ps - LEFT JOIN city ON city.Id = ps.CityId WHERE ps.Deleted = 0 AND ps.CompanyId = @CompanyId "; + LEFT JOIN city ON city.Id = ps.CityId"; + if (myUser.Role.Layer == 2) + { + sql += " WHERE ps.Deleted = 0 AND ps.CompanyId = @CompanyId "; + } + else + { + sql += @" LEFT JOIN power_station_operation_personnel op ON ps.Id = op.PowerStationId + WHERE ps.Deleted = 0 AND op.Deleted = 0 AND op.UserId = @UserId "; + } if (!string.IsNullOrEmpty(filter)) { sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')"; } - result = (await conn.QueryAsync(sql, new { CompanyId = companyId, Filter = filter })).ToList(); + result = (await conn.QueryAsync(sql, new { CompanyId = myUser.CompanyId, UserId = myUser.Id, Filter = filter })).ToList(); } catch (Exception exception) { diff --git a/SolarPower/Repository/Interface/IPowerStationRepository.cs b/SolarPower/Repository/Interface/IPowerStationRepository.cs index 51e7d95..bf48ec1 100644 --- a/SolarPower/Repository/Interface/IPowerStationRepository.cs +++ b/SolarPower/Repository/Interface/IPowerStationRepository.cs @@ -546,13 +546,13 @@ namespace SolarPower.Repository.Interface Task CalcSensorAvgHistoryMonthDataByPowerStationId(string month, int powerStationId); Task AddSensorAvgHistoryMonthList(List entity, List properties); Task UpdateSensorAvgHistoryMonthList(List entity); - Task> GetPowerStationsByCompanyId(int companyId); + Task> GetPowerStationsByCompanyId(MyUser myUser); Task> GetPowerStationInverter(Dictionary> dic, string filter); Task> GetPowerStationDevice(Dictionary> dic, string filter); Task> GetInverterHistoryRowData(string nowDay, List entities); Task> GetInverterHistoryByDate(string startDay, string endDay, List entities); Task> GetInverterHistoryByYear(string year, List entities); - Task> GetPowerStationsByCompanyIdWithfilter(int companyId, string filter); + Task> GetPowerStationsByCompanyIdWithfilter(MyUser myUser, string filter); Task> GetPowerStationsAllWithfilter(string filter); Task> GetDeviceByPowerStationIdAndDeviceIds(string db_name, int powerStationId, List deviceIds); Task GetSensorAvgByDevices(string date, byte searchType, List devices); diff --git a/SolarPower/Views/AnalysisInverter/Index.cshtml b/SolarPower/Views/AnalysisInverter/Index.cshtml index 312c60d..5675d47 100644 --- a/SolarPower/Views/AnalysisInverter/Index.cshtml +++ b/SolarPower/Views/AnalysisInverter/Index.cshtml @@ -21,7 +21,10 @@
@@ -217,7 +220,7 @@ PushSpecifyCurrentCompareCol(Single_day_compare_col); }) - function myfunc(div) { + @*function myfunc(div) { var className = div.getAttribute("class"); if (className == "fal fa-angle-left fa-lg py-3") { div.className = "fal fa-angle-right fa-lg py-3"; @@ -225,7 +228,7 @@ else { div.className = "fal fa-angle-left fa-lg py-3"; } - } + }*@ //#region 更換搜尋條件(日,日區間,月,年) function changeType(type, e) { @@ -429,7 +432,7 @@ $.post(url, send_data, function (rel) { if (rel.code != "0000") { - toast_error(rel.data.msg); + toast_error(rel.msg); return; } diff --git a/SolarPower/Views/AnalysisStationCombine/Index.cshtml b/SolarPower/Views/AnalysisStationCombine/Index.cshtml index 23d75bc..6016f8c 100644 --- a/SolarPower/Views/AnalysisStationCombine/Index.cshtml +++ b/SolarPower/Views/AnalysisStationCombine/Index.cshtml @@ -6,196 +6,229 @@ @using SolarPower.Models.Role @model RoleLayerEnum - -
-

- 合併電站 -

-
-
-
-
-
-
-
-
- -
-
- -
+
+
+ -
+ + + +
+ +
+

+ 合併電站 +

+
+ +
+
+
+
+
+ @*
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+
*@ + +
+
+
+ + + + +
+
+
+ + +
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+

發電量

+
kW h
+
+
+
+

總發電量

+

126,161.72

+
+
+

今日發電量

+

4,069.73

+
+
+
+
+
+

發電金額

+
NTD
+
+
+
+

總發金額

+

126,161.72

+
+
+

今日發電金額

+

4,069.73

+
+
+
+ +
+
+

有效日照時數

+
hr
+
+
+
+

平均有效日照時數

+

140.39

+
+
+

今日有效日照時數

+

4.53

+
+
+
+
+
+

PR值

+
%
+
+
+
+

平均 PR 值

+

119.04

+
+
+

今日PR值

+

3.84

+
+
+
+ +
+
+

減碳量

+
kG
+
+
+
+

總減碳量

+

6,091.78

+
+
+

今日減碳量

+

985.98

+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ + +
+
+
+
+
+
+ + + @section Scripts{ -} \ No newline at end of file +} diff --git a/SolarPower/Views/AnalysisStationInfo/Index.cshtml b/SolarPower/Views/AnalysisStationInfo/Index.cshtml index 4937d55..29884d6 100644 --- a/SolarPower/Views/AnalysisStationInfo/Index.cshtml +++ b/SolarPower/Views/AnalysisStationInfo/Index.cshtml @@ -21,7 +21,10 @@
@@ -166,7 +169,7 @@ //#endregion }) - function myfunc(div) { + @*function myfunc(div) { var className = div.getAttribute("class"); if (className == "fal fa-angle-left fa-lg py-3") { div.className = "fal fa-angle-right fa-lg py-3"; @@ -174,7 +177,7 @@ else { div.className = "fal fa-angle-left fa-lg py-3"; } - } + }*@ //#region 更換搜尋條件(日,日區間,月,年) function changeType(type, e) { @@ -444,7 +447,7 @@ $.post(url, send_data, function (rel) { if (rel.code != "0000") { - toast_error(rel.data.msg); + toast_error(rel.msg); return; } diff --git a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml index a39bb8f..e009f6a 100644 --- a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml +++ b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml @@ -967,54 +967,127 @@ $("#power_station_operation_personnel").select2(); + var ps_company_text = $("#select_power_station_company").find(':selected').text(); - var url = "/PowerStation/SavePowerStationInfo"; + @if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser) + { + + Swal.fire( + { + title: "", + text: "你確定是否要將該電站加入至【" + ps_company_text + "】?", + type: "question", + icon: 'question', + showCancelButton: true, + confirmButtonText: "是", + cancelButtonText: "否" + }).then(function (result) { + if (result.value) { + var url = "/PowerStation/SavePowerStationInfo"; - var send_data = { - Id: stationId, - CityId: $("#select_city").val(), - AreaId: $("#select_area").val(), - Address: $("#address_detail").val(), - Name: $("#power_station_name").val(), - IsEscrow: $('#check_escrow').is(':checked') ? 1 : 0, - ElectricityMeterAt: $("#electricity_meter_at").val(), - EstimatedRecoveryTime: $("#estimated_recovery_time").val(), - GeneratingCapacity: $("#generating_capacity").val(), - EscrowName: $('#check_escrow').is(':checked') ? $("#escrow_name").val() : "", - PowerRate: $("#power_rate").val(), - Coordinate: $("#coordinate").val(), - OperationPersonnelIds: $("#power_station_operation_personnel").val(), - InverterBrand: $("#inverter_brand").val(), - InverterProductModel: $("#inverter_product_model").val(), - InverterAmount: $("#inverter_amount").val(), - PhotovoltaicPanelBrand: $("#photovoltaic_panel_brand").val(), - PhotovoltaicPanelSpecification: $("#photovoltaic_panel_specification").val(), - PhotovoltaicPanelAmount: $("#photovoltaic_panel_amount").val(), - PhotovoltaicPanelProductModel: $("#photovoltaic_panel_product_model").val(), - SolarType: $("#select_solar_tpye").val(), - line_token: $("#line_token").val(), - Estimate_kwh: $("#estimate_kwh").val(), - EstimateEfficacy: $("#estimate_efficacy").val(), - CompanyId: $("#select_power_station_company").val(), + var send_data = { + Id: stationId, + CityId: $("#select_city").val(), + AreaId: $("#select_area").val(), + Address: $("#address_detail").val(), + Name: $("#power_station_name").val(), + IsEscrow: $('#check_escrow').is(':checked') ? 1 : 0, + ElectricityMeterAt: $("#electricity_meter_at").val(), + EstimatedRecoveryTime: $("#estimated_recovery_time").val(), + GeneratingCapacity: $("#generating_capacity").val(), + EscrowName: $('#check_escrow').is(':checked') ? $("#escrow_name").val() : "", + PowerRate: $("#power_rate").val(), + Coordinate: $("#coordinate").val(), + OperationPersonnelIds: $("#power_station_operation_personnel").val(), + InverterBrand: $("#inverter_brand").val(), + InverterProductModel: $("#inverter_product_model").val(), + InverterAmount: $("#inverter_amount").val(), + PhotovoltaicPanelBrand: $("#photovoltaic_panel_brand").val(), + PhotovoltaicPanelSpecification: $("#photovoltaic_panel_specification").val(), + PhotovoltaicPanelAmount: $("#photovoltaic_panel_amount").val(), + PhotovoltaicPanelProductModel: $("#photovoltaic_panel_product_model").val(), + SolarType: $("#select_solar_tpye").val(), + line_token: $("#line_token").val(), + Estimate_kwh: $("#estimate_kwh").val(), + EstimateEfficacy: $("#estimate_efficacy").val(), + CompanyId: $("#select_power_station_company").val(), + } + + $.post(url, send_data, function (rel) { + if (rel.code != "0000") { + toast_error(rel.msg); + return; + } + + toast_ok(rel.msg); + + if (stationId == "new") { + window.location = "/PowerStation/Edit?stationId=" + rel.data.id + } else { + //回填資料 + powerStationData = rel.data; + SetStationInfo(); + ChangeMode("station_info", "view"); + } + }, 'json'); + } + }); + + } + else + { + + var url = "/PowerStation/SavePowerStationInfo"; + + var send_data = { + Id: stationId, + CityId: $("#select_city").val(), + AreaId: $("#select_area").val(), + Address: $("#address_detail").val(), + Name: $("#power_station_name").val(), + IsEscrow: $('#check_escrow').is(':checked') ? 1 : 0, + ElectricityMeterAt: $("#electricity_meter_at").val(), + EstimatedRecoveryTime: $("#estimated_recovery_time").val(), + GeneratingCapacity: $("#generating_capacity").val(), + EscrowName: $('#check_escrow').is(':checked') ? $("#escrow_name").val() : "", + PowerRate: $("#power_rate").val(), + Coordinate: $("#coordinate").val(), + OperationPersonnelIds: $("#power_station_operation_personnel").val(), + InverterBrand: $("#inverter_brand").val(), + InverterProductModel: $("#inverter_product_model").val(), + InverterAmount: $("#inverter_amount").val(), + PhotovoltaicPanelBrand: $("#photovoltaic_panel_brand").val(), + PhotovoltaicPanelSpecification: $("#photovoltaic_panel_specification").val(), + PhotovoltaicPanelAmount: $("#photovoltaic_panel_amount").val(), + PhotovoltaicPanelProductModel: $("#photovoltaic_panel_product_model").val(), + SolarType: $("#select_solar_tpye").val(), + line_token: $("#line_token").val(), + Estimate_kwh: $("#estimate_kwh").val(), + EstimateEfficacy: $("#estimate_efficacy").val(), + CompanyId: $("#select_power_station_company").val(), + } + + $.post(url, send_data, function (rel) { + if (rel.code != "0000") { + toast_error(rel.msg); + return; + } + + toast_ok(rel.msg); + + if (stationId == "new") { + window.location = "/PowerStation/Edit?stationId=" + rel.data.id + } else { + //回填資料 + powerStationData = rel.data; + SetStationInfo(); + ChangeMode("station_info", "view"); + } + }, 'json'); + } - $.post(url, send_data, function (rel) { - if (rel.code != "0000") { - toast_error(rel.msg); - return; - } - toast_ok(rel.msg); - - if (stationId == "new") { - window.location = "/PowerStation/Edit?stationId=" + rel.data.id - } else { - //回填資料 - powerStationData = rel.data; - SetStationInfo(); - ChangeMode("station_info", "view"); - } - }, 'json'); } //#endregion diff --git a/SolarPower/Views/PowerStation/_StationInfo.cshtml b/SolarPower/Views/PowerStation/_StationInfo.cshtml index 088d8d9..b0ba183 100644 --- a/SolarPower/Views/PowerStation/_StationInfo.cshtml +++ b/SolarPower/Views/PowerStation/_StationInfo.cshtml @@ -187,7 +187,7 @@
-
+
@*
逆變器
@@ -216,31 +216,31 @@
*@ -
+
光電板
-
+
-
+
-
+
-
+
diff --git a/SolarPower/Views/Shared/_Layout.cshtml b/SolarPower/Views/Shared/_Layout.cshtml index 0c6beb6..b69ef46 100644 --- a/SolarPower/Views/Shared/_Layout.cshtml +++ b/SolarPower/Views/Shared/_Layout.cshtml @@ -1252,8 +1252,8 @@
- - + + diff --git a/SolarPower/Views/StationOverview/Index.cshtml b/SolarPower/Views/StationOverview/Index.cshtml index b44c6b6..9a29d96 100644 --- a/SolarPower/Views/StationOverview/Index.cshtml +++ b/SolarPower/Views/StationOverview/Index.cshtml @@ -398,6 +398,7 @@ default: console.log(`Sorry, we are out of ${val.solarType}.`); } + $('#card_' + val.id).find('#editSolarUrl').find('#Solarimg').attr('src', val.mainDisplay); $('#card_' + val.id).find('#stationtype').html(type); var time = new Date(val.createdAt); $('#card_' + val.id).find('#editSolarUrl').attr('href', localurl + '/Info?stationId=' + val.id); diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index b101d7a..19a2208 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -303,7 +303,7 @@ label: '輸出功率', yAxisID: 'A', backgroundColor: 'rgb(103, 180, 172)', - order: 2, + order: 3, data: chartToday.powerDatas }, { type: 'line', @@ -317,8 +317,22 @@ pointRadius: 4, pointHoverRadius: 5, fill: false, - order: 1, + order: 2, data: chartToday.irradianceDatas, + }, { + type: 'line', + label: '模組溫度', + yAxisID: 'C', + borderColor: 'rgb(255, 192, 0)', + pointBackgroundColor: 'rgb(255, 192, 0)', + pointBorderColor: 'rgb(255, 192, 0)', + pointBorderWidth: 1, + borderWidth: 2, + pointRadius: 4, + pointHoverRadius: 5, + fill: false, + order: 1, + data: chartToday.temperatureDatas, }] }, options: { @@ -353,6 +367,17 @@ display: true, labelString: 'W/㎡' } + }, { + id: 'C', + type: 'linear', + position: 'right', + ticks: { + min: 0 + }, + scaleLabel: { + display: true, + labelString: '℃' + } }] } } @@ -370,7 +395,7 @@ label: '輸出功率', yAxisID: 'A', backgroundColor: 'rgb(103, 180, 172)', - order: 2, + order: 3, data: chart7day.powerDatas }, { type: 'line', @@ -383,9 +408,23 @@ borderWidth: 2, pointRadius: 4, pointHoverRadius: 5, - order: 1, + order: 2, fill: false, data: chart7day.irradianceDatas, + }, { + type: 'line', + label: '模組溫度', + yAxisID: 'C', + borderColor: 'rgb(255, 192, 0)', + pointBackgroundColor: 'rgb(255, 192, 0)', + pointBorderColor: 'rgb(255, 192, 0)', + pointBorderWidth: 1, + borderWidth: 2, + pointRadius: 4, + pointHoverRadius: 5, + fill: false, + order: 1, + data: chart7day.temperatureDatas, }] }, options: { @@ -420,6 +459,17 @@ display: true, labelString: 'W/㎡' } + }, { + id: 'C', + type: 'linear', + position: 'right', + ticks: { + min: 0 + }, + scaleLabel: { + display: true, + labelString: '℃' + } }] } } @@ -437,7 +487,7 @@ label: '輸出功率', yAxisID: 'A', backgroundColor: 'rgb(103, 180, 172)', - order: 2, + order: 3, data: chartMonth.powerDatas }, { type: 'line', @@ -450,9 +500,23 @@ borderWidth: 2, pointRadius: 4, pointHoverRadius: 5, - order: 1, + order: 2, fill: false, data: chartMonth.irradianceDatas, + }, { + type: 'line', + label: '模組溫度', + yAxisID: 'C', + borderColor: 'rgb(255, 192, 0)', + pointBackgroundColor: 'rgb(255, 192, 0)', + pointBorderColor: 'rgb(255, 192, 0)', + pointBorderWidth: 1, + borderWidth: 2, + pointRadius: 4, + pointHoverRadius: 5, + fill: false, + order: 1, + data: chartMonth.temperatureDatas, }] }, options: { @@ -487,6 +551,17 @@ display: true, labelString: 'W/㎡' } + }, { + id: 'C', + type: 'linear', + position: 'right', + ticks: { + min: 0 + }, + scaleLabel: { + display: true, + labelString: '℃' + } }] } } @@ -520,6 +595,20 @@ order: 1, fill: false, data: chartYear.irradianceDatas, + }, { + type: 'line', + label: '模組溫度', + yAxisID: 'C', + borderColor: 'rgb(255, 192, 0)', + pointBackgroundColor: 'rgb(255, 192, 0)', + pointBorderColor: 'rgb(255, 192, 0)', + pointBorderWidth: 1, + borderWidth: 2, + pointRadius: 4, + pointHoverRadius: 5, + fill: false, + order: 1, + data: chartYear.temperatureDatas, }] }, options: { @@ -554,6 +643,17 @@ display: true, labelString: 'W/㎡' } + }, { + id: 'C', + type: 'linear', + position: 'right', + ticks: { + min: 0 + }, + scaleLabel: { + display: true, + labelString: '℃' + } }] } } @@ -2216,6 +2316,9 @@ var listcolor = new Array(0); var listcolor2 = new Array(0); var listirradiance = new Array(0); + var listtemperature = new Array(0); + var listsolarhour = new Array(0); + var listpr = new Array(0); var color = rgba(1); var color2 = rgba(2); $.each(rel.data, function (index, val) { @@ -2241,10 +2344,13 @@ '' + val.temp.toFixed(2) + '' + ''); listmonth.push(val.timestamp); - listkwh.push(val.kwh); + listkwh.push(val.kwh.toFixed(2)); listcolor.push(color); listcolor2.push(color2); - listirradiance.push(val.irradiance); + listirradiance.push(val.irradiance.toFixed(2)); + listtemperature.push(val.temp.toFixed(2)); + listsolarhour.push(val.solarhour.toFixed(2)); + listpr.push(val.pr.toFixed(2)); } else { @@ -2259,10 +2365,13 @@ '' + val.temp.toFixed(2) + '' + ''); listmonth.push(val.timestamp); - listkwh.push(val.kwh); + listkwh.push(val.kwh.toFixed(2)); listcolor.push(color); listcolor2.push(color2); - listirradiance.push(val.irradiance); + listirradiance.push(val.irradiance.toFixed(2)); + listtemperature.push(val.temp.toFixed(2)); + listsolarhour.push(val.solarhour.toFixed(2)); + listpr.push(val.pr.toFixed(2)); } @@ -2280,22 +2389,55 @@ type: 'bar', data: { labels: listmonth, - datasets: [{ - type: 'line', - label: '日照度(kWh/㎡)', - borderColor: 'rgba(190, 45, 45,1)', - pointRadius: 4, - yAxisID: 'B', - fill: false, - data: listirradiance - }, { + datasets: [ + { + type: 'line', + label: '溫度(℃)', + yAxisID: 'E', + borderColor: 'rgb(255, 192, 0)', + pointBackgroundColor: 'rgb(255, 192, 0)', + pointBorderColor: 'rgb(255, 192, 0)', + pointBorderWidth: 1, + borderWidth: 2, + pointRadius: 4, + pointHoverRadius: 5, + fill: false, + data: listtemperature + }, { + type: 'line', + label: '日照度(kWh/㎡)', + yAxisID: 'B', + borderColor: 'rgba(190, 45, 45,1)', + pointBackgroundColor: 'rgb(190, 45, 45,1)', + pointBorderColor: 'rgb(190, 45, 45,1)', + pointBorderWidth: 1, + borderWidth: 2, + pointRadius: 4, + pointHoverRadius: 5, + fill: false, + data: listirradiance + },{ type: 'bar', - backgroundColor: 'rgba(103, 180, 172, 1)', + label: 'PR(%)', + yAxisID: 'D', + backgroundColor: 'rgba(68, 114, 196)', borderWidth: 1, - label: '發電量(kWh)', - yAxisID: 'A', - data: listkwh - }] + data: listpr + },{ + type: 'bar', + label: '發電小時', + yAxisID: 'C', + backgroundColor: 'rgba(165, 165, 165)', + borderWidth: 1, + data: listsolarhour + },{ + type: 'bar', + backgroundColor: 'rgba(103, 180, 172, 1)', + borderWidth: 1, + label: '發電量(kWh)', + yAxisID: 'A', + data: listkwh + }] }, options: { title: { @@ -2329,6 +2471,39 @@ display: true, labelString: 'kWh/㎡' } + }, { + id: 'C', + type: 'linear', + position: 'right', + ticks: { + min: 0 + }, + scaleLabel: { + display: true, + labelString: 'hr' + } + }, { + id: 'D', + type: 'linear', + position: 'right', + ticks: { + min: 0 + }, + scaleLabel: { + display: true, + labelString: 'PR(%)' + } + }, { + id: 'E', + type: 'linear', + position: 'right', + ticks: { + min: 0 + }, + scaleLabel: { + display: true, + labelString: '℃' + } }] } } diff --git a/SolarPower/Views/StationOverview/_Info.cshtml b/SolarPower/Views/StationOverview/_Info.cshtml index 269da22..a024541 100644 --- a/SolarPower/Views/StationOverview/_Info.cshtml +++ b/SolarPower/Views/StationOverview/_Info.cshtml @@ -157,29 +157,29 @@
-
-
+
+
光電板
-
+
-
+
-
+
-
+
diff --git a/SolarPower/Views/StationReport/Index.cshtml b/SolarPower/Views/StationReport/Index.cshtml index 5f3dbf7..d8d1c07 100644 --- a/SolarPower/Views/StationReport/Index.cshtml +++ b/SolarPower/Views/StationReport/Index.cshtml @@ -166,7 +166,10 @@
@@ -514,7 +517,7 @@ //#endregion //#region 左邊的搜索欄位 - function myfunc(div) { + @*function myfunc(div) { var className = div.getAttribute("class"); if (className == "fal fa-angle-left fa-lg py-3") { div.className = "fal fa-angle-right fa-lg py-3"; @@ -522,7 +525,7 @@ else { div.className = "fal fa-angle-left fa-lg py-3"; } - } + }*@ $("#js_list_accordion_filter").change(function (e) { GetPowerStationCollapse($(this).val()); @@ -562,7 +565,7 @@ $.post(url, send_data, function (rel) { if (rel.code != "0000") { - toast_error(rel.data.msg); + toast_error(rel.msg); return; } diff --git a/SolarPower/appsettings.Development.json b/SolarPower/appsettings.Development.json index fc2f78e..226ca35 100644 --- a/SolarPower/appsettings.Development.json +++ b/SolarPower/appsettings.Development.json @@ -26,7 +26,7 @@ "CalcAvgPowerStationJob": "0 0 2 * * ?", "OperationScheduleJob": "0 0 2 * * ?", "CalcInverter15minJob": "0 2/15 * * * ?", - "SendEmailJob": "0 0 3 * * ?" + "SendEmailJob": "0 15 2 * * ?" }, "SMTPConfig": { "Host": "smtp.gmail.com", diff --git a/SolarPower/wwwroot/upload/power_station/1/738117f3-640f-43a0-924d-071bff9df54f.png b/SolarPower/wwwroot/upload/power_station/1/main.png similarity index 100% rename from SolarPower/wwwroot/upload/power_station/1/738117f3-640f-43a0-924d-071bff9df54f.png rename to SolarPower/wwwroot/upload/power_station/1/main.png diff --git a/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_120210803.xlsx b/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_120210803.xlsx index 1ba9b21..edcf25b 100644 Binary files a/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_120210803.xlsx and b/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_120210803.xlsx differ diff --git a/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_220210803.xlsx b/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_220210803.xlsx new file mode 100644 index 0000000..74f9f24 Binary files /dev/null and b/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_220210803.xlsx differ diff --git a/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_320210803.xlsx b/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_320210803.xlsx new file mode 100644 index 0000000..82b96df Binary files /dev/null and b/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_320210803.xlsx differ diff --git a/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_420210803.xlsx b/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_420210803.xlsx new file mode 100644 index 0000000..23ea101 Binary files /dev/null and b/SolarPower/wwwroot/upload/report/20210803/FIC太陽能監控平台_日報表_420210803.xlsx differ diff --git a/slnSolarPower.sln b/slnSolarPower.sln index 2531625..731c6d0 100644 --- a/slnSolarPower.sln +++ b/slnSolarPower.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.31005.135 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SolarPower", "SolarPower\SolarPower.csproj", "{6C88BBD7-5A1F-47B8-BF46-9CBDC73EF2E9}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "solarApp", "solarApp\solarApp.csproj", "{3D54E7DA-4EF8-42A3-85D3-39DD08AC9A0C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {6C88BBD7-5A1F-47B8-BF46-9CBDC73EF2E9}.Debug|Any CPU.Build.0 = Debug|Any CPU {6C88BBD7-5A1F-47B8-BF46-9CBDC73EF2E9}.Release|Any CPU.ActiveCfg = Release|Any CPU {6C88BBD7-5A1F-47B8-BF46-9CBDC73EF2E9}.Release|Any CPU.Build.0 = Release|Any CPU + {3D54E7DA-4EF8-42A3-85D3-39DD08AC9A0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3D54E7DA-4EF8-42A3-85D3-39DD08AC9A0C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3D54E7DA-4EF8-42A3-85D3-39DD08AC9A0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3D54E7DA-4EF8-42A3-85D3-39DD08AC9A0C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/solarApp/App.config b/solarApp/App.config new file mode 100644 index 0000000..83106d1 --- /dev/null +++ b/solarApp/App.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/solarApp/Form1.Designer.cs b/solarApp/Form1.Designer.cs new file mode 100644 index 0000000..fec4d26 --- /dev/null +++ b/solarApp/Form1.Designer.cs @@ -0,0 +1,48 @@ + +namespace solarApp +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1269, 751); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + + } + + #endregion + } +} + diff --git a/solarApp/Form1.cs b/solarApp/Form1.cs new file mode 100644 index 0000000..27bbbb4 --- /dev/null +++ b/solarApp/Form1.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace solarApp +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + } +} diff --git a/solarApp/Form1.resx b/solarApp/Form1.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/solarApp/Form1.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/solarApp/Model/inv_hour.cs b/solarApp/Model/inv_hour.cs new file mode 100644 index 0000000..d5163e1 --- /dev/null +++ b/solarApp/Model/inv_hour.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace solarApp.Model +{ + //public class raw_inv + //{ + // // public string ID { get; set; } + // // public string TIMESTAMP { get; set; } + // // public string SITEID { get; set; } + // // public string SITETYPE { get; set; } + // // public string CONTROLLERID { get; set; } + // public string INVERTERID { get; set; } + // public string reportdate { get; set; } + // //public double SN { get; set; } + // //public double AC1V { get; set; } + // //public double AC1A { get; set; } + // //public double AC1W { get; set; } + // //public double AC1F { get; set; } + // //public double AC1WH { get; set; } + // //public double AC2V { get; set; } + // //public double AC2A { get; set; } + // //public double AC2W { get; set; } + // //public double AC2F { get; set; } + // //public double AC2WH { get; set; } + // //public double AC3V { get; set; } + // //public double AC3A { get; set; } + // //public double AC3W { get; set; } + // //public double AC3F { get; set; } + // //public double AC3WH { get; set; } + // //public double ACRUNTIME { get; set; } + // //public double DC1V { get; set; } + // //public double DC1A { get; set; } + // //public double DC1W { get; set; } + // //public double DC1WH { get; set; } + // //public double DC2V { get; set; } + // //public double DC2A { get; set; } + // //public double DC2W { get; set; } + // //public double DC2WH { get; set; } + // //public double DC3V { get; set; } + // //public double DC3A { get; set; } + // //public double DC3W { get; set; } + // //public double DC3WH { get; set; } + // //public double DC4V { get; set; } + // //public double DC4A { get; set; } + // //public double DC4W { get; set; } + // //public double DC4WH { get; set; } + // //public double DC5V { get; set; } + // //public double DC5A { get; set; } + // //public double DC5W { get; set; } + // //public double DC5WH { get; set; } + // //public double DCRUNTIME { get; set; } + // public double WH { get; set; } + // public double TODAYKWH { get; set; } + // public double TOTALKWH { get; set; } + // public double PR { get; set; } + + // public int ct { get; set; } + // //public double RA1 { get; set; } + // //public double RA2 { get; set; } + // //public double RA3 { get; set; } + // //public double RA4 { get; set; } + // //public double RA5 { get; set; } + //} + + public class raw_inv + { + public string INVERTERID { get; set; } + public string reportdate { get; set; } + + public double WH { get; set; } + public double TODAYKWH { get; set; } + public double TOTALKWH { get; set; } + public double PR { get; set; } + } + + public class raw_inv_hour + { + public string INVERTERID { get; set; } + public string reportdate { get; set; } + + public double KWH { get; set; } + public double TODAYKWH { get; set; } + public double TOTALKWH { get; set; } + public double PR { get; set; } + public int count { get; set; } + } + + public class web_inv_hour + { + public string INVERTERID { get; set; } + public string reportdate { get; set; } + + public double KWH { get; set; } + public double TODAYKWH { get; set; } + public double TOTALKWH { get; set; } + public double PR { get; set; } + } + + public class web_inv_list + { + public string dbName { get; set; } + public string inverterid { get; set; } + } +} diff --git a/solarApp/Model/station_model.cs b/solarApp/Model/station_model.cs new file mode 100644 index 0000000..ff0a4f5 --- /dev/null +++ b/solarApp/Model/station_model.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace solarApp.Model +{ + public class raw_statino + { + // public string siteid { get; set; } + public string reportdate { get; set; } + public double KWH { get; set; } + public double TODAYKWH { get; set; } + public double TOTALKWH { get; set; } + public double PR { get; set; } + public double SOLARHOUR { get; set; } + public double kwhkwp { get; set; } + } + + public class raw_station_day + { + // public string siteid { get; set; } + public string reportdate { get; set; } + + public double KWH { get; set; } + public double TODAYKWH { get; set; } + public double TOTALKWH { get; set; } + public double PR { get; set; } + public double SOLARHOUR { get; set; } + public double kwhkwp { get; set; } + public int count { get; set; } + } + + public class web_station_hour + { + public string siteid { get; set; } + public string reportdate { get; set; } + public double KWH { get; set; } + public double TODAYKWH { get; set; } + public double TOTALKWH { get; set; } + public double PR { get; set; } + public double SOLARHOUR { get; set; } + public double kwhkwp { get; set; } + //public double MONEY { get; set; } + //public double TODAYMONEY { get; set; } + //public double CARBON { get; set; } + //public double TODAYCARBON { get; set; } + } + + public class web_station_day + { + public string siteid { get; set; } + public string reportdate { get; set; } + public double TODAYKWH { get; set; } + public double TOTALKWH { get; set; } + public double PR { get; set; } + public double SOLARHOUR { get; set; } + public double kwhkwp { get; set; } + } + + public class station_list + { + public string id { get; set; } + public string CompanyID { get; set; } + public string SiteID { get; set; } + public string SiteDB { get; set; } + public string SiteName { get; set; } + } +} diff --git a/solarApp/Program.cs b/solarApp/Program.cs new file mode 100644 index 0000000..21ecdcb --- /dev/null +++ b/solarApp/Program.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace solarApp +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.SetHighDpiMode(HighDpiMode.SystemAware); + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new fmMain()); + } + } +} diff --git a/solarApp/Service/getInvSvc.cs b/solarApp/Service/getInvSvc.cs new file mode 100644 index 0000000..0b0aa0e --- /dev/null +++ b/solarApp/Service/getInvSvc.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MySql.Data.MySqlClient; +using Dapper; +using solarApp.Model; +using System.Configuration; +using System.Threading.Tasks; + +namespace solarApp.Service +{ + public class get_inv_svc + { + string Connection1 = ConfigurationManager.ConnectionStrings["mySql"].ConnectionString; + /// + /// inverter 原始資料 - 5 min + /// + /// + /// + /// + public List Get_rawInv(string reportDate, string invID, string siteDB, string siteID) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + //string sql = @"select ID, TIMESTAMP, SITEID, SITETYPE, CONTROLLERID, INVERTERID, SN, AC1V, AC1A, AC1W, AC1F, AC1WH, AC2V, AC2A, AC2W, AC2F, AC2WH, AC3V, AC3A, AC3W, AC3F, AC3WH, ACRUNTIME, DC1V, DC1A, DC1W, DC1WH, DC2V, DC2A, DC2W, DC2WH, DC3V, DC3A, DC3W, DC3WH, DC4V, DC4A, DC4W, DC4WH, DC5V, DC5A, DC5W, DC5WH, DCRUNTIME, WH, TODAYKWH, TOTALKWH, PR, RA1, RA2, RA3, RA4, RA5 + // from solar_com0002.s02202000101_inv order by id desc limit 100; "; + string sql = @"select id , FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i') reportdate, inverterid, WH,round(TODAYKWH, 2) TODAYKWH, round(TOTALKWH, 2) TOTALKWH,round(PR, 2) PR, RA1 + from " + siteDB + ".s" + siteID + @"_inv where left(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i') , 10) = '" + reportDate + "' and inverterid = '" + invID + "'"; + + //List ds = conn.Query(sql, new { kind = kind }).ToList(); + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + /// + /// 每小時平均值 inverter 原始資料 - hour + /// + /// + /// + /// + public List get_Inv_rawAvg(string reportDate, string invID, string siteDB, string siteID) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + //string sql = @"select left(reportdate, 13)reportdate, inverterid, round((sum(WH)/1000), 2) KWH, round(max(TODAYKWH), 2) TODAYKWH, + // round(max(TOTALKWH), 2) TOTALKWH, round(max(PR), 2) PR, count(*) count + // from v_inv_temp where left(reportdate, 10) = '" + reportDate + "' and inverterid = '" + invID + "' " + + // "group by left(reportdate, 13), inverterid"; //round(avg(PR), 2) PR, + string sql = @" select a.reportdate, a.inverterid, a.KWH, b.TODAYKWH, b.TOTALKWH, b.PR, a.count from + ( + select left(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i') , 13)reportdate, inverterid + ,round((sum(WH)/1000), 2) KWH, count(*) count + from " + siteDB + ".s" + siteID + @"_inv + where FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d') = '" + reportDate + "' and inverterid = '" + invID + @"' + group by left(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i'), 13), inverterid + )a join ( + select FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i') reportdate, round(TODAYKWH, 2) TODAYKWH, round(TOTALKWH, 2) TOTALKWH, inverterid, round(PR, 2) PR + from " + siteDB + ".s" + siteID + @"_inv + where FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d') = '" + reportDate + @"' and right(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i'), 2) = '55' and inverterid = '" + invID + @"' + )b on a.reportdate = left(b.reportdate, 13) and a.inverterid = b.inverterid "; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + + /// + /// web 呈現值 每小時平均值 inverter - hour + /// + /// + /// + /// + public List get_web_Inv_hour(string reportDate, string invID) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @"select `TIMESTAMP` reportdate, inverterid, KWH, TODAYKWH, TOTALKWH, round(PR, 2) PR + from inverter_history_hour where left(`TIMESTAMP`, 10) = '" + reportDate + "' and inverterid = '" + invID + "' "; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + + public List get_web_Inv_day(string reportDate, string invID) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @"select `TIMESTAMP` reportdate, inverterid, KWH, TODAYKWH, TOTALKWH, round(PR, 2) PR + from inverter_history_day where left(`TIMESTAMP`, 10) = '" + reportDate + "' and inverterid = '" + invID + "' "; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + + public List get_web_Inv_month(string reportDate, string invID) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @"select `TIMESTAMP` reportdate, inverterid, KWH, TODAYKWH, TOTALKWH, round(PR, 2) PR + from inverter_history_month where left(`TIMESTAMP`, 7) = '" + reportDate + "' and inverterid = '" + invID + "' "; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + + /// + /// + /// + /// + /// + /// + public List get_Inv_list(string siteDB, string siteID) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @"select dbname, inverterid from v_company_inv where dbname = @siteDB and left(inverterid, 9) = @siteID"; + List ds = conn.Query(sql, new { siteDB = siteDB, siteID = siteID }).AsList(); + conn.Close(); + return ds; + } + } + } +} diff --git a/solarApp/Service/getStationSvc.cs b/solarApp/Service/getStationSvc.cs new file mode 100644 index 0000000..e16d2f9 --- /dev/null +++ b/solarApp/Service/getStationSvc.cs @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MySql.Data.MySqlClient; +using Dapper; +using solarApp.Model; +using System.Configuration; + +namespace solarApp.Service +{ + /// + /// 電站原始資料 rawData + /// + public class getStationSvc + { + string Connection1 = ConfigurationManager.ConnectionStrings["mySql"].ConnectionString; + /// + /// 電站 Raw Data + /// + /// + /// + /// + /// + public List get_station_raw(string reportDate, string siteDB, string siteID) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @"select id , FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i') reportdate, siteid, round(KWH, 3) KWH, round(TODAYKWH, 3) TODAYKWH, + round(TOTALKWH, 3)TOTALKWH, round(PR, 3) PR, round(TODAYKWH, 3)SOLARHOUR , round(kwhkwp, 3) kwhkwp + from " + siteDB + ".s" + siteID + @"_station + where left(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i'), 10) = @reportDate"; + List ds = conn.Query(sql, new { reportDate = reportDate }).AsList(); + conn.Close(); + return ds; + } + } + #region 全區使用的 view + public List create_v_station_inv(string date1, string date2) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @" select siteid, left(reportdate, 10) reportdate, round((sum(KWH)), 2) KWH, round((max(TODAYKWH)), 2) TODAYKWH, round((max(TOTALKWH)), 2) TOTALKWH, + round((max(PR)), 2) PR, round((max(SOLARHOUR)), 2) SOLARHOUR, round((max(KWHKWP)), 2) KWHKWP, count(*) count + from v_station_temp + where left(reportdate, 10) between @date1 and @date2 + group by siteid, left(reportdate, 10)"; + List ds = conn.Query(sql, new { date1 = date1, date2 = date2 }).AsList(); + conn.Close(); + return ds; + } + } + + #endregion + /// + /// 電站每天平均 from RawData + /// + /// + /// + /// + public List get_station_rawAvg(string date1, string date2, string siteDB, string siteID) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + //string sql = @" select siteid, left(reportdate, 10) reportdate, round((sum(KWH)), 2) KWH, round((max(TODAYKWH)), 2) TODAYKWH, round((max(TOTALKWH)), 2) TOTALKWH, + // round((max(PR)), 2) PR, round((max(SOLARHOUR)), 2) SOLARHOUR, round((max(KWHKWP)), 2) KWHKWP, count(*) count + // from v_station_temp + // where left(reportdate, 10) between @date1 and @date2 + // group by siteid, left(reportdate, 10)"; + string sql = @" select siteid, left(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i'), 10) reportdate, round((sum(KWH)), 2) KWH, round((max(TODAYKWH)), 2) TODAYKWH, round((max(TOTALKWH)), 2) TOTALKWH, + round((max(PR)), 2) PR, round((max(SOLARHOUR)), 2) SOLARHOUR, round((max(KWHKWP)), 2) KWHKWP, count(*) count + from " + siteDB+ ".s"+ siteID + @"_station + where left(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i'), 10) between @date1 and @date2 + group by siteid, left(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H:%i'), 10)"; + List ds = conn.Query(sql, new { date1 = date1, date2 = date2 }).AsList(); + conn.Close(); + return ds; + } + } + + + + /// + /// web 呈現值 station - hour + /// + /// + /// + public List get_web_station_hour(string reportDate) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @" select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d %H') reportdate, siteid, round(KWH, 2) KWH, round(TODAYKWH, 2) TODAYKWH, round(TOTALKWH, 2) TOTALKWH, + round(PR, 3) PR, round(KWHKWP, 3) KWHKWP, money + from power_station_history_hour where left(`TIMESTAMP`, 10) = '" + reportDate + "' "; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + + /// + /// web 呈現值 station - day + /// + /// + /// + /// + public List get_web_station_day(string date1, string date2) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @" select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') reportdate, siteid, round(TODAYKWH, 2) TODAYKWH, round(TOTALKWH, 2) TOTALKWH, + round(PR, 3) PR, round(KWHKWP, 3) KWHKWP, money + from power_station_history_day where left(`TIMESTAMP`, 10) between @date1 and @date2 "; + List ds = conn.Query(sql, new { date1 = date1, date2 = date2 }).AsList(); + conn.Close(); + return ds; + } + } + + public List get_web_station_month(string date1, string date2) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @" select DATE_FORMAT(`TIMESTAMP`,'%Y-%m-%d') reportdate, siteid, round(TOTALKWH, 2) TOTALKWH, round(PR, 3) PR, round(KWHKWP, 3) KWHKWP, money + from power_station_history_month where left(`TIMESTAMP`, 7) between @date1 and @date2 "; + List ds = conn.Query(sql, new { date1 = date1, date2 = date2 }).AsList(); + conn.Close(); + return ds; + } + } + + /// + /// 取得電站資訊 + /// + /// + public List get_station_list() + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); // 01 控制器編號 + string sql = @" select id, CompanyId, `code` , SerialNumber, CONCAT(`code` ,'01') SiteID, SiteDB, `name` SiteName + from power_station + where id in (1, 8)"; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + } +} diff --git a/solarApp/Service/myHelper.cs b/solarApp/Service/myHelper.cs new file mode 100644 index 0000000..3ff098e --- /dev/null +++ b/solarApp/Service/myHelper.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace solarApp.Service +{ + //static class myHelper + //{ + + //} + public static class ListHelper + { + public static string ToSiteTable(this IList list) + { + + return string.Join(", ", list.ToArray()); + } + } +} diff --git a/solarApp/Service/procInvSvc.cs b/solarApp/Service/procInvSvc.cs new file mode 100644 index 0000000..215ff4e --- /dev/null +++ b/solarApp/Service/procInvSvc.cs @@ -0,0 +1,222 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MySql.Data.MySqlClient; +using Dapper; +using solarApp.Model; +using System.Configuration; +using System.Threading.Tasks; + +namespace solarApp.Service +{ + public class procInvSvc + { + string Connection1 = ConfigurationManager.ConnectionStrings["mySql"].ConnectionString; + /// + /// 每小時平均值 inverter 原始資料 - hour + /// + /// + /// + /// + public List proc_Inv_hour(string reportDate) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + //string sql = @" select a.reportdate, a.inverterid, a.KWH, b.TODAYKWH, b.TOTALKWH, b.PR, a.count from + // ( + // select left(reportdate, 13)reportdate, inverterid + // ,round((sum(WH)/1000), 2) KWH, count(*) count + // from v_inv_temp + // where left(reportdate, 10) = '" + reportDate + "' and inverterid = '" + invID + @"' + + // group by left(reportdate, 13), inverterid + // )a join ( + // select reportdate, round(TODAYKWH, 2) TODAYKWH, round(TOTALKWH, 2) TOTALKWH, inverterid, round(PR, 2) PR + // from v_inv_temp + // where left(reportdate, 10) = '" + reportDate + @"' and right(reportdate, 2) = '55' and inverterid = '" + invID + @"' + // )b on a.reportdate = left(b.reportdate, 13) and a.inverterid = b.inverterid "; + string sql = @" +INSERT INTO `solar_master`.`inverter_history_hour`(`PowerStationId`, `INVERTERID`, `TIMESTAMP`, Irradiance, `AC1V`, `AC1A`, `AC1W`, `AC1F`, `AC1WH`, `AC2V`, `AC2A`, `AC2W`, `AC2F`, `AC2WH`, +`AC3V`, `AC3A`, `AC3W`, `AC3F`, `AC3WH`, `DC1V`, `DC1A`, `DC1W`, `DC1WH`, `DC2V`, `DC2A`, `DC2W`, `DC2WH`, `DC3V`, `DC3A`, `DC3W`, +`DC3WH`, `DC4V`, `DC4A`, `DC4W`, `DC4WH`, `DC5V`, `DC5A`, `DC5W`, `DC5WH`, `PR`, `RA1`, `RA2`, `RA3`, `RA4`, `RA5`, `ACKW`, `KWH`, `TODAYKWH`, `TOTALKWH`, `KWHKWP`) +SELECT 1 powerStationID, a.INVERTERID, concat(a.reportDate,':00:00') reportDate, IFNULL(Irradiance, 0), a.AC1V, a.AC1A, a.AC1W, a.AC1F, a.AC1WH, a.AC2V, a.AC2A, a.AC2W, a.AC2F, a.AC2WH, + a.AC3V, a.AC3A, a.AC3W, a.AC3F, a.AC3WH, a.DC1V, a.DC1A, a.DC1W, a.DC1WH, a.DC2V, a.DC2A, a.DC2W, a.DC2WH, a.DC3V, a.DC3A, a.DC3W, + a.DC3WH, a.DC4V, a.DC4A, a.DC4W, a.DC4WH, a.DC5V, a.DC5A, a.DC5W, a.DC5WH, inv_pr.PR, a.RA1, a.RA2, a.RA3, a.RA4, a.RA5, a.KWH, a.TODAYKWH, a.TOTALKWH, + i.Capacity, (a.KWH / i.Capacity) AS KWHKWP +from +( -- 取得該時間區間的KWH + SELECT FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d %H') AS reportDate, a.INVERTERID, + AVG(a.AC1V) AS AC1V, AVG(a.AC1A) AS AC1A, SUM(a.AC1W) AS AC1W, + AVG(a.AC1F) AS AC1F, SUM(a.AC1WH) AS AC1WH, AVG(a.AC2V) AS AC2V, + AVG(a.AC2A) AS AC2A, SUM(a.AC2W) AS AC2W, AVG(a.AC2F) AS AC2F, + SUM(a.AC2WH) AS AC2WH,AVG(a.AC3V) AS AC3V, AVG(a.AC3A) AS AC3A, + SUM(a.AC3W) AS AC3W, AVG(a.AC3F) AS AC3F, SUM(a.AC3WH) AS AC3WH, + AVG(a.DC1V) AS DC1V, AVG(a.DC1A) AS DC1A, SUM(a.DC1W) AS DC1W, + SUM(a.DC1WH) AS DC1WH, AVG(a.DC2V) AS DC2V, AVG(a.DC2A) AS DC2A, + SUM(a.DC2W) AS DC2W, SUM(a.DC2WH) AS DC2WH, AVG(a.DC3V) AS DC3V, + AVG(a.DC3A) AS DC3A, AVG(a.DC3W) AS DC3W, AVG(a.DC3WH) AS DC3WH, + AVG(a.DC4V) AS DC4V, AVG(a.DC4A) AS DC4A, SUM(a.DC4W) AS DC4W, + SUM(a.DC4WH) AS DC4WH,AVG(a.DC5V) AS DC5V, AVG(a.DC5A) AS DC5A, + SUM(a.DC5W) AS DC5W, SUM(a.DC5WH) AS DC5WH, #inv_pr.PR AS PR, + AVG(a.RA1) AS RA1, AVG(a.RA2) AS RA2, AVG(a.RA3) AS RA3, + AVG(a.RA4) AS RA4, AVG(a.RA5) AS RA5, # a.KWH, + MAX(a.TODAYKWH) AS TODAYKWH, MAX(a.TOTALKWH) AS TOTALKWH, (SUM(a.WH)/1000) AS KWH + FROM s02202000101_inv a + WHERE left(FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d'), 10) = '2021-08-04' + GROUP BY left(FROM_UNIXTIME(a.TIMESTAMP/ 1000, '%Y-%m-%d %H'), 13), a.INVERTERID +) a +LEFT JOIN( -- 取得整點值PR + SELECT FROM_UNIXTIME(inv.TIMESTAMP / 1000, '%Y-%m-%d %H') AS reportDate, inv.INVERTERID, inv.PR + FROM s02202000101_inv inv + WHERE left(DATE_FORMAT(FROM_UNIXTIME(inv.TIMESTAMP / 1000), '%Y-%m-%d %H:%i'), 10) = '2021-08-04' + and right(DATE_FORMAT(FROM_UNIXTIME(inv.TIMESTAMP / 1000), '%Y-%m-%d %H:%i'), 2) = '55' + GROUP BY FROM_UNIXTIME(inv.TIMESTAMP/ 1000, '%Y-%m-%d %H'), inv.INVERTERID +) inv_pr +ON a.reportDate = inv_pr.reportDate AND a.INVERTERID = inv_pr.INVERTERID +-- 取得逆變器容量 +LEFT JOIN solar_com0002.inverter i ON a.INVERTERID = i.InverterId +-- 取日照度 ----------------------臨時做法 +left join ( + select FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d %H') AS reportDate, round(avg(SENSORAVG01),3) Irradiance + from s02202000101_sensoravg a + where left(FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d'), 10) = '2021-08-04' and SENSORAVG01 <> 0 + group by FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d %H') +)irr on a.reportDate = irr.reportDate ;"; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + + public List proc_Inv_day(string reportDate) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @" +INSERT INTO `solar_master`.`inverter_history_day`(`PowerStationId`, `INVERTERID`, `TIMESTAMP`, Irradiance, `AC1V`, `AC1A`, `AC1W`, `AC1F`, `AC1WH`, `AC2V`, `AC2A`, `AC2W`, `AC2F`, `AC2WH`, +`AC3V`, `AC3A`, `AC3W`, `AC3F`, `AC3WH`, `DC1V`, `DC1A`, `DC1W`, `DC1WH`, `DC2V`, `DC2A`, `DC2W`, `DC2WH`, `DC3V`, `DC3A`, `DC3W`, +`DC3WH`, `DC4V`, `DC4A`, `DC4W`, `DC4WH`, `DC5V`, `DC5A`, `DC5W`, `DC5WH`, `PR`, `RA1`, `RA2`, `RA3`, `RA4`, `RA5`, `ACKW`, `KWH`, `TODAYKWH`, `TOTALKWH`, `KWHKWP`) + +SELECT 1 powerStationID, a.INVERTERID, concat(a.reportDate,':00:00') reportDate, IFNULL(Irradiance, 0), a.AC1V, a.AC1A, a.AC1W, a.AC1F, a.AC1WH, a.AC2V, a.AC2A, a.AC2W, a.AC2F, a.AC2WH, + a.AC3V, a.AC3A, a.AC3W, a.AC3F, a.AC3WH, a.DC1V, a.DC1A, a.DC1W, a.DC1WH, a.DC2V, a.DC2A, a.DC2W, a.DC2WH, a.DC3V, a.DC3A, a.DC3W, + a.DC3WH, a.DC4V, a.DC4A, a.DC4W, a.DC4WH, a.DC5V, a.DC5A, a.DC5W, a.DC5WH, a.PR, a.RA1, a.RA2, a.RA3, a.RA4, a.RA5, a.KWH, a.TODAYKWH, a.TOTALKWH, + i.Capacity, (a.KWH / i.Capacity) AS KWHKWP +from +( -- 取得該時間區間的KWH + SELECT FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d') AS reportDate, a.INVERTERID, + AVG(a.AC1V) AS AC1V, AVG(a.AC1A) AS AC1A, SUM(a.AC1W) AS AC1W, + AVG(a.AC1F) AS AC1F, SUM(a.AC1WH) AS AC1WH, AVG(a.AC2V) AS AC2V, + AVG(a.AC2A) AS AC2A, SUM(a.AC2W) AS AC2W, AVG(a.AC2F) AS AC2F, + SUM(a.AC2WH) AS AC2WH,AVG(a.AC3V) AS AC3V, AVG(a.AC3A) AS AC3A, + SUM(a.AC3W) AS AC3W, AVG(a.AC3F) AS AC3F, SUM(a.AC3WH) AS AC3WH, + AVG(a.DC1V) AS DC1V, AVG(a.DC1A) AS DC1A, SUM(a.DC1W) AS DC1W, + SUM(a.DC1WH) AS DC1WH, AVG(a.DC2V) AS DC2V, AVG(a.DC2A) AS DC2A, + SUM(a.DC2W) AS DC2W, SUM(a.DC2WH) AS DC2WH, AVG(a.DC3V) AS DC3V, + AVG(a.DC3A) AS DC3A, AVG(a.DC3W) AS DC3W, AVG(a.DC3WH) AS DC3WH, + AVG(a.DC4V) AS DC4V, AVG(a.DC4A) AS DC4A, SUM(a.DC4W) AS DC4W, + SUM(a.DC4WH) AS DC4WH,AVG(a.DC5V) AS DC5V, AVG(a.DC5A) AS DC5A, + SUM(a.DC5W) AS DC5W, SUM(a.DC5WH) AS DC5WH, #inv_pr.PR AS PR, + AVG(a.RA1) AS RA1, AVG(a.RA2) AS RA2, AVG(a.RA3) AS RA3, + AVG(a.RA4) AS RA4, AVG(a.RA5) AS RA5, # a.KWH, + AVG(a.PR) as PR, + MAX(a.TODAYKWH) AS TODAYKWH, MAX(a.TOTALKWH) AS TOTALKWH, (SUM(a.WH)/1000) AS KWH + FROM solar_com0002.s02202000101_inv a + WHERE left(FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d'), 10) = '2021-08-04' + GROUP BY left(FROM_UNIXTIME(a.TIMESTAMP/ 1000, '%Y-%m-%d'), 10), a.INVERTERID +) a +-- LEFT JOIN( -- 取得整點值PR +-- SELECT FROM_UNIXTIME(inv.TIMESTAMP / 1000, '%Y-%m-%d') AS reportDate, inv.INVERTERID, inv.PR +-- FROM s02202000101_inv inv +-- WHERE left(FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d'), 10) = '2021-08-04' +-- and right(DATE_FORMAT(FROM_UNIXTIME(inv.TIMESTAMP / 1000), '%Y-%m-%d %H:%i'), 2) = '55' +-- GROUP BY FROM_UNIXTIME(inv.TIMESTAMP/ 1000, '%Y-%m-%d %H'), inv.INVERTERID +-- ) inv_pr +-- ON a.reportDate = inv_pr.reportDate AND a.INVERTERID = inv_pr.INVERTERID +-- 取得逆變器容量 +LEFT JOIN solar_com0002.inverter i ON a.INVERTERID = i.InverterId +-- 取日照度 ----------------------臨時做法 +left join ( + select FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d') AS reportDate, round(avg(SENSORAVG01),3) Irradiance + from s02202000101_sensoravg a + where left(FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d'), 10) = '2021-08-04' and SENSORAVG01 <> 0 + group by FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d') +)irr on a.reportDate = irr.reportDate ;"; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + + public List proc_station_hour(string reportDate) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @" +INSERT INTO `solar_master`.`power_station_history_hour`(`PowerStationId`, `TIMESTAMP`, `SITEID`, `SITETYPE`, `KWH`, `TODAYKWH`, `TOTALKWH`, `KWHKWP`, `PR`, `MP`, `SOLARHOUR`, `MONEY`, `TODAYMONEY`, `TOTALMONEY`, `CARBON`, `TODAYCARBON`, `TOTALCARBON`) + +select 1 PowerStationId, concat(FROM_UNIXTIME(`TIMESTAMP`/1000, '%Y-%m-%d %H'), ':00:00') reportdate, siteid, 0 SITETYPE, round((sum(KWH)), 2) KWH, round((max(TODAYKWH)), 2) TODAYKWH, round((max(TOTALKWH)), 2) TOTALKWH, round((max(KWHKWP)), 2) KWHKWP, round((max(PR)), 2) PR, 0 as MP, round((max(SOLARHOUR)), 2) SOLARHOUR, + 0, 0 , 0, 0, 0 , 0 +from solar_com0002.s02202000101_station +where FROM_UNIXTIME(`TIMESTAMP`/1000, '%Y-%m-%d') = '2021-08-04' +group by siteid, FROM_UNIXTIME(`TIMESTAMP`/1000, '%Y-%m-%d %H')"; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + + public List proc_station_day(string reportDate) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @" +insert into solar_master.power_station_history_day(`PowerStationId`, `TIMESTAMP`, `SITEID`, `SITETYPE`, `TODAYKWH`, `TOTALKWH`, `KWHKWP`, `PR`, `MP`, `SOLARHOUR`, `MONEY`, `TOTALMONEY`, `CARBON`, `TOTALCARBON`) + +SELECT 1 as PowerStationId, FROM_UNIXTIME(s.TIMESTAMP/1000, '%Y-%m-%d %H') AS reportDate, s.SITEID, s.SITETYPE, + s.TodayKWh, s.TotalKWH, s.KWHKWP, s.PR, s.MP, s.SolarHour, 0, 0, 0, 0 + FROM solar_com0002.s02202000101_station s + WHERE DATE_FORMAT(FROM_UNIXTIME(s.TIMESTAMP/1000), '%Y-%m-%d') = '2021-08-04' + ORDER BY TIMESTAMP DESC + LIMIT 1 "; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + + public List proc_sensor_hour(string reportDate) + { + using (MySqlConnection conn = new MySqlConnection(Connection1)) + { + conn.Open(); + string sql = @" + +INSERT INTO `solar_master`.`sensor_history_hour`(`PowerStationId`, `TIMESTAMP`, `Irradiance`, `Temperature`) + +select a.PowerStationId, a.reportDate, ifnull(b.Irradiance, 0) Irradiance, a.temperature +from +(#溫度 + select 1 as PowerStationId, concat(FROM_UNIXTIME(`TIMESTAMP`/1000, '%Y-%m-%d %H'), ':00:00') AS reportDate, + 0 Irradiance, round(avg(SENSORAVG02),3) temperature + from s02202000101_sensoravg a + where left(FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d'), 10) = '2021-08-04' + group by FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d %H') +)a left join ( + #日照 + select 1 as PowerStationId, concat(FROM_UNIXTIME(`TIMESTAMP`/1000, '%Y-%m-%d %H'), ':00:00') AS reportDate, + round(avg(SENSORAVG01),3) Irradiance, round(avg(SENSORAVG02),3) temperature + from s02202000101_sensoravg a + where left(FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d'), 10) = '2021-08-04' and SENSORAVG01 <> 0 + group by FROM_UNIXTIME(a.TIMESTAMP / 1000, '%Y-%m-%d %H') +)b on a.reportDate = b.reportDate ;"; + List ds = conn.Query(sql).AsList(); + conn.Close(); + return ds; + } + } + } +} diff --git a/solarApp/fmArchive.Designer.cs b/solarApp/fmArchive.Designer.cs new file mode 100644 index 0000000..2f5b495 --- /dev/null +++ b/solarApp/fmArchive.Designer.cs @@ -0,0 +1,799 @@ + +namespace solarApp +{ + partial class fmArchive + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + this.tb2 = new System.Windows.Forms.TabPage(); + this.sp_main_station = new System.Windows.Forms.SplitContainer(); + this.label12 = new System.Windows.Forms.Label(); + this.dtselect_station2 = new System.Windows.Forms.DateTimePicker(); + this.lbMsg_station = new System.Windows.Forms.Label(); + this.bt_find_station = new System.Windows.Forms.Button(); + this.dtselect_station1 = new System.Windows.Forms.DateTimePicker(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.label13 = new System.Windows.Forms.Label(); + this.sp_child_station = new System.Windows.Forms.SplitContainer(); + this.gv_web_station_day = new System.Windows.Forms.DataGridView(); + this.panel7 = new System.Windows.Forms.Panel(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.gv_web_station_hour = new System.Windows.Forms.DataGridView(); + this.panel4 = new System.Windows.Forms.Panel(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.gv_fic_station_day = new System.Windows.Forms.DataGridView(); + this.panel5 = new System.Windows.Forms.Panel(); + this.label7 = new System.Windows.Forms.Label(); + this.gv_fic_station_raw = new System.Windows.Forms.DataGridView(); + this.panel6 = new System.Windows.Forms.Panel(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.tb_inv = new System.Windows.Forms.TabPage(); + this.sp_main_inv = new System.Windows.Forms.SplitContainer(); + this.bt_inv_proc = new System.Windows.Forms.Button(); + this.lbMsg_inv = new System.Windows.Forms.Label(); + this.lbInverterID = new System.Windows.Forms.Label(); + this.fp_inv = new System.Windows.Forms.FlowLayoutPanel(); + this.bt_select1 = new System.Windows.Forms.Button(); + this.sp_child_inv = new System.Windows.Forms.SplitContainer(); + this.gv_web_inv_hour = new System.Windows.Forms.DataGridView(); + this.panel1 = new System.Windows.Forms.Panel(); + this.label3 = new System.Windows.Forms.Label(); + this.lb_inv_hour = new System.Windows.Forms.Label(); + this.gv_fic_inv_hour = new System.Windows.Forms.DataGridView(); + this.panel3 = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.gv_fic_inv_raw = new System.Windows.Forms.DataGridView(); + this.panel2 = new System.Windows.Forms.Panel(); + this.label2 = new System.Windows.Forms.Label(); + this.lb_raw_inv_hour = new System.Windows.Forms.Label(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tb2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sp_main_station)).BeginInit(); + this.sp_main_station.Panel1.SuspendLayout(); + this.sp_main_station.Panel2.SuspendLayout(); + this.sp_main_station.SuspendLayout(); + this.flowLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sp_child_station)).BeginInit(); + this.sp_child_station.Panel1.SuspendLayout(); + this.sp_child_station.Panel2.SuspendLayout(); + this.sp_child_station.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_day)).BeginInit(); + this.panel7.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_hour)).BeginInit(); + this.panel4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_station_day)).BeginInit(); + this.panel5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_station_raw)).BeginInit(); + this.panel6.SuspendLayout(); + this.tb_inv.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sp_main_inv)).BeginInit(); + this.sp_main_inv.Panel1.SuspendLayout(); + this.sp_main_inv.Panel2.SuspendLayout(); + this.sp_main_inv.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sp_child_inv)).BeginInit(); + this.sp_child_inv.Panel1.SuspendLayout(); + this.sp_child_inv.Panel2.SuspendLayout(); + this.sp_child_inv.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_inv_hour)).BeginInit(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_inv_hour)).BeginInit(); + this.panel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_inv_raw)).BeginInit(); + this.panel2.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.SuspendLayout(); + // + // tb2 + // + this.tb2.Controls.Add(this.sp_main_station); + this.tb2.Location = new System.Drawing.Point(4, 28); + this.tb2.Name = "tb2"; + this.tb2.Padding = new System.Windows.Forms.Padding(3); + this.tb2.Size = new System.Drawing.Size(1774, 921); + this.tb2.TabIndex = 1; + this.tb2.Text = " site "; + this.tb2.UseVisualStyleBackColor = true; + // + // sp_main_station + // + this.sp_main_station.BackColor = System.Drawing.SystemColors.ActiveCaption; + this.sp_main_station.Dock = System.Windows.Forms.DockStyle.Fill; + this.sp_main_station.Location = new System.Drawing.Point(3, 3); + this.sp_main_station.Name = "sp_main_station"; + // + // sp_main_station.Panel1 + // + this.sp_main_station.Panel1.Controls.Add(this.label12); + this.sp_main_station.Panel1.Controls.Add(this.dtselect_station2); + this.sp_main_station.Panel1.Controls.Add(this.lbMsg_station); + this.sp_main_station.Panel1.Controls.Add(this.bt_find_station); + this.sp_main_station.Panel1.Controls.Add(this.dtselect_station1); + this.sp_main_station.Panel1.Controls.Add(this.flowLayoutPanel1); + // + // sp_main_station.Panel2 + // + this.sp_main_station.Panel2.BackColor = System.Drawing.Color.OldLace; + this.sp_main_station.Panel2.Controls.Add(this.sp_child_station); + this.sp_main_station.Size = new System.Drawing.Size(1768, 915); + this.sp_main_station.SplitterDistance = 262; + this.sp_main_station.TabIndex = 0; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label12.Location = new System.Drawing.Point(13, 44); + this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(24, 24); + this.label12.TabIndex = 12; + this.label12.Text = "~"; + // + // dtselect_station2 + // + this.dtselect_station2.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.dtselect_station2.Location = new System.Drawing.Point(12, 76); + this.dtselect_station2.Name = "dtselect_station2"; + this.dtselect_station2.Size = new System.Drawing.Size(234, 31); + this.dtselect_station2.TabIndex = 10; + // + // lbMsg_station + // + this.lbMsg_station.AutoSize = true; + this.lbMsg_station.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbMsg_station.Location = new System.Drawing.Point(26, 162); + this.lbMsg_station.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbMsg_station.Name = "lbMsg_station"; + this.lbMsg_station.Size = new System.Drawing.Size(22, 24); + this.lbMsg_station.TabIndex = 9; + this.lbMsg_station.Text = "..."; + // + // bt_find_station + // + this.bt_find_station.Location = new System.Drawing.Point(12, 124); + this.bt_find_station.Name = "bt_find_station"; + this.bt_find_station.Size = new System.Drawing.Size(94, 29); + this.bt_find_station.TabIndex = 7; + this.bt_find_station.Text = "查詢"; + this.bt_find_station.UseVisualStyleBackColor = true; + // + // dtselect_station1 + // + this.dtselect_station1.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.dtselect_station1.Location = new System.Drawing.Point(14, 8); + this.dtselect_station1.Name = "dtselect_station1"; + this.dtselect_station1.Size = new System.Drawing.Size(234, 31); + this.dtselect_station1.TabIndex = 6; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.BackColor = System.Drawing.Color.Azure; + this.flowLayoutPanel1.Controls.Add(this.label13); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 270); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(262, 645); + this.flowLayoutPanel1.TabIndex = 8; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label13.Location = new System.Drawing.Point(4, 0); + this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(110, 24); + this.label13.TabIndex = 4; + this.label13.Text = "請選擇 電站"; + // + // sp_child_station + // + this.sp_child_station.Dock = System.Windows.Forms.DockStyle.Fill; + this.sp_child_station.Location = new System.Drawing.Point(0, 0); + this.sp_child_station.Margin = new System.Windows.Forms.Padding(4); + this.sp_child_station.Name = "sp_child_station"; + // + // sp_child_station.Panel1 + // + this.sp_child_station.Panel1.Controls.Add(this.gv_web_station_day); + this.sp_child_station.Panel1.Controls.Add(this.panel7); + this.sp_child_station.Panel1.Controls.Add(this.gv_web_station_hour); + this.sp_child_station.Panel1.Controls.Add(this.panel4); + // + // sp_child_station.Panel2 + // + this.sp_child_station.Panel2.Controls.Add(this.gv_fic_station_day); + this.sp_child_station.Panel2.Controls.Add(this.panel5); + this.sp_child_station.Panel2.Controls.Add(this.gv_fic_station_raw); + this.sp_child_station.Panel2.Controls.Add(this.panel6); + this.sp_child_station.Size = new System.Drawing.Size(1502, 915); + this.sp_child_station.SplitterDistance = 727; + this.sp_child_station.SplitterWidth = 13; + this.sp_child_station.TabIndex = 1; + // + // gv_web_station_day + // + this.gv_web_station_day.AllowUserToAddRows = false; + this.gv_web_station_day.AllowUserToDeleteRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.Azure; + this.gv_web_station_day.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.gv_web_station_day.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_web_station_day.Dock = System.Windows.Forms.DockStyle.Fill; + this.gv_web_station_day.Location = new System.Drawing.Point(0, 583); + this.gv_web_station_day.Margin = new System.Windows.Forms.Padding(4); + this.gv_web_station_day.Name = "gv_web_station_day"; + this.gv_web_station_day.ReadOnly = true; + this.gv_web_station_day.RowHeadersWidth = 51; + this.gv_web_station_day.RowTemplate.Height = 25; + this.gv_web_station_day.Size = new System.Drawing.Size(727, 332); + this.gv_web_station_day.TabIndex = 3; + // + // panel7 + // + this.panel7.Controls.Add(this.label10); + this.panel7.Controls.Add(this.label11); + this.panel7.Dock = System.Windows.Forms.DockStyle.Top; + this.panel7.Location = new System.Drawing.Point(0, 545); + this.panel7.Margin = new System.Windows.Forms.Padding(4); + this.panel7.Name = "panel7"; + this.panel7.Size = new System.Drawing.Size(727, 38); + this.panel7.TabIndex = 2; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label10.Location = new System.Drawing.Point(230, 8); + this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(368, 24); + this.label10.TabIndex = 1; + this.label10.Text = "solar_master.power_station_history_day"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label11.Location = new System.Drawing.Point(35, 8); + this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(162, 24); + this.label11.TabIndex = 0; + this.label11.Text = "web: station 每天"; + // + // gv_web_station_hour + // + this.gv_web_station_hour.AllowUserToAddRows = false; + this.gv_web_station_hour.AllowUserToDeleteRows = false; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.Azure; + this.gv_web_station_hour.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2; + this.gv_web_station_hour.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_web_station_hour.Dock = System.Windows.Forms.DockStyle.Top; + this.gv_web_station_hour.Location = new System.Drawing.Point(0, 38); + this.gv_web_station_hour.Margin = new System.Windows.Forms.Padding(4); + this.gv_web_station_hour.Name = "gv_web_station_hour"; + this.gv_web_station_hour.ReadOnly = true; + this.gv_web_station_hour.RowHeadersWidth = 51; + this.gv_web_station_hour.RowTemplate.Height = 25; + this.gv_web_station_hour.Size = new System.Drawing.Size(727, 507); + this.gv_web_station_hour.TabIndex = 1; + // + // panel4 + // + this.panel4.Controls.Add(this.label5); + this.panel4.Controls.Add(this.label6); + this.panel4.Dock = System.Windows.Forms.DockStyle.Top; + this.panel4.Location = new System.Drawing.Point(0, 0); + this.panel4.Margin = new System.Windows.Forms.Padding(4); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(727, 38); + this.panel4.TabIndex = 0; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label5.Location = new System.Drawing.Point(230, 8); + this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(379, 24); + this.label5.TabIndex = 1; + this.label5.Text = "solar_master.power_station_history_hour"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label6.Location = new System.Drawing.Point(35, 8); + this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(156, 24); + this.label6.TabIndex = 0; + this.label6.Text = "web: site 每小時 "; + // + // gv_fic_station_day + // + this.gv_fic_station_day.AllowUserToAddRows = false; + this.gv_fic_station_day.AllowUserToDeleteRows = false; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.LightCyan; + this.gv_fic_station_day.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; + this.gv_fic_station_day.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_fic_station_day.Dock = System.Windows.Forms.DockStyle.Fill; + this.gv_fic_station_day.Location = new System.Drawing.Point(0, 583); + this.gv_fic_station_day.Margin = new System.Windows.Forms.Padding(4); + this.gv_fic_station_day.Name = "gv_fic_station_day"; + this.gv_fic_station_day.ReadOnly = true; + this.gv_fic_station_day.RowHeadersWidth = 51; + this.gv_fic_station_day.RowTemplate.Height = 25; + this.gv_fic_station_day.Size = new System.Drawing.Size(762, 332); + this.gv_fic_station_day.TabIndex = 4; + // + // panel5 + // + this.panel5.Controls.Add(this.label7); + this.panel5.Dock = System.Windows.Forms.DockStyle.Top; + this.panel5.Location = new System.Drawing.Point(0, 545); + this.panel5.Margin = new System.Windows.Forms.Padding(4); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(762, 38); + this.panel5.TabIndex = 3; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label7.Location = new System.Drawing.Point(15, 8); + this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(152, 24); + this.label7.TabIndex = 2; + this.label7.Text = "FIC: station 每天"; + // + // gv_fic_station_raw + // + this.gv_fic_station_raw.AllowUserToAddRows = false; + this.gv_fic_station_raw.AllowUserToDeleteRows = false; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.LightCyan; + this.gv_fic_station_raw.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + this.gv_fic_station_raw.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_fic_station_raw.Dock = System.Windows.Forms.DockStyle.Top; + this.gv_fic_station_raw.Location = new System.Drawing.Point(0, 38); + this.gv_fic_station_raw.Margin = new System.Windows.Forms.Padding(4); + this.gv_fic_station_raw.Name = "gv_fic_station_raw"; + this.gv_fic_station_raw.ReadOnly = true; + this.gv_fic_station_raw.RowHeadersWidth = 51; + this.gv_fic_station_raw.RowTemplate.Height = 25; + this.gv_fic_station_raw.Size = new System.Drawing.Size(762, 507); + this.gv_fic_station_raw.TabIndex = 2; + // + // panel6 + // + this.panel6.Controls.Add(this.label8); + this.panel6.Controls.Add(this.label9); + this.panel6.Dock = System.Windows.Forms.DockStyle.Top; + this.panel6.Location = new System.Drawing.Point(0, 0); + this.panel6.Margin = new System.Windows.Forms.Padding(4); + this.panel6.Name = "panel6"; + this.panel6.Size = new System.Drawing.Size(762, 38); + this.panel6.TabIndex = 1; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label8.Location = new System.Drawing.Point(255, 8); + this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(350, 24); + this.label8.TabIndex = 3; + this.label8.Text = "solar_com0002.s02202000101_station"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label9.Location = new System.Drawing.Point(15, 8); + this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(245, 24); + this.label9.TabIndex = 2; + this.label9.Text = "FIC: station 原始資料(hour)"; + // + // tb_inv + // + this.tb_inv.BackColor = System.Drawing.Color.LightSkyBlue; + this.tb_inv.Controls.Add(this.sp_main_inv); + this.tb_inv.Location = new System.Drawing.Point(4, 28); + this.tb_inv.Name = "tb_inv"; + this.tb_inv.Padding = new System.Windows.Forms.Padding(3); + this.tb_inv.Size = new System.Drawing.Size(1774, 921); + this.tb_inv.TabIndex = 0; + this.tb_inv.Text = " Inverter "; + // + // sp_main_inv + // + this.sp_main_inv.BackColor = System.Drawing.Color.LightSkyBlue; + this.sp_main_inv.Dock = System.Windows.Forms.DockStyle.Fill; + this.sp_main_inv.Location = new System.Drawing.Point(3, 3); + this.sp_main_inv.Name = "sp_main_inv"; + // + // sp_main_inv.Panel1 + // + this.sp_main_inv.Panel1.BackColor = System.Drawing.Color.LightSkyBlue; + this.sp_main_inv.Panel1.Controls.Add(this.bt_inv_proc); + this.sp_main_inv.Panel1.Controls.Add(this.lbMsg_inv); + this.sp_main_inv.Panel1.Controls.Add(this.lbInverterID); + this.sp_main_inv.Panel1.Controls.Add(this.fp_inv); + this.sp_main_inv.Panel1.Controls.Add(this.bt_select1); + // + // sp_main_inv.Panel2 + // + this.sp_main_inv.Panel2.Controls.Add(this.sp_child_inv); + this.sp_main_inv.Size = new System.Drawing.Size(1768, 915); + this.sp_main_inv.SplitterDistance = 357; + this.sp_main_inv.TabIndex = 0; + // + // bt_inv_proc + // + this.bt_inv_proc.Location = new System.Drawing.Point(22, 83); + this.bt_inv_proc.Name = "bt_inv_proc"; + this.bt_inv_proc.Size = new System.Drawing.Size(94, 29); + this.bt_inv_proc.TabIndex = 6; + this.bt_inv_proc.Text = "查詢"; + this.bt_inv_proc.UseVisualStyleBackColor = true; + this.bt_inv_proc.Click += new System.EventHandler(this.bt_inv_proc_Click); + // + // lbMsg_inv + // + this.lbMsg_inv.AutoSize = true; + this.lbMsg_inv.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbMsg_inv.Location = new System.Drawing.Point(136, 28); + this.lbMsg_inv.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbMsg_inv.Name = "lbMsg_inv"; + this.lbMsg_inv.Size = new System.Drawing.Size(22, 24); + this.lbMsg_inv.TabIndex = 5; + this.lbMsg_inv.Text = "..."; + // + // lbInverterID + // + this.lbInverterID.AutoSize = true; + this.lbInverterID.Dock = System.Windows.Forms.DockStyle.Bottom; + this.lbInverterID.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbInverterID.Location = new System.Drawing.Point(0, 246); + this.lbInverterID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbInverterID.Name = "lbInverterID"; + this.lbInverterID.Size = new System.Drawing.Size(105, 24); + this.lbInverterID.TabIndex = 3; + this.lbInverterID.Text = "待處理設備"; + // + // fp_inv + // + this.fp_inv.BackColor = System.Drawing.Color.GhostWhite; + this.fp_inv.Dock = System.Windows.Forms.DockStyle.Bottom; + this.fp_inv.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.fp_inv.Location = new System.Drawing.Point(0, 270); + this.fp_inv.Margin = new System.Windows.Forms.Padding(4); + this.fp_inv.Name = "fp_inv"; + this.fp_inv.Size = new System.Drawing.Size(357, 645); + this.fp_inv.TabIndex = 2; + // + // bt_select1 + // + this.bt_select1.Location = new System.Drawing.Point(22, 23); + this.bt_select1.Name = "bt_select1"; + this.bt_select1.Size = new System.Drawing.Size(94, 29); + this.bt_select1.TabIndex = 1; + this.bt_select1.Text = "查詢"; + this.bt_select1.UseVisualStyleBackColor = true; + // + // sp_child_inv + // + this.sp_child_inv.Dock = System.Windows.Forms.DockStyle.Fill; + this.sp_child_inv.Location = new System.Drawing.Point(0, 0); + this.sp_child_inv.Margin = new System.Windows.Forms.Padding(4); + this.sp_child_inv.Name = "sp_child_inv"; + // + // sp_child_inv.Panel1 + // + this.sp_child_inv.Panel1.Controls.Add(this.gv_web_inv_hour); + this.sp_child_inv.Panel1.Controls.Add(this.panel1); + // + // sp_child_inv.Panel2 + // + this.sp_child_inv.Panel2.Controls.Add(this.gv_fic_inv_hour); + this.sp_child_inv.Panel2.Controls.Add(this.panel3); + this.sp_child_inv.Panel2.Controls.Add(this.gv_fic_inv_raw); + this.sp_child_inv.Panel2.Controls.Add(this.panel2); + this.sp_child_inv.Size = new System.Drawing.Size(1407, 915); + this.sp_child_inv.SplitterDistance = 678; + this.sp_child_inv.SplitterWidth = 13; + this.sp_child_inv.TabIndex = 0; + // + // gv_web_inv_hour + // + this.gv_web_inv_hour.AllowUserToAddRows = false; + this.gv_web_inv_hour.AllowUserToDeleteRows = false; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.Azure; + this.gv_web_inv_hour.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; + this.gv_web_inv_hour.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_web_inv_hour.Dock = System.Windows.Forms.DockStyle.Fill; + this.gv_web_inv_hour.Location = new System.Drawing.Point(0, 38); + this.gv_web_inv_hour.Margin = new System.Windows.Forms.Padding(4); + this.gv_web_inv_hour.Name = "gv_web_inv_hour"; + this.gv_web_inv_hour.ReadOnly = true; + this.gv_web_inv_hour.RowHeadersWidth = 51; + this.gv_web_inv_hour.RowTemplate.Height = 25; + this.gv_web_inv_hour.Size = new System.Drawing.Size(678, 877); + this.gv_web_inv_hour.TabIndex = 1; + // + // panel1 + // + this.panel1.Controls.Add(this.label3); + this.panel1.Controls.Add(this.lb_inv_hour); + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(678, 38); + this.panel1.TabIndex = 0; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label3.Location = new System.Drawing.Point(230, 8); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(321, 24); + this.label3.TabIndex = 1; + this.label3.Text = "solar_master.inverter_history_hour"; + // + // lb_inv_hour + // + this.lb_inv_hour.AutoSize = true; + this.lb_inv_hour.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lb_inv_hour.Location = new System.Drawing.Point(35, 8); + this.lb_inv_hour.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lb_inv_hour.Name = "lb_inv_hour"; + this.lb_inv_hour.Size = new System.Drawing.Size(151, 24); + this.lb_inv_hour.TabIndex = 0; + this.lb_inv_hour.Text = "web: inv 每小時 "; + // + // gv_fic_inv_hour + // + this.gv_fic_inv_hour.AllowUserToAddRows = false; + this.gv_fic_inv_hour.AllowUserToDeleteRows = false; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.LightCyan; + this.gv_fic_inv_hour.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; + this.gv_fic_inv_hour.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_fic_inv_hour.Dock = System.Windows.Forms.DockStyle.Fill; + this.gv_fic_inv_hour.Location = new System.Drawing.Point(0, 583); + this.gv_fic_inv_hour.Margin = new System.Windows.Forms.Padding(4); + this.gv_fic_inv_hour.Name = "gv_fic_inv_hour"; + this.gv_fic_inv_hour.ReadOnly = true; + this.gv_fic_inv_hour.RowHeadersWidth = 51; + this.gv_fic_inv_hour.RowTemplate.Height = 25; + this.gv_fic_inv_hour.Size = new System.Drawing.Size(716, 332); + this.gv_fic_inv_hour.TabIndex = 4; + // + // panel3 + // + this.panel3.Controls.Add(this.label1); + this.panel3.Dock = System.Windows.Forms.DockStyle.Top; + this.panel3.Location = new System.Drawing.Point(0, 545); + this.panel3.Margin = new System.Windows.Forms.Padding(4); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(716, 38); + this.panel3.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label1.Location = new System.Drawing.Point(15, 8); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(141, 24); + this.label1.TabIndex = 2; + this.label1.Text = "FIC: inv 每小時 "; + // + // gv_fic_inv_raw + // + this.gv_fic_inv_raw.AllowUserToAddRows = false; + this.gv_fic_inv_raw.AllowUserToDeleteRows = false; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.LightCyan; + this.gv_fic_inv_raw.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; + this.gv_fic_inv_raw.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_fic_inv_raw.Dock = System.Windows.Forms.DockStyle.Top; + this.gv_fic_inv_raw.Location = new System.Drawing.Point(0, 38); + this.gv_fic_inv_raw.Margin = new System.Windows.Forms.Padding(4); + this.gv_fic_inv_raw.Name = "gv_fic_inv_raw"; + this.gv_fic_inv_raw.ReadOnly = true; + this.gv_fic_inv_raw.RowHeadersWidth = 51; + this.gv_fic_inv_raw.RowTemplate.Height = 25; + this.gv_fic_inv_raw.Size = new System.Drawing.Size(716, 507); + this.gv_fic_inv_raw.TabIndex = 2; + // + // panel2 + // + this.panel2.Controls.Add(this.label2); + this.panel2.Controls.Add(this.lb_raw_inv_hour); + this.panel2.Dock = System.Windows.Forms.DockStyle.Top; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(716, 38); + this.panel2.TabIndex = 1; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label2.Location = new System.Drawing.Point(255, 8); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(315, 24); + this.label2.TabIndex = 3; + this.label2.Text = "solar_com0002.s02202000101_inv"; + // + // lb_raw_inv_hour + // + this.lb_raw_inv_hour.AutoSize = true; + this.lb_raw_inv_hour.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lb_raw_inv_hour.Location = new System.Drawing.Point(15, 8); + this.lb_raw_inv_hour.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lb_raw_inv_hour.Name = "lb_raw_inv_hour"; + this.lb_raw_inv_hour.Size = new System.Drawing.Size(155, 24); + this.lb_raw_inv_hour.TabIndex = 2; + this.lb_raw_inv_hour.Text = "FIC: inv 原始資料"; + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tb_inv); + this.tabControl1.Controls.Add(this.tb2); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(1782, 953); + this.tabControl1.TabIndex = 1; + // + // fmArchive + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1782, 953); + this.Controls.Add(this.tabControl1); + this.Name = "fmArchive"; + this.Text = "fmArchive"; + this.tb2.ResumeLayout(false); + this.sp_main_station.Panel1.ResumeLayout(false); + this.sp_main_station.Panel1.PerformLayout(); + this.sp_main_station.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.sp_main_station)).EndInit(); + this.sp_main_station.ResumeLayout(false); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); + this.sp_child_station.Panel1.ResumeLayout(false); + this.sp_child_station.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.sp_child_station)).EndInit(); + this.sp_child_station.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_day)).EndInit(); + this.panel7.ResumeLayout(false); + this.panel7.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_hour)).EndInit(); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_station_day)).EndInit(); + this.panel5.ResumeLayout(false); + this.panel5.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_station_raw)).EndInit(); + this.panel6.ResumeLayout(false); + this.panel6.PerformLayout(); + this.tb_inv.ResumeLayout(false); + this.sp_main_inv.Panel1.ResumeLayout(false); + this.sp_main_inv.Panel1.PerformLayout(); + this.sp_main_inv.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.sp_main_inv)).EndInit(); + this.sp_main_inv.ResumeLayout(false); + this.sp_child_inv.Panel1.ResumeLayout(false); + this.sp_child_inv.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.sp_child_inv)).EndInit(); + this.sp_child_inv.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_inv_hour)).EndInit(); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_inv_hour)).EndInit(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_inv_raw)).EndInit(); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); + this.tabControl1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabPage tb2; + private System.Windows.Forms.SplitContainer sp_main_station; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.DateTimePicker dtselect_station2; + private System.Windows.Forms.Label lbMsg_station; + private System.Windows.Forms.Button bt_find_station; + private System.Windows.Forms.DateTimePicker dtselect_station1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.SplitContainer sp_child_station; + private System.Windows.Forms.DataGridView gv_web_station_day; + private System.Windows.Forms.Panel panel7; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.DataGridView gv_web_station_hour; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.DataGridView gv_fic_station_day; + private System.Windows.Forms.Panel panel5; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.DataGridView gv_fic_station_raw; + private System.Windows.Forms.Panel panel6; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TabPage tb_inv; + private System.Windows.Forms.SplitContainer sp_main_inv; + private System.Windows.Forms.Button bt_inv_proc; + private System.Windows.Forms.Label lbMsg_inv; + private System.Windows.Forms.Label lbInverterID; + private System.Windows.Forms.FlowLayoutPanel fp_inv; + private System.Windows.Forms.Button bt_select1; + private System.Windows.Forms.SplitContainer sp_child_inv; + private System.Windows.Forms.DataGridView gv_web_inv_hour; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label lb_inv_hour; + private System.Windows.Forms.DataGridView gv_fic_inv_hour; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.DataGridView gv_fic_inv_raw; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label lb_raw_inv_hour; + private System.Windows.Forms.TabControl tabControl1; + } +} \ No newline at end of file diff --git a/solarApp/fmArchive.cs b/solarApp/fmArchive.cs new file mode 100644 index 0000000..7c2ab47 --- /dev/null +++ b/solarApp/fmArchive.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace solarApp +{ + public partial class fmArchive : Form + { + public fmArchive() + { + InitializeComponent(); + } + + private void bt_inv_proc_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/solarApp/fmArchive.resx b/solarApp/fmArchive.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/solarApp/fmArchive.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/solarApp/fmMain.Designer.cs b/solarApp/fmMain.Designer.cs new file mode 100644 index 0000000..136b60e --- /dev/null +++ b/solarApp/fmMain.Designer.cs @@ -0,0 +1,1063 @@ + +namespace solarApp +{ + partial class fmMain + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tb_inv = new System.Windows.Forms.TabPage(); + this.sp_main_inv = new System.Windows.Forms.SplitContainer(); + this.lbSiteDB_inv = new System.Windows.Forms.Label(); + this.lbSiteID_inv = new System.Windows.Forms.Label(); + this.lbSiteName_inv = new System.Windows.Forms.Label(); + this.lbMsg_inv = new System.Windows.Forms.Label(); + this.lbInverterID = new System.Windows.Forms.Label(); + this.fp_inv = new System.Windows.Forms.FlowLayoutPanel(); + this.label4 = new System.Windows.Forms.Label(); + this.bt_InvSearch = new System.Windows.Forms.Button(); + this.dtselect_inv = new System.Windows.Forms.DateTimePicker(); + this.sp_child_inv = new System.Windows.Forms.SplitContainer(); + this.gv_web_inv_month = new System.Windows.Forms.DataGridView(); + this.panel9 = new System.Windows.Forms.Panel(); + this.label16 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.gv_web_inv_day = new System.Windows.Forms.DataGridView(); + this.panel8 = new System.Windows.Forms.Panel(); + this.label14 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.gv_web_inv_hour = new System.Windows.Forms.DataGridView(); + this.panel1 = new System.Windows.Forms.Panel(); + this.label3 = new System.Windows.Forms.Label(); + this.lb_inv_hour = new System.Windows.Forms.Label(); + this.gv_fic_inv_hour = new System.Windows.Forms.DataGridView(); + this.panel3 = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.gv_fic_inv_raw = new System.Windows.Forms.DataGridView(); + this.panel2 = new System.Windows.Forms.Panel(); + this.lbInvRaw = new System.Windows.Forms.Label(); + this.lb_raw_inv_hour = new System.Windows.Forms.Label(); + this.tb2 = new System.Windows.Forms.TabPage(); + this.sp_main_station = new System.Windows.Forms.SplitContainer(); + this.label13 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.dtselect_station2 = new System.Windows.Forms.DateTimePicker(); + this.lbMsg_station = new System.Windows.Forms.Label(); + this.bt_find_station = new System.Windows.Forms.Button(); + this.dtselect_station1 = new System.Windows.Forms.DateTimePicker(); + this.fp_site = new System.Windows.Forms.FlowLayoutPanel(); + this.sp_child_station = new System.Windows.Forms.SplitContainer(); + this.gv_web_station_month = new System.Windows.Forms.DataGridView(); + this.panel10 = new System.Windows.Forms.Panel(); + this.label18 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.gv_web_station_day = new System.Windows.Forms.DataGridView(); + this.panel7 = new System.Windows.Forms.Panel(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.gv_web_station_hour = new System.Windows.Forms.DataGridView(); + this.panel4 = new System.Windows.Forms.Panel(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.gv_fic_station_day = new System.Windows.Forms.DataGridView(); + this.panel5 = new System.Windows.Forms.Panel(); + this.label7 = new System.Windows.Forms.Label(); + this.gv_fic_station_raw = new System.Windows.Forms.DataGridView(); + this.panel6 = new System.Windows.Forms.Panel(); + this.lbSiteRaw = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.tabControl1.SuspendLayout(); + this.tb_inv.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sp_main_inv)).BeginInit(); + this.sp_main_inv.Panel1.SuspendLayout(); + this.sp_main_inv.Panel2.SuspendLayout(); + this.sp_main_inv.SuspendLayout(); + this.fp_inv.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sp_child_inv)).BeginInit(); + this.sp_child_inv.Panel1.SuspendLayout(); + this.sp_child_inv.Panel2.SuspendLayout(); + this.sp_child_inv.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_inv_month)).BeginInit(); + this.panel9.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_inv_day)).BeginInit(); + this.panel8.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_inv_hour)).BeginInit(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_inv_hour)).BeginInit(); + this.panel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_inv_raw)).BeginInit(); + this.panel2.SuspendLayout(); + this.tb2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sp_main_station)).BeginInit(); + this.sp_main_station.Panel1.SuspendLayout(); + this.sp_main_station.Panel2.SuspendLayout(); + this.sp_main_station.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.sp_child_station)).BeginInit(); + this.sp_child_station.Panel1.SuspendLayout(); + this.sp_child_station.Panel2.SuspendLayout(); + this.sp_child_station.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_month)).BeginInit(); + this.panel10.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_day)).BeginInit(); + this.panel7.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_hour)).BeginInit(); + this.panel4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_station_day)).BeginInit(); + this.panel5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_station_raw)).BeginInit(); + this.panel6.SuspendLayout(); + this.SuspendLayout(); + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tb_inv); + this.tabControl1.Controls.Add(this.tb2); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(1743, 1074); + this.tabControl1.TabIndex = 0; + // + // tb_inv + // + this.tb_inv.BackColor = System.Drawing.Color.Azure; + this.tb_inv.Controls.Add(this.sp_main_inv); + this.tb_inv.Location = new System.Drawing.Point(4, 28); + this.tb_inv.Name = "tb_inv"; + this.tb_inv.Padding = new System.Windows.Forms.Padding(3); + this.tb_inv.Size = new System.Drawing.Size(1735, 1042); + this.tb_inv.TabIndex = 0; + this.tb_inv.Text = " Inverter "; + // + // sp_main_inv + // + this.sp_main_inv.Dock = System.Windows.Forms.DockStyle.Fill; + this.sp_main_inv.Location = new System.Drawing.Point(3, 3); + this.sp_main_inv.Name = "sp_main_inv"; + // + // sp_main_inv.Panel1 + // + this.sp_main_inv.Panel1.BackColor = System.Drawing.Color.LightCyan; + this.sp_main_inv.Panel1.Controls.Add(this.lbSiteDB_inv); + this.sp_main_inv.Panel1.Controls.Add(this.lbSiteID_inv); + this.sp_main_inv.Panel1.Controls.Add(this.lbSiteName_inv); + this.sp_main_inv.Panel1.Controls.Add(this.lbMsg_inv); + this.sp_main_inv.Panel1.Controls.Add(this.lbInverterID); + this.sp_main_inv.Panel1.Controls.Add(this.fp_inv); + this.sp_main_inv.Panel1.Controls.Add(this.bt_InvSearch); + this.sp_main_inv.Panel1.Controls.Add(this.dtselect_inv); + // + // sp_main_inv.Panel2 + // + this.sp_main_inv.Panel2.Controls.Add(this.sp_child_inv); + this.sp_main_inv.Size = new System.Drawing.Size(1729, 1036); + this.sp_main_inv.SplitterDistance = 351; + this.sp_main_inv.TabIndex = 0; + // + // lbSiteDB_inv + // + this.lbSiteDB_inv.AutoSize = true; + this.lbSiteDB_inv.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbSiteDB_inv.Location = new System.Drawing.Point(36, 100); + this.lbSiteDB_inv.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbSiteDB_inv.Name = "lbSiteDB_inv"; + this.lbSiteDB_inv.Size = new System.Drawing.Size(79, 24); + this.lbSiteDB_inv.TabIndex = 8; + this.lbSiteDB_inv.Text = "Site_DB"; + // + // lbSiteID_inv + // + this.lbSiteID_inv.AutoSize = true; + this.lbSiteID_inv.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbSiteID_inv.Location = new System.Drawing.Point(36, 58); + this.lbSiteID_inv.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbSiteID_inv.Name = "lbSiteID_inv"; + this.lbSiteID_inv.Size = new System.Drawing.Size(72, 24); + this.lbSiteID_inv.TabIndex = 7; + this.lbSiteID_inv.Text = "Site_ID"; + // + // lbSiteName_inv + // + this.lbSiteName_inv.AutoSize = true; + this.lbSiteName_inv.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbSiteName_inv.Location = new System.Drawing.Point(36, 14); + this.lbSiteName_inv.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbSiteName_inv.Name = "lbSiteName_inv"; + this.lbSiteName_inv.Size = new System.Drawing.Size(107, 24); + this.lbSiteName_inv.TabIndex = 6; + this.lbSiteName_inv.Text = "Site_Name"; + // + // lbMsg_inv + // + this.lbMsg_inv.AutoSize = true; + this.lbMsg_inv.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbMsg_inv.Location = new System.Drawing.Point(155, 212); + this.lbMsg_inv.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbMsg_inv.Name = "lbMsg_inv"; + this.lbMsg_inv.Size = new System.Drawing.Size(22, 24); + this.lbMsg_inv.TabIndex = 5; + this.lbMsg_inv.Text = "..."; + // + // lbInverterID + // + this.lbInverterID.AutoSize = true; + this.lbInverterID.Dock = System.Windows.Forms.DockStyle.Bottom; + this.lbInverterID.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbInverterID.Location = new System.Drawing.Point(0, 367); + this.lbInverterID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbInverterID.Name = "lbInverterID"; + this.lbInverterID.Size = new System.Drawing.Size(142, 24); + this.lbInverterID.TabIndex = 3; + this.lbInverterID.Text = "請選擇 Inverter"; + // + // fp_inv + // + this.fp_inv.BackColor = System.Drawing.Color.Azure; + this.fp_inv.Controls.Add(this.label4); + this.fp_inv.Dock = System.Windows.Forms.DockStyle.Bottom; + this.fp_inv.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.fp_inv.Location = new System.Drawing.Point(0, 391); + this.fp_inv.Margin = new System.Windows.Forms.Padding(4); + this.fp_inv.Name = "fp_inv"; + this.fp_inv.Size = new System.Drawing.Size(351, 645); + this.fp_inv.TabIndex = 2; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label4.Location = new System.Drawing.Point(4, 0); + this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(142, 24); + this.label4.TabIndex = 4; + this.label4.Text = "請選擇 Inverter"; + // + // bt_InvSearch + // + this.bt_InvSearch.Location = new System.Drawing.Point(36, 209); + this.bt_InvSearch.Name = "bt_InvSearch"; + this.bt_InvSearch.Size = new System.Drawing.Size(94, 29); + this.bt_InvSearch.TabIndex = 1; + this.bt_InvSearch.Text = "查詢"; + this.bt_InvSearch.UseVisualStyleBackColor = true; + this.bt_InvSearch.Click += new System.EventHandler(this.button1_Click); + // + // dtselect_inv + // + this.dtselect_inv.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.dtselect_inv.Location = new System.Drawing.Point(36, 162); + this.dtselect_inv.Name = "dtselect_inv"; + this.dtselect_inv.Size = new System.Drawing.Size(250, 31); + this.dtselect_inv.TabIndex = 0; + this.dtselect_inv.ValueChanged += new System.EventHandler(this.dtselect_ValueChanged); + // + // sp_child_inv + // + this.sp_child_inv.Dock = System.Windows.Forms.DockStyle.Fill; + this.sp_child_inv.Location = new System.Drawing.Point(0, 0); + this.sp_child_inv.Margin = new System.Windows.Forms.Padding(4); + this.sp_child_inv.Name = "sp_child_inv"; + // + // sp_child_inv.Panel1 + // + this.sp_child_inv.Panel1.Controls.Add(this.gv_web_inv_month); + this.sp_child_inv.Panel1.Controls.Add(this.panel9); + this.sp_child_inv.Panel1.Controls.Add(this.gv_web_inv_day); + this.sp_child_inv.Panel1.Controls.Add(this.panel8); + this.sp_child_inv.Panel1.Controls.Add(this.gv_web_inv_hour); + this.sp_child_inv.Panel1.Controls.Add(this.panel1); + // + // sp_child_inv.Panel2 + // + this.sp_child_inv.Panel2.Controls.Add(this.gv_fic_inv_hour); + this.sp_child_inv.Panel2.Controls.Add(this.panel3); + this.sp_child_inv.Panel2.Controls.Add(this.gv_fic_inv_raw); + this.sp_child_inv.Panel2.Controls.Add(this.panel2); + this.sp_child_inv.Size = new System.Drawing.Size(1374, 1036); + this.sp_child_inv.SplitterDistance = 666; + this.sp_child_inv.SplitterWidth = 13; + this.sp_child_inv.TabIndex = 0; + // + // gv_web_inv_month + // + this.gv_web_inv_month.AllowUserToAddRows = false; + this.gv_web_inv_month.AllowUserToDeleteRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.Azure; + this.gv_web_inv_month.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.gv_web_inv_month.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_web_inv_month.Dock = System.Windows.Forms.DockStyle.Fill; + this.gv_web_inv_month.Location = new System.Drawing.Point(0, 853); + this.gv_web_inv_month.Margin = new System.Windows.Forms.Padding(4); + this.gv_web_inv_month.Name = "gv_web_inv_month"; + this.gv_web_inv_month.ReadOnly = true; + this.gv_web_inv_month.RowHeadersWidth = 51; + this.gv_web_inv_month.RowTemplate.Height = 25; + this.gv_web_inv_month.Size = new System.Drawing.Size(666, 183); + this.gv_web_inv_month.TabIndex = 7; + // + // panel9 + // + this.panel9.Controls.Add(this.label16); + this.panel9.Controls.Add(this.label17); + this.panel9.Dock = System.Windows.Forms.DockStyle.Top; + this.panel9.Location = new System.Drawing.Point(0, 815); + this.panel9.Margin = new System.Windows.Forms.Padding(4); + this.panel9.Name = "panel9"; + this.panel9.Size = new System.Drawing.Size(666, 38); + this.panel9.TabIndex = 6; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label16.Location = new System.Drawing.Point(230, 8); + this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(339, 24); + this.label16.TabIndex = 1; + this.label16.Text = "solar_master.inverter_history_month"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label17.Location = new System.Drawing.Point(35, 8); + this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(127, 24); + this.label17.TabIndex = 0; + this.label17.Text = "web: inv 每月"; + // + // gv_web_inv_day + // + this.gv_web_inv_day.AllowUserToAddRows = false; + this.gv_web_inv_day.AllowUserToDeleteRows = false; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.Azure; + this.gv_web_inv_day.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2; + this.gv_web_inv_day.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_web_inv_day.Dock = System.Windows.Forms.DockStyle.Top; + this.gv_web_inv_day.Location = new System.Drawing.Point(0, 583); + this.gv_web_inv_day.Margin = new System.Windows.Forms.Padding(4); + this.gv_web_inv_day.Name = "gv_web_inv_day"; + this.gv_web_inv_day.ReadOnly = true; + this.gv_web_inv_day.RowHeadersWidth = 51; + this.gv_web_inv_day.RowTemplate.Height = 25; + this.gv_web_inv_day.Size = new System.Drawing.Size(666, 232); + this.gv_web_inv_day.TabIndex = 4; + // + // panel8 + // + this.panel8.Controls.Add(this.label14); + this.panel8.Controls.Add(this.label15); + this.panel8.Dock = System.Windows.Forms.DockStyle.Top; + this.panel8.Location = new System.Drawing.Point(0, 545); + this.panel8.Margin = new System.Windows.Forms.Padding(4); + this.panel8.Name = "panel8"; + this.panel8.Size = new System.Drawing.Size(666, 38); + this.panel8.TabIndex = 3; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label14.Location = new System.Drawing.Point(230, 8); + this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(310, 24); + this.label14.TabIndex = 1; + this.label14.Text = "solar_master.inverter_history_day"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label15.Location = new System.Drawing.Point(35, 8); + this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(127, 24); + this.label15.TabIndex = 0; + this.label15.Text = "web: inv 每天"; + // + // gv_web_inv_hour + // + this.gv_web_inv_hour.AllowUserToAddRows = false; + this.gv_web_inv_hour.AllowUserToDeleteRows = false; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.Azure; + this.gv_web_inv_hour.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; + this.gv_web_inv_hour.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_web_inv_hour.Dock = System.Windows.Forms.DockStyle.Top; + this.gv_web_inv_hour.Location = new System.Drawing.Point(0, 38); + this.gv_web_inv_hour.Margin = new System.Windows.Forms.Padding(4); + this.gv_web_inv_hour.Name = "gv_web_inv_hour"; + this.gv_web_inv_hour.ReadOnly = true; + this.gv_web_inv_hour.RowHeadersWidth = 51; + this.gv_web_inv_hour.RowTemplate.Height = 25; + this.gv_web_inv_hour.Size = new System.Drawing.Size(666, 507); + this.gv_web_inv_hour.TabIndex = 1; + // + // panel1 + // + this.panel1.Controls.Add(this.label3); + this.panel1.Controls.Add(this.lb_inv_hour); + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(4); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(666, 38); + this.panel1.TabIndex = 0; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label3.Location = new System.Drawing.Point(230, 8); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(321, 24); + this.label3.TabIndex = 1; + this.label3.Text = "solar_master.inverter_history_hour"; + // + // lb_inv_hour + // + this.lb_inv_hour.AutoSize = true; + this.lb_inv_hour.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lb_inv_hour.Location = new System.Drawing.Point(35, 8); + this.lb_inv_hour.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lb_inv_hour.Name = "lb_inv_hour"; + this.lb_inv_hour.Size = new System.Drawing.Size(151, 24); + this.lb_inv_hour.TabIndex = 0; + this.lb_inv_hour.Text = "web: inv 每小時 "; + // + // gv_fic_inv_hour + // + this.gv_fic_inv_hour.AllowUserToAddRows = false; + this.gv_fic_inv_hour.AllowUserToDeleteRows = false; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.LightCyan; + this.gv_fic_inv_hour.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + this.gv_fic_inv_hour.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_fic_inv_hour.Dock = System.Windows.Forms.DockStyle.Fill; + this.gv_fic_inv_hour.Location = new System.Drawing.Point(0, 583); + this.gv_fic_inv_hour.Margin = new System.Windows.Forms.Padding(4); + this.gv_fic_inv_hour.Name = "gv_fic_inv_hour"; + this.gv_fic_inv_hour.ReadOnly = true; + this.gv_fic_inv_hour.RowHeadersWidth = 51; + this.gv_fic_inv_hour.RowTemplate.Height = 25; + this.gv_fic_inv_hour.Size = new System.Drawing.Size(695, 453); + this.gv_fic_inv_hour.TabIndex = 4; + this.gv_fic_inv_hour.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.gv_fic_inv_hour_CellFormatting); + // + // panel3 + // + this.panel3.Controls.Add(this.label1); + this.panel3.Dock = System.Windows.Forms.DockStyle.Top; + this.panel3.Location = new System.Drawing.Point(0, 545); + this.panel3.Margin = new System.Windows.Forms.Padding(4); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(695, 38); + this.panel3.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label1.Location = new System.Drawing.Point(15, 8); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(141, 24); + this.label1.TabIndex = 2; + this.label1.Text = "FIC: inv 每小時 "; + // + // gv_fic_inv_raw + // + this.gv_fic_inv_raw.AllowUserToAddRows = false; + this.gv_fic_inv_raw.AllowUserToDeleteRows = false; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.LightCyan; + this.gv_fic_inv_raw.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; + this.gv_fic_inv_raw.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_fic_inv_raw.Dock = System.Windows.Forms.DockStyle.Top; + this.gv_fic_inv_raw.Location = new System.Drawing.Point(0, 38); + this.gv_fic_inv_raw.Margin = new System.Windows.Forms.Padding(4); + this.gv_fic_inv_raw.Name = "gv_fic_inv_raw"; + this.gv_fic_inv_raw.ReadOnly = true; + this.gv_fic_inv_raw.RowHeadersWidth = 51; + this.gv_fic_inv_raw.RowTemplate.Height = 25; + this.gv_fic_inv_raw.Size = new System.Drawing.Size(695, 507); + this.gv_fic_inv_raw.TabIndex = 2; + // + // panel2 + // + this.panel2.Controls.Add(this.lbInvRaw); + this.panel2.Controls.Add(this.lb_raw_inv_hour); + this.panel2.Dock = System.Windows.Forms.DockStyle.Top; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Margin = new System.Windows.Forms.Padding(4); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(695, 38); + this.panel2.TabIndex = 1; + // + // lbInvRaw + // + this.lbInvRaw.AutoSize = true; + this.lbInvRaw.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbInvRaw.Location = new System.Drawing.Point(255, 8); + this.lbInvRaw.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbInvRaw.Name = "lbInvRaw"; + this.lbInvRaw.Size = new System.Drawing.Size(315, 24); + this.lbInvRaw.TabIndex = 3; + this.lbInvRaw.Text = "solar_com0002.s02202000101_inv"; + // + // lb_raw_inv_hour + // + this.lb_raw_inv_hour.AutoSize = true; + this.lb_raw_inv_hour.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lb_raw_inv_hour.Location = new System.Drawing.Point(15, 8); + this.lb_raw_inv_hour.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lb_raw_inv_hour.Name = "lb_raw_inv_hour"; + this.lb_raw_inv_hour.Size = new System.Drawing.Size(155, 24); + this.lb_raw_inv_hour.TabIndex = 2; + this.lb_raw_inv_hour.Text = "FIC: inv 原始資料"; + // + // tb2 + // + this.tb2.Controls.Add(this.sp_main_station); + this.tb2.Location = new System.Drawing.Point(4, 28); + this.tb2.Name = "tb2"; + this.tb2.Padding = new System.Windows.Forms.Padding(3); + this.tb2.Size = new System.Drawing.Size(1735, 1042); + this.tb2.TabIndex = 1; + this.tb2.Text = " site "; + this.tb2.UseVisualStyleBackColor = true; + // + // sp_main_station + // + this.sp_main_station.BackColor = System.Drawing.SystemColors.ActiveCaption; + this.sp_main_station.Dock = System.Windows.Forms.DockStyle.Fill; + this.sp_main_station.Location = new System.Drawing.Point(3, 3); + this.sp_main_station.Name = "sp_main_station"; + // + // sp_main_station.Panel1 + // + this.sp_main_station.Panel1.Controls.Add(this.label13); + this.sp_main_station.Panel1.Controls.Add(this.label12); + this.sp_main_station.Panel1.Controls.Add(this.dtselect_station2); + this.sp_main_station.Panel1.Controls.Add(this.lbMsg_station); + this.sp_main_station.Panel1.Controls.Add(this.bt_find_station); + this.sp_main_station.Panel1.Controls.Add(this.dtselect_station1); + this.sp_main_station.Panel1.Controls.Add(this.fp_site); + // + // sp_main_station.Panel2 + // + this.sp_main_station.Panel2.BackColor = System.Drawing.Color.OldLace; + this.sp_main_station.Panel2.Controls.Add(this.sp_child_station); + this.sp_main_station.Size = new System.Drawing.Size(1729, 1036); + this.sp_main_station.SplitterDistance = 257; + this.sp_main_station.TabIndex = 0; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label13.Location = new System.Drawing.Point(6, 363); + this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(110, 24); + this.label13.TabIndex = 13; + this.label13.Text = "請選擇 電站"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label12.Location = new System.Drawing.Point(13, 44); + this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(24, 24); + this.label12.TabIndex = 12; + this.label12.Text = "~"; + // + // dtselect_station2 + // + this.dtselect_station2.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.dtselect_station2.Location = new System.Drawing.Point(12, 76); + this.dtselect_station2.Name = "dtselect_station2"; + this.dtselect_station2.Size = new System.Drawing.Size(234, 31); + this.dtselect_station2.TabIndex = 10; + // + // lbMsg_station + // + this.lbMsg_station.AutoSize = true; + this.lbMsg_station.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbMsg_station.Location = new System.Drawing.Point(26, 162); + this.lbMsg_station.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbMsg_station.Name = "lbMsg_station"; + this.lbMsg_station.Size = new System.Drawing.Size(22, 24); + this.lbMsg_station.TabIndex = 9; + this.lbMsg_station.Text = "..."; + // + // bt_find_station + // + this.bt_find_station.Location = new System.Drawing.Point(12, 124); + this.bt_find_station.Name = "bt_find_station"; + this.bt_find_station.Size = new System.Drawing.Size(94, 29); + this.bt_find_station.TabIndex = 7; + this.bt_find_station.Text = "查詢"; + this.bt_find_station.UseVisualStyleBackColor = true; + this.bt_find_station.Click += new System.EventHandler(this.bt_find_station_Click); + // + // dtselect_station1 + // + this.dtselect_station1.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.dtselect_station1.Location = new System.Drawing.Point(14, 8); + this.dtselect_station1.Name = "dtselect_station1"; + this.dtselect_station1.Size = new System.Drawing.Size(234, 31); + this.dtselect_station1.TabIndex = 6; + // + // fp_site + // + this.fp_site.BackColor = System.Drawing.Color.Azure; + this.fp_site.Dock = System.Windows.Forms.DockStyle.Bottom; + this.fp_site.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.fp_site.Location = new System.Drawing.Point(0, 391); + this.fp_site.Margin = new System.Windows.Forms.Padding(4); + this.fp_site.Name = "fp_site"; + this.fp_site.Size = new System.Drawing.Size(257, 645); + this.fp_site.TabIndex = 8; + // + // sp_child_station + // + this.sp_child_station.Dock = System.Windows.Forms.DockStyle.Fill; + this.sp_child_station.Location = new System.Drawing.Point(0, 0); + this.sp_child_station.Margin = new System.Windows.Forms.Padding(4); + this.sp_child_station.Name = "sp_child_station"; + // + // sp_child_station.Panel1 + // + this.sp_child_station.Panel1.Controls.Add(this.gv_web_station_month); + this.sp_child_station.Panel1.Controls.Add(this.panel10); + this.sp_child_station.Panel1.Controls.Add(this.gv_web_station_day); + this.sp_child_station.Panel1.Controls.Add(this.panel7); + this.sp_child_station.Panel1.Controls.Add(this.gv_web_station_hour); + this.sp_child_station.Panel1.Controls.Add(this.panel4); + // + // sp_child_station.Panel2 + // + this.sp_child_station.Panel2.Controls.Add(this.gv_fic_station_day); + this.sp_child_station.Panel2.Controls.Add(this.panel5); + this.sp_child_station.Panel2.Controls.Add(this.gv_fic_station_raw); + this.sp_child_station.Panel2.Controls.Add(this.panel6); + this.sp_child_station.Size = new System.Drawing.Size(1468, 1036); + this.sp_child_station.SplitterDistance = 711; + this.sp_child_station.SplitterWidth = 13; + this.sp_child_station.TabIndex = 1; + // + // gv_web_station_month + // + this.gv_web_station_month.AllowUserToAddRows = false; + this.gv_web_station_month.AllowUserToDeleteRows = false; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.Azure; + this.gv_web_station_month.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; + this.gv_web_station_month.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_web_station_month.Dock = System.Windows.Forms.DockStyle.Fill; + this.gv_web_station_month.Location = new System.Drawing.Point(0, 913); + this.gv_web_station_month.Margin = new System.Windows.Forms.Padding(4); + this.gv_web_station_month.Name = "gv_web_station_month"; + this.gv_web_station_month.ReadOnly = true; + this.gv_web_station_month.RowHeadersWidth = 51; + this.gv_web_station_month.RowTemplate.Height = 25; + this.gv_web_station_month.Size = new System.Drawing.Size(711, 123); + this.gv_web_station_month.TabIndex = 5; + // + // panel10 + // + this.panel10.Controls.Add(this.label18); + this.panel10.Controls.Add(this.label19); + this.panel10.Dock = System.Windows.Forms.DockStyle.Top; + this.panel10.Location = new System.Drawing.Point(0, 875); + this.panel10.Margin = new System.Windows.Forms.Padding(4); + this.panel10.Name = "panel10"; + this.panel10.Size = new System.Drawing.Size(711, 38); + this.panel10.TabIndex = 4; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label18.Location = new System.Drawing.Point(230, 8); + this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(397, 24); + this.label18.TabIndex = 1; + this.label18.Text = "solar_master.power_station_history_month"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label19.Location = new System.Drawing.Point(35, 8); + this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(162, 24); + this.label19.TabIndex = 0; + this.label19.Text = "web: station 每月"; + // + // gv_web_station_day + // + this.gv_web_station_day.AllowUserToAddRows = false; + this.gv_web_station_day.AllowUserToDeleteRows = false; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.Azure; + this.gv_web_station_day.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; + this.gv_web_station_day.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_web_station_day.Dock = System.Windows.Forms.DockStyle.Top; + this.gv_web_station_day.Location = new System.Drawing.Point(0, 583); + this.gv_web_station_day.Margin = new System.Windows.Forms.Padding(4); + this.gv_web_station_day.Name = "gv_web_station_day"; + this.gv_web_station_day.ReadOnly = true; + this.gv_web_station_day.RowHeadersWidth = 51; + this.gv_web_station_day.RowTemplate.Height = 25; + this.gv_web_station_day.Size = new System.Drawing.Size(711, 292); + this.gv_web_station_day.TabIndex = 3; + // + // panel7 + // + this.panel7.Controls.Add(this.label10); + this.panel7.Controls.Add(this.label11); + this.panel7.Dock = System.Windows.Forms.DockStyle.Top; + this.panel7.Location = new System.Drawing.Point(0, 545); + this.panel7.Margin = new System.Windows.Forms.Padding(4); + this.panel7.Name = "panel7"; + this.panel7.Size = new System.Drawing.Size(711, 38); + this.panel7.TabIndex = 2; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label10.Location = new System.Drawing.Point(230, 8); + this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(368, 24); + this.label10.TabIndex = 1; + this.label10.Text = "solar_master.power_station_history_day"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label11.Location = new System.Drawing.Point(35, 8); + this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(162, 24); + this.label11.TabIndex = 0; + this.label11.Text = "web: station 每天"; + // + // gv_web_station_hour + // + this.gv_web_station_hour.AllowUserToAddRows = false; + this.gv_web_station_hour.AllowUserToDeleteRows = false; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.Azure; + this.gv_web_station_hour.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; + this.gv_web_station_hour.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_web_station_hour.Dock = System.Windows.Forms.DockStyle.Top; + this.gv_web_station_hour.Location = new System.Drawing.Point(0, 38); + this.gv_web_station_hour.Margin = new System.Windows.Forms.Padding(4); + this.gv_web_station_hour.Name = "gv_web_station_hour"; + this.gv_web_station_hour.ReadOnly = true; + this.gv_web_station_hour.RowHeadersWidth = 51; + this.gv_web_station_hour.RowTemplate.Height = 25; + this.gv_web_station_hour.Size = new System.Drawing.Size(711, 507); + this.gv_web_station_hour.TabIndex = 1; + // + // panel4 + // + this.panel4.Controls.Add(this.label5); + this.panel4.Controls.Add(this.label6); + this.panel4.Dock = System.Windows.Forms.DockStyle.Top; + this.panel4.Location = new System.Drawing.Point(0, 0); + this.panel4.Margin = new System.Windows.Forms.Padding(4); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(711, 38); + this.panel4.TabIndex = 0; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label5.Location = new System.Drawing.Point(230, 8); + this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(379, 24); + this.label5.TabIndex = 1; + this.label5.Text = "solar_master.power_station_history_hour"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label6.Location = new System.Drawing.Point(35, 8); + this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(156, 24); + this.label6.TabIndex = 0; + this.label6.Text = "web: site 每小時 "; + // + // gv_fic_station_day + // + this.gv_fic_station_day.AllowUserToAddRows = false; + this.gv_fic_station_day.AllowUserToDeleteRows = false; + dataGridViewCellStyle9.BackColor = System.Drawing.Color.LightCyan; + this.gv_fic_station_day.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9; + this.gv_fic_station_day.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_fic_station_day.Dock = System.Windows.Forms.DockStyle.Fill; + this.gv_fic_station_day.Location = new System.Drawing.Point(0, 583); + this.gv_fic_station_day.Margin = new System.Windows.Forms.Padding(4); + this.gv_fic_station_day.Name = "gv_fic_station_day"; + this.gv_fic_station_day.ReadOnly = true; + this.gv_fic_station_day.RowHeadersWidth = 51; + this.gv_fic_station_day.RowTemplate.Height = 25; + this.gv_fic_station_day.Size = new System.Drawing.Size(744, 453); + this.gv_fic_station_day.TabIndex = 4; + // + // panel5 + // + this.panel5.Controls.Add(this.label7); + this.panel5.Dock = System.Windows.Forms.DockStyle.Top; + this.panel5.Location = new System.Drawing.Point(0, 545); + this.panel5.Margin = new System.Windows.Forms.Padding(4); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(744, 38); + this.panel5.TabIndex = 3; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label7.Location = new System.Drawing.Point(15, 8); + this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(152, 24); + this.label7.TabIndex = 2; + this.label7.Text = "FIC: station 每天"; + // + // gv_fic_station_raw + // + this.gv_fic_station_raw.AllowUserToAddRows = false; + this.gv_fic_station_raw.AllowUserToDeleteRows = false; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.LightCyan; + this.gv_fic_station_raw.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10; + this.gv_fic_station_raw.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_fic_station_raw.Dock = System.Windows.Forms.DockStyle.Top; + this.gv_fic_station_raw.Location = new System.Drawing.Point(0, 38); + this.gv_fic_station_raw.Margin = new System.Windows.Forms.Padding(4); + this.gv_fic_station_raw.Name = "gv_fic_station_raw"; + this.gv_fic_station_raw.ReadOnly = true; + this.gv_fic_station_raw.RowHeadersWidth = 51; + this.gv_fic_station_raw.RowTemplate.Height = 25; + this.gv_fic_station_raw.Size = new System.Drawing.Size(744, 507); + this.gv_fic_station_raw.TabIndex = 2; + // + // panel6 + // + this.panel6.Controls.Add(this.lbSiteRaw); + this.panel6.Controls.Add(this.label9); + this.panel6.Dock = System.Windows.Forms.DockStyle.Top; + this.panel6.Location = new System.Drawing.Point(0, 0); + this.panel6.Margin = new System.Windows.Forms.Padding(4); + this.panel6.Name = "panel6"; + this.panel6.Size = new System.Drawing.Size(744, 38); + this.panel6.TabIndex = 1; + // + // lbSiteRaw + // + this.lbSiteRaw.AutoSize = true; + this.lbSiteRaw.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.lbSiteRaw.Location = new System.Drawing.Point(268, 8); + this.lbSiteRaw.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lbSiteRaw.Name = "lbSiteRaw"; + this.lbSiteRaw.Size = new System.Drawing.Size(350, 24); + this.lbSiteRaw.TabIndex = 3; + this.lbSiteRaw.Text = "solar_com0002.s02202000101_station"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Microsoft JhengHei UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label9.Location = new System.Drawing.Point(15, 8); + this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(245, 24); + this.label9.TabIndex = 2; + this.label9.Text = "FIC: station 原始資料(hour)"; + // + // fmMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1743, 1074); + this.Controls.Add(this.tabControl1); + this.Name = "fmMain"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "太陽能電站數據檢核 V0729"; + this.Load += new System.EventHandler(this.fmMain_Load); + this.tabControl1.ResumeLayout(false); + this.tb_inv.ResumeLayout(false); + this.sp_main_inv.Panel1.ResumeLayout(false); + this.sp_main_inv.Panel1.PerformLayout(); + this.sp_main_inv.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.sp_main_inv)).EndInit(); + this.sp_main_inv.ResumeLayout(false); + this.fp_inv.ResumeLayout(false); + this.fp_inv.PerformLayout(); + this.sp_child_inv.Panel1.ResumeLayout(false); + this.sp_child_inv.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.sp_child_inv)).EndInit(); + this.sp_child_inv.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_inv_month)).EndInit(); + this.panel9.ResumeLayout(false); + this.panel9.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_inv_day)).EndInit(); + this.panel8.ResumeLayout(false); + this.panel8.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_inv_hour)).EndInit(); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_inv_hour)).EndInit(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_inv_raw)).EndInit(); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); + this.tb2.ResumeLayout(false); + this.sp_main_station.Panel1.ResumeLayout(false); + this.sp_main_station.Panel1.PerformLayout(); + this.sp_main_station.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.sp_main_station)).EndInit(); + this.sp_main_station.ResumeLayout(false); + this.sp_child_station.Panel1.ResumeLayout(false); + this.sp_child_station.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.sp_child_station)).EndInit(); + this.sp_child_station.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_month)).EndInit(); + this.panel10.ResumeLayout(false); + this.panel10.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_day)).EndInit(); + this.panel7.ResumeLayout(false); + this.panel7.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_web_station_hour)).EndInit(); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_station_day)).EndInit(); + this.panel5.ResumeLayout(false); + this.panel5.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gv_fic_station_raw)).EndInit(); + this.panel6.ResumeLayout(false); + this.panel6.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tb_inv; + private System.Windows.Forms.TabPage tb2; + private System.Windows.Forms.SplitContainer sp_main_inv; + private System.Windows.Forms.SplitContainer sp_main_station; + private System.Windows.Forms.Button bt_InvSearch; + private System.Windows.Forms.DateTimePicker dtselect_inv; + private System.Windows.Forms.SplitContainer sp_child_inv; + private System.Windows.Forms.DataGridView gv_web_inv_hour; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label lb_inv_hour; + private System.Windows.Forms.DataGridView gv_fic_inv_raw; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Label lb_raw_inv_hour; + private System.Windows.Forms.FlowLayoutPanel fp_inv; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.DataGridView gv_fic_inv_hour; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label lbInverterID; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label lbMsg; + private System.Windows.Forms.SplitContainer sp_child_station; + private System.Windows.Forms.DataGridView gv_web_station_hour; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.DataGridView gv_fic_station_day; + private System.Windows.Forms.Panel panel5; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.DataGridView gv_fic_station_raw; + private System.Windows.Forms.Panel panel6; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Panel panel7; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.DataGridView gv_web_station_day; + private System.Windows.Forms.Label lbMsg_station; + private System.Windows.Forms.Button bt_find_station; + private System.Windows.Forms.DateTimePicker dtselect_station; + private System.Windows.Forms.FlowLayoutPanel fp_site; + private System.Windows.Forms.Label lbMsg_inv; + private System.Windows.Forms.DateTimePicker dateTimePicker1; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.DateTimePicker dtselect_station1; + private System.Windows.Forms.DateTimePicker dtselect_station2; + private System.Windows.Forms.DataGridView gv_web_inv_day; + private System.Windows.Forms.Panel panel8; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.DataGridView gv_web_inv_month; + private System.Windows.Forms.Panel panel9; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Panel panel10; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.DataGridView gv_web_station_month; + private System.Windows.Forms.Label lbSiteID_inv; + private System.Windows.Forms.Label lbSiteName_inv; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label lbSiteDB_inv; + private System.Windows.Forms.Label lbSiteRaw; + private System.Windows.Forms.Label lbInvRaw; + } +} \ No newline at end of file diff --git a/solarApp/fmMain.cs b/solarApp/fmMain.cs new file mode 100644 index 0000000..5336da0 --- /dev/null +++ b/solarApp/fmMain.cs @@ -0,0 +1,173 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using solarApp.Service; + +namespace solarApp +{ + public partial class fmMain : Form + { + get_inv_svc inv_svc = new get_inv_svc(); + getStationSvc stationSvc = new getStationSvc(); + public fmMain() + { + InitializeComponent(); + // init_GridView(); + } + + private async void button1_Click(object sender, EventArgs e) + { + lbMsg_inv.Text = "loading ... "; + string date1 = dtselect_inv.Value.ToString("yyyy-MM-dd"); + gv_fic_inv_raw.DataSource = inv_svc.Get_rawInv(date1, lbInverterID.Text, lbSiteDB_inv.Text, lbSiteID_inv.Text); + + gv_fic_inv_hour.DataSource = inv_svc.get_Inv_rawAvg(date1, lbInverterID.Text, lbSiteDB_inv.Text, lbSiteID_inv.Text); + + gv_web_inv_hour.DataSource = inv_svc.get_web_Inv_hour(date1, lbInverterID.Text); + + gv_web_inv_day.DataSource = inv_svc.get_web_Inv_day(date1, lbInverterID.Text); + + gv_web_inv_month.DataSource = inv_svc.get_web_Inv_month( date1.Substring(0, 7), lbInverterID.Text); + + lbMsg_inv.Text = " done " + System.DateTime.Now.ToShortTimeString(); + } + + + private void fmMain_Load(object sender, EventArgs e) + { + dtselect_station1.Value = DateTime.Today.AddDays(-7); + dtselect_station2.Value = DateTime.Today.AddDays(-1); + dtselect_inv.Value = DateTime.Today.AddDays(-1); + + // Cursor.Current = Cursors.Default; + + + tabControl1.SelectedTab = tabControl1.TabPages[1]; + + #region 電站清單 + int i = 0; + var site_list = stationSvc.get_station_list(); + foreach (var item in site_list) + { + RadioButton rb = new RadioButton(); + rb.Name = item.SiteID; + rb.Text = item.SiteName; + rb.Tag = item.SiteDB; + rb.Font = new Font(Font.FontFamily, 22); + rb.AutoSize = true; + rb.CheckedChanged += new EventHandler(rb_site_CheckedChanged); + fp_site.Controls.Add(rb); + if (i == 0) rb.Checked = true; + i++; + } + #endregion + + + #region 顯示逆變器list + //add_inv_list(); + #endregion + } + + private void rb_site_CheckedChanged(object sender, EventArgs e) + { + RadioButton rb = sender as RadioButton; + if (rb.Checked) + { + lbSiteDB_inv.Text = rb.Tag.ToString(); + lbSiteName_inv.Text = rb.Text; + lbSiteID_inv.Text = rb.Name; + //顯示 table name on label + lbSiteRaw.Text = lbSiteName_inv.Text + " "+ lbSiteDB_inv.Text + ".s" + lbSiteID_inv.Text + "_Station"; + lbInvRaw.Text = lbSiteName_inv.Text + " " + lbSiteDB_inv.Text + ".s" + lbSiteID_inv.Text + "_Inv"; + add_inv_list(lbSiteDB_inv.Text, lbSiteID_inv.Text.Substring(0, 9)); + } + } + + /// + /// 顯示 Inventer 提供選擇 + /// + /// + /// + void add_inv_list(string siteDB, string siteID) { + fp_inv.Controls.Clear(); + var inv_list = inv_svc.get_Inv_list(siteDB, siteID); + int i = 0; + foreach (var item in inv_list) + { + RadioButton rb = new RadioButton(); + rb.Name = "rb" + item.inverterid; + rb.Text = item.inverterid; + //rb.Dock = DockStyle.Top; + rb.Width = 200; + rb.CheckedChanged += radio_inv_click; + if (i == 0) rb.Checked = true; //預設第一個勾選 + fp_inv.Controls.Add(rb); + i++; + } + } + + + private void radio_inv_click(object sender, EventArgs e) + { + RadioButton rb = sender as RadioButton; + if (rb.Checked) + { + lbInverterID.Text = rb.Text; + lbMsg_inv.Text = "..."; + } + } + + private void gv_fic_inv_hour_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) + { + //int rowindex = e.RowIndex; e.ColumnIndex + if (gv_fic_inv_hour.Rows[e.RowIndex].Cells["count"].Value != null && !string.IsNullOrWhiteSpace(gv_fic_inv_hour.Rows[e.RowIndex].Cells["count"].Value.ToString())) + { + if (gv_fic_inv_hour.Rows[e.RowIndex].Cells["count"].Value.ToString() != "12") + { + gv_fic_inv_hour.Rows[e.RowIndex].Cells["count"].Style = new DataGridViewCellStyle { ForeColor = Color.Red, BackColor = Color.White }; + } + } + //else + //{ + // gv_fic_inv_hour.Rows[e.RowIndex].Cells[e.ColumnIndex].Style = gv_fic_inv_hour.DefaultCellStyle; + //} + } + + + private void dtselect_ValueChanged(object sender, EventArgs e) + { + lbMsg_inv.Text = "..."; + } + + /// + /// 電站 + /// + /// + /// + private void bt_find_station_Click(object sender, EventArgs e) + { + lbMsg_station.Text = "loading ... "; + + string date1 = dtselect_station1.Value.ToString("yyyy-MM-dd"); + string date2 = dtselect_station2.Value.ToString("yyyy-MM-dd"); + + gv_fic_station_raw.DataSource = stationSvc.get_station_raw(date1, lbSiteDB_inv.Text, lbSiteID_inv.Text); + + gv_fic_station_day.DataSource = stationSvc.get_station_rawAvg(date1, date2, lbSiteDB_inv.Text, lbSiteID_inv.Text); + + gv_web_station_hour.DataSource = stationSvc.get_web_station_hour( date1 ); + + gv_web_station_day.DataSource = stationSvc.get_web_station_day(date1, date2); + + gv_web_station_month.DataSource = stationSvc.get_web_station_month(date1.Substring(0, 7), date2.Substring(0, 7)); + + + lbMsg_station.Text = " done " + System.DateTime.Now.ToShortTimeString(); + } + } +} diff --git a/solarApp/fmMain.resx b/solarApp/fmMain.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/solarApp/fmMain.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/solarApp/solarApp.csproj b/solarApp/solarApp.csproj new file mode 100644 index 0000000..3ac3235 --- /dev/null +++ b/solarApp/solarApp.csproj @@ -0,0 +1,14 @@ + + + + WinExe + netcoreapp3.1 + true + + + + + + + + \ No newline at end of file diff --git a/solarApp/solarApp.sln b/solarApp/solarApp.sln new file mode 100644 index 0000000..f35c416 --- /dev/null +++ b/solarApp/solarApp.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31313.79 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "solarApp", "solarApp.csproj", "{1C20C2D4-3303-454C-AB7A-8E670527D3B1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1C20C2D4-3303-454C-AB7A-8E670527D3B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C20C2D4-3303-454C-AB7A-8E670527D3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C20C2D4-3303-454C-AB7A-8E670527D3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C20C2D4-3303-454C-AB7A-8E670527D3B1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FD3EC354-1C59-4048-9617-5D0913EFB0F7} + EndGlobalSection +EndGlobal