コード例 #1
0
        ObjectModelInfo getObjectModelInfo(GeneratedCode.SimulationModelRoot model)
        {
            ObjectModelInfo   objectModel = new ObjectModelInfo();
            List <ObjectInfo> objects     = null;

            for (int i = 0; i < model.ObjectModel.Length; i++)
            {
                if (objects == null)
                {
                    objects = getObjectInfo("", model.ObjectModel[i]);
                }
                else
                {
                    System.Console.WriteLine("Error: there should only be one EventModel section!");
                    System.Environment.Exit(1);
                }
                foreach (ObjectInfo o in objects)
                {
                    if (objectModel.objects.ContainsKey(o.name))
                    {
                        System.Console.WriteLine("Error: multiple definition of " + o.name + " object type");
                        System.Environment.Exit(1);
                    }

                    if (o.parentName != "")
                    {
                        foreach (AttributeInfo a in objectModel.objects[o.parentName].attributes.Values)
                        {
                            if (o.attributes.ContainsKey(a.name))
                            {
                                System.Console.WriteLine("Error: multiple parameters with name:" + a.name + " defined");
                                System.Environment.Exit(1);
                            }
                            o.attributes[a.name] = a;
                        }
                    }
                    objectModel.objects[o.name] = o;
                }
            }
            return(objectModel);
        }
コード例 #2
0
ファイル: SimulationModel.cs プロジェクト: wshanshan/DDD
 public SimulationModelInfo()
 {
     objectModel = null;
     eventModel = null;
     simulationExecutionModel = null;
 }
コード例 #3
0
        ObjectModelInfo getObjectModelInfo(GeneratedCode.SimulationModelRoot model)
        {
            ObjectModelInfo objectModel = new ObjectModelInfo();
            List<ObjectInfo> objects = null;
            for (int i = 0; i < model.ObjectModel.Length; i++)
            {
                if (objects == null)
                {
                    objects = getObjectInfo("", model.ObjectModel[i]);
                }
                else
                {
                    System.Console.WriteLine("Error: there should only be one EventModel section!");
                    System.Environment.Exit(1);
                }
                foreach (ObjectInfo o in objects)
                {
                    if (objectModel.objects.ContainsKey(o.name))
                    {
                        System.Console.WriteLine("Error: multiple definition of " + o.name + " object type");
                        System.Environment.Exit(1);
                    }

                    if (o.parentName != "")
                    {
                        foreach (AttributeInfo a in objectModel.objects[o.parentName].attributes.Values)
                        {
                            if (o.attributes.ContainsKey(a.name))
                            {
                                System.Console.WriteLine("Error: multiple parameters with name:" + a.name + " defined");
                                System.Environment.Exit(1);
                            }
                            o.attributes[a.name] = a;
                        }
                    }
                    objectModel.objects[o.name] = o;
                }
            }
            return objectModel;
        }
コード例 #4
0
ファイル: SimulationModel.cs プロジェクト: xiangnanyue/DDD
 public SimulationModelInfo()
 {
     objectModel = null;
     eventModel  = null;
     simulationExecutionModel = null;
 }