Ejemplo n.º 1
0
        public CoreBaseNew()
        {
            sess_group = new List<SockSessNew>();
            dispatcher = new DispatcherBase();

            dispatcher.RegisterDefaultService("DefaultService", DefaultService);
            dispatcher.RegisterService("SockOpenService", SockOpenService, Encoding.UTF8.GetBytes("/center/sockopen"));
            dispatcher.RegisterService("SockCloseService", SockCloseService, Encoding.UTF8.GetBytes("/center/sockclose"));
            dispatcher.RegisterService("SockSendService", SockSendService, Encoding.UTF8.GetBytes("/center/socksend"));
        }
Ejemplo n.º 2
0
        public CoreBase()
        {
            // init timectl
            timectl = new TimeOutCtl();

            // init sessctl
            sessctl = new SessCtl();
            sessctl.sess_parse += new SessCtl.SessDelegate(SessParse);
            sessctl.sess_create += new SessCtl.SessDelegate(SessCreate);
            sessctl.sess_delete += new SessCtl.SessDelegate(SessDelete);

            // init dispatcher
            dispatcher = new DispatcherBase();
        }
Ejemplo n.º 3
0
        public IList <IHandlingBatch> SORT_LOT_GROUP_CONTENTS1(DispatcherBase db, IList <IHandlingBatch> list, IDispatchContext ctx, ref bool handled, IList <IHandlingBatch> prevReturnValue)
        {
            list.QuickSort(LotGroupSorter);

            return(list);
        }
Ejemplo n.º 4
0
        public IHandlingBatch[] SELECT1(DispatcherBase db, AoEquipment aeqp, IList <IHandlingBatch> wips, ref bool handled, IHandlingBatch[] prevReturnValue)
        {
            if (InputMart.Instance.GlobalParameters.ApplyFlexialePMSchedule == false)
            {
                return(prevReturnValue);
            }

            if (prevReturnValue == null)
            {
                return(prevReturnValue);
            }

            var list = aeqp.DownManager.GetStartScheduleItems(Time.MaxValue);

            if (list == null || list.Count == 0)
            {
                return(prevReturnValue);
            }

            FabLot lot = prevReturnValue[0] as FabLot;

            var eqp     = aeqp.ToFabAoEquipment();
            var proc    = eqp.Processes[0];
            var outTime = proc.GetUnloadingTime(lot);

            bool isLast      = eqp.IsLastPlan(lot);
            bool isNeedSetup = ResHelper.IsNeedSetup(eqp, lot);

            foreach (var item in list)
            {
                var schedule = item.Tag as PeriodSection;
                var isPM     = schedule is PMSchedule;

                if (isPM == false)
                {
                    continue;
                }

                var pm = schedule as FabPMSchedule;
                var reaminNextPMStart = pm.StartTime - eqp.NowDT;

                //하루 이내만 조정
                if (reaminNextPMStart.TotalDays > 1)
                {
                    continue;
                }

                bool          isAdjust = false;
                FabPMSchedule adjust   = pm.Clone() as FabPMSchedule;

                if (isLast)
                {
                    if ((DateTime)outTime < pm.LimitDelayTime && outTime > pm.StartTime)
                    {
                        adjust.StartTime      = (DateTime)outTime;
                        adjust.EndTime        = adjust.StartTime.AddMinutes(pm.InputDuration.TotalMinutes);
                        adjust.Description    = "DELAY";
                        adjust.AllowAheadTime = (float)(outTime - eqp.Now).TotalMinutes;
                        adjust.ScheduleType   = DownScheduleType.ShiftBackward;

                        aeqp.DownManager.AdjustEvent(item, adjust);
                        isAdjust = true;
                    }
                }
                else
                {
                    if (reaminNextPMStart.TotalMinutes < pm.AllowAheadTime)
                    {
                        prevReturnValue  = null;
                        adjust.StartTime = aeqp.NowDT;
                        adjust.EndTime   = adjust.StartTime.AddMinutes(pm.InputDuration.TotalMinutes);

                        if (adjust.Description != "DELAY")
                        {
                            adjust.Description = "AHEAD";
                        }

                        adjust.IsNeedAdjust = false;

                        aeqp.DownManager.AdjustEvent(item, adjust);
                        isAdjust = true;
                    }
                }

                if (isAdjust == false && pm.StartTime < outTime)
                {
                    float setupTime = 0f;
                    if (isNeedSetup)
                    {
                        setupTime = SetupMaster.GetSetupTime(aeqp, lot);
                    }

                    adjust.StartTime = (DateTime)(outTime + Time.FromMinutes(setupTime));
                    adjust.EndTime   = adjust.StartTime.AddMinutes(pm.InputDuration.TotalMinutes);

                    aeqp.DownManager.AdjustEvent(item, adjust);
                }
            }

            //var data = aeqp.DownManager.GetStartScheduleItems(Time.MaxValue);
            return(prevReturnValue);
        }
Ejemplo n.º 5
0
 protected void RemoveEventListener(string key, DispatcherBase <UIDisPatcher, object[], string> .OnActionHandler handler)
 {
     UIDisPatcher.Instance.RemoveEventListener(key, handler);
 }
 /// <summary>Creates service definition that can be registered with a server</summary>
 public static ServerServiceDefinition BindService(DispatcherBase serviceImpl)
 {
     return(ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_Dispatch, serviceImpl.Dispatch)
            .AddMethod(__Method_DispatchEvent, serviceImpl.DispatchEvent).Build());
 }
