Example #1
0
        public bool ProcessData(XmlReader reader)
        {
            try
            {
                VectoApiRun = VectoApi.VectoInstance(reader);

                VectoApiRun.WaitFinished = false;  // RunSimulation is non-blocking!
                VectoApiRun.RunSimulation();
                m_vStatus = VectoStatus.enProcessing;
                return(true);
            }
            catch
            {
            }
            return(false);
        }
Example #2
0
        private VSumEntry Simulate(XmlReader xmlReader)
        {
            try
            {
                Helper.ToConsole(">> inner Simulate");
                var    run  = VectoApi.VectoInstance(xmlReader);
                SimJob job2 = new SimJob(run);

                run.WaitFinished = false;
                run.RunSimulation();

                while (!run.IsFinished)
                {
                    Thread.Sleep(100);
                }

                Helper.ToConsole(">> inner Simulate, done");
                bool bAnyAbortedCycle = job2.ContainsAbortedCycles();
                if (bAnyAbortedCycle == true)
                {
                }

                string strVSum = job2.CreateVSumBlob(DateTime.Now.ToUniversalTime()
                                                     .ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'"));

                VSumEntry entry = new VSumEntry();
                entry.ApiVersion = VectoApi.GetVectoCoreVersion();
                entry.LoadString(strVSum);

                Helper.ToConsole(">> inner Simulate, inner done");
                return(entry);
            }
            catch (Exception e)
            {
                Helper.ToConsole(string.Format("!! Reco3Simulator.Simulate, inner: {0}", e.Message));
            }

            return(null);
        }