using System;
using System.Collections.Generic;
using System.Text;
using ZigBee.Device;
namespace Shared.Phone.UserCenter.DeviceAirConditioner
{
///
/// 中央空调的升级菜单界面
///
public class ACZbGatewayUpdateMenuForm : EditorCommonForm
{
#region ■ 变量声明___________________________
///
/// 设备
///
private CommonDevice deviceAc = null;
#endregion
#region ■ 初始化_____________________________
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
/// 设备
/// 拥有新版本
public void ShowForm(CommonDevice i_deviceAc, bool hadNewVersion)
{
this.deviceAc = i_deviceAc;
//设置头部信息
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uFirmwareUpdate));
//初始化中部信息
this.InitMiddleFrame(hadNewVersion);
}
///
/// 初始化中部信息
///
private void InitMiddleFrame(bool hadNewVersion)
{
//清空bodyFrame
this.ClearBodyFrame();
var frameBack = new FrameLayout();
frameBack.Height = Application.GetRealHeight(8);
frameBack.BackgroundColor = UserCenterColor.Current.White;
bodyFrameLayout.AddChidren(frameBack);
var listView = new VerticalListControl(12);
listView.Y = frameBack.Bottom;
listView.Height = bodyFrameLayout.Height;
listView.BackgroundColor = UserCenterColor.Current.White;
bodyFrameLayout.AddChidren(listView);
var btnNewVersion = new PicViewControl(78, 55);
//通信芯片
var rowComunication = new FrameRowControl(listView.rowSpace / 2);
listView.AddChidren(rowComunication);
rowComunication.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uCommunicationChip), 600);
rowComunication.AddRightArrow();
rowComunication.AddBottomLine();
rowComunication.ButtonClickEvent += (sender, e) =>
{
//这里是设备的Ota升级
btnNewVersion.Visible = false;
var form = new Device.DeviceFirmwareUpdateForm();
form.AddForm(this.deviceAc.DeviceAddr);
};
//提示有新版本
btnNewVersion.UnSelectedImagePath = "Item/NewVersion.png";
btnNewVersion.Visible = hadNewVersion;
btnNewVersion.X = Application.GetRealWidth(242);
btnNewVersion.Y = Application.GetRealHeight(23);
rowComunication.AddChidren(btnNewVersion, ChidrenBindMode.BindEvent);
//空调模块
var rowModel = new FrameRowControl(listView.rowSpace / 2);
listView.AddChidren(rowModel);
rowModel.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uAirConditioningModule), 600);
rowModel.AddRightArrow();
rowModel.ButtonClickEvent += (sender, e) =>
{
var form = new ACZbGatewayModuleUpdateForm();
form.AddForm(deviceAc);
};
//调整列表高度
listView.AdjustRealHeight(Application.GetRealHeight(23));
}
#endregion
#region ■ 一般方法___________________________
#endregion
}
}