From ab0aa1ee1d2db27b48d2e678f40f22c5f6a9c393 Mon Sep 17 00:00:00 2001 From: Kai Date: Mon, 16 Aug 2021 16:46:13 +0800 Subject: [PATCH 1/4] =?UTF-8?q?1.=20=E5=A4=A9=E6=B0=A3=20=E5=8A=A0?= =?UTF-8?q?=E5=85=A5try=20catch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Quartz/Jobs/CalcPowerStationJob.cs | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs b/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs index ec69123..c8a016e 100644 --- a/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs +++ b/SolarPower/Quartz/Jobs/CalcPowerStationJob.cs @@ -40,9 +40,11 @@ namespace SolarPower.Quartz.Jobs var DateTimeNow = DateTime.Now; var dateTime = DateTimeNow.AddHours(-1).ToString("yyyy-MM-dd HH"); + Root2 observation = null; + if (this.environment.IsDevelopment()) { - dateTime = "2021-08-09 10"; + dateTime = "2021-08-16 09"; } logger.LogInformation("【CalcPowerStationJob】【任務開始】"); @@ -64,13 +66,23 @@ namespace SolarPower.Quartz.Jobs List weatherObservations = new List(); #region 氣象觀測(取資料) - logger.LogInformation("【CalcPowerStationJob】【開始取得氣象觀測】"); - var client = new HttpClient(); - var UVUri = "https://opendata.cwb.gov.tw/api/v1/rest/datastore/O-A0003-001?Authorization=CWB-EA24220B-DDCC-4188-84E5-AD37A0E03F80&elementName=TIME,TEMP"; - HttpResponseMessage response = client.GetAsync(UVUri).Result; - String jsonUVs = response.Content.ReadAsStringAsync().Result.ToString(); - Root2 observation = JsonConvert.DeserializeObject(jsonUVs); - logger.LogInformation("【CalcPowerStationJob】【取得成功氣象觀測】"); + try + { + logger.LogInformation("【CalcPowerStationJob】【開始取得氣象觀測】"); + var client = new HttpClient(); + var UVUri = "https://opendata.cwb.gov.tw/api/v1/rest/datastore/O-A0003-001?Authorization=CWB-EA24220B-DDCC-4188-84E5-AD37A0E03F80&elementName=TIME,TEMP"; + HttpResponseMessage response = client.GetAsync(UVUri).Result; + String jsonUVs = response.Content.ReadAsStringAsync().Result.ToString(); + observation = JsonConvert.DeserializeObject(jsonUVs); + logger.LogInformation("【CalcPowerStationJob】【取得成功氣象觀測】"); + } + catch (Exception ex) + { + logger.LogError("【CalcPowerStationJob】【取得失敗氣象觀測】"); + logger.LogError("【{0}】{1}", "CalcPowerStationJob", ex.Message); + observation = null; + } + #endregion #region step2. 從電站的DB及電站編號找出該電站的控制器 @@ -195,7 +207,7 @@ namespace SolarPower.Quartz.Jobs #endregion powerStationHistoriesHour.Add(history); - + logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的每小時歷史資料】", powerStation.Code, dateTime); } #endregion @@ -353,7 +365,7 @@ namespace SolarPower.Quartz.Jobs #endregion WeatherObservation weatherObservation = new WeatherObservation(); - if (powerStation.WeathersStationId != null) + if (powerStation.WeathersStationId != null && observation != null) { foreach (var Location in observation.Records.Location) { @@ -363,7 +375,7 @@ namespace SolarPower.Quartz.Jobs calcPowerStation.TodayWeatherTemp = Convert.ToDouble(Location.WeatherElement[0].ElementValue); weatherObservation.PowerStationId = powerStation.Id; weatherObservation.Temp = Convert.ToDouble(Location.WeatherElement[0].ElementValue); - weatherObservation.ObsTime = !string.IsNullOrEmpty(Location.Time.ObsTime)? Convert.ToInt32(Location.Time.ObsTime.Substring(0, 4)) >= 1971 ? Location.Time.ObsTime : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + weatherObservation.ObsTime = !string.IsNullOrEmpty(Location.Time.ObsTime) ? Convert.ToInt32(Location.Time.ObsTime.Substring(0, 4)) >= 1971 ? Location.Time.ObsTime : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); calcPowerStation.WeathersStationId = powerStation.WeathersStationId; break; } @@ -380,8 +392,8 @@ namespace SolarPower.Quartz.Jobs calcPowerStation.RateOfRain = weather.PoP; } - - + + } #endregion @@ -581,7 +593,7 @@ namespace SolarPower.Quartz.Jobs #endregion #region step8. 將 meter INSERT 到 meter_history_hour 資料表 - List memter_history_properties = new List() + List memter_history_properties = new List() { "PowerStationId", "TIMESTAMP", From d04644310bea4bf94724c34cadd0439672122fb7 Mon Sep 17 00:00:00 2001 From: b110212000 Date: Mon, 16 Aug 2021 18:44:49 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=80=86=E8=AE=8A=E5=99=A8=E7=9B=A3?= =?UTF-8?q?=E6=8E=A7(=E5=83=854=E5=80=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/NoticeScheduleController.cs | 3 +- .../Controllers/PowerStationController.cs | 71 +++ SolarPower/Models/PowerStation.cs | 20 + .../Repository/Implement/CompanyRepository.cs | 1 + .../Implement/PowerStationRepository.cs | 27 + .../Interface/IPowerStationRepository.cs | 2 + .../PowerStation/PowerStationEdit.cshtml | 137 ++++- .../Views/PowerStation/_Inverter.cshtml | 546 ++++++++++++++++++ SolarPower/Views/User/Index.cshtml | 4 +- 9 files changed, 807 insertions(+), 4 deletions(-) create mode 100644 SolarPower/Views/PowerStation/_Inverter.cshtml diff --git a/SolarPower/Controllers/NoticeScheduleController.cs b/SolarPower/Controllers/NoticeScheduleController.cs index b5bee75..07f58fc 100644 --- a/SolarPower/Controllers/NoticeScheduleController.cs +++ b/SolarPower/Controllers/NoticeScheduleController.cs @@ -38,7 +38,8 @@ namespace SolarPower.Controllers 0 => "日報表", 1 => "月報表", 2 => "綜合報表", - 3 => "運維", + 3 => "運維通知", + 4 => "異常通知", _ => "" }; a.IsDeliveryName = a.IsDelivery switch diff --git a/SolarPower/Controllers/PowerStationController.cs b/SolarPower/Controllers/PowerStationController.cs index 5b2b420..e10c9c3 100644 --- a/SolarPower/Controllers/PowerStationController.cs +++ b/SolarPower/Controllers/PowerStationController.cs @@ -2775,5 +2775,76 @@ namespace SolarPower.Controllers apiResult.Msg = errorCode.GetString(apiResult.Code); return apiResult; } + + public async Task>> GetInverterInfoList (IdAndDB post) + { + List list = new List(); + ApiResult> apiResult = new ApiResult>(); + try + { + var controllers = await powerStationRepository.GetAllDeviceControllerId(post.Id, post.SiteDB); + if(controllers.Count == 0) + { + apiResult.Code = "0001"; + apiResult.Msg = "該電站沒有控制器"; + return apiResult; + } + var inverters = await powerStationRepository.InverterTable(controllers, post.SiteDB); + if (inverters.Count == 0) + { + apiResult.Code = "0001"; + apiResult.Msg = "該電站沒有啟用的逆變器"; + return apiResult; + } + var inverterIds = inverters.Where(x => x.Enabled == 1 && x.Status == 1).Select(x => x.InverterId).ToList(); + if(inverterIds.Count > 0) + { + var site = "s" + inverterIds[0].Substring(0, 11) + "_inv"; + var inverterss = await powerStationRepository.GetAllInverterInfo(inverterIds, site, post.SiteDB); + foreach(var inverter in inverterss) + { + var info = new InverterInfoList + { + Input = (inverter.DC1W + inverter.DC2W + inverter.DC3W + inverter.DC4W + inverter.DC5W)/1000, + Output = (inverter.AC1W + inverter.AC2W + inverter.AC3W)/1000, + PR = inverter.PR, + TODAYKWH = inverter.TODAYKWH, + Name = inverter.INVERTERName, + ID = inverter.ID, + Type = 1 + }; + + list.Add(info); + } + } + var inverterIdsdd = inverters.Where(x => x.Enabled == 1 && x.Status == 2).Select(x => new { name = x.InverterName , id = x.Id } ).ToList(); + foreach (var inverter in inverterIdsdd) + { + var info = new InverterInfoList + { + Input = 0, + Output = 0, + PR = 0, + TODAYKWH = 0, + Name = inverter.name, + ID = inverter.id, + Type = 2 + }; + list.Add(info); + } + apiResult.Code = "0000"; + apiResult.Data = list; + + } + catch (Exception exception) + { + apiResult.Code = "9999"; + apiResult.Msg = errorCode.GetString(apiResult.Code); + string json = System.Text.Json.JsonSerializer.Serialize(post); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + json); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + } + return apiResult; + } } } diff --git a/SolarPower/Models/PowerStation.cs b/SolarPower/Models/PowerStation.cs index 74c785f..7bdad79 100644 --- a/SolarPower/Models/PowerStation.cs +++ b/SolarPower/Models/PowerStation.cs @@ -687,6 +687,7 @@ namespace SolarPower.Models.PowerStation public string TIMESTAMP { get; set; } public int PowerStationId { get; set; } public string INVERTERID { get; set; } + public string INVERTERName { get; set; } public double Irradiance { get; set; } public double AC1V { get; set; } public double AC1A { get; set; } @@ -740,6 +741,7 @@ namespace SolarPower.Models.PowerStation public double TODAYKWH { get; set; } public double TOTALKWH { get; set; } public double KWHKWP { get; set; } + public int ID { get; set; } } #region 氣象觀測 public class FieldsItem @@ -929,5 +931,23 @@ namespace SolarPower.Models.PowerStation public double INPUT_KWH { get; set; } } + public class InverterInfoList + { + public double Input { get; set; } + public double Output { get; set; } + public double PR { get; set; } + public double TODAYKWH { get; set; } + public string Name { get; set; } + public int ID { get; set; } + public int Type { get; set; } + } + + public class IdAndDB + { + public int Id { get; set; } + public string SiteDB { get; set; } + } + + } diff --git a/SolarPower/Repository/Implement/CompanyRepository.cs b/SolarPower/Repository/Implement/CompanyRepository.cs index e3afe32..6e3771b 100644 --- a/SolarPower/Repository/Implement/CompanyRepository.cs +++ b/SolarPower/Repository/Implement/CompanyRepository.cs @@ -486,6 +486,7 @@ namespace SolarPower.Repository.Implement `InverterId` varchar(50) DEFAULT NULL COMMENT '逆變器UID', `ControllerId` int(10) DEFAULT NULL COMMENT '所屬控制器', `Brand` varchar(50) DEFAULT NULL COMMENT '廠牌', + `BrandNum` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '廠商序號', `Model` varchar(50) DEFAULT NULL COMMENT '型號', `Capacity` double(10,3) DEFAULT NULL COMMENT '裝置容量 kWp', `Pyrheliometer` int(10) DEFAULT NULL COMMENT '日照計設備流水號', diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index 94e5e29..50c1d09 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -5037,5 +5037,32 @@ namespace SolarPower.Repository.Implement return result; } } + + public async Task> GetAllInverterInfo(List post,string site_table, string site_db) + { + List result; + using (IDbConnection conn = this._databaseHelper.GetConnection()) + { + try + { + var sql = @$"SELECT b.*,c.InverterName as INVERTERName,c.ID as ID FROM + ( + SELECT MAX(aa.TIMESTAMP) AS maxtime ,aa.INVERTERID from (SELECT * from {site_db}.{site_table} LIMIT 500) aa GROUP BY INVERTERID + ) a + LEFT JOIN + (SELECT * from {site_db}.{site_table} LIMIT 500) b ON a.maxtime = b.TIMESTAMP AND a.INVERTERID = b.INVERTERID + LEFT JOIN {site_db}.inverter c ON b.INVERTERID = c.InverterId + WHERE b.INVERTERID in @ids + "; + + result = (await conn.QueryAsync(sql, new { ids = post })).ToList(); + } + catch (Exception exception) + { + throw exception; + } + return result; + } + } } } diff --git a/SolarPower/Repository/Interface/IPowerStationRepository.cs b/SolarPower/Repository/Interface/IPowerStationRepository.cs index 6a09846..b82dfef 100644 --- a/SolarPower/Repository/Interface/IPowerStationRepository.cs +++ b/SolarPower/Repository/Interface/IPowerStationRepository.cs @@ -587,5 +587,7 @@ namespace SolarPower.Repository.Interface Task AddAfterPurgeSensorAvgHistory(string startDate, string endDate, byte type, List entity, List properties); Task CheckShowMoney(int userid); Task> GetAllInverterRowData(string date, string table_name); + + Task> GetAllInverterInfo(List post, string site_table, string site_db); } } diff --git a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml index cd0ed05..3a06227 100644 --- a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml +++ b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml @@ -58,6 +58,11 @@ 異常設定 +
@@ -79,6 +84,10 @@
@Html.Partial("_Exception")
+ +
+ @Html.Partial("_Inverter") +
@@ -86,6 +95,8 @@ +
+ @section Scripts{ } \ No newline at end of file diff --git a/SolarPower/Views/PowerStation/_Inverter.cshtml b/SolarPower/Views/PowerStation/_Inverter.cshtml new file mode 100644 index 0000000..e4f4dd0 --- /dev/null +++ b/SolarPower/Views/PowerStation/_Inverter.cshtml @@ -0,0 +1,546 @@ +
+
+
    +
  • +
    +
    + ... +
    +

    新竹巨城站

    +

    +
    +
    +
    +
    +

    發電量

    +

    185 kWh

    +

    27°C

    +
    +
    +

    發電金額

    +

    2,5840 NT

    +

    自建躉售

    +
    +
    +

    Pr值

    +

    90 %

    +

    17:50:36

    +
    +
    +
    + +
    +
    +
      +
    • +
      +
      +

      逆變器 022020001010001 (96.6kWp)

      +

      4分鐘前

      +
      +
      +
      +
      +

      設備狀態

      +

      正常

      +

      詳細資料

      +
      +
      +
      +
      +

      輸出功率

      +

      1.7

      +

      kw

      +
      +
      +
      +
      +

      輸入功率

      +

      1.7

      +

      kw

      +
      +
      +
      +
      + PR + 36.3% +
      +
      +
      +
      +
      +
      +
      +

      日發電量

      +

      83.1

      +

      kWh

      +
      +
      +
      +
      +
        +
      • +
        +
        +

        逆變器 022020001010001 (96.6kWp)

        +

        4分鐘前

        +
        +
        +
        +
        +

        設備狀態

        +

        正常

        +

        詳細資料

        +
        +
        +
        +
        +

        輸出功率

        +

        1.7

        +

        kw

        +
        +
        +
        +
        +

        輸入功率

        +

        1.7

        +

        kw

        +
        +
        +
        +
        + PR + 36.3% +
        +
        +
        +
        +
        +
        +
        +

        日發電量

        +

        83.1

        +

        kWh

        +
        +
        +
        +
        +
      • +
      +
    • +
    • +
      +
      +

      逆變器 022020001010001 (96.6kWp)

      +

      4分鐘前

      +
      +
      +
      +
      +

      設備狀態

      +

      正常

      +

      詳細資料

      +
      +
      +
      +
      +

      輸出功率

      +

      1.7

      +

      kw

      +
      +
      +
      +
      +

      輸入功率

      +

      1.7

      +

      kw

      +
      +
      +
      +
      + PR + 36.3% +
      +
      +
      +
      +
      +
      +
      +

      日發電量

      +

      83.1

      +

      kWh

      +
      +
      +
      +
      +
        +
      • +
        +
        +

        逆變器 022020001010001 (96.6kWp)

        +

        4分鐘前

        +
        +
        +
        +
        +

        設備狀態

        +

        正常

        +

        詳細資料

        +
        +
        +
        +
        +

        輸出功率

        +

        1.7

        +

        kw

        +
        +
        +
        +
        +

        輸入功率

        +

        1.7

        +

        kw

        +
        +
        +
        +
        + PR + 36.3% +
        +
        +
        +
        +
        +
        +
        +

        日發電量

        +

        83.1

        +

        kWh

        +
        +
        +
        +
        +
      • +
      +
    • +
    • +
      +
      +

      逆變器 022020001010001 (96.6kWp)

      +

      4分鐘前

      +
      +
      +
      +
      +

      設備狀態

      +

      正常

      +

      詳細資料

      +
      +
      +
      +
      +

      輸出功率

      +

      1.7

      +

      kw

      +
      +
      +
      +
      +

      輸入功率

      +

      1.7

      +

      kw

      +
      +
      +
      +
      + PR + 36.3% +
      +
      +
      +
      +
      +
      +
      +

      日發電量

      +

      83.1

      +

      kWh

      +
      +
      +
      +
      +
    • +
    • +
      +
      +

      逆變器 022020001010001 (96.6kWp)

      +

      4分鐘前

      +
      +
      +
      +
      +

      設備狀態

      +

      正常

      +

      詳細資料

      +
      +
      +
      +
      +

      輸出功率

      +

      1.7

      +

      kw

      +
      +
      +
      +
      +

      輸入功率

      +

      1.7

      +

      kw

      +
      +
      +
      +
      + PR + 36.3% +
      +
      +
      +
      +
      +
      +
      +

      日發電量

      +

      83.1

      +

      kWh

      +
      +
      +
      +
      +
    • +
    +
  • +
