public override void responseReceived(SerialComm.Packet_t p) { if (form == null || formWasClosed == true) { formWasClosed = false; form = new ResponseForm(this); form.FormClosing += new FormClosingEventHandler(form_FormClosing); if (showResponseForm == true) { form.WindowState = FormWindowState.Normal; form.Show(); } } if (showResponseForm == true) { //form.WindowState = FormWindowState.Normal; //form.TopMost = true; form.Show(); counter++; } lastResponse = form.updateStatus(p); form.updateStatus(p); if (StatusReceivedEvent != null) { StatusReceivedEvent(this, new StatusEventArgs(lastResponse)); } }
public GetStatus() { SerialComm.Packet_t packet = new SerialComm.Packet_t(); lastResponse = new GetStatusResponse_t(); this.Click += new EventHandler(OnButtonClick); this.Text = "GetStatus"; this.toolTip = "get the current status"; packet.destination = (byte)ModuleId_t.Touch_e; packet.source = (byte)ModuleId_t.Api_e; packet.appPort = SerialComm.ApplicationPort_t.Api_e; packet.type = SerialComm.PacketType_t.Request_e; packet.message.command = (byte)API_Command_t.GetStatus_e; this.packet = packet; this.processResponse = true; this.showResponseForm = true; }
public StatusEventArgs(GetStatusResponse_t resp) { response = resp; }