4.12. IPresenterPaperCounterParser

added in version 1.13.0

An interface to provide functions to generate commands to get the value of a presenter paper counter.

  • Constant

    Name

    Contents

    Counter

    This constant indicates the paper counter type

  • Method

    Name

    Contents

    getCount

    Gets the value of the presenter paper counter.

    getCounter

    Gets the paper counter type.

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

Model/Emulation

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

getCount

getCounter

4.12.1. Counter

added in version 1.13.0

This constant indicates the paper counter type.

  • Declaration

    enum Counter {
        Print,
        Retract
    }
    
  • Constants

    Name

    Contents

    Print

    The counter is incremented (+1) when paper is printed.

    Retract

    The counter is incremented (+1) when paper is automatically retracted or ejected.

4.12.2. getCount

added in version 1.13.0

Gets the value of the presenter paper counter.

Executes after the parse method returns Success .

  • Declaration

    int getCount();
    
  • Parameter

    None

  • Return value

    Contents

    Type

    The value of the presenter paper counter.

    int

  • Examples

    final IPresenterPaperCounterParser parser = StarIoExt.createPresenterPaperCounterParser(mEmulation, counter);
    
    Communication.parseDoNotCheckCondition(PresenterFragment.class, parser, mPrinterSettings.getPortName(), mPrinterSettings.getPortSettings(), 10000, getActivity(), new Communication.SendCallback() {
        @Override
        public void onStatus(boolean result, Communication.Result communicateResult) {
            if (!mIsForeground) {
            return;
            }
    
            String msg;
            String title;
    
            if (result) {
            if (parser.getCounter() == Counter.Print) {
                title = "Printed paper counter";
            }
            else { // Counter.Retract
                title = "Auto retracted/ejected paper counter";
            }
    
            msg = String.valueOf(parser.getCount());
            }
            else {
            title = "Communication Result";
            msg = "Printer Impossible";
            }
    
            ...
        }
    });
    

    Refer to PresenterFragment.java.

4.12.3. getCounter

added in version 1.13.0

Gets the paper counter type.

  • Declaration

    Counter getCounter();
    
  • Parameter

    None

  • Return value

    Contents

    Type

    The paper counter type

    Counter

  • Examples

    Refer to the example of the getCount method.