Merge branch 'genesys-improve-motor-support' into 'master'

genesys: Improve motor support

See merge request sane-project/backends!318
merge-requests/340/head
Povilas Kanapickas 2020-01-31 22:58:52 +00:00
commit 6f9a3cfa2c
18 zmienionych plików z 326 dodań i 544 usunięć

Wyświetl plik

@ -535,7 +535,6 @@ libgenesys_la_SOURCES = genesys/genesys.cpp genesys/genesys.h \
genesys/tables_gpo.cpp \
genesys/tables_model.cpp \
genesys/tables_motor.cpp \
genesys/tables_motor_profile.cpp \
genesys/tables_sensor.cpp \
genesys/test_scanner_interface.h genesys/test_scanner_interface.cpp \
genesys/test_settings.h genesys/test_settings.cpp \

Wyświetl plik

@ -89,11 +89,11 @@ struct RawPixel;
// low.h
struct Genesys_USB_Device_Entry;
struct Motor_Profile;
// motor.h
struct Genesys_Motor;
struct MotorSlope;
struct MotorProfile;
struct MotorSlopeTable;
// register.h
@ -113,6 +113,7 @@ class ScannerInterfaceUsb;
class TestScannerInterface;
// sensor.h
class ScanMethodFilter;
class ResolutionFilter;
struct GenesysFrontendLayout;
struct Genesys_Frontend;

Wyświetl plik

