Пример #1
0
 private void SeriesParseJoint(Stepper.RunningOption opt, string[] args)
 {
     opt.Step      = Convert.ToUInt16(args[1]);
     opt.StepDelay = Convert.ToUInt16(args[2]);
     if (args[3] == "l")
     {
         opt.dir = Stepper.Direction.Left;
     }
     else if (args[3] == "r")
     {
         opt.dir = Stepper.Direction.Right;
     }
 }
Пример #2
0
        private string ParseInput(string v)
        {
            string retString = "";

            string[] splitString = v.Split('?');
            Stepper.RunningOption        option1    = new Stepper.RunningOption();
            Stepper.RunningOption        option2    = new Stepper.RunningOption();
            Stepper.RunningOption        option3    = new Stepper.RunningOption();
            List <Stepper.RunningOption> listOption = new List <Stepper.RunningOption>();

            listOption.Add(option1);
            listOption.Add(option2);
            listOption.Add(option3);

            switch (splitString[0])
            {
            case "/index.html":
                ParseIndexWebpage(splitString[1], listOption);
                //if (option.RunInfitive) retString = File.ReadAllText("webpages\\stopmotor.html");
                //else retString = File.ReadAllText("webpages\\index.html");
                retString = File.ReadAllText("webpages\\index.html");
                break;

            case "/stopmotor.html":
                StepperA.ForceToStopMotor();
                retString = File.ReadAllText("webpages\\mainpage.html");
                break;

            case "/series.html":
                GetSeriesMoves(splitString[1], listOption);
                retString = File.ReadAllText("webpages\\index.html");
                break;

            default:
                retString = File.ReadAllText("webpages\\index.html");
                break;
            }
            return(retString);
        }