Example #1
0
        public ActionRet AjaxGetUpdateLineData()
        {
            AjaxUpdateData data           = new AjaxUpdateData();
            IRealTimeData  dataHandel     = new RealTimeDataGenerator();
            ILineInfo      RegisteredData = new XMLLineInfoReader();
            DataRecorder   dataRecorder   = new DataRecorder();



            List <int> AllStatus   = dataHandel.getAllStatus(this.SessionData.LineNo);
            int        FinalStatus = LineStatusIDConvertor.getFinalStatus(AllStatus);

            data.SignalLight       = LineStatusIDConvertor.getBigSignalLight(FinalStatus);
            data.StatusDescription = LineStatusIDConvertor.getFinalStatusDsc(FinalStatus);
            data.SignalLights      = LineStatusIDConvertor.getSignalLights(AllStatus);
            data.StatusDscs        = LineStatusIDConvertor.getStautsDscs(AllStatus);
            data.Speed             = dataHandel.getSpeed(this.SessionData.LineNo);
            data.UMK_current       = dataHandel.getUMK_current(this.SessionData.LineNo);
            data.CurrentUMKDiff    = data.UMK_current / 100;
            data.Progress          = data.UMK_current * 100 / RegisteredData.getUMK_Total(this.SessionData.LineNo);
            data.CurrentCountDiff  = dataHandel.getCurrentCountDiff(this.SessionData.LineNo);

            dataRecorder.RecordLineOnConsole(this.SessionData.LineNo, data);
            dataRecorder.RecordLineOnTxtFile(this.SessionData.LineNo, data);
            dataRecorder.RecordLineOnCsvFile(this.SessionData.LineNo, data);

            return(OutputText(data.ToJSON()));
        }
Example #2
0
        public ActionRet Main()
        {
            IRealTimeData dataHandel     = new RealTimeDataGenerator();
            ILineInfo     RegisteredData = new XMLLineInfoReader();

            this.Model.LineNo          = GetParameter("lineNo").StrToInt();
            this.SessionData.LineNo    = GetParameter("lineNo").StrToInt();
            this.Model.WerkNo          = GetParameter("werkNo").StrToInt();
            this.Model.Administrator   = RegisteredData.getManager(this.Model.LineNo);
            this.Model.Assignment      = RegisteredData.getAssignment(this.Model.LineNo);
            this.Model.Item            = RegisteredData.getItem(this.Model.LineNo);
            this.Model.ItemDescription = RegisteredData.getItemDescription(this.Model.LineNo);
            this.Model.UMK_total       = RegisteredData.getUMK_Total(this.Model.LineNo);

            return(View("LineDetail", this.Model));
        }
Example #3
0
        public ActionRet AjaxGetUpdateData()
        {
            List <LineUpdateData> data           = new List <LineUpdateData>();
            IRealTimeData         dataHandel     = new RealTimeDataGenerator();
            ILineInfo             RegisteredData = new Services.XMLLineInfoReader();

            foreach (int lineNo in RegisteredData.getRegisteredLineNos(this.SessionData.WerkNo))
            {
                LineUpdateData lineUpdateData = new LineUpdateData();
                lineUpdateData.LineNo = lineNo;
                int FinalStatus = LineStatusIDConvertor.getFinalStatus(dataHandel.getAllStatus(lineNo));
                lineUpdateData.LastSignalLight       = LineStatusIDConvertor.getBigSignalLight(FinalStatus);
                lineUpdateData.LastStatusDescription = LineStatusIDConvertor.getFinalStatusDsc(FinalStatus);
                lineUpdateData.Speed    = dataHandel.getSpeed(lineNo);
                lineUpdateData.Progress = dataHandel.getUMK_current(lineNo) * 100 / RegisteredData.getUMK_Total(lineNo);
                data.Add(lineUpdateData);
            }

            return(OutputText(data.ToJSON()));
        }