SnapScan backend 1.4.13: Support for ADF

DEVEL_2_0_BRANCH-1
Oliver Schwartz 2002-05-02 17:19:20 +00:00
rodzic 370793323e
commit 61ef620c9a
5 zmienionych plików z 67 dodań i 68 usunięć

Wyświetl plik

@ -282,11 +282,16 @@ static void init_options (SnapScan_Scanner * ps)
source_list[i++] = src_tpo;
po[OPT_SOURCE].cap &= ~SANE_CAP_INACTIVE;
}
if (ps->hconfig & HCFG_ADF)
{
source_list[i++] = src_adf;
po[OPT_SOURCE].cap &= ~SANE_CAP_INACTIVE;
}
source_list[i] = 0;
po[OPT_SOURCE].size = max_string_size(source_list);
po[OPT_SOURCE].constraint.string_list = source_list;
ps->source = SRC_FLATBED;
ps->source_s = (SANE_Char *) strdup(source_list[0]);
ps->source_s = (SANE_Char *) strdup(src_flatbed);
}
po[OPT_GEOMETRY_GROUP].title = SANE_I18N("Geometry");
@ -843,9 +848,10 @@ SANE_Status sane_control_option (SANE_Handle h,
}
/* prevent setting of options during a scan */
if (pss->state!=ST_IDLE) {
DBG(DL_INFO,
"set value for option %s ignored: scanner is still scanning\n",
pss->options[n].name
DBG(DL_INFO,
"set value for option %s ignored: scanner is still scanning (status %d)\n",
pss->options[n].name,
pss->state
);
return SANE_STATUS_DEVICE_BUSY;
}
@ -1009,6 +1015,12 @@ SANE_Status sane_control_option (SANE_Handle h,
pss->pdev->x_range.max = x_range_tpo.max;
pss->pdev->y_range.max = y_range_tpo.max;
}
else if (strcmp(v, src_adf) == 0)
{
pss->source = SRC_ADF;
pss->pdev->x_range.max = x_range_fb.max;
pss->pdev->y_range.max = y_range_fb.max;
}
else
{
DBG (DL_MAJOR_ERROR,
@ -1336,6 +1348,9 @@ SANE_Status sane_control_option (SANE_Handle h,
/*
* $Log$
* Revision 1.4 2002/05/02 17:19:14 oliverschwartz
* SnapScan backend 1.4.13: Support for ADF
*
* Revision 1.3 2002/04/27 15:35:16 oliverschwartz
* SnapScan backend 1.4.12: Fix option handling
*

Wyświetl plik

@ -867,6 +867,9 @@ static SANE_Status set_window (SnapScan_Scanner *pss)
if (pss->source == SRC_TPO) {
source |= 0x08;
}
if (pss->source == SRC_ADF) {
source |= 0x10;
}
pc[SET_WINDOW_P_OPERATION_MODE] = source;
DBG (DL_MINOR_INFO, "%s: operation mode set to %d\n", me, (int) source);
pc[SET_WINDOW_P_RED_UNDER_COLOR] = 0xff; /* defaults */
@ -957,7 +960,7 @@ static SANE_Status send_diagnostic (SnapScan_Scanner *pss)
pss->pdev->model == SNAPSCAN1236)
{
return SANE_STATUS_GOOD;
}
}
DBG (DL_CALL_TRACE, "%s\n", me);
status = snapscan_cmd (pss->pdev->bus, pss->fd, cmd, sizeof (cmd), NULL, NULL);
@ -973,8 +976,8 @@ static SANE_Status wait_scanner_ready (SnapScan_Scanner *pss)
DBG (DL_CALL_TRACE, "%s\n", me);
/* if the tray is returning to the start position
no time to wait is returned by the scanner. We'll
/* if the tray is returning to the start position
no time to wait is returned by the scanner. We'll
try several times and sleep 1 second between each try. */
for (retries = 20; retries; retries--)
{
@ -997,6 +1000,9 @@ static SANE_Status wait_scanner_ready (SnapScan_Scanner *pss)
/* hardware error; bail */
DBG (DL_MAJOR_ERROR, "%s: hardware error detected.\n", me);
return status;
case SANE_STATUS_JAMMED:
case SANE_STATUS_NO_DOCS:
return status;
default:
DBG (DL_MAJOR_ERROR,
"%s: unhandled request_sense result; trying again.\n",
@ -1178,6 +1184,9 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss)
/*
* $Log$
* Revision 1.17 2002/05/02 17:19:15 oliverschwartz
* SnapScan backend 1.4.13: Support for ADF
*
* Revision 1.16 2002/04/27 15:35:17 oliverschwartz
* SnapScan backend 1.4.12: Fix option handling
*

Wyświetl plik

@ -78,7 +78,7 @@
#define EXPECTED_MAJOR 1
#define MINOR_VERSION 4
#define BUILD 12
#define BUILD 13
#include "snapscan.h"
@ -162,6 +162,7 @@ static char md_lineart[] = SANE_I18N("Lineart");
/* predefined scan source names */
static char src_flatbed[] = SANE_I18N("Flatbed");
static char src_tpo[] = SANE_I18N("Transparency Adapter");
static char src_adf[] = SANE_I18N("Document Feeder");
/* predefined scan window setting names */
static char pdw_none[] = SANE_I18N("none");
@ -933,19 +934,12 @@ SANE_Status sane_open (SANE_String_Const name, SANE_Handle * h)
status = wait_scanner_ready (pss);
if (status != SANE_STATUS_GOOD)
{
if (status == SANE_STATUS_DEVICE_BUSY)
{
sleep(5);
}
else
{
DBG (DL_MAJOR_ERROR,
"%s: error waiting for scanner to warm up: %s\n",
me,
sane_strstatus(status));
free (pss);
return status;
}
DBG (DL_MAJOR_ERROR,
"%s: error waiting for scanner to warm up: %s\n",
me,
sane_strstatus(status));
free (pss);
return status;
}
DBG (DL_MINOR_INFO, "%s: performing scanner self test.\n", me);
status = send_diagnostic (pss);
@ -1569,10 +1563,19 @@ SANE_Status sane_start (SANE_Handle h)
status = scan(pss);
if (status != SANE_STATUS_GOOD)
{
DBG (DL_MAJOR_ERROR, "%s: scan command failed.\n", me);
DBG (DL_MAJOR_ERROR, "%s: scan command failed: %s.\n", me, sane_strstatus(status));
release_unit (pss);
return status;
}
status = wait_scanner_ready (pss);
if (status != SANE_STATUS_GOOD)
{
DBG (DL_MAJOR_ERROR, "%s: scan command failed: %s.\n", me, sane_strstatus(status));
release_unit (pss);
return status;
}
DBG (DL_MINOR_INFO, "%s: starting the reader process.\n", me);
status = start_reader(pss);
{
@ -1605,8 +1608,10 @@ SANE_Status sane_read (SANE_Handle h,
*plen = 0;
if (pss->state == ST_CANCEL_INIT)
if (pss->state == ST_CANCEL_INIT) {
pss->state = ST_IDLE;
return SANE_STATUS_CANCELLED;
}
if (pss->psrc == NULL || pss->psrc->remaining(pss->psrc) == 0)
{
@ -1757,6 +1762,9 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
/*
* $Log$
* Revision 1.23 2002/05/02 17:19:16 oliverschwartz
* SnapScan backend 1.4.13: Support for ADF
*
* Revision 1.22 2002/04/27 15:35:18 oliverschwartz
* SnapScan backend 1.4.12: Fix option handling
*

Wyświetl plik

@ -87,7 +87,8 @@
:interface "SCSI"
:comment "Close SnapScan 310 compatible."
:mfg "Acer"
:mfg "Acer / Benq"
:url "www.benq.com
;------------------------------------------------------------------------------
:model "300f"
@ -140,12 +141,17 @@
:interface "USB"
:comment "Have no specific programming info yet, untested."
:mfg "Guillemot International"
:mfg "Guillemot / Hercules"
:url "www.guillemot.com"
;------------------------------------------------------------------------------
:model "Maxi Scan A4 Deluxe (SCSI)"
:interface "SCSI"
:comment "May be a repackaged Vuego 310s or SnapScan 310s."
:model "Scan@home Touch 1248 (USB)"
:interface "USB"
:comment "Seems to be a repackaged Acer 3300."
; :comment and :url specifiers are optional after :mfg, :model, :desc,
; and at the top-level.

Wyświetl plik

@ -36,6 +36,10 @@ msgstr "Flachbett"
msgid "Transparency Adapter"
msgstr "Durchlicht"
#snapscan.c:166
msgid "Document Feeder"
msgstr "Automatischer Dokumenteinzug"
#snapscan.c:227
msgid "none"
msgstr "keine"
@ -123,46 +127,3 @@ msgstr "Farbzeilen pro Lesevorgang"
#snapscan.c:821
msgid "Greyscale lines per read"
msgstr "Graustufenzeilen pro Lesevorgang"
#snapscan.c:835
msgid "SCSI commands (for debugging)"
msgstr "SCSI Befehle (zur Fehlerbehebung)"
#snapscan.c:840
msgid "Inquiry"
msgstr "Inquiry"
#snapscan.c:841
msgid "Send an Inquiry command to the scanner and dump out some of "
"the current settings."
msgstr "Sendet ein 'Inquiry' Kommando an den Scanner und gibt einige "
"der momentanen Einstellungen aus."
#snapscan.c:849
msgid "Self test"
msgstr "Selbsttest"
#snapscan.c:850
msgid "Send a Self Test command to the scanner and report the result."
msgstr "Sendet ein Selbstestkommando an den Scanner und gibt das "
"Ergebnis aus"
#snapscan.c:857
msgid "Request sense"
msgstr "Request sense"
#snapscan.c:858
msgid "Send a Request Sense command to the scanner, and print out the sense "
"report."
msgstr "Sendet ein 'Request Sense' Kommando an den Scanner und gibt "
"den aktuellen Sense-Status aus."
#snapscan.c:866
msgid "Release unit (cancel)"
msgstr "Release unit (Abbruch)"
#snapscan.c:867
msgid "Send a Release Unit command to the scanner. This is the same as "
"a cancel command."
msgstr "Sendet ein 'Release Unit' Kommando an den Scanner. Dies führt "
"zum selben Ergebnis wie ein Abbruch-Kommando"