| | |
| | | var list = FunctionList.List.GetDeviceFunctionList(); |
| | | foreach (var function in list) |
| | | { |
| | | |
| | | |
| | | //音乐模块有主从关系,需要特殊处理 |
| | | if (SPK.MusicSpkList().Contains( function.spk)) |
| | | { |
| | | continue; |
| | | //var music = function as Music.A31MusicModel; |
| | | //var music = Music.A31MusicModel.A31MusicModelList.Find((obj) => obj.sid == function.sid); |
| | | //if (music == null) |
| | | //{ |
| | | // continue; |
| | | //} |
| | | //if (music.ServerClientType == -1) |
| | | //{ |
| | | // continue; |
| | | //} |
| | | //else if (music.ServerClientType == 1) |
| | | //{ |
| | | // if (!music.MainPlayCollection) |
| | | // { |
| | | // continue; |
| | | // } |
| | | //} |
| | | //else |
| | | //{ |
| | | // if (!music.collect) |
| | | // { |
| | | // continue; |
| | | // } |
| | | //} |
| | | } |
| | | else |
| | | { |
| | |
| | | }; |
| | | |
| | | |
| | | if (function.spk == SPK.SenesorMegahealth) |
| | | if (function.spk == SPK.SenesorMegahealth || function.spk == SPK.SensorMmvPose) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/HomeIcon/sensormegahealth.png"; |
| | | btnIcon.SelectedImagePath = "FunctionIcon/Icon/HomeIcon/sensormegahealth.png"; |
| | |
| | | |
| | | } |
| | | |
| | | else if (function.spk == SPK.SenesorMegahealth) |
| | | else if (function.spk == SPK.SenesorMegahealth || function.spk == SPK.SensorMmvPose) |
| | | { |
| | | //btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}.png"; |
| | | //btnIcon.SelectedImagePath = "FunctionIcon/Icon/HomeIcon/sensormegahealth.png"; |
| | |
| | | }; |
| | | |
| | | |
| | | Button btnAcstPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(115), |
| | | Y = Application.GetRealHeight(70), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on", |
| | | }; |
| | | view.AddChidren(btnAcstPower); |
| | | btnAcstPower.MouseUpEventHandler = (sender, e) => { |
| | | btnAcstPower.IsSelected = !btnAcstPower.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | string onoff = btnAcstPower.IsSelected ? "on" : "off"; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, onoff); |
| | | foreach (var temp in FunctionList.List.GetAcstParentList()) |
| | | { |
| | | Control.Ins.SendWriteCommand(temp, d); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | //Button btnAcstPower = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(115), |
| | | // Y = Application.GetRealHeight(70), |
| | | // Width = Application.GetRealWidth(32), |
| | | // Height = Application.GetRealWidth(32), |
| | | // SelectedImagePath = "Public/PowerOpen.png", |
| | | // UnSelectedImagePath = "Public/PowerClose.png", |
| | | // IsSelected = function.trait_on_off.curValue.ToString() == "on", |
| | | //}; |
| | | //view.AddChidren(btnAcstPower); |
| | | //btnAcstPower.MouseUpEventHandler = (sender, e) => { |
| | | // btnAcstPower.IsSelected = !btnAcstPower.IsSelected; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // string onoff = btnAcstPower.IsSelected ? "on" : "off"; |
| | | // Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.OnOff, onoff); |
| | | // foreach (var temp in FunctionList.List.GetAcstParentList()) |
| | | // { |
| | | // Control.Ins.SendWriteCommand(temp, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | |
| | | |
| | | |