示例#1
0
        public ProtocolSet(ProgramLayer layer)
        {
            Records = new List <FieldSet>();

            foreach (var protocol in layer.Protocols)
            {
                Records.Add(new FieldSet(protocol));
            }

            Cache = new CacheChain(Records.SelectMany(r => r.MasterRecords).ToList());
        }
示例#2
0
        public static void Compile(List <Protocol> protocols)
        {
            Layers.Clear();
            ProgramSet.RuleProgram.Clear();

            var rootLayer = new ProgramLayer();

            rootLayer.AddProtocol(ProtocolLibrary.GetRoot());
            Layers.Add(rootLayer);

            foreach (var p in protocols)
            {
                AddProtocol(p);
            }

            Validate();

            //generate the program set beased on statically available Layers var
            ProgramSet.Generate();
        }