1
0
mirror of https://git.familie-radermacher.ch/linux/ptouch-print.git synced 2025-10-05 19:23:12 +00:00

add --timeout option

This commit is contained in:
Markus Schramma 2025-09-28 08:05:41 +02:00 committed by Dominic Radermacher
parent e730c3b480
commit d8a4ed71e2
7 changed files with 116 additions and 104 deletions

View File

@ -106,7 +106,7 @@ size_t ptouch_get_max_width(ptouch_dev ptdev);
size_t ptouch_get_tape_width(ptouch_dev ptdev); size_t ptouch_get_tape_width(ptouch_dev ptdev);
int ptouch_page_flags(ptouch_dev ptdev, uint8_t page_flags); int ptouch_page_flags(ptouch_dev ptdev, uint8_t page_flags);
int ptouch_finalize(ptouch_dev ptdev, int chain); int ptouch_finalize(ptouch_dev ptdev, int chain);
int ptouch_getstatus(ptouch_dev ptdev); int ptouch_getstatus(ptouch_dev ptdev, int timeout);
int ptouch_getmaxwidth(ptouch_dev ptdev); int ptouch_getmaxwidth(ptouch_dev ptdev);
int ptouch_send_d460bt_magic(ptouch_dev ptdev); int ptouch_send_d460bt_magic(ptouch_dev ptdev);
int ptouch_send_d460bt_chain(ptouch_dev ptdev); int ptouch_send_d460bt_chain(ptouch_dev ptdev);

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: ptouch-print 1.3.1\n" "Project-Id-Version: ptouch-print 1.3.1\n"
"Report-Msgid-Bugs-To: dominic@familie-radermacher.ch\n" "Report-Msgid-Bugs-To: dominic@familie-radermacher.ch\n"
"POT-Creation-Date: 2025-08-11 09:57+0200\n" "POT-Creation-Date: 2025-09-28 08:03+0200\n"
"PO-Revision-Date: 2024-05-23 22:27-0400\n" "PO-Revision-Date: 2024-05-23 22:27-0400\n"
"Last-Translator: dominic@familie-radermacher.ch\n" "Last-Translator: dominic@familie-radermacher.ch\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n" "Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
@ -107,7 +107,7 @@ msgstr ""
#: src/libptouch.c:371 #: src/libptouch.c:371
#, c-format #, c-format
msgid "timeout while waiting for status response\n" msgid "timeout (%i sec) while waiting for status response\n"
msgstr "" msgstr ""
#: src/libptouch.c:385 #: src/libptouch.c:385
@ -155,149 +155,149 @@ msgstr ""
msgid "debug: called ptouch_sendraster() with NULL ptdev\n" msgid "debug: called ptouch_sendraster() with NULL ptdev\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:143 #: src/ptouch-print.c:146
#, c-format #, c-format
msgid "nothing to print\n" msgid "nothing to print\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:151 #: src/ptouch-print.c:154
#, c-format #, c-format
msgid "image is too large (%ipx x %ipx)\n" msgid "image is too large (%ipx x %ipx)\n"
msgstr "Bild ist zu gross (%ipx x %ipx)\n" msgstr "Bild ist zu gross (%ipx x %ipx)\n"
#: src/ptouch-print.c:152 #: src/ptouch-print.c:155
#, c-format #, c-format
msgid "maximum printing width for this tape is %ipx\n" msgid "maximum printing width for this tape is %ipx\n"
msgstr "Maximal druckbare Breite für dieses Schriftband sind %ipx\n" msgstr "Maximal druckbare Breite für dieses Schriftband sind %ipx\n"
#: src/ptouch-print.c:155 #: src/ptouch-print.c:158
#, fuzzy, c-format #, fuzzy, c-format
msgid "image size (%ipx x %ipx)\n" msgid "image size (%ipx x %ipx)\n"
msgstr "Bild ist zu gross (%ipx x %ipx)\n" msgstr "Bild ist zu gross (%ipx x %ipx)\n"
#: src/ptouch-print.c:165 #: src/ptouch-print.c:168
#, c-format #, c-format
msgid "ptouch_rasterstart() failed\n" msgid "ptouch_rasterstart() failed\n"
msgstr "ptouch_rasterstart() fehlgeschlagen\n" msgstr "ptouch_rasterstart() fehlgeschlagen\n"
#: src/ptouch-print.c:171 #: src/ptouch-print.c:174
#, c-format #, c-format
msgid "send print information command\n" msgid "send print information command\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:177 #: src/ptouch-print.c:180
#, c-format #, c-format
msgid "send PT-D460BT magic commands\n" msgid "send PT-D460BT magic commands\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:183 #: src/ptouch-print.c:186
#, c-format #, c-format
msgid "send precut command\n" msgid "send precut command\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:191 #: src/ptouch-print.c:194
#, c-format #, c-format
msgid "send PT-D460BT chain commands\n" msgid "send PT-D460BT chain commands\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:203 #: src/ptouch-print.c:206
#, fuzzy, c-format #, fuzzy, c-format
msgid "ptouch_sendraster() failed\n" msgid "ptouch_sendraster() failed\n"
msgstr "ptouch_send() fehlgeschlagen\n" msgstr "ptouch_send() fehlgeschlagen\n"
#: src/ptouch-print.c:252 #: src/ptouch-print.c:255
#, c-format #, c-format
msgid "writing image '%s' failed\n" msgid "writing image '%s' failed\n"
msgstr "Schreiben der Bilddatei '%s' fehlgeschlagen\n" msgstr "Schreiben der Bilddatei '%s' fehlgeschlagen\n"
#: src/ptouch-print.c:274 #: src/ptouch-print.c:277
#, c-format #, c-format
msgid "debug: o baseline offset - %d\n" msgid "debug: o baseline offset - %d\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:275 #: src/ptouch-print.c:278
#, c-format #, c-format
msgid "debug: text baseline offset - %d\n" msgid "debug: text baseline offset - %d\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:334 #: src/ptouch-print.c:337
#, c-format #, c-format
msgid "render_text(): %i lines, font = '%s'\n" msgid "render_text(): %i lines, font = '%s'\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:337 #: src/ptouch-print.c:340
#, c-format #, c-format
msgid "warning: font config not available\n" msgid "warning: font config not available\n"
msgstr "Warnung: fontconfig ist nicht verfügbar\n" msgstr "Warnung: fontconfig ist nicht verfügbar\n"
#: src/ptouch-print.c:341 #: src/ptouch-print.c:344
#, c-format #, c-format
msgid "setting font size=%i\n" msgid "setting font size=%i\n"
msgstr "setze Zeichensatzgrösse=%i\n" msgstr "setze Zeichensatzgrösse=%i\n"
#: src/ptouch-print.c:345 #: src/ptouch-print.c:348
#, c-format #, c-format
msgid "could not estimate needed font size\n" msgid "could not estimate needed font size\n"
msgstr "Konnte die notwendige Zeichensatzgrösse nicht bestimmen\n" msgstr "Konnte die notwendige Zeichensatzgrösse nicht bestimmen\n"
#: src/ptouch-print.c:352 #: src/ptouch-print.c:355
#, c-format #, c-format
msgid "choosing font size=%i\n" msgid "choosing font size=%i\n"
msgstr "Wähle Zeichensatzgrösse %i\n" msgstr "Wähle Zeichensatzgrösse %i\n"
#: src/ptouch-print.c:368 src/ptouch-print.c:396 #: src/ptouch-print.c:371 src/ptouch-print.c:399
#, c-format #, c-format
msgid "error in gdImageStringFT: %s\n" msgid "error in gdImageStringFT: %s\n"
msgstr "Fehler in Funktion gdImageStringFT(): %s\n" msgstr "Fehler in Funktion gdImageStringFT(): %s\n"
#: src/ptouch-print.c:557 #: src/ptouch-print.c:563
#, c-format #, c-format
msgid "Only up to %d lines are supported" msgid "Only up to %d lines are supported"
msgstr "" msgstr ""
#: src/ptouch-print.c:570 #: src/ptouch-print.c:576
msgid "No arguments supported" msgid "No arguments supported"
msgstr "" msgstr ""
#: src/ptouch-print.c:575 #: src/ptouch-print.c:581
msgid "Option --writepng missing" msgid "Option --writepng missing"
msgstr "" msgstr ""
#: src/ptouch-print.c:578 #: src/ptouch-print.c:584
msgid "Options --force_tape_width and --info can't be used together" msgid "Options --force_tape_width and --info can't be used together"
msgstr "" msgstr ""
#: src/ptouch-print.c:609 #: src/ptouch-print.c:615
#, c-format #, c-format
msgid "ptouch_init() failed\n" msgid "ptouch_init() failed\n"
msgstr "ptouch_init() fehlgeschlagen\n" msgstr "ptouch_init() fehlgeschlagen\n"
#: src/ptouch-print.c:612 #: src/ptouch-print.c:618
#, c-format #, c-format
msgid "ptouch_getstatus() failed\n" msgid "ptouch_getstatus() failed\n"
msgstr "ptouch_getstatus() fehlgeschlagen\n" msgstr "ptouch_getstatus() fehlgeschlagen\n"
#: src/ptouch-print.c:626 #: src/ptouch-print.c:632
#, fuzzy, c-format #, fuzzy, c-format
msgid "maximum printing width for this printer is %ldpx\n" msgid "maximum printing width for this printer is %ldpx\n"
msgstr "Maximal druckbare Breite für dieses Schriftband sind %ipx\n" msgstr "Maximal druckbare Breite für dieses Schriftband sind %ipx\n"
#: src/ptouch-print.c:627 #: src/ptouch-print.c:633
#, fuzzy, c-format #, fuzzy, c-format
msgid "maximum printing width for this tape is %ldpx\n" msgid "maximum printing width for this tape is %ldpx\n"
msgstr "Maximal druckbare Breite für dieses Schriftband sind %ipx\n" msgstr "Maximal druckbare Breite für dieses Schriftband sind %ipx\n"
#: src/ptouch-print.c:652 #: src/ptouch-print.c:658
#, c-format #, c-format
msgid "failed to load image file\n" msgid "failed to load image file\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:661 #: src/ptouch-print.c:667
#, c-format #, c-format
msgid "could not render text\n" msgid "could not render text\n"
msgstr "Konnte Text nicht rendern\n" msgstr "Konnte Text nicht rendern\n"
#: src/ptouch-print.c:700 #: src/ptouch-print.c:706
#, c-format #, c-format
msgid "ptouch_finalize(%d) failed\n" msgid "ptouch_finalize(%d) failed\n"
msgstr "ptouch_finalize(%d) fehlgeschlagen\n" msgstr "ptouch_finalize(%d) fehlgeschlagen\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: ptouch-print 1.3.1\n" "Project-Id-Version: ptouch-print 1.3.1\n"
"Report-Msgid-Bugs-To: dominic@familie-radermacher.ch\n" "Report-Msgid-Bugs-To: dominic@familie-radermacher.ch\n"
"POT-Creation-Date: 2025-08-11 09:57+0200\n" "POT-Creation-Date: 2025-09-28 08:03+0200\n"
"PO-Revision-Date: 2024-05-23 22:26-0400\n" "PO-Revision-Date: 2024-05-23 22:26-0400\n"
"Last-Translator: dominic@familie-radermacher.ch\n" "Last-Translator: dominic@familie-radermacher.ch\n"
"Language-Team: English <en@translate.freefriends.org>\n" "Language-Team: English <en@translate.freefriends.org>\n"
@ -106,8 +106,8 @@ msgid "read error: %s\n"
msgstr "read error: %s\n" msgstr "read error: %s\n"
#: src/libptouch.c:371 #: src/libptouch.c:371
#, c-format #, fuzzy, c-format
msgid "timeout while waiting for status response\n" msgid "timeout (%i sec) while waiting for status response\n"
msgstr "timeout while waiting for status response\n" msgstr "timeout while waiting for status response\n"
#: src/libptouch.c:385 #: src/libptouch.c:385
@ -155,149 +155,149 @@ msgstr ""
msgid "debug: called ptouch_sendraster() with NULL ptdev\n" msgid "debug: called ptouch_sendraster() with NULL ptdev\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:143 #: src/ptouch-print.c:146
#, c-format #, c-format
msgid "nothing to print\n" msgid "nothing to print\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:151 #: src/ptouch-print.c:154
#, c-format #, c-format
msgid "image is too large (%ipx x %ipx)\n" msgid "image is too large (%ipx x %ipx)\n"
msgstr "image is too large (%ipx x %ipx)\n" msgstr "image is too large (%ipx x %ipx)\n"
#: src/ptouch-print.c:152 #: src/ptouch-print.c:155
#, c-format #, c-format
msgid "maximum printing width for this tape is %ipx\n" msgid "maximum printing width for this tape is %ipx\n"
msgstr "maximum printing width for this tape is %ipx\n" msgstr "maximum printing width for this tape is %ipx\n"
#: src/ptouch-print.c:155 #: src/ptouch-print.c:158
#, fuzzy, c-format #, fuzzy, c-format
msgid "image size (%ipx x %ipx)\n" msgid "image size (%ipx x %ipx)\n"
msgstr "image is too large (%ipx x %ipx)\n" msgstr "image is too large (%ipx x %ipx)\n"
#: src/ptouch-print.c:165 #: src/ptouch-print.c:168
#, c-format #, c-format
msgid "ptouch_rasterstart() failed\n" msgid "ptouch_rasterstart() failed\n"
msgstr "ptouch_rasterstart() failed\n" msgstr "ptouch_rasterstart() failed\n"
#: src/ptouch-print.c:171 #: src/ptouch-print.c:174
#, c-format #, c-format
msgid "send print information command\n" msgid "send print information command\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:177 #: src/ptouch-print.c:180
#, c-format #, c-format
msgid "send PT-D460BT magic commands\n" msgid "send PT-D460BT magic commands\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:183 #: src/ptouch-print.c:186
#, c-format #, c-format
msgid "send precut command\n" msgid "send precut command\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:191 #: src/ptouch-print.c:194
#, c-format #, c-format
msgid "send PT-D460BT chain commands\n" msgid "send PT-D460BT chain commands\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:203 #: src/ptouch-print.c:206
#, c-format #, c-format
msgid "ptouch_sendraster() failed\n" msgid "ptouch_sendraster() failed\n"
msgstr "ptouch_sendraster() failed\n" msgstr "ptouch_sendraster() failed\n"
#: src/ptouch-print.c:252 #: src/ptouch-print.c:255
#, c-format #, c-format
msgid "writing image '%s' failed\n" msgid "writing image '%s' failed\n"
msgstr "writing image '%s' failed\n" msgstr "writing image '%s' failed\n"
#: src/ptouch-print.c:274 #: src/ptouch-print.c:277
#, c-format #, c-format
msgid "debug: o baseline offset - %d\n" msgid "debug: o baseline offset - %d\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:275 #: src/ptouch-print.c:278
#, c-format #, c-format
msgid "debug: text baseline offset - %d\n" msgid "debug: text baseline offset - %d\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:334 #: src/ptouch-print.c:337
#, c-format #, c-format
msgid "render_text(): %i lines, font = '%s'\n" msgid "render_text(): %i lines, font = '%s'\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:337 #: src/ptouch-print.c:340
#, c-format #, c-format
msgid "warning: font config not available\n" msgid "warning: font config not available\n"
msgstr "warning: font config not available\n" msgstr "warning: font config not available\n"
#: src/ptouch-print.c:341 #: src/ptouch-print.c:344
#, c-format #, c-format
msgid "setting font size=%i\n" msgid "setting font size=%i\n"
msgstr "setting font size=%i\n" msgstr "setting font size=%i\n"
#: src/ptouch-print.c:345 #: src/ptouch-print.c:348
#, c-format #, c-format
msgid "could not estimate needed font size\n" msgid "could not estimate needed font size\n"
msgstr "could not estimate needed font size\n" msgstr "could not estimate needed font size\n"
#: src/ptouch-print.c:352 #: src/ptouch-print.c:355
#, c-format #, c-format
msgid "choosing font size=%i\n" msgid "choosing font size=%i\n"
msgstr "choosing font size=%i\n" msgstr "choosing font size=%i\n"
#: src/ptouch-print.c:368 src/ptouch-print.c:396 #: src/ptouch-print.c:371 src/ptouch-print.c:399
#, c-format #, c-format
msgid "error in gdImageStringFT: %s\n" msgid "error in gdImageStringFT: %s\n"
msgstr "error in gdImageStringFT: %s\n" msgstr "error in gdImageStringFT: %s\n"
#: src/ptouch-print.c:557 #: src/ptouch-print.c:563
#, c-format #, c-format
msgid "Only up to %d lines are supported" msgid "Only up to %d lines are supported"
msgstr "" msgstr ""
#: src/ptouch-print.c:570 #: src/ptouch-print.c:576
msgid "No arguments supported" msgid "No arguments supported"
msgstr "" msgstr ""
#: src/ptouch-print.c:575 #: src/ptouch-print.c:581
msgid "Option --writepng missing" msgid "Option --writepng missing"
msgstr "" msgstr ""
#: src/ptouch-print.c:578 #: src/ptouch-print.c:584
msgid "Options --force_tape_width and --info can't be used together" msgid "Options --force_tape_width and --info can't be used together"
msgstr "" msgstr ""
#: src/ptouch-print.c:609 #: src/ptouch-print.c:615
#, c-format #, c-format
msgid "ptouch_init() failed\n" msgid "ptouch_init() failed\n"
msgstr "ptouch_init() failed\n" msgstr "ptouch_init() failed\n"
#: src/ptouch-print.c:612 #: src/ptouch-print.c:618
#, c-format #, c-format
msgid "ptouch_getstatus() failed\n" msgid "ptouch_getstatus() failed\n"
msgstr "ptouch_getstatus() failed\n" msgstr "ptouch_getstatus() failed\n"
#: src/ptouch-print.c:626 #: src/ptouch-print.c:632
#, fuzzy, c-format #, fuzzy, c-format
msgid "maximum printing width for this printer is %ldpx\n" msgid "maximum printing width for this printer is %ldpx\n"
msgstr "maximum printing width for this tape is %ipx\n" msgstr "maximum printing width for this tape is %ipx\n"
#: src/ptouch-print.c:627 #: src/ptouch-print.c:633
#, fuzzy, c-format #, fuzzy, c-format
msgid "maximum printing width for this tape is %ldpx\n" msgid "maximum printing width for this tape is %ldpx\n"
msgstr "maximum printing width for this tape is %ipx\n" msgstr "maximum printing width for this tape is %ipx\n"
#: src/ptouch-print.c:652 #: src/ptouch-print.c:658
#, c-format #, c-format
msgid "failed to load image file\n" msgid "failed to load image file\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:661 #: src/ptouch-print.c:667
#, c-format #, c-format
msgid "could not render text\n" msgid "could not render text\n"
msgstr "could not render text\n" msgstr "could not render text\n"
#: src/ptouch-print.c:700 #: src/ptouch-print.c:706
#, c-format #, c-format
msgid "ptouch_finalize(%d) failed\n" msgid "ptouch_finalize(%d) failed\n"
msgstr "ptouch_finalize(%d) failed\n" msgstr "ptouch_finalize(%d) failed\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: ptouch-print\n" "Project-Id-Version: ptouch-print\n"
"Report-Msgid-Bugs-To: dominic@familie-radermacher.ch\n" "Report-Msgid-Bugs-To: dominic@familie-radermacher.ch\n"
"POT-Creation-Date: 2025-08-11 10:05+0200\n" "POT-Creation-Date: 2025-09-28 08:03+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -105,7 +105,7 @@ msgstr ""
#: src/libptouch.c:371 #: src/libptouch.c:371
#, c-format #, c-format
msgid "timeout while waiting for status response\n" msgid "timeout (%i sec) while waiting for status response\n"
msgstr "" msgstr ""
#: src/libptouch.c:385 #: src/libptouch.c:385
@ -153,149 +153,149 @@ msgstr ""
msgid "debug: called ptouch_sendraster() with NULL ptdev\n" msgid "debug: called ptouch_sendraster() with NULL ptdev\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:143 #: src/ptouch-print.c:146
#, c-format #, c-format
msgid "nothing to print\n" msgid "nothing to print\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:151 #: src/ptouch-print.c:154
#, c-format #, c-format
msgid "image is too large (%ipx x %ipx)\n" msgid "image is too large (%ipx x %ipx)\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:152 #: src/ptouch-print.c:155
#, c-format #, c-format
msgid "maximum printing width for this tape is %ipx\n" msgid "maximum printing width for this tape is %ipx\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:155 #: src/ptouch-print.c:158
#, c-format #, c-format
msgid "image size (%ipx x %ipx)\n" msgid "image size (%ipx x %ipx)\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:165 #: src/ptouch-print.c:168
#, c-format #, c-format
msgid "ptouch_rasterstart() failed\n" msgid "ptouch_rasterstart() failed\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:171 #: src/ptouch-print.c:174
#, c-format #, c-format
msgid "send print information command\n" msgid "send print information command\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:177 #: src/ptouch-print.c:180
#, c-format #, c-format
msgid "send PT-D460BT magic commands\n" msgid "send PT-D460BT magic commands\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:183 #: src/ptouch-print.c:186
#, c-format #, c-format
msgid "send precut command\n" msgid "send precut command\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:191 #: src/ptouch-print.c:194
#, c-format #, c-format
msgid "send PT-D460BT chain commands\n" msgid "send PT-D460BT chain commands\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:203 #: src/ptouch-print.c:206
#, c-format #, c-format
msgid "ptouch_sendraster() failed\n" msgid "ptouch_sendraster() failed\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:252 #: src/ptouch-print.c:255
#, c-format #, c-format
msgid "writing image '%s' failed\n" msgid "writing image '%s' failed\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:274 #: src/ptouch-print.c:277
#, c-format #, c-format
msgid "debug: o baseline offset - %d\n" msgid "debug: o baseline offset - %d\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:275 #: src/ptouch-print.c:278
#, c-format #, c-format
msgid "debug: text baseline offset - %d\n" msgid "debug: text baseline offset - %d\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:334 #: src/ptouch-print.c:337
#, c-format #, c-format
msgid "render_text(): %i lines, font = '%s'\n" msgid "render_text(): %i lines, font = '%s'\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:337 #: src/ptouch-print.c:340
#, c-format #, c-format
msgid "warning: font config not available\n" msgid "warning: font config not available\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:341 #: src/ptouch-print.c:344
#, c-format #, c-format
msgid "setting font size=%i\n" msgid "setting font size=%i\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:345 #: src/ptouch-print.c:348
#, c-format #, c-format
msgid "could not estimate needed font size\n" msgid "could not estimate needed font size\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:352 #: src/ptouch-print.c:355
#, c-format #, c-format
msgid "choosing font size=%i\n" msgid "choosing font size=%i\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:368 src/ptouch-print.c:396 #: src/ptouch-print.c:371 src/ptouch-print.c:399
#, c-format #, c-format
msgid "error in gdImageStringFT: %s\n" msgid "error in gdImageStringFT: %s\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:557 #: src/ptouch-print.c:563
#, c-format #, c-format
msgid "Only up to %d lines are supported" msgid "Only up to %d lines are supported"
msgstr "" msgstr ""
#: src/ptouch-print.c:570 #: src/ptouch-print.c:576
msgid "No arguments supported" msgid "No arguments supported"
msgstr "" msgstr ""
#: src/ptouch-print.c:575 #: src/ptouch-print.c:581
msgid "Option --writepng missing" msgid "Option --writepng missing"
msgstr "" msgstr ""
#: src/ptouch-print.c:578 #: src/ptouch-print.c:584
msgid "Options --force_tape_width and --info can't be used together" msgid "Options --force_tape_width and --info can't be used together"
msgstr "" msgstr ""
#: src/ptouch-print.c:609 #: src/ptouch-print.c:615
#, c-format #, c-format
msgid "ptouch_init() failed\n" msgid "ptouch_init() failed\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:612 #: src/ptouch-print.c:618
#, c-format #, c-format
msgid "ptouch_getstatus() failed\n" msgid "ptouch_getstatus() failed\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:626 #: src/ptouch-print.c:632
#, c-format #, c-format
msgid "maximum printing width for this printer is %ldpx\n" msgid "maximum printing width for this printer is %ldpx\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:627 #: src/ptouch-print.c:633
#, c-format #, c-format
msgid "maximum printing width for this tape is %ldpx\n" msgid "maximum printing width for this tape is %ldpx\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:652 #: src/ptouch-print.c:658
#, c-format #, c-format
msgid "failed to load image file\n" msgid "failed to load image file\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:661 #: src/ptouch-print.c:667
#, c-format #, c-format
msgid "could not render text\n" msgid "could not render text\n"
msgstr "" msgstr ""
#: src/ptouch-print.c:700 #: src/ptouch-print.c:706
#, c-format #, c-format
msgid "ptouch_finalize(%d) failed\n" msgid "ptouch_finalize(%d) failed\n"
msgstr "" msgstr ""

