genesys: Rename slow_back_home() to move_back_home()

merge-requests/256/head
Povilas Kanapickas 2019-12-01 10:43:10 +02:00
rodzic 35c8cb84f8
commit 27aea235b4
16 zmienionych plików z 58 dodań i 58 usunięć

Wyświetl plik

@ -107,7 +107,7 @@ public:
Genesys_Register_Set& regs) const = 0;
virtual void wait_for_motor_stop(Genesys_Device* dev) const = 0;
virtual void slow_back_home(Genesys_Device* dev, bool wait_until_home) const = 0;
virtual void move_back_home(Genesys_Device* dev, bool wait_until_home) const = 0;
virtual void rewind(Genesys_Device* dev) const = 0;

Wyświetl plik

@ -1133,7 +1133,7 @@ void scanner_move(Genesys_Device& dev, unsigned steps, Direction direction)
dev.interface->sleep_ms(100);
}
void scanner_slow_back_home(Genesys_Device& dev, bool wait_until_home)
void scanner_move_back_home(Genesys_Device& dev, bool wait_until_home)
{
DBG_HELPER_ARGS(dbg, "wait_until_home = %d", wait_until_home);
@ -1149,7 +1149,7 @@ void scanner_slow_back_home(Genesys_Device& dev, bool wait_until_home)
}
if (dev.needs_home_ta) {
scanner_slow_back_home_ta(dev);
scanner_move_back_home_ta(dev);
}
if (dev.cmd_set->needs_update_home_sensor_gpio()) {
@ -1236,7 +1236,7 @@ void scanner_slow_back_home(Genesys_Device& dev, bool wait_until_home)
}
if (is_testing_mode()) {
dev.interface->test_checkpoint("slow_back_home");
dev.interface->test_checkpoint("move_back_home");
return;
}
@ -1266,7 +1266,7 @@ void scanner_slow_back_home(Genesys_Device& dev, bool wait_until_home)
dbg.log(DBG_info, "scanhead is still moving");
}
void scanner_slow_back_home_ta(Genesys_Device& dev)
void scanner_move_back_home_ta(Genesys_Device& dev)
{
DBG_HELPER(dbg);
@ -1872,7 +1872,7 @@ static void genesys_repark_sensor_before_shading(Genesys_Device* dev)
if (dev->cmd_set->has_rewind()) {
dev->cmd_set->rewind(dev);
} else {
dev->cmd_set->slow_back_home(dev, true);
dev->cmd_set->move_back_home(dev, true);
}
if (dev->settings.scan_method == ScanMethod::TRANSPARENCY ||
@ -1887,7 +1887,7 @@ static void genesys_repark_sensor_after_white_shading(Genesys_Device* dev)
{
DBG_HELPER(dbg);
if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK) {
dev->cmd_set->slow_back_home(dev, true);
dev->cmd_set->move_back_home(dev, true);
}
}
@ -3312,7 +3312,7 @@ static void genesys_start_scan(Genesys_Device* dev, bool lamp_off)
dev->cmd_set->search_start_position (dev);
dev->parking = false;
dev->cmd_set->slow_back_home (dev, true);
dev->cmd_set->move_back_home(dev, true);
dev->scanhead_position_in_steps = 0;
}
else
@ -3321,7 +3321,7 @@ static void genesys_start_scan(Genesys_Device* dev, bool lamp_off)
/* TODO: check we can drop this since we cannot have the
scanner's head wandering here */
dev->parking = false;
dev->cmd_set->slow_back_home (dev, true);
dev->cmd_set->move_back_home(dev, true);
dev->scanhead_position_in_steps = 0;
}
@ -3371,7 +3371,7 @@ static void genesys_start_scan(Genesys_Device* dev, bool lamp_off)
dev->cmd_set->wait_for_motor_stop(dev);
if (dev->cmd_set->needs_home_before_init_regs_for_scan(dev)) {
dev->cmd_set->slow_back_home(dev, true);
dev->cmd_set->move_back_home(dev, true);
}
if (dev->settings.scan_method == ScanMethod::TRANSPARENCY ||
@ -3490,7 +3490,7 @@ static void genesys_read_ordered_data(Genesys_Device* dev, SANE_Byte* destinatio
if (!dev->model->is_sheetfed && !(dev->model->flags & GENESYS_FLAG_MUST_WAIT) &&
!dev->parking)
{
dev->cmd_set->slow_back_home(dev, false);
dev->cmd_set->move_back_home(dev, false);
dev->parking = true;
}
throw SaneException(SANE_STATUS_EOF, "nothing more to scan: EOF");
@ -4829,7 +4829,7 @@ static void genesys_buffer_image(Genesys_Scanner *s)
* computing so we can save time
*/
if (!dev->model->is_sheetfed && !dev->parking) {
dev->cmd_set->slow_back_home(dev, dev->model->flags & GENESYS_FLAG_MUST_WAIT);
dev->cmd_set->move_back_home(dev, dev->model->flags & GENESYS_FLAG_MUST_WAIT);
dev->parking = !(s->dev->model->flags & GENESYS_FLAG_MUST_WAIT);
}
@ -6037,7 +6037,7 @@ void sane_read_impl(SANE_Handle handle, SANE_Byte * buf, SANE_Int max_len, SANE_
if (!dev->model->is_sheetfed && !(dev->model->flags & GENESYS_FLAG_MUST_WAIT) &&
!dev->parking)
{
dev->cmd_set->slow_back_home(dev, false);
dev->cmd_set->move_back_home(dev, false);
dev->parking = true;
}
throw SaneException(SANE_STATUS_EOF);
@ -6134,7 +6134,7 @@ void sane_cancel_impl(SANE_Handle handle)
/* park head if flatbed scanner */
if (!s->dev->model->is_sheetfed) {
if (!s->dev->parking) {
s->dev->cmd_set->slow_back_home (s->dev, s->dev->model->flags &
s->dev->cmd_set->move_back_home (s->dev, s->dev->model->flags &
GENESYS_FLAG_MUST_WAIT);
s->dev->parking = !(s->dev->model->flags & GENESYS_FLAG_MUST_WAIT);

Wyświetl plik

@ -1125,9 +1125,9 @@ void CommandSetGl124::rewind(Genesys_Device* dev) const
* @param wait_until_home true to make the function waiting for head
* to be home before returning, if fals returne immediately
*/
void CommandSetGl124::slow_back_home(Genesys_Device* dev, bool wait_until_home) const
void CommandSetGl124::move_back_home(Genesys_Device* dev, bool wait_until_home) const
{
scanner_slow_back_home(*dev, wait_until_home);
scanner_move_back_home(*dev, wait_until_home);
}
// Automatically set top-left edge of the scan area by scanning a 200x200 pixels area at 600 dpi
@ -1961,7 +1961,7 @@ void CommandSetGl124::coarse_gain_calibration(Genesys_Device* dev, const Genesys
if (is_testing_mode()) {
dev->interface->test_checkpoint("coarse_gain_calibration");
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
return;
}
@ -2022,7 +2022,7 @@ void CommandSetGl124::coarse_gain_calibration(Genesys_Device* dev, const Genesys
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
}
// wait for lamp warmup by scanning the same line until difference

Wyświetl plik

@ -160,7 +160,7 @@ public:
Genesys_Register_Set& regs) const override;
void wait_for_motor_stop(Genesys_Device* dev) const override;
void slow_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void move_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void rewind(Genesys_Device* dev) const override;
void update_hardware_sensors(struct Genesys_Scanner* s) const override;

Wyświetl plik

@ -1451,7 +1451,7 @@ void CommandSetGl646::end_scan(Genesys_Device* dev, Genesys_Register_Set* reg,
* @param dev scanner's device
* @param wait_until_home true if the function waits until head parked
*/
void CommandSetGl646::slow_back_home(Genesys_Device* dev, bool wait_until_home) const
void CommandSetGl646::move_back_home(Genesys_Device* dev, bool wait_until_home) const
{
DBG_HELPER_ARGS(dbg, "wait_until_home = %d\n", wait_until_home);
int i;
@ -1545,7 +1545,7 @@ void CommandSetGl646::slow_back_home(Genesys_Device* dev, bool wait_until_home)
dev->cmd_set->begin_scan(dev, sensor, &dev->reg, true);
if (is_testing_mode()) {
dev->interface->test_checkpoint("slow_back_home");
dev->interface->test_checkpoint("move_back_home");
return;
}
@ -2695,7 +2695,7 @@ static void gl646_repark_head(Genesys_Device* dev)
while (steps < expected);
// toggle motor flag, put an huge step number and redo move backward
dev->cmd_set->slow_back_home(dev, 1);
dev->cmd_set->move_back_home(dev, 1);
}
/* *
@ -2840,7 +2840,7 @@ void CommandSetGl646::init(Genesys_Device* dev) const
}
else
{
slow_back_home(dev, true);
move_back_home(dev, true);
}
}

Wyświetl plik

@ -281,7 +281,7 @@ public:
Genesys_Register_Set& regs) const override;
void wait_for_motor_stop(Genesys_Device* dev) const override;
void slow_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void move_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void rewind(Genesys_Device* dev) const override;
bool has_rewind() const override { return false; }

Wyświetl plik

@ -2210,7 +2210,7 @@ static void gl841_feed(Genesys_Device* dev, int steps)
}
// Moves the slider to the home (top) position slowly
void CommandSetGl841::slow_back_home(Genesys_Device* dev, bool wait_until_home) const
void CommandSetGl841::move_back_home(Genesys_Device* dev, bool wait_until_home) const
{
DBG_HELPER_ARGS(dbg, "wait_until_home = %d", wait_until_home);
Genesys_Register_Set local_reg;
@ -2278,7 +2278,7 @@ void CommandSetGl841::slow_back_home(Genesys_Device* dev, bool wait_until_home)
}
if (is_testing_mode()) {
dev->interface->test_checkpoint("slow_back_home");
dev->interface->test_checkpoint("move_back_home");
return;
}
@ -2704,7 +2704,7 @@ SensorExposure CommandSetGl841::led_calibration(Genesys_Device* dev, const Genes
if (is_testing_mode()) {
dev->interface->test_checkpoint("led_calibration");
slow_back_home(dev, true);
move_back_home(dev, true);
return { 0, 0, 0 };
}
@ -2809,7 +2809,7 @@ SensorExposure CommandSetGl841::led_calibration(Genesys_Device* dev, const Genes
DBG(DBG_info,"%s: acceptable exposure: %d,%d,%d\n", __func__, exp[0], exp[1], exp[2]);
dev->cmd_set->slow_back_home(dev, true);
dev->cmd_set->move_back_home(dev, true);
return calib_sensor.exposure;
}
@ -3378,7 +3378,7 @@ void CommandSetGl841::coarse_gain_calibration(Genesys_Device* dev, const Genesys
if (is_testing_mode()) {
dev->interface->test_checkpoint("coarse_gain_calibration");
gl841_stop_action(dev);
slow_back_home(dev, true);
move_back_home(dev, true);
return;
}
@ -3475,7 +3475,7 @@ void CommandSetGl841::coarse_gain_calibration(Genesys_Device* dev, const Genesys
gl841_stop_action(dev);
dev->cmd_set->slow_back_home(dev, true);
dev->cmd_set->move_back_home(dev, true);
}
// wait for lamp warmup by scanning the same line until difference
@ -3540,7 +3540,7 @@ static void sanei_gl841_repark_head(Genesys_Device* dev)
gl841_feed(dev,232);
// toggle motor flag, put an huge step number and redo move backward
dev->cmd_set->slow_back_home(dev, true);
dev->cmd_set->move_back_home(dev, true);
}
/*
@ -3586,11 +3586,11 @@ void CommandSetGl841::init(Genesys_Device* dev) const
// Set analog frontend
dev->cmd_set->set_fe(dev, sensor, AFE_INIT);
// FIXME: slow_back_home modifies dev->calib_reg and requires it to be filled
// FIXME: move_back_home modifies dev->calib_reg and requires it to be filled
dev->calib_reg = dev->reg;
// Move home
dev->cmd_set->slow_back_home(dev, true);
dev->cmd_set->move_back_home(dev, true);
// Init shading data
sanei_genesys_init_shading_data(dev, sensor, sensor.sensor_pixels);

Wyświetl plik

@ -98,7 +98,7 @@ public:
Genesys_Register_Set& regs) const override;
void wait_for_motor_stop(Genesys_Device* dev) const override;
void slow_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void move_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void rewind(Genesys_Device* dev) const override;
bool has_rewind() const override { return false; }

Wyświetl plik

@ -1670,9 +1670,9 @@ void CommandSetGl843::end_scan(Genesys_Device* dev, Genesys_Register_Set* reg,
/** @brief Moves the slider to the home (top) position slowly
* */
void CommandSetGl843::slow_back_home(Genesys_Device* dev, bool wait_until_home) const
void CommandSetGl843::move_back_home(Genesys_Device* dev, bool wait_until_home) const
{
scanner_slow_back_home(*dev, wait_until_home);
scanner_move_back_home(*dev, wait_until_home);
}
// Automatically set top-left edge of the scan area by scanning a 200x200 pixels area at 600 dpi
@ -2077,7 +2077,7 @@ SensorExposure CommandSetGl843::led_calibration(Genesys_Device* dev, const Genes
if (is_testing_mode()) {
dev->interface->test_checkpoint("led_calibration");
slow_back_home(dev, true);
move_back_home(dev, true);
return { 0, 0, 0 };
}
@ -2150,7 +2150,7 @@ SensorExposure CommandSetGl843::led_calibration(Genesys_Device* dev, const Genes
DBG(DBG_info, "%s: acceptable exposure: %d,%d,%d\n", __func__, expr, expg, expb);
slow_back_home(dev, true);
move_back_home(dev, true);
return calib_sensor.exposure;
}
@ -2502,7 +2502,7 @@ void CommandSetGl843::coarse_gain_calibration(Genesys_Device* dev, const Genesys
if (is_testing_mode()) {
dev->interface->test_checkpoint("coarse_gain_calibration");
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
return;
}
@ -2556,7 +2556,7 @@ void CommandSetGl843::coarse_gain_calibration(Genesys_Device* dev, const Genesys
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
}
// wait for lamp warmup by scanning the same line until difference

Wyświetl plik

@ -98,7 +98,7 @@ public:
Genesys_Register_Set& regs) const override;
void wait_for_motor_stop(Genesys_Device* dev) const override;
void slow_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void move_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void rewind(Genesys_Device* dev) const override;
bool has_rewind() const override { return false; }

Wyświetl plik

@ -883,9 +883,9 @@ void CommandSetGl846::end_scan(Genesys_Device* dev, Genesys_Register_Set* reg,
}
// Moves the slider to the home (top) postion slowly
void CommandSetGl846::slow_back_home(Genesys_Device* dev, bool wait_until_home) const
void CommandSetGl846::move_back_home(Genesys_Device* dev, bool wait_until_home) const
{
scanner_slow_back_home(*dev, wait_until_home);
scanner_move_back_home(*dev, wait_until_home);
}
// Automatically set top-left edge of the scan area by scanning a 200x200 pixels area at 600 dpi
@ -1305,7 +1305,7 @@ SensorExposure CommandSetGl846::led_calibration(Genesys_Device* dev, const Genes
if (is_testing_mode()) {
dev->interface->test_checkpoint("led_calibration");
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
return { 0, 0, 0 };
}
@ -1374,7 +1374,7 @@ SensorExposure CommandSetGl846::led_calibration(Genesys_Device* dev, const Genes
/* go back home */
if(move>20)
{
slow_back_home(dev, true);
move_back_home(dev, true);
}
return { exp[0], exp[1], exp[2] };
@ -2005,7 +2005,7 @@ void CommandSetGl846::coarse_gain_calibration(Genesys_Device* dev, const Genesys
if (is_testing_mode()) {
dev->interface->test_checkpoint("coarse_gain_calibration");
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
return;
}
@ -2060,7 +2060,7 @@ void CommandSetGl846::coarse_gain_calibration(Genesys_Device* dev, const Genesys
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
}
bool CommandSetGl846::needs_home_before_init_regs_for_scan(Genesys_Device* dev) const

Wyświetl plik

@ -173,7 +173,7 @@ public:
Genesys_Register_Set& regs) const override;
void wait_for_motor_stop(Genesys_Device* dev) const override;
void slow_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void move_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void rewind(Genesys_Device* dev) const override;
bool has_rewind() const override { return false; }

Wyświetl plik

@ -926,9 +926,9 @@ static void gl847_rewind(Genesys_Device* dev)
* @param wait_until_home true to make the function waiting for head
* to be home before returning, if fals returne immediately
*/
void CommandSetGl847::slow_back_home(Genesys_Device* dev, bool wait_until_home) const
void CommandSetGl847::move_back_home(Genesys_Device* dev, bool wait_until_home) const
{
scanner_slow_back_home(*dev, wait_until_home);
scanner_move_back_home(*dev, wait_until_home);
}
// Automatically set top-left edge of the scan area by scanning a 200x200 pixels area at 600 dpi
@ -1339,7 +1339,7 @@ SensorExposure CommandSetGl847::led_calibration(Genesys_Device* dev, const Genes
if (is_testing_mode()) {
dev->interface->test_checkpoint("led_calibration");
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
return { 0, 0, 0 };
}
@ -1402,7 +1402,7 @@ SensorExposure CommandSetGl847::led_calibration(Genesys_Device* dev, const Genes
// go back home
if (move>20) {
slow_back_home(dev, true);
move_back_home(dev, true);
}
return { exp[0], exp[1], exp[2] };
@ -2075,7 +2075,7 @@ void CommandSetGl847::coarse_gain_calibration(Genesys_Device* dev, const Genesys
if (is_testing_mode()) {
dev->interface->test_checkpoint("coarse_gain_calibration");
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
return;
}
@ -2136,7 +2136,7 @@ void CommandSetGl847::coarse_gain_calibration(Genesys_Device* dev, const Genesys
scanner_stop_action(*dev);
slow_back_home(dev, true);
move_back_home(dev, true);
}
bool CommandSetGl847::needs_home_before_init_regs_for_scan(Genesys_Device* dev) const

Wyświetl plik

@ -161,7 +161,7 @@ public:
Genesys_Register_Set& regs) const override;
void wait_for_motor_stop(Genesys_Device* dev) const override;
void slow_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void move_back_home(Genesys_Device* dev, bool wait_until_home) const override;
void rewind(Genesys_Device* dev) const override;
bool has_rewind() const override { return false; }

Wyświetl plik

@ -1582,7 +1582,7 @@ void sanei_genesys_asic_init(Genesys_Device* dev, bool /*max_regs*/)
dev->already_initialized = true;
// Move to home if needed
dev->cmd_set->slow_back_home(dev, true);
dev->cmd_set->move_back_home(dev, true);
dev->scanhead_position_in_steps = 0;
// Set powersaving (default = 15 minutes)

Wyświetl plik

@ -355,8 +355,8 @@ extern void sanei_genesys_search_reference_point(Genesys_Device* dev, Genesys_Se
// 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_slow_back_home(Genesys_Device& dev, bool wait_until_home);
void scanner_slow_back_home_ta(Genesys_Device& dev);
void scanner_move_back_home(Genesys_Device& dev, bool wait_until_home);
void scanner_move_back_home_ta(Genesys_Device& dev);
void scanner_clear_scan_and_feed_counts(Genesys_Device& dev);