示例#1
0
 public GenSubParam(RecDao rec, ParsingCondition parsingCondition, ParsingGenerator parsingGenerator)
     : base(rec, parsingCondition, parsingGenerator)
 {
     MakeCondition(rec);
     OwnerId = rec.GetInt("OwnerId");
     rec.Put("ErrMess", ErrMess);
 }
示例#2
0
 public GenParam(RecDao rec, ParsingCondition parsingCondition, ParsingGenerator parsingGenerator)
     : base(rec, parsingCondition, parsingGenerator)
 {
     MakeCondition(rec);
     _task          = MakeField(rec, "Task");
     _calcParamType = MakeField(rec, "CalcParamType");
     _defaultValue  = MakeField(rec, "DefaultValue");
     CalcParamId    = rec.GetInt("CalcParamId");
     rec.Put("ErrMess", ErrMess);
 }
示例#3
0
 protected GenParamBase(RecDao rec, ParsingCondition parsingCondition, ParsingGenerator parsingGenerator)
 {
     ErrMess            = "";
     ParsingCondition   = parsingCondition;
     _parsingGenerator  = parsingGenerator;
     _code              = MakeField(rec, "Code");
     _name              = MakeField(rec, "Name");
     _units             = MakeField(rec, "Units");
     _inputs            = MakeField(rec, "Inputs");
     _userExpr1         = MakeField(rec, "UserExpr1");
     _userExpr2         = MakeField(rec, "UserExpr2");
     _interpolationType = MakeField(rec, "InterpolationType");
     _superProcessType  = MakeField(rec, "SuperProcessType");
     _comment           = MakeField(rec, "Comment");
     _min          = MakeField(rec, "Min");
     _max          = MakeField(rec, "Max");
     _tag          = MakeField(rec, "Tag");
     _receiverCode = MakeField(rec, "ReceiverCode");
     _codeSignal   = MakeField(rec, "CodeSignal");
 }
示例#4
0
        //Загрузка параметров из шаблона
        private void LoadParams()
        {
            AddEvent("Загрузка генерирующих параметров");
            var parsingCondition = new ParsingCondition();
            var parsingGenerator = new ParsingGenerator();

            using (var rec = new RecDao(_templateFile, "SELECT * FROM CalcParams WHERE GenOn=True"))
                using (var recs = new RecDao(rec.DaoDb, "SELECT CalcSubParams.* FROM CalcSubParams INNER JOIN CalcParams ON CalcParams.CalcParamId = CalcSubParams.OwnerId WHERE (CalcParams.GenOn = True) AND (CalcSubParams.GenOn = True)"))
                {
                    while (rec.Read())
                    {
                        var par = new GenParam(rec, parsingCondition, parsingGenerator);
                        Params.Add(par.CalcParamId, par);
                    }
                    while (recs.Read())
                    {
                        var par   = new GenSubParam(recs, parsingCondition, parsingGenerator);
                        var owner = Params[par.OwnerId];
                        owner.SubParams.Add(par);
                        par.Owner = owner;
                    }
                }
        }