Ejemplo n.º 1
0
        /// <summary>
        ///     Configures the filtering dialog
        /// </summary>
        /// <param name="efsSystem"></param>
        /// <param name="filterConfiguration"></param>
        public void Configure(EfsSystem efsSystem, FilterConfiguration filterConfiguration)
        {
            ruleActivationCheckBox.Checked = filterConfiguration.RuleFired;
            expectationsCheckBox.Checked   = filterConfiguration.Expect;
            variableUpdateCheckBox.Checked = filterConfiguration.VariableUpdate;

            List <Dictionary> dictionaries = new List <Dictionary>(efsSystem.Dictionaries);

            dictionaries.Sort(Compare);
            foreach (Dictionary dictionary in dictionaries)
            {
                NamableTreeNode dictionaryTreeNode = new NamableTreeNode(dictionary);
                nameSpaceTreeView.Nodes.Add(dictionaryTreeNode);

                List <NameSpace> nameSpaces = new List <NameSpace>();
                foreach (NameSpace nameSpace in dictionary.NameSpaces)
                {
                    nameSpaces.Add(nameSpace);
                }
                nameSpaces.Sort();

                foreach (NameSpace nameSpace in nameSpaces)
                {
                    GatherNamespaces(dictionaryTreeNode, nameSpace, filterConfiguration);
                }
            }

            regExpTextBox.Text = filterConfiguration.RegExp;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public Override(EfsSystem efsSystem)
            : base(efsSystem, "Override")
        {
            DefaultFunction = (Parameter) acceptor.getFactory().createParameter();
            DefaultFunction.Name = "Default";
            DefaultFunction.Type = EFSSystem.AnyType;
            DefaultFunction.setFather(this);
            FormalParameters.Add(DefaultFunction);

            OverrideFunction = (Parameter) acceptor.getFactory().createParameter();
            OverrideFunction.Name = "Override";
            OverrideFunction.Type = EFSSystem.AnyType;
            OverrideFunction.setFather(this);
            FormalParameters.Add(OverrideFunction);

            Returns = (Function) acceptor.getFactory().createFunction();
            Returns.Name = "Override";
            Returns.ReturnType = EFSSystem.DoubleType;
            Returns.setFather(this);

            Parameter distanceParam = (Parameter) acceptor.getFactory().createParameter();
            distanceParam.Name = "Distance";
            distanceParam.Type = EFSSystem.DoubleType;
            distanceParam.setFather(Returns);
            Returns.appendParameters(distanceParam);

            Parameter speedParameter = (Parameter) acceptor.getFactory().createParameter();
            speedParameter.Name = "Speed";
            speedParameter.Type = EFSSystem.DoubleType;
            speedParameter.setFather(Returns);
            Returns.appendParameters(speedParameter);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public Override(EfsSystem efsSystem)
            : base(efsSystem, "Override")
        {
            DefaultFunction      = (Parameter)acceptor.getFactory().createParameter();
            DefaultFunction.Name = "Default";
            DefaultFunction.Type = EFSSystem.AnyType;
            DefaultFunction.setFather(this);
            FormalParameters.Add(DefaultFunction);

            OverrideFunction      = (Parameter)acceptor.getFactory().createParameter();
            OverrideFunction.Name = "Override";
            OverrideFunction.Type = EFSSystem.AnyType;
            OverrideFunction.setFather(this);
            FormalParameters.Add(OverrideFunction);

            Returns            = (Function)acceptor.getFactory().createFunction();
            Returns.Name       = "Override";
            Returns.ReturnType = EFSSystem.DoubleType;
            Returns.setFather(this);

            Parameter distanceParam = (Parameter)acceptor.getFactory().createParameter();

            distanceParam.Name = "Distance";
            distanceParam.Type = EFSSystem.DoubleType;
            distanceParam.setFather(Returns);
            Returns.appendParameters(distanceParam);

            Parameter speedParameter = (Parameter)acceptor.getFactory().createParameter();

            speedParameter.Name = "Speed";
            speedParameter.Type = EFSSystem.DoubleType;
            speedParameter.setFather(Returns);
            Returns.appendParameters(speedParameter);
        }
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="system"></param>
        public TestsCoverageReportHandler(EfsSystem system)
            : base(null)
        {
            __efsSystem = system;

            init();
        }
Ejemplo n.º 5
0
        private static string format_euroloop_message(DBMessage message)
        {
            EfsSystem system = EfsSystem.Instance;

            NameSpace      nameSpace     = findNameSpace("Messages.EUROLOOP");
            Structure      structureType = (Structure)system.FindType(nameSpace, "Message");
            StructureValue structure     = new StructureValue(structureType);

            int currentIndex = 0;

            FillStructure(nameSpace, message.Fields, ref currentIndex, structure);


            // then we fill the packets
            IVariable subSequenceVariable;

            if (structure.SubVariables.TryGetValue("Sequence1", out subSequenceVariable))
            {
                subSequenceVariable.Value = get_message_packets(message, nameSpace, system);
            }
            else
            {
                throw new Exception("Cannot find SubSequence in variable");
            }

            return(structure.Name);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="dictionary"></param>
        public BoolType(EfsSystem efsSystem)
            : base(efsSystem, "Boolean")
        {
            True  = new BoolValue(this, true);
            False = new BoolValue(this, false);

            InitDeclaredElements();
        }
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="dictionary"></param>
        public BoolType(EfsSystem efsSystem)
            : base(efsSystem, "Boolean")
        {
            True = new BoolValue(this, true);
            False = new BoolValue(this, false);

            InitDeclaredElements();
        }
Ejemplo n.º 8
0
 /// <summary>
 ///     Constructor
 /// </summary>
 public Allocate(EfsSystem efsSystem)
     : base(efsSystem, "Allocate")
 {
     Collection = (Parameter) acceptor.getFactory().createParameter();
     Collection.Name = "Collection";
     Collection.Type = EFSSystem.GenericCollection;
     Collection.setFather(this);
     FormalParameters.Add(Collection);
 }
Ejemplo n.º 9
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 /// <param name="name">the name of the cast function</param>
 public Not(EfsSystem efsSystem)
     : base(efsSystem, "NOT")
 {
     Value      = (Parameter)acceptor.getFactory().createParameter();
     Value.Name = "Value";
     Value.Type = EFSSystem.BoolType;
     Value.setFather(this);
     FormalParameters.Add(Value);
 }
Ejemplo n.º 10
0
 /// <summary>
 ///     Constructor
 /// </summary>
 public Available(EfsSystem efsSystem)
     : base(efsSystem, "Available")
 {
     Element      = (Parameter)acceptor.getFactory().createParameter();
     Element.Name = "Element";
     Element.Type = EFSSystem.AnyType;
     Element.setFather(this);
     FormalParameters.Add(Element);
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public DoubleToInteger(EfsSystem efsSystem)
     : base(efsSystem, "DoubleToInteger")
 {
     Value = (Parameter) acceptor.getFactory().createParameter();
     Value.Name = "Value";
     Value.Type = EFSSystem.DoubleType;
     Value.setFather(this);
     FormalParameters.Add(Value);
 }
Ejemplo n.º 12
0
 /// <summary>
 ///     Constructor
 /// </summary>
 public Available(EfsSystem efsSystem)
     : base(efsSystem, "Available")
 {
     Element = (Parameter) acceptor.getFactory().createParameter();
     Element.Name = "Element";
     Element.Type = EFSSystem.AnyType;
     Element.setFather(this);
     FormalParameters.Add(Element);
 }
Ejemplo n.º 13
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public Window()
        {
            InitializeComponent();

            frameToolStripComboBox.DropDown      += frameToolStripComboBox_DropDown;
            subSequenceSelectorComboBox.DropDown += subSequenceSelectorComboBox_DropDown;
            Text      = Resources.Window_Window_System_test_view;
            EfsSystem = EfsSystem.Instance;
        }
Ejemplo n.º 14
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public Discontinuities(EfsSystem efsSystem)
     : base(efsSystem, "Discontinuities")
 {
     Targets      = (Parameter)acceptor.getFactory().createParameter();
     Targets.Name = "SpeedRestrictions";
     Targets.Type = EFSSystem.AnyType;
     Targets.setFather(this);
     FormalParameters.Add(Targets);
 }
Ejemplo n.º 15
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public DoubleToInteger(EfsSystem efsSystem)
     : base(efsSystem, "DoubleToInteger")
 {
     Value      = (Parameter)acceptor.getFactory().createParameter();
     Value.Name = "Value";
     Value.Type = EFSSystem.DoubleType;
     Value.setFather(this);
     FormalParameters.Add(Value);
 }
Ejemplo n.º 16
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 /// <param name="name">the name of the cast function</param>
 public Not(EfsSystem efsSystem)
     : base(efsSystem, "NOT")
 {
     Value = (Parameter) acceptor.getFactory().createParameter();
     Value.Name = "Value";
     Value.Type = EFSSystem.BoolType;
     Value.setFather(this);
     FormalParameters.Add(Value);
 }
Ejemplo n.º 17
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public CheckNumber(EfsSystem efsSystem)
     : base(efsSystem, "CheckNumber")
 {
     Number      = (Parameter)acceptor.getFactory().createParameter();
     Number.Name = "Number";
     Number.Type = EFSSystem.AnyType;
     Number.setFather(this);
     FormalParameters.Add(Number);
 }
Ejemplo n.º 18
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public Targets(EfsSystem efsSystem)
     : base(efsSystem, "TARGETS")
 {
     SpeedRestrictions      = (Parameter)acceptor.getFactory().createParameter();
     SpeedRestrictions.Name = "SpeedRestrictions";
     SpeedRestrictions.Type = EFSSystem.AnyType;
     SpeedRestrictions.setFather(this);
     FormalParameters.Add(SpeedRestrictions);
 }
Ejemplo n.º 19
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public Targets(EfsSystem efsSystem)
     : base(efsSystem, "TARGETS")
 {
     SpeedRestrictions = (Parameter) acceptor.getFactory().createParameter();
     SpeedRestrictions.Name = "SpeedRestrictions";
     SpeedRestrictions.Type = EFSSystem.AnyType;
     SpeedRestrictions.setFather(this);
     FormalParameters.Add(SpeedRestrictions);
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public Discontinuities(EfsSystem efsSystem)
     : base(efsSystem, "Discontinuities")
 {
     Segments = (Parameter)acceptor.getFactory().createParameter();
     Segments.Name = "SpeedRestrictions";
     Segments.Type = EFSSystem.AnyType;
     Segments.setFather(this);
     FormalParameters.Add(Segments);
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public Characters(EfsSystem efsSystem)
     : base(efsSystem, "Characters")
 {
     Value      = (Parameter)acceptor.getFactory().createParameter();
     Value.Name = "String";
     Value.Type = EFSSystem.StringType;
     Value.setFather(this);
     FormalParameters.Add(Value);
 }
Ejemplo n.º 22
0
 /// <summary>
 ///     Constructor
 /// </summary>
 public Allocate(EfsSystem efsSystem)
     : base(efsSystem, "Allocate")
 {
     Collection      = (Parameter)acceptor.getFactory().createParameter();
     Collection.Name = "Collection";
     Collection.Type = EFSSystem.GenericCollection;
     Collection.setFather(this);
     FormalParameters.Add(Collection);
 }
Ejemplo n.º 23
0
        /// <summary>
        ///     Closes the dictionary
        /// </summary>
        public override void ExecuteWork()
        {
            EfsSystem efsSystem = EfsSystem.Instance;

            efsSystem.Dictionaries.Remove(Dictionary);
            FinderRepository.INSTANCE.ClearCache();
            efsSystem.Compiler.Compile_Synchronous(true);

            efsSystem.Context.HandleChangeEvent(null, Context.ChangeKind.ModelChange);
        }
Ejemplo n.º 24
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="system"></param>
 public MessageCounter(EfsSystem system)
 {
     Info    = 0;
     Warning = 0;
     Error   = 0;
     foreach (Dictionary dictionary in system.Dictionaries)
     {
         visit(dictionary, true);
     }
 }
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        /// <param name="name">the name of the function</param>
        public FunctionOnGraph(EfsSystem efsSystem, string name)
            : base(efsSystem, name)
        {
            Returns = (Function) acceptor.getFactory().createFunction();
            Returns.Name = name + "ReturnType";
            Returns.ReturnType = EFSSystem.DoubleType;
            Returns.setFather(this);

            Parameter returnTypeParam = (Parameter) acceptor.getFactory().createParameter();
            returnTypeParam.Name = name + "ReturnTypeParam";
            returnTypeParam.Type = EFSSystem.DoubleType;
            returnTypeParam.setFather(Returns);
            Returns.appendParameters(returnTypeParam);
        }
Ejemplo n.º 26
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public AddToDate(EfsSystem efsSystem)
            : base(efsSystem, "AddToDate")
        {
            StartDate      = (Parameter)acceptor.getFactory().createParameter();
            StartDate.Name = "StartDate";
            StartDate.Type = EFSSystem.AnyType;
            StartDate.setFather(this);
            FormalParameters.Add(StartDate);

            Increment      = (Parameter)acceptor.getFactory().createParameter();
            Increment.Name = "Increment";
            Increment.Type = EFSSystem.DoubleType;
            Increment.setFather(this);
            FormalParameters.Add(Increment);
        }
Ejemplo n.º 27
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public DistanceForSpeed(EfsSystem efsSystem)
            : base(efsSystem, "DistanceForSpeed")
        {
            Function      = (Parameter)acceptor.getFactory().createParameter();
            Function.Name = "Function";
            Function.Type = EFSSystem.AnyType;
            Function.setFather(this);
            FormalParameters.Add(Function);

            Speed      = (Parameter)acceptor.getFactory().createParameter();
            Speed.Name = "Speed";
            Speed.Type = EFSSystem.DoubleType;
            Speed.setFather(this);
            FormalParameters.Add(Speed);
        }
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public DistanceForSpeed(EfsSystem efsSystem)
            : base(efsSystem, "DistanceForSpeed")
        {
            Function = (Parameter) acceptor.getFactory().createParameter();
            Function.Name = "Function";
            Function.Type = EFSSystem.AnyType;
            Function.setFather(this);
            FormalParameters.Add(Function);

            Speed = (Parameter) acceptor.getFactory().createParameter();
            Speed.Name = "Speed";
            Speed.Type = EFSSystem.DoubleType;
            Speed.setFather(this);
            FormalParameters.Add(Speed);
        }
Ejemplo n.º 29
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public IntersectAt(EfsSystem efsSystem)
            : base(efsSystem, "IntersectAt")
        {
            FunctionA      = (Parameter)acceptor.getFactory().createParameter();
            FunctionA.Name = "FunctionA";
            FunctionA.Type = EFSSystem.AnyType;
            FunctionA.setFather(this);
            FormalParameters.Add(FunctionA);

            FunctionB      = (Parameter)acceptor.getFactory().createParameter();
            FunctionB.Name = "FunctionB";
            FunctionB.Type = EFSSystem.AnyType;
            FunctionB.setFather(this);
            FormalParameters.Add(FunctionB);
        }
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public AddIncrement(EfsSystem efsSystem)
            : base(efsSystem, "AddIncrement")
        {
            Function = (Parameter) acceptor.getFactory().createParameter();
            Function.Name = "Function";
            Function.Type = EFSSystem.AnyType;
            Function.setFather(this);
            FormalParameters.Add(Function);

            Increment = (Parameter) acceptor.getFactory().createParameter();
            Increment.Name = "Increment";
            Increment.Type = EFSSystem.AnyType;
            Increment.setFather(this);
            FormalParameters.Add(Increment);
        }
Ejemplo n.º 31
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public AddToDate(EfsSystem efsSystem)
            : base(efsSystem, "AddToDate")
        {
            StartDate = (Parameter) acceptor.getFactory().createParameter();
            StartDate.Name = "StartDate";
            StartDate.Type = EFSSystem.AnyType;
            StartDate.setFather(this);
            FormalParameters.Add(StartDate);

            Increment = (Parameter) acceptor.getFactory().createParameter();
            Increment.Name = "Increment";
            Increment.Type = EFSSystem.DoubleType;
            Increment.setFather(this);
            FormalParameters.Add(Increment);
        }
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public DecelerationProfile(EfsSystem efsSystem)
            : base(efsSystem, "DecelerationProfile")
        {
            SpeedRestrictions = (Parameter) acceptor.getFactory().createParameter();
            SpeedRestrictions.Name = "SpeedRestrictions";
            SpeedRestrictions.Type = EFSSystem.AnyType;
            SpeedRestrictions.setFather(this);
            FormalParameters.Add(SpeedRestrictions);

            DecelerationFactor = (Parameter) acceptor.getFactory().createParameter();
            DecelerationFactor.Name = "DecelerationFactor";
            DecelerationFactor.Type = EFSSystem.AnyType;
            DecelerationFactor.setFather(this);
            FormalParameters.Add(DecelerationFactor);
        }
Ejemplo n.º 33
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public MinSurface(EfsSystem efsSystem)
            : base(efsSystem, "MINSURFACE")
        {
            First      = (Parameter)acceptor.getFactory().createParameter();
            First.Name = "First";
            First.Type = EFSSystem.AnyType;
            First.setFather(this);
            FormalParameters.Add(First);

            Second      = (Parameter)acceptor.getFactory().createParameter();
            Second.Name = "Second";
            Second.Type = EFSSystem.AnyType;
            Second.setFather(this);
            FormalParameters.Add(Second);
        }
Ejemplo n.º 34
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public Concat(EfsSystem efsSystem)
            : base(efsSystem, "Concat")
        {
            String1      = (Parameter)acceptor.getFactory().createParameter();
            String1.Name = "String1";
            String1.Type = EFSSystem.StringType;
            String1.setFather(this);
            FormalParameters.Add(String1);

            String2      = (Parameter)acceptor.getFactory().createParameter();
            String2.Name = "String2";
            String2.Type = EFSSystem.StringType;
            String2.setFather(this);
            FormalParameters.Add(String2);
        }
Ejemplo n.º 35
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public Max(EfsSystem efsSystem)
            : base(efsSystem, "MAX")
        {
            First = (Parameter) acceptor.getFactory().createParameter();
            First.Name = "First";
            First.Type = EFSSystem.AnyType;
            First.setFather(this);
            FormalParameters.Add(First);

            Second = (Parameter) acceptor.getFactory().createParameter();
            Second.Name = "Second";
            Second.Type = EFSSystem.AnyType;
            Second.setFather(this);
            FormalParameters.Add(Second);
        }
Ejemplo n.º 36
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public IntersectAt(EfsSystem efsSystem)
            : base(efsSystem, "IntersectAt")
        {
            FunctionA = (Parameter) acceptor.getFactory().createParameter();
            FunctionA.Name = "FunctionA";
            FunctionA.Type = EFSSystem.AnyType;
            FunctionA.setFather(this);
            FormalParameters.Add(FunctionA);

            FunctionB = (Parameter) acceptor.getFactory().createParameter();
            FunctionB.Name = "FunctionB";
            FunctionB.Type = EFSSystem.AnyType;
            FunctionB.setFather(this);
            FormalParameters.Add(FunctionB);
        }
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public RoundToMultiple(EfsSystem efsSystem)
            : base(efsSystem, "RoundToMultiple")
        {
            Value = (Parameter) acceptor.getFactory().createParameter();
            Value.Name = "Value";
            Value.Type = EFSSystem.DoubleType;
            Value.setFather(this);
            FormalParameters.Add(Value);

            Multiple = (Parameter) acceptor.getFactory().createParameter();
            Multiple.Name = "Multiple";
            Multiple.Type = EFSSystem.DoubleType;
            Multiple.setFather(this);
            FormalParameters.Add(Multiple);
        }
Ejemplo n.º 38
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public DecelerationProfile(EfsSystem efsSystem)
            : base(efsSystem, "DecelerationProfile")
        {
            SpeedRestrictions      = (Parameter)acceptor.getFactory().createParameter();
            SpeedRestrictions.Name = "SpeedRestrictions";
            SpeedRestrictions.Type = EFSSystem.AnyType;
            SpeedRestrictions.setFather(this);
            FormalParameters.Add(SpeedRestrictions);

            DecelerationFactor      = (Parameter)acceptor.getFactory().createParameter();
            DecelerationFactor.Name = "DecelerationFactor";
            DecelerationFactor.Type = EFSSystem.AnyType;
            DecelerationFactor.setFather(this);
            FormalParameters.Add(DecelerationFactor);
        }
Ejemplo n.º 39
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public Concat(EfsSystem efsSystem)
            : base(efsSystem, "Concat")
        {
            String1 = (Parameter)acceptor.getFactory().createParameter();
            String1.Name = "String1";
            String1.Type = EFSSystem.StringType;
            String1.setFather(this);
            FormalParameters.Add(String1);

            String2 = (Parameter)acceptor.getFactory().createParameter();
            String2.Name = "String2";
            String2.Type = EFSSystem.StringType;
            String2.setFather(this);
            FormalParameters.Add(String2);
        }
Ejemplo n.º 40
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        /// <param name="name">the name of the function</param>
        public FunctionOnGraph(EfsSystem efsSystem, string name)
            : base(efsSystem, name)
        {
            Returns            = (Function)acceptor.getFactory().createFunction();
            Returns.Name       = name + "ReturnType";
            Returns.ReturnType = EFSSystem.DoubleType;
            Returns.setFather(this);

            Parameter returnTypeParam = (Parameter)acceptor.getFactory().createParameter();

            returnTypeParam.Name = name + "ReturnTypeParam";
            returnTypeParam.Type = EFSSystem.DoubleType;
            returnTypeParam.setFather(Returns);
            Returns.appendParameters(returnTypeParam);
        }
Ejemplo n.º 41
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public AddIncrement(EfsSystem efsSystem)
            : base(efsSystem, "AddIncrement")
        {
            Function      = (Parameter)acceptor.getFactory().createParameter();
            Function.Name = "Function";
            Function.Type = EFSSystem.AnyType;
            Function.setFather(this);
            FormalParameters.Add(Function);

            Increment      = (Parameter)acceptor.getFactory().createParameter();
            Increment.Name = "Increment";
            Increment.Type = EFSSystem.AnyType;
            Increment.setFather(this);
            FormalParameters.Add(Increment);
        }
Ejemplo n.º 42
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        public RoundToMultiple(EfsSystem efsSystem)
            : base(efsSystem, "RoundToMultiple")
        {
            Value      = (Parameter)acceptor.getFactory().createParameter();
            Value.Name = "Value";
            Value.Type = EFSSystem.DoubleType;
            Value.setFather(this);
            FormalParameters.Add(Value);

            Multiple      = (Parameter)acceptor.getFactory().createParameter();
            Multiple.Name = "Multiple";
            Multiple.Type = EFSSystem.DoubleType;
            Multiple.setFather(this);
            FormalParameters.Add(Multiple);
        }
Ejemplo n.º 43
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="fileName">The file path of the file to load</param>
        /// <param name="system">The EFS system for which the load is performed</param>
        /// <param name="allowErrors">Indicates that errors are allowed during load</param>
        /// <param name="updateGuid">Indicates that the GUID should be set during load</param>
        public OpenFileOperation(string fileName, EfsSystem system, bool allowErrors, bool updateGuid)
        {
            FileName = fileName;
            System   = system;

            if (allowErrors)
            {
                ErrorsDuringLoad = new List <ElementLog>();
            }
            else
            {
                ErrorsDuringLoad = null;
            }
            UpdateGuid      = updateGuid;
            PleaseLockFiles = Util.PleaseLockFiles;
        }
Ejemplo n.º 44
0
        /// <summary>
        ///     Provides the set of rules which uses this variable
        /// </summary>
        /// <param name="node">the element to find in rules</param>
        /// <returns>the list of rules which use the element provided</returns>
        public static HashSet <RuleCondition> RulesUsingThisElement(IVariable node)
        {
            UsageVisitor visitor = new UsageVisitor(node);

            EfsSystem efsSystem = EnclosingFinder <EfsSystem> .find(node);

            if (efsSystem != null)
            {
                foreach (Dictionary dictionary in efsSystem.Dictionaries)
                {
                    visitor.visit(dictionary);
                }
            }

            return(visitor.Usages);
        }
Ejemplo n.º 45
0
        /// <summary>
        ///     Provides the dictionary on which operation should be performed
        /// </summary>
        /// <returns></returns>
        public Dictionary GetPatchDictionary()
        {
            Dictionary retVal = null;

            MainWindow mainWindow = GuiUtils.MdiWindow;
            EfsSystem  efsSystem  = mainWindow.EfsSystem;

            if (efsSystem != null)
            {
                ModelElement modelElement = Item as ModelElement;
                if (modelElement != null)
                {
                    int updates = 0;
                    foreach (Dictionary dict in efsSystem.Dictionaries)
                    {
                        if (modelElement.Dictionary.IsUpdatedBy(dict))
                        {
                            // Set retVal to the update in case it is the only one for the base dictionary
                            retVal = dict;
                            updates++;
                        }
                    }

                    if (updates == 0)
                    {
                        MessageBox.Show("No updates loaded for the current dictionary.");
                    }

                    if (updates > 1)
                    {
                        // if there are 0 or 1 possible updates, it will already have the correct value
                        // if there are more, choose the update from a list of possibilities
                        DictionarySelector.DictionarySelector dictionarySelector =
                            new DictionarySelector.DictionarySelector(FilterOptions.Updates, modelElement.Dictionary);
                        dictionarySelector.ShowDictionaries(mainWindow);

                        if (dictionarySelector.Selected != null)
                        {
                            retVal = dictionarySelector.Selected;
                        }
                    }
                }
            }

            return(retVal);
        }
Ejemplo n.º 46
0
        private static NameSpace findNameSpace(string name)
        {
            NameSpace retVal = null;

            EfsSystem system = EfsSystem.Instance;

            foreach (Dictionary dictionary in system.Dictionaries)
            {
                retVal = OverallNameSpaceFinder.INSTANCE.findByName(dictionary, name);
                if (retVal != null)
                {
                    break;
                }
            }

            return(retVal);
        }
Ejemplo n.º 47
0
        /// <summary>
        ///     Finds the type of the structure corresponding to the provided NID_PACKET
        /// </summary>
        /// <param name="nameSpace">The namespace where the type has to be found</param>
        /// <param name="nidPacket">The id of the packet</param>
        /// <returns></returns>
        private static StructureValue FindStructure(int nidPacket)
        {
            EfsSystem system    = EfsSystem.Instance;
            Structure structure = null;
            NameSpace nameSpace = findNameSpace("Messages.PACKET.TRACK_TO_TRAIN");

            foreach (NameSpace packetNameSpace in nameSpace.NameSpaces)
            {
                Structure structureType =
                    (Structure)system.FindType(packetNameSpace, packetNameSpace.FullName + ".Message");
                StructureValue structureValue = new StructureValue(structureType);

                foreach (KeyValuePair <string, IVariable> pair in structureValue.SubVariables)
                {
                    string variableName = pair.Key;
                    if (variableName.Equals("NID_PACKET"))
                    {
                        IntValue value = pair.Value.Value as IntValue;
                        if (value.Val == nidPacket)
                        {
                            structure = structureType;
                        }
                    }
                    if (structure != null)
                    {
                        break;
                    }
                }
                if (structure != null)
                {
                    break;
                }
            }

            StructureValue retVal = null;

            if (structure != null)
            {
                retVal = new StructureValue(structure);
            }

            return(retVal);
        }
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="efsSystem"></param>
        /// <param name="name">the name of the function</param>
        public FunctionOnSurface(EfsSystem efsSystem, string name)
            : base(efsSystem, name)
        {
            Returns = (Function) acceptor.getFactory().createFunction();
            Returns.Name = Name + "ReturnType";
            Returns.ReturnType = EFSSystem.DoubleType;
            Returns.setFather(this);

            Parameter returnTypeParam1 = (Parameter) acceptor.getFactory().createParameter();
            returnTypeParam1.Name = Name + "ReturnTypeParam1";
            returnTypeParam1.Type = EFSSystem.DoubleType;
            returnTypeParam1.setFather(Returns);
            Returns.appendParameters(returnTypeParam1);

            Parameter returnTypeParam2 = (Parameter) acceptor.getFactory().createParameter();
            returnTypeParam2.Name = Name + "ReturnTypeParam2";
            returnTypeParam2.Type = EFSSystem.DoubleType;
            returnTypeParam2.setFather(Returns);
            Returns.appendParameters(returnTypeParam2);
        }
Ejemplo n.º 49
0
        /// <summary>
        ///     Constructor
        /// </summary>
        public Before(EfsSystem efsSystem)
            : base(efsSystem, "Before")
        {
            ExpectedFirst = (Parameter) acceptor.getFactory().createParameter();
            ExpectedFirst.Name = "ExpectedFirst";
            ExpectedFirst.Type = EFSSystem.AnyType;
            ExpectedFirst.setFather(this);
            FormalParameters.Add(ExpectedFirst);

            ExpectedSecond = (Parameter) acceptor.getFactory().createParameter();
            ExpectedSecond.Name = "ExpectedSecond";
            ExpectedSecond.Type = EFSSystem.AnyType;
            ExpectedSecond.setFather(this);
            FormalParameters.Add(ExpectedSecond);

            Collection = (Parameter) acceptor.getFactory().createParameter();
            Collection.Name = "Collection";
            Collection.Type = EFSSystem.GenericCollection;
            Collection.setFather(this);
            FormalParameters.Add(Collection);
        }
        public FullDecelerationForTarget(EfsSystem efsSystem)
            : base(efsSystem, "FullDecelerationForTarget")
        {
            Target = (Parameter) acceptor.getFactory().createParameter();
            Target.Name = "Target";
            Target.Type = EFSSystem.AnyType;
            Target.setFather(this);
            FormalParameters.Add(Target);

            DecelerationFactor = (Parameter) acceptor.getFactory().createParameter();
            DecelerationFactor.Name = "DecelerationFactor";
            DecelerationFactor.Type = EFSSystem.AnyType;
            DecelerationFactor.setFather(this);
            FormalParameters.Add(DecelerationFactor);

            // Third parameter end speed
            EndSpeed = (Parameter) acceptor.getFactory().createParameter();
            EndSpeed.Name = "EndSpeed";
            EndSpeed.Type = EFSSystem.AnyType;
            EndSpeed.setFather(this);
            FormalParameters.Add(EndSpeed);
        }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public StringCollection(EfsSystem efsSystem)
 {
     Enclosing = efsSystem;
     setMaxSize(int.MaxValue);
 }
Ejemplo n.º 52
0
 /// <summary>
 ///     Constrcutor
 /// </summary>
 public AnyType(EfsSystem efsSystem)
 {
     Enclosing = efsSystem;
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem">The system for which this function is created</param>
 /// <param name="name">The name of the predefined function</param>
 public PredefinedFunction(EfsSystem efsSystem, string name)
 {
     Enclosing = efsSystem;
     Name = name;
 }
Ejemplo n.º 54
0
 /// <summary>
 ///     Constrcutor
 /// </summary>
 public NoType(EfsSystem efsSystem)
 {
     Enclosing = efsSystem;
 }
 public StringType(EfsSystem efsSystem)
     : base(efsSystem, "String")
 {
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="dictionary"></param>
 /// <param name="name"></param>
 public PredefinedType(EfsSystem system, string name)
 {
     Enclosing = system;
     Name = name;
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="dictionary"></param>
 public IntegerType(EfsSystem efsSystem)
     : base(efsSystem, "Integer")
 {
 }
Ejemplo n.º 58
0
        private static ListValue get_message_packets(DBMessage message, NameSpace nameSpace, EfsSystem system)
        {
            ListValue retVal;

            Collection collectionType = (Collection) system.FindType(nameSpace, "Collection1");
            Structure subStructure1Type = (Structure) system.FindType(nameSpace, "SubStructure1");

            string packetLocation = "Messages.PACKET.";
            if (nameSpace.FullName.Contains("TRAIN_TO_TRACK"))
            {
                packetLocation += "TRAIN_TO_TRACK.Message";
            }
            else
            {
                packetLocation += "TRACK_TO_TRAIN.Message";
            }

            Structure packetStructureType = (Structure) system.FindType(nameSpace, packetLocation);

            retVal = new ListValue(collectionType, new List<IValue>());

            foreach (DBPacket packet in message.Packets)
            {
                DBField nidPacketField = packet.Fields[0] as DBField;
                if (nidPacketField.Value != "255") // 255 means "end of information"
                {
                    int packetId = int.Parse(nidPacketField.Value);
                    StructureValue subStructure = FindStructure(packetId);

                    int currentIndex = 0;
                    FillStructure(nameSpace, packet.Fields, ref currentIndex, subStructure);

                    StructureValue subStructure1 = new StructureValue(subStructure1Type);

                    // For Balise messages, we have an extra level of information to fill, so here we define StructureVal in one of two ways
                    StructureValue structureVal;
                    if (subStructure1.SubVariables.Count == 1 &&
                        subStructure1.SubVariables.ContainsKey("TRACK_TO_TRAIN"))
                    {
                        // For a Balise message, we have an extra level of structures for TRACK_TO_TRAIN
                        structureVal = new StructureValue(packetStructureType);

                        subStructure1.SubVariables["TRACK_TO_TRAIN"].Value = structureVal;
                    }
                    else
                    {
                        // For RBC, the collection directly holds the different packet types
                        structureVal = subStructure1;
                    }

                    // Find the right variable in the packet to add the structure we just created
                    foreach (KeyValuePair<string, IVariable> pair in structureVal.SubVariables)
                    {
                        string variableName = pair.Key;
                        string[] ids = subStructure.Structure.FullName.Split('.');
                        if (ids[ids.Length-2].Equals(variableName))
                        {
                            pair.Value.Value = subStructure;

                            retVal.Val.Add(subStructure1);

                            break;
                        }
                    }
                }
            }

            return retVal;
        }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="dictionary"></param>
 public DoubleType(EfsSystem efsSystem)
     : base(efsSystem, "Double")
 {
 }
Ejemplo n.º 60
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem"></param>
 public GenericCollection(EfsSystem efsSystem)
 {
     Enclosing = efsSystem;
 }