You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
newValue/tpvs17/lpMain/lpGlobalConfig.h

92 lines
2.1 KiB
C++

#ifndef _LPGLOBALCONFIG_H_
#define _LPGLOBALCONFIG_H_
#include <QObject>
#include "lp_singleton_base.h"
#include <QMap>
#include <QPoint>
#include <QPolygonF>
#include <QPointF>
struct MatixParam
{
double m11{ 1 };
double m21{ 0 };
double dx{ 0 };
double m12{ 0 };
double m22{ 1 };
double dy{ 0 };
};
struct StationStandard {
MatixParam matix;
QPoint Pixpoint1{ 100,100 };
QPoint Pixpoint2{ 200,100 };
QPoint Pixpoint3{ 200,200 };
QPoint Pixpoint4{ 100,200 };
QPointF Realpoint1{ 100,100 };
QPointF Realpoint2{ 200,100 };
QPointF Realpoint3{ 200,200 };
QPointF Realpoint4{ 100,200 };
QPoint testPoint{ 300,300 };
bool bXYTrans{ false };
double xPointOffset{0};
double yPointOffset{0};
};
QPointF transWorldPoint(QPointF imgPoint, MatixParam param);
MatixParam gentransform(QPolygonF srcPos, QPolygonF dstPos);
class lpGlobalConfig : public QObject, public lp_singleton_base<lpGlobalConfig>
{
Q_OBJECT
public:
lpGlobalConfig(QObject *parent = nullptr);
~lpGlobalConfig();
public:
void readConfig();
void writeConfig();
QString m_StationCamKey_1;//工位相机绑定
QString m_StationCamKey_2;//工位相机绑定
QString m_StationSolution_1;//工位solution绑定
QString m_StationSolution_2;//工位solution绑定
QString m_StationRunModel_1;
QString m_StationRunModel_2;
//坐标标定 工位A
QPoint point1_1;//标定点 1
QPoint point2_1;//标定点 2
double fLength_1{ 1000.0 };//物理两标定点长度
double m_StationScale_1{ 1.0 };//比例尺 长度/像素
double m_StationXOffset_1{ 0.0 };//物理标点横向偏移
double m_StationYOffset_1{ 0.0 };//物理标点纵向偏移
bool m_StationXYTrans_1{ false };//输出坐标取反
//坐标标定 工位B
QPoint point1_2;//标定点 1
QPoint point2_2;//标定点 2
double fLength_2{ 1000.0 };//物理两标定点长度
double m_StationScale_2{ 1.0 };
double m_StationXOffset_2{ 0.0 };
double m_StationYOffset_2{ 0.0 };
bool m_StationXYTrans_2{ false };//输出坐标取反
int pointCircle{ 20 };//标定点 直径
bool m_bOnlineMode{ false };//在线模式
QString m_rootPath;
int trigerFilter{ 1000 };//触发滤波时间
bool bUse4PointStand{ false };
StationStandard stationParam1;
StationStandard stationParam2;
};
#endif