public void Udp() { //发点数 //PointNum = StopIndexForSend - StartIndexForSend + 1; byte u = 0; sp = new Spmatrix.spmatrix(); PointNum = ListSend.Count; sp.td = PointNum; sp.data = new Spmatrix.tupletype[PointNum]; int m = 0; for (m = 0; m < ListSend.Count; m++) { tup.y = ListSend[m].Pointx; tup.x = ListSend[m].Pointy; tup.value = ListSend[m].Mode; tup.U = u; sp.data[m] = tup; u++; } // CountUdp = ListSend.Count; vs.PubMsg("Path_GPS", VirtualSwitchBus.GetBytes((object)sp)); //byte[] mysendmessage = new byte[PointNum * 6 + 4]; //mysendmessage = SerializeTool.Serialize(sp, 4, 6); //SendClient.Send(mysendmessage, PointNum * 6 + 4, IpSend); }
public Form1() { InitializeComponent(); vs = new VirtualSwitchBus(1); opentxt(); timer1.Enabled = true; }
public void GetControlMessage(byte[] msg) { double[] args = (double[])VirtualSwitchBus.GetObject(msg); Control_Steer = args[0]; Control_Speed = args[1]; Receive_Speed = args[2]; try { Speedlabel.Text = Control_Speed.ToString() + " " + spoff; Steerlabel.Text = Control_Steer.ToString("F2") + " " + stoff; } catch (Exception ee) { } }