kopia lustrzana https://gitlab.com/sane-project/backends
use expiration time option
- use expiration time option value to managed cached entries - changelog for genesys build #2506merge-requests/1/head
rodzic
1549a56b75
commit
f6896e0de4
|
@ -1,3 +1,8 @@
|
|||
2015-04-12 Stéphane Voltz <stef.dev@free.fr>
|
||||
* doc/sane-genesys.man backend/genesys.[ch] backend/genesys_low.c:
|
||||
fix calibration cleared when calibration file loaded,
|
||||
add expiration time option for cache.
|
||||
|
||||
2015-04-07 Rolf Bensch <rolf at bensch hyphen online dot de>
|
||||
* backend/pixma_mp810.c: Canon Pixma MP990 TPU scan patch from Guillaume
|
||||
Courtois.
|
||||
|
|
|
@ -5320,6 +5320,9 @@ calc_parameters (Genesys_Scanner * s)
|
|||
s->dev->settings.brightness=0;
|
||||
}
|
||||
|
||||
/* cache expiration time */
|
||||
s->dev->settings.expiration_time=s->val[OPT_EXPIRATION_TIME].w;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
@ -1766,7 +1766,8 @@ int sanei_genesys_get_lowest_dpi(Genesys_Device *dev)
|
|||
* A calibration cache is compatible if color mode and x dpi match the user
|
||||
* requested scan. In the case of CIS scanners, dpi isn't a criteria.
|
||||
* flatbed cache entries are considred too old and then expires if they
|
||||
* are older dans 1h, forcing calcibration at least once an hour. */
|
||||
* are older than the expiration time option, forcing calibration at least once
|
||||
* then given time. */
|
||||
SANE_Status
|
||||
sanei_genesys_is_compatible_calibration (Genesys_Device * dev,
|
||||
Genesys_Calibration_Cache * cache,
|
||||
|
@ -1832,13 +1833,13 @@ sanei_genesys_is_compatible_calibration (Genesys_Device * dev,
|
|||
return SANE_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
/* a cache entry expires after 60 minutes for non sheetfed scanners */
|
||||
/* a cache entry expires after afetr expiration time for non sheetfed scanners */
|
||||
/* this is not taken into account when overwriting cache entries */
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
if(for_overwrite == SANE_FALSE)
|
||||
if(for_overwrite == SANE_FALSE && dev->settings.expiration_time >=0)
|
||||
{
|
||||
gettimeofday (&time, NULL);
|
||||
if ((time.tv_sec - cache->last_calibration > 60 * 60)
|
||||
if ((time.tv_sec - cache->last_calibration > dev->settings.expiration_time*60)
|
||||
&& (dev->model->is_sheetfed == SANE_FALSE)
|
||||
&& (dev->settings.scan_method == SCAN_METHOD_FLATBED))
|
||||
{
|
||||
|
|
|
@ -707,6 +707,9 @@ typedef struct
|
|||
|
||||
/**< value for brightness enhancement in the [-100..100] range */
|
||||
int brightness;
|
||||
|
||||
/**< cahe entries expiration time */
|
||||
int expiration_time;
|
||||
} Genesys_Settings;
|
||||
|
||||
typedef struct Genesys_Current_Setup
|
||||
|
|
Ładowanie…
Reference in New Issue