Exemplo n.º 1
0
        //---------------------------------------------------------------------------
        // 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);
            }
        }
Exemplo n.º 2
0
        //**********************************************************************
        //**********************************************************************
        //**********************************************************************

        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);
            }
        }
Exemplo n.º 3
0
        //**********************************************************************

        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));
        }
Exemplo n.º 4
0
        //**********************************************************************

        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());
        }
Exemplo n.º 5
0
        //**********************************************************************

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