/*
 * MainDialog.java
 *
 * Created on 5 June 2008, 12:54
 */

/**
 *
 * @author  V.Kravtsov
 */
import jpos.*;
import javax.swing.*;
import java.io.UnsupportedEncodingException;

public class MainDialog extends javax.swing.JDialog {

    CashDrawer cashDrawer = new CashDrawer();
    PrinterTest printer = new PrinterTest();

    /**
     * Creates new form MainDialog
     */
    public MainDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    private void updateDayOpened() {
        try {
            btnZReport.setEnabled(printer.printer.getDayOpened());
            if (printer.printer.getDayOpened()) {
                edtDayOpened.setText("Day is opened");
            } else {
                edtDayOpened.setText("Day is not opened");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents

        tabPane1 = new javax.swing.JTabbedPane();
        pnlFptr1 = new javax.swing.JPanel();
        btnPrintNonfiscalReceipt = new javax.swing.JButton();
        btnPrintFiscalReceipt = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        edtDeviceName = new javax.swing.JTextField();
        jButton7 = new javax.swing.JButton();
        btnPrintImage = new javax.swing.JButton();
        edtHeaderImageFile = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        edtImageFile = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        btnPrintFile = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        edtTextFileName = new javax.swing.JTextField();
        btnEmptyFiscalReceipt = new javax.swing.JButton();
        btnPrintCashIn = new javax.swing.JButton();
        btnPrintCashOut = new javax.swing.JButton();
        btnPrintRefundReceipt = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        edtDayOpened = new javax.swing.JTextField();
        lblDayOpened = new javax.swing.JLabel();
        btnUpdateDayOpened = new javax.swing.JButton();
        btnZReport = new javax.swing.JButton();
        btnZReport1 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jButton14 = new javax.swing.JButton();
        jButton15 = new javax.swing.JButton();
        jButton16 = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jButton17 = new javax.swing.JButton();
        btnOpenDrawer = new javax.swing.JButton();
        lblDrawerState = new javax.swing.JLabel();
        edtDrawerState = new javax.swing.JTextField();
        btnReadDrawerState = new javax.swing.JButton();
        jButton18 = new javax.swing.JButton();
        btnZeroFiscalReceipt = new javax.swing.JButton();
        btnXmlZReport = new javax.swing.JButton();
        btnPrintEscBarcodesNormal = new javax.swing.JButton();
        btnPrintEscBarcodesRecMessage = new javax.swing.JButton();
        btnReadStatus1 = new javax.swing.JButton();
        btnReadStatus2 = new javax.swing.JButton();
        btnCsvZReport = new javax.swing.JButton();
        btnFiscalReceipt2 = new javax.swing.JButton();
        btnFiscalReceipt7 = new javax.swing.JButton();
        btnTestSynchronization = new javax.swing.JButton();
        pnlCash1 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        edtCashDrawerDeviceName = new javax.swing.JTextField();
        edtCashDrawerTimeout = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        chbCashDrawerDeviceEnabled = new javax.swing.JCheckBox();
        chbCashDrawerFreezeEvents = new javax.swing.JCheckBox();
        edtCashDrawerBeepTimeout = new javax.swing.JTextField();
        edtCashDrawerBeepDelay = new javax.swing.JTextField();
        edtCashDrawerBeepDuration = new javax.swing.JTextField();
        edtCashDrawerBeepFrequency = new javax.swing.JTextField();
        btnCashDrawerOpenDrawer = new javax.swing.JButton();
        btnCashDrawerClaim = new javax.swing.JButton();
        btnCashDrawerOpen = new javax.swing.JButton();
        btnCashDrawerClose = new javax.swing.JButton();
        btnCashDrawerRelease = new javax.swing.JButton();
        btnCashDrawerWaitForDrawerClose = new javax.swing.JButton();
        btnCashDrawerGetState = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtReport = new javax.swing.JTextArea();
        pnlFptr2 = new javax.swing.JPanel();
        btnReadStatus = new javax.swing.JButton();
        Pane2 = new javax.swing.JScrollPane();
        Memo1 = new javax.swing.JEditorPane();
        btnReadCashReg = new javax.swing.JButton();
        btnReadOperReg = new javax.swing.JButton();
        btnClose = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        pnlFptr1.setFocusable(false);
        pnlFptr1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        btnPrintNonfiscalReceipt.setText("non fiscal receipt");
        btnPrintNonfiscalReceipt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintNonfiscalReceiptActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnPrintNonfiscalReceipt, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 220, 160, 26));

        btnPrintFiscalReceipt.setText("fiscal receipt");
        btnPrintFiscalReceipt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintFiscalReceiptActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnPrintFiscalReceipt, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 250, 160, 26));

        jButton3.setText("setHeaderLines");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 10, 160, 26));

        jButton4.setText("setTrailerLines");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 40, 160, 26));

        jButton5.setText("open");
        jButton5.setHideActionText(true);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 10, 160, 26));

        jButton6.setText("close");
        jButton6.setHideActionText(true);
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 40, 160, 26));

        edtDeviceName.setText("ShtrihFptr");
        edtDeviceName.setName("edtDeviceName"); // NOI18N
        pnlFptr1.add(edtDeviceName, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 10, 200, -1));

        jButton7.setText("printAllBarcodes");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 380, 219, 26));

        btnPrintImage.setText("printImage");
        btnPrintImage.setHideActionText(true);
        btnPrintImage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintImageActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnPrintImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 70, 160, 26));

        edtHeaderImageFile.setText("Logo.bmp");
        edtHeaderImageFile.setName("edtFileName"); // NOI18N
        pnlFptr1.add(edtHeaderImageFile, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 40, 200, -1));

        jLabel1.setText("Device name:");
        pnlFptr1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(6, 11, -1, -1));

        jLabel2.setText("Logo file:");
        pnlFptr1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 40, 65, -1));

        edtImageFile.setText("Logo2.bmp");
        edtImageFile.setName("edtFileName"); // NOI18N
        pnlFptr1.add(edtImageFile, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 70, 200, -1));

        jLabel3.setText("Image file:");
        pnlFptr1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 70, 65, -1));

        btnPrintFile.setText("printFile");
        btnPrintFile.setHideActionText(true);
        btnPrintFile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintFileActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnPrintFile, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 100, 160, 26));

        jLabel4.setText("Text file:");
        pnlFptr1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, 65, -1));

        edtTextFileName.setText("test.txt");
        edtTextFileName.setName("edtFileName"); // NOI18N
        pnlFptr1.add(edtTextFileName, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 100, 200, -1));

        btnEmptyFiscalReceipt.setText("empty fiscal receipt");
        btnEmptyFiscalReceipt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEmptyFiscalReceiptActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnEmptyFiscalReceipt, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 160, 160, 26));

        btnPrintCashIn.setText("print cash in");
        btnPrintCashIn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintCashInActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnPrintCashIn, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 70, 160, 26));

        btnPrintCashOut.setText("print cash out");
        btnPrintCashOut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintCashOutActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnPrintCashOut, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 100, 160, 26));

        btnPrintRefundReceipt.setText("print refund receipt");
        btnPrintRefundReceipt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintRefundReceiptActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnPrintRefundReceipt, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 130, 160, 26));

        jButton9.setText("fiscal receipts");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton9, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 190, 160, 26));

        edtDayOpened.setName("edtFileName"); // NOI18N
        pnlFptr1.add(edtDayOpened, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 130, 200, -1));

        lblDayOpened.setText("Day opened:");
        pnlFptr1.add(lblDayOpened, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 130, 80, -1));

        btnUpdateDayOpened.setText("Update");
        btnUpdateDayOpened.setHideActionText(true);
        btnUpdateDayOpened.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUpdateDayOpenedActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnUpdateDayOpened, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 130, 160, 26));

        btnZReport.setText("Z Report");
        btnZReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnZReportActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnZReport, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 160, 160, 26));

        btnZReport1.setText("Z Report");
        btnZReport1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnZReport1ActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnZReport1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 0, 25));

        jButton10.setText("Vat Entry");
        jButton10.setName("btnVatEntry"); // NOI18N
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton10, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 190, 160, 26));

        jButton11.setText("printImages");
        jButton11.setName("btnPrintImages"); // NOI18N
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton11, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 250, 160, 26));

        jButton12.setText("loadImages");
        jButton12.setName("btnLoadImages"); // NOI18N
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton12, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 220, 160, 26));

        jButton13.setText("printLines");
        jButton13.setName("btnPrintLines"); // NOI18N
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton13, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 280, 160, 26));

        jButton14.setText("clearReceiptLogo");
        jButton14.setName("btnClearReceiptLogo"); // NOI18N
        jButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton14ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton14, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 250, 158, 26));

        jButton15.setText("setReceiptLogo");
        jButton15.setName("btnSetReceiptLogo"); // NOI18N
        jButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton15ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton15, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 280, 158, 26));

        jButton16.setText("printCode39Barcodes");
        jButton16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton16ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton16, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 410, 219, 26));
        pnlFptr1.add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 310, 631, 10));

        jButton17.setText("printFonts");
        jButton17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton17ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton17, new org.netbeans.lib.awtextra.AbsoluteConstraints(297, 382, 115, 26));

        btnOpenDrawer.setText("openDrawer");
        btnOpenDrawer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnOpenDrawerActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnOpenDrawer, new org.netbeans.lib.awtextra.AbsoluteConstraints(297, 353, 115, 26));

        lblDrawerState.setText("Drawer state:");
        pnlFptr1.add(lblDrawerState, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 320, 80, -1));

        edtDrawerState.setName("edtFileName"); // NOI18N
        pnlFptr1.add(edtDrawerState, new org.netbeans.lib.awtextra.AbsoluteConstraints(94, 324, 197, -1));

        btnReadDrawerState.setText("readDrawerState");
        btnReadDrawerState.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReadDrawerStateActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnReadDrawerState, new org.netbeans.lib.awtextra.AbsoluteConstraints(297, 324, -1, 26));

        jButton18.setText("clearImages");
        jButton18.setName("btnLoadImages"); // NOI18N
        jButton18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton18ActionPerformed(evt);
            }
        });
        pnlFptr1.add(jButton18, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 220, 158, 26));

        btnZeroFiscalReceipt.setText("Zero fiscal receipt");
        btnZeroFiscalReceipt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnZeroFiscalReceiptActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnZeroFiscalReceipt, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 280, 160, 26));

        btnXmlZReport.setText("XML Z report");
        btnXmlZReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnXmlZReportActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnXmlZReport, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 380, 115, 26));

        btnPrintEscBarcodesNormal.setText("printEscBarcodesNormal");
        btnPrintEscBarcodesNormal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintEscBarcodesNormalActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnPrintEscBarcodesNormal, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 320, 219, 26));

        btnPrintEscBarcodesRecMessage.setText("printEscBarcodesRecMessage");
        btnPrintEscBarcodesRecMessage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPrintEscBarcodesRecMessageActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnPrintEscBarcodesRecMessage, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 350, 219, 26));

        btnReadStatus1.setText("Read Status1");
        btnReadStatus1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReadStatus1ActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnReadStatus1, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 380, 110, 26));

        btnReadStatus2.setText("Read Status2");
        btnReadStatus2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReadStatus2ActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnReadStatus2, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 410, 110, 26));

        btnCsvZReport.setText("CSV Z report");
        btnCsvZReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCsvZReportActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnCsvZReport, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 410, 115, 26));

        btnFiscalReceipt2.setText("Fiscal receipt 2");
        btnFiscalReceipt2.setName("btnLoadImages"); // NOI18N
        btnFiscalReceipt2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFiscalReceipt2ActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnFiscalReceipt2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 190, 158, 26));

        btnFiscalReceipt7.setText("Fiscal receipt 7");
        btnFiscalReceipt7.setName("btnLoadImages"); // NOI18N
        btnFiscalReceipt7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFiscalReceipt7ActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnFiscalReceipt7, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 160, 158, 26));

        btnTestSynchronization.setText("Test synchronization");
        btnTestSynchronization.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTestSynchronizationActionPerformed(evt);
            }
        });
        pnlFptr1.add(btnTestSynchronization, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 440, 230, 26));

        tabPane1.addTab("FiscalPrinter", pnlFptr1);

        pnlCash1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel5.setText("Device name:");
        pnlCash1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1));

        jLabel6.setText("Timeout:");
        pnlCash1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 40, -1, -1));

        edtCashDrawerDeviceName.setText("ShtrihCashDrawer");
        edtCashDrawerDeviceName.setName("edtDeviceName"); // NOI18N
        pnlCash1.add(edtCashDrawerDeviceName, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 10, 213, -1));

        edtCashDrawerTimeout.setText("1000");
        edtCashDrawerTimeout.setName("edtDeviceName"); // NOI18N
        pnlCash1.add(edtCashDrawerTimeout, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 40, 213, -1));

        jLabel9.setText("beepFrequency:");
        pnlCash1.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 130, -1, -1));

        jLabel10.setText("beepDuration:");
        pnlCash1.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 160, -1, -1));

        jLabel11.setText("beepDelay:");
        pnlCash1.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 190, -1, -1));

        jLabel8.setText("beepTimeout:");
        pnlCash1.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, -1, -1));

        chbCashDrawerDeviceEnabled.setText("DeviceEnabled");
        chbCashDrawerDeviceEnabled.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        chbCashDrawerDeviceEnabled.setMargin(new java.awt.Insets(0, 0, 0, 0));
        chbCashDrawerDeviceEnabled.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chbCashDrawerDeviceEnabledActionPerformed(evt);
            }
        });
        pnlCash1.add(chbCashDrawerDeviceEnabled, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 70, -1, -1));

        chbCashDrawerFreezeEvents.setText("FreezeEvents");
        chbCashDrawerFreezeEvents.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        chbCashDrawerFreezeEvents.setMargin(new java.awt.Insets(0, 0, 0, 0));
        chbCashDrawerFreezeEvents.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chbCashDrawerFreezeEventsActionPerformed(evt);
            }
        });
        pnlCash1.add(chbCashDrawerFreezeEvents, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 70, 99, -1));

        edtCashDrawerBeepTimeout.setText("1000");
        edtCashDrawerBeepTimeout.setName("edtDeviceName"); // NOI18N
        pnlCash1.add(edtCashDrawerBeepTimeout, new org.netbeans.lib.awtextra.AbsoluteConstraints(104, 100, 200, -1));

        edtCashDrawerBeepDelay.setText("200");
        edtCashDrawerBeepDelay.setName("edtDeviceName"); // NOI18N
        pnlCash1.add(edtCashDrawerBeepDelay, new org.netbeans.lib.awtextra.AbsoluteConstraints(104, 190, 200, -1));

        edtCashDrawerBeepDuration.setText("10000");
        edtCashDrawerBeepDuration.setName("edtDeviceName"); // NOI18N
        pnlCash1.add(edtCashDrawerBeepDuration, new org.netbeans.lib.awtextra.AbsoluteConstraints(104, 160, 200, -1));

        edtCashDrawerBeepFrequency.setText("2000");
        edtCashDrawerBeepFrequency.setName("edtDeviceName"); // NOI18N
        pnlCash1.add(edtCashDrawerBeepFrequency, new org.netbeans.lib.awtextra.AbsoluteConstraints(104, 130, 200, -1));

        btnCashDrawerOpenDrawer.setText("openDrawer");
        btnCashDrawerOpenDrawer.setHideActionText(true);
        btnCashDrawerOpenDrawer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCashDrawerOpenDrawerActionPerformed(evt);
            }
        });
        pnlCash1.add(btnCashDrawerOpenDrawer, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 70, 117, 26));

        btnCashDrawerClaim.setText("claim");
        btnCashDrawerClaim.setHideActionText(true);
        btnCashDrawerClaim.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCashDrawerClaimActionPerformed(evt);
            }
        });
        pnlCash1.add(btnCashDrawerClaim, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 40, 117, 26));

        btnCashDrawerOpen.setText("open");
        btnCashDrawerOpen.setHideActionText(true);
        btnCashDrawerOpen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCashDrawerOpenActionPerformed(evt);
            }
        });
        pnlCash1.add(btnCashDrawerOpen, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 10, 117, 26));

        btnCashDrawerClose.setText("close");
        btnCashDrawerClose.setHideActionText(true);
        btnCashDrawerClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCashDrawerCloseActionPerformed(evt);
            }
        });
        pnlCash1.add(btnCashDrawerClose, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 10, 104, 26));

        btnCashDrawerRelease.setText("release");
        btnCashDrawerRelease.setHideActionText(true);
        btnCashDrawerRelease.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCashDrawerReleaseActionPerformed(evt);
            }
        });
        pnlCash1.add(btnCashDrawerRelease, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 40, 104, 26));

        btnCashDrawerWaitForDrawerClose.setText("waitForDrawerClose");
        btnCashDrawerWaitForDrawerClose.setHideActionText(true);
        btnCashDrawerWaitForDrawerClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCashDrawerWaitForDrawerCloseActionPerformed(evt);
            }
        });
        pnlCash1.add(btnCashDrawerWaitForDrawerClose, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 130, 227, 26));

        btnCashDrawerGetState.setText("getDrawerState");
        btnCashDrawerGetState.setHideActionText(true);
        btnCashDrawerGetState.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCashDrawerGetStateActionPerformed(evt);
            }
        });
        pnlCash1.add(btnCashDrawerGetState, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 100, 227, 26));

        txtReport.setColumns(20);
        txtReport.setFont(new java.awt.Font("Monospaced", 0, 12));
        txtReport.setRows(5);
        jScrollPane1.setViewportView(txtReport);

        pnlCash1.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 229, 620, 220));

        tabPane1.addTab("CashDrawer", pnlCash1);

        pnlFptr2.setFocusCycleRoot(true);
        pnlFptr2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        btnReadStatus.setText("readStatus");
        btnReadStatus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReadStatusActionPerformed(evt);
            }
        });
        pnlFptr2.add(btnReadStatus, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 430, -1, -1));

        Memo1.setFont(new java.awt.Font("Courier New", 0, 14));
        Pane2.setViewportView(Memo1);

        pnlFptr2.add(Pane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 620, 410));

        btnReadCashReg.setText("read cash registers");
        btnReadCashReg.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReadCashRegActionPerformed(evt);
            }
        });
        pnlFptr2.add(btnReadCashReg, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 430, -1, -1));

        btnReadOperReg.setText("read operation registers");
        btnReadOperReg.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReadOperRegActionPerformed(evt);
            }
        });
        pnlFptr2.add(btnReadOperReg, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 430, -1, -1));

        tabPane1.addTab("Printer status", pnlFptr2);

        getContentPane().add(tabPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 650, 540));

        btnClose.setText("close");
        btnClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCloseActionPerformed(evt);
            }
        });
        getContentPane().add(btnClose, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 560, 90, 25));

        pack();
    }//GEN-END:initComponents

    private void btnPrintEscBarcodesRecMessageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintEscBarcodesRecMessageActionPerformed
        printer.printEscBarcodesRecMessage();
    }//GEN-LAST:event_btnPrintEscBarcodesRecMessageActionPerformed

    private void btnPrintEscBarcodesNormalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintEscBarcodesNormalActionPerformed
        printer.printEscBarcodesNormal();
    }//GEN-LAST:event_btnPrintEscBarcodesNormalActionPerformed

    private void btnXmlZReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnXmlZReportActionPerformed
        printer.saveXmlZReport();
    }//GEN-LAST:event_btnXmlZReportActionPerformed

    private void btnZeroFiscalReceiptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnZeroFiscalReceiptActionPerformed
        printer.zeroFiscalReceipt();
    }//GEN-LAST:event_btnZeroFiscalReceiptActionPerformed

    private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed
        printer.clearImages();
    }//GEN-LAST:event_jButton18ActionPerformed

    private void btnReadOperRegActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReadOperRegActionPerformed
        Memo1.setText(printer.readOperRegisters());
    }//GEN-LAST:event_btnReadOperRegActionPerformed

    private void btnReadCashRegActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReadCashRegActionPerformed
        Memo1.setText(printer.readCashRegisters());
    }//GEN-LAST:event_btnReadCashRegActionPerformed

    private void btnReadStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReadStatusActionPerformed
        Memo1.setText(printer.readStatus());
    }//GEN-LAST:event_btnReadStatusActionPerformed

    private void btnReadDrawerStateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReadDrawerStateActionPerformed
        if (printer.isDrawerOpened()) {
            edtDrawerState.setText("Drawer is opened");
        } else {
            edtDrawerState.setText("Drawer is closed");
        }
    }//GEN-LAST:event_btnReadDrawerStateActionPerformed

    private void btnOpenDrawerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOpenDrawerActionPerformed
        printer.openCashDrawer();
    }//GEN-LAST:event_btnOpenDrawerActionPerformed

    private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton17ActionPerformed
        printer.printFonts();
    }//GEN-LAST:event_jButton17ActionPerformed

    private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton16ActionPerformed
        printer.printCode39Barcodes();
    }//GEN-LAST:event_jButton16ActionPerformed

    private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
        printer.setReceiptLogo();
    }//GEN-LAST:event_jButton15ActionPerformed

    private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
        printer.clearReceiptLogo();
    }//GEN-LAST:event_jButton14ActionPerformed

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
        printer.printLines();
    }//GEN-LAST:event_jButton13ActionPerformed

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
        printer.loadImages();
    }//GEN-LAST:event_jButton12ActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
        printer.printImages();
    }//GEN-LAST:event_jButton11ActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        printer.VatTest();
    }//GEN-LAST:event_jButton10ActionPerformed

    private void btnZReport1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnZReport1ActionPerformed
