示例#1
0
        void ProcessResult(string line, outputType eventType, Match matchResult)
        {
            // after getting the result and putting it to the lastResult var we are pulsing lock
            AutoResetEvent are = (AutoResetEvent)syncHandle [0];

            switch (eventType)
            {
            case outputType.interrupt:
                lastResult.threadId = Convert.ToInt32(matchResult.Groups [1].Value);
                lastResult.depth    = lastResult.depth_unprocessed = Convert.ToInt32(matchResult.Groups [2].Value);

                are.Set();
                break;

            case outputType.backtrace:
                var element = new HxcppStackInfo();
                //2: function name. 3: file name. 4: line number
                element.name = Convert.ToString(matchResult.Groups [2].Value);
                element.file = Convert.ToString(matchResult.Groups [3].Value);
                element.line = Convert.ToInt32(matchResult.Groups [4].Value);
                lastResult.stackElements.Add(element);
                lastResult.depth_unprocessed--;
                if (lastResult.depth_unprocessed < 0)
                {
                    are.Set();
                }
                break;

            case outputType.varsList:
                if (line != "}")
                {
                    lastResult.vars.Add(line);
                }
                else
                {
                    waitForVars = false;
                    are.Set();
                }
                break;
            }
        }
示例#2
0
        public string GenerateLettersQA(string templateLoc, string outputLoc, outputType outputType, string server, string database, string autoTagSource, string paramField, string paramValue, bool overwriteOuput = false)
        {
            string printStatus;

            if (File.Exists(outputLoc) && !overwriteOuput)
            {
                errorMessage = "Output file already exists(" + outputLoc + "). Default will not overwrite file;";
                return(errorMessage);
            }

            switch (outputType)
            {
            case outputType.Docx: printStatus = PrintDocxWindward(templateLoc, outputLoc, server, database, autoTagSource, paramField, paramValue); break;

            //case outputType.Pdf: printStatus = PrintPdf(templateLoc, outputLoc, server, database, autoTagSource,paramFields, paramValues); break;
            //case outputType.Printer: printStatus = PrintPrinter(templateLoc, outputLoc, server, database, autoTagSource,paramFields, paramValues); break;
            default: errorMessage = "Improper Output Letter Type Selected"; printStatus = errorMessage; break;
            }

            return(printStatus);
        }
        void ProcessResult(string line, outputType eventType, Match matchResult)
        {
            // after getting the result and putting it to the lastResult var we are pulsing lock
            AutoResetEvent are = (AutoResetEvent)syncHandle [0];
            switch (eventType)
            {
            case outputType.interrupt:
                lastResult.threadId = Convert.ToInt32 (matchResult.Groups [1].Value);
                lastResult.depth = lastResult.depth_unprocessed = Convert.ToInt32 (matchResult.Groups [2].Value);

                are.Set ();
                break;
            case outputType.backtrace:
                var element = new HxcppStackInfo ();
                //2: function name. 3: file name. 4: line number
                element.name = Convert.ToString (matchResult.Groups [2].Value);
                element.file = Convert.ToString (matchResult.Groups [3].Value);
                element.line = Convert.ToInt32 (matchResult.Groups [4].Value);
                lastResult.stackElements.Add (element);
                lastResult.depth_unprocessed--;
                if (lastResult.depth_unprocessed < 0) {
                    are.Set ();
                }
                break;
            case outputType.varsList:
                if (line != "}") {
                    lastResult.vars.Add (line);
                } else {
                    waitForVars = false;
                    are.Set ();
                }
                break;
            }
        }
示例#4
0
文件: Brain.cs 项目: Horonex/EcoSim
 private float GetOutput(outputType type)
 {
     return(outputs.GetNode(OStartIndexes[type]));
 }