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)); }
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; }
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); } }