Пример #1
0
        public static PbCmdArg GetPbCmdArg(string cmd, int min, int max, int interp)
        {
            string[] cmdArray = cmd.Split(',');
            if (cmdArray.Length <= 1)
            {
                return(null);
            }

            int nr = -1;

            for (int i = 1; i < cmdArray.Length; ++i)
            {
                if (cmdArray[i].ToLower() == "val")
                {
                    nr = i - 1;
                    break;
                }
            }
            if (nr == -1)
            {
                return(null);
            }

            string buff  = cmd.Replace("val", "0");
            PbCmd  pbCmd = PbCmd.GetPbCmd(buff);

            return(pbCmd == null || nr >= pbCmd.args.Length  ?  null : new PbCmdArg(pbCmd, nr, cmd, min, max, interp));
        }
Пример #2
0
 private PbCmdArg(PbCmd cmd, int argNr, string name, int min, int max, int interp)
 {
     this.cmd    = cmd;
     this.argNr  = argNr;
     this.name   = name;
     this.min    = min;
     this.max    = max;
     this.interp = interp;
     val         = min;
 }
Пример #3
0
        public static void ExecuteCmd(PbCmd cmd)
        {
            cmd.method.Invoke(null, cmd.args);

            if (Auto.GetLastError() != AutoError.None)
            {
                LogCtrl.Error("PB Error: " + Auto.GetLastError().ToString());
            }

            if (cmd.args.Length > 0)
            {
                LogCtrl.Status("PB: " + cmd.method.Name + "," + string.Join(",", cmd.args));
            }
            else
            {
                LogCtrl.Status("PB: " + cmd.method.Name);
            }
        }