+
+
+ + + + + + \ No newline at end of file diff --git a/SolarPower/Views/User/Index.cshtml b/SolarPower/Views/User/Index.cshtml index 7ac90f3..915d12d 100644 --- a/SolarPower/Views/User/Index.cshtml +++ b/SolarPower/Views/User/Index.cshtml @@ -756,7 +756,7 @@ del_btn.parents("tr").remove(); toast_ok(rel.msg); - + userTable.ajax.reload(); }, 'json'); } }); @@ -834,7 +834,7 @@ }); $("#add-user-manager-station-modal").modal(); - + userTable.ajax.reload(); }, 'json'); } From 54250e64bbf22f92420b71b89784a416ded76d73 Mon Sep 17 00:00:00 2001 From: b110212000 Date: Tue, 17 Aug 2021 12:02:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9C=AA=E6=9C=89=E8=A9=B3=E7=B4=B0?= =?UTF-8?q?=E8=B3=87=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/PowerStationRepository.cs | 4 +- .../PowerStation/PowerStationEdit.cshtml | 112 ++++++++++++++++-- .../Views/PowerStation/_Inverter.cshtml | 4 +- SolarPower/Views/StationOverview/Index.cshtml | 1 + SolarPower/wwwroot/js/workers/workers.js | 10 ++ 5 files changed, 114 insertions(+), 17 deletions(-) create mode 100644 SolarPower/wwwroot/js/workers/workers.js diff --git a/SolarPower/Repository/Implement/PowerStationRepository.cs b/SolarPower/Repository/Implement/PowerStationRepository.cs index 50c1d09..7c69c30 100644 --- a/SolarPower/Repository/Implement/PowerStationRepository.cs +++ b/SolarPower/Repository/Implement/PowerStationRepository.cs @@ -5047,10 +5047,10 @@ namespace SolarPower.Repository.Implement { var sql = @$"SELECT b.*,c.InverterName as INVERTERName,c.ID as ID FROM ( - SELECT MAX(aa.TIMESTAMP) AS maxtime ,aa.INVERTERID from (SELECT * from {site_db}.{site_table} LIMIT 500) aa GROUP BY INVERTERID + SELECT MAX(aa.TIMESTAMP) AS maxtime ,aa.INVERTERID from (SELECT * from {site_db}.{site_table} ORDER BY ID desc LIMIT 1000) aa GROUP BY INVERTERID ) a LEFT JOIN - (SELECT * from {site_db}.{site_table} LIMIT 500) b ON a.maxtime = b.TIMESTAMP AND a.INVERTERID = b.INVERTERID + (SELECT * from {site_db}.{site_table} ORDER BY ID desc LIMIT 1000) b ON a.maxtime = b.TIMESTAMP AND a.INVERTERID = b.INVERTERID LEFT JOIN {site_db}.inverter c ON b.INVERTERID = c.InverterId WHERE b.INVERTERID in @ids "; diff --git a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml index 3a06227..3763f45 100644 --- a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml +++ b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml @@ -43,6 +43,11 @@ 裝置列表 + - +
@@ -73,6 +74,10 @@ @Html.Partial("_DeviceSetting")
+
+ @Html.Partial("_Inverter") +
+
@Html.Partial("_Operation")
@@ -85,9 +90,7 @@ @Html.Partial("_Exception")
-
- @Html.Partial("_Inverter") -
+ @@ -897,6 +900,15 @@ //#endregion GetInverterCard(stationId); + + if (typeof (Worker) !== "undefined") { + var worker = new Worker('../js/workers/workers.js'); + worker.onmessage = function (event) { + if (event.data == "ok") { + GetInverterCard(stationId); + } + } + } }); //#region 代管切換 @@ -2879,8 +2891,9 @@ $("#Invertercard-kwh").html(rel.data.kwh); $("#Invertercard-money").html(rel.data.today_Money); $("#Invertercard-pr").html(rel.data.today_PR); - var str = "
" + + var str = "
" + "
" + $('#prbar').remove(); $("#Invertercard").append(str); var TypeName = ""; switch (rel.data.solarType) { @@ -2924,10 +2937,10 @@ return; } $("#ullist").empty(); - var long = rel.data.length <= 3 ? rel.data.length : 4; + var long = rel.data.length <= 4 ? rel.data.length : 4; for (var a = 0; a < long; a++) { - var str = "
  • "; + var str = "
  • "; str += '
    '; str += '
    '; str += '

    ' + rel.data[a].name + '

    '; @@ -2936,12 +2949,18 @@ str += '
    '; str += '
    '; str += '

    設備狀態

    '; + if (rel.data[a].type == 1) { + str += '

    正常

    '; + } + else { + str += '

    異常

    '; + } - str += '

    正常

    '; + - str += '

    詳細資料

    '; + str += '

    詳細資料

    '; str += '
    '; str += '
    '; str += '
    '; @@ -2981,8 +3000,75 @@ $("#ullist").append(str); } + if (rel.data.length >= 4) + { + for (var a = 4; a < rel.data.length; a++) + { + + + + var str = '
      '; + str += '
      '; + str += '
      '; + str += '

      ' + rel.data[a].name + '

      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '

      設備狀態

      '; + if (rel.data[a].type == 1) { + str += '

      正常

      '; + } + else { + str += '

      異常

      '; + } + + str += '

      詳細資料

      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '

      輸出功率

      '; + str += '

      ' + rel.data[a].output.toFixed(2) + '

      '; + str += '

      kw

      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '

      輸入功率

      '; + str += '

      ' + rel.data[a].input.toFixed(2) + '

      '; + str += '

      kw

      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += 'PR ' + rel.data[a].pr.toFixed(2) + '%'; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '

      日發電量

      '; + str += '

      ' + rel.data[a].todaykwh.toFixed(2) + '

      '; + str += '

      kWh

      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
      '; + str += '
    '; + + $("#li_" + a % 4).append(str); + + } + }; }); } + + function InverterInfoDetail(id) { + $("#inverterdetailmodal").modal(); + } } \ No newline at end of file diff --git a/SolarPower/Views/PowerStation/_Inverter.cshtml b/SolarPower/Views/PowerStation/_Inverter.cshtml index e4f4dd0..907508b 100644 --- a/SolarPower/Views/PowerStation/_Inverter.cshtml +++ b/SolarPower/Views/PowerStation/_Inverter.cshtml @@ -90,7 +90,7 @@

    設備狀態

    正常

    -

    詳細資料

    +

    詳細資料

    @@ -325,7 +325,7 @@
    -