View File

@ -28,6 +28,12 @@ once in any order, and will be executed in the given order.
.TP .TP
.BR \-\-debug .BR \-\-debug
Enables printing of debugging information. Enables printing of debugging information.
.TP
.BR \-\-timeout\ \fI<time>
Set the seconds ptouch-print is waiting for finishing a previous ptouch-print command.
Default is 1 second. 0 (zero) means wait forever.
Useful if ptouch-print is used in a script multiple times, and the device is waiting for the user
to use the mechanical cutter.
.SS "Font selection options" .SS "Font selection options"
.TP .TP

View File

@ -345,11 +345,11 @@ void ptouch_rawstatus(uint8_t raw[32])
return; return;
} }
int ptouch_getstatus(ptouch_dev ptdev) int ptouch_getstatus(ptouch_dev ptdev, int timeout)
{ {
char cmd[]="\x1biS"; /* 1B 69 53 = ESC i S = Status info request */ char cmd[]="\x1biS"; /* 1B 69 53 = ESC i S = Status info request */
uint8_t buf[32] = {}; uint8_t buf[32] = {};
int i, r, tx=0, tries=0; int i, r, tx=0, tries=0, maxtries=timeout*10;
struct timespec w; struct timespec w;
if (!ptdev) { if (!ptdev) {
@ -367,8 +367,8 @@ int ptouch_getstatus(ptouch_dev ptdev)
return -1; return -1;
} }
++tries; ++tries;
if (tries > 10) { if (timeout && tries > maxtries) {
fprintf(stderr, _("timeout while waiting for status response\n")); fprintf(stderr, _("timeout (%i sec) while waiting for status response\n"), timeout);
return -1; return -1;
} }
} }

