wxr
2021-06-09 cb6e11c5067ecaba4d8f9907989154167c1e8943
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
@@ -148,6 +148,7 @@
            };
            fLayout.AddChidren(succeedBtn);
            #endregion
            #region 点击事件
            //表示库列表索引值(目前只20个库)
            int index = 1; 
@@ -176,14 +177,13 @@
                code = 1;
                GetBtnText(testBtn, code, spk);
            };
            //测试Text
            testBtn.MouseUpEventHandler += (sender, e) =>
            {
                var library = libraryList[index - 1];
                var control = GetControl(spk, testBtn.TextID, library);
                //发送测试码命令
                Method.ThreadSend(control, (responsePackNew) => { }, "库码测试", "frame", this, null);
                PirMethod.ThreadSend(control, (responsePackNew) => { }, "库码测试", "frame", this, null);
                if (code == 3) {
                    //标记最后那个码
                    if_bool = true;
@@ -216,7 +216,20 @@
                {
                    var library = libraryList[index-1];
                    var control = GetControl(spk, testBtn.TextID, library);
                    Method method = new Method();
                    if (spk == SPK.TvIr)
                    {
                        //备注:伟南要求小米电视换掉spk=ir.tvxm(听说是临时解决方案)
                        var brand = brandList.Find((c) => c.id == library.brandId);
                        if (brand != null)
                        {
                            if (brand.brandName.Contains("小米") || brand.brandName.Contains("Xiaomi"))
                            {
                                //更换spk
                                control.spk = "ir.tvxm";
                            }
                        }
                    }
                    PirMethod method = new PirMethod();
                    //发送库添加遥控器命令
                    method.ThreadAddControl(control, this, (device) =>  
                    {
@@ -295,6 +308,136 @@
                        }
                    }
                    break;
                case SPK.FanIr:
                    {
                        switch (textInt)
                        {
                            case StringId.dianyuan:
                                {
                                    key = "on_off";
                                    value = "on";
                                }
                                break;
                            case StringId.zhongsu:
                                {
                                    key = "middle";
                                    value = "";
                                }
                                break;
                            case StringId.yaotou:
                                {
                                    key = "swing";
                                    value = "";
                                }
                                break;
                        }
                    }
                    break;
                case SPK.PjtIr:
                    {
                        switch (textInt)
                        {
                            case StringId.dianyuan:
                                {
                                    key = "on_off";
                                    value = "on";
                                }
                                break;
                            case StringId.yinliangjia:
                                {
                                    key = "volume+";
                                    value = "";
                                }
                                break;
                            case StringId.yinliangjian:
                                {
                                    key = "volume-";
                                    value = "";
                                }
                                break;
                        }
                    }
                    break;
                case SPK.StbIr:
                    {
                        switch (textInt)
                        {
                            case StringId.dianyuan:
                                {
                                    key = "on_off";
                                    value = "on";
                                }
                                break;
                            case StringId.yinliangjia:
                                {
                                    key = "volume+";
                                    value = "";
                                }
                                break;
                            case StringId.yinliangjian:
                                {
                                    key = "volume-";
                                    value = "";
                                }
                                break;
                        }
                    }
                    break;
                case SPK.DvDIr:
                    {
                    }
                    break;
                case SPK.PurifierIr:
                    {
                        switch (textInt)
                        {
                            case StringId.dianyuan:
                                {
                                    key = "on_off";
                                    value = "on";
                                }
                                break;
                            case StringId.zidong:
                                {
                                    key = "auto";
                                    value = "";
                                }
                                break;
                            case StringId.jingyin:
                                {
                                    key = "mute";
                                    value = "0";
                                }
                                break;
                        }
                    }
                    break;
                case SPK.HeaterIr:
                    {
                        switch (textInt)
                        {
                            case StringId.dianyuan:
                                {
                                    key = "on_off";
                                    value = "on";
                                }
                                break;
                            case StringId.wendujia:
                                {
                                    key = "temp+";
                                    value = "";
                                }
                                break;
                            case StringId.wendujian:
                                {
                                    key = "temp-";
                                    value = "";
                                }
                                break;
                        }
                    }
                    break;
            }
            AttributesStatus buttonObj = new AttributesStatus();
            buttonObj.key = key;
@@ -373,6 +516,121 @@
                        }
                    }
                    break;
                case SPK.FanIr:
                    {
                        switch (code)
                        {
                            case 1:
                                {
                                    textValue = StringId.dianyuan;
                                }
                                break;
                            case 2:
                                {
                                    textValue = StringId.zhongsu;
                                }
                                break;
                            case 3:
                                {
                                    textValue = StringId.yaotou;
                                }
                                break;
                        }
                    }
                    break;
                case SPK.PjtIr:
                    {
                        switch (code)
                        {
                            case 1:
                                {
                                    textValue = StringId.dianyuan;
                                }
                                break;
                            case 2:
                                {
                                    textValue = StringId.yinliangjia;
                                }
                                break;
                            case 3:
                                {
                                    textValue = StringId.yinliangjian;
                                }
                                break;
                        }
                    }
                    break;
                case SPK.StbIr:
                    {
                        switch (code)
                        {
                            case 1:
                                {
                                    textValue = StringId.dianyuan;
                                }
                                break;
                            case 2:
                                {
                                    textValue = StringId.yinliangjia;
                                }
                                break;
                            case 3:
                                {
                                    textValue = StringId.yinliangjian;
                                }
                                break;
                        }
                    }
                    break;
                case SPK.DvDIr:
                    {
                    }
                    break;
                case SPK.PurifierIr:
                    {
                        switch (code)
                        {
                            case 1:
                                {
                                    textValue = StringId.dianyuan;
                                }
                                break;
                            case 2:
                                {
                                    textValue = StringId.zidong;
                                }
                                break;
                            case 3:
                                {
                                    textValue = StringId.jingyin;
                                }
                                break;
                        }
                    }
                    break;
                case SPK.HeaterIr:
                    {
                        switch (code)
                        {
                            case 1:
                                {
                                    textValue = StringId.dianyuan;
                                }
                                break;
                            case 2:
                                {
                                    textValue = StringId.wendujia;
                                }
                                break;
                            case 3:
                                {
                                    textValue = StringId.wendujian;
                                }
                                break;
                        }
                    }
                    break;
            }
            testBtn.TextID = textValue;
        }