kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Return MotorSlopeTable out of sanei_genesys_slope_table()
rodzic
63b0366b43
commit
9cd373fe6c
|
@ -496,9 +496,7 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
|
|||
DBG_HELPER(dbg);
|
||||
int use_fast_fed;
|
||||
unsigned int lincnt, fast_dpi;
|
||||
std::vector<uint16_t> scan_table;
|
||||
std::vector<uint16_t> fast_table;
|
||||
int scan_steps,fast_steps,factor;
|
||||
int factor;
|
||||
unsigned int feedl,dist;
|
||||
uint32_t z1, z2;
|
||||
unsigned yres;
|
||||
|
@ -584,17 +582,12 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
|
|||
reg->set16(REG_SCANFED, 4);
|
||||
|
||||
/* scan and backtracking slope table */
|
||||
sanei_genesys_slope_table(scan_table,
|
||||
&scan_steps,
|
||||
yres,
|
||||
scan_exposure_time,
|
||||
dev->motor.base_ydpi,
|
||||
factor,
|
||||
motor_profile);
|
||||
gl124_send_slope_table(dev, SCAN_TABLE, scan_table, scan_steps);
|
||||
gl124_send_slope_table(dev, BACKTRACK_TABLE, scan_table, scan_steps);
|
||||
auto scan_table = sanei_genesys_slope_table(yres, scan_exposure_time,
|
||||
dev->motor.base_ydpi, factor, motor_profile);
|
||||
gl124_send_slope_table(dev, SCAN_TABLE, scan_table.table, scan_table.scan_steps);
|
||||
gl124_send_slope_table(dev, BACKTRACK_TABLE, scan_table.table, scan_table.scan_steps);
|
||||
|
||||
reg->set16(REG_STEPNO, scan_steps);
|
||||
reg->set16(REG_STEPNO, scan_table.scan_steps);
|
||||
|
||||
/* fast table */
|
||||
fast_dpi=yres;
|
||||
|
@ -605,30 +598,25 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
|
|||
fast_dpi*=3;
|
||||
}
|
||||
*/
|
||||
sanei_genesys_slope_table(fast_table,
|
||||
&fast_steps,
|
||||
fast_dpi,
|
||||
scan_exposure_time,
|
||||
dev->motor.base_ydpi,
|
||||
factor,
|
||||
motor_profile);
|
||||
gl124_send_slope_table(dev, STOP_TABLE, fast_table, fast_steps);
|
||||
gl124_send_slope_table(dev, FAST_TABLE, fast_table, fast_steps);
|
||||
auto fast_table = sanei_genesys_slope_table(fast_dpi, scan_exposure_time, dev->motor.base_ydpi,
|
||||
factor, motor_profile);
|
||||
gl124_send_slope_table(dev, STOP_TABLE, fast_table.table, fast_table.scan_steps);
|
||||
gl124_send_slope_table(dev, FAST_TABLE, fast_table.table, fast_table.scan_steps);
|
||||
|
||||
reg->set16(REG_FASTNO, fast_steps);
|
||||
reg->set16(REG_FSHDEC, fast_steps);
|
||||
reg->set16(REG_FMOVNO, fast_steps);
|
||||
reg->set16(REG_FASTNO, fast_table.scan_steps);
|
||||
reg->set16(REG_FSHDEC, fast_table.scan_steps);
|
||||
reg->set16(REG_FMOVNO, fast_table.scan_steps);
|
||||
|
||||
/* substract acceleration distance from feedl */
|
||||
feedl=feed_steps;
|
||||
feedl <<= static_cast<unsigned>(motor_profile.step_type);
|
||||
|
||||
dist = scan_steps;
|
||||
if (flags & MOTOR_FLAG_FEED)
|
||||
dist *=2;
|
||||
if (use_fast_fed)
|
||||
{
|
||||
dist += fast_steps*2;
|
||||
dist = scan_table.scan_steps;
|
||||
if (flags & MOTOR_FLAG_FEED) {
|
||||
dist *= 2;
|
||||
}
|
||||
if (use_fast_fed) {
|
||||
dist += fast_table.scan_steps * 2;
|
||||
}
|
||||
DBG (DBG_io2, "%s: acceleration distance=%d\n", __func__, dist);
|
||||
|
||||
|
@ -643,12 +631,12 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
|
|||
DBG (DBG_io, "%s: feedl=%d\n", __func__, feedl);
|
||||
|
||||
/* doesn't seem to matter that much */
|
||||
sanei_genesys_calculate_zmod (use_fast_fed,
|
||||
sanei_genesys_calculate_zmod(use_fast_fed,
|
||||
scan_exposure_time,
|
||||
scan_table,
|
||||
scan_steps,
|
||||
scan_table.table,
|
||||
scan_table.scan_steps,
|
||||
feedl,
|
||||
scan_steps,
|
||||
scan_table.scan_steps,
|
||||
&z1,
|
||||
&z2);
|
||||
|
||||
|
@ -663,7 +651,7 @@ static void gl124_init_motor_regs_scan(Genesys_Device* dev,
|
|||
reg->set8(REG_0xA0, (static_cast<unsigned>(motor_profile.step_type) << REG_0xA0S_STEPSEL) |
|
||||
(static_cast<unsigned>(motor_profile.step_type) << REG_0xA0S_FSTPSEL));
|
||||
|
||||
reg->set16(REG_FMOVDEC, fast_steps);
|
||||
reg->set16(REG_FMOVDEC, fast_table.scan_steps);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -832,9 +832,6 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
|
|||
|
||||
int use_fast_fed, coeff;
|
||||
unsigned int lincnt;
|
||||
std::vector<uint16_t> scan_table;
|
||||
std::vector<uint16_t> fast_table;
|
||||
int scan_steps,fast_steps;
|
||||
unsigned int feedl,factor,dist;
|
||||
GenesysRegister *r;
|
||||
uint32_t z1, z2;
|
||||
|
@ -876,23 +873,19 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
|
|||
}
|
||||
|
||||
/* scan and backtracking slope table */
|
||||
sanei_genesys_slope_table(scan_table,
|
||||
&scan_steps,
|
||||
scan_yres,
|
||||
exposure,
|
||||
dev->motor.base_ydpi,
|
||||
factor,
|
||||
motor_profile);
|
||||
gl843_send_slope_table(dev, SCAN_TABLE, scan_table, scan_steps * factor);
|
||||
gl843_send_slope_table(dev, BACKTRACK_TABLE, scan_table, scan_steps * factor);
|
||||
auto scan_table = sanei_genesys_slope_table(scan_yres, exposure, dev->motor.base_ydpi,
|
||||
factor, motor_profile);
|
||||
|
||||
gl843_send_slope_table(dev, SCAN_TABLE, scan_table.table, scan_table.scan_steps * factor);
|
||||
gl843_send_slope_table(dev, BACKTRACK_TABLE, scan_table.table, scan_table.scan_steps * factor);
|
||||
|
||||
/* STEPNO */
|
||||
r = sanei_genesys_get_address(reg, REG_STEPNO);
|
||||
r->value = scan_steps;
|
||||
r->value = scan_table.scan_steps;
|
||||
|
||||
/* FSHDEC */
|
||||
r = sanei_genesys_get_address(reg, REG_FSHDEC);
|
||||
r->value = scan_steps;
|
||||
r->value = scan_table.scan_steps;
|
||||
|
||||
/* fast table */
|
||||
// BUG: looks like for fast moves we use inconsistent step type
|
||||
|
@ -908,33 +901,28 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
|
|||
if (dev->model->model_id == ModelId::CANON_4400F) {
|
||||
fast_yres = scan_yres;
|
||||
}
|
||||
sanei_genesys_slope_table(fast_table,
|
||||
&fast_steps,
|
||||
fast_yres,
|
||||
exposure,
|
||||
dev->motor.base_ydpi,
|
||||
factor,
|
||||
fast_motor_profile);
|
||||
gl843_send_slope_table(dev, STOP_TABLE, fast_table, fast_steps * factor);
|
||||
gl843_send_slope_table(dev, FAST_TABLE, fast_table, fast_steps * factor);
|
||||
gl843_send_slope_table(dev, HOME_TABLE, fast_table, fast_steps * factor);
|
||||
auto fast_table = sanei_genesys_slope_table(fast_yres, exposure, dev->motor.base_ydpi,
|
||||
factor, fast_motor_profile);
|
||||
gl843_send_slope_table(dev, STOP_TABLE, fast_table.table, fast_table.scan_steps * factor);
|
||||
gl843_send_slope_table(dev, FAST_TABLE, fast_table.table, fast_table.scan_steps * factor);
|
||||
gl843_send_slope_table(dev, HOME_TABLE, fast_table.table, fast_table.scan_steps * factor);
|
||||
|
||||
/* FASTNO */
|
||||
r = sanei_genesys_get_address(reg, REG_FASTNO);
|
||||
r->value = fast_steps;
|
||||
r->value = fast_table.scan_steps;
|
||||
|
||||
/* FMOVNO */
|
||||
r = sanei_genesys_get_address(reg, REG_FMOVNO);
|
||||
r->value = fast_steps;
|
||||
r->value = fast_table.scan_steps;
|
||||
|
||||
/* substract acceleration distance from feedl */
|
||||
feedl=feed_steps;
|
||||
feedl <<= static_cast<unsigned>(motor_profile.step_type);
|
||||
|
||||
dist = scan_steps;
|
||||
dist = scan_table.scan_steps;
|
||||
if (use_fast_fed)
|
||||
{
|
||||
dist += fast_steps*2;
|
||||
dist += fast_table.scan_steps*2;
|
||||
}
|
||||
DBG(DBG_io2, "%s: acceleration distance=%d\n", __func__, dist);
|
||||
|
||||
|
@ -950,12 +938,12 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
|
|||
DBG(DBG_io, "%s: feedl=%d\n", __func__, feedl);
|
||||
|
||||
/* doesn't seem to matter that much */
|
||||
sanei_genesys_calculate_zmod (use_fast_fed,
|
||||
sanei_genesys_calculate_zmod(use_fast_fed,
|
||||
exposure,
|
||||
scan_table,
|
||||
scan_steps,
|
||||
scan_table.table,
|
||||
scan_table.scan_steps,
|
||||
feedl,
|
||||
scan_steps,
|
||||
scan_table.scan_steps,
|
||||
&z1,
|
||||
&z2);
|
||||
if(scan_yres>600)
|
||||
|
@ -979,7 +967,7 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
|
|||
|
||||
/* steps for STOP table */
|
||||
r = sanei_genesys_get_address(reg, REG_FMOVDEC);
|
||||
r->value = fast_steps;
|
||||
r->value = fast_table.scan_steps;
|
||||
|
||||
/* Vref XXX STEF XXX : optical divider or step type ? */
|
||||
r = sanei_genesys_get_address (reg, 0x80);
|
||||
|
|
|
@ -385,9 +385,7 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
|
|||
scan_lines, scan_dummy, feed_steps, flags);
|
||||
int use_fast_fed;
|
||||
unsigned int fast_dpi;
|
||||
std::vector<uint16_t> scan_table;
|
||||
std::vector<uint16_t> fast_table;
|
||||
int scan_steps, fast_steps, factor;
|
||||
int factor;
|
||||
unsigned int feedl, dist;
|
||||
GenesysRegister *r;
|
||||
uint32_t z1, z2;
|
||||
|
@ -430,15 +428,10 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
|
|||
}
|
||||
|
||||
/* scan and backtracking slope table */
|
||||
sanei_genesys_slope_table(scan_table,
|
||||
&scan_steps,
|
||||
scan_yres,
|
||||
scan_exposure_time,
|
||||
dev->motor.base_ydpi,
|
||||
factor,
|
||||
motor_profile);
|
||||
gl846_send_slope_table(dev, SCAN_TABLE, scan_table, scan_steps * factor);
|
||||
gl846_send_slope_table(dev, BACKTRACK_TABLE, scan_table, scan_steps * factor);
|
||||
auto scan_table = sanei_genesys_slope_table(scan_yres, scan_exposure_time, dev->motor.base_ydpi,
|
||||
factor, motor_profile);
|
||||
gl846_send_slope_table(dev, SCAN_TABLE, scan_table.table, scan_table.scan_steps * factor);
|
||||
gl846_send_slope_table(dev, BACKTRACK_TABLE, scan_table.table, scan_table.scan_steps * factor);
|
||||
|
||||
/* fast table */
|
||||
fast_dpi=sanei_genesys_get_lowest_ydpi(dev);
|
||||
|
@ -452,27 +445,22 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
|
|||
Motor_Profile fast_motor_profile = motor_profile;
|
||||
fast_motor_profile.step_type = fast_step_type;
|
||||
|
||||
sanei_genesys_slope_table(fast_table,
|
||||
&fast_steps,
|
||||
fast_dpi,
|
||||
scan_exposure_time,
|
||||
dev->motor.base_ydpi,
|
||||
factor,
|
||||
fast_motor_profile);
|
||||
auto fast_table = sanei_genesys_slope_table(fast_dpi, scan_exposure_time, dev->motor.base_ydpi,
|
||||
factor, fast_motor_profile);
|
||||
|
||||
/* manual override of high start value */
|
||||
fast_table[0]=fast_table[1];
|
||||
// manual override of high start value
|
||||
fast_table.table[0] = fast_table.table[1];
|
||||
|
||||
gl846_send_slope_table(dev, STOP_TABLE, fast_table, fast_steps * factor);
|
||||
gl846_send_slope_table(dev, FAST_TABLE, fast_table, fast_steps * factor);
|
||||
gl846_send_slope_table(dev, HOME_TABLE, fast_table, fast_steps * factor);
|
||||
gl846_send_slope_table(dev, STOP_TABLE, fast_table.table, fast_table.scan_steps * factor);
|
||||
gl846_send_slope_table(dev, FAST_TABLE, fast_table.table, fast_table.scan_steps * factor);
|
||||
gl846_send_slope_table(dev, HOME_TABLE, fast_table.table, fast_table.scan_steps * factor);
|
||||
|
||||
/* correct move distance by acceleration and deceleration amounts */
|
||||
feedl=feed_steps;
|
||||
if (use_fast_fed)
|
||||
{
|
||||
feedl <<= static_cast<unsigned>(fast_step_type);
|
||||
dist=(scan_steps+2*fast_steps)*factor;
|
||||
dist = (scan_table.scan_steps + 2 * fast_table.scan_steps) * factor;
|
||||
/* TODO read and decode REG_0xAB */
|
||||
r = sanei_genesys_get_address (reg, 0x5e);
|
||||
dist += (r->value & 31);
|
||||
|
@ -483,11 +471,11 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
|
|||
else
|
||||
{
|
||||
feedl <<= static_cast<unsigned>(motor_profile.step_type);
|
||||
dist=scan_steps*factor;
|
||||
dist=scan_table.scan_steps*factor;
|
||||
if (flags & MOTOR_FLAG_FEED)
|
||||
dist *=2;
|
||||
}
|
||||
DBG (DBG_io2, "%s: scan steps=%d\n", __func__, scan_steps);
|
||||
DBG (DBG_io2, "%s: scan steps=%d\n", __func__, scan_table.scan_steps);
|
||||
DBG (DBG_io2, "%s: acceleration distance=%d\n", __func__, dist);
|
||||
|
||||
/* check for overflow */
|
||||
|
@ -549,7 +537,7 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
|
|||
dev->interface->write_register(REG_0x7E, val);
|
||||
}
|
||||
|
||||
min_restep=scan_steps/2-1;
|
||||
min_restep = scan_table.scan_steps / 2 - 1;
|
||||
if (min_restep < 1) {
|
||||
min_restep = 1;
|
||||
}
|
||||
|
@ -558,10 +546,10 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
|
|||
r = sanei_genesys_get_address(reg, REG_BWDSTEP);
|
||||
r->value = min_restep;
|
||||
|
||||
sanei_genesys_calculate_zmod(use_fast_fed,
|
||||
sanei_genesys_calculate_zmod(use_fast_fed,
|
||||
scan_exposure_time*ccdlmt*tgtime,
|
||||
scan_table,
|
||||
scan_steps*factor,
|
||||
scan_table.table,
|
||||
scan_table.scan_steps*factor,
|
||||
feedl,
|
||||
min_restep*factor,
|
||||
&z1,
|
||||
|
@ -584,19 +572,19 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
|
|||
r->value = 0x7f;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_STEPNO);
|
||||
r->value = scan_steps;
|
||||
r->value = scan_table.scan_steps;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_FASTNO);
|
||||
r->value = scan_steps;
|
||||
r->value = scan_table.scan_steps;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_FSHDEC);
|
||||
r->value = scan_steps;
|
||||
r->value = scan_table.scan_steps;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_FMOVNO);
|
||||
r->value = fast_steps;
|
||||
r->value = fast_table.scan_steps;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_FMOVDEC);
|
||||
r->value = fast_steps;
|
||||
r->value = fast_table.scan_steps;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -419,9 +419,7 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
|
|||
scan_lines, scan_dummy, feed_steps, flags);
|
||||
int use_fast_fed;
|
||||
unsigned int fast_dpi;
|
||||
std::vector<uint16_t> scan_table;
|
||||
std::vector<uint16_t> fast_table;
|
||||
int scan_steps, fast_steps, factor;
|
||||
int factor;
|
||||
unsigned int feedl, dist;
|
||||
GenesysRegister *r;
|
||||
uint32_t z1, z2;
|
||||
|
@ -464,15 +462,10 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
|
|||
}
|
||||
|
||||
/* scan and backtracking slope table */
|
||||
sanei_genesys_slope_table(scan_table,
|
||||
&scan_steps,
|
||||
scan_yres,
|
||||
scan_exposure_time,
|
||||
dev->motor.base_ydpi,
|
||||
factor,
|
||||
motor_profile);
|
||||
gl847_send_slope_table(dev, SCAN_TABLE, scan_table, scan_steps * factor);
|
||||
gl847_send_slope_table(dev, BACKTRACK_TABLE, scan_table, scan_steps * factor);
|
||||
auto scan_table = sanei_genesys_slope_table(scan_yres, scan_exposure_time, dev->motor.base_ydpi,
|
||||
factor, motor_profile);
|
||||
gl847_send_slope_table(dev, SCAN_TABLE, scan_table.table, scan_table.scan_steps * factor);
|
||||
gl847_send_slope_table(dev, BACKTRACK_TABLE, scan_table.table, scan_table.scan_steps * factor);
|
||||
|
||||
/* fast table */
|
||||
fast_dpi=sanei_genesys_get_lowest_ydpi(dev);
|
||||
|
@ -484,27 +477,22 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
|
|||
Motor_Profile fast_motor_profile = motor_profile;
|
||||
fast_motor_profile.step_type = fast_step_type;
|
||||
|
||||
sanei_genesys_slope_table(fast_table,
|
||||
&fast_steps,
|
||||
fast_dpi,
|
||||
scan_exposure_time,
|
||||
dev->motor.base_ydpi,
|
||||
factor,
|
||||
fast_motor_profile);
|
||||
auto fast_table = sanei_genesys_slope_table(fast_dpi, scan_exposure_time, dev->motor.base_ydpi,
|
||||
factor, fast_motor_profile);
|
||||
|
||||
/* manual override of high start value */
|
||||
fast_table[0]=fast_table[1];
|
||||
// manual override of high start value
|
||||
fast_table.table[0] = fast_table.table[1];
|
||||
|
||||
gl847_send_slope_table(dev, STOP_TABLE, fast_table, fast_steps * factor);
|
||||
gl847_send_slope_table(dev, FAST_TABLE, fast_table, fast_steps * factor);
|
||||
gl847_send_slope_table(dev, HOME_TABLE, fast_table, fast_steps * factor);
|
||||
gl847_send_slope_table(dev, STOP_TABLE, fast_table.table, fast_table.scan_steps * factor);
|
||||
gl847_send_slope_table(dev, FAST_TABLE, fast_table.table, fast_table.scan_steps * factor);
|
||||
gl847_send_slope_table(dev, HOME_TABLE, fast_table.table, fast_table.scan_steps * factor);
|
||||
|
||||
/* correct move distance by acceleration and deceleration amounts */
|
||||
feedl=feed_steps;
|
||||
if (use_fast_fed)
|
||||
{
|
||||
feedl <<= static_cast<unsigned>(fast_step_type);
|
||||
dist=(scan_steps+2*fast_steps)*factor;
|
||||
dist = (scan_table.scan_steps + 2 * fast_table.scan_steps) * factor;
|
||||
/* TODO read and decode REG_0xAB */
|
||||
r = sanei_genesys_get_address (reg, 0x5e);
|
||||
dist += (r->value & 31);
|
||||
|
@ -515,11 +503,11 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
|
|||
else
|
||||
{
|
||||
feedl <<= static_cast<unsigned>(motor_profile.step_type);
|
||||
dist=scan_steps*factor;
|
||||
dist=scan_table.scan_steps*factor;
|
||||
if (flags & MOTOR_FLAG_FEED)
|
||||
dist *=2;
|
||||
}
|
||||
DBG(DBG_io2, "%s: scan steps=%d\n", __func__, scan_steps);
|
||||
DBG(DBG_io2, "%s: scan steps=%d\n", __func__, scan_table.scan_steps);
|
||||
DBG(DBG_io2, "%s: acceleration distance=%d\n", __func__, dist);
|
||||
|
||||
/* check for overflow */
|
||||
|
@ -557,7 +545,7 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
|
|||
val = effective | REG_0x6C_GPIO10;
|
||||
dev->interface->write_register(REG_0x6C, val);
|
||||
|
||||
min_restep=scan_steps/2-1;
|
||||
min_restep = scan_table.scan_steps / 2 - 1;
|
||||
if (min_restep < 1) {
|
||||
min_restep = 1;
|
||||
}
|
||||
|
@ -566,10 +554,10 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
|
|||
r = sanei_genesys_get_address(reg, REG_BWDSTEP);
|
||||
r->value = min_restep;
|
||||
|
||||
sanei_genesys_calculate_zmod(use_fast_fed,
|
||||
sanei_genesys_calculate_zmod(use_fast_fed,
|
||||
scan_exposure_time*ccdlmt*tgtime,
|
||||
scan_table,
|
||||
scan_steps*factor,
|
||||
scan_table.table,
|
||||
scan_table.scan_steps*factor,
|
||||
feedl,
|
||||
min_restep*factor,
|
||||
&z1,
|
||||
|
@ -592,19 +580,19 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
|
|||
r->value = REG_0x68_FASTPWM;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_STEPNO);
|
||||
r->value = scan_steps;
|
||||
r->value = scan_table.scan_steps;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_FASTNO);
|
||||
r->value = scan_steps;
|
||||
r->value = scan_table.scan_steps;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_FSHDEC);
|
||||
r->value = scan_steps;
|
||||
r->value = scan_table.scan_steps;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_FMOVNO);
|
||||
r->value = fast_steps;
|
||||
r->value = fast_table.scan_steps;
|
||||
|
||||
r = sanei_genesys_get_address(reg, REG_FMOVDEC);
|
||||
r->value = fast_steps;
|
||||
r->value = fast_table.scan_steps;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1695,22 +1695,22 @@ const Motor_Profile& sanei_genesys_get_motor_profile(const std::vector<Motor_Pro
|
|||
* @param factor shrink factor for the slope
|
||||
* @param motor_profile motor profile
|
||||
*/
|
||||
int sanei_genesys_slope_table(std::vector<uint16_t>& slope,
|
||||
int* steps, int dpi, int exposure, int base_dpi,
|
||||
int factor, const Motor_Profile& motor_profile)
|
||||
MotorSlopeTable sanei_genesys_slope_table(int dpi, int exposure, int base_dpi,
|
||||
int factor, const Motor_Profile& motor_profile)
|
||||
{
|
||||
MotorSlopeTable table;
|
||||
int sum, i;
|
||||
uint16_t target,current;
|
||||
|
||||
unsigned step_shift = static_cast<unsigned>(motor_profile.step_type);
|
||||
slope.clear();
|
||||
table.table.clear();
|
||||
|
||||
/* required speed */
|
||||
target = ((exposure * dpi) / base_dpi) >> step_shift;
|
||||
DBG (DBG_io2, "%s: exposure=%d, dpi=%d, target=%d\n", __func__, exposure, dpi, target);
|
||||
|
||||
/* fill result with target speed */
|
||||
slope.resize(SLOPE_TABLE_SIZE, target);
|
||||
table.table.resize(SLOPE_TABLE_SIZE, target);
|
||||
|
||||
/* use profile to build table */
|
||||
i=0;
|
||||
|
@ -1721,8 +1721,8 @@ uint16_t target,current;
|
|||
|
||||
// loop on profile copying and apply step type
|
||||
while (motor_profile.table[i] != 0 && current >= target) {
|
||||
slope[i]=current;
|
||||
sum+=slope[i];
|
||||
table.table[i]=current;
|
||||
sum += table.table[i];
|
||||
i++;
|
||||
current = motor_profile.table[i] >> step_shift;
|
||||
}
|
||||
|
@ -1730,8 +1730,8 @@ uint16_t target,current;
|
|||
/* ensure last step is required speed in case profile doesn't contain it */
|
||||
if(current!=0 && current<target)
|
||||
{
|
||||
slope[i]=target;
|
||||
sum+=slope[i];
|
||||
table.table[i] = target;
|
||||
sum += table.table[i];
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -1747,22 +1747,23 @@ uint16_t target,current;
|
|||
/* align on factor */
|
||||
while(i%factor!=0)
|
||||
{
|
||||
slope[i+1]=slope[i];
|
||||
sum+=slope[i];
|
||||
table.table[i+1] = table.table[i];
|
||||
sum += table.table[i];
|
||||
i++;
|
||||
}
|
||||
|
||||
/* ensure minimal slope size */
|
||||
while(i<2*factor)
|
||||
{
|
||||
slope[i+1]=slope[i];
|
||||
sum+=slope[i];
|
||||
table.table[i+1] = table.table[i];
|
||||
sum += table.table[i];
|
||||
i++;
|
||||
}
|
||||
|
||||
// return used steps and taken time
|
||||
*steps=i/factor;
|
||||
return sum;
|
||||
// return used steps and taken time
|
||||
table.scan_steps = i / factor;
|
||||
table.pixeltime_sum = sum;
|
||||
return table;
|
||||
}
|
||||
|
||||
/** @brief returns the lowest possible ydpi for the device
|
||||
|
|
|
@ -425,8 +425,8 @@ extern void sanei_genesys_asic_init(Genesys_Device* dev, bool cold);
|
|||
const Motor_Profile& sanei_genesys_get_motor_profile(const std::vector<Motor_Profile>& motors,
|
||||
MotorId motor_id, int exposure);
|
||||
|
||||
int sanei_genesys_slope_table(std::vector<uint16_t>& slope, int *steps, int dpi, int exposure,
|
||||
int base_dpi, int factor, const Motor_Profile& motor_profile);
|
||||
MotorSlopeTable sanei_genesys_slope_table(int dpi, int exposure, int base_dpi,
|
||||
int factor, const Motor_Profile& motor_profile);
|
||||
|
||||
/** @brief find lowest motor resolution for the device.
|
||||
* Parses the resolution list for motor and
|
||||
|
|
Ładowanie…
Reference in New Issue