onbon.bx06.file
Class BxFileWriter<C>

java.lang.Object
  extended by onbon.bx06.file.BxFileWriter<C>
Type Parameters:
C - 驅動。

public final class BxFileWriter<C>
extends Object

BX 文件写入程式。

Author:
ONBON

Field Summary
static boolean DEBUG
           
static org.slf4j.Logger logger
           
 
Constructor Summary
BxFileWriter(Bx6GController controller, C owner)
          建构子。
 
Method Summary
 void addListener(BxFileWriterListener<C> listener)
          新增监听器。
 void clearListeners()
          清除所有监听器。
 void removeListener(BxFileWriterListener<C> listener)
          移除监听器。
 boolean writeConfig(ControllerConfigBxFile ccf)
          将屏幕参数写入控制器。
 boolean writeFile(String fileId, onbon.bx06.message.common.FileType fileType, byte[] data, byte[] crc)
          将文件写入控制器。
 void writeFileAsync(String fileId, onbon.bx06.message.common.FileType fileType, byte[] data, byte[] crc)
          将文件写入控制器。
 boolean writeLogo(LogoBxFile logo)
          将 LOGO 写入控制器。
 int writeLogoAsync(LogoBxFile logo)
          将 LOGO 写入控制器。
 boolean writePrograms(List<ProgramBxFile> pfs)
          同步将节目组写入控制器。
 int writeProgramsAsync(List<ProgramBxFile> pfs)
          非同步将节目组写入控制器。
 int writeProgramsAsyncQuickly(List<ProgramBxFile> pfs)
          非同步将节目组写入控制器。
 boolean writeProgramsQuickly(List<ProgramBxFile> pfs)
          同步将节目组写入控制器,本方法不做任何检查。
 boolean writeVoice(VoiceBxFile voice)
          将語音写入控制器。
 int writeVoiceAsync(VoiceBxFile voice)
          将語音写入控制器。
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG

logger

public static org.slf4j.Logger logger
Constructor Detail

BxFileWriter

public BxFileWriter(Bx6GController controller,
                    C owner)
建构子。

Parameters:
controller - 控制器。
owner - 驅動。
Method Detail

addListener

public void addListener(BxFileWriterListener<C> listener)
新增监听器。

Parameters:
listener - 监听器。

removeListener

public void removeListener(BxFileWriterListener<C> listener)
移除监听器。

Parameters:
listener - 监听器。

clearListeners

public void clearListeners()
清除所有监听器。


writeFile

public boolean writeFile(String fileId,
                         onbon.bx06.message.common.FileType fileType,
                         byte[] data,
                         byte[] crc)
                  throws Bx6GCommException
将文件写入控制器。

Parameters:
fileId - 写入編號。
fileType - 文件類型。
data - 資料。
crc - 檢核碼。
Returns:
文件結果。
Throws:
Bx6GCommException - 写入异常。

writeFileAsync

public void writeFileAsync(String fileId,
                           onbon.bx06.message.common.FileType fileType,
                           byte[] data,
                           byte[] crc)
将文件写入控制器。

Parameters:
fileId - 写入編號。
fileType - 文件類型。
data - 資料。
crc - 檢核碼。

writeLogo

public boolean writeLogo(LogoBxFile logo)
                  throws Bx6GException,
                         Bx6GCommException
将 LOGO 写入控制器。

Parameters:
logo - LOGO 文件。
Returns:
写入结果。
Throws:
Bx6GException - 写入异常。
Bx6GCommException - 通讯异常。

writeLogoAsync

public int writeLogoAsync(LogoBxFile logo)
将 LOGO 写入控制器。

Parameters:
logo - LOGO 文件。
Returns:
0: 成功,-1:未加载屏参。

writeVoice

public boolean writeVoice(VoiceBxFile voice)
                   throws Bx6GException,
                          Bx6GCommException
将語音写入控制器。

Parameters:
voice - 語音。
Returns:
写入结果。
Throws:
Bx6GException - 写入异常。
Bx6GCommException - 通讯异常。

writeVoiceAsync

public int writeVoiceAsync(VoiceBxFile voice)
将語音写入控制器。

Parameters:
voice - 語音。
Returns:
0: 成功,-1:未加载屏参。

writeConfig

public boolean writeConfig(ControllerConfigBxFile ccf)
                    throws Bx6GException,
                           Bx6GCommException
将屏幕参数写入控制器。

Parameters:
ccf - 屏幕参数。
Returns:
写入结果。
Throws:
Bx6GException - 写入异常。
Bx6GCommException - 通讯异常。

writeProgramsAsync

public int writeProgramsAsync(List<ProgramBxFile> pfs)
非同步将节目组写入控制器。

Parameters:
pfs - 节目组。
Returns:
0: 成功,-1:未加载屏参。

writeProgramsAsyncQuickly

public int writeProgramsAsyncQuickly(List<ProgramBxFile> pfs)
非同步将节目组写入控制器。

Parameters:
pfs - 节目组。
Returns:
0: 成功,-1:未加载屏参。

writeProgramsQuickly

public boolean writeProgramsQuickly(List<ProgramBxFile> pfs)
                             throws Bx6GCommException,
                                    Bx6GException
同步将节目组写入控制器,本方法不做任何检查。

Parameters:
pfs - 节目组。
Returns:
写入结果。
Throws:
Bx6GException - 写入异常。
Bx6GCommException - 通讯异常。

writePrograms

public boolean writePrograms(List<ProgramBxFile> pfs)
                      throws Bx6GCommException,
                             Bx6GException
同步将节目组写入控制器。

Parameters:
pfs - 节目组。
Returns:
写入结果。
Throws:
Bx6GException - 写入异常。
Bx6GCommException - 通讯异常。


Copyright © 2020 onbon. All rights reserved.