using System; using System.Collections.Generic; using Shared.Common; namespace Shared.Phone.UserCenter.SmartSound { public class SmartSoundControlForm : EditorCommonForm { private SmartSound mSmartSound; public SmartSoundControlForm() { } /// /// 画面显示(底层会固定调用此方法,借以完成画面创建) /// public void ShowForm() { // iniData();//先加载模拟数据 this.ScrollEnabled = false; //设置标题信息 base.SetTitleText("语音控制"); //右上添加按钮 var btnAddDeviceIcon = new MostRightIconControl(69, 69); btnAddDeviceIcon.UnSelectedImagePath = "Item/Add.png"; topFrameLayout.AddChidren(btnAddDeviceIcon); btnAddDeviceIcon.InitControl(); btnAddDeviceIcon.ButtonClickEvent += (sender, e) => { iniView(); }; //初始化中部控件 //this.InitMiddleFrame(); } /// /// 将数据转换为智能音箱使用的数据 /// private void iniData(bool isAdd) { //1.从服务器获取的数据,json反序列化得来 //2.点击"+"将网关的数据转换为 智能音箱使用的数据 /*{ Dictionary ss = Config.Instance.Home.FloorDics;//楼层列表 string currentFloor = Config.Instance.Home.CurrentFloorId;//当前楼层的键 var listRoom = HdlRoomLogic.Current.GetFloorSortRoom("楼层的主键");//获取当前楼层的所有房间 var room = listRoom[0]; for (int i=0;i() { device }); if (myType.BeloneType == DeviceBeloneType.A灯光) { //这里面的就是灯光了 var light = device; // light.DeviceAddr; 设备的地址 // light.DeviceEpoint;//设备的端口 } } for (int i = 0; i < room.ListSceneId.Count; i++) { //场景数据 var device = HdlSceneLogic.Current.GetSceneUIBySceneId(room.ListSceneId[i]); // device.Id;场景 id } }*/ if (isAdd) { mSmartSound = new SmartSound(); Dictionary floorDictionary = Config.Instance.Home.FloorDics;//楼层列表 if (floorDictionary.Count < 1) { //没有楼层 } } } private void iniView() { //房间列表行{房间列表 textView,楼层下拉窗} //显示房间{带选择框的;当选中了房间后需要在底部弹出确认按钮,点击确认跳转到新的界面} var frame = new TopRightMenuControl(2, 2); //创建楼层 frame.AddRowMenu(Language.StringByID(R.MyInternationalizationString.uCreatFloor), "Item/CreatFloor.png", "Item/CreatFloorSelected.png", () => { //创建楼层 //this.CreatOrEditorFloor(null, null, string.Empty, string.Empty); }); //创建房间 frame.AddRowMenu(Language.StringByID(R.MyInternationalizationString.uCreatRoom), "Item/RoomIcon.png", "Item/RoomIconSelected.png", () => { /*var form = new AddNewRoomForm(); form.AddForm(string.Empty); form.FinishEditorEvent += () => { //根据指定模式,初始化桌布控件 this.InitFrameTableByMode(); };*/ }); } } }