public void TimerCloseTimer()
        {
            IniFileControl inifileControl = IniFileControl.GetInstance();

            inifileControl.CloseTimer2();
            Response.Redirect("/ControlBlock/Index");
        }
        public void FileOpenTimer()
        {
            IniFileControl inifileControl = IniFileControl.GetInstance();

            inifileControl.OpenTimer();
            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));
        }
Exemplo n.º 4
0
        public ViewResult EditSample(int RollerSampleInfoID)
        {
            SettingViewModel settingviewModel = new SettingViewModel(baserepository);
            RollerSampleInfo rollersampleinfo = repository.RollerSampleInfos.FirstOrDefault(p => p.RollerSampleInfoID == RollerSampleInfoID);

            ViewData["StationList"] = settingviewModel.GetStationList(projectrepo.RollerProjectInfos.FirstOrDefault(a => a.RollerProjectInfoID == rollersampleinfo.RollerProjectInfo.RollerProjectInfoID).TestDevice);
            IniFileControl.GetInstance().CloseRollerTimeSwitch(rollersampleinfo.RollerBaseStation.Station);
            return(View(rollersampleinfo));
        }
Exemplo n.º 5
0
 private void HandleGetData(List <ChannelData> info)
 {
     foreach (var p in info)
     {
         Send(p.channel, p.data);
         if (JudgeLimit(p))
         {
             IniFileControl.GetInstance().CloseRollerTimeSwitch(faultdata.station);
         }
         ;
     }
 }
Exemplo n.º 6
0
 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");
 }
Exemplo n.º 7
0
 public void CloseTest(int StationId)
 {
     if (baserepo.RollerBaseStations.FirstOrDefault(x => x.RollerBaseStationID == StationId).State == true)
     {
         baserepo.ChangeStationState(StationId, false);
         int sampleId = samplerepo.RollerSampleInfos.FirstOrDefault(x => x.State == true && x.RollerBaseStationID == StationId).RollerSampleInfoID;
         samplerepo.setsampleState(sampleId, false);
         samplerepo.setsampleEndTime(sampleId);
         IniFileControl.GetInstance().CloseRollerTimeSwitch(baserepo.RollerBaseStations.FirstOrDefault(x => x.RollerBaseStationID == StationId).Station);
         IniFileControl.GetInstance().CleanRollerTime(baserepo.RollerBaseStations.FirstOrDefault(x => x.RollerBaseStationID == StationId).Station);
     }
     Response.Redirect("/TestBlock/Index");
 }
Exemplo n.º 8
0
 public void execute()
 {
     IniFileControl.GetInstance().CloseTimer2();
 }
Exemplo n.º 9
0
 public void execute()
 {
     IniFileControl.GetInstance().OpenTimer();
 }
Exemplo n.º 10
0
 public ActionResult DeleteSample(int RollerSampleInfoID, int RollerProjectInfoId)
 {
     IniFileControl.GetInstance().CloseRollerTimeSwitch(repository.RollerSampleInfos.FirstOrDefault(x => x.RollerSampleInfoID == RollerSampleInfoID).RollerBaseStation.Station);
     repository.DeleteRollerSampleInfo(RollerSampleInfoID);
     return(RedirectToAction("ViewInfo", new { RollerProjectInfoID = RollerProjectInfoId }));
 }
Exemplo n.º 11
0
 public void CleanTimer(int StationId)
 {
     IniFileControl.GetInstance().CleanRollerTime(baserepo.RollerBaseStations.FirstOrDefault(x => x.RollerBaseStationID == StationId).Station);
     Response.Redirect("/TestBlock/Index");
 }