Hi, On Friday 30 September 2005 08:26, Gerhard Jaeger wrote: > Hi, > > On Thursday 29 September 2005 20:34, Henning Meier-Geinitz wrote: > > Hi, > > > > On Thu, Sep 29, 2005 at 05:05:18PM +0200, Gerhard Jaeger wrote: > > > please find attached a patch to make the OpticSlim M12 scanner > > > work. Work here means, scan a sheet. > > > > I have included the patch into CVS with some modifications. Please > > check if it still works. See below for details. > > > > > Calibration is not available, > > > > How does that work with sheet-fed scanners at all? Is there also some > > kind of calibration area? > > as Gerard already stated. there's an extra calibration sheed, which > needs to be scanned at the first time, then the settings are stored > somewhere. > > > > > > area selection is limited - positioning does currently not work. > > > > That means that length and width can be changed but not tl-x and tl-y? > > Yes and No. Need to do some more investigations on how to set tl-y, tl-x > seems to be fine. > > > > The patch is meant as a starting point to make gt68xx based sheet-fed > > > scanner > > > work. It should apply to the current cvs. > > > > > > @Henning: It's up to you to include it. Maybe some changes are needed - > > > I'll > > > test them. > > > > > > Ciao, > > > Gerhard > > > > > --- sane-backends/doc/descriptions/gt68xx.desc.orig 2005-09-27 > > > 11:19:02.000000000 +0200 > > > +++ sane-backends/doc/descriptions/gt68xx.desc 2005-09-29 > > > 16:57:39.000000000 +0200 > > > > [...] > > > > > + if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED) > > > + { > > > + s->val[OPT_BACKTRACK_LINES].w = 0x3f; > > > + DISABLE (OPT_BACKTRACK_LINES); > > > + } > > > + > > > > Is it really necessary to disable that option unconditionally? > > Otherwise I would move the check for GT68XX_FLAG_SHEET_FED up to the > > normal setting of that option (normally 0x3f is used for CCD). > > Hmmm, probably not.
Not tested, but go ahead - let's try your way. > > > > - RIE (gt68xx_scanner_calibrate (s, &scan_request)); > > > + if ( !(s->dev->model->flags & GT68XX_FLAG_SHEET_FED)) { > > > + RIE (gt68xx_scanner_calibrate (s, &scan_request)); > > > + } > > > > I haven't changed that because coarse and fine calibration is turned > > off anyway for that scanner. > > Okay! > > > > --- sane-backends/backend/gt68xx_devices.c.orig 2005-09-27 > > > 11:18:57.000000000 +0200 > > > +++ sane-backends/backend/gt68xx_devices.c 2005-09-29 > > > 11:29:05.000000000 +0200 > > > > I used a new command_set for sheet-fed types. this way we have more > > flexibility. > > Tried that in my first approach, but failed - anyway I'll test the changes. > > > Also there is one more level of indirection (always call > > gt68xx_device_*, not gt68xx_generic_* or gt68xx_gt6816_* directly). > > Okay, I see. > > > > > > --- sane-backends/backend/gt68xx_generic.c.orig 2005-09-27 > > > 11:18:57.000000000 +0200 > > > +++ sane-backends/backend/gt68xx_generic.c 2005-09-29 > > > 11:29:49.000000000 +0200 > > > @@ -96,10 +96,17 @@ gt68xx_generic_read_scanned_data (GT68xx > > > > > > RIE (gt68xx_device_req (dev, req, req)); > > > > > > - if (req[0] == 0) > > > - *ready = SANE_TRUE; > > > + *ready = SANE_FALSE; > > > + if (dev->model->flags & GT68XX_FLAG_SHEET_FED) > > > + { > > > + if (req[0] == 0 && req[1] == 0x35 ) > > > + *ready = SANE_TRUE; > > > + } > > > > Is this really necessary? I know that 95% of the gt68xx scanners > > return 00 35 but I only test for 00 beacuse of the 5% which don't > > return the 35. If it also works with the test only for the 00, I would > > prefer to keep the old version. At the moment, i have apllied your > > patch, however. > > Maybe it is not necessary - I'll test that too. Okay, works both ways - you can remove that and go back to the old behaviour. > > > > > in gt68xx_geneirc_set_exposure-time: > > > > > + if (dev->model->flags & GT68XX_FLAG_SHEET_FED) > > > + return SANE_STATUS_GOOD; > > > + > > > > Not applied. Added a check in gt68xx_high.c instead. > > Okay. Seems to work w/o modifications. I think setting the correct exposure times needs to be done anyway. > > > > --- sane-backends/backend/gt68xx_gt6816.c.orig 2005-06-01 > > > 13:28:18.000000000 +0200 > > > +++ sane-backends/backend/gt68xx_gt6816.c 2005-09-29 11:23:28.000000000 > > > +0200 > > > @@ -217,6 +217,9 @@ gt6816_carriage_home (GT68xx_Device * de > > > { > > > GT68xx_Packet req; > > > > > > + if (dev->model->flags & GT68XX_FLAG_SHEET_FED) > > > + return SANE_STATUS_GOOD; > > > + > > > > Not applied. Added checks in gt68xx.c instead. > > Okay. > > > > > > > In stop scan: > > > { > > > GT68xx_Packet req; > > > > > > + if (dev->model->flags & GT68XX_FLAG_SHEET_FED) > > > + { > > > + memset (req, 0, sizeof (req)); > > > + req[0] = 0x42; > > > + req[1] = 0x01; > > > > Not applied. Used gt6801_stop_scan instead in the new command_set. > > Okay - Thanks for the new version, I'll test that the next days. Well, I've checked the CVS version and it works "out of the box" with the previous mentioned restrictions. I think this is now a good base for further work... Ciao, Gerhard