Ejemplo n.º 1
0
        public virtual void Initialize()
        {
            try
            {
                // Log = new Log(ConfigurationManager.AppSettings["txtlog"], Convert.ToBoolean(ConfigurationManager.AppSettings["logtofile"]));
                // initialize Communicators
                Communicator = CommunicatorList?.ToDictionary((p) => p.Name);

                Crane = CraneList?.ToDictionary((p) => p.Name);

                Conveyor = ConveyorList?.ToDictionary((p) => p.Name);

                Segment = SegmentList?.ToDictionary((p) => p.Name);

                // initialize ConveyorUnits
                ConveyorList?.ForEach(p => p.Initialize(this));
                SegmentList?.ForEach(p => p.Initialize(this));
                CraneList?.ForEach(p => p.Initialize(this));
                CommunicatorList?.ForEach(prop => prop.Initialize(this));
                StrategyList?.ForEach(p => p.Initialize(this));
                SteeringCommands?.Initialize(this);


                ConveyorList?.ForEach(prop => prop.Startup());
                CraneList?.ForEach(prop => prop.Startup());
                SteeringCommands?.Startup();

                WMS?.Initialize(this);
            }
            catch (Exception ex)
            {
                AddEvent(Event.EnumSeverity.Error, Event.EnumType.Exception, ex.Message);
                AddEvent(Event.EnumSeverity.Error, Event.EnumType.Exception, String.Format("{0} BasicWarehouse.Initialize failed", Name));
            }
        }
Ejemplo n.º 2
0
 public BasicWarehouse()
 {
     SteeringCommands = new SteeringCommands();
     OnNewEvent       = new List <Action <DateTime, Event.EnumSeverity, Event.EnumType, string> >();
     _lock            = new object();
     BindingOperations.EnableCollectionSynchronization(OnNewEvent, _lock);
 }