public void SetContent() { textBox1.Text = theCircuit.CircuitName; textBox2.Text = theCircuit.CircuitNumber; comboBox1.SelectedValue = theCircuit.CircuitToID; thisId = ByteWithString.intTo4Byte(int.Parse(theCircuit.CircuitID)); }
private void SetContent() { textBox1.Text = theMsgGeneratrix.GeneratrixName; textBox2.Text = theMsgGeneratrix.GeneratrixNumber; comboBox1.SelectedValue = theMsgGeneratrix.GeneratrixToID; thisId = ByteWithString.intTo4Byte(int.Parse(theMsgGeneratrix.GeneratrixID)); }
private void SettingValue() { textBoxAddress.Text = theDeviceDataSetting.DeviceDataID; textBoxName.Text = theDeviceDataSetting.DeviceDataName; this.comboBox1.SelectedValue = theDeviceDataSetting.RemoteAToID; this.comboBox2.SelectedValue = theDeviceDataSetting.RemoteBToID; this.comboBox3.SelectedValue = theDeviceDataSetting.RemoteCToID; thisId = ByteWithString.intTo4Byte(int.Parse(theDeviceDataSetting.DeviceDataToID)); }
private List <byte> GetParameterCount() { List <byte> listArray = new List <byte>(); listArray = listArray.Concat(ByteWithString.intTo4Byte(int.Parse(timerSummonInterval.Value.ToString()))).ToList(); listArray = listArray.Concat(ByteWithString.intTo4Byte(int.Parse(timerTelemetryInterval.Value.ToString()))).ToList(); listArray = listArray.Concat(ByteWithString.intTo4Byte(int.Parse(timerHeartbeatInterval.Value.ToString()))).ToList(); return(listArray); }
private void MsgConvertingStation_Load(object sender, EventArgs e) { label3.Visible = false; if (content != null) { this.thisId = ByteWithString.intTo4Byte(int.Parse(content.stationID)); textBox1.Text = content.stationName; textBox2.Text = content.stationRemarks; } }
private void SetControlsValue() { textBox1.Text = theDetection.DetectionName; textBox2.Text = theDetection.DetectionNumber; textBoxA.Text = theDetection.RemoteA; textBoxB.Text = theDetection.RemoteB; textBoxC.Text = theDetection.RemoteC; textID.Text = theDetection.DetectionID; comboBox1.SelectedValue = theDetection.DetectionToID; comboBox2.SelectedValue = theDetection.DetectionToSecondID; thisId = ByteWithString.intTo4Byte(int.Parse(theDetection.DetectionID)); }
void theSerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e) { THE_DATA_LENGTH = THE_SERIAL_PORT.BytesToRead; byte[] receviceBuff = new byte[THE_DATA_LENGTH]; //声明一个临时数组存储当前来的串口数据 THE_SERIAL_PORT.Read(receviceBuff, 0, THE_DATA_LENGTH); //读取缓冲数据 thePortHandle.HandleData(receviceBuff); if (receviceBuff.Length > 0) { RECEIVE_DATA += ByteWithString.byteToHexStrAppend(receviceBuff, " ");//以16进制进行接收 } HandelData(RECEIVE_DATA); }
private void isAddOrUpdateMethod() { List <byte> ListArray = new List <byte>(); byte[] byteArray = ByteWithString.encodeingToByte(textBox1.Text, "utf-8"); byte[] byteArrayRemake = ByteWithString.encodeingToByte(textBox2.Text, "utf-8"); ListArray.AddRange(ByteWithString.intTo4Byte(byteArray.Length)); ListArray.AddRange(byteArray.ToList()); ListArray.AddRange(ByteWithString.intTo4Byte(byteArrayRemake.Length)); ListArray.AddRange(byteArrayRemake.ToList()); ListArray.AddRange(thisId); theScoket.theSocketSend <byte[]>(0x27, ListArray.ToArray()); }
/// <summary> /// /// </summary> /// <param name="command">标志</param> /// <param name="addOrUpdate">增加或修改</param> /// <param name="bytesArray">id</param> /// <param name="bytesArray">所属于</param> public void GetContent(byte command, byte[] bytesId) { List <byte> ListArray = new List <byte>(); byte[] byteArray = ByteWithString.encodeingToByte(textBox2.Text, "utf-8"); //名称 byte[] byteArrayRemake = ByteWithString.encodeingToByte(textBox1.Text, "utf-8"); //编号 ListArray.AddRange(ByteWithString.intTo4Byte(byteArray.Length).ToList()); //名称长度 ListArray.AddRange(byteArray.ToList()); //名称 ListArray.AddRange(ByteWithString.intTo4Byte(byteArrayRemake.Length).ToList()); //编号长度 ListArray.AddRange(byteArrayRemake.ToList()); //编号 ListArray.AddRange(ByteWithString.intTo4Byte(int.Parse(comboBox1.SelectedValue.ToString())).ToList()); //所属的id ListArray.AddRange(bytesId); //id theScoket.theSocketSend <byte[]>(command, ListArray.ToArray()); // }
private void isAddOrUpdata() { string name = textBoxName.Text; List <byte> ListArray = new List <byte>(); byte[] byteArray = ByteWithString.encodeingToByte(name, "utf-8"); //名称 ListArray.AddRange(ByteWithString.intTo4Byte(byteArray.Length)); //名称长度 ListArray.AddRange(byteArray.ToList()); //名称 ListArray.AddRange(ByteWithString.strToToHexByte(textBoxAddress.Text)); //地址 ListArray.AddRange(ByteWithString.intTo4Byte(int.Parse(comboBox1.SelectedValue.ToString()))); //A ListArray.AddRange(ByteWithString.intTo4Byte(int.Parse(comboBox2.SelectedValue.ToString()))); //B ListArray.AddRange(ByteWithString.intTo4Byte(int.Parse(comboBox3.SelectedValue.ToString()))); //C ListArray.AddRange(thisId); //C this.theScoket.theSocketSend <byte[]>(0x31, ListArray.ToArray()); }
private void isAddOrUpdateMethod() { List <byte> ListArray = new List <byte>(); byte[] byteArray = ByteWithString.encodeingToByte(textBox2.Text, "utf-8"); //名称 byte[] byteArrayRemake = ByteWithString.encodeingToByte(textBox1.Text, "utf-8"); //编号 ListArray.AddRange(ByteWithString.intTo4Byte(int.Parse(byteArray.Length.ToString()))); //名称长度 ListArray.AddRange(byteArray.ToList()); //名称 ListArray.AddRange(ByteWithString.intTo4Byte(int.Parse(byteArrayRemake.Length.ToString()))); //编号长度 ListArray.AddRange(byteArrayRemake); ListArray.AddRange(ByteWithString.intTo4Byte(int.Parse(comboBox2.SelectedValue.ToString()))); //上一个检测点id ListArray.AddRange(ByteWithString.strToToHexByte(textBoxA.Text)); //A ListArray.AddRange(ByteWithString.strToToHexByte(textBoxB.Text)); //B ListArray.AddRange(ByteWithString.strToToHexByte(textBoxC.Text)); //C ListArray.AddRange(ByteWithString.intTo4Byte(int.Parse(comboBox1.SelectedValue.ToString()))); //所属的id ListArray.AddRange(thisId); //id this.theScoket.theSocketSend <byte[]>(0x30, ListArray.ToArray()); // }