@ -339,8 +339,8 @@ MotorSlopeTable sanei_genesys_create_slope_table3(AsicType asic_type, const Gene
{
unsigned target_speed_w = (exposure_time * yres) / motor.base_ydpi;
return create_slope_table(motor.get_slope(step_type), target_speed_w, step_type, 1, 1,
get_slope_table_max_size(asic_type));
return create_slope_table(motor.get_slope_with_step_type(step_type), target_speed_w,
step_type, 1, 1, get_slope_table_max_size(asic_type));
}
/** @brief computes gamma table
@ -415,7 +415,7 @@ SANE_Int sanei_genesys_exposure_time2(Genesys_Device * dev, float ydpi,
StepType step_type, int endpixel, int exposure_by_led)
{
int exposure_by_ccd = endpixel + 32;
unsigned max_speed_motor_w = dev->motor.get_slope(step_type).max_speed_w;
unsigned max_speed_motor_w = dev->motor.get_slope_with_step_type(step_type).max_speed_w;
int exposure_by_motor = static_cast<int>((max_speed_motor_w * dev->motor.base_ydpi) / ydpi);
int exposure = exposure_by_ccd;
@ -4865,7 +4865,6 @@ void sane_init_impl(SANE_Int * version_code, SANE_Auth_Callback authorize)
genesys_init_frontend_tables();
genesys_init_gpo_tables();
genesys_init_motor_tables();
genesys_init_motor_profile_tables();
genesys_init_usb_device_tables();

Wyświetl plik

@ -466,7 +466,7 @@ void CommandSetGl124::set_fe(Genesys_Device* dev, const Genesys_Sensor& sensor,
static void gl124_init_motor_regs_scan(Genesys_Device* dev,
const Genesys_Sensor& sensor,
Genesys_Register_Set* reg,
const Motor_Profile& motor_profile,
const MotorProfile& motor_profile,
unsigned int scan_exposure_time,
unsigned scan_yres,
unsigned int scan_lines,
@ -856,9 +856,7 @@ void CommandSetGl124::init_regs_for_scan_session(Genesys_Device* dev, const Gene
} else {
exposure_time = sensor.exposure_lperiod;
}
const auto& motor_profile = sanei_genesys_get_motor_profile(*gl124_motor_profiles,
dev->model->motor_id,
exposure_time);
const auto& motor_profile = get_motor_profile(dev->motor.profiles, exposure_time, session);
DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time);
DBG(DBG_info, "%s : scan_step_type=%d\n", __func__, static_cast<unsigned>(motor_profile.step_type));

Wyświetl plik

@ -860,7 +860,7 @@ static void gl841_init_motor_regs(Genesys_Device* dev, const Genesys_Sensor& sen
if (action == MOTOR_ACTION_HOME_FREE) {
/* HOME_FREE must be able to stop in one step, so do not try to get faster */
fast_exposure = dev->motor.get_slope(StepType::FULL).max_speed_w;
fast_exposure = dev->motor.get_slope_with_step_type(StepType::FULL).max_speed_w;
}
auto fast_table = sanei_genesys_create_slope_table3(dev->model->asic_type, dev->motor,

Wyświetl plik

@ -800,8 +800,9 @@ void CommandSetGl843::set_fe(Genesys_Device* dev, const Genesys_Sensor& sensor,
static void gl843_init_motor_regs_scan(Genesys_Device* dev,
const Genesys_Sensor& sensor,
const ScanSession& session,
Genesys_Register_Set* reg,
const Motor_Profile& motor_profile,
const MotorProfile& motor_profile,
unsigned int exposure,
unsigned scan_yres,
unsigned int scan_lines,
@ -863,7 +864,9 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
r->value &= ~REG_0x02_MTRREV;
}
/* scan and backtracking slope table */
// scan and backtracking slope table
auto scan_table = sanei_genesys_slope_table(dev->model->asic_type, scan_yres, exposure,
dev->motor.base_ydpi, step_multiplier,
motor_profile);
@ -875,10 +878,16 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
reg->set8(REG_FASTNO, scan_table.steps_count / step_multiplier);
// fast table
const auto* fast_profile = get_motor_profile_ptr(dev->motor.fast_profiles, 0, session);
if (fast_profile == nullptr) {
fast_profile = &motor_profile;
}
unsigned fast_yres = sanei_genesys_get_lowest_ydpi(dev);
auto fast_table = sanei_genesys_slope_table(dev->model->asic_type, fast_yres, exposure,
dev->motor.base_ydpi, step_multiplier,
motor_profile);
*fast_profile);
gl843_send_slope_table(dev, STOP_TABLE, fast_table.table, fast_table.steps_count);
gl843_send_slope_table(dev, FAST_TABLE, fast_table.table, fast_table.steps_count);
gl843_send_slope_table(dev, HOME_TABLE, fast_table.table, fast_table.steps_count);
@ -886,6 +895,15 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
reg->set8(REG_FSHDEC, fast_table.steps_count / step_multiplier);
reg->set8(REG_FMOVNO, fast_table.steps_count / step_multiplier);
if (motor_profile.motor_vref != -1 && fast_profile->motor_vref != 1) {
std::uint8_t vref = 0;
vref |= (motor_profile.motor_vref << REG_0x80S_TABLE1_NORMAL) & REG_0x80_TABLE1_NORMAL;
vref |= (motor_profile.motor_vref << REG_0x80S_TABLE2_BACK) & REG_0x80_TABLE2_BACK;
vref |= (fast_profile->motor_vref << REG_0x80S_TABLE4_FAST) & REG_0x80_TABLE4_FAST;
vref |= (fast_profile->motor_vref << REG_0x80S_TABLE5_GO_HOME) & REG_0x80_TABLE5_GO_HOME;
reg->set8(REG_0x80, vref);
}
/* substract acceleration distance from feedl */
feedl=feed_steps;
feedl <<= static_cast<unsigned>(motor_profile.step_type);
@ -1170,9 +1188,7 @@ void CommandSetGl843::init_regs_for_scan_session(Genesys_Device* dev, const Gene
if (exposure < 0) {
throw std::runtime_error("Exposure not defined in sensor definition");
}
const auto& motor_profile = sanei_genesys_get_motor_profile(*gl843_motor_profiles,
dev->model->motor_id,
exposure);
const auto& motor_profile = get_motor_profile(dev->motor.profiles, exposure, session);
DBG(DBG_info, "%s : exposure=%d pixels\n", __func__, exposure);
DBG(DBG_info, "%s : scan_step_type=%d\n", __func__,
@ -1196,7 +1212,7 @@ void CommandSetGl843::init_regs_for_scan_session(Genesys_Device* dev, const Gene
mflags |= MotorFlag::REVERSE;
}
gl843_init_motor_regs_scan(dev, sensor, reg, motor_profile, exposure, slope_dpi,
gl843_init_motor_regs_scan(dev, sensor, session, reg, motor_profile, exposure, slope_dpi,
session.optical_line_count, dummy, session.params.starty, mflags);
dev->read_buffer.clear();

Wyświetl plik

@ -338,6 +338,16 @@ static constexpr RegAddr REG_CK4MAP = 0x7a;
static constexpr RegAddr REG_0x7E = 0x7e;
static constexpr RegAddr REG_0x80 = 0x80;
static constexpr RegMask REG_0x80_TABLE1_NORMAL = 0x03;
static constexpr RegShift REG_0x80S_TABLE1_NORMAL = 0;
static constexpr RegMask REG_0x80_TABLE2_BACK = 0x0c;
static constexpr RegShift REG_0x80S_TABLE2_BACK = 2;
static constexpr RegMask REG_0x80_TABLE4_FAST = 0x30;
static constexpr RegShift REG_0x80S_TABLE4_FAST = 4;
static constexpr RegMask REG_0x80_TABLE5_GO_HOME = 0xc0;
static constexpr RegShift REG_0x80S_TABLE5_GO_HOME = 6;
static constexpr RegAddr REG_0x9D = 0x9d;
static constexpr RegShift REG_0x9DS_STEPTIM = 2;

Wyświetl plik

@ -327,7 +327,7 @@ void CommandSetGl846::set_fe(Genesys_Device* dev, const Genesys_Sensor& sensor,
static void gl846_init_motor_regs_scan(Genesys_Device* dev,
const Genesys_Sensor& sensor,
Genesys_Register_Set* reg,
const Motor_Profile& motor_profile,
const MotorProfile& motor_profile,
unsigned int scan_exposure_time,
unsigned scan_yres,
unsigned int scan_lines,
@ -400,7 +400,7 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
fast_step_type = StepType::QUARTER;
}
Motor_Profile fast_motor_profile = motor_profile;
MotorProfile fast_motor_profile = motor_profile;
fast_motor_profile.step_type = fast_step_type;
auto fast_table = sanei_genesys_slope_table(dev->model->asic_type, fast_dpi,
@ -705,9 +705,7 @@ void CommandSetGl846::init_regs_for_scan_session(Genesys_Device* dev, const Gene
slope_dpi = slope_dpi * (1 + dummy);
exposure_time = sensor.exposure_lperiod;
const auto& motor_profile = sanei_genesys_get_motor_profile(*gl846_motor_profiles,
dev->model->motor_id,
exposure_time);
const auto& motor_profile = get_motor_profile(dev->motor.profiles, exposure_time, session);
DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time);
DBG(DBG_info, "%s : scan_step_type=%d\n", __func__,

Wyświetl plik

@ -354,7 +354,7 @@ void CommandSetGl847::set_fe(Genesys_Device* dev, const Genesys_Sensor& sensor,
static void gl847_init_motor_regs_scan(Genesys_Device* dev,
const Genesys_Sensor& sensor,
Genesys_Register_Set* reg,
const Motor_Profile& motor_profile,
const MotorProfile& motor_profile,
unsigned int scan_exposure_time,
unsigned scan_yres,
unsigned int scan_lines,
@ -429,7 +429,7 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
fast_step_type = StepType::QUARTER;
}
Motor_Profile fast_motor_profile = motor_profile;
MotorProfile fast_motor_profile = motor_profile;
fast_motor_profile.step_type = fast_step_type;
auto fast_table = sanei_genesys_slope_table(dev->model->asic_type, fast_dpi,
@ -712,9 +712,7 @@ void CommandSetGl847::init_regs_for_scan_session(Genesys_Device* dev, const Gene
slope_dpi = slope_dpi * (1 + dummy);
exposure_time = sensor.exposure_lperiod;
const auto& motor_profile = sanei_genesys_get_motor_profile(*gl847_motor_profiles,
dev->model->motor_id,
exposure_time);
const auto& motor_profile = get_motor_profile(dev->motor.profiles, exposure_time, session);
DBG(DBG_info, "%s : exposure_time=%d pixels\n", __func__, exposure_time);
DBG(DBG_info, "%s : scan_step_type=%d\n", __func__,

Wyświetl plik

@ -1720,63 +1720,61 @@ void sanei_genesys_wait_for_home(Genesys_Device* dev)
}
}
/** @brief motor profile
* search for the database of motor profiles and get the best one. Each
* profile is at full step and at a reference exposure. Use first entry
* by default.
* @param motors motor profile database
* @param motor_type motor id
* @param exposure exposure time
* @return a pointer to a Motor_Profile struct
*/
const Motor_Profile& sanei_genesys_get_motor_profile(const std::vector<Motor_Profile>& motors,
MotorId motor_id, int exposure)
const MotorProfile* get_motor_profile_ptr(const std::vector<MotorProfile>& profiles,
unsigned exposure,
const ScanSession& session)
{
int idx;
int best_i = -1;
idx=-1;
for (std::size_t i = 0; i < motors.size(); ++i) {
// exact match
if (motors[i].motor_id == motor_id && motors[i].exposure==exposure) {
return motors[i];
for (unsigned i = 0; i < profiles.size(); ++i) {
const auto& profile = profiles[i];
if (!profile.resolutions.matches(session.params.yres)) {
continue;
}
if (!profile.scan_methods.matches(session.params.scan_method)) {
continue;
}
// closest match
if (motors[i].motor_id == motor_id) {
/* if profile exposure is higher than the required one,
* the entry is a candidate for the closest match */
if (motors[i].exposure == 0 || motors[i].exposure >= exposure)
{
if(idx<0)
{
/* no match found yet */
idx=i;
}
else
{
/* test for better match */
if(motors[i].exposure<motors[idx].exposure)
{
idx=i;
}
if (profile.max_exposure == exposure) {
return &profile;
}
if (profile.max_exposure == 0 || profile.max_exposure >= exposure) {
if (best_i < 0) {
// no match found yet
best_i = i;
} else {
// test for better match
if (profiles[i].max_exposure < profiles[best_i].max_exposure) {
best_i = i;
}
}
}
}
/* default fallback */
if(idx<0)
{
DBG (DBG_warn,"%s: using default motor profile\n",__func__);
idx=0;
if (best_i < 0) {
return nullptr;
}
return motors[idx];
return &profiles[best_i];
}
const MotorProfile& get_motor_profile(const std::vector<MotorProfile>& profiles,
unsigned exposure,
const ScanSession& session)
{
const auto* profile = get_motor_profile_ptr(profiles, exposure, session);
if (profile == nullptr) {
throw SaneException("Motor slope is not configured");
}
return *profile;
}
MotorSlopeTable sanei_genesys_slope_table(AsicType asic_type, int dpi, int exposure, int base_dpi,
unsigned step_multiplier,
const Motor_Profile& motor_profile)
const MotorProfile& motor_profile)
{
unsigned target_speed_w = ((exposure * dpi) / base_dpi);
@ -1787,7 +1785,7 @@ MotorSlopeTable sanei_genesys_slope_table(AsicType asic_type, int dpi, int expos
}
MotorSlopeTable create_slope_table_fastest(AsicType asic_type, unsigned step_multiplier,
const Motor_Profile& motor_profile)
const MotorProfile& motor_profile)
{
return create_slope_table(motor_profile.slope, motor_profile.slope.max_speed_w,
motor_profile.step_type,

Wyświetl plik

@ -215,22 +215,6 @@ struct Genesys_USB_Device_Entry {
Genesys_Model model;
};
/**
* structure for motor database
*/
struct Motor_Profile
{
MotorId motor_id;
int exposure; // used only to select the wanted motor
StepType step_type; // default step type for given exposure
MotorSlope slope;
};
extern StaticInit<std::vector<Motor_Profile>> gl843_motor_profiles;
extern StaticInit<std::vector<Motor_Profile>> gl846_motor_profiles;
extern StaticInit<std::vector<Motor_Profile>> gl847_motor_profiles;
extern StaticInit<std::vector<Motor_Profile>> gl124_motor_profiles;
/*--------------------------------------------------------------------------*/
/* common functions needed by low level specific functions */
/*--------------------------------------------------------------------------*/
@ -404,15 +388,20 @@ void scanner_stop_action_no_move(Genesys_Device& dev, Genesys_Register_Set& regs
bool scanner_is_motor_stopped(Genesys_Device& dev);
const Motor_Profile& sanei_genesys_get_motor_profile(const std::vector<Motor_Profile>& motors,
MotorId motor_id, int exposure);
const MotorProfile* get_motor_profile_ptr(const std::vector<MotorProfile>& profiles,
unsigned exposure,
const ScanSession& session);
const MotorProfile& get_motor_profile(const std::vector<MotorProfile>& profiles,
unsigned exposure,
const ScanSession& session);
MotorSlopeTable sanei_genesys_slope_table(AsicType asic_type, int dpi, int exposure, int base_dpi,
unsigned step_multiplier,
const Motor_Profile& motor_profile);
const MotorProfile& motor_profile);
MotorSlopeTable create_slope_table_fastest(AsicType asic_type, unsigned step_multiplier,
const Motor_Profile& motor_profile);
const MotorProfile& motor_profile);
/** @brief find lowest motor resolution for the device.
* Parses the resolution list for motor and
@ -509,7 +498,6 @@ void genesys_init_sensor_tables();
void genesys_init_frontend_tables();
void genesys_init_gpo_tables();
void genesys_init_motor_tables();
void genesys_init_motor_profile_tables();
void genesys_init_usb_device_tables();
template<class T>

Wyświetl plik

@ -164,15 +164,31 @@ std::ostream& operator<<(std::ostream& out, const MotorSlope& slope)
return out;
}
std::ostream& operator<<(std::ostream& out, const MotorProfile& profile)
{
out << "MotorProfile{\n"
<< " max_exposure: " << profile.max_exposure << '\n'
<< " step_type: " << profile.step_type << '\n'
<< " motor_vref: " << profile.motor_vref << '\n'
<< " resolutions: " << format_indent_braced_list(4, profile.resolutions) << '\n'
<< " scan_methods: " << format_indent_braced_list(4, profile.scan_methods) << '\n'
<< " slope: " << format_indent_braced_list(4, profile.slope) << '\n'
<< '}';
return out;
}
std::ostream& operator<<(std::ostream& out, const Genesys_Motor& motor)
{
out << "Genesys_Motor{\n"
<< " id: " << static_cast<unsigned>(motor.id) << '\n'
<< " base_ydpi: " << motor.base_ydpi << '\n'
<< " optical_ydpi: " << motor.optical_ydpi << '\n'
<< " slopes: "
<< format_indent_braced_list(4, format_vector_indent_braced(4, "MotorSlope",
motor.slopes))
<< " profiles: "
<< format_indent_braced_list(4, format_vector_indent_braced(4, "MotorProfile",
motor.profiles)) << '\n'
<< " fast_profiles: "
<< format_indent_braced_list(4, format_vector_indent_braced(4, "MotorProfile",
motor.fast_profiles)) << '\n'
<< '}';
return out;
}

Wyświetl plik

@ -44,9 +44,11 @@
#ifndef BACKEND_GENESYS_MOTOR_H
#define BACKEND_GENESYS_MOTOR_H
#include <algorithm>
#include <cstdint>
#include <vector>
#include "enums.h"
#include "sensor.h"
namespace genesys {
@ -137,6 +139,26 @@ MotorSlopeTable create_slope_table(const MotorSlope& slope, unsigned target_spee
std::ostream& operator<<(std::ostream& out, const MotorSlope& slope);
struct MotorProfile
{
MotorProfile() = default;
MotorProfile(const MotorSlope& a_slope, StepType a_step_type, unsigned a_max_exposure) :
slope{a_slope}, step_type{a_step_type}, max_exposure{a_max_exposure}
{}
MotorSlope slope;
StepType step_type = StepType::FULL;
int motor_vref = -1;
// the resolutions this profile is good for
ResolutionFilter resolutions = ResolutionFilter::ANY;
// the scan method this profile is good for. If the list is empty, good for any method.
ScanMethodFilter scan_methods = ScanMethodFilter::ANY;
unsigned max_exposure = 0; // 0 - any exposure
};
std::ostream& operator<<(std::ostream& out, const MotorProfile& profile);
struct Genesys_Motor
{
@ -149,24 +171,40 @@ struct Genesys_Motor
// maximum resolution in y-direction. Unit: 1/inch
int optical_ydpi = 0;
// slopes to derive individual slopes from
std::vector<MotorSlope> slopes;
std::vector<MotorProfile> profiles;
// slopes to derive individual slopes from for fast moving
std::vector<MotorProfile> fast_profiles;
MotorSlope& get_slope(StepType step_type)
MotorSlope& get_slope_with_step_type(StepType step_type)
{
return slopes[static_cast<unsigned>(step_type)];
for (auto& p : profiles) {
if (p.step_type == step_type)
return p.slope;
}
throw SaneException("No motor profile with step type");
}
const MotorSlope& get_slope(StepType step_type) const
const MotorSlope& get_slope_with_step_type(StepType step_type) const
{
return slopes[static_cast<unsigned>(step_type)];
for (const auto& p : profiles) {
if (p.step_type == step_type)
return p.slope;
}
throw SaneException("No motor profile with step type");
}
StepType max_step_type() const
{
if (slopes.empty()) {
throw std::runtime_error("Slopes table is empty");
if (profiles.empty()) {
throw std::runtime_error("Profiles table is empty");
}
return static_cast<StepType>(slopes.size() - 1);
StepType step_type = StepType::FULL;
for (const auto& p : profiles) {
step_type = static_cast<StepType>(
std::max(static_cast<unsigned>(step_type),
static_cast<unsigned>(p.step_type)));
}
return step_type;
}
};

Wyświetl plik

@ -122,6 +122,16 @@ std::ostream& operator<<(std::ostream& out, const ResolutionFilter& resolutions)
return out;
}
std::ostream& operator<<(std::ostream& out, const ScanMethodFilter& methods)
{
if (methods.matches_any()) {
out << "ANY";
return out;
}
out << format_vector_unsigned(4, methods.methods());
return out;
}
std::ostream& operator<<(std::ostream& out, const Genesys_Sensor& sensor)
{
out << "Genesys_Sensor{\n"

Wyświetl plik

@ -290,6 +290,46 @@ void serialize(Stream& str, ResolutionFilter& x)
}
class ScanMethodFilter
{
public:
struct Any {};
static constexpr Any ANY{};
ScanMethodFilter() : matches_any_{false} {}
ScanMethodFilter(Any) : matches_any_{true} {}
ScanMethodFilter(std::initializer_list<ScanMethod> methods) :
matches_any_{false},
methods_{methods}
{}
bool matches(ScanMethod method) const
{
if (matches_any_)
return true;
auto it = std::find(methods_.begin(), methods_.end(), method);
return it != methods_.end();
}
bool operator==(const ScanMethodFilter& other) const
{
return matches_any_ == other.matches_any_ && methods_ == other.methods_;
}
bool matches_any() const { return matches_any_; }
const std::vector<ScanMethod>& methods() const { return methods_; }
private:
bool matches_any_ = false;
std::vector<ScanMethod> methods_;
template<class Stream>
friend void serialize(Stream& str, ResolutionFilter& x);
};
std::ostream& operator<<(std::ostream& out, const ScanMethodFilter& methods);
struct Genesys_Sensor {
Genesys_Sensor() = default;

Wyświetl plik

@ -57,8 +57,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::UMAX;
motor.base_ydpi = 1200;
motor.optical_ydpi = 2400;
motor.slopes.push_back(MotorSlope::create_from_steps(11000, 3000, 128));
motor.slopes.push_back(MotorSlope::create_from_steps(11000, 3000, 128));
motor.profiles.push_back({MotorSlope::create_from_steps(11000, 3000, 128), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(11000, 3000, 128), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -66,8 +66,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::MD_5345; // MD5345/6228/6471
motor.base_ydpi = 1200;
motor.optical_ydpi = 2400;
motor.slopes.push_back(MotorSlope::create_from_steps(2000, 1375, 128));
motor.slopes.push_back(MotorSlope::create_from_steps(2000, 1375, 128));
motor.profiles.push_back({MotorSlope::create_from_steps(2000, 1375, 128), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(2000, 1375, 128), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -75,8 +75,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::ST24;
motor.base_ydpi = 2400;
motor.optical_ydpi = 2400;
motor.slopes.push_back(MotorSlope::create_from_steps(2289, 2100, 128));
motor.slopes.push_back(MotorSlope::create_from_steps(2289, 2100, 128));
motor.profiles.push_back({MotorSlope::create_from_steps(2289, 2100, 128), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(2289, 2100, 128), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -84,8 +84,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::HP3670;
motor.base_ydpi = 1200;
motor.optical_ydpi = 1200;
motor.slopes.push_back(MotorSlope::create_from_steps(11000, 3000, 128));
motor.slopes.push_back(MotorSlope::create_from_steps(11000, 3000, 128));
motor.profiles.push_back({MotorSlope::create_from_steps(11000, 3000, 128), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(11000, 3000, 128), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -93,8 +93,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::HP2400;
motor.base_ydpi = 1200;
motor.optical_ydpi = 1200;
motor.slopes.push_back(MotorSlope::create_from_steps(11000, 3000, 128));
motor.slopes.push_back(MotorSlope::create_from_steps(11000, 3000, 128));
motor.profiles.push_back({MotorSlope::create_from_steps(11000, 3000, 128), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(11000, 3000, 128), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -102,8 +102,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::HP2300;
motor.base_ydpi = 600;
motor.optical_ydpi = 1200;
motor.slopes.push_back(MotorSlope::create_from_steps(3200, 1200, 128));
motor.slopes.push_back(MotorSlope::create_from_steps(3200, 1200, 128));
motor.profiles.push_back({MotorSlope::create_from_steps(3200, 1200, 128), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(3200, 1200, 128), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -111,8 +111,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_LIDE_35;
motor.base_ydpi = 1200;
motor.optical_ydpi = 2400;
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 1300, 60));
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 1400, 60));
motor.profiles.push_back({MotorSlope::create_from_steps(3500, 1300, 60), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(3500, 1400, 60), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -120,8 +120,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::XP200;
motor.base_ydpi = 600;
motor.optical_ydpi = 600;
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 1300, 60));
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 1300, 60));
motor.profiles.push_back({MotorSlope::create_from_steps(3500, 1300, 60), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(3500, 1300, 60), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -130,8 +130,8 @@ void genesys_init_motor_tables()
motor.base_ydpi = 300;
motor.optical_ydpi = 600;
// works best with GPIO10, GPIO14 off
motor.slopes.push_back(MotorSlope::create_from_steps(3700, 3700, 2));
motor.slopes.push_back(MotorSlope::create_from_steps(11000, 11000, 2));
motor.profiles.push_back({MotorSlope::create_from_steps(3700, 3700, 2), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(11000, 11000, 2), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -139,8 +139,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::DP665;
motor.base_ydpi = 750;
motor.optical_ydpi = 1500;
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 2500, 10));
motor.slopes.push_back(MotorSlope::create_from_steps(11000, 11000, 2));
motor.profiles.push_back({MotorSlope::create_from_steps(3000, 2500, 10), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(11000, 11000, 2), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -148,8 +148,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::ROADWARRIOR;
motor.base_ydpi = 750;
motor.optical_ydpi = 1500;
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 2600, 10));
motor.slopes.push_back(MotorSlope::create_from_steps(11000, 11000, 2));
motor.profiles.push_back({MotorSlope::create_from_steps(3000, 2600, 10), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(11000, 11000, 2), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -157,8 +157,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::DSMOBILE_600;
motor.base_ydpi = 750;
motor.optical_ydpi = 1500;
motor.slopes.push_back(MotorSlope::create_from_steps(6666, 3700, 8));
motor.slopes.push_back(MotorSlope::create_from_steps(6666, 3700, 8));
motor.profiles.push_back({MotorSlope::create_from_steps(6666, 3700, 8), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(6666, 3700, 8), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -166,9 +166,16 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_LIDE_100;
motor.base_ydpi = 1200;
motor.optical_ydpi = 6400;
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 1000, 127));
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 1500, 127));
motor.slopes.push_back(MotorSlope::create_from_steps(3 * 2712, 3 * 2712, 16));
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 255),
StepType::HALF, 1424});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 255),
StepType::HALF, 1432});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 255),
StepType::HALF, 2848});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 279),
StepType::QUARTER, 2712});
motor.profiles.push_back({MotorSlope::create_from_steps(31680, 534, 247),
StepType::EIGHTH, 5280});
s_motors->push_back(std::move(motor));
@ -176,9 +183,18 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_LIDE_200;
motor.base_ydpi = 1200;
motor.optical_ydpi = 6400;
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 1000, 127));
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 1500, 127));
motor.slopes.push_back(MotorSlope::create_from_steps(3 * 2712, 3 * 2712, 16));
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 255),
StepType::HALF, 1424});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 255),
StepType::HALF, 1432});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 255),
StepType::HALF, 2848});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 279),
StepType::QUARTER, 2712});
motor.profiles.push_back({MotorSlope::create_from_steps(31680, 534, 247),
StepType::EIGHTH, 5280});
motor.profiles.push_back({MotorSlope::create_from_steps(31680, 534, 247),
StepType::EIGHTH, 10416});
s_motors->push_back(std::move(motor));
@ -186,9 +202,16 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_LIDE_700;
motor.base_ydpi = 1200;
motor.optical_ydpi = 6400;
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 1000, 127));
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 1500, 127));
motor.slopes.push_back(MotorSlope::create_from_steps(3 * 2712, 3 * 2712, 16));
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 255),
StepType::HALF, 1424});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 255),
StepType::HALF, 1504});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 2022, 127),
StepType::HALF, 2696});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 534, 255),
StepType::HALF, 2848});
motor.profiles.push_back({MotorSlope::create_from_steps(46876, 15864, 2),
StepType::EIGHTH, 10576});
s_motors->push_back(std::move(motor));
@ -196,9 +219,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::KVSS080;
motor.base_ydpi = 1200;
motor.optical_ydpi = 1200;
motor.slopes.push_back(MotorSlope::create_from_steps(22222, 500, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(22222, 500, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(22222, 500, 246));
motor.profiles.push_back({MotorSlope::create_from_steps(44444, 500, 489),
StepType::HALF, 8000});
s_motors->push_back(std::move(motor));
@ -206,9 +228,14 @@ void genesys_init_motor_tables()
motor.id = MotorId::G4050;
motor.base_ydpi = 2400;
motor.optical_ydpi = 9600;
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.profiles.push_back({MotorSlope::create_from_steps(7842, 320, 602),
StepType::HALF, 8016});
motor.profiles.push_back({MotorSlope::create_from_steps(9422, 254, 1004),
StepType::HALF, 15624});
motor.profiles.push_back({MotorSlope::create_from_steps(28032, 2238, 604),
StepType::HALF, 56064});
motor.profiles.push_back({MotorSlope::create_from_steps(42752, 1706, 610),
StepType::QUARTER, 42752});
s_motors->push_back(std::move(motor));
@ -216,9 +243,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_4400F;
motor.base_ydpi = 2400;
motor.optical_ydpi = 9600;
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.profiles.push_back({MotorSlope::create_from_steps(49152, 484, 1014),
StepType::HALF, 11640});
s_motors->push_back(std::move(motor));
@ -226,9 +252,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_8400F;
motor.base_ydpi = 1600;
motor.optical_ydpi = 6400;
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.profiles.push_back({MotorSlope::create_from_steps(8743, 300, 794),
StepType::QUARTER, 50000});
s_motors->push_back(std::move(motor));
@ -236,9 +261,10 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_8600F;
motor.base_ydpi = 2400;
motor.optical_ydpi = 9600;
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
motor.slopes.push_back(MotorSlope::create_from_steps(3961, 240, 246));
// BUG: this is a fallback slope that was selected previously and preserved for compatibility
motor.profiles.push_back({MotorSlope::create_from_steps(44444, 500, 489), StepType::HALF, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(54612, 1500, 219),
StepType::QUARTER, 23000});
s_motors->push_back(std::move(motor));
@ -246,7 +272,14 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_LIDE_110;
motor.base_ydpi = 4800;
motor.optical_ydpi = 9600;
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 1000, 256));
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 335, 255),
StepType::FULL, 2768});
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 335, 469),
StepType::HALF, 5360});
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 2632, 3),
StepType::HALF, 10528});
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 10432, 3),
StepType::QUARTER, 20864});
s_motors->push_back(std::move(motor));
@ -254,7 +287,14 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_LIDE_120;
motor.base_ydpi = 4800;
motor.optical_ydpi = 9600;
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 1000, 256));
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 864, 127),
StepType::FULL, 4608});
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 2010, 63),
StepType::HALF, 5360});
motor.profiles.push_back({MotorSlope::create_from_steps(62464, 2632, 3),
StepType::QUARTER, 10528});
motor.profiles.push_back({MotorSlope::create_from_steps(62592, 10432, 5),
StepType::QUARTER, 20864});
s_motors->push_back(std::move(motor));
@ -262,7 +302,14 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_LIDE_210;
motor.base_ydpi = 4800;
motor.optical_ydpi = 9600;
motor.slopes.push_back(MotorSlope::create_from_steps(3000, 1000, 256));
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 335, 255),
StepType::FULL, 2768});
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 335, 469),
StepType::HALF, 5360});
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 2632, 3),
StepType::HALF, 10528});
motor.profiles.push_back({MotorSlope::create_from_steps(62496, 10432, 4),
StepType::QUARTER, 20864});
s_motors->push_back(std::move(motor));
@ -270,8 +317,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::PLUSTEK_OPTICPRO_3600;
motor.base_ydpi = 1200;
motor.optical_ydpi = 2400;
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 1300, 60));
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 3250, 60));
motor.profiles.push_back({MotorSlope::create_from_steps(3500, 1300, 60), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(3500, 3250, 60), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -279,6 +326,7 @@ void genesys_init_motor_tables()
motor.id = MotorId::PLUSTEK_OPTICFILM_7200I;
motor.base_ydpi = 3600;
motor.optical_ydpi = 3600;
motor.profiles.push_back({MotorSlope::create_from_steps(39682, 1191, 15), StepType::HALF, 0});
s_motors->push_back(std::move(motor));
@ -286,6 +334,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::PLUSTEK_OPTICFILM_7300;
motor.base_ydpi = 3600;
motor.optical_ydpi = 3600;
motor.profiles.push_back({MotorSlope::create_from_steps(31250, 1512, 6),
StepType::QUARTER, 12100});
s_motors->push_back(std::move(motor));
@ -293,6 +343,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::PLUSTEK_OPTICFILM_7500I;
motor.base_ydpi = 3600;
motor.optical_ydpi = 3600;
motor.profiles.push_back({MotorSlope::create_from_steps(31250, 1375, 7),
StepType::QUARTER, 0});
s_motors->push_back(std::move(motor));
@ -300,8 +352,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::IMG101;
motor.base_ydpi = 600;
motor.optical_ydpi = 1200;
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 1300, 60));
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 3250, 60));
motor.profiles.push_back({MotorSlope::create_from_steps(22000, 1000, 1017),
StepType::HALF, 11000});
s_motors->push_back(std::move(motor));
@ -309,8 +361,8 @@ void genesys_init_motor_tables()
motor.id = MotorId::PLUSTEK_OPTICBOOK_3800;
motor.base_ydpi = 600;
motor.optical_ydpi = 1200;
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 1300, 60));
motor.slopes.push_back(MotorSlope::create_from_steps(3500, 3250, 60));
motor.profiles.push_back({MotorSlope::create_from_steps(22000, 1000, 1017),
StepType::HALF, 11000});
s_motors->push_back(std::move(motor));
@ -318,7 +370,7 @@ void genesys_init_motor_tables()
motor.id = MotorId::CANON_LIDE_80;
motor.base_ydpi = 2400;
motor.optical_ydpi = 4800; // 9600
motor.slopes.push_back(MotorSlope::create_from_steps(9560, 1912, 31));
motor.profiles.push_back({MotorSlope::create_from_steps(9560, 1912, 31), StepType::FULL, 0});
s_motors->push_back(std::move(motor));
}

Wyświetl plik

@ -1,380 +0,0 @@
/* sane - Scanner Access Now Easy.
Copyright (C) 2019 Povilas Kanapickas <povilas@radix.lt>
This file is part of the SANE package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
*/
#define DEBUG_DECLARE_ONLY
#include "low.h"
namespace genesys {
StaticInit<std::vector<Motor_Profile>> gl843_motor_profiles;
void genesys_init_motor_profile_tables_gl843()
{
gl843_motor_profiles.init();
auto profile = Motor_Profile();
profile.motor_id = MotorId::KVSS080;
profile.exposure = 8000;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(44444, 500, 489);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::G4050;
profile.exposure = 8016;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(7842, 320, 602);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::G4050;
profile.exposure = 15624;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(9422, 254, 1004);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::G4050;
profile.exposure = 42752;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(42752, 1706, 610);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::G4050;
profile.exposure = 56064;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(28032, 2238, 604);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_4400F;
profile.exposure = 11640;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(49152, 484, 1014);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_8400F;
profile.exposure = 50000;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(8743, 300, 794);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_8600F;
profile.exposure = 0x59d8;
profile.step_type = StepType::QUARTER;
// FIXME: if the exposure is lower then we'll select another motor
profile.slope = MotorSlope::create_from_steps(54612, 1500, 219);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::PLUSTEK_OPTICFILM_7200I;
profile.exposure = 0;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(39682, 1191, 15);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::PLUSTEK_OPTICFILM_7300;
profile.exposure = 0x2f44;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(31250, 1512, 6);
gl843_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::PLUSTEK_OPTICFILM_7500I;
profile.exposure = 0;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(31250, 1375, 7);
gl843_motor_profiles->push_back(profile);
}
StaticInit<std::vector<Motor_Profile>> gl846_motor_profiles;
void genesys_init_motor_profile_tables_gl846()
{
gl846_motor_profiles.init();
auto profile = Motor_Profile();
profile.motor_id = MotorId::IMG101;
profile.exposure = 11000;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(22000, 1000, 1017);
gl846_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::PLUSTEK_OPTICBOOK_3800;
profile.exposure = 11000;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(22000, 1000, 1017);
gl846_motor_profiles->push_back(profile);
}
/**
* database of motor profiles
*/
StaticInit<std::vector<Motor_Profile>> gl847_motor_profiles;
void genesys_init_motor_profile_tables_gl847()
{
gl847_motor_profiles.init();
auto profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_100;
profile.exposure = 2848;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 534, 255);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_100;
profile.exposure = 1424;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 534, 255);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_100;
profile.exposure = 1432;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 534, 255);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_100;
profile.exposure = 2712;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(46876, 534, 279);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_100;
profile.exposure = 5280;
profile.step_type = StepType::EIGHTH;
profile.slope = MotorSlope::create_from_steps(31680, 534, 247);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_200;
profile.exposure = 2848;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 534, 255);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_200;
profile.exposure = 1424;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 534, 255);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_200;
profile.exposure = 1432;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 534, 255);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_200;
profile.exposure = 2712;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(46876, 534, 279);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_200;
profile.exposure = 5280;
profile.step_type = StepType::EIGHTH;
profile.slope = MotorSlope::create_from_steps(31680, 534, 247);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_200;
profile.exposure = 10416;
profile.step_type = StepType::EIGHTH;
profile.slope = MotorSlope::create_from_steps(31680, 534, 247);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_700;
profile.exposure = 2848;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 534, 255);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_700;
profile.exposure = 1424;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 534, 255);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_700;
profile.exposure = 1504;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 534, 255);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_700;
profile.exposure = 2696;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(46876, 2022, 127);
gl847_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_700;
profile.exposure = 10576;
profile.step_type = StepType::EIGHTH;
profile.slope = MotorSlope::create_from_steps(46876, 15864, 2);
gl847_motor_profiles->push_back(profile);
}
StaticInit<std::vector<Motor_Profile>> gl124_motor_profiles;
void genesys_init_motor_profile_tables_gl124()
{
gl124_motor_profiles.init();
// NEXT LPERIOD=PREVIOUS*2-192
Motor_Profile profile;
profile.motor_id = MotorId::CANON_LIDE_110;
profile.exposure = 2768;
profile.step_type = StepType::FULL;
profile.slope = MotorSlope::create_from_steps(62496, 335, 255);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_110;
profile.exposure = 5360;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(62496, 335, 469);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_110;
profile.exposure = 10528;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(62496, 2632, 3);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_110;
profile.exposure = 20864;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(62496, 10432, 3);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_120;
profile.exposure = 4608;
profile.step_type = StepType::FULL;
profile.slope = MotorSlope::create_from_steps(62496, 864, 127);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_120;
profile.exposure = 5360;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(62496, 2010, 63);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_120;
profile.exposure = 10528;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(62464, 2632, 3);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_120;
profile.exposure = 20864;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(62592, 10432, 5);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_210;
profile.exposure = 2768;
profile.step_type = StepType::FULL;
profile.slope = MotorSlope::create_from_steps(62496, 335, 255);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_210;
profile.exposure = 5360;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(62496, 335, 469);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_210;
profile.exposure = 10528;
profile.step_type = StepType::HALF;
profile.slope = MotorSlope::create_from_steps(62496, 2632, 3);
gl124_motor_profiles->push_back(profile);
profile = Motor_Profile();
profile.motor_id = MotorId::CANON_LIDE_210;
profile.exposure = 20864;
profile.step_type = StepType::QUARTER;
profile.slope = MotorSlope::create_from_steps(62496, 10432, 4);
gl124_motor_profiles->push_back(profile);
}
void genesys_init_motor_profile_tables()
{
genesys_init_motor_profile_tables_gl843();
genesys_init_motor_profile_tables_gl846();
genesys_init_motor_profile_tables_gl847();
genesys_init_motor_profile_tables_gl124();
}
} // namespace genesys

Wyświetl plik

@ -40,9 +40,10 @@ void test_create_slope_table3()
motor.id = MotorId::CANON_LIDE_200;
motor.base_ydpi = 1200;
motor.optical_ydpi = 6400;
motor.slopes.push_back(MotorSlope::create_from_steps(10000, 1000, 20));
motor.slopes.push_back(MotorSlope::create_from_steps(10000, 1000, 20));
motor.slopes.push_back(MotorSlope::create_from_steps(10000, 1000, 16));
motor.profiles.push_back({MotorSlope::create_from_steps(10000, 1000, 20), StepType::FULL, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(10000, 1000, 20), StepType::HALF, 0});
motor.profiles.push_back({MotorSlope::create_from_steps(10000, 1000, 16),
StepType::QUARTER, 0});
auto table = sanei_genesys_create_slope_table3(asic_type, motor, StepType::FULL, 10000,
motor.base_ydpi);