Ejemplo n.º 1
0
        private static void Load_IF_MACHINE()
        {
            var table = InputMart.Instance.IF_MACHINE;

            if (table == null || table.Rows.Count == 0)
            {
                return;
            }

            if (MainHelper.CheckActiveAction(table.TableName) == false)
            {
                return;
            }

            var      modelContext = ModelContext.Current;
            DateTime now          = modelContext.StartTime;

            string factoryID = LcdHelper.GetTargetFactoryID();
            //DateTime versionDate = LcdHelper.GetVersionDate();

            var result = OutputMart.Instance.RSL_RTS_EQP_STATUS_IF;

            foreach (var entity in table.DefaultView)
            {
                string shopID = entity.FACTORYNAME;
                string eqpID  = entity.MACHINENAME;

                if (DataVaildHelper.IsVaildEqp(eqpID) == false)
                {
                    continue;
                }

                var find = result.Find(factoryID, shopID, eqpID);
                if (find == null)
                {
                    find            = new RSL_RTS_EQP_STATUS_IF();
                    find.FACTORY_ID = factoryID;
                    find.SHOP_ID    = shopID;
                    find.EQP_ID     = eqpID;

                    result.Add(find);
                }

                find.STATUS      = entity.MACHINESTATENAME;
                find.REASON_CODE = entity.LASTEVENTNAME;

                DateTime eventStartTime = LcdHelper.DbToDateTime(LcdHelper.SafeSubstring(entity.LASTEVENTTIMEKEY, 0, 14));
                find.EVENT_START_TIME = LcdHelper.DbDateTime(eventStartTime);

                DateTime dueDate = LcdHelper.DbToDateTime(LcdHelper.SafeSubstring(entity.DUEDATE, 0, 14));
                find.EVENT_END_TIME = LcdHelper.DbDateTime(dueDate);

                find.UPDATE_DTTM = now;
            }

            //更新最新的 BATCH信息(by LotHistory)
            //LAST진행 BATCH 정보 업데이트(by LotHistory)
            Update_RSL_RTS_EQP_STATUS_IF();

            //LAST ACID浓度信息
            //LAST ACID 농도 정보
            Load_IF_CT_FACILITYRESULTHISTORY();

            //更新CHAMBER EQP STATUS信息
            //CHAMBER EQP STATUS 정보 업데이트
            Load_IF_MACHINESPEC_CHAMBER();

            var dashboard = InputMart.Instance.Dashboard;

            //设定时间 (lastLotEventTime)
            //확정된 시간 (lastLotEventTime) 설정
            DateTime lastLotEventTime = dashboard.LastLotEventTime;

            foreach (var entity in result.Table.Rows)
            {
                entity.IF_TIME = lastLotEventTime;
            }
        }