Ejemplo n.º 1
0
 public ExperimentData(double[] signalGeneratorInput, ExperimentInitialSettings initialSettings)
 {
     InitialSettings = initialSettings;
     scopeData = new ScopeData();
     SignalGeneratorData = new SignalGeneratorData(signalGeneratorInput);
     SignalGeneratorInputFileName = "";
     PointsInCycle = signalGeneratorInput.Length;
     InitializeExperimentData();
 }
Ejemplo n.º 2
0
        public CodeDomArg(CodeExpression codeExpression, IScopeData scope)
        {
            MethodIdentifier = Guid.NewGuid().ToString("N");
            CodeExpression = codeExpression;
            Scope = scope;

            ParentMemberDefinitions = new CodeTypeMemberCollection();
            ParentStatements = new CodeStatementCollection();
        }
Ejemplo n.º 3
0
 public ExperimentData(IEnumerable<double> signalGeneratorArbitraryOutput, ExperimentInitialSettings initialSettings)
 {
     scopeData = new ScopeData();
     ScopeData.SampleMode = ScopeSampleMode.Average;
     SignalGeneratorData = new SignalGeneratorData(signalGeneratorArbitraryOutput);
     SignalGeneratorInputFileName = "From array.";
     InitialSettings = initialSettings;
     PointsInCycle = signalGeneratorArbitraryOutput.Count();
     InitializeExperimentData();
 }
Ejemplo n.º 4
0
        private BufferTable FetchBufferTable(NestedSelectStatement statement, IScopeData scope, IList <CodeAssignStatement> codeAssignments, out Boolean outerLoopNeeded)
        {
            outerLoopNeeded = false;
            string aliasId     = ((AliasBase)statement.Parent).Alias.Id;
            var    bufferTable = new BufferTable()
            {
                Variable = aliasId
            };

            for (int x = 0; x < statement.Args.Length; x++) //select args
            {
                var domSelectArg = VisitChild(statement.Args[x], new CodeDomArg()
                {
                    Scope = scope
                });
                if (((SelectArgsInfo)domSelectArg.Tag).IsPickStatement)
                {
                    outerLoopNeeded = true;
                }

                if (((SelectArgsInfo)domSelectArg.Tag).ColumnName == null) //have to have a column name in a nested select
                {
                    Errors.Add(new NoColumnName(x + 1, new Semantic.LineInfo(statement.Args[x].Line.Line, statement.Args[x].Line.CharacterPosition)));
                }

                var primitive = TablePrimitive.FromType(domSelectArg.Scope.CodeType);
                bufferTable.Children.Add(new TableColumnArg()
                {
                    Variable = ((SelectArgsInfo)domSelectArg.Tag).DisplayColumnName, Type = primitive.TypeString
                });

                var assignment = new CodeAssignStatement();
                assignment.Left  = new CodePropertyReferenceExpression(new CodeTypeReferenceExpression("resultRow"), ((SelectArgsInfo)domSelectArg.Tag).DisplayColumnName);
                assignment.Right = domSelectArg.CodeExpression;
                codeAssignments.Add(assignment);
            }

            return(bufferTable);
        }