diff --git a/SolarPower/Controllers/AnalysisStationInfoController.cs b/SolarPower/Controllers/AnalysisStationInfoController.cs index 06a9ea5..bf7831f 100644 --- a/SolarPower/Controllers/AnalysisStationInfoController.cs +++ b/SolarPower/Controllers/AnalysisStationInfoController.cs @@ -217,24 +217,24 @@ namespace SolarPower.Controllers var temp_item = item.OrderBy(x => x.Timestamp).ToList(); - DeviceHistoryInfo Irradiance = new DeviceHistoryInfo(); - Irradiance.Name = string.Format("{0}:{1}", powerStation.Name, analysisDevice.MultipleYaxes["Irradiance"]); - Irradiance.YaxesKey = "Irradiance"; - Irradiance.Values = new List(); - foreach (var xa in XAxis) - { - var history = temp_item.Where(x => xa == x.Timestamp).FirstOrDefault(); + //DeviceHistoryInfo Irradiance = new DeviceHistoryInfo(); + //Irradiance.Name = string.Format("{0}:{1}", powerStation.Name, analysisDevice.MultipleYaxes["Irradiance"]); + //Irradiance.YaxesKey = "Irradiance"; + //Irradiance.Values = new List(); + //foreach (var xa in XAxis) + //{ + // var history = temp_item.Where(x => xa == x.Timestamp).FirstOrDefault(); - if (history != null) - { - Irradiance.Values.Add(history.Irradiance); - } - else - { - Irradiance.Values.Add(0); - } - } - analysisDevice.Series.Add(Irradiance); + // if (history != null) + // { + // Irradiance.Values.Add(history.Irradiance); + // } + // else + // { + // Irradiance.Values.Add(0); + // } + //} + //analysisDevice.Series.Add(Irradiance); DeviceHistoryInfo KWH = new DeviceHistoryInfo(); KWH.Name = string.Format("{0}:{1}", powerStation.Name, analysisDevice.MultipleYaxes["KWH"]); @@ -312,24 +312,24 @@ namespace SolarPower.Controllers } analysisDevice.Series.Add(PR); - DeviceHistoryInfo modelTemperature = new DeviceHistoryInfo(); - modelTemperature.Name = string.Format("{0}:{1}", powerStation.Name, analysisDevice.MultipleYaxes["Temperature"]); - modelTemperature.YaxesKey = "Temperature"; - modelTemperature.Values = new List(); - foreach (var xa in XAxis) - { - var history = temp_item.Where(x => xa == x.Timestamp).FirstOrDefault(); + //DeviceHistoryInfo modelTemperature = new DeviceHistoryInfo(); + //modelTemperature.Name = string.Format("{0}:{1}", powerStation.Name, analysisDevice.MultipleYaxes["Temperature"]); + //modelTemperature.YaxesKey = "Temperature"; + //modelTemperature.Values = new List(); + //foreach (var xa in XAxis) + //{ + // var history = temp_item.Where(x => xa == x.Timestamp).FirstOrDefault(); - if (history != null) - { - modelTemperature.Values.Add(Math.Round(history.Temperature, 2)); - } - else - { - modelTemperature.Values.Add(0); - } - } - analysisDevice.Series.Add(modelTemperature); + // if (history != null) + // { + // modelTemperature.Values.Add(Math.Round(history.Temperature, 2)); + // } + // else + // { + // modelTemperature.Values.Add(0); + // } + //} + //analysisDevice.Series.Add(modelTemperature); } } #endregion diff --git a/SolarPower/Repository/Implement/StationReportRepository.cs b/SolarPower/Repository/Implement/StationReportRepository.cs index 00adb1f..392de79 100644 --- a/SolarPower/Repository/Implement/StationReportRepository.cs +++ b/SolarPower/Repository/Implement/StationReportRepository.cs @@ -80,10 +80,10 @@ namespace SolarPower.Repository.Implement ) c on a.powerStationid = c.powerStationid and DATE_FORMAT(a.`TIMESTAMP`,''%Y-%m-%d'') = c.report_date left join ( - select powerStationID, DATE_FORMAT(TIMESTAMP,''%Y-%m-%d %H:%i'')report_date, irradiance, Temperature + select powerStationID, DATE_FORMAT(TIMESTAMP,''%Y-%m-%d %H:00'')report_date, irradiance, Temperature from sensor_history_hour where powerstationid = {post.PowerStation} and DATE_FORMAT(`TIMESTAMP`,''%Y-%m-%d'') = ''{post.Time}'' - ) d on a.powerStationid = d.powerStationid and DATE_FORMAT(a.TIMESTAMP,''%Y-%m-%d %H:%i'') = d.report_date + ) d on a.powerStationid = d.powerStationid and DATE_FORMAT(a.TIMESTAMP,''%Y-%m-%d %H:00'') = d.report_date join ( select id, name stationName, powerRate from power_station where id = {post.PowerStation} diff --git a/SolarPower/Views/AnalysisInverter/Index.cshtml b/SolarPower/Views/AnalysisInverter/Index.cshtml index cc4e6a2..efb5c7e 100644 --- a/SolarPower/Views/AnalysisInverter/Index.cshtml +++ b/SolarPower/Views/AnalysisInverter/Index.cshtml @@ -388,15 +388,16 @@ }); $('#js_list_accordion').on("change", 'input[name="selectedInverterId[]"]', function (event) { + var powerStationId = $(this).attr('data-power-station-id'); + if (this.checked) { - if ($.inArray(this.value, selected_inverter) < 0) { - var powerStationId = $(this).attr('data-power-station-id'); - selected_inverter.push({ powerStationId: powerStationId, InverterId: this.value }); + if ($.map(selected_inverter, function (item, index) { return item.InverterId }).indexOf(this.value) < 0) { + selected_inverter.push({ 'powerStationId': powerStationId, 'InverterId': this.value }); } } else { - if ($.inArray(this.value, selected_inverter) > -1) { - var powerStationId = $(this).attr('data-power-station-id'); - selected_inverter.splice($.inArray({ powerStationId: powerStationId, InverterId: this.value }, selected_inverter), 1); + var result = $.map(selected_inverter, function (item, index) { return item.InverterId }).indexOf(this.value) + if (result > -1) { + selected_inverter.splice(result, 1); } } }); diff --git a/SolarPower/Views/AnalysisStationInfo/Index.cshtml b/SolarPower/Views/AnalysisStationInfo/Index.cshtml index d473a10..2a4cd73 100644 --- a/SolarPower/Views/AnalysisStationInfo/Index.cshtml +++ b/SolarPower/Views/AnalysisStationInfo/Index.cshtml @@ -123,10 +123,10 @@ var selected_device = []; var PWS_compare_col = [ { key: "KWH", title: "發電量", default: true }, - { key: "Irradiance", title: "日照度", default: false }, + @*{ key: "Irradiance", title: "日照度", default: false },*@ { key: "KWHKWP", title: "有效日照時數", default: false }, { key: "PR", title: "PR %", default: false }, - { key: "Temperature", title: "模組溫度", default: false }, + @*{ key: "Temperature", title: "模組溫度", default: false },*@ { key: "SolarHour", title: "日照小時", default: false }, ] var PWR_compare_col = [ diff --git a/SolarPower/Views/MapOverview/Index.cshtml b/SolarPower/Views/MapOverview/Index.cshtml index 3af9f0e..4f33c0e 100644 --- a/SolarPower/Views/MapOverview/Index.cshtml +++ b/SolarPower/Views/MapOverview/Index.cshtml @@ -97,7 +97,7 @@
-
+

電站分佈圖

@@ -111,9 +111,9 @@
-
+
-
+

電站總數

@@ -125,7 +125,7 @@
-
+

總裝置容量

@@ -136,7 +136,7 @@
-
+

電站分佈小計