예제 #1
0
 public static bool LoadFromFile(string fileName, out Connector obj) {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
예제 #2
0
 /// <summary>
 /// Deserializes xml markup from file into an Connector object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output Connector object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out Connector obj, out System.Exception exception) {
     exception = null;
     obj = default(Connector);
     try {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
예제 #3
0
 /// <summary>
 /// Deserializes workflow markup into an Connector object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output Connector object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out Connector obj, out System.Exception exception) {
     exception = null;
     obj = default(Connector);
     try {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
예제 #4
0
 public static bool Deserialize(string xml, out Connector obj) {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
        private void createAVMCyberConnector(List<avm.modelica.Connector> avmCyberModelConnectorList,  ISIS.GME.Common.Interfaces.Model cyberModelSignalInterface)
        {

            //Intialize new avm.modelica.Connector
            avm.modelica.Connector avmCyberConnector = new avm.modelica.Connector();

            // Assign the Class to avmCyberConnector from cyber SignalInterface
            avmCyberConnector.Class = META2AVM_Util.UtilFuncs.getMetaAttributeContent(cyberModelSignalInterface, "Class");

            // Assign name to the avmconnector from cyber SignalInterface
            //avmCyberConnector.Name = META2AVM_Util.UtilFuncs.getMetaObjectName(cyberModelSignalInterface);
            avmCyberConnector.Name = cyberModelSignalInterface.Name;

            // Assign Locator to the avmconnector from cyber SignalInterface relative path from its CyberModel
            avmCyberConnector.Locator = cyberModelSignalInterface.Name; // the Port is a direct child of the CyberModel hence locator is the name

            // Assign id to the avmconnector from cyber SignalInterface UDM ID
            avmCyberConnector.ID = META2AVM_Util.UtilFuncs.ensureMetaIDAttribute(cyberModelSignalInterface);
            


            // Now create the outer connector
            avm.Connector avmConnector = new avm.Connector();
            avmConnector.Name = avmCyberConnector.Name;
            avmConnector.ID = avmCyberConnector.ID;

            avm.modelica.Connector innerConnector = new avm.modelica.Connector();
            innerConnector.ID = META2AVM_Util.UtilFuncs.ensureMetaIDAttribute();
            innerConnector.Class = avmCyberConnector.Class;
            innerConnector.Locator = avmCyberConnector.Locator;
            innerConnector.Name = avmCyberConnector.Name;
            innerConnector.PortMap.Add(avmCyberConnector.ID);
     
            avmConnector.Role.Add(innerConnector);
            _avmComponent.Connector.Add(avmConnector);

            // Add the created avm connector to the given list
            avmCyberModelConnectorList.Add(avmCyberConnector);
        }