Exemplo n.º 1
0
        private ParkFullLed _DixiaKongjian;  //地下空间用
        #endregion

        #region 私有方法
        private void InitLED()
        {
            try
            {
                //满位显示屏
                if (AppSettings.CurrentSetting.ParkFullLedCOMPort > 0)
                {
                    _ParkFullLed = new ZhongKuangLed(AppSettings.CurrentSetting.ParkFullLedCOMPort);
                    _ParkFullLed.Open();
                    if (ParkBuffer.Current.Parks.Count == 1)  //显示车位余数
                    {
                        ParkInfo park = ParkBuffer.Current.Parks[0];
                        _ParkFullLed.DisplayMsg(string.Format("{0}{1}", park.VacantText, park.Vacant), int.MaxValue);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionPolicy.HandleException(ex);
            }

            try
            {
                string filePath = System.IO.Path.Combine(Application.StartupPath, "ParkFullLed.xml");
                if (System.IO.File.Exists(filePath))  //显示在地下空间满位显示屏上
                {
                    _DixiaKongjian = ParkFullLed.Create(filePath);
                    _DixiaKongjian.Open();
                }
            }
            catch (Exception ex)
            {
                ExceptionPolicy.HandleException(ex);
            }
        }
Exemplo n.º 2
0
        public void SendDataTest()
        {
            ParkFullLed led = new ParkFullLed();

            led.ID        = 1;
            led.Mark      = 0x10;
            led.Width     = 4;
            led.Height    = 2;
            led.ShowMode  = 4;
            led.MoveSpeed = 1;
            led.Pause     = 0;
            led.Append    = 0;
            led.Color     = 1;

            byte[] data  = led.GetSendData("  1234秒123456次");
            byte[] cdata = new byte[] {
                0x55, 0x1D, 0x00, 0x01, 0x00, 0x10,
                0x04, 0x01, 0x00, 0x00, 0x08, 0x02, 0x01, 0x00,
                0x20, 0x20, 0x31, 0x32, 0x33, 0x34, 0xC3, 0xEB, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0xB4, 0xCE,
                0x0E, 0xF9, 0xaa
            };

            Assert.IsTrue(data.Length == cdata.Length);
            for (int i = 0; i < data.Length; i++)
            {
                Assert.IsTrue(data[i] == cdata[i], string.Format("data[{0}]==cdata[{1}]出错,{2}!={3}", i, i, data[i], cdata[i]));
            }

            data  = led.GetSendData("欢迎领导莅临指导");
            cdata = new byte[]
            {
                0x55, 0x1D, 0x00, 0x01, 0x00, 0x10,
                0x04, 0x01, 0x00, 0x00, 0x08, 0x02, 0x01, 0x00,
                0xBB, 0xB6, 0xD3, 0xAD, 0xC1, 0xEC, 0xB5, 0xBC, 0xDD, 0xB0, 0xC1, 0xD9, 0xD6, 0xB8, 0xB5, 0xBC,
                0x3F, 0x95, 0xAA
            };
            Assert.IsTrue(data.Length == cdata.Length);
            for (int i = 0; i < data.Length; i++)
            {
                Assert.IsTrue(data[i] == cdata[i], string.Format("data[{0}]==cdata[{1}]出错,{2}!={3}", i, i, data[i], cdata[i]));
            }
        }
Exemplo n.º 3
0
 private void DixiakongjianRender(ParkInfo park)
 {
     try
     {
         string filePath = System.IO.Path.Combine(Application.StartupPath, "ParkFullLed.xml");
         if (System.IO.File.Exists(filePath))  //显示在地下空间满位显示屏上
         {
             if (_DixiaKongjian == null)
             {
                 _DixiaKongjian = ParkFullLed.Create(filePath);
                 _DixiaKongjian.Open();
             }
             _DixiaKongjian.DisplayVacantInfo(park.Vacant);
         }
     }
     catch (Exception ex)
     {
         ExceptionPolicy.HandleException(ex);
     }
 }