4.8. ILedCommandBuilder

added in version 1.13.0

An interface to provide functions to generate commands for the LED control.

  • Constant

    Name

    Contents

    Led

    LED constants

  • Method

    Name

    Contents

    appendAutomaticBlinkMode

    A command to set the LED blink mode during presenter/bezel operation is generated and added to the command buffer.

    appendAutomaticBlinkInterval

    A command to set the LED ON/OFF time in presenter/bezel operation is generated and added to the command buffer.

    appendBlink

    A command to blink the LED is generated and added to the command buffer.

    getCommands

    Gets the command buffer (generated command).

This interface is only for models with LED indicator.This table shows the supported methods for each model.

Model/Emulation

TUP500 SK1-211/221/V211 SK1-211/221/V211 Presenter SK1-311/321/V311 SK1-311/V311 Presenter
StarLine StarPRNT StarPRNT StarPRNT StarPRNT

appendAutomaticBlinkMode

appendAutomaticBlinkInterval

[1] [1]

appendBlink

- -

getCommands

4.8.1. Led

added in version 1.13.0

LED constants

  • Declaration

    enum Led {
        Printing,
        Error,
        Idle
    }
    
  • Constants

    Name

    Contents

    Printing

    LED indicating printing or presenter/bezel operation

    Error

    LED indicating error

    Idle

    LED indicating idling

4.8.2. appendAutomaticBlinkMode

added in version 1.13.0

A command to set the LED blink mode during presenter/bezel operation is generated and added to the command buffer.

  • Declaration

    void appendAutomaticBlinkMode(Led... led);
    
  • Parameter

    Name

    Contents

    Type

    led

    LED constants
    Specifies the LED to blink.
    If nothing is specified for the argument, blinking will not be performed.

    Led

    The combination of parameters which can be set in the led argument are the following.

    LedModel

    Combination of parameters which can be set

    Star

    Printing
    Error
    Printing, Error

    SK

    Printing
    Error
    Printing, Error
    Printing, Error, Idle
  • Return value

    None

  • Exception

    Class

    Contents

    IllegalArgumentException

    The combination of parameters which cannot be set in the led argument is specified.

  • Examples

    private void print() {
        ...
    
        Led[] leds;
        switch (mAutomaticBlinkLedControlSpinner.getSelectedItemPosition()) {
            default:
            case 0:
            leds = new Led[] { Led.Printing, Led.Error };
            break;
            case 1:
            leds = new Led[] { Led.Printing };
            break;
            case 2:
            leds = new Led[] { Led.Error };
            break;
            case 3:
            leds = new Led[] { };
            break;
            case 4:
            leds = new Led[] { Led.Printing, Led.Error, Led.Idle };
            break;
        }
    
        LedModel model = ModelCapability.getLedModel(mPrinterSettings.getModelIndex());
        ILedCommandBuilder ledBuilder = StarIoExt.createLedCommandBuilder(model);
    
        try {
            ledBuilder.appendAutomaticBlinkMode(leds);
    
            List ledList = Arrays.asList(leds);
    
            if (ledList.contains(Led.Printing)) {
            ledBuilder.appendAutomaticBlinkInterval(Led.Printing, printingLedOnTime, printingLedOffTime);
            }
    
            if (ledList.contains(Led.Error)) {
            ledBuilder.appendAutomaticBlinkInterval(Led.Error, errorLedOnTime, errorLedOffTime);
            }
    
            if (ledList.contains(Led.Idle)) {
            ledBuilder.appendAutomaticBlinkInterval(Led.Idle, idleLedOnTime, idleLedOffTime);
            }
        }
        catch (IllegalArgumentException e) {
            ...
        }
    
        ...
    }
    

    Refer to LedFragment.java.

4.8.3. appendAutomaticBlinkInterval

added in version 1.13.0

A command to set the LED ON/OFF time in presenter/bezel operation is generated and added to the command buffer.

  • Declaration

    void appendAutomaticBlinkInterval(Led led, int onTime, int offTime);
    
  • Parameter

    Name

    Contents

    Type

    led

    LED constants
    Specifies the LED to blink.

    Led

    onTime

    On time (Units : mSec)
    Settable range: 0 - 25500

    int

    offTime

    Off time (Units : mSec)
    Settable range: 0 - 25500

    int

    The parameters which can be set in the led argument are the following.

    LedModel

    Parameters which can be set

    Star

    Printing
    Error

    SK

    Printing
    Error
    Idle
  • Return value

    None

  • Exception

    Class

    Contents

    IllegalArgumentException

    Parameter is out of range

4.8.5. getCommands

added in version 1.13.0

Gets the command buffer (generated command).

  • Declaration

    byte[] getCommands();
    
  • Parameter

    None

  • Return value

    Contents

    Type

    Command buffer (generated command)

    byte[]