仰邦LED显示卡SDK对接思路!半成品第二个函数闪退有大老指点

dzkaiwen 9月前 596

Code AardioLine:111复制
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110.
  • 111.
    • import win.ui;
    • /*DSG{{*/
    • mainForm = win.form(text="仰邦LED";right=757;bottom=467;)
    • mainForm.add(
    • button={cls="button";text="发送节目";left=70;top=40;right=161;bottom=72;z=1;};
    • button2={cls="button";text="开机";left=63;top=306;right=154;bottom=338;z=2;};
    • button3={cls="button";text="关机";left=183;top=306;right=274;bottom=338;z=3;};
    • )
    • /*}}*/
    • import raw;
    • import string
    • led = ..raw.loadDll("\res\bx_sdk_dual.dll");
    • //初始化LED
    • led.bxDual_InitSdk()
    • //发送动态数据到控制器
    • class EQSound_6G {
    • byte SoundFlag = 0;
    • byte SoundPerson = 1;
    • byte SoundVolum;
    • byte SoundSpeed;
    • byte SoundDataMode;
    • int SoundReplayTimes;
    • int SoundReplayDelay;
    • byte SoundReservedParaLen;
    • byte Soundnumdeal;
    • byte Soundlanguages;
    • byte Soundwordstyle;
    • int SoundDataLen;
    • pointer SoundData;
    • }
    • class EQareaHeader_G6 { //区域属性
    • byte AreaType = 0; //区域类型
    • word AreaX = 0; //左上角
    • word AreaY = 0; //右
    • word AreaWidth = 96; //宽
    • word AreaHeight = 16; //高
    • byte BackGroundFlag = 0;
    • byte Transparency = 101;
    • byte AreaEqual = 0;
    • struct stSoundData = ..EQSound_6G();
    • }
    • class EQpageHeader_G6 { //显示属性
    • byte PageStyle = 0; //数据页类型
    • byte DisplayMode = 1; //显示方式
    • byte ClearMode = 0; //退出方式
    • byte Speed = 10; //速度等级1-64 1最快
    • word StayTime = 500; //停留秒
    • byte RepeatTime = 1;
    • word ValidLen = 96; //有效宽度
    • byte CartoonFrameRate=0;
    • byte BackNotValidFlag=0;
    • int arrMode = 1; //1为单行 2为多行
    • word fontSize = 12; //字体大小
    • int color = 1; //颜色
    • byte fontBold = 0;
    • byte fontItalic = 0;
    • word tdirection = 1;
    • word txtSpace = 0;
    • byte Valign = 0;
    • byte Halign = 0;
    • }
    • import console;
    • //UFT8 为65001 GBK 为936
    • mainForm.button.oncommand = function(id, event) {
    • // var text = "光庆你好 ";
    • var font = "宋体";
    • var color = 1; //1单基色 2 双基色
    • var ProgramID = 0; //默认从0开始
    • var EQareaHeader = EQareaHeader_G6(); //区域
    • var EQpageHeader = EQpageHeader_G6(); //显示内容
    • console.varDump(EQareaHeader,EQpageHeader)
    • var ret = led.bxDual_program_addArea_G6(ProgramID, EQareaHeader)
    • console.log(ret, "创建分区")
    • //var text = string.fromto("光庆你好 ", 65001, 936);
    • //var aa = raw.buffer("hello word AreaY");
    • // var fontb =raw.buffer("宋体");
    • //这条函数闪通
    • var ret = led.bxDual_dynamicArea_AddAreaTxtDetails_6G("192.168.1.4", 5005, ProgramID, EQareaHeader, EQpageHeader,"宋体", "hello word AreaY")
    • console.log(ret, "发送内容")
    • }
    • mainForm.button2.oncommand = function(id,event){
    • //开机
    • var ret =led.bxDual_cmd_coerceOnOff("192.168.1.4",5005,1)
    • console.log(ret)
    • }
    • mainForm.button3.oncommand = function(id,event){
    • //关机
    • var ret =led.bxDual_cmd_coerceOnOff("192.168.1.4",5005,0)
    • console.log(ret)
    • }
    • mainForm.show();
    • return win.loopMessage();


    最新回复 (0)
    返回