private new void ControlsToData() { if (_itemDescriptionReference == null) _itemDescriptionReference = new TestStationDescriptionInstrument(); base.ControlsToData(); var instrument = _itemDescriptionReference as TestStationDescriptionInstrument; if (instrument != null) { instrument.Address = edtAddress.GetValue<string>(); instrument.ID = edtId.GetValue<string>(); instrument.PhysicalLocation = edtPhysicalLocation.GetValue<string>(); } }
/// <summary> /// Deserializes xml markup from file into an TestStationDescriptionInstrument object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output TestStationDescriptionInstrument object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out TestStationDescriptionInstrument obj, out Exception exception) { exception = null; obj = default(TestStationDescriptionInstrument); try { obj = LoadFromFile(fileName); return(true); } catch (Exception ex) { exception = ex; return(false); } }
/// <summary> /// Deserializes workflow markup into an TestStationDescriptionInstrument object /// </summary> /// <param name="input">string workflow markup to deserialize</param> /// <param name="obj">Output TestStationDescriptionInstrument object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string input, out TestStationDescriptionInstrument obj, out Exception exception) { exception = null; obj = default(TestStationDescriptionInstrument); try { obj = Deserialize(input); return(true); } catch (Exception ex) { exception = ex; return(false); } }
private ItemDescription GetItemDescription(TestStationDescriptionInstrument testStationDescriptionInstrument) { ItemDescription itemDescription = testStationDescriptionInstrument.Item as InstrumentDescription; if (itemDescription != null) { //TODO: Process Test Station Instrument as Item Description } return itemDescription; }
private InstrumentDescription GetInstrumentDescription(TestStationDescriptionInstrument testStationDescriptionInstrument) { InstrumentDescription instrument = null; DocumentReference documentReference = testStationDescriptionInstrument.Item as DocumentReference; if (documentReference != null) { try { Document document = DocumentManager.GetDocument(documentReference.uuid); if (document != null) { instrument = InstrumentDescription.Deserialize(Encoding.UTF8.GetString(document.DocumentContent)); } } catch (Exception e) { LogManager.SourceError(ATMLAllocator.SOURCE, string.Format( "Error obtaining the Test Station ({0}) - Instrument Description Document for \"{1}\" - Error: {2}", _testStation.name, documentReference, e.Message), e); } } return instrument; }
public TestStationInstrumentData( TestStationDescription11 testStation, TestStationDescriptionInstrument testStationInstrument) { _testStation = testStation; _testStationInstrument = testStationInstrument; _instrumentDescription = GetInstrumentDescription( testStationInstrument ); _itemDescription = GetItemDescription( testStationInstrument ); }
public static bool LoadFromFile(string fileName, out TestStationDescriptionInstrument obj) { Exception exception; return(LoadFromFile(fileName, out obj, out exception)); }
public static bool Deserialize(string input, out TestStationDescriptionInstrument obj) { Exception exception; return(Deserialize(input, out obj, out exception)); }
public static bool LoadFromFile(string fileName, out TestStationDescriptionInstrument obj) { Exception exception; return LoadFromFile(fileName, out obj, out exception); }
/// <summary> /// Deserializes xml markup from file into an TestStationDescriptionInstrument object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output TestStationDescriptionInstrument object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out TestStationDescriptionInstrument obj, out Exception exception) { exception = null; obj = default(TestStationDescriptionInstrument); try { obj = LoadFromFile(fileName); return true; } catch (Exception ex) { exception = ex; return false; } }
public static bool Deserialize(string input, out TestStationDescriptionInstrument obj) { Exception exception; return Deserialize(input, out obj, out exception); }
/// <summary> /// Deserializes workflow markup into an TestStationDescriptionInstrument object /// </summary> /// <param name="input">string workflow markup to deserialize</param> /// <param name="obj">Output TestStationDescriptionInstrument object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string input, out TestStationDescriptionInstrument obj, out Exception exception) { exception = null; obj = default(TestStationDescriptionInstrument); try { obj = Deserialize(input); return true; } catch (Exception ex) { exception = ex; return false; } }