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;
}