// TODO add your handling code here:
    }//GEN-LAST:event_btnZReport1ActionPerformed

    private void btnZReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnZReportActionPerformed
        printer.printZReport();
    }//GEN-LAST:event_btnZReportActionPerformed

    private void btnUpdateDayOpenedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateDayOpenedActionPerformed
        updateDayOpened();
    }//GEN-LAST:event_btnUpdateDayOpenedActionPerformed

    private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCloseActionPerformed
        System.exit(0);
    }//GEN-LAST:event_btnCloseActionPerformed

    private void btnCashDrawerGetStateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCashDrawerGetStateActionPerformed
        try {
            if (cashDrawer.getDrawerOpened()) {
                txtReport.setText("Drawer is opened");
            } else {
                txtReport.setText("Drawer is closed");
            }
        } catch (JposException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_btnCashDrawerGetStateActionPerformed

    private void btnCashDrawerWaitForDrawerCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCashDrawerWaitForDrawerCloseActionPerformed
        try {
            cashDrawer.waitForDrawerClose(
                    Integer.parseInt(edtCashDrawerBeepTimeout.getText()),
                    Integer.parseInt(edtCashDrawerBeepFrequency.getText()),
                    Integer.parseInt(edtCashDrawerBeepDuration.getText()),
                    Integer.parseInt(edtCashDrawerBeepDelay.getText()));
        } catch (JposException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_btnCashDrawerWaitForDrawerCloseActionPerformed

    private void btnCashDrawerReleaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCashDrawerReleaseActionPerformed
        try {
            cashDrawer.release();
        } catch (JposException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_btnCashDrawerReleaseActionPerformed

    private void btnCashDrawerCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCashDrawerCloseActionPerformed
        try {
            cashDrawer.close();
        } catch (JposException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_btnCashDrawerCloseActionPerformed

    private void btnCashDrawerOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCashDrawerOpenActionPerformed
        try {
            cashDrawer.open(edtCashDrawerDeviceName.getText());
            if (cashDrawer.getCapStatus()){
                txtReport.setText("CapStatus = true");
            } else{
                txtReport.setText("CapStatus = false");
            }
        } catch (JposException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_btnCashDrawerOpenActionPerformed

    private void btnCashDrawerClaimActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCashDrawerClaimActionPerformed
        try {
            cashDrawer.claim(Integer.parseInt(edtCashDrawerTimeout.getText()));
        } catch (JposException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_btnCashDrawerClaimActionPerformed

    private void btnCashDrawerOpenDrawerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCashDrawerOpenDrawerActionPerformed
        try {
            cashDrawer.openDrawer();
        } catch (JposException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_btnCashDrawerOpenDrawerActionPerformed

    private void chbCashDrawerFreezeEventsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chbCashDrawerFreezeEventsActionPerformed
        try {
            cashDrawer.setFreezeEvents(
                    chbCashDrawerFreezeEvents.getModel().isSelected());
        } catch (JposException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_chbCashDrawerFreezeEventsActionPerformed

    private void chbCashDrawerDeviceEnabledActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chbCashDrawerDeviceEnabledActionPerformed
        try {
            cashDrawer.setDeviceEnabled(chbCashDrawerDeviceEnabled.getModel().isSelected());
        } catch (JposException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_chbCashDrawerDeviceEnabledActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        printer.fiscalReceipts();
    }//GEN-LAST:event_jButton9ActionPerformed

    private void btnPrintRefundReceiptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintRefundReceiptActionPerformed
        printer.printRefundReceipt();
    }//GEN-LAST:event_btnPrintRefundReceiptActionPerformed

    private void btnPrintCashOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintCashOutActionPerformed
        printer.printCashOutReceipt();
    }//GEN-LAST:event_btnPrintCashOutActionPerformed

    private void btnPrintCashInActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintCashInActionPerformed
        printer.printCashInReceipt();
    }//GEN-LAST:event_btnPrintCashInActionPerformed

    private void btnEmptyFiscalReceiptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEmptyFiscalReceiptActionPerformed
        printer.printEmptyFiscalReceipt();
    }//GEN-LAST:event_btnEmptyFiscalReceiptActionPerformed

    private void btnPrintFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintFileActionPerformed
        printer.printTextFile(edtTextFileName.getText());
    }//GEN-LAST:event_btnPrintFileActionPerformed

    private void btnPrintImageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintImageActionPerformed
        printer.printImage(edtImageFile.getText());
    }//GEN-LAST:event_btnPrintImageActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        printer.printAllBarcodes();
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        printer.close();
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        printer.open(edtDeviceName.getText());
        updateDayOpened();
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        printer.setTrailerLines();
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        printer.setHeaderLines(edtHeaderImageFile.getText());
    }//GEN-LAST:event_jButton3ActionPerformed

    private void btnPrintFiscalReceiptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintFiscalReceiptActionPerformed
        printer.printFiscalReceipt();
    }//GEN-LAST:event_btnPrintFiscalReceiptActionPerformed

    private void btnPrintNonfiscalReceiptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintNonfiscalReceiptActionPerformed
        printer.printNonFiscal();
    }//GEN-LAST:event_btnPrintNonfiscalReceiptActionPerformed

    private void btnReadStatus1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReadStatus1ActionPerformed
        printer.readStatus1();
    }//GEN-LAST:event_btnReadStatus1ActionPerformed

    private void btnReadStatus2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReadStatus2ActionPerformed
        printer.readStatus2();
    }//GEN-LAST:event_btnReadStatus2ActionPerformed

    private void btnCsvZReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCsvZReportActionPerformed
        printer.saveCsvZReport();
    }//GEN-LAST:event_btnCsvZReportActionPerformed

    private void btnFiscalReceipt2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFiscalReceipt2ActionPerformed
        printer.printFiscalReceipt6();
    }//GEN-LAST:event_btnFiscalReceipt2ActionPerformed

    private void btnFiscalReceipt7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFiscalReceipt7ActionPerformed
        printer.printFiscalReceipt7();
    }//GEN-LAST:event_btnFiscalReceipt7ActionPerformed

    private void btnTestSynchronizationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTestSynchronizationActionPerformed
        printer.testSynchronization(edtDeviceName.getText(), 
                edtCashDrawerDeviceName.getText());
    }//GEN-LAST:event_btnTestSynchronizationActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        // Установка вывода консольных сообщений в нужной кодировке
        try {
            System.setOut(new CodepagePrintStream(
                    System.out, System.getProperty("console.encoding", "Cp866")));
        } catch (UnsupportedEncodingException e) {
            System.out.println("Unable to setup console codepage: " + e);
        }

        setSystemLookAndFeel();
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MainDialog(new javax.swing.JFrame(), true).setVisible(true);
            }
        });
    }

    public static void setSystemLookAndFeel() {
        try {
            // Set System L&F
            UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
        }
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JEditorPane Memo1;
    private javax.swing.JScrollPane Pane2;
    private javax.swing.JButton btnCashDrawerClaim;
    private javax.swing.JButton btnCashDrawerClose;
    private javax.swing.JButton btnCashDrawerGetState;
    private javax.swing.JButton btnCashDrawerOpen;
    private javax.swing.JButton btnCashDrawerOpenDrawer;
    private javax.swing.JButton btnCashDrawerRelease;
    private javax.swing.JButton btnCashDrawerWaitForDrawerClose;
    private javax.swing.JButton btnClose;
    private javax.swing.JButton btnCsvZReport;
    private javax.swing.JButton btnEmptyFiscalReceipt;
    private javax.swing.JButton btnFiscalReceipt2;
    private javax.swing.JButton btnFiscalReceipt7;
    private javax.swing.JButton btnOpenDrawer;
    private javax.swing.JButton btnPrintCashIn;
    private javax.swing.JButton btnPrintCashOut;
    private javax.swing.JButton btnPrintEscBarcodesNormal;
    private javax.swing.JButton btnPrintEscBarcodesRecMessage;
    private javax.swing.JButton btnPrintFile;
    private javax.swing.JButton btnPrintFiscalReceipt;
    private javax.swing.JButton btnPrintImage;
    private javax.swing.JButton btnPrintNonfiscalReceipt;
    private javax.swing.JButton btnPrintRefundReceipt;
    private javax.swing.JButton btnReadCashReg;
    private javax.swing.JButton btnReadDrawerState;
    private javax.swing.JButton btnReadOperReg;
    private javax.swing.JButton btnReadStatus;
    private javax.swing.JButton btnReadStatus1;
    private javax.swing.JButton btnReadStatus2;
    private javax.swing.JButton btnTestSynchronization;
    private javax.swing.JButton btnUpdateDayOpened;
    private javax.swing.JButton btnXmlZReport;
    private javax.swing.JButton btnZReport;
    private javax.swing.JButton btnZReport1;
    private javax.swing.JButton btnZeroFiscalReceipt;
    private javax.swing.JCheckBox chbCashDrawerDeviceEnabled;
    private javax.swing.JCheckBox chbCashDrawerFreezeEvents;
    private javax.swing.JTextField edtCashDrawerBeepDelay;
    private javax.swing.JTextField edtCashDrawerBeepDuration;
    private javax.swing.JTextField edtCashDrawerBeepFrequency;
    private javax.swing.JTextField edtCashDrawerBeepTimeout;
    private javax.swing.JTextField edtCashDrawerDeviceName;
    private javax.swing.JTextField edtCashDrawerTimeout;
    private javax.swing.JTextField edtDayOpened;
    private javax.swing.JTextField edtDeviceName;
    private javax.swing.JTextField edtDrawerState;
    private javax.swing.JTextField edtHeaderImageFile;
    private javax.swing.JTextField edtImageFile;
    private javax.swing.JTextField edtTextFileName;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton15;
    private javax.swing.JButton jButton16;
    private javax.swing.JButton jButton17;
    private javax.swing.JButton jButton18;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JLabel lblDayOpened;
    private javax.swing.JLabel lblDrawerState;
    private javax.swing.JPanel pnlCash1;
    private javax.swing.JPanel pnlFptr1;
    private javax.swing.JPanel pnlFptr2;
    private javax.swing.JTabbedPane tabPane1;
    private javax.swing.JTextArea txtReport;
    // End of variables declaration//GEN-END:variables
}
