Пример #1
0
        //Begin with "Cmd"
        public static void ProcessCmd(string _sOut)
        {
            if (_sOut.Length > 5 && _sOut[3] == '[')
            {
                //Get app name
                int _nStartIndex = 4;
                int _nEndIndex   = _sOut.IndexOf(']', _nStartIndex);
                if (_nEndIndex != -1)
                {
                    string _sAppName  = _sOut.Substring(_nStartIndex, _nEndIndex - _nStartIndex);
                    int    _nStartCmd = _sOut.IndexOf(':', _nEndIndex);
                    if (_nStartCmd != -1)
                    {
                        string _sCmd = _sOut.Substring(_nStartCmd + 1);
                        ProcessCmdSendToApp(_sCmd, _sAppName);
                        return;
                    }
                }
                Output.TraceErrorLite("C> Unable to Process:" + _sOut);
            }


            /*
             * if(_sOut.Length > 8 && _sOut[3] == '(' && _sOut[4] == 'a' && _sOut[5] == 'd' && _sOut[6] == 'd' && _sOut[7] == ')') {
             *  //add to cmd list
             *  aList.Add(_sOut.Substring(8));
             *       Output.TraceWarning("Add:" +_sOut.Substring(8) );
             * }*/
        }
Пример #2
0
        public static void fShowResult(OutToken _oOut)
        {
            string _sOut = _oOut.sOut;
            CppCmd _oCmd = _oOut.oFrom;

            if (Data.bNowBuilding)
            {
                if (fManageMessages(_oCmd, _sOut))
                {
                    return;
                }

                if (_oOut.eType == OutType.Undefined)
                {
                    Output.TraceUndefined(_sOut);
                    return;
                }
                if (_oOut.eType == OutType.Warning)
                {
                    Output.TraceWarningLite(_sOut);
                    return;
                }
                if (_oOut.eType == OutType.Error)
                {
                    Output.TraceErrorLite(_sOut);
                    return;
                }

                //Add color manually
                if (_sOut.Length > 8)
                {
                    if (_sOut[7] == ':')                      //no color by default
                    {
                        bool   bFound = false;
                        string _sCmd  = _sOut.Substring(0, 7).ToLower();
                        switch (_sCmd)
                        {
                        case "warning":
                            bFound = true;
                            Output.TraceWarning(_sOut);
                            break;
                        }
                    }
                }

                string _sResult = Output.Trace(_sOut, true);

                /*
                 * if( Data.oMainForm != null) {
                 *   Data.oMainForm.fAddItem(_sResult);
                 * }*/
            }
        }
Пример #3
0
        public static void ProcessCmdSendToApp(string _sCmd, string _sAppName)
        {
            string _sAppNameNorm = _sAppName.ToLower();

            foreach (LaunchTool _oLaunch in LaunchTool.aLaunchList)
            {
                if (_oLaunch.sExeName.ToLower() == _sAppNameNorm)
                {
                    Output.TraceActionLite("C> Send[" + _sAppName + "]:" + _sCmd);
                    //  _oLaunch.fSend(_sCmd.Substring(_sCmd.Length));
                    _oLaunch.fSend(_sCmd.Trim());
                    return;
                }
            }
            Output.TraceErrorLite("C> Unable to Send:[" + _sAppName + "]" + _sCmd);
        }
Пример #4
0
 public static void ProcessStdErr(string _sOut)
 {
     if (_sOut.Length > 4 && _sOut[0] == 'C' && _sOut[1] == 'm' && _sOut[2] == 'd' && (_sOut[3] == ':' || _sOut[3] == '(' || _sOut[3] == '['))
     {
         //Output.TraceActionLite("C> " + _sOut);
         ProcessCmd(_sOut);
     }
     else
     {
         if (_sOut.IndexOf("warning") != -1)
         {
             Output.TraceWarningLite("W> " + _sOut);
         }
         else
         {
             Output.TraceErrorLite("E> " + _sOut);
         }
     }
 }