void _view_WriteToFlashClick(object sender, EventArgs e) { if (_portManager.PortState) { ch_1 = _view.GetSettingChanel_1(); DataHelper.buffer_append_uint16(txData, Convert.ToUInt16(ch_1.enable), 0); DataHelper.buffer_append_uint16(txData, ch_1.heaterCondition, 2); DataHelper.buffer_append_uint16(txData, ch_1.hightSatte, 4); DataHelper.buffer_append_uint16(txData, ch_1.lowState, 6); DataHelper.buffer_append_uint16(txData, ch_1.yCoef, 8); DataHelper.buffer_append_uint16(txData, ch_1.timeShift, 10); DataHelper.buffer_append_uint16(txData, ch_1.valueInWait, 12); Wake.SendWpacket(0x01, (byte)Commadns.CMD_SETPARAM_CH1, (byte)txData.Length, txData); } }
public void SetSettingChanel_1(ChanelSettings settings) { //Thread.Sleep(190); enabledCheckBox_ch1.BeginInvoke(new Action(() => { enabledCheckBox_ch1.Checked = settings.enable; })); heaterNumeric_ch1.BeginInvoke(new Action(() => { heaterNumeric_ch1.Value = settings.heaterCondition; })); hightNumeric_ch1.BeginInvoke(new Action(() => { hightNumeric_ch1.Value = settings.hightSatte; })); lowNumeric_ch1.BeginInvoke(new Action(() => { lowNumeric_ch1.Value = settings.lowState; })); ycoefNumeric_ch1.BeginInvoke(new Action(() => { ycoefNumeric_ch1.Value = settings.yCoef; })); timeShiftNumeric_ch1.BeginInvoke(new Action(() => { timeShiftNumeric_ch1.Value = settings.timeShift; })); waitNumeric_ch1.BeginInvoke(new Action(() => { waitNumeric_ch1.Value = settings.valueInWait; })); }