diff --git a/backend/genesys/genesys.cpp b/backend/genesys/genesys.cpp index dcf566b95..a41577304 100644 --- a/backend/genesys/genesys.cpp +++ b/backend/genesys/genesys.cpp @@ -320,8 +320,7 @@ void sanei_genesys_init_structs (Genesys_Device * dev) /** * This function generates a slope table using the slope from the motor struct * truncated at the given exposure time or step count, whichever comes first. - * The reached step time is then stored in final_exposure and used for the rest - * of the table. The summed time of the acceleration steps is returned, and the + * The summed time of the acceleration steps is returned, and the * number of accerelation steps is put into used_steps. * * @param dev Device struct @@ -331,7 +330,6 @@ void sanei_genesys_init_structs (Genesys_Device * dev) * @param exposure_time Minimum exposure time of a scan line * @param yres Resolution of a scan line * @param used_steps Final number of steps is stored here - * @param final_exposure Final step time is stored here * @return Motor slope table * @note all times in pixel time */ @@ -341,11 +339,8 @@ MotorSlopeTable sanei_genesys_create_slope_table3(AsicType asic_type, const Gene { unsigned target_speed_w = (exposure_time * yres) / motor.base_ydpi; - auto table = create_slope_table(motor.get_slope(step_type), target_speed_w, step_type, 1, 1, - get_slope_table_max_size(asic_type)); - - table.final_exposure = (table.final_exposure * motor.base_ydpi) / yres; - return table; + return create_slope_table(motor.get_slope(step_type), target_speed_w, step_type, 1, 1, + get_slope_table_max_size(asic_type)); } /** @brief computes gamma table diff --git a/backend/genesys/low.cpp b/backend/genesys/low.cpp index 0582e8d71..aaff7fb57 100644 --- a/backend/genesys/low.cpp +++ b/backend/genesys/low.cpp @@ -1768,20 +1768,16 @@ MotorSlopeTable sanei_genesys_slope_table(AsicType asic_type, int dpi, int expos auto table = create_slope_table(motor_profile.slope, target_speed_w, motor_profile.step_type, step_multiplier, 2 * step_multiplier, get_slope_table_max_size(asic_type)); - table.final_exposure = (table.final_exposure * base_dpi) / dpi; return table; } -MotorSlopeTable create_slope_table_fastest(AsicType asic_type, int dpi, int base_dpi, - unsigned step_multiplier, +MotorSlopeTable create_slope_table_fastest(AsicType asic_type, unsigned step_multiplier, const Motor_Profile& motor_profile) { - auto table = create_slope_table(motor_profile.slope, motor_profile.slope.max_speed_w, - motor_profile.step_type, - step_multiplier, 2 * step_multiplier, - get_slope_table_max_size(asic_type)); - table.final_exposure = (table.final_exposure * base_dpi) / dpi; - return table; + return create_slope_table(motor_profile.slope, motor_profile.slope.max_speed_w, + motor_profile.step_type, + step_multiplier, 2 * step_multiplier, + get_slope_table_max_size(asic_type)); } /** @brief returns the lowest possible ydpi for the device diff --git a/backend/genesys/low.h b/backend/genesys/low.h index 3de358bf0..d7f5dd2d7 100644 --- a/backend/genesys/low.h +++ b/backend/genesys/low.h @@ -411,8 +411,7 @@ MotorSlopeTable sanei_genesys_slope_table(AsicType asic_type, int dpi, int expos unsigned step_multiplier, const Motor_Profile& motor_profile); -MotorSlopeTable create_slope_table_fastest(AsicType asic_type, int dpi, int base_dpi, - unsigned step_multiplier, +MotorSlopeTable create_slope_table_fastest(AsicType asic_type, unsigned step_multiplier, const Motor_Profile& motor_profile); /** @brief find lowest motor resolution for the device. diff --git a/backend/genesys/motor.cpp b/backend/genesys/motor.cpp index 12fc5f056..910266aa7 100644 --- a/backend/genesys/motor.cpp +++ b/backend/genesys/motor.cpp @@ -85,11 +85,7 @@ void MotorSlopeTable::slice_steps(unsigned count) if (count >= table.size() || count > steps_count) { throw SaneException("Excepssive steps count"); } - unsigned old_step = table[steps_count - 1]; - unsigned new_step = table[count - 1]; steps_count = count; - - final_exposure = final_exposure * (static_cast(new_step) / old_step); } unsigned get_slope_table_max_size(AsicType asic_type) @@ -155,8 +151,6 @@ MotorSlopeTable create_slope_table(const MotorSlope& slope, unsigned target_spee // fill the rest of the table with the final speed table.table.resize(max_size, final_speed); - table.final_exposure = final_speed; - return table; } diff --git a/backend/genesys/motor.h b/backend/genesys/motor.h index 4f7789dc6..d80da6dce 100644 --- a/backend/genesys/motor.h +++ b/backend/genesys/motor.h @@ -126,9 +126,6 @@ struct MotorSlopeTable unsigned steps_count = 0; unsigned pixeltime_sum = 0; - // table.back() adjusted to the scan dpi - unsigned final_exposure = 0; - void slice_steps(unsigned count); }; diff --git a/testsuite/backend/genesys/tests_motor.cpp b/testsuite/backend/genesys/tests_motor.cpp index e8a2a4b9e..07ca693a9 100644 --- a/testsuite/backend/genesys/tests_motor.cpp +++ b/testsuite/backend/genesys/tests_motor.cpp @@ -49,7 +49,6 @@ void test_create_slope_table3() ASSERT_EQ(table.pixeltime_sum, 10000u); ASSERT_EQ(table.steps_count, 1u); - ASSERT_EQ(table.final_exposure, 10000u); std::vector expected_steps = { 10000, @@ -63,7 +62,6 @@ void test_create_slope_table3() ASSERT_EQ(table.pixeltime_sum, 33830u); ASSERT_EQ(table.steps_count, 7u); - ASSERT_EQ(table.final_exposure, 2000u); expected_steps = { 10000, 10000, 4099, 3028, 2511, 2192, 2000 @@ -77,7 +75,6 @@ void test_create_slope_table3() ASSERT_EQ(table.pixeltime_sum, 5000u); ASSERT_EQ(table.steps_count, 1u); - ASSERT_EQ(table.final_exposure, 5000u); expected_steps = { 5000, @@ -92,7 +89,6 @@ void test_create_slope_table3() ASSERT_EQ(table.pixeltime_sum, 16914u); ASSERT_EQ(table.steps_count, 7u); - ASSERT_EQ(table.final_exposure, 1000u); expected_steps = { 5000, 5000, 2049, 1514, 1255, 1096, 1000 @@ -106,7 +102,6 @@ void test_create_slope_table3() ASSERT_EQ(table.pixeltime_sum, 2500u); ASSERT_EQ(table.steps_count, 1u); - ASSERT_EQ(table.final_exposure, 2500u); expected_steps = { 2500, @@ -121,7 +116,6 @@ void test_create_slope_table3() ASSERT_EQ(table.pixeltime_sum, 7680u); ASSERT_EQ(table.steps_count, 6u); - ASSERT_EQ(table.final_exposure, 500u); expected_steps = { 2500, 2500, 932, 683, 565, 500