private void btnStopInterface_Click(object sender, EventArgs e)
 {
     Cursor.Current = Cursors.WaitCursor;
     _conf          = ConsoleAPI.StopEIBInterface();
     UpdateView();
     Cursor.Current = Cursors.Default;
 }
示例#2
0
        void IRefreshable.Refresh()
        {
            Cursor.Current = Cursors.WaitCursor;
            EIBInterfaceConf conf = ConsoleAPI.GetEIBInterfaceConf();

            UpdateView(conf);
            Cursor.Current = Cursors.Default;
        }
示例#3
0
 public static EIBInterfaceConf StopEIBInterface()
 {
     try
     {
         EIBInterfaceConf conf_obj = null;
         StreamReader     sr       = null;
         sr = GetEIBResponse(ConsoleDefinitions.EIBInterfaceConf.EIB_SERVER_INTERFACE_STOP_CMD, string.Empty);
         XmlSerializer ser = new XmlSerializer(typeof(EIBInterfaceConf));
         conf_obj = (EIBInterfaceConf)ser.Deserialize(sr);
         return(conf_obj);
     }
     catch (Exception)
     {
         return(null);
     }
 }
 void IRefreshable.Refresh()
 {
     _conf = ConsoleAPI.GetEIBInterfaceConf();
     UpdateView();
 }
示例#5
0
 void IRefreshable.Refresh()
 {
     _conf = ConsoleAPI.GetEIBInterfaceConf();
     UpdateView();
 }
示例#6
0
 private void btnStopInterface_Click(object sender, EventArgs e)
 {
     Cursor.Current = Cursors.WaitCursor;
     _conf = ConsoleAPI.StopEIBInterface();
     UpdateView();
     Cursor.Current = Cursors.Default;
 }
示例#7
0
        public void UpdateView(EIBInterfaceConf conf)
        {
            if (conf == null)
            {
                //management buttons
                this.btnStart.Enabled = false;
                this.btnStop.Enabled  = false;

                //device address
                this.ipDeviceAddress.Text    = "0.0.0.0";
                this.ipDeviceAddress.Enabled = false;

                //device status
                this.lblInterfaceStatus.Text = "Unknown Status";

                //auto detec check box
                this.cbAutoDetect.Checked = false;
                this.cbAutoDetect.Enabled = false;

                //device mode radio buttons
                this.rbModeRouting.Checked   = false;
                this.rbModeRouting.Enabled   = false;
                this.rbModeTunneling.Checked = false;
                this.rbModeTunneling.Enabled = false;

                //stats
                this.lblTotalSentVal.Text  = "0";
                this.lblTotalRecvdVal.Text = "0";

                //status image
                this.pbDeviceStatus.Image = this.ControlimageList.Images[DEVICE_STATUS_UNKNOWN_IMG_INDEX];

                return;
            }

            this.ipDeviceAddress.Enabled = true;
            this.ipDeviceAddress.Text    = conf.DeviceAddress;

            this.rbModeTunneling.Enabled = true;
            this.rbModeRouting.Enabled   = true;
            this.cbAutoDetect.Enabled    = true;

            if (conf.DeviceMode == DeviceMode.MODE_ROUTING)
            {
                this.rbModeRouting.Checked = true;
            }
            else if (conf.DeviceMode == DeviceMode.MODE_TUNNELING)
            {
                this.rbModeTunneling.Checked = true;
            }
            this.cbAutoDetect.Checked  = conf.AutoDetect;
            this.lblTotalRecvdVal.Text = conf.TotalPacketsReceived.ToString();
            this.lblTotalSentVal.Text  = conf.TotalPacketsSent.ToString();
            if (conf.Running)
            {
                this.pbDeviceStatus.Image    = this.ControlimageList.Images[DEVICE_STATUS_RUNNING_IMG_INDEX];
                this.lblInterfaceStatus.Text = "Running";
                this.btnStart.Enabled        = false;
                this.btnStop.Enabled         = true;
            }
            else
            {
                this.pbDeviceStatus.Image    = this.ControlimageList.Images[DEVICE_STATUS_STOPPED_IMG_INDEX];
                this.lblInterfaceStatus.Text = "Stopped";
                this.btnStart.Enabled        = true;
                this.btnStop.Enabled         = false;
            }
        }