Example #1
0
        public void InitData()
        {
            Label一网.Text      = mGetParaValue.Num一次网.ToString();
            Label一网.ForeColor = BoolIsNormalConverter(!mGetParaValue.Alarm一次网);

            Label二网高区.Text      = mGetParaValue.Num二次高区.ToString();
            Label二网高区.ForeColor = BoolIsNormalConverter(!mGetParaValue.Alarm二次高区);

            Label二网中区.Text      = mGetParaValue.Num二次中区.ToString();
            Label二网中区.ForeColor = BoolIsNormalConverter(!mGetParaValue.Alarm二次中区);

            Label二网低区.Text      = mGetParaValue.Num二次低区.ToString();
            Label二网低区.ForeColor = BoolIsNormalConverter(!mGetParaValue.Alarm二次低区);

            Label水箱.Text      = mGetParaValue.Num水箱.ToString();
            Label水箱.ForeColor = BoolIsErrorConverter(mGetParaValue.Alarm水箱);

            Label总调节阀.Text = mGetParaValue.Num总调节阀.ToString();

            Label热量流量表.Text = mGetParaValue.Num热量流量表1.ToString();

            Label泵0.Text      = mGetParaValue.GetNum变频控制Para(1).ToString();
            Label泵0.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(1));

            Label泵1.Text      = mGetParaValue.GetNum变频控制Para(2).ToString();
            Label泵1.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(2));
            Label泵2.Text      = mGetParaValue.GetNum变频控制Para(3).ToString();
            Label泵2.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(3));
            Label泵3.Text      = mGetParaValue.GetNum变频控制Para(4).ToString();
            Label泵3.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(4));
            Label泵4.Text      = mGetParaValue.GetNum变频控制Para(5).ToString();
            Label泵4.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(5));
            Label泵5.Text      = mGetParaValue.GetNum变频控制Para(6).ToString();
            Label泵5.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(6));
            Label泵6.Text      = mGetParaValue.GetNum变频控制Para(7).ToString();
            Label泵6.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(7));
            Label泵7.Text      = mGetParaValue.GetNum变频控制Para(8).ToString();
            Label泵7.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(8));
            Label泵8.Text      = mGetParaValue.GetNum变频控制Para(9).ToString();
            Label泵8.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(9));
            Label泵9.Text      = mGetParaValue.GetNum变频控制Para(10).ToString();
            Label泵9.ForeColor = BoolIsErrorConverter(mGetParaValue.GeAlarm变频控制Para(10));
        }
Example #2
0
        public async override Task InitializeAsync()
        {
            if (IsInitialize == true)
            {
                return;
            }
            await Task.Delay(100);

            await Task.Run(async() => {
                var getParaValue = new GetParaValue(StationCode, GatherData, GatherError);
                #region 一次网
                if (StationCodes[Index].Exist一次网() == true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "一次网参数",
                        ParaValue = getParaValue.Num一次网,
                        Id        = "Area1",
                        TextColor = (Color) new BoolToWarningColorConverter().
                                    BoolConvert(getParaValue.Alarm一次网)
                    });
                }
                #endregion
                #region 二次低区
                if (StationCodes[Index].Exist二次低区() == true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "二次低区参数",
                        ParaValue = getParaValue.Num二次低区,
                        Id        = "Area2",
                        TextColor = (Color) new BoolToWarningColorConverter().
                                    BoolConvert(getParaValue.Alarm二次低区)
                    });
                }
                #endregion
                #region 二次中区
                if (StationCodes[Index].Exist二次中区() == true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "二次中区参数",
                        ParaValue = getParaValue.Num二次中区,
                        Id        = "Area3",
                        TextColor = (Color) new BoolToWarningColorConverter().
                                    BoolConvert(getParaValue.Alarm二次中区)
                    });
                }
                #endregion
                #region 二次高区
                if (StationCodes[Index].Exist二次高区() == true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "二次高区参数",
                        ParaValue = getParaValue.Num二次高区,
                        Id        = "Area4",
                        TextColor = (Color) new BoolToWarningColorConverter().
                                    BoolConvert(getParaValue.Alarm二次高区)
                    });
                }
                #endregion
                #region 水箱
                if (StationCodes[Index].Exist水箱() == true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "水箱参数",
                        ParaValue = getParaValue.Num水箱,
                        TextColor = (Color) new BoolToWarningColorConverter().
                                    BoolConvert(getParaValue.Alarm水箱)
                    });
                }
                #endregion
                #region 补水压力设备
                if (false)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "补水压力设备参数",
                        ParaValue = getParaValue.Num补水压力设备
                    });
                }
                #endregion
                #region 总调节阀
                if (true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "总调节阀参数",
                        ParaValue = getParaValue.Num总调节阀
                    });
                }
                #endregion
                #region 热量流量表
                if (StationCodes[Index].Exist热量流量表(1) == true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "热量流量表1参数",
                        ParaValue = getParaValue.Num热量流量表1
                    });
                }
                if (StationCodes[Index].Exist热量流量表(2) == true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "热量流量表2参数",
                        ParaValue = getParaValue.Num热量流量表2
                    });
                }
                #endregion
                #region 入出口温度参数
                if (StationCodes[Index].Exist入出口温度(1) == true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "入出口温度1参数",
                        ParaValue = getParaValue.Num入出口温度1
                    });
                }
                if (StationCodes[Index].Exist入出口温度(2) == true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "入出口温度2参数",
                        ParaValue = getParaValue.Num入出口温度2
                    });
                }
                #endregion
                #region 变频控制1-6
                for (int i = 1; i <= 6; ++i)
                {
                    if (StationCodes[Index].Exist变频控制(i))
                    {
                        await AddItemAsync(new ItemStationDetail()
                        {
                            ParaName  = $"变频控制{i}参数",
                            ParaValue = getParaValue.GetNum变频控制Para(i),
                            Id        = $"FC{i}",
                            TextColor = (Color) new BoolToWarningColorConverter().
                                        BoolConvert(getParaValue.GeAlarm变频控制Para(i))
                        });
                    }
                }
                #endregion
                #region 变频控制7-10
                for (int i = 7; i <= 10; ++i)
                {
                    if (StationCodes[Index].Exist变频控制(i))
                    {
                        await AddItemAsync(new ItemStationDetail()
                        {
                            ParaName  = $"变频控制{i}参数",
                            ParaValue = getParaValue.GetNum变频控制Para(i),
                            Id        = $"FC{i}",
                            TextColor = (Color) new BoolToWarningColorConverter().
                                        BoolConvert(getParaValue.GeAlarm变频控制Para(i))
                        });
                    }
                }
                #endregion
                #region 错误标志
                if (true)
                {
                    await AddItemAsync(new ItemStationDetail()
                    {
                        ParaName  = "错误标志参数",
                        ParaValue = getParaValue.Num错误标志
                    });
                }
                #endregion
            });

            IsInitialize = true;
        }