public void CdioCloseTimer()
        {
            CdioControl cdioControl = CdioControl.GetInstance();

            cdioControl.CloseTimer();
            Response.Redirect("/ControlBlock/Index");
        }
        public void MotoRunning()
        {
            CdioControl cdioControl = CdioControl.GetInstance();

            cdioControl.setMotoRunning();
            Response.Redirect("/ControlBlock/Index");
        }
        // GET: ControlBlock
        public ActionResult Index()
        {
            IniFileControl inifileControl = IniFileControl.GetInstance();
            CdioControl    cdioControl    = CdioControl.GetInstance();
            DealControl    dealControl    = DealControl.GetInstance();

            ViewData["FileTimerState"]  = inifileControl.TimerState() == false?"关闭":"开启";
            ViewData["TimerTimerState"] = inifileControl.Timer2State() == false ? "关闭" : "开启";
            ViewData["DealState"]       = dealControl.getConnectState() == false ? "断开" : "连接";
            if (cdioControl.InitMoto().Equals("Success"))
            {
                ViewData["CdioInitState"] = "连接";
            }
            else
            {
                CdioCloseTimer();
                ViewData["CdioInitState"] = cdioControl.InitMoto();
            }
            ViewData["CdioTimerState"] = cdioControl.TimerState() == false ? "关闭" : "开启";
            ControlBlockViewModel controlblockviewModel = new ControlBlockViewModel
            {
                readiniModel = inifileControl.ReadInifile()
            };

            return(View(controlblockviewModel));
        }
Esempio n. 4
0
 public void execute()
 {
     CdioControl.GetInstance().setMotoRunning();
 }