Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0015470 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
feature request | [Java Client POS] (No Category) | minor | always | 2010-12-16 20:18 | 2011-06-03 12:22 | |||||||
Reporter | Henne | View Status | public | |||||||||
Assigned To | adrianromero | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | Fix in branch | Fixed in SCM revision | |||||||||
Projection | none | ETA | none | Target Version | 2.40 | |||||||
OS | Any | Database | Any | Java version | ||||||||
OS Version | Database version | Ant version | ||||||||||
Product Version | 2.30.1 | SCM revision | ||||||||||
Regression date | ||||||||||||
Regression introduced by commit | ||||||||||||
Regression level | ||||||||||||
Review Assigned To | ||||||||||||
Regression introduced in release | ||||||||||||
Summary | 0015470: Support for Siemens Nixdorf ND55 escpos printer | |||||||||||
Description | OpenbravoPos has no support for the ND77 printer. Here is the driver for it. | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | nd77.diff [^] (13,897 bytes) 2010-12-16 20:18 [Show Content] [Hide Content]diff -r 8d7a6ecfa591 src-pos/com/openbravo/pos/config/JPanelConfigGeneral.java --- a/src-pos/com/openbravo/pos/config/JPanelConfigGeneral.java Wed Jul 21 18:56:33 2010 +0200 +++ b/src-pos/com/openbravo/pos/config/JPanelConfigGeneral.java Thu Dec 16 19:33:50 2010 +0100 @@ -140,6 +140,7 @@ jcboMachinePrinter.addItem("tmu220"); jcboMachinePrinter.addItem("star"); jcboMachinePrinter.addItem("ithaca"); + jcboMachinePrinter.addItem("nd77"); jcboMachinePrinter.addItem("surepos"); jcboMachinePrinter.addItem("plain"); jcboMachinePrinter.addItem("javapos"); @@ -165,6 +166,7 @@ jcboMachinePrinter2.addItem("tmu220"); jcboMachinePrinter2.addItem("star"); jcboMachinePrinter2.addItem("ithaca"); + jcboMachinePrinter2.addItem("nd77"); jcboMachinePrinter2.addItem("surepos"); jcboMachinePrinter2.addItem("plain"); jcboMachinePrinter2.addItem("javapos"); @@ -190,6 +192,7 @@ jcboMachinePrinter3.addItem("tmu220"); jcboMachinePrinter3.addItem("star"); jcboMachinePrinter3.addItem("ithaca"); + jcboMachinePrinter3.addItem("nd77"); jcboMachinePrinter3.addItem("surepos"); jcboMachinePrinter3.addItem("plain"); jcboMachinePrinter3.addItem("javapos"); @@ -396,7 +399,12 @@ config.setProperty("machine.ticketsbag", comboValue(jcboTicketsBag.getSelectedItem())); String sMachinePrinter = comboValue(jcboMachinePrinter.getSelectedItem()); - if ("epson".equals(sMachinePrinter) || "tmu220".equals(sMachinePrinter) || "star".equals(sMachinePrinter) || "ithaca".equals(sMachinePrinter) || "surepos".equals(sMachinePrinter)) { + if ("epson".equals(sMachinePrinter) || + "tmu220".equals(sMachinePrinter) || + "star".equals(sMachinePrinter) || + "ithaca".equals(sMachinePrinter) || + "nd77".equals(sMachinePrinter) || + "surepos".equals(sMachinePrinter)) { config.setProperty("machine.printer", sMachinePrinter + ":" + comboValue(jcboConnPrinter.getSelectedItem()) + "," + comboValue(jcboSerialPrinter.getSelectedItem())); } else if ("javapos".equals(sMachinePrinter)) { config.setProperty("machine.printer", sMachinePrinter + ":" + m_jtxtJPOSPrinter.getText() + "," + m_jtxtJPOSDrawer.getText()); @@ -407,7 +415,12 @@ } String sMachinePrinter2 = comboValue(jcboMachinePrinter2.getSelectedItem()); - if ("epson".equals(sMachinePrinter2) || "tmu220".equals(sMachinePrinter2) || "star".equals(sMachinePrinter2) || "ithaca".equals(sMachinePrinter2) || "surepos".equals(sMachinePrinter2)) { + if ("epson".equals(sMachinePrinter2) || + "tmu220".equals(sMachinePrinter2) || + "star".equals(sMachinePrinter2) || + "ithaca".equals(sMachinePrinter2) || + "nd77".equals(sMachinePrinter2) || + "surepos".equals(sMachinePrinter2)) { config.setProperty("machine.printer.2", sMachinePrinter2 + ":" + comboValue(jcboConnPrinter2.getSelectedItem()) + "," + comboValue(jcboSerialPrinter2.getSelectedItem())); } else if ("javapos".equals(sMachinePrinter2)) { config.setProperty("machine.printer.2", sMachinePrinter2 + ":" + m_jtxtJPOSPrinter2.getText() + "," + m_jtxtJPOSDrawer2.getText()); @@ -419,7 +432,12 @@ String sMachinePrinter3 = comboValue(jcboMachinePrinter3.getSelectedItem()); - if ("epson".equals(sMachinePrinter3) || "tmu220".equals(sMachinePrinter3) || "star".equals(sMachinePrinter3) || "ithaca".equals(sMachinePrinter3) || "surepos".equals(sMachinePrinter3)) { + if ("epson".equals(sMachinePrinter3) || + "tmu220".equals(sMachinePrinter3) || + "star".equals(sMachinePrinter3) || + "ithaca".equals(sMachinePrinter3) || + "nd77".equals(sMachinePrinter3) || + "surepos".equals(sMachinePrinter3)) { config.setProperty("machine.printer.3", sMachinePrinter3 + ":" + comboValue(jcboConnPrinter3.getSelectedItem()) + "," + comboValue(jcboSerialPrinter3.getSelectedItem())); } else if ("javapos".equals(sMachinePrinter3)) { config.setProperty("machine.printer.3", sMachinePrinter3 + ":" + m_jtxtJPOSPrinter3.getText() + "," + m_jtxtJPOSDrawer3.getText()); @@ -1166,7 +1184,12 @@ private void jcboMachinePrinter3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcboMachinePrinter3ActionPerformed CardLayout cl = (CardLayout) (m_jPrinterParams3.getLayout()); - if ("epson".equals(jcboMachinePrinter3.getSelectedItem()) || "tmu220".equals(jcboMachinePrinter3.getSelectedItem()) || "star".equals(jcboMachinePrinter3.getSelectedItem()) || "ithaca".equals(jcboMachinePrinter3.getSelectedItem()) || "surepos".equals(jcboMachinePrinter3.getSelectedItem())) { + if ("epson".equals(jcboMachinePrinter3.getSelectedItem()) || + "tmu220".equals(jcboMachinePrinter3.getSelectedItem()) || + "star".equals(jcboMachinePrinter3.getSelectedItem()) || + "ithaca".equals(jcboMachinePrinter3.getSelectedItem()) || + "nd77".equals(jcboMachinePrinter3.getSelectedItem()) || + "surepos".equals(jcboMachinePrinter3.getSelectedItem())) { cl.show(m_jPrinterParams3, "comm"); } else if ("javapos".equals(jcboMachinePrinter3.getSelectedItem())) { cl.show(m_jPrinterParams3, "javapos"); @@ -1180,7 +1203,12 @@ private void jcboMachinePrinter2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcboMachinePrinter2ActionPerformed CardLayout cl = (CardLayout) (m_jPrinterParams2.getLayout()); - if ("epson".equals(jcboMachinePrinter2.getSelectedItem()) || "tmu220".equals(jcboMachinePrinter2.getSelectedItem()) || "star".equals(jcboMachinePrinter2.getSelectedItem()) || "ithaca".equals(jcboMachinePrinter2.getSelectedItem()) || "surepos".equals(jcboMachinePrinter2.getSelectedItem())) { + if ("epson".equals(jcboMachinePrinter2.getSelectedItem()) || + "tmu220".equals(jcboMachinePrinter2.getSelectedItem()) || + "star".equals(jcboMachinePrinter2.getSelectedItem()) || + "ithaca".equals(jcboMachinePrinter2.getSelectedItem()) || + "nd77".equals(jcboMachinePrinter2.getSelectedItem()) || + "surepos".equals(jcboMachinePrinter2.getSelectedItem())) { cl.show(m_jPrinterParams2, "comm"); } else if ("javapos".equals(jcboMachinePrinter2.getSelectedItem())) { cl.show(m_jPrinterParams2, "javapos"); @@ -1206,7 +1234,12 @@ private void jcboMachinePrinterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcboMachinePrinterActionPerformed CardLayout cl = (CardLayout) (m_jPrinterParams1.getLayout()); - if ("epson".equals(jcboMachinePrinter.getSelectedItem()) || "tmu220".equals(jcboMachinePrinter.getSelectedItem()) || "star".equals(jcboMachinePrinter.getSelectedItem()) || "ithaca".equals(jcboMachinePrinter.getSelectedItem()) || "surepos".equals(jcboMachinePrinter.getSelectedItem())) { + if ("epson".equals(jcboMachinePrinter.getSelectedItem()) || + "tmu220".equals(jcboMachinePrinter.getSelectedItem()) || + "star".equals(jcboMachinePrinter.getSelectedItem()) || + "ithaca".equals(jcboMachinePrinter.getSelectedItem()) || + "nd77".equals(jcboMachinePrinter.getSelectedItem()) || + "surepos".equals(jcboMachinePrinter.getSelectedItem())) { cl.show(m_jPrinterParams1, "comm"); } else if ("javapos".equals(jcboMachinePrinter.getSelectedItem())) { cl.show(m_jPrinterParams1, "javapos"); diff -r 8d7a6ecfa591 src-pos/com/openbravo/pos/printer/DeviceTicket.java --- a/src-pos/com/openbravo/pos/printer/DeviceTicket.java Wed Jul 21 18:56:33 2010 +0200 +++ b/src-pos/com/openbravo/pos/printer/DeviceTicket.java Thu Dec 16 19:33:50 2010 +0100 @@ -161,6 +161,8 @@ addPrinter(sPrinterIndex, new DevicePrinterESCPOS(pws.getPrinterWritter(sPrinterParam1, sPrinterParam2), new CodesStar(), new UnicodeTranslatorStar())); } else if ("ithaca".equals(sPrinterType)) { addPrinter(sPrinterIndex, new DevicePrinterESCPOS(pws.getPrinterWritter(sPrinterParam1, sPrinterParam2), new CodesIthaca(), new UnicodeTranslatorInt())); + } else if ("nd77".equals(sPrinterType)) { + addPrinter(sPrinterIndex, new DevicePrinterESCPOS(pws.getPrinterWritter(sPrinterParam1, sPrinterParam2), new CodesND77(), new UnicodeTranslatorInt())); } else if ("surepos".equals(sPrinterType)) { addPrinter(sPrinterIndex, new DevicePrinterESCPOS(pws.getPrinterWritter(sPrinterParam1, sPrinterParam2), new CodesSurePOS(), new UnicodeTranslatorSurePOS())); } else if ("plain".equals(sPrinterType)) { diff -r 8d7a6ecfa591 src-pos/com/openbravo/pos/printer/escpos/CodesND77.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src-pos/com/openbravo/pos/printer/escpos/CodesND77.java Thu Dec 16 19:33:50 2010 +0100 @@ -0,0 +1,126 @@ +// Openbravo POS is a point of sales application designed for touch screens. +// Copyright (C) 2007-2009 Openbravo, S.L. +// http://www.openbravo.com/product/pos +// +// This file is part of Openbravo POS. +// +// Openbravo POS is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Openbravo POS is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Openbravo POS. If not, see <http://www.gnu.org/licenses/>. + + +package com.openbravo.pos.printer.escpos; + +import java.awt.image.BufferedImage; + +/** + * @author HenrikKretzschmar + */ +public class CodesND77 extends Codes { + + private static final byte[] INITSEQUENCE = {0x1b, 0x40}; + + private static final byte[] CHAR_SIZE_0 = {0x1b, 0x21, 0x01}; + private static final byte[] CHAR_SIZE_1 = {0x1b, 0x21, 0x11}; + private static final byte[] CHAR_SIZE_2 = {0x1b, 0x21, 0x21}; + private static final byte[] CHAR_SIZE_3 = {0x1b, 0x21, 0x31}; + + private static final byte[] BOLD_SET = {0x1b, 0x45, 0x01}; + private static final byte[] BOLD_RESET = {0x1b, 0x45, 0x00}; + private static final byte[] UNDERLINE_SET = {0x1b, 0x2d, 0x01}; + private static final byte[] UNDERLINE_RESET = {0x1b, 0x2d, 0x00}; + +/* To open the cash drawer sequence of 5 bytes is sent to the ND77. + The first two bytes (0x1b, 0x70) are constant. + The third byte represents the pin on which the opening pulse is sent. + The value 0x00 and 0x48 are pin 2, + the value 0x01 and 0x49 are pin 5. + The last both bytes represent the pulse time for start and + stop the opening pulse in 10 ms steps. + If the value is odd, it is incremented by one internally. + If the start value is bigger than the stop value both valuesi + are exchanged internally. + The default values of start=5 and stop=255 (-0x01) are needed + by Simens Nixdorf cash drawers. + */ + private static final byte[] OPEN_DRAWER = {0x1b, 0x70, 0x00, 0x05, -0x01}; + + private static final byte[] CUT_FULL = {0x1b, 0x69}; +// private static final byte[] CUT_PARTIAL = {0x1b, 0x6d}; + + private static final byte[] IMAGE_HEADER = {0x1d, 0x2a}; + private static final byte[] IMAGE_PRINT = {0x1d, 0x2f, 0x00}; + private static final byte[] NEW_LINE = {0x0a}; + + public CodesND77() { + } + + public byte[] getInitSequence() { return INITSEQUENCE; } + + public byte[] getSize0() { return CHAR_SIZE_0; } + public byte[] getSize1() { return CHAR_SIZE_1; } + public byte[] getSize2() { return CHAR_SIZE_2; } + public byte[] getSize3() { return CHAR_SIZE_3; } + + public byte[] getBoldSet() { return BOLD_SET; } + public byte[] getBoldReset() { return BOLD_RESET; } + public byte[] getUnderlineSet() { return UNDERLINE_SET; } + public byte[] getUnderlineReset() { return UNDERLINE_RESET; } + + public byte[] getOpenDrawer() { return OPEN_DRAWER; } + public byte[] getCutReceipt() { return CUT_FULL; } + public byte[] getNewLine() { return NEW_LINE; } + public byte[] getImageHeader() { return IMAGE_HEADER; } + public int getImageWidth() { return 180; } + + @Override + public byte[] transImage(BufferedImage image) { + + CenteredImage centeredimage = new CenteredImage(image, getImageWidth()); + + int iWidth = (centeredimage.getWidth() + 7) / 8; + int iHeight = (centeredimage.getHeight() + 7) / 8; + + // Truncate height if the picture is to height + if (iWidth * iHeight > 404) + iHeight = 404 / iWidth; + + int index = getImageHeader().length; + + //Create a byte array for all the data sent to the printer + byte[] bData = new byte[index + 2 + iWidth * iHeight * 8 + IMAGE_PRINT.length]; + + // Copy "Define Bitmap" Instruction + System.arraycopy(getImageHeader(), 0, bData, 0, index); + + // Copy the Width and Height in Bytes + bData[index++] = (byte)iWidth; + bData[index++] = (byte)iHeight; + + // Copy the image data + // This printer processes the pixel data vertically! + for (int i = 0; i < iWidth*8; i++) + for (int j = 0; j < iHeight; j++) { + int p=0x00; + + for (int d = 0; d < 8; d++) + if (centeredimage.isBlack(i, j*8+d)) + p = p | 0x01 << (7-d); + bData[index++] = (byte)p; + } + + // Copy the "Print Bitmap" instruction + System.arraycopy(IMAGE_PRINT, 0, bData, bData.length-IMAGE_PRINT.length, IMAGE_PRINT.length); + + return bData; + } +} | |||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |
Notes | |
(0033262) adrianromero (manager) 2010-12-17 10:08 |
Thank you Henne I expect to include it in the next Openbravo POS release. |
Issue History | |||
Date Modified | Username | Field | Change |
2010-12-16 20:18 | Henne | New Issue | |
2010-12-16 20:18 | Henne | Assigned To | => adrianromero |
2010-12-16 20:18 | Henne | File Added: nd77.diff | |
2010-12-17 10:08 | adrianromero | Note Added: 0033262 | |
2010-12-17 10:08 | adrianromero | Target Version | => 2.40 |
2011-06-03 10:58 | dalsasua | Assigned To | adrianromero => dalsasua |
2011-06-03 12:22 | dalsasua | Assigned To | dalsasua => adrianromero |
2012-11-07 09:40 | priyam | Category | 01 - General => (No Category) |
Copyright © 2000 - 2009 MantisBT Group |