使用QSettings保存选择的相机类型
This commit is contained in:
@ -13,6 +13,10 @@ HPPA::HPPA(QWidget *parent)
|
|||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
|
QCoreApplication::setOrganizationName("IRIS");
|
||||||
|
QCoreApplication::setOrganizationDomain("iris.com");
|
||||||
|
QCoreApplication::setApplicationName("HPPA");
|
||||||
|
|
||||||
QString strPath = QCoreApplication::applicationDirPath() + "/UILayout.ini";
|
QString strPath = QCoreApplication::applicationDirPath() + "/UILayout.ini";
|
||||||
QFile file(strPath);
|
QFile file(strPath);
|
||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
@ -301,13 +305,36 @@ void HPPA::createActionGroups()
|
|||||||
mImagerGroup->addAction(ui.mActionCorning_410);
|
mImagerGroup->addAction(ui.mActionCorning_410);
|
||||||
mImagerGroup->addAction(ui.mActionPica_NIR);
|
mImagerGroup->addAction(ui.mActionPica_NIR);
|
||||||
|
|
||||||
|
|
||||||
|
// <20><>ȡ<EFBFBD>ϴ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>
|
||||||
|
QSettings settings;
|
||||||
|
QString lastSelectedAction = settings.value("LastSelectedImagerAction").toString();
|
||||||
|
|
||||||
|
// <20>ָ<EFBFBD><D6B8>ϴ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>
|
||||||
|
if (lastSelectedAction == "mActionPica_L")
|
||||||
|
{
|
||||||
|
ui.mActionPica_L->setChecked(true);
|
||||||
|
}
|
||||||
|
else if (lastSelectedAction == "mActionPica_NIR")
|
||||||
|
{
|
||||||
ui.mActionPica_NIR->setChecked(true);
|
ui.mActionPica_NIR->setChecked(true);
|
||||||
imagerSelected = ui.mActionPica_NIR->objectName();
|
}
|
||||||
|
else if (lastSelectedAction == "mActionPika_XC2")
|
||||||
|
{
|
||||||
|
ui.mActionPika_XC2->setChecked(true);
|
||||||
|
}
|
||||||
|
else if (lastSelectedAction == "mActionCorning_410")
|
||||||
|
{
|
||||||
|
ui.mActionCorning_410->setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HPPA::selectingImager(QAction* selectedAction)
|
void HPPA::selectingImager(QAction* selectedAction)
|
||||||
{
|
{
|
||||||
imagerSelected = selectedAction->objectName();
|
QSettings settings;
|
||||||
|
settings.setValue("LastSelectedImagerAction", selectedAction->objectName());
|
||||||
|
settings.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
HPPA::~HPPA()
|
HPPA::~HPPA()
|
||||||
@ -1491,6 +1518,7 @@ void HPPA::newMotor()
|
|||||||
m_yMotor = new VinceControl(NETTCP, 6001);//ԭ<><D4AD><EFBFBD><EFBFBD>6001<30><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>6003
|
m_yMotor = new VinceControl(NETTCP, 6001);//ԭ<><D4AD><EFBFBD><EFBFBD>6001<30><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>6003
|
||||||
|
|
||||||
m_pathPlan->setMotor(m_xMotor, m_yMotor);
|
m_pathPlan->setMotor(m_xMotor, m_yMotor);
|
||||||
|
QString imagerSelected = mImagerGroup->checkedAction()->objectName();
|
||||||
if (imagerSelected == "mActionPica_NIR")
|
if (imagerSelected == "mActionPica_NIR")
|
||||||
{
|
{
|
||||||
connect(m_xMotor, SIGNAL(newTCPConnection(VinceControl*)), this, SLOT(setMotorParamMicroscope(VinceControl*)));
|
connect(m_xMotor, SIGNAL(newTCPConnection(VinceControl*)), this, SLOT(setMotorParamMicroscope(VinceControl*)));
|
||||||
@ -1626,6 +1654,7 @@ void HPPA::onconnect()
|
|||||||
m_RecordThread = new QThread();
|
m_RecordThread = new QThread();
|
||||||
|
|
||||||
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>mImagerGroup
|
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>mImagerGroup
|
||||||
|
QString imagerSelected = mImagerGroup->checkedAction()->objectName();
|
||||||
if (imagerSelected == "mActionPica_L")
|
if (imagerSelected == "mActionPica_L")
|
||||||
{
|
{
|
||||||
m_Imager = new ResononPicaLImager();
|
m_Imager = new ResononPicaLImager();
|
||||||
|
Reference in New Issue
Block a user