Beispiel #1
0
        public void initInstances(opis o)
        {
            global_log.log.CopyArr(new opis());
            CTX.Handle(o);

            var sentence = context.Find("sentence_context");

            StartPreparationMessages = sentence["preparation messages"].DuplicateA();

            ModelFactory.hotkeys = sentence["hotkeys"].DuplicateA();

            CTX.AddRootElem(sentence);
            SysInstance.Words = context;

            o["globalcomm"] = new opisEventsSubscription();
            o["globalcomm"].PartitionKind = "communicator";

            for (int i = 0; i < o["sys"].listCou; i++)
            {
                opis curr = o["sys"][i];

                opis p = context.Find(curr.PartitionName.Trim()).DuplicateA();
                if (!p.isInitlze)
                {
                    continue;
                }

                p.InitFuncObj2();
                o["sys_instances"].AddArr(p);
                p.Process("bind", o);
            }
        }
Beispiel #2
0
        public opis CodenotionScript(string specName, string sysName, string method, opis param)
        {
            var methodRun = CreateMethodMessage(sysName, method, param);

            lock (scriptLocker)
            {
                if (ScriptContext == null)
                {
                    OntologyTreeBuilder tpb = new OntologyTreeBuilder();
                    tpb.context = Parser.ContextGlobal["words"];

                    opis o = new opis("context");
                    o.PartitionName = "context";
                    o.Vset("level", "topBranch");
                    o.Vset(context.Higher, "none");
                    o.Vset(context.Organizer, "контекстречення");

                    tpb.buildTree(tpb.context.Find(specName), o);

                    opis currContext = o;
                    currContext["globalcomm"] = new opisEventsSubscription();

                    var vmsg = CreateMethodMessage(sysName, "version");

                    tpb.messagesToSend = new opis();
                    tpb.messagesToSend.AddArr(vmsg);

                    tpb.initInstances(currContext);

                    #if NETFRAMEWORK
                    if (SysInstance.Log != null)
                    {
                        SysInstance.Log.Clear();
                    }
                    #endif

                    tpb.contextToIgnite = currContext;
                    tpb.igniteTree();

                    ScriptContext = currContext;
                    //AddAnalytic(222, "Init new ScriptContext ", specName, vmsg["p"].serialize(), "");
                    ScriptContext["globalcomm"][sysName] = methodRun;
                }
                else
                {
                    try
                    {
                        ScriptContext["globalcomm"][sysName] = methodRun;
                    }
                    catch (Exception e)
                    {
                        //AddAnalytic(222, "Exception running ScriptContext " + e.StackTrace, specName, methodRun.serialize(), e.Message);
                    }
                }
            }

            return(methodRun["p"]);
        }
Beispiel #3
0
        public void SendMsg(opis msg)
        {
            if (!string.IsNullOrWhiteSpace(msg.V(MsgTemplate.msg)))
            {
                opisEventsSubscription newmsg = msg.DuplicateAs <opisEventsSubscription>();

                thisins["Models_log"]["instance_msg_aggr"] = (new opis("fill message params", "body ___"));

                instanse.ExecParamModels(newmsg[MsgTemplate.p]);
                instanse.ExecParamModels(newmsg);
                //instanse.ExecParamModels(newmsg[MsgTemplate.p]);

                instanse.ExecActionResponceModelsList(modelSpec[Features], newmsg);

                thisins["Models_log"]["instance_msg_aggr"].PartitionName = "msg_composion " + newmsg.V(MsgTemplate.msg);

                instanse.ThisRequest(newmsg.V(MsgTemplate.msg_receiver), newmsg.V(MsgTemplate.msg), newmsg);
            }
        }