Exemple #1
0
        private static LNode StmtToCSharp(LNode stmt, IMacroContext context, bool execContext, Symbol parentConstruct)
        {
            if (!stmt.IsCall)
            {
                return(stmt);
            }
            if (stmt.Calls(S.Braces))
            {
                return(null);
            }

            var      helpers = RVList <LNode> .Empty;
            ExecInfo info;

            if (!StatementTypes.TryGetValueSafe(stmt.Name, out info))
            {
                info = new ExecInfo(-1, execContext);
            }

            var args = stmt.Args;

            for (int i = info.IgnoreMax; i < stmt.Args.Count; i++)
            {
                if (i == info.BraceIndex)
                {
                    continue;
                }
            }

            return(stmt);
        }
Exemple #2
0
        internal bool getExecIndex(int modelindex, out int index)
        {
            ExecInfo info;

            if (execmap.TryGetValue(modelindex, out info))
            {
                index = info.index;
                return(true);
            }
            else
            {
                if (filter.show_execution(modelindex))
                {
                    index = execs.Count + 1;
                    ExecInfo ei = new ExecInfo(modelindex, index);
                    execmap[modelindex] = ei;
                    execs.Add(ei);
                    return(true);
                }
                else
                {
                    index = 0;
                    return(false);
                }
            }
        }
Exemple #3
0
 void OnBeforeExecute()
 {
     _isExecuting = true;
     Cursor       = Cursors.WaitCursor;
     ExecInfo.Clear();
     StatusLbl.Text = "Running...";
     ExecBtn.Text   = "&Cancel";
 }
Exemple #4
0
        public int ToModelThread(int exec, int thread)
        {
            if (exec < 1 || exec > execs.Count)
            {
                return(-1);
            }
            ExecInfo info = execs[exec - 1];

            if (thread < 1 || thread > info.ts.Count)
            {
                return(-1);
            }
            return(info.ts[thread - 1]);
        }
 public string Evaluate(int exec_period_secs, string command, string workdir)
 {
     string id = GenerateUniqueIdFromExecParameters(command, workdir);
     ExecInfo exec_info;
     lock (this)
     {
         if (!m_ExecInfos.TryGetValue(id, out exec_info))
         {
             exec_info = new ExecInfo(exec_period_secs, command, workdir);
             m_ExecInfos.Add(id, exec_info);
         }
     }
     return exec_info.GetValue(exec_period_secs);
 }
        public string Evaluate(int exec_period_secs, string command, string workdir)
        {
            string   id = GenerateUniqueIdFromExecParameters(command, workdir);
            ExecInfo exec_info;

            lock (this)
            {
                if (!m_ExecInfos.TryGetValue(id, out exec_info))
                {
                    exec_info = new ExecInfo(exec_period_secs, command, workdir);
                    m_ExecInfos.Add(id, exec_info);
                }
            }
            return(exec_info.GetValue(exec_period_secs));
        }
Exemple #7
0
        internal bool getThreadIndex(int modelindex, int thread, out int index)
        {
            ExecInfo info = execmap[modelindex];

            if (info.tmap.TryGetValue(thread, out index))
            {
                return(true);
            }
            else
            {
                if (filter.show_thread(modelindex, thread))
                {
                    index             = info.tmap.Count + 1;
                    info.tmap[thread] = index;
                    info.ts.Add(thread);
                    return(true);
                }
                else
                {
                    index = 0;
                    return(false);
                }
            }
        }
Exemple #8
0
 void ExecPrint(string value)
 {
     ExecInfo.AppendText(value + Environment.NewLine);
 }
Exemple #9
0
 public ExecInfoTest()
 {
     _ExecInfo = new ExecInfo();
 }
Exemple #10
0
		private static LNode StmtToCSharp(LNode stmt, IMacroContext context, bool execContext, Symbol parentConstruct)
		{
			if (!stmt.IsCall)
				return stmt;
			if (stmt.Calls(S.Braces))
				return null;

			var helpers = RVList<LNode>.Empty;
			ExecInfo info;
			if (!StatementTypes.TryGetValueSafe(stmt.Name, out info))
				info = new ExecInfo(-1, execContext);

			var args = stmt.Args;
			for (int i = info.IgnoreMax; i < stmt.Args.Count; i++)
			{
				if (i == info.BraceIndex) continue;
			}

			return stmt;
		}