/// <summary> /// /// </summary> /// <param name="device"></param> public frmDeviceItem(Device device) : this() { if (device == null) { throw new ArgumentNullException("device"); } this._device = device; this.DeviceType = device.DeviceType; //this._station = (CZGRStation)device.Station; this.Station = device.Station; this.txtOwnerStatoin.Text = this._device.Station.Name; this.txtDeviceType.Text = this._device.Text; this.txtName.Text = this._device.Name; this.txtRemark.Text = this._device.Remark; //this.cmbDeviceType.Text = CZGRCommon.DeviceTypes.GetText(_device.DeviceType); this.numDeviceAddress.Value = _device.Address; this._adeState = ADEState.Edit; // // FormulaCollection fs= YeHeCommuniServerApp.Default.DevieFormaulCollectionMapCollection.GetFormulaCollection(device.ID); foreach (Formula f in fs) { AddFormulaListViewItem(f); } }
/// <summary> /// /// </summary> /// <param name="dbgrDevice"></param> public frmPlanHeatItem(int grDeviceID) { InitializeComponent(); InitControls(); this._grDeviceID = grDeviceID; this._adeState = ADEState.Add; }
/// <summary> /// /// </summary> /// <param name="aDEState"></param> /// <returns></returns> private string GetADEStateText(ADEState aDEState) { if (aDEState == ADEState.Add) { return("增加"); } if (aDEState == ADEState.Edit) { return("修改"); } return(string.Empty); }
/// <summary> /// /// </summary> public frmStationItem(StationCollection stations) { this.InitializeComponent(); this.FillDiscriminateMode(); BindGroup(); ShowSocketSettingUI(); _stations = stations; // set init value // this.cmbDiscriminateMode.SelectedValue = DiscriminateMode.ByIPAddress; this._adeState = ADEState.Add; this.rbSocket.Checked = true; }
/// <summary> /// /// </summary> /// <param name="st"></param> public frmDeviceItem(Station st, string deviceType) : this() { if (st == null) throw new ArgumentNullException("st"); this.Station = st; this.DeviceType= deviceType; this._adeState = ADEState.Add; this.txtOwnerStatoin.Text = Station.Name; //string deviceText = YeHeCommuniServerApp.Default.CommuniSoft.OperaFactory.DeviceDefineCollection.GetDeviceText(deviceType); string deviceText = YeHeCommuniServerApp.Default.CommuniSoft.DeviceDefineManager.DeviceDefineCollection.GetDeviceText(deviceType); this.txtDeviceType.Text = deviceText; }
/// <summary> /// /// </summary> public frmPlanHeatItem( int grdeviceID, int planHeatID, PlanHeatItem planHeatItem) { if (planHeatItem == null) throw new ArgumentNullException("dbGRPlanHeat"); InitializeComponent(); InitControls(); this._planHeatItem = planHeatItem; this._grDeviceID = grdeviceID; this._planHeatID = planHeatID; this._editMonth = planHeatItem.Month; this._adeState = ADEState.Edit; this.numMonth.Value = this._planHeatItem.Month; this.numPlanHeat.Value = this._planHeatItem.PlanHeat; }
static public string GetAdeStateText(ADEState state) { switch (state) { case ADEState.Add: return(GT.TEXT_ADD); case ADEState.Delete: return(GT.TEXT_DELETE); case ADEState.Edit: return(GT.TEXT_MODIFY); default: throw new ArgumentException(state.ToString()); } }
/// <summary> /// /// </summary> /// <param name="device"></param> public frmDeviceItem(Device device) : this() { if (device == null) { throw new ArgumentNullException("device"); } this._device = device; this.DeviceType = device.DeviceType; //this._station = (CZGRStation)device.Station; this.Station = device.Station; this.txtOwnerStatoin.Text = this._device.Station.Name; this.txtDeviceType.Text = this._device.Text; this.txtName.Text = this._device.Name; this.txtRemark.Text = this._device.Remark; //this.cmbDeviceType.Text = CZGRCommon.DeviceTypes.GetText(_device.DeviceType); this.numDeviceAddress.Value = _device.Address; this._adeState = ADEState.Edit; }
/// <summary> /// /// </summary> /// <param name="aDEState"></param> /// <returns></returns> private string GetADEStateText(ADEState aDEState) { if (aDEState == ADEState.Add) return "增加"; if (aDEState == ADEState.Edit) return "修改"; return string.Empty; }
/// <summary> /// /// </summary> /// <param name="device"></param> public void InitForEdit(Device device) { this.Device = device; this._adeState = ADEState.Edit; }
/// <summary> /// /// </summary> /// <param name="station"></param> /// <param name="dd"></param> public void InitForAdd(Station station, DeviceDefine dd) { if (station == null) { throw new ArgumentNullException("station"); } if( dd == null ) { throw new ArgumentNullException("dd"); } this.Station = station; this.DeviceDefine = dd; this._adeState = ADEState.Add; }