Added options to set the time after which the lamp of the A3 Pro is shut off

and to shut it off immediately.
merge-requests/1/head
Henning Geinitz 2005-05-05 17:28:38 +00:00
rodzic 2cba59f874
commit b3669f8d6e
5 zmienionych plików z 57 dodań i 7 usunięć

Wyświetl plik

@ -1,6 +1,10 @@
2005-05-05 Henning Meier-Geinitz <henning@meier-geinitz.de> 2005-05-05 Henning Meier-Geinitz <henning@meier-geinitz.de>
* doc/descriptions/unsupported.desc: Added Dell 922. * doc/descriptions/unsupported.desc: Added Dell 922.
* backend/mustek.c backend/mustek.h doc/descriptions/mustek.desc
doc/mustek/mustek.CHANGES: Added options to set the time after
which the lamp of the A3 Pro is shut off and to shut it off
immediately.
2005-05-02 Peter Fales <peter@fales-lorenz.net> 2005-05-02 Peter Fales <peter@fales-lorenz.net>
* backend/gphoto2.c: Fix core dump when no port is specified in * backend/gphoto2.c: Fix core dump when no port is specified in

Wyświetl plik

@ -1,7 +1,7 @@
/* sane - Scanner Access Now Easy. /* sane - Scanner Access Now Easy.
Copyright (C) 1996, 1997 David Mosberger-Tang and Andreas Czechanowski, Copyright (C) 1996, 1997 David Mosberger-Tang and Andreas Czechanowski,
1998 Andreas Bolsch for extension to ScanExpress models version 0.6, 1998 Andreas Bolsch for extension to ScanExpress models version 0.6,
2000-2004 Henning Meier-Geinitz, 2000-2005 Henning Meier-Geinitz,
2003 James Perry (600 EP). 2003 James Perry (600 EP).
This file is part of the SANE package. This file is part of the SANE package.
@ -48,7 +48,7 @@
/**************************************************************************/ /**************************************************************************/
/* Mustek backend version */ /* Mustek backend version */
#define BUILD 137 #define BUILD 138
/**************************************************************************/ /**************************************************************************/
#include "../include/sane/config.h" #include "../include/sane/config.h"
@ -115,6 +115,8 @@ static SANE_Int new_dev_len;
/* Number of entries alloced for new_dev */ /* Number of entries alloced for new_dev */
static SANE_Int new_dev_alloced; static SANE_Int new_dev_alloced;
static SANE_Int lamp_off_time = 60;
/* Used for line-distance correction: */ /* Used for line-distance correction: */
static const SANE_Int color_seq[] = { static const SANE_Int color_seq[] = {
1, 2, 0 /* green, blue, red */ 1, 2, 0 /* green, blue, red */
@ -2105,7 +2107,7 @@ set_window_pro (Mustek_Scanner * s)
STORE16L (cp, SANE_UNFIX (s->val[OPT_BR_Y].w) * pixels_per_mm + 0.5); STORE16L (cp, SANE_UNFIX (s->val[OPT_BR_Y].w) * pixels_per_mm + 0.5);
if (strcmp (s->hw->sane.model, "1200 SP PRO") != 0) if (strcmp (s->hw->sane.model, "1200 SP PRO") != 0)
*cp++ = 0x3c; /* Only needed for A3 Pro, 60 minutes until lamp-off */ *cp++ = lamp_off_time; /* Only needed for A3 Pro, default: 60 minutes until lamp-off */
DBG (5, "set_window_pro\n"); DBG (5, "set_window_pro\n");
return dev_cmd (s, cmd, (cp - cmd), 0, 0); return dev_cmd (s, cmd, (cp - cmd), 0, 0);
@ -4330,6 +4332,27 @@ init_options (Mustek_Scanner * s)
s->opt[OPT_FAST_PREVIEW].type = SANE_TYPE_BOOL; s->opt[OPT_FAST_PREVIEW].type = SANE_TYPE_BOOL;
s->val[OPT_FAST_PREVIEW].w = SANE_FALSE; s->val[OPT_FAST_PREVIEW].w = SANE_FALSE;
/* lamp off time*/
s->opt[OPT_LAMP_OFF_TIME].name = "lamp-off-time";
s->opt[OPT_LAMP_OFF_TIME].title = SANE_I18N ("Lamp off time (minutes)");
s->opt[OPT_LAMP_OFF_TIME].desc = SANE_I18N ("Set the time (in minutes) after "
"which the lamp is shut off.");
s->opt[OPT_LAMP_OFF_TIME].type = SANE_TYPE_INT;
if (strcmp (s->hw->sane.model, "1200 A3 PRO") != 0)
s->opt[OPT_LAMP_OFF_TIME].cap |= SANE_CAP_INACTIVE;
s->opt[OPT_LAMP_OFF_TIME].constraint_type = SANE_CONSTRAINT_RANGE;
s->opt[OPT_LAMP_OFF_TIME].constraint.range = &u8_range;
s->val[OPT_LAMP_OFF_TIME].w = 60;
/* shut lamp off */
s->opt[OPT_LAMP_OFF_BUTTON].name = "lamp-off";
s->opt[OPT_LAMP_OFF_BUTTON].title = SANE_I18N ("Turn lamp off");
s->opt[OPT_LAMP_OFF_BUTTON].desc = SANE_I18N ("Turns the lamp off immediately.");
s->opt[OPT_LAMP_OFF_BUTTON].type = SANE_TYPE_BUTTON;
s->opt[OPT_LAMP_OFF_BUTTON].cap = SANE_CAP_SOFT_SELECT;
if (strcmp (s->hw->sane.model, "1200 A3 PRO") != 0)
s->opt[OPT_LAMP_OFF_BUTTON].cap |= SANE_CAP_INACTIVE;
/* "Geometry" group: */ /* "Geometry" group: */
s->opt[OPT_GEOMETRY_GROUP].title = SANE_I18N ("Geometry"); s->opt[OPT_GEOMETRY_GROUP].title = SANE_I18N ("Geometry");
s->opt[OPT_GEOMETRY_GROUP].desc = ""; s->opt[OPT_GEOMETRY_GROUP].desc = "";
@ -5725,7 +5748,8 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
DBG (1, "sane_control_option: handle is null!\n"); DBG (1, "sane_control_option: handle is null!\n");
return SANE_STATUS_INVAL; return SANE_STATUS_INVAL;
} }
if (!val)
if (s->opt[option].type != SANE_TYPE_BUTTON && !val)
{ {
DBG (1, "sane_control_option: val is null!\n"); DBG (1, "sane_control_option: val is null!\n");
return SANE_STATUS_INVAL; return SANE_STATUS_INVAL;
@ -5785,6 +5809,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
case OPT_CONTRAST_B: case OPT_CONTRAST_B:
case OPT_CUSTOM_GAMMA: case OPT_CUSTOM_GAMMA:
case OPT_QUALITY_CAL: case OPT_QUALITY_CAL:
case OPT_LAMP_OFF_TIME:
*(SANE_Word *) val = s->val[option].w; *(SANE_Word *) val = s->val[option].w;
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
@ -5826,6 +5851,20 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
switch (option) switch (option)
{ {
case OPT_LAMP_OFF_BUTTON:
{
SANE_Int old_time = lamp_off_time;
SANE_Status status;
status = dev_open (s->hw->sane.name, s, sense_handler);
if (status != SANE_STATUS_GOOD)
return status;
lamp_off_time = 0;
set_window_pro (s);
lamp_off_time = old_time;
dev_close (s);
return SANE_STATUS_GOOD;
}
/* (mostly) side-effect-free word options: */ /* (mostly) side-effect-free word options: */
case OPT_RESOLUTION: case OPT_RESOLUTION:
case OPT_TL_X: case OPT_TL_X:
@ -5847,6 +5886,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
case OPT_CONTRAST_G: case OPT_CONTRAST_G:
case OPT_CONTRAST_B: case OPT_CONTRAST_B:
case OPT_QUALITY_CAL: case OPT_QUALITY_CAL:
case OPT_LAMP_OFF_TIME:
s->val[option].w = *(SANE_Word *) val; s->val[option].w = *(SANE_Word *) val;
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;

Wyświetl plik

@ -1,7 +1,7 @@
/* sane - Scanner Access Now Easy. /* sane - Scanner Access Now Easy.
Copyright (C) 1996, 1997 David Mosberger-Tang, 1998 Andreas Bolsch for Copyright (C) 1996, 1997 David Mosberger-Tang, 1998 Andreas Bolsch for
extension to ScanExpress models version 0.5, extension to ScanExpress models version 0.5,
2000 - 2002 Henning Meier-Geinitz. 2000 - 2005 Henning Meier-Geinitz.
This file is part of the SANE package. This file is part of the SANE package.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
@ -172,7 +172,8 @@ enum Mustek_Option
OPT_SOURCE, OPT_SOURCE,
OPT_PREVIEW, OPT_PREVIEW,
OPT_FAST_PREVIEW, OPT_FAST_PREVIEW,
OPT_LAMP_OFF_TIME,
OPT_LAMP_OFF_BUTTON,
OPT_GEOMETRY_GROUP, OPT_GEOMETRY_GROUP,
OPT_TL_X, /* top-left x */ OPT_TL_X, /* top-left x */
OPT_TL_Y, /* top-left y */ OPT_TL_Y, /* top-left y */

Wyświetl plik

@ -9,7 +9,7 @@
; ;
:backend "mustek" ; name of backend :backend "mustek" ; name of backend
:version "1.0-137" ; version of backend :version "1.0-138" ; version of backend
:manpage "sane-mustek" ; name of manpage (if it exists) :manpage "sane-mustek" ; name of manpage (if it exists)
:url "http://www.meier-geinitz.de/sane/mustek-backend/" :url "http://www.meier-geinitz.de/sane/mustek-backend/"
:comment "Most Mustek SCSI scanners are supported by this backend. For USB scanners, look at the mustek_usb backend." :comment "Most Mustek SCSI scanners are supported by this backend. For USB scanners, look at the mustek_usb backend."

Wyświetl plik

@ -1,5 +1,10 @@
CHANGES for the SANE Mustek backend CHANGES for the SANE Mustek backend
2005-05-05:
* Released Mustek backend 1.0-138
* Added options to set the time after which the lamp of the A3 Pro is shut
off and to shut it off immediately.
2004-06-08 2004-06-08
* Released Mustek backend 1.0-137 * Released Mustek backend 1.0-137
* Reduced scan area of Mustek Paragon 1200 A3 Pro. Removed warning message. * Reduced scan area of Mustek Paragon 1200 A3 Pro. Removed warning message.