4.3. ISDCBBuilder

added in version 1.7.0

An interface to provide functions to generate commands for the customer display control.

This interface is only for models which support a customer display.For the supporting models, refer to Supported Peripherals .

  • Property

    Name

    Contents

    commands

    Generated commands.

    passThroughCommands

    Generated or added commands to which adds a pass-through command.

  • Method

    Name

    Contents

    appendData

    Adds data (text or command) to the command buffer.

    appendBackSpace

    Generates a backspace command, and then adds it to the command buffer.

    appendHorizontalTab

    Generates a horizontal tab command, and then adds it to the command buffer.

    appendLineFeed

    Generates a line feed command, and then adds it to the command buffer.

    appendCarriageReturn

    Generates a carriage-return command, and then adds it to the command buffer.

    appendBitmap

    Generates a graphic display command, and then adds it to the command buffer.

    appendInternational

    Select command of the international character mode is generated and added to the command buffer.

    appendCodePage

    Select command of the code page is generated and added to the command buffer.

    appendDeleteToEndOfLine

    Generates a command to clear the screen until the end of the line, and then adds it to the command buffer.

    appendClearScreen

    Generates a command to clear the screen, and then adds it to the command buffer.

    appendHomePosition

    Generates a command to move the cursor to the home position, and then adds it to the command buffer.

    appendTurnOn

    Generates a command to turn on/off the backlight, and then adds it to the command buffer.

    appendSpecifiedPosition

    Generates a command to move the cursor to the specified position, and then adds it to the command buffer.

    appendCursorMode

    Generates a command to change the cursor mode, and then adds it to the command buffer.

    appendContrastMode

    Generates a command to change the contrast mode, and then adds it to the command buffer.

    appendUserDefinedCharacter

    Generates a command to register user-defined characters (SBCS), and then adds it to the command buffer.

    appendUserDefinedDbcsCharacter

    Generates a command to register user-defined characters (DBCS), and then adds it to the command buffer.

4.3.1. SDCBInternationalType

added in version 1.7.0

International character constants

  • Declaration

    public enum SDCBInternationalType : Int {
        case USA
        case france
        case germany
        case UK
        case denmark
        case sweden
        case italy
        case spain
        case japan
        case norway
        case denmark2
        case spain2
        case latinAmerica
        case korea
    }
    
  • Constants

    Name

    Contents

    USA

    USA

    france

    France

    germany

    Germany

    UK

    UK

    denmark

    Denmark

    sweden

    Sweden

    italy

    Italy

    spain

    Spain

    japan

    Japan

    norway

    Norway

    denmark2

    Denmark ||

    spain2

    Spain ||

    latinAmerica

    Latin America

    korea

    Korea

4.3.2. SDCBCodePageType

added in version 1.7.0

