private CTraceStation getStationData(long id) { CTraceStation stn = new CTraceStation(); if (id < 0) { return(stn); } try { string InternalID = jbc.GetStationInternalUID(id); // info.InternalID stn.ID = id; stn.UID = InternalID; stn.COM = jbc.GetStationCOM(id); stn.Name = jbc.GetStationName(id); // settings.Name stn.Model = jbc.GetStationModel(id); // info.Model stn.ModelType = jbc.GetStationModelType(id); // info.ModelType stn.ModelVersion = System.Convert.ToString(jbc.GetStationModelVersion(id)); // info.ModelVersion.ToString stn.Software = jbc.GetStationSWversion(id); // info.Version_Software stn.Hardware = jbc.GetStationHWversion(id); // info.Version_Hardware } catch (Exception) { } return(stn); }
public void GetStationCOM() { String addr = jbc_api.GetStationCOM(station_id); bool isValid = true; Trace.WriteLine("STATION: " + station_id + " PORT: " + addr); IPAddress address; if (!IPAddress.TryParse(addr, out address)) { isValid = addr.StartsWith("COM"); } Assert.IsTrue(isValid); }