123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using IntelligentControlForsx.Service.Control.FormInfo;
- namespace IntelligentControlForsx.MyControls
- {
- public partial class ControlFormTop : UserControl
- {
- public ControlFormTop()
- {
- InitializeComponent();
- }
- public void BindStationInfo(StatInfo info)
- {
- lblZFDL.Text = info.PowerAll != null ? info.PowerAll.Value.ToString("f2") : "";
- lblNFDL.Text = info.PowerByYear != null ? info.PowerByYear.Value.ToString("f2") : "";
- lblYFDL.Text = info.PowerByMonth != null ? info.PowerByMonth.Value.ToString("f2") : "0";
- lblRFDL.Text = info.PowerByDay != null ? info.PowerByDay.Value.ToString("f2") : "";
- lblPower.Text = info.Power.HasValue ? info.Power.Value.ToString("f2") : "0";
- lblWindSpeed.Text = info.Speed.HasValue ? info.Speed.Value.ToString("f2") : "0";
- lblAllCount.Text = info.LinkCount.HasValue ? "接入 " + info.LinkCount.Value.ToString() : "0";
- lblOnlineCount.Text = info.OnlineCount.HasValue ? "并网 " + info.OnlineCount.Value.ToString() : "0";
- lblStandbyCount.Text = info.StandByCount.HasValue ? "待机 " + info.StandByCount.Value.ToString() : "0";
- lblFaultCount.Text = info.FaultCount.HasValue ? "故障 " + info.FaultCount.ToString() : "0";
- lblMaintainCount.Text = info.MaintainCount.HasValue ? "维护 " + info.MaintainCount.Value.ToString() : "0";
- lblOfflineCount.Text = info.OfflineCount.HasValue ? "离线 " + info.OfflineCount.Value.ToString() : "0";
- lblStartCount.Text = info.StartCount.HasValue ? "启动 " + info.StartCount.Value.ToString() : "0";
- lblStopCount.Text = info.StopCount.HasValue ? "停机 " + info.StopCount.ToString() : "0";
- lblOnPowerCount.Text = info.OnPowerCount.HasValue ? "上电 " + info.OnPowerCount.ToString() : "0";
- string stationName = "";
- switch (info.StationId)
- {
- case "NSS_FDC":
- stationName = "牛首山风电场";
- break;
- case "XS_FDC":
- stationName = "香山风电场";
- break;
- case "SBQ_FDC":
- stationName = "石板泉风电场";
- break;
- case "MHS_FDC":
- stationName = "麻黄山风电场";
- break;
- case "QS_FDC":
- stationName = "青山风电场";
- break;
- case "0":
- stationName = "石板泉风电场";
- break;
- }
- lblStationName.Text = stationName;
- }
- public void BindAllStationInfo(StatInfo info)
- {
- if (info != null)
- {
-
- lblAllPowerCount.Text = info.PowerAll.HasValue ? info.PowerAll.Value.ToString("f2") : "0";
- lblAllPowerByYear.Text = info.PowerByYear.HasValue ? info.PowerByYear.Value.ToString("f2") : "0";
- lblAllPowerByMonth.Text = info.PowerByMonth != null ? info.PowerByMonth.Value.ToString("f2") : "0";
- lblAllPowerByDay.Text = info.PowerByDay.HasValue ? info.PowerByDay.Value.ToString("f2") : "0";
- lblAllPower.Text = info.Power.HasValue ? info.Power.Value.ToString("f2") : "0";
- lblAllSpeed.Text = info.Speed.HasValue ? info.Speed.Value.ToString("f2") : "0";
- // lblAllLink.Text = "接入:"+info.LinkCount.ToString();
- string run = info.OnlineCount.HasValue ? info.OnlineCount.Value.ToString() : "0";
- string standBy = info.StandByCount.HasValue ? info.StandByCount.Value.ToString() : "0";
- string fault = info.FaultCount.HasValue ? info.FaultCount.Value.ToString() : "0";
- string maintain = info.MaintainCount.HasValue ? info.MaintainCount.Value.ToString() : "0";
- string offline = info.OfflineCount.HasValue ? info.OfflineCount.Value.ToString() : "0";
- string start = info.StartCount.HasValue ? info.StartCount.Value.ToString() : "0";
- string stop = info.StopCount.HasValue ? info.StopCount.Value.ToString() : "0";
- string onPower = info.OnPowerCount.HasValue ? info.OnPowerCount.Value.ToString() : "0";
- lblAllRun.Text = "运行:" + run;
- lblAllStandby.Text = "待机:" + standBy;
- lblAllFault.Text = "故障:" + fault;
- lblAllMaintain.Text = "维护:" + maintain;
- lblAllOffline.Text = "离线:" + offline;
- lblAllStart.Text = "启动:" + start;
- lblAllStop.Text = "停机:" + stop;
- lblAllOnPower.Text = "上电:" + onPower;
- }
- }
- }
- }
|