public static String toATML(CASS_MTPSI tpsi) { StringWriter tw = new StringWriter(); TestConfiguration testConfig = new TestConfiguration(); ManufacturerData configManager = testConfig.ConfigurationManager; List <CASS_MTPSICASS_MTPSI_page> pages = tpsi.CASS_MTPSI_page; foreach (CASS_MTPSICASS_MTPSI_page page in pages) { CASS_MTPSICASS_MTPSI_pageUUT uut = page.UUT; String partNo = uut.UUT_ID.Part_Number; //UUTInstance instance = new UUTInstance(); UUTDescription item = new UUTDescription(); //item.Item.name = uut.UUT_ID.Part_Number; //Lookup UUT Information ItemDescriptionReference reference = new ItemDescriptionReference(); DocumentReference docRef = new DocumentReference(); //docRef.ID = uut.UUT_ID.Part_Number; docRef.uuid = "{SOMEUUIDHERE}"; reference.Item = docRef;// item.Item; //testConfig.TestedUUTs.Add(reference); TestConfigurationTestEquipmentItem testEquipment = new TestConfigurationTestEquipmentItem(); foreach (CASS_MTPSICASS_MTPSI_pageATE_assets asset in page.ATE_assets) { ItemDescriptionReference refEquip = new ItemDescriptionReference(); ItemDescription instrument = new ItemDescription(); instrument.name = asset.Asset_Identifier; refEquip.Item = instrument; //testEquipment.Instrumentation.Add(refEquip); } // testConfig.TestEquipment.Add(testEquipment); try { XmlSerializer serializerObj = new XmlSerializer(typeof(TestConfiguration)); serializerObj.Serialize(tw, testConfig); } catch (Exception e) { Exception ie = e.InnerException; while (ie != null) { Trace.WriteLine(ie.Message); ie = ie.InnerException; } } break; } return(tw.ToString()); }
protected override void DataToControls() { base.DataToControls(); TestConfigurationTestEquipmentItem testEquipmentItem = base.ItemDescriptionReference as TestConfigurationTestEquipmentItem; //Fill Tabbed Controls if (testEquipmentItem != null) { //testEquipmentItem.Instrumentation; //testEquipmentItem.Resource; //testEquipmentItem.Software; } }
protected override void ControlsToData() { if (base.ItemDescriptionReference == null) { base.ItemDescriptionReference = new TestConfigurationTestEquipmentItem(); } TestConfigurationTestEquipmentItem testEquipmentItem = base.ItemDescriptionReference as TestConfigurationTestEquipmentItem; base.ControlsToData(); //Grab Tabbed Controls Data if (testEquipmentItem != null) { SoftwareInstance si; } }
private void testStationListControl_OnFind() { var form = new ATMLLibraryForm(typeof(TestStationListControl)); if (DialogResult.OK == form.ShowDialog()) { var testStation = form.SelectedObject as TestStationDescription11; Document document = DocumentManager.GetDocument(testStation.uuid); if (document != null) { var reference = new TestConfigurationTestEquipmentItem(); var documentReference = new DocumentReference(); documentReference.ContentType = ATMLContext.CONTEXT_TYPE_XML; documentReference.DocumentContent = Encoding.UTF8.GetBytes(testStation.Serialize()); documentReference.DocumentName = document.name; documentReference.DocumentType = document.DocumentType; documentReference.ID = testStation.Identification.ModelName; documentReference.uuid = testStation.uuid; reference.Item = documentReference; testEquipmentListControl.AddListViewObject(reference); } } }