1. 逆變器交叉分析bug fix

2. 地圖總覽手機版
3. 電站交叉分析 移除日照、模組溫度
This commit is contained in:
Kai 2021-11-11 18:11:45 +08:00
parent 8d20c0ca54
commit dcca7c4afc
5 changed files with 50 additions and 49 deletions

View File

@ -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<double>();
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<double>();
//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<double>();
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<double>();
//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

View File

@ -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}

View File

@ -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);
}
}
});

View File

@ -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 = [

View File

@ -97,7 +97,7 @@
</div>
<div class="row">
<div class="col-auto" style="width: 60%;">
<div class="col-md-8 col-sm-12">
<div id="panel-1" class="panel">
<div class="panel-hdr">
<h2>電站分佈圖</h2>
@ -111,9 +111,9 @@
</div>
</div>
</div>
<div class="col-auto" style="width: 40%;">
<div class="col-md-4 col-sm-12">
<div class="row">
<div class="col-xl-6">
<div class="col-xl-6 mb-4">
<div class="card">
<div class="card-header bg-fusion-25 py-2 pr-3 d-flex align-items-center flex-wrap">
<h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 電站總數</h4>
@ -125,7 +125,7 @@
</div>
</div>
<div class="col-xl-6">
<div class="col-xl-6 mb-4">
<div class="card">
<div class="card-header bg-fusion-25 py-2 pr-3 d-flex align-items-center flex-wrap">
<h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 總裝置容量</h4>
@ -136,7 +136,7 @@
</div>
</div>
</div>
<div class="col-xl-12 mt-4">
<div class="col-xl-12">
<div id="panel-1" class="panel">
<div class="panel-hdr">
<h2>電站分佈小計</h2>