仰邦BX-C04显示屏二次开发

1、项目需求

通过调用第三方接口查询相关信息,并按指定格式展示
在这里插入图片描述

2、开发

整体排版其实按照提供SDK开发就行,较为简单。其中有一点是测试了半天,就是针对动态显示的内容,这个地方需要使用动态区域,然后针对设定的动态区域进行内容更新。比如上面的装车物料、层数、袋数等内容,这些都是一直查询接口然后实时更新的。最初使用字母,然后整体更新节目,这种会刷新整体,屏幕内容更新的时候就会一闪一闪的,用动态区域可以解决。

public static void showLoadingInfo() throws Exception {
   
        // 初始化API,此操作只在程序启动时候执行一次,多次执行会出现内存错误
        Y2Env.initial();

        Y2Screen screen = new Y2Screen(url);
        boolean result = screen.login("guest", "guest");
        log.warn("login result:" + result);

        // 创建节目
        ProgramPlayFile pf = new ProgramPlayFile(1);

        // 创建一个字幕区1
        MarqueeArea marea1 = new MarqueeArea(20, 0, 256, 22);

        // 区域1字幕内容
        marea1.addContent("无锡中粮工程科技有限公司");

        // 创建一个字幕区2
        MarqueeArea marea2 = new MarqueeArea(20, 22, 176, 22);
        marea2.addContent(laneNo + "车道  车牌号:");

        MarqueeArea marea3 = new MarqueeArea(20, 44, 176, 22);
        marea3.addContent("当前装车物料:");

        // 创建一个字幕区3
        MarqueeArea marea4 = new MarqueeArea(20, 66, 156, 22);
        marea4.addContent("当前装车层数: ");


        // 创建一个字幕区4
        MarqueeArea marea5 = new MarqueeArea(20, 88, 156, 22);
        marea5.addContent("当前装车袋数: ");


        // 时钟区域
        Da
led dll接口调用。 public class bx5k_err { public const int ERR_NO = 0; //No Error public const int ERR_OUTOFGROUP = 1; //Command Group Error public const int ERR_NOCMD = 2; //Command Not Found public const int ERR_BUSY = 3; //The Controller is busy now public const int ERR_MEMORYVOLUME = 4; //Out of the Memory Volume public const int ERR_CHECKSUM = 5; //CRC16 Checksum Error public const int ERR_FILENOTEXIST = 6; //File Not Exist public const int ERR_FLASH = 7;//Flash Access Error public const int ERR_FILE_DOWNLOAD = 8; //File Download Error public const int ERR_FILE_NAME = 9; //Filename Error public const int ERR_FILE_TYPE = 10;//File type Error public const int ERR_FILE_CRC16 = 11;//File CRC16 Error public const int ERR_FONT_NOT_EXIST = 12;//Font Library Not Exist public const int ERR_FIRMWARE_TYPE = 13;//Firmware Type Error (Check the controller type) public const int ERR_DATE_TIME_FORMAT = 14;//Date Time format error public const int ERR_FILE_EXIST = 15;//File Exist for File overwrite public const int ERR_FILE_BLOCK_NUM = 16;//File block number error public const int ERR_COMMUNICATE = 100;//通信失败 public const int ERR_PROTOCOL = 101;//协议数据不正确 public const int ERR_TIMEOUT = 102;//通信超时 public const int ERR_NETCLOSE = 103;//通信断开 public const int ERR_INVALID_HAND = 104;//无效句柄 public const int ERR_PARAMETER = 105;//参数错误 public const int ERR_SHOULDREPEAT = 106;//需要重复上次数据包 public const int ERR_FILE = 107;//无效文件 }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值