123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using ONNONLed5KSDKD;
- namespace BroadcastModule
- {
- public class Program
- {
- public void MainTest(string[] args)
- {
- BroadcastBoardManager bbm = new BroadcastBoardManager();
- uint handle = 0;
- //addScreen 1 模式
- if(bbm.AddScreen(0, Encoding.Default.GetBytes("192.168.0.17"),5005, Led5kSDK.bx_5k_card_type.BX_6K3_YY, 1, 2))
- {
- handle = bbm.boardList[bbm.boardList.Count - 1].boardParams.handle;
- }
- if (handle == 0)
- {
- Console.WriteLine("失败");
- return;
- }
- //bb.RemoveDynamicAreas(handle);
- ////第一行128*16显示文字,上下8像素留空
- //bb.header_model.AreaWidth = 2;// 2=16/8
- //bb.header_model.AreaHeight = 96;
- //bb.header_model.AreaX = 8/8;
- //bb.header_model.AreaY = 0;
- //bb.header_model.SingleLine = 0x02;
- //bb.header_model.NewLine = 0x02;
- //bb.header_model.DisplayMode = 0x02;
- //bb.header_model.StayTime = 2;
- //bb.header_model.RunMode = 1;
- //bb.header_model.Speed = 1;
- ////bb.header_model.AreaY = 16;
- //int areaNo = bb.AddDynamicArea(handle, bb.header_model);
- //if (areaNo != -1)
- //{
- // //bb.UpdateArea(handle, areaNo, Encoding.Default.GetBytes("\\C1温馨提示:请带好随\\C2身携带的物品," + "依次从\\C3后边门下车。\\n"));
- // bb.UpdateArea(handle, areaNo, Encoding.Default.GetBytes(""));
- //}
- ////第二、三行64*64显示一个指示标志
- //bb.header_model.AreaWidth = 12;// 12=96/8
- //bb.header_model.AreaHeight = 96;
- //bb.header_model.SingleLine = 0x01;
- //bb.header_model.NewLine = 0x01;
- //bb.header_model.DisplayMode = 0x02;
- //bb.header_model.StayTime = 5;
- //bb.header_model.RunMode = 2;
- //bb.header_model.AreaX = (32+16) / 8;
- //bb.header_model.AreaY = 16;
- //int area1 = bb.AddDynamicArea(handle, bb.header_model);
- //if (area1 != -1)
- //{
- // bb.UpdateArea(handle, area1, Encoding.Default.GetBytes("\\T001arrU64|"));
- // //updateList.Add(new AreaInfo(handle, area1, Encoding.Default.GetBytes(" ")));
- // //bb.UpdateArea(handle, areaNoArrU, Encoding.Default.GetBytes("\\T000arrL|\\n\\T000arrU|\\n\\T000arrR|\\n\\T000arrD|"));
- //}
- //////left
- ////bb.header_model.AreaX = 0;
- ////bb.header_model.AreaY = 0;
- ////bb.header_model.AreaWidth = 8;// 8=64/8
- ////bb.header_model.AreaHeight = 64;
- ////int area2 = bb.AddDynamicArea(handle, bb.header_model);
- ////if (area2 != -1)
- ////{
- //// //updateList.Add(new AreaInfo(handle, area2, Encoding.Default.GetBytes("\\T000arrL|\\n\\T000arrU|\\n\\T000arrR|\\n\\T000arrD|")));
- //// updateList.Add(new AreaInfo(handle, area2, Encoding.Default.GetBytes(" ")));
- ////}
- //string sentence = "温馨提示:请携带好随身物品,关闭车窗与车门,待所有人员离开车库后,再操作终端停车";
- //List<string> sentenceContent = new List<string>();
- //int i = 0;
- //while(i < sentence.Length)
- //{
- // if((i+6)%6==0)
- // {
- // if (i < sentence.Length - 5)
- // {
- // char[] temp = (sentence.Substring(i, 6)).ToCharArray();
- // temp = temp.Reverse().ToArray();
- // sentenceContent.Add(new String(temp));
- // i = i + 5;
- // }
- // else
- // {
- // sentenceContent.Add(new String(sentence.Substring(i).ToCharArray().Reverse().ToArray()));
- // break;
- // }
- // }
- // i++;
- //}
- //string[] dispContent = {"\\T001arrU64|", "\\T001arrD64|" , "\\T001arrL64|" , "\\T001arrR64|" };
- ////string[] dispContent2 = { "\\T000arrU|", "\\T000arrD|", "\\T000arrL|", "\\T000arrR|" };
- Task.Factory.StartNew(() =>
- {
- int count = 0;
- int lightIndex = 0;
- Random rnd = new Random(DateTime.Now.Millisecond);
- bbm.boardList[0].UpdateText("温馨提示:请携带好随身物品,关闭车窗与车门,待所有人员离开车库后,再操作终端停车", 1);
- lightIndex = rnd.Next(0, 4);
- bbm.boardList[0].UpdateArrow(lightIndex);
- while (count < 10000)
- {
-
- //bb.UpdateArea(handle, areaNo, Encoding.Default.GetBytes(sentenceContent[count%sentenceContent.Count]));
-
- //bb.UpdateArea(handle, 1, Encoding.Default.GetBytes(dispContent[lightIndex]));
- //Console.WriteLine(areaNo + ", " + area1);
- //Console.WriteLine(dispContent[lightIndex]);
- //}
- //bb.UpdateArea(handle, 1, Encoding.Default.GetBytes("\\T000arrL|\\n\\T000arrU|\\n\\T000arrR|\\n\\T000arrD|"));
- //bb.UpdateArea(handle, 0, Encoding.Default.GetBytes("\\T000arrL|"));
- Thread.Sleep(1000);
- count++;
- }
- });
- //bb.UpdateArea(handle, 2, Encoding.Default.GetBytes("\\T000arrL|\\n\\T000arrU|\\n\\T000arrR|\\n\\T000arrD|"));
- //bb.UpdateArea(handle, 1, Encoding.Default.GetBytes("\\T000arrL|\\n\\T000arrU|\\n\\T000arrR|\\n\\T000arrD|"));
- //bb.UpdateArea(handle, 0, Encoding.Default.GetBytes("\\T000arrL|"));
- Console.ReadLine();
- bbm.DestroyAll();
- }
- }
- }
|