public static void CopyData(CToolStatusData_SOLD statusTool, CPortData_SOLD infoPort, dc_StatusTool dcStatusTool) { statusTool.ConnectedTool = (GenericStationTools)dcStatusTool.ConnectedTool; statusTool.ActualTemp[0].UTI = dcStatusTool.ActualTemp.UTI; statusTool.Current_mA[0] = 0; // FALTA saber si se usa statusTool.Desold_OnOff = (OnOff)dcStatusTool.Desold_OnOff; statusTool.Extractor_OnOff = (OnOff)dcStatusTool.Extractor_OnOff; // servicio: S (sleep) or H (hibernation) switch (dcStatusTool.FutureMode) { case "S": statusTool.FutureMode_Tool = ToolFutureMode.Sleep; break; case "H": statusTool.FutureMode_Tool = ToolFutureMode.Hibernation; break; default: statusTool.FutureMode_Tool = ToolFutureMode.NoFutureMode; break; } statusTool.Hiber_OnOff = (OnOff)dcStatusTool.Hiber_OnOff; statusTool.Peripherals = new CPeripheralData[dcStatusTool.Peripheral.Count()]; for (var i = 0; i <= dcStatusTool.Peripheral.Count() - 1; i++) { statusTool.Peripherals[(int)i] = new CPeripheralData(statusTool.Peripherals.Count()); CConvertPeripheralFromDC.CopyData(statusTool.Peripherals[(int)i], dcStatusTool.Peripheral[i]); } statusTool.Power_x_Mil[0] = dcStatusTool.Power_x_Mil; statusTool.Sleep_OnOff = (OnOff)dcStatusTool.Sleep_OnOff; statusTool.Stand_OnOff = (OnOff)dcStatusTool.Stand_OnOff; statusTool.StatusRemoteMode.Sleep_OnOff = (OnOff)dcStatusTool.StatusRemoteMode_Sleep_OnOff; statusTool.StatusRemoteMode.Desold_OnOff = (OnOff)dcStatusTool.StatusRemoteMode_Desold_OnOff; statusTool.StatusRemoteMode.Extractor_OnOff = (OnOff)dcStatusTool.StatusRemoteMode_Extractor_OnOff; statusTool.Temp_MOS.UTI = dcStatusTool.Temp_MOS.UTI; statusTool.TimeToSleepHibern = dcStatusTool.TimeToSleepHibern; statusTool.ToolError = (ToolError)dcStatusTool.ToolError; infoPort.ToolStatus.SelectedTemp.UTI = dcStatusTool.PortSelectedTemp.UTI; }
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(); }