//--------------------------------------------------------------------------- // Execute public override void execute(CmdLineCmd aCmd) { // Read Members if (aCmd.isCmd("Code1")) { mCode1 = aCmd.argInt(1); } if (aCmd.isCmd("Code2")) { mCode2 = aCmd.argInt(1); } if (aCmd.isCmd("Code3")) { mCode3 = aCmd.argInt(1); } if (aCmd.isCmd("Code4")) { mCode4 = aCmd.argInt(1); } if (aCmd.isCmd("Command1")) { executeCommand1(aCmd); } if (aCmd.isComment()) { executeIsComment(aCmd); } }
//********************************************************************** //********************************************************************** //********************************************************************** public void OnGo2(CmdLineCmd aCmd) { aCmd.setArgDefault(1, 1); aCmd.setArgDefault(1, 10); int tN = aCmd.argInt(1); int tK = aCmd.argInt(2); System.Random tRandom = new Random(); for (int i = 0; i < tN; i++) { int tX = tRandom.Next(tK); Console.WriteLine("{0} X = {1}", i, tX); } }
//********************************************************************** public void ExecuteGo2(CmdLineCmd aCmd) { aCmd.setArgDefault(1, "aaaaaaa"); aCmd.setArgDefault(2, 111); aCmd.setArgDefault(3, 22.22); Console.WriteLine("{0} {1} {2}", aCmd.argString(1), aCmd.argInt(2), aCmd.argDouble(3)); }
//********************************************************************** public void executeGo5(CmdLineCmd aCmd) { aCmd.setArgDefault(1, 101); int tX = aCmd.argInt(1); Console.WriteLine("X {0}", tX); Console.WriteLine("Comment {0} {1}", aCmd.hasComment(), aCmd.comment()); }
//********************************************************************** public void ExecuteTx(CmdLineCmd aCmd) { aCmd.setArgDefault(1, 1); int tMsgType = aCmd.argInt(1); switch (tMsgType) { case 1: { TestMsg tMsg = new TestMsg(); Helper.initialize(tMsg); Global.mNetworkThread.sendMsg(tMsg); break; } case 2: { FirstMessageMsg tMsg = new FirstMessageMsg(); Helper.initialize(tMsg); Global.mNetworkThread.sendMsg(tMsg); break; } case 3: { StatusRequestMsg tMsg = new StatusRequestMsg(); Helper.initialize(tMsg); Global.mNetworkThread.sendMsg(tMsg); break; } case 4: { StatusResponseMsg tMsg = new StatusResponseMsg(); Helper.initialize(tMsg); Global.mNetworkThread.sendMsg(tMsg); break; } case 5: { DataMsg tMsg = new DataMsg(); Helper.initialize(tMsg); Global.mNetworkThread.sendMsg(tMsg); break; } } }