// 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));
        }
        public void CancelDeal()
        {
            DealControl dealControl = DealControl.GetInstance();

            dealControl.DealConnectDis();
            Response.Redirect("/ControlBlock/Index");
        }
 public void OpenTest(int StationId)
 {
     if (baserepo.RollerBaseStations.FirstOrDefault(x => x.RollerBaseStationID == StationId).State == false)
     {
         baserepo.ChangeStationState(StationId, true);
         IniFileControl.GetInstance().OpenRollerTimeSwitch(baserepo.RollerBaseStations.FirstOrDefault(x => x.RollerBaseStationID == StationId).Station);
         RollerSampleInfo rollersampleinfo = samplerepo.RollerSampleInfos.FirstOrDefault(x => x.RollerBaseStationID == StationId && x.State == true);
         samplerepo.setsampleStartTime(rollersampleinfo);
         DealControl.GetInstance().setRollerLimit(StationId, rollersampleinfo.UpLimit, rollersampleinfo.DnLimit);
     }
     Response.Redirect("/TestBlock/Index");
 }
示例#4
0
 public void execute()
 {
     DealControl.GetInstance().DealConnect();
 }