genesys: Add a class to move common command set functions to

merge-requests/317/merge
Povilas Kanapickas 2020-01-12 10:57:04 +02:00
rodzic 8b129b32ff
commit 3753716e04
9 zmienionych plików z 85 dodań i 12 usunięć

Wyświetl plik

@ -504,6 +504,7 @@ libgenesys_la_SOURCES = genesys/genesys.cpp genesys/genesys.h \
genesys/buffer.h genesys/buffer.cpp \
genesys/calibration.h \
genesys/command_set.h \
genesys/command_set_common.h genesys/command_set_common.cpp \
genesys/conv.h genesys/conv.cpp \
genesys/device.h genesys/device.cpp \
genesys/enums.h genesys/enums.cpp \

Wyświetl plik

@ -0,0 +1,31 @@
/* 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.
*/
#define DEBUG_DECLARE_ONLY
#include "command_set_common.h"
namespace genesys {
CommandSetCommon::~CommandSetCommon() = default;
} // namespace genesys

Wyświetl plik

@ -0,0 +1,41 @@
/* 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.
*/
#ifndef BACKEND_GENESYS_COMMAND_SET_COMMON_H
#define BACKEND_GENESYS_COMMAND_SET_COMMON_H
#include "command_set.h"
namespace genesys {
/** Common command set functionality
*/
class CommandSetCommon : public CommandSet
{
public:
~CommandSetCommon() override;
};
} // namespace genesys
#endif // BACKEND_GENESYS_COMMAND_SET_COMMON_H

Wyświetl plik

@ -45,7 +45,7 @@
#define BACKEND_GENESYS_GL124_H
#include "genesys.h"
#include "command_set.h"
#include "command_set_common.h"
namespace genesys {
namespace gl124 {
@ -112,7 +112,7 @@ static Memory_layout layouts[]={
static void gl124_send_slope_table(Genesys_Device* dev, int table_nr,
const std::vector<uint16_t>& slope_table, int steps);
class CommandSetGl124 : public CommandSet
class CommandSetGl124 : public CommandSetCommon
{
public:
~CommandSetGl124() override = default;

Wyświetl plik

@ -48,7 +48,7 @@
#define BACKEND_GENESYS_GL646_H
#include "genesys.h"
#include "command_set.h"
#include "command_set_common.h"
#include "motor.h"
namespace genesys {
@ -436,7 +436,7 @@ static Motor_Master motor_master[] = {
MotorSlope::create_from_steps(2000, 300, 255), 146}, /* 5500 guessed */
};
class CommandSetGl646 : public CommandSet
class CommandSetGl646 : public CommandSetCommon
{
public:
~CommandSetGl646() override = default;

Wyświetl plik

@ -42,7 +42,7 @@
*/
#include "genesys.h"
#include "command_set.h"
#include "command_set_common.h"
#ifndef BACKEND_GENESYS_GL841_H
#define BACKEND_GENESYS_GL841_H
@ -50,7 +50,7 @@
namespace genesys {
namespace gl841 {
class CommandSetGl841 : public CommandSet
class CommandSetGl841 : public CommandSetCommon
{
public:
~CommandSetGl841() override = default;

Wyświetl plik

@ -42,7 +42,7 @@
*/
#include "genesys.h"
#include "command_set.h"
#include "command_set_common.h"
#ifndef BACKEND_GENESYS_GL843_H
#define BACKEND_GENESYS_GL843_H
@ -50,7 +50,7 @@
namespace genesys {
namespace gl843 {
class CommandSetGl843 : public CommandSet
class CommandSetGl843 : public CommandSetCommon
{
public:
~CommandSetGl843() override = default;

Wyświetl plik

@ -42,7 +42,7 @@
*/
#include "genesys.h"
#include "command_set.h"
#include "command_set_common.h"
#ifndef BACKEND_GENESYS_GL846_H
#define BACKEND_GENESYS_GL846_H
@ -125,7 +125,7 @@ static Memory_layout layouts[]={
{ nullptr, 0, 0, 0, 0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }
};
class CommandSetGl846 : public CommandSet
class CommandSetGl846 : public CommandSetCommon
{
public:
~CommandSetGl846() override = default;

Wyświetl plik

@ -45,7 +45,7 @@
#define BACKEND_GENESYS_GL847_H
#include "genesys.h"
#include "command_set.h"
#include "command_set_common.h"
namespace genesys {
namespace gl847 {
@ -113,7 +113,7 @@ static Memory_layout layouts[]={
}
};
class CommandSetGl847 : public CommandSet
class CommandSetGl847 : public CommandSetCommon
{
public:
~CommandSetGl847() override = default;