Beispiel #1
0
        private byte GetHardwareInvalidType(EventInvalidType invalidType)
        {
            switch (invalidType)
            {
            case EventInvalidType.INV_UnRegister:
                return(0);                      //此卡未登记

            case EventInvalidType.INV_ReadCard: //请继续读卡,用于作读写器使用
                return(1);

            case EventInvalidType.INV_CarPlateWrong:
            case EventInvalidType.INV_CarPlateWrongWithPaid:
            case EventInvalidType.INV_InvalidImg:
                return(4);     //图像有差异

            case EventInvalidType.INV_Recycled:
                return(5);    //此卡已注销

            case EventInvalidType.INV_Loss:
                return(6);    //此卡已锁定

            case EventInvalidType.INV_Lock:
                return(7);    //此卡已挂失

            case EventInvalidType.INV_Type:
                return(8);    //非停车卡类

            case EventInvalidType.INV_NotActive:
            case EventInvalidType.INV_NoAccessRight:
            case EventInvalidType.INV_DisableNestedPark:
            case EventInvalidType.INV_ForbidTempCard:
                return(9);    //未准入本场

            case EventInvalidType.INV_HaveIn:
                return(10);    //此卡已入场

            case EventInvalidType.INV_StillOut:
                return(11);     //此卡已出场

            case EventInvalidType.INV_ParkFull:
                return(13);     //车位已满

            case EventInvalidType.IVN_NotPaid:
                return(14);    //未缴费

            case EventInvalidType.INV_OverTime:
                return(15);     //超时补交费

            case EventInvalidType.INV_OverDate:
                return(16);    //此卡已过期

            case EventInvalidType.INV_Balance:
                return(18);    //余额不足

            default:
                return(9);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 向控制板发送卡片无效
        /// </summary>
        /// <param name="cardevent"></param>
        public override void CardInValid(EventInvalidType invalidType, object param)
        {
            if (AppSettings.CurrentSetting.Debug)
            {
                FileLog.Log(EntranceName, "发送卡片无效" + CardInvalidDescripition.GetDescription(invalidType));
            }
            Packet p = _PacketCreater.CreateCardInvalidPacket(Address, invalidType, param);

            _CommComponent.SendPacket(p);
        }
Beispiel #3
0
 public Packet CreateCardInvalidPacket(byte address, EventInvalidType invalidType, object param)
 {
     if (invalidType == EventInvalidType.INV_OverDate && param is DateTime)
     {
         //卡等待/有效/无效指令+参数长度(采用可变长度)+1字节语音显示参数+1字节内屏显示模式参数(总为0)+1字节卡类型+2字节卡编号+年月日
         Packet p = new Packet();
         p.Order   = OrderCode.Comm_CardInvalid;
         p.Address = address;
         p.AddByte(GetHardwareInvalidType(invalidType));
         p.AddByte(0);
         p.AddByte(0);
         p.AddShort((short)1000);
         p.AddDate((DateTime)param);
         return(p);
     }
     else if (invalidType == EventInvalidType.INV_Balance && param is decimal)
     {
         //卡等待/有效/无效指令+参数长度(采用可变长度)+1字节语音显示参数+1字节内屏显示模式参数(总为0)+1字节卡类型+2字节卡编号+余额
         Packet p = new Packet();
         p.Order   = OrderCode.Comm_CardInvalid;
         p.Address = address;
         p.AddByte(GetHardwareInvalidType(invalidType));
         p.AddByte(0);
         p.AddByte(0);
         p.AddShort((short)1000);
         p.AddInt(TariffSetting.Current.TariffOption.FromYuan((decimal)param));
         return(p);
     }
     else
     {
         //卡等待/有效/无效指令+参数长度(采用可变长度)+1字节语音显示参数+1字节内屏显示模式参数(总为0)+1字节卡类型+2字节卡编号
         Packet p = new Packet();
         p.Order   = OrderCode.Comm_CardInvalid;
         p.Address = address;
         p.AddByte(GetHardwareInvalidType(invalidType));
         p.AddByte(0);
         p.AddByte(0);
         p.AddShort((short)1000);
         return(p);
     }
 }
Beispiel #4
0
 /// <summary>
 /// 向控制板发送卡片无效
 /// </summary>
 public abstract void CardInValid(EventInvalidType reason, object param);