code_device/hgdriver/hgdev/IConfig.h

197 lines
5.8 KiB
C
Raw Permalink Normal View History

2022-05-03 03:56:07 +00:00
#ifndef ICONFIG_H
#define ICONFIG_H
// !ICONFIG_H
#include "predefine.h"
#include <map>
#include "PaperSize.h"
#ifndef unix
//typedef char byte;
#endif
enum G400_PaperSize {
G400_A3 = 0,
G400_A4,
G400_A4R,
G400_A5,
G400_A5R,
G400_A6,
G400_A6R,
G400_B4,
G400_B5,
G400_B5R,
G400_B6,
G400_B6R,
G400_DOUBLELETTER,
G400_LEGAL,
G400_LETTER,
G400_LETTERR,
G400_LONGLETTER,
G400_MAXSIZE
};
enum G400_DPI {
G400_D300 = 0,
G400_D200,
G400_D600
};
static std::map<unsigned short, unsigned int> SupPixelTypes = {
{0, 0},//bw
{1, 0},//gray
{2, 1}//color
};
static std::map<float, unsigned int> SupResolutions = {
{300.0f, 0},
{200.0f, 1},
{600.0f, 2}
};
static std::map<byte, byte> secrewMaps = {
{1,0},
{2,1},
{3,2},
{4,3},
{5,4}
};
typedef union Config_Param {
unsigned int value;
struct {
unsigned int paper : 5;
unsigned int color : 1;
unsigned int dpi : 2;
unsigned int double_feed_enbale : 1;
unsigned int stable_enbale : 1;
unsigned int screw_detect_enable : 1;
unsigned int screw_detect_level : 3;
unsigned int unused_one : 6;
unsigned int pc_correct : 1;
unsigned int unused_two : 11;
};
} ConfigParam;
static std::map<PaperStatus, unsigned int> SupPaperTyps_G100
{
{{TwSS::A3,PaperAlign::Rot0},0},
{{TwSS::A4,PaperAlign::Rot0},1},
{{TwSS::A4,PaperAlign::Rot270},2},
{{TwSS::A5,PaperAlign::Rot0 },2},
{{TwSS::A5,PaperAlign::Rot270},2},
{{TwSS::A6,PaperAlign::Rot0},2},
{{TwSS::A6,PaperAlign::Rot270},2},
{{TwSS::B4,PaperAlign::Rot0},0},
{{TwSS::B5,PaperAlign::Rot0},0},
{{TwSS::B5,PaperAlign::Rot270},1},
{{TwSS::B6,PaperAlign::Rot0},2},
{{TwSS::B6,PaperAlign::Rot270},2},
{{TwSS::USLetter,PaperAlign::Rot0},1},
{{TwSS::USLetter,PaperAlign::Rot270},2},
{{TwSS::USLedger,PaperAlign::Rot0},0},
{{TwSS::USLegal,PaperAlign::Rot0},0},
{{TwSS::None,PaperAlign::Rot0},0},
{{TwSS::USStatement,PaperAlign::Rot0},16},
{{TwSS::MaxSize,PaperAlign::Rot0},16}
};
static std::map<PaperStatus, unsigned int> SupPaperTyps_G300
{
{{TwSS::A4,PaperAlign::Rot270},G400_A4R},
{{TwSS::A5,PaperAlign::Rot0 },G400_A5},
{{TwSS::A5,PaperAlign::Rot270},G400_A5R},
{{TwSS::A6,PaperAlign::Rot0},G400_A6},
{{TwSS::A6,PaperAlign::Rot270},G400_A6R},
{{TwSS::B5,PaperAlign::Rot0},G400_B5},
{{TwSS::B5,PaperAlign::Rot270},G400_B5R},
{{TwSS::B6,PaperAlign::Rot0},G400_B6},
{{TwSS::B6,PaperAlign::Rot270},G400_B6R},
{{TwSS::USLetter,PaperAlign::Rot0},G400_LETTER},
{{TwSS::USLetter,PaperAlign::Rot270},G400_LETTERR},
{{TwSS::USLegal,PaperAlign::Rot0},G400_LEGAL},
{{TwSS::None,PaperAlign::Rot0},G400_A4},
};
static std::map<PaperStatus, unsigned int> SupPaperTyps_G400
{
{{TwSS::A3,PaperAlign::Rot0},G400_A3},
{{TwSS::A4,PaperAlign::Rot0},G400_A4},
{{TwSS::A4,PaperAlign::Rot270},G400_A4R},
{{TwSS::A5,PaperAlign::Rot0 },G400_A5},
{{TwSS::A5,PaperAlign::Rot270},G400_A5R},
{{TwSS::A6,PaperAlign::Rot0},G400_A6},
{{TwSS::A6,PaperAlign::Rot270},G400_A6R},
{{TwSS::B4,PaperAlign::Rot0},G400_B4},
{{TwSS::B5,PaperAlign::Rot0},G400_B5},
{{TwSS::B5,PaperAlign::Rot270},G400_B5R},
{{TwSS::B6,PaperAlign::Rot0},G400_B6},
{{TwSS::B6,PaperAlign::Rot270},G400_B6R},
{{TwSS::USLetter,PaperAlign::Rot0},G400_LETTER},
{{TwSS::USLetter,PaperAlign::Rot270},G400_LETTERR},
{{TwSS::USLedger,PaperAlign::Rot0},G400_DOUBLELETTER},
{{TwSS::USLegal,PaperAlign::Rot0},G400_LEGAL},
{{TwSS::None,PaperAlign::Rot0},G400_A3},
{{TwSS::MaxSize,PaperAlign::Rot0},G400_MAXSIZE},
{{TwSS::USStatement,PaperAlign::Rot0},G400_MAXSIZE}
};
// static std::map<PaperStatus, unsigned int> SupPaperTyps = {
// #ifdef G200SCANNER
// {{TwSS::A3,PaperAlign::Rot0},0},
// {{TwSS::A4,PaperAlign::Rot0},1},
// {{TwSS::A4,PaperAlign::Rot270},2},
// {{TwSS::A5,PaperAlign::Rot0 },2},
// {{TwSS::A5,PaperAlign::Rot270},2},
// {{TwSS::A6,PaperAlign::Rot0},2},
// {{TwSS::A6,PaperAlign::Rot270},2},
// {{TwSS::B4,PaperAlign::Rot0},0},
// {{TwSS::B5,PaperAlign::Rot0},0},
// {{TwSS::B5,PaperAlign::Rot270},1},
// {{TwSS::B6,PaperAlign::Rot0},2},
// {{TwSS::B6,PaperAlign::Rot270},2},
// {{TwSS::USLetter,PaperAlign::Rot0},1},
// {{TwSS::USLetter,PaperAlign::Rot270},2},
// {{TwSS::USLedger,PaperAlign::Rot0},0},
// {{TwSS::USLegal,PaperAlign::Rot0},0},
// {{TwSS::None,PaperAlign::Rot0},0},
// {{TwSS::USStatement,PaperAlign::Rot0},16},
// {{TwSS::MaxSize,PaperAlign::Rot0},16}
// #else
// {{TwSS::A3,PaperAlign::Rot0},G400_A3},
// {{TwSS::A4,PaperAlign::Rot0},G400_A4},
// {{TwSS::A4,PaperAlign::Rot270},G400_A4R},
// {{TwSS::A5,PaperAlign::Rot0 },G400_A5},
// {{TwSS::A5,PaperAlign::Rot270},G400_A5R},
// {{TwSS::A6,PaperAlign::Rot0},G400_A6},
// {{TwSS::A6,PaperAlign::Rot270},G400_A6R},
// {{TwSS::B4,PaperAlign::Rot0},G400_B4},
// {{TwSS::B5,PaperAlign::Rot0},G400_B5},
// {{TwSS::B5,PaperAlign::Rot270},G400_B5R},
// {{TwSS::B6,PaperAlign::Rot0},G400_B6},
// {{TwSS::B6,PaperAlign::Rot270},G400_B6R},
// {{TwSS::USLetter,PaperAlign::Rot0},G400_LETTER},
// {{TwSS::USLetter,PaperAlign::Rot270},G400_LETTERR},
// {{TwSS::USLedger,PaperAlign::Rot0},G400_DOUBLELETTER},
// {{TwSS::USLegal,PaperAlign::Rot0},G400_LEGAL},
// #ifdef G300SCANNER
// {{TwSS::None,PaperAlign::Rot0},G400_A4},
// #else // G300
// {{TwSS::None,PaperAlign::Rot0},G400_A3},
// #endif
// {{TwSS::MaxSize,PaperAlign::Rot0},G400_MAXSIZE},
// {{TwSS::USStatement,PaperAlign::Rot0},G400_MAXSIZE}
// #endif
// };
class IConfig
{
public:
IConfig(void) {};
virtual ~IConfig(void) {};
virtual unsigned int GetData() { return m_param.value; }
protected:
ConfigParam m_param;
};
#endif