Code Page constants

  • Declaration

    public enum SDCBCodePageType : Int {
        case CP437
        case katakana
        case CP850
        case CP860
        case CP863
        case CP865
        case CP1252
        case CP866
        case CP852
        case CP858
        case japanese
        case simplifiedChinese
        case traditionalChinese
        case hangul
    }
    
  • Constants

    Name

    Contents

    CP437

    CodePage437 (USA, Std. Europe)

    katakana

    Katakana

    CP850

    PC850 (Multilingual)

    CP860

    PC860 (Portuguese)

    CP863

    PC863 (Canadian-French)

    CP865

    PC865 (Norwegian)

    CP1252

    WPC1252

    CP866

    PC866 [Cyrillic #2]

    CP852

    PC852 [Latin 2]

    CP858

    Page 19 [PC858]

    japanese

    Japanese font (shift JIS)

    simplifiedChinese

    Simplified Chinese (GB2312)

    traditionalChinese

    Traditional Chinese (Big5)

    hangul

    Hangul (KSC5601)

4.3.3. SDCBCursorMode

added in version 1.7.0

Cursor Mode constants.

  • Declaration

    public enum SDCBCursorMode : Int {
        case off
        case blink
        case on
    }
    
  • Constants

    Name

    Contents

    off

    Cursor off

    blink

    Cursor blinking

    on

    Cursor lighting

4.3.4. SDCBContrastMode

added in version 1.7.0

Contrast mode constants.

  • Declaration

    public enum SDCBContrastMode : Int {
        case minus3
        case minus2
        case minus1
        case default
        case plus1
        case plus2
        case plus3
    }
    
  • Constants

    Name

    Contents

    minus3

    Contrast: -3

    minus2

    Contrast: -2

    minus1

    Contrast: -1

    default

    Default

    plus1

    Contrast: +1

    plus2

    Contrast: +2

    plus3

    Contrast: +3

4.3.5. commands

added in version 1.7.0

Gets the command buffer (generated command).

  • Declaration

    open var commands: UnsafeMutablePointer<Int32>! { get }
    
  • Parameter

    None

  • Value

    Contents

    Type

    Command buffer (generated command)

    NSMutableData

4.3.6. passThroughCommands

added in version 1.7.0

Gets a command sequence with the pass-through command to the printer added at the beginning of the command buffer (generated command).

  • Declaration

    open var passThroughCommands: UnsafeMutablePointer<Int32>! { get }
    
  • Parameter

    None

  • Return value

    Contents

    Type

    Command buffer (generated command)

    NSMutableData

4.3.7. appendData

added in version 1.7.0

Adds data (text or command) to the command buffer.

  • Declaration

    open func appendByte(_ data: UInt8)
    open func appendData(_ otherData: Any!)
    open func appendBytes(_ bytes: UnsafeRawPointer!, length: Any!)
    
  • Parameter

    Name

    Contents

    Type

    data
    otherData
    bytes

    Data (Text and Command)

    UInt8
    Data
    UnsafeRawPointer

    length

    Data length

    UInt

  • Return value

    None

4.3.8. appendBackSpace

added in version 1.7.0

Generates a backspace command, and then adds it to the command buffer.

  • Declaration

    open func appendBackSpace()
    
  • Parameter

    None

  • Return value

    None

4.3.9. appendHorizontalTab

added in version 1.7.0

Generates a horizontal tab command, and then adds it to the command buffer.

  • Declaration

    open func appendHorizontalTab()
    
  • Parameter

    None

  • Return value

    None

4.3.10. appendLineFeed

added in version 1.7.0

Generates a line feed command, and then adds it to the command buffer.

  • Declaration

    open func appendLineFeed()
    
  • Parameter

    None

  • Return value

    None

4.3.11. appendCarriageReturn

added in version 1.7.0

Generates a carriage-return command, and then adds it to the command buffer.

  • Declaration

    open func appendCarriageReturn()
    
  • Parameter

    None

  • Return value

    None

4.3.12. appendBitmap

added in version 1.7.0

Generates a graphic display command, and then adds it to the command buffer.

  • Declaration

    open func appendBitmap(_ image: Any!, diffusion: Any!)
    
  • Parameter

    Name

    Contents

    Type

    bitmap

    Image you want to display
    Specify the instance of the 160 × 40 dots monochrome Bitmap class.
    If a different sized Bitmap is specified, it is resized to 160 × 40 dots.
    The Bitmap pixels are automatically converted to monochrome value.

    UIImage

    diffusion

    Random dither
    true … Valid
    false … Invalid

    Bool

  • Return value

    None

4.3.13. appendInternational

added in version 1.7.0

Select command of the international character mode is generated and added to the command buffer.

  • Declaration

    open func appendInternational(_ type: Any!)
    
  • Parameter

    Name

    Contents

    Type

    internationalType

    International character constants

    SDCBInternationalType

  • Return value

    None

4.3.14. appendCodePage

added in version 1.7.0

Select command of the code page is generated and added to the command buffer.

  • Declaration

    open func appendCodePage(_ type: Any!)
    
  • Parameter

    Name

    Contents

    Type

    codePageType

    Code Page constants

    SDCBCodePageType

  • Return value

    None

4.3.15. appendDeleteToEndOfLine

added in version 1.7.0

Generates a command to clear the screen until the end of the line, and then adds it to the command buffer.

  • Declaration

    open func appendDeleteToEndOfLine()
    
  • Parameter

    None

  • Return value

    None

4.3.16. appendClearScreen

added in version 1.7.0

Generates a command to clear the screen, and then adds it to the command buffer.

  • Declaration

    open func appendClearScreen()
    
  • Parameter

    None

  • Return value

    None

4.3.17. appendHomePosition

added in version 1.7.0

Generates a command to move the cursor to the home position, and then adds it to the command buffer.

  • Declaration

    open func appendHomePosition()
    
  • Parameter

    None

  • Return value

    None

4.3.18. appendTurnOn

added in version 1.7.0

Generates a command to turn on/off the backlight, and then adds it to the command buffer.

  • Declaration

    open func appendTurn(on turnOn: Any!)
    
  • Parameter

    Name

    Contents

    Type

    turnOn

    Backlight ON/OFF

    Bool

  • Return value

    None

4.3.19. appendSpecifiedPosition

added in version 1.7.0

Generates a command to move the cursor to the specified position, and then adds it to the command buffer.

  • Declaration

    open func appendSpecifiedPosition(_ x: Int32, y: Int32)
    
  • Parameter

    Name

    Contents

    Type

    x

    Digit position (Leftmost digit is 1)

    Int32

    y

    Line position (top line is 1)

    Int32

  • Return value

    None

4.3.20. appendCursorMode

added in version 1.7.0

Generates a command to change the cursor mode, and then adds it to the command buffer.

  • Declaration

    open func appendCursorMode(_ cursorMode: Any!)
    
  • Parameter

    Name

    Contents

    Type

    cursorMode

    Cursor Mode constants

    SDCBCursorMode

  • Return value

    None

4.3.21. appendContrastMode

added in version 1.7.0

Generates a command to change the contrast mode, and then adds it to the command buffer.

  • Declaration

    open func appendContrastMode(_ contrastMode: Any!)
    
  • Parameter

    Name

    Contents

    Type

    contrastMode

    ContrastMode constants

    SDCBContrastMode

  • Return value

    None

4.3.22. appendUserDefinedCharacter

added in version 1.7.0

Generates a command to register user-defined characters (SBCS), and then adds it to the command buffer.

  • Declaration

    open func appendUserDefinedCharacter(_ index: Int32, code: Int32, font: UnsafeMutablePointer<UInt8>!)
    
  • Parameter

    Name

    Contents

    Type

    index

    Japanese fontFont number
    00h ≦ index ≦ 1Fh

    Int32

    code

    Character code of user-defined character
    20h ≦ code ≦ 7Fh

    If japanese is specified with the appendCodePage method, the following range is also supported.
    A0h ≦ code ≦ DFh

    Int32

    font

    16-byte font data
    Refer to the font data format of the user-defined characters.

    Specifying nil deletes the user-defined characters of the specified font No.

    UnsafeMutablePointer<UInt8>

  • Return value

    None

  • The font data format of the user-defined characters.

    ../_images/display_user_defined_sbcs_data.png

4.3.23. appendUserDefinedDbcsCharacter

added in version 1.7.0

Generates a command to register user-defined characters (DBCS), and then adds it to the command buffer.

  • Declaration

    open func appendUserDefinedDbcsCharacter(_ index: Int32, code: Int32, font: UnsafeMutablePointer<UInt8>!)
    
  • Parameter

    Name

    Contents

    Type

    index

    Japanese fontFont number
    00h ≦ index ≦ 0Fh

    Int32

    code

    Character code of user-defined character
    20h ≦ code ≦ 7Fh

    If japanese is specified with the appendCodePage method, the following range is also supported.
    80 00h ≦ code ≦ FF FFh

    Int32

    font

    32-byte font data
    Refer to the font data format of the user-defined characters.

    Specifying nil deletes the user-defined characters of the specified font No.

    UnsafeMutablePointer<UInt8>

  • Return value

None

  • The font data format of the user-defined characters.

    ../_images/display_user_defined_dbcs_data.png