shtrih-m / javapos_shtrih

Реализация JavaPOS драйвера принтера фискального регистратора для устройств Штрих-М
http://www.shtrih-m.ru
MIT License
33 stars 16 forks source link

disablePrintOnce вызывает ошибку и отключает печать на всегда #150

Closed Tango600 closed 1 year ago

Tango600 commented 2 years ago

Использование disablePrintOnce вызывает ошибку и отключает печать на всегда.

Штрих-Нано-Ф, прошивка 312. Драйвер 648.

` --------- beginning of main 04-25 10:10:49.488 I/System.out(10366): [logcat, -v, time, -f, /storage/emulated/0/MPKT/Logs/Logcat/Log_20220425101049.txt] 04-25 10:10:49.489 I/System.out(10366): null 04-25 10:10:49.489 I/System.out(10366): null 04-25 10:10:49.489 I/System.out(10366): Calling by::className:nppltt.ppsmobileclient.Bootstrapper MethodName:startLogcatLoggingAll 04-25 10:10:49.520 I/Adreno (10366): QUALCOMM build : 710c145, Iebe23be877 04-25 10:10:49.520 I/Adreno (10366): Build Date : 08/23/16 04-25 10:10:49.520 I/Adreno (10366): OpenGL ES Shader Compiler Version: XE031.08.00.00 04-25 10:10:49.520 I/Adreno (10366): Local Branch : 04-25 10:10:49.520 I/Adreno (10366): Remote Branch : 04-25 10:10:49.520 I/Adreno (10366): Remote Branch : 04-25 10:10:49.520 I/Adreno (10366): Reconstruct Branch : 04-25 10:10:49.527 I/OpenGLRenderer(10366): Initialized EGL, version 1.4 04-25 10:10:49.543 W/OpenGLRenderer(10366): load: so=/system/lib64/libhwuibp.so 04-25 10:10:49.543 W/OpenGLRenderer(10366): dlopen failed: library "/system/lib64/libhwuibp.so" not found 04-25 10:10:49.543 W/OpenGLRenderer(10366): Initialize Binary Program Cache: Load Failed 04-25 10:10:50.117 I/TextInputLayout(10366): EditText added is not a TextInputEditText. Please switch to using that class instead. 04-25 10:10:51.874 I/DpmTcmClient(10366): RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor 04-25 10:10:51.876 I/DpmTcmClient(10366): connected to TCM 04-25 10:10:51.930 I/System (10366): core_booster, getBoosterConfig = false 04-25 10:10:52.079 I/System (10366): core_booster, getBoosterConfig = false 04-25 10:10:53.327 I/HwSecImmHelper(10366): mSecurityInputMethodService is null 04-25 10:10:53.335 I/System (10366): core_booster, getBoosterConfig = false 04-25 10:10:53.479 I/System (10366): core_booster, getBoosterConfig = false 04-25 10:11:14.584 W/System.err(10366): jpos/res/jpos.properties file not found 04-25 10:11:14.587 W/System.err(10366): jpos/res/jpos.properties file not found 04-25 10:11:14.589 W/System.err(10366): jpos/res/jpos.properties file not found 04-25 10:11:14.722 I/BluetoothDevice(10366): createInsecureRfcommSocketToServiceRecord 04-25 10:11:14.723 W/BluetoothAdapter(10366): getBluetoothService() called with no BluetoothManagerCallback 04-25 10:11:23.547 W/System.err(10366): jpos.JposException: 2, ФН: Неверное состояние ФН 04-25 10:11:23.547 W/System.err(10366): at com.shtrih.jpos.fiscalprinter.JposExceptionHandler.getJposExceptionWithoutDetails(JposExceptionHandler.java:94) 04-25 10:11:23.547 W/System.err(10366): at com.shtrih.jpos.fiscalprinter.JposExceptionHandler.getJposException(JposExceptionHandler.java:52) 04-25 10:11:23.547 W/System.err(10366): at com.shtrih.jpos.fiscalprinter.JposExceptionHandler.handleException(JposExceptionHandler.java:41) 04-25 10:11:23.547 W/System.err(10366): at com.shtrih.jpos.fiscalprinter.FiscalPrinterImpl.handleException(FiscalPrinterImpl.java:465) 04-25 10:11:23.547 W/System.err(10366): at com.shtrih.jpos.fiscalprinter.FiscalPrinterService.handleException(FiscalPrinterService.java:37) 04-25 10:11:23.548 W/System.err(10366): at com.shtrih.jpos.fiscalprinter.FiscalPrinterService.directIO(FiscalPrinterService.java:253) 04-25 10:11:23.548 W/System.err(10366): at jpos.BaseJposControl.directIO(BaseJposControl.java:461) 04-25 10:11:23.548 W/System.err(10366): at com.shtrih.fiscalprinter.ShtrihFiscalPrinter113.directIO(ShtrihFiscalPrinter113.java:1023) 04-25 10:11:23.548 W/System.err(10366): at com.shtrih.fiscalprinter.ShtrihFiscalPrinter113.executeCommand(ShtrihFiscalPrinter113.java:1382) 04-25 10:11:23.548 W/System.err(10366): at com.shtrih.fiscalprinter.ShtrihFiscalPrinter113.fsCancelDocument(ShtrihFiscalPrinter113.java:1663) 04-25 10:11:23.548 W/System.err(10366): at nppltt.ppsmobileclient.kkmManagment.shtrih.ShtrihKkmManager.printCheque(ShtrihKkmManager.java:681) 04-25 10:11:23.548 W/System.err(10366): at nppltt.ppsmobileclient.viewModels.PaymentsBasketVM.printCheque(PaymentsBasketVM.java:1019) 04-25 10:11:23.548 W/System.err(10366): at nppltt.ppsmobileclient.viewModels.PaymentsBasketVM.payProc(PaymentsBasketVM.java:744) 04-25 10:11:23.548 W/System.err(10366): at nppltt.ppsmobileclient.viewModels.PaymentsBasketVM.lambda$onPromoResult$14$nppltt-ppsmobileclient-viewModels-PaymentsBasketVM(PaymentsBasketVM.java:364) 04-25 10:11:23.548 W/System.err(10366): at nppltt.ppsmobileclient.viewModels.PaymentsBasketVM$$ExternalSyntheticLambda6.execute(D8$$SyntheticClass) 04-25 10:11:23.548 W/System.err(10366): at nppltt.ppsmobileclient.core.ui.RunningTask.lambda$submit$6(RunningTask.java:112) 04-25 10:11:23.548 W/System.err(10366): at nppltt.ppsmobileclient.core.ui.RunningTask$$ExternalSyntheticLambda11.run(D8$$SyntheticClass) 04-25 10:11:23.548 W/System.err(10366): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) 04-25 10:11:23.548 W/System.err(10366): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 04-25 10:11:23.548 W/System.err(10366): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154) 04-25 10:11:23.548 W/System.err(10366): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) 04-25 10:11:23.548 W/System.err(10366): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 04-25 10:11:23.548 W/System.err(10366): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 04-25 10:11:23.548 W/System.err(10366): at java.lang.Thread.run(Thread.java:833) 04-25 10:11:23.548 W/System.err(10366): Caused by: com.shtrih.fiscalprinter.DeviceException: 2, ФН: Неверное состояние ФН 04-25 10:11:23.549 W/System.err(10366): at com.shtrih.fiscalprinter.SMFiscalPrinterImpl.check(SMFiscalPrinterImpl.java:395) 04-25 10:11:23.549 W/System.err(10366): at com.shtrih.fiscalprinter.SMFiscalPrinterImpl.execute(SMFiscalPrinterImpl.java:400) 04-25 10:11:23.549 W/System.err(10366): at com.shtrih.jpos.fiscalprinter.directIO.DirectIOHandler2.directIO(DirectIOHandler2.java:194) 04-25 10:11:23.549 W/System.err(10366): at com.shtrih.jpos.fiscalprinter.FiscalPrinterImpl.directIO(FiscalPrinterImpl.java:2181) 04-25 10:11:23.549 W/System.err(10366): at com.shtrih.jpos.fiscalprinter.FiscalPrinterService.directIO(FiscalPrinterService.java:251) 04-25 10:11:23.549 W/System.err(10366): ... 18 more

`

Tango600 commented 1 year ago

Лучше не использовать disablePrintOnce

protected void SetNoPrintMode(boolean value) throws Exception {

    if (isNano(printer)) {
        printer.writeTable(17, 1, 7, value ? "2" : "0");  // На Нано не работает временное отключение печати
    } else {
        if (isNewMobile(printer)) {
            printer.writeTable(1, 1, 43, value ? "1" : "0");
        }
    }
}