wjc
2022-06-13 32ad85a377b00bc54ad7f15a45d7631d3e2b10d5
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -133,13 +133,145 @@
                        TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                        Tag = "AlarmStatus"
                    };
                    if(alarmStatusAttr.state == "alarm")
                    if (alarmStatusAttr.state == "alarm")
                    {
                        btnAlarmStatus.TextID = StringId.InAlarm;
                        btnAlarmStatus.TextColor = CSS_Color.WarningColor;
                    }
                    else
                    {
                        btnAlarmStatus.TextID = StringId.zhengchang;
                        btnAlarmStatus.TextColor = CSS_Color.MainColor;
                    }
                    bodyDiv.AddChidren(btnAlarmStatus);
                }
                //var tipScrView1 = new HorizontalScrolViewLayout() {
                //    X = Application.GetRealWidth(10),
                //    Y =  Application.GetRealHeight(56),
                //    Height = Application.GetRealHeight(20),
                //    Width = Application.GetRealWidth(330),
                //    BackgroundColor = 0x22220022,
                //};
                //var tipScrView2 = new HorizontalScrolViewLayout()
                //{
                //    X = Application.GetRealWidth(10),
                //    Y = Application.GetRealHeight(83),
                //    Height = Application.GetRealHeight(20),
                //    Width = Application.GetRealWidth(330),
                //    BackgroundColor = 0x22220022,
                //};
                foreach (var target in function.targetSids)
                {
                    //bodyDiv.AddChidren(tipScrView1);
                    //bodyDiv.AddChidren(tipScrView2);
                    var targetObj = FunctionList.List.Functions.Find((obj) => target == obj.sid);
                    if(targetObj == null)
                    {
                        continue;
                    }
                    if (SPK.AcSpkList().Contains(targetObj.spk))
                    {
                        bodyDiv.Height = Application.GetRealHeight(126);
                        AC acDevice = new AC();
                        var btnAcMode = new Button()
                        {
                            X = Application.GetRealWidth(10),
                            Y = Application.GetRealHeight(56),
                            Width = Application.GetRealWidth(62),
                            Height = Application.GetRealHeight(19),
                            BackgroundColor = 0x334484F4,
                            TextAlignment = TextAlignment.Center,
                            TextSize = 10,
                            TextColor = 0xFF4484F4,
                            Text = Language.StringByID(StringId.AC) + acDevice.GetModeAttrText(targetObj.GetAttrState(FunctionAttributeKey.Mode)),
                            Tag = target + "screen.panel.ac.mode",
                            Radius = (uint)Application.GetRealWidth(4),
                        };
                        bodyDiv.AddChidren(btnAcMode);
                        //tipScrView1.AddChidren(new Button() { Width = Application.GetRealWidth(16)});
                        var btnAcTemp = new Button()
                        {
                            X = Application.GetRealWidth(10 + 72),
                            Y = Application.GetRealHeight(56),
                            Width = Application.GetRealWidth(62),
                            Height = Application.GetRealHeight(19),
                            BackgroundColor = 0x334484F4,
                            TextAlignment = TextAlignment.Center,
                            TextSize = 10,
                            TextColor = 0xFF4484F4,
                            Text = Language.StringByID(StringId.AC) + targetObj.GetAttrState(FunctionAttributeKey.Temperature) + "°C",
                            Radius = (uint)Application.GetRealWidth(4),
                            Tag = target + "screen.panel.ac.temp"
                        };
                        bodyDiv.AddChidren(btnAcTemp);
                        //tipScrView1.AddChidren(new Button() { Width = Application.GetRealWidth(6) });
                    }
                    else if (SPK.FhSpkList().Contains(targetObj.spk))
                    {
                        FloorHeating fhDevice = new FloorHeating();
                        var btnFhMode = new Button()
                        {
                            X = Application.GetRealWidth(10 + 72*2),
                            Y = Application.GetRealHeight(56),
                            Radius = (uint)Application.GetRealWidth(4),
                            Width = Application.GetRealWidth(62),
                            Height = Application.GetRealHeight(19),
                            BackgroundColor = 0x33ff9d54,
                            TextAlignment = TextAlignment.Center,
                            TextSize = 10,
                            TextColor = 0xFFff9d54,
                            Text = Language.StringByID(StringId.FloorHeating) + fhDevice.GetModeAttrText(targetObj.GetAttrState(FunctionAttributeKey.Mode)),
                            Tag = target + "screen.panel.fh.mode"
                        };
                        bodyDiv.AddChidren(btnFhMode);
                        //tipScrView1.AddChidren(new Button() { Width = Application.GetRealWidth(6) });
                        var btnFhTemp = new Button()
                        {
                            X = Application.GetRealWidth(10 + 72 * 3),
                            Y = Application.GetRealHeight(56),
                            Radius = (uint)Application.GetRealWidth(4),
                            Width = Application.GetRealWidth(62),
                            Height = Application.GetRealHeight(19),
                            BackgroundColor = 0x33ff9d54,
                            TextAlignment = TextAlignment.Center,
                            TextSize = 10,
                            TextColor = 0xFFff9d54,
                            Text = Language.StringByID(StringId.FloorHeating) + targetObj.GetAttrState(FunctionAttributeKey.Temperature) + "°C",
                            Tag = target + "screen.panel.fh.temp"
                        };
                        bodyDiv.AddChidren(btnFhTemp);
                        //tipScrView1.AddChidren(new Button() { Width = Application.GetRealWidth(6) });
                    }
                    else if (SPK.AirFreshSpkList().Contains(targetObj.spk))
                    {
                        AC acDevice = new AC();
                        var btnAirFreshFanSpeed = new Button()
                        {
                            X = Application.GetRealWidth(10),
                            Y = Application.GetRealHeight(83),
                            Width = Application.GetRealWidth(62),
                            Height = Application.GetRealHeight(19),
                            BackgroundColor = 0x3309bb07,
                            TextAlignment = TextAlignment.Center,
                            TextSize = 10,
                            TextColor = 0xFF09bb07,
                            Radius = (uint)Application.GetRealWidth(4),
                            Text = Language.StringByID(StringId.AirFresh) + acDevice.GetFanAttrText(targetObj.GetAttrState(FunctionAttributeKey.FanSpeed)),
                            Tag = target + "screen.panel.airFresh.mode"
                        };
                        bodyDiv.AddChidren(btnAirFreshFanSpeed);
                    }
                }
            }
            else
            {