Пример #1
0
        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));
            }
        }
Пример #2
0
        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;
        }
Пример #3
0
 public StatusEventArgs(GetStatusResponse_t resp)
 {
     response = resp;
 }