kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Support multiple scan methods in scanner_move()
rodzic
27aea235b4
commit
6a5fd2d36c
|
@ -1047,13 +1047,12 @@ void scanner_stop_action_no_move(Genesys_Device& dev, genesys::Genesys_Register_
|
||||||
dev.interface->sleep_ms(100);
|
dev.interface->sleep_ms(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
void scanner_move(Genesys_Device& dev, unsigned steps, Direction direction)
|
void scanner_move(Genesys_Device& dev, ScanMethod scan_method, unsigned steps, Direction direction)
|
||||||
{
|
{
|
||||||
DBG_HELPER_ARGS(dbg, "steps=%d direction=%d", steps, static_cast<unsigned>(direction));
|
DBG_HELPER_ARGS(dbg, "steps=%d direction=%d", steps, static_cast<unsigned>(direction));
|
||||||
|
|
||||||
auto local_reg = dev.reg;
|
auto local_reg = dev.reg;
|
||||||
|
|
||||||
auto scan_method = dev.model->default_method;
|
|
||||||
unsigned resolution = dev.model->get_resolution_settings(scan_method).get_min_resolution_y();
|
unsigned resolution = dev.model->get_resolution_settings(scan_method).get_min_resolution_y();
|
||||||
|
|
||||||
const auto& sensor = sanei_genesys_find_sensor(&dev, resolution, 3, scan_method);
|
const auto& sensor = sanei_genesys_find_sensor(&dev, resolution, 3, scan_method);
|
||||||
|
@ -1109,7 +1108,6 @@ void scanner_move(Genesys_Device& dev, unsigned steps, Direction direction)
|
||||||
|
|
||||||
if (is_testing_mode()) {
|
if (is_testing_mode()) {
|
||||||
dev.interface->test_checkpoint("feed");
|
dev.interface->test_checkpoint("feed");
|
||||||
|
|
||||||
// FIXME: why don't we stop the scanner like on other ASICs
|
// FIXME: why don't we stop the scanner like on other ASICs
|
||||||
if (dev.model->asic_type != AsicType::GL843) {
|
if (dev.model->asic_type != AsicType::GL843) {
|
||||||
scanner_stop_action(dev);
|
scanner_stop_action(dev);
|
||||||
|
@ -1170,7 +1168,7 @@ void scanner_move_back_home(Genesys_Device& dev, bool wait_until_home)
|
||||||
|
|
||||||
if (dev.model->model_id == ModelId::CANON_LIDE_210) {
|
if (dev.model->model_id == ModelId::CANON_LIDE_210) {
|
||||||
// move the head back a little first
|
// move the head back a little first
|
||||||
scanner_move(dev, 20, Direction::BACKWARD);
|
scanner_move(dev, dev.model->default_method, 20, Direction::BACKWARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
Genesys_Register_Set local_reg = dev.reg;
|
Genesys_Register_Set local_reg = dev.reg;
|
||||||
|
|
|
@ -1351,7 +1351,8 @@ void CommandSetGl124::init_regs_for_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
DBG (DBG_info, "%s: move=%f steps\n", __func__, move);
|
DBG (DBG_info, "%s: move=%f steps\n", __func__, move);
|
||||||
|
|
||||||
if (dev->settings.get_channels() * dev->settings.yres >= 600 && move > 700) {
|
if (dev->settings.get_channels() * dev->settings.yres >= 600 && move > 700) {
|
||||||
scanner_move(*dev, static_cast<unsigned>(move - 500), Direction::FORWARD);
|
scanner_move(*dev, dev->model->default_method, static_cast<unsigned>(move - 500),
|
||||||
|
Direction::FORWARD);
|
||||||
move=500;
|
move=500;
|
||||||
}
|
}
|
||||||
DBG(DBG_info, "%s: move=%f steps\n", __func__, move);
|
DBG(DBG_info, "%s: move=%f steps\n", __func__, move);
|
||||||
|
|
|
@ -2730,7 +2730,7 @@ void CommandSetGl843::asic_boot(Genesys_Device* dev, bool cold) const
|
||||||
// setup gpio
|
// setup gpio
|
||||||
gl843_init_gpio(dev);
|
gl843_init_gpio(dev);
|
||||||
|
|
||||||
scanner_move(*dev, 300, Direction::FORWARD);
|
scanner_move(*dev, dev->model->default_method, 300, Direction::FORWARD);
|
||||||
dev->interface->sleep_ms(100);
|
dev->interface->sleep_ms(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2790,7 +2790,7 @@ void CommandSetGl843::move_to_ta(Genesys_Device* dev) const
|
||||||
}
|
}
|
||||||
unsigned feed = static_cast<unsigned>(multiplier * (dev->model->y_offset_sensor_to_ta * resolution) /
|
unsigned feed = static_cast<unsigned>(multiplier * (dev->model->y_offset_sensor_to_ta * resolution) /
|
||||||
MM_PER_INCH);
|
MM_PER_INCH);
|
||||||
scanner_move(*dev, feed, Direction::FORWARD);
|
scanner_move(*dev, dev->model->default_method, feed, Direction::FORWARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1101,7 +1101,8 @@ void CommandSetGl846::init_regs_for_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
* resolution. So leave a remainder for it so scan makes the final
|
* resolution. So leave a remainder for it so scan makes the final
|
||||||
* move tuning */
|
* move tuning */
|
||||||
if (dev->settings.get_channels() * dev->settings.yres >= 600 && move > 700) {
|
if (dev->settings.get_channels() * dev->settings.yres >= 600 && move > 700) {
|
||||||
scanner_move(*dev, static_cast<unsigned>(move - 500), Direction::FORWARD);
|
scanner_move(*dev, dev->model->default_method, static_cast<unsigned>(move - 500),
|
||||||
|
Direction::FORWARD);
|
||||||
move=500;
|
move=500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1235,7 +1236,8 @@ SensorExposure CommandSetGl846::led_calibration(Genesys_Device* dev, const Genes
|
||||||
move = static_cast<float>((move * (dev->motor.base_ydpi / 4)) / MM_PER_INCH);
|
move = static_cast<float>((move * (dev->motor.base_ydpi / 4)) / MM_PER_INCH);
|
||||||
if(move>20)
|
if(move>20)
|
||||||
{
|
{
|
||||||
scanner_move(*dev, static_cast<unsigned>(move), Direction::FORWARD);
|
scanner_move(*dev, dev->model->default_method, static_cast<unsigned>(move),
|
||||||
|
Direction::FORWARD);
|
||||||
}
|
}
|
||||||
DBG(DBG_io, "%s: move=%f steps\n", __func__, move);
|
DBG(DBG_io, "%s: move=%f steps\n", __func__, move);
|
||||||
|
|
||||||
|
|
|
@ -1135,7 +1135,8 @@ void CommandSetGl847::init_regs_for_scan(Genesys_Device* dev, const Genesys_Sens
|
||||||
* resolution. So leave a remainder for it so scan makes the final
|
* resolution. So leave a remainder for it so scan makes the final
|
||||||
* move tuning */
|
* move tuning */
|
||||||
if (dev->settings.get_channels() * dev->settings.yres >= 600 && move > 700) {
|
if (dev->settings.get_channels() * dev->settings.yres >= 600 && move > 700) {
|
||||||
scanner_move(*dev, static_cast<unsigned>(move - 500), Direction::FORWARD);
|
scanner_move(*dev, dev->model->default_method, static_cast<unsigned>(move - 500),
|
||||||
|
Direction::FORWARD);
|
||||||
move=500;
|
move=500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1269,7 +1270,8 @@ SensorExposure CommandSetGl847::led_calibration(Genesys_Device* dev, const Genes
|
||||||
move = static_cast<float>(dev->model->y_offset_calib_white);
|
move = static_cast<float>(dev->model->y_offset_calib_white);
|
||||||
move = static_cast<float>((move * (dev->motor.base_ydpi / 4)) / MM_PER_INCH);
|
move = static_cast<float>((move * (dev->motor.base_ydpi / 4)) / MM_PER_INCH);
|
||||||
if (move > 20) {
|
if (move > 20) {
|
||||||
scanner_move(*dev, static_cast<unsigned>(move), Direction::FORWARD);
|
scanner_move(*dev, dev->model->default_method, static_cast<unsigned>(move),
|
||||||
|
Direction::FORWARD);
|
||||||
}
|
}
|
||||||
DBG(DBG_io, "%s: move=%f steps\n", __func__, move);
|
DBG(DBG_io, "%s: move=%f steps\n", __func__, move);
|
||||||
|
|
||||||
|
|
|
@ -353,7 +353,7 @@ extern void sanei_genesys_search_reference_point(Genesys_Device* dev, Genesys_Se
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
// moves the scan head by the specified steps at the motor base dpi
|
// moves the scan head by the specified steps at the motor base dpi
|
||||||
void scanner_move(Genesys_Device& dev, unsigned steps, Direction direction);
|
void scanner_move(Genesys_Device& dev, ScanMethod scan_method, unsigned steps, Direction direction);
|
||||||
|
|
||||||
void scanner_move_back_home(Genesys_Device& dev, bool wait_until_home);
|
void scanner_move_back_home(Genesys_Device& dev, bool wait_until_home);
|
||||||
void scanner_move_back_home_ta(Genesys_Device& dev);
|
void scanner_move_back_home_ta(Genesys_Device& dev);
|
||||||
|
|
Ładowanie…
Reference in New Issue