View File

@ -48,6 +48,7 @@ struct arguments {
int forced_tape_width; int forced_tape_width;
char *save_png; char *save_png;
int verbose; int verbose;
int timeout;
}; };
typedef enum { JOB_CUTMARK, JOB_IMAGE, JOB_PAD, JOB_TEXT, JOB_UNDEFINED } job_type_t; typedef enum { JOB_CUTMARK, JOB_IMAGE, JOB_PAD, JOB_TEXT, JOB_UNDEFINED } job_type_t;
@ -87,6 +88,7 @@ static struct argp_option options[] = {
{ "writepng", 4, "<file>", 0, "Instead of printing, write output to png <file>", 1}, { "writepng", 4, "<file>", 0, "Instead of printing, write output to png <file>", 1},
{ "force-tape-width", 5, "<px>", 0, "Set tape width in pixels, use together with --writepng without a printer connected", 1}, { "force-tape-width", 5, "<px>", 0, "Set tape width in pixels, use together with --writepng without a printer connected", 1},
{ "copies", 6, "<number>", 0, "Sets the number of identical prints", 1}, { "copies", 6, "<number>", 0, "Sets the number of identical prints", 1},
{ "timeout", 7, "<seconds>", 0, "Set timeout waiting for finishing previous job. Default:1, 0 means infinity", 1},
{ 0, 0, 0, 0, "print commands:", 2}, { 0, 0, 0, 0, "print commands:", 2},
{ "image", 'i', "<file>", 0, "Print the given image which must be a 2 color (black/white) png", 2}, { "image", 'i', "<file>", 0, "Print the given image which must be a 2 color (black/white) png", 2},
@ -115,7 +117,8 @@ struct arguments arguments = {
.font_size = 0, .font_size = 0,
.forced_tape_width = 0, .forced_tape_width = 0,
.save_png = NULL, .save_png = NULL,
.verbose = 0 .verbose = 0,
.timeout = 1
}; };
job_t *jobs = NULL; job_t *jobs = NULL;
@ -532,6 +535,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
case 6: // copies case 6: // copies
arguments->copies = strtol(arg, NULL, 10); arguments->copies = strtol(arg, NULL, 10);
break; break;
case 7: // timeout
arguments->timeout = strtol(arg, NULL, 10);
break;
case 'i': // image case 'i': // image
add_job(JOB_IMAGE, 1, arg); add_job(JOB_IMAGE, 1, arg);
break; break;
@ -608,7 +614,7 @@ int main(int argc, char *argv[])
if (ptouch_init(ptdev) != 0) { if (ptouch_init(ptdev) != 0) {
printf(_("ptouch_init() failed\n")); printf(_("ptouch_init() failed\n"));
} }
if (ptouch_getstatus(ptdev) != 0) { if (ptouch_getstatus(ptdev, arguments.timeout) != 0) {
printf(_("ptouch_getstatus() failed\n")); printf(_("ptouch_getstatus() failed\n"));
return 1; return 1;
} }