Exemplo n.º 1
0
 public static void CopyData(CStationSettingsData_SOLD stationSettings,
                             dc_Station_Sold_Settings dcStationSettings)
 {
     stationSettings.Name = dcStationSettings.Name;
     stationSettings.PIN  = dcStationSettings.PIN;
     if (dcStationSettings.Unit == "F")
     {
         stationSettings.Unit = CTemperature.TemperatureUnit.Fahrenheit;
     }
     else
     {
         stationSettings.Unit = CTemperature.TemperatureUnit.Celsius;
     }
     stationSettings.MaxTemp    = new CTemperature(dcStationSettings.MaxTemp.UTI);
     stationSettings.MinTemp    = new CTemperature(dcStationSettings.MinTemp.UTI);
     stationSettings.N2Mode     = (OnOff)dcStationSettings.N2Mode;
     stationSettings.HelpText   = (OnOff)dcStationSettings.HelpText;
     stationSettings.PowerLimit = dcStationSettings.PowerLimit;
     stationSettings.Beep       = (OnOff)dcStationSettings.Beep;
     stationSettings.Language   = (Idioma)dcStationSettings.Idioma;
 }
Exemplo n.º 2
0
    private void tmr_Elapsed(object sender, EventArgs e)
    {
        if (_stationID >= 0)
        {
            //is necessary to maintain control mode
            _JBC_StationControllerService.KeepControlMode(_stationID);

            //get station information
            _stationInfo     = _JBC_StationControllerService.GetStationInfo(_stationID);
            _stationStatus   = _JBC_StationControllerService.GetStationStatus(_stationID);
            _stationSettings = _JBC_StationControllerService.GetStationSettings(_stationID);

            //update station data
            lblModel.Text = _stationInfo.Model;
            lblSW.Text    = _stationInfo.Version_Software;
            if (_stationSettings.Unit == "C")
            {
                lblTrafo.Text      = _stationStatus.TRAFOTemp.Celsius.ToString() + " ºC";
                lblTrafoError.Text = _stationStatus.TempErrorTRAFO.Celsius.ToString() + " ºC";
                lblMOSerror.Text   = _stationStatus.TempErrorMOS.Celsius.ToString() + " ºC";
            }
            else
            {
                lblTrafo.Text      = _stationStatus.TRAFOTemp.Fahrenheit.ToString() + " ºF";
                lblTrafoError.Text = _stationStatus.TempErrorTRAFO.Fahrenheit.ToString() + " ºF";
                lblMOSerror.Text   = _stationStatus.TempErrorMOS.Fahrenheit.ToString() + " ºF";
            }
            lblError.Text = _stationStatus.StationError.ToString();

            //update station params
            lblName.Text = _stationSettings.Name;
            if (_stationSettings.Unit == "C")
            {
                lblMaxTemp.Text = _stationSettings.MaxTemp.Celsius.ToString() + " ºC";
                lblMinTemp.Text = _stationSettings.MinTemp.Celsius.ToString() + " ºC";
            }
            else
            {
                lblMaxTemp.Text = _stationSettings.MaxTemp.Fahrenheit.ToString() + " ºF";
                lblMinTemp.Text = _stationSettings.MinTemp.Fahrenheit.ToString() + " ºF";
            }
            //if station supports display settings changes
            if (_stationInfo.Features.DisplaySettings)
            {
                lblUnits.Text = _stationSettings.Unit.ToString();
                lblN2.Text    = _stationSettings.N2Mode.ToString().Replace("_", "");
                lblHelp.Text  = _stationSettings.HelpText.ToString().Replace("_", "");
                lblBeep.Text  = _stationSettings.Beep.ToString().Replace("_", "");

                butUnits.Enabled = true;
                butN2.Enabled    = true;
                butHelp.Enabled  = true;
                butBeep.Enabled  = true;
            }
            else
            {
                lblUnits.Text = "N/A";              // not supported
                lblN2.Text    = "N/A";              // not supported
                lblHelp.Text  = "N/A";              // not supported
                lblBeep.Text  = "N/A";              // not supported

                butUnits.Enabled = false;
                butN2.Enabled    = false;
                butHelp.Enabled  = false;
                butBeep.Enabled  = false;
            }

            //update ports information
            for (var i = 1; i <= _stationInfo.PortCount; i++)
            {
                this.Controls.Find("gbxPort" + System.Convert.ToString(i), true)[0].Enabled = true;
                dc_StatusTool statusTool = _JBC_StationControllerService.GetPortStatus(_stationID, (dc_EnumConstJBCdc_Port)(i - 1));

                Control tool       = this.Controls.Find("lblPort" + System.Convert.ToString(i) + "Tool", true)[0];
                Control actualTemp = this.Controls.Find("lblPort" + System.Convert.ToString(i) + "ActualTemp", true)[0];
                Control selecTemp  = this.Controls.Find("lblPort" + System.Convert.ToString(i) + "SelecTemp", true)[0];
                Control err        = this.Controls.Find("lblPort" + System.Convert.ToString(i) + "Error", true)[0];
                Control status     = this.Controls.Find("lblPort" + System.Convert.ToString(i) + "Status", true)[0];
                tool.Text = (statusTool.ConnectedTool).ToString();
                if (_stationSettings.Unit == "C")
                {
                    actualTemp.Text = statusTool.ActualTemp.Celsius.ToString() + " ºC";
                    selecTemp.Text  = statusTool.PortSelectedTemp.Celsius.ToString() + " ºC";
                }
                else
                {
                    actualTemp.Text = statusTool.ActualTemp.Fahrenheit.ToString() + " ºF";
                    selecTemp.Text  = statusTool.PortSelectedTemp.Fahrenheit.ToString() + " ºF";
                }
                err.Text = statusTool.ToolError.ToString();
                if (statusTool.Extractor_OnOff == dc_EnumConstJBCdc_OnOff._ON)
                {
                    status.Text = "Extractor";
                }
                else if (statusTool.Hiber_OnOff == dc_EnumConstJBCdc_OnOff._ON)
                {
                    status.Text = "Hibernation";
                }
                else if (statusTool.Sleep_OnOff == dc_EnumConstJBCdc_OnOff._ON)
                {
                    status.Text = "Sleep";
                }
                else if (statusTool.Stand_OnOff == dc_EnumConstJBCdc_OnOff._ON)
                {
                    status.Text = "Stand";
                }
                else
                {
                    status.Text = "Work";
                }
            }
            for (var i = _stationInfo.PortCount + 1; i <= 4; i++)
            {
                this.Controls.Find("gbxPort" + System.Convert.ToString(i), true)[0].Enabled = false;
            }
        }

        _tmr.Start();
    }