Example #1
0
        public NETPark(ParkInfo park, ParkBase parent)
            : base(park, parent)
        {
            foreach (EntranceInfo en in park.Entrances)  //初始化主控制器
            {
                if (en.IsMaster && _Master == null)
                {
                    AddEntrance(en);
                }
            }

            foreach (EntranceInfo en in park.Entrances)  //初始化所有其它的控制器,都设置成非主控,且其主控IP设置为_Master的IP
            {
                if (GetEntrance(en.EntranceID) == null)
                {
                    AddEntrance(en);
                }
            }

            if (park.SubParks != null && park.SubParks.Count > 0)
            {
                foreach (ParkInfo subPark in park.SubParks)
                {
                    NETPark sub = new NETPark(subPark, this);
                    AddSubPark(sub);
                }
            }
            BeginBackGroudWork();
        }
Example #2
0
        public EntranceBase(EntranceInfo info, ParkBase parent)
        {
            Parent    = parent;
            _entrance = info;
            _status   = EntranceStatus.UnKnown; //初始状态设置为未知

            if (info.TicketReaderCOMPort > 0)
            {
                _TicketReader              = new BarCodeReader(info.TicketReaderCOMPort);
                _TicketReader.BarCodeRead += new BarCodeReadEventHandler(TicketReader_BarCodeRead);
                _TicketReader.Open();
            }
            if (info.TicketPrinterCOMPort > 0)
            {
                _TicketPrinter = new KPM150BarCodePrinter(info.TicketPrinterCOMPort);
                _TicketPrinter.Open();
            }
            //初始化处理消息包的线程
            _PacketHandleThread = new Thread(ReportHandle_Thread);
            _PacketHandleThread.Start();

            Thread t = new Thread(new ThreadStart(HeartBeatCheck_Thread));

            t.IsBackground = true;
            t.Start();
        }
Example #3
0
 private void ListenParkEvents(ParkBase park)
 {
     park.CardCaptureReporting            += new ReportingHandler <CardCaptureReport>(park_CardCaptureReporting);
     park.CardEventReporting              += new ReportingHandler <CardEventReport>(park_CardEventReporting);
     park.CardInvalidReporting            += new ReportingHandler <CardInvalidEventReport>(park_CardInvalidReporting);
     park.CarSenseReporting               += new ReportingHandler <CarSenseReport>(park_CarSenseReporting);
     park.EntranceRemainTempCardReporting += new ReportingHandler <EntranceRemainTempCardReport>(park_EntranceRemainTempCardReporting);
     park.EntranceStatusReporting         += new ReportingHandler <EntranceStatusReport>(park_EntranceStatusReporting);
     park.ParkVacantReporting             += new ReportingHandler <ParkVacantReport>(park_ParkVacantReporting);
     park.DeviceResetReporting            += new ReportingHandler <DeviceResetReport>(park_DeviceResetReporting);
     park.AlarmReporting += new ReportingHandler <AlarmReport>(park_AlarmReporting);
 }
Example #4
0
 public CANPark(ParkInfo park, CommComponent commport, ParkBase parent)
     : base(park, parent)
 {
     _commComponent = commport;
     if (park.SubParks != null && park.SubParks.Count > 0)
     {
         foreach (ParkInfo subPark in park.SubParks)
         {
             CANPark sub = new CANPark(subPark, _commComponent, this);
             AddSubPark(sub);
         }
     }
     foreach (EntranceInfo en in park.Entrances)
     {
         AddEntrance(en, false);
     }
     BeginBackGroudWork();
 }
Example #5
0
        public CANEntrance(CommComponent comPort, EntranceInfo info, ParkBase parent)
            : base(info, parent)
        {
            _CommComponent = comPort;
            _CommComponent.ReportReceviced += RecevicedPacketEventHandler;
            if (info.Address == CanAddress.HostEntrance)
            {
                SyncTime();
                SetEntranceMode(Parent.WorkMode);  //设置工作模式
                ////控制器复位 ,由于控制板在车压地感时复位会使其它地址加一,且厂家也推荐不要经常进行复位操作,但由于一号板偶尔会不正常,所以目前只复位一号板
                //Thread t1 = new Thread(ResetHardWare_Thread);
                //t1.IsBackground = true;
                //t1.Start();

                Thread t2 = new Thread(OnlineQuery_Thread);
                t2.IsBackground = true;
                t2.Start();
            }
        }