Ejemplo n.º 7
0
 public void SetDispatcher(DispatcherBase dispatcher)
 {
     this.dispatcher = dispatcher;
 }
Ejemplo n.º 8
0
 private void LogOutputEventHandler(DispatcherBase dispatcher, LogOutLevelType levelType, string log) => this.Log(levelType, log);
Ejemplo n.º 9
0
        private static void Experiment(string control, DateTime startDate, string experimentOutputDirectory, bool dynamic, bool stochastic, double weightA, double weightB, double weightC, Dictionary <string, double> deterministicNonProductiveTimesRMS, Dictionary <string, double> deterministicNonProductiveTimesARMS, int CPTimeLimit = 0)
        {
            string     outputDir = experimentOutputDirectory;
            Simulation sim       = new Simulation("LithographyAreaSim", outputDir);

            // Parameters
            double simulationLength  = 30 * 24 * 3600 + 1;
            string productionControl = control;

            // The experiment part
            sim.MyExperiment.LengthOfReplication = simulationLength;
            sim.MyExperiment.LengthOfWarmUp      = 0;
            if (stochastic)
            {
                sim.MyExperiment.NumberOfReplications = 1;
            }
            else
            {
                sim.MyExperiment.NumberOfReplications = 1;
            }

            // The model part

            // Create lithographyarea
            LithographyArea lithographyarea = new LithographyArea(sim.MyModel, "LithographyArea", startDate, simulationLength, dynamic, stochastic, weightA, weightB, weightC, deterministicNonProductiveTimesRMS, deterministicNonProductiveTimesARMS);

            // Property dispatcherBase
            DispatcherBase dispatcher = null;

            // Create chosen dispatcher
            if (productionControl == "FIFO")
            {
                dispatcher = new FIFODispatcher(lithographyarea, "FIFODispatcher");
            }
            else if (productionControl == "EDD")
            {
                dispatcher = new EDDDispatcher(lithographyarea, "EDDDispatcher");
            }
            else if (productionControl == "SPT")
            {
                dispatcher = new SPTDispatcher(lithographyarea, "SPTDispatcher");
            }
            else if (productionControl == "CurrentProductionControl")
            {
                dispatcher = new CurrentDispatcher(lithographyarea, "CurrentDispatcher");
            }
            else if (productionControl == "ILPScheduling")
            {
                dispatcher = new ILPSchedulingDispatcher(lithographyarea, "ILPSchedulingDispatcher");
            }
            else if (productionControl == "CPScheduling")
            {
                dispatcher = new CPDispatcher(lithographyarea, "CPDispatcher", CPTimeLimit);
            }

            // Set dispatcher
            lithographyarea.SetDispatcher(dispatcher);

            // Create and set lotGenerator
            LotGenerator lotGenerator = new LotGenerator(lithographyarea, "LotGenerator", dispatcher);

            lithographyarea.SetLotGenerator(lotGenerator);

            // Create and set machines
            lithographyarea.AddMachine(new Machine(lithographyarea, "StepCluster#1", dispatcher, 1));
            lithographyarea.AddMachine(new Machine(lithographyarea, "StepCluster#2", dispatcher, 2));
            lithographyarea.AddMachine(new Machine(lithographyarea, "StepCluster#3", dispatcher, 3));
            lithographyarea.AddMachine(new Machine(lithographyarea, "ASML#4", dispatcher, 4));
            lithographyarea.AddMachine(new Machine(lithographyarea, "StepCluster#5", dispatcher, 5));
            lithographyarea.AddMachine(new Machine(lithographyarea, "ASML#6", dispatcher, 6));
            lithographyarea.AddMachine(new Machine(lithographyarea, "StepCluster#7", dispatcher, 7));
            lithographyarea.AddMachine(new Machine(lithographyarea, "StepCluster#8", dispatcher, 8));
            lithographyarea.AddMachine(new Machine(lithographyarea, "ASML#9", dispatcher, 9));
            lithographyarea.AddMachine(new Machine(lithographyarea, "StepCluster#10", dispatcher, 10));
            lithographyarea.AddMachine(new Machine(lithographyarea, "StepCluster#11", dispatcher, 11));
            lithographyarea.AddMachine(new Machine(lithographyarea, "StepCluster#13", dispatcher, 12));

            // The observer part

            LithographyAreaObserver lithographyAreaObserver = new LithographyAreaObserver(sim, startDate);

            lithographyarea.Subscribe(lithographyAreaObserver);

            foreach (Machine machine in lithographyarea.Machines)
            {
                MachineObserver machineObserver = new MachineObserver(sim, startDate);
                machine.Subscribe(machineObserver);
            }

            // Run

            sim.Run();

            // The reporting part

            SimulationReporter reporter = sim.MakeSimulationReporter();

            reporter.PrintSummaryToFile();
            reporter.PrintSummaryToConsole();
        }
Ejemplo n.º 10
0
 protected void AddEventListener(string key, DispatcherBase <UIDispatcher, object, string> .OnActionHandler handler)
 {
     UIDispatcher.Instance.AddEventListener(key, handler);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 监听UI观察者派发的消息
 /// </summary>
 /// <param name="key"></param>
 /// <param name="handler"></param>
 public void AddEventListen(string key, DispatcherBase <UIDispatcher, object[], string> .OnActionHandler handler)
 {
     UIDispatcher.Instance.AddEventListen(key, handler);
 }
Ejemplo n.º 12
0
 public async Task SendObject(DispatcherBase sender, UpdateEventArgs args)
 {
     await SendObject(args.MessageType, args.Data);
 }