kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Simplify motor setup to make it easier to expand
rodzic
7d6897ecb4
commit
239eab6ea6
|
@ -255,7 +255,8 @@ std::vector<std::reference_wrapper<Genesys_Sensor>>
|
||||||
void
|
void
|
||||||
sanei_genesys_init_structs (Genesys_Device * dev)
|
sanei_genesys_init_structs (Genesys_Device * dev)
|
||||||
{
|
{
|
||||||
unsigned int i, gpo_ok = 0, motor_ok = 0;
|
unsigned int i, gpo_ok = 0;
|
||||||
|
bool motor_ok = false;
|
||||||
bool fe_ok = false;
|
bool fe_ok = false;
|
||||||
|
|
||||||
/* initialize the GPO data stuff */
|
/* initialize the GPO data stuff */
|
||||||
|
@ -268,13 +269,12 @@ sanei_genesys_init_structs (Genesys_Device * dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize the motor data stuff */
|
// initialize the motor data stuff
|
||||||
for (i = 0; i < sizeof (Motor) / sizeof (Genesys_Motor); i++)
|
for (const auto& motor : *s_motors) {
|
||||||
{
|
if (dev->model->motor_type == motor.motor_id) {
|
||||||
if (dev->model->motor_type == Motor[i].motor_id)
|
dev->motor = motor;
|
||||||
{
|
motor_ok = true;
|
||||||
dev->motor = Motor[i];
|
break;
|
||||||
motor_ok = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,8 +286,7 @@ sanei_genesys_init_structs (Genesys_Device * dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sanity check */
|
if (!motor_ok || gpo_ok == 0 || !fe_ok)
|
||||||
if (motor_ok == 0 || gpo_ok == 0 || !fe_ok)
|
|
||||||
{
|
{
|
||||||
DBG(DBG_error0, "%s: bad description(s) for fe/gpo/motor=%d/%d/%d\n", __func__,
|
DBG(DBG_error0, "%s: bad description(s) for fe/gpo/motor=%d/%d/%d\n", __func__,
|
||||||
dev->model->ccd_type, dev->model->gpo_type, dev->model->motor_type);
|
dev->model->ccd_type, dev->model->gpo_type, dev->model->motor_type);
|
||||||
|
@ -5426,6 +5425,7 @@ sane_init_impl(SANE_Int * version_code, SANE_Auth_Callback authorize)
|
||||||
s_sane_devices_ptrs.init();
|
s_sane_devices_ptrs.init();
|
||||||
genesys_init_sensor_tables();
|
genesys_init_sensor_tables();
|
||||||
genesys_init_frontend_tables();
|
genesys_init_frontend_tables();
|
||||||
|
genesys_init_motor_tables();
|
||||||
genesys_init_usb_device_tables();
|
genesys_init_usb_device_tables();
|
||||||
|
|
||||||
|
|
||||||
|
|
Plik diff jest za duży
Load Diff
|
@ -684,6 +684,7 @@ private:
|
||||||
extern StaticInit<std::vector<Genesys_Sensor>> s_sensors;
|
extern StaticInit<std::vector<Genesys_Sensor>> s_sensors;
|
||||||
void genesys_init_sensor_tables();
|
void genesys_init_sensor_tables();
|
||||||
void genesys_init_frontend_tables();
|
void genesys_init_frontend_tables();
|
||||||
|
void genesys_init_motor_tables();
|
||||||
void genesys_init_usb_device_tables();
|
void genesys_init_usb_device_tables();
|
||||||
|
|
||||||
void debug_dump(unsigned level, const Genesys_Settings& settings);
|
void debug_dump(unsigned level, const Genesys_Settings& settings);
|
||||||
|
|
|
@ -71,6 +71,14 @@ struct Genesys_Motor_Slope
|
||||||
i = 0.0 for first entry and i = 1.0 for last entry in default table
|
i = 0.0 for first entry and i = 1.0 for last entry in default table
|
||||||
*/
|
*/
|
||||||
float g = 0;
|
float g = 0;
|
||||||
|
|
||||||
|
/* start speed, max end speed, step number */
|
||||||
|
/* maximum speed (second field) is used to compute exposure as seen by motor */
|
||||||
|
/* exposure=max speed/ slope dpi * base dpi */
|
||||||
|
/* 5144 = max pixels at 600 dpi */
|
||||||
|
/* 1288=(5144+8)*ydpi(=300)/base_dpi(=1200) , where 5152 is exposure */
|
||||||
|
/* 6440=9660/(1932/1288) */
|
||||||
|
// { 9560, 1912, 31, 0.8 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,5 +110,4 @@ struct Genesys_Motor
|
||||||
std::vector<std::vector<Genesys_Motor_Slope>> slopes;
|
std::vector<std::vector<Genesys_Motor_Slope>> slopes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // BACKEND_GENESYS_MOTOR_H
|
#endif // BACKEND_GENESYS_MOTOR_H
|
||||||
|
|
Ładowanie…
Reference in New Issue