| | |
| | | case 1: |
| | | write((List<LedCommand>)task.getData()); |
| | | break; |
| | | // 写数据 |
| | | case 9: |
| | | write9((List<LedCommand>)task.getData()); |
| | | break; |
| | | // 复位 |
| | | case 2: |
| | | reset(); |
| | |
| | | close(); |
| | | } |
| | | |
| | | private void write9(List<LedCommand> list) throws Bx5GException { |
| | | if (!connect()) { |
| | | return; |
| | | } |
| | | pf = new ProgramBxFile( 0, screen.getProfile()); |
| | | pf.setFrameShow(false); |
| | | // 分别输入X,Y,width,height |
| | | area = new TextCaptionBxArea( 0,0,96,48, screen.getProfile()); |
| | | // 创建一个数据页 |
| | | TextBxPage page = new TextBxPage(); |
| | | for (LedCommand command : list) { |
| | | page.newLine(command.getTitle()); |
| | | page.newLine("\n"); |
| | | } |
| | | |
| | | // 设置字体 |
| | | page.setFont(new Font("宋体",Font.PLAIN,12)); |
| | | // 设置文本颜色 |
| | | page.setForeground(Color.red); |
| | | // 设置显示特技为快速打出 |
| | | page.setDisplayStyle(styles[6]); |
| | | area.clearPages(); |
| | | area.addPage(page); |
| | | pf.addArea(area); |
| | | if (pf.validate() != null) { |
| | | log.info("pf out of range"); |
| | | } else { |
| | | // 更新节目 |
| | | screen.writeProgram(pf); |
| | | // resetStatus = false; |
| | | } |
| | | close(); |
| | | } |
| | | |
| | | private void reset() throws Bx5GException { |
| | | if (!connect()) { |
| | | return; |