mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
OP-1763 Added import functionality to the template dialog.
Added new tab and gui with template selector widget to the export template dialog. Renamed dialog menu to export/import vehicle wizard settings. Added code to upload and save template data to board.
This commit is contained in:
parent
2b0d357df3
commit
8eedfcec49
@ -48,6 +48,7 @@ AirframeInitialTuningPage::~AirframeInitialTuningPage()
|
|||||||
void AirframeInitialTuningPage::initializePage()
|
void AirframeInitialTuningPage::initializePage()
|
||||||
{
|
{
|
||||||
const char *path;
|
const char *path;
|
||||||
|
|
||||||
switch (getWizard()->getVehicleType()) {
|
switch (getWizard()->getVehicleType()) {
|
||||||
case VehicleConfigurationSource::VEHICLE_FIXEDWING:
|
case VehicleConfigurationSource::VEHICLE_FIXEDWING:
|
||||||
path = VehicleTemplateExportDialog::EXPORT_FIXEDWING_NAME;
|
path = VehicleTemplateExportDialog::EXPORT_FIXEDWING_NAME;
|
||||||
|
@ -59,7 +59,7 @@ bool SetupWizardPlugin::initialize(const QStringList & args, QString *errMsg)
|
|||||||
QList<int>() <<
|
QList<int>() <<
|
||||||
Core::Constants::C_GLOBAL_ID);
|
Core::Constants::C_GLOBAL_ID);
|
||||||
cmd->setDefaultKeySequence(QKeySequence("Ctrl+V"));
|
cmd->setDefaultKeySequence(QKeySequence("Ctrl+V"));
|
||||||
cmd->action()->setText(tr("Vehicle Setup Wizard"));
|
cmd->action()->setText(tr("Vehicle Setup Wizard..."));
|
||||||
connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(showSetupWizard()));
|
connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(showSetupWizard()));
|
||||||
|
|
||||||
Core::ModeManager::instance()->addAction(cmd, 1);
|
Core::ModeManager::instance()->addAction(cmd, 1);
|
||||||
@ -71,7 +71,7 @@ bool SetupWizardPlugin::initialize(const QStringList & args, QString *errMsg)
|
|||||||
"SetupWizardPlugin.ExportJSon",
|
"SetupWizardPlugin.ExportJSon",
|
||||||
QList<int>() <<
|
QList<int>() <<
|
||||||
Core::Constants::C_GLOBAL_ID);
|
Core::Constants::C_GLOBAL_ID);
|
||||||
cmd->action()->setText(tr("Export Wizard Vehicle Template"));
|
cmd->action()->setText(tr("Export/Import Wizard Vehicle Template..."));
|
||||||
connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(exportSettings()));
|
connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(exportSettings()));
|
||||||
|
|
||||||
Core::ModeManager::instance()->addAction(cmd, 1);
|
Core::ModeManager::instance()->addAction(cmd, 1);
|
||||||
|
@ -37,12 +37,15 @@
|
|||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <uavobjecthelper.h>
|
||||||
|
#include <objectpersistence.h>
|
||||||
#include "stabilizationsettings.h"
|
#include "stabilizationsettings.h"
|
||||||
#include "stabilizationsettingsbank1.h"
|
#include "stabilizationsettingsbank1.h"
|
||||||
#include "stabilizationsettingsbank2.h"
|
#include "stabilizationsettingsbank2.h"
|
||||||
#include "stabilizationsettingsbank3.h"
|
#include "stabilizationsettingsbank3.h"
|
||||||
#include "mixersettings.h"
|
#include "mixersettings.h"
|
||||||
#include "ekfconfiguration.h"
|
#include "ekfconfiguration.h"
|
||||||
|
#include <uavtalk/telemetrymanager.h>
|
||||||
|
|
||||||
const char *VehicleTemplateExportDialog::EXPORT_BASE_NAME = "../share/openpilotgcs/cloudconfig";
|
const char *VehicleTemplateExportDialog::EXPORT_BASE_NAME = "../share/openpilotgcs/cloudconfig";
|
||||||
const char *VehicleTemplateExportDialog::EXPORT_FIXEDWING_NAME = "fixedwing";
|
const char *VehicleTemplateExportDialog::EXPORT_FIXEDWING_NAME = "fixedwing";
|
||||||
@ -61,12 +64,24 @@ VehicleTemplateExportDialog::VehicleTemplateExportDialog(QWidget *parent) :
|
|||||||
m_uavoManager = pm->getObject<UAVObjectManager>();
|
m_uavoManager = pm->getObject<UAVObjectManager>();
|
||||||
ui->Photo->setScene(new QGraphicsScene(this));
|
ui->Photo->setScene(new QGraphicsScene(this));
|
||||||
ui->Type->setText(setupVehicleType());
|
ui->Type->setText(setupVehicleType());
|
||||||
|
ui->selectionWidget->setTemplateInfo(m_dir, m_type, m_subType);
|
||||||
|
|
||||||
connect(ui->Name, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
connect(ui->Name, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
||||||
connect(ui->Owner, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
connect(ui->Owner, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
||||||
connect(ui->ForumNick, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
connect(ui->ForumNick, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
||||||
connect(ui->Size, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
connect(ui->Size, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
||||||
connect(ui->Weight, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
connect(ui->Weight, SIGNAL(textChanged(QString)), this, SLOT(updateStatus()));
|
||||||
|
|
||||||
|
connect(ui->exportBtn, SIGNAL(clicked()), this, SLOT(exportTemplate()));
|
||||||
|
connect(ui->importBtn, SIGNAL(clicked()), this, SLOT(importTemplate()));
|
||||||
|
connect(ui->cancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
|
connect(ui->cancelBtn_2, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
|
|
||||||
|
TelemetryManager *telemManager = pm->getObject<TelemetryManager>();
|
||||||
|
ui->importBtn->setEnabled(telemManager->isConnected());
|
||||||
|
|
||||||
|
connect(telemManager, SIGNAL(connected()), this, SLOT(onAutoPilotConnect()));
|
||||||
|
connect(telemManager, SIGNAL(disconnected()), this, SLOT(onAutoPilotDisconnect()));
|
||||||
}
|
}
|
||||||
|
|
||||||
VehicleTemplateExportDialog::~VehicleTemplateExportDialog()
|
VehicleTemplateExportDialog::~VehicleTemplateExportDialog()
|
||||||
@ -85,85 +100,102 @@ QString VehicleTemplateExportDialog::setupVehicleType()
|
|||||||
case SystemSettings::AIRFRAMETYPE_FIXEDWING:
|
case SystemSettings::AIRFRAMETYPE_FIXEDWING:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_FIXEDWING;
|
m_type = VehicleConfigurationSource::VEHICLE_FIXEDWING;
|
||||||
m_subType = VehicleConfigurationSource::FIXED_WING_AILERON;
|
m_subType = VehicleConfigurationSource::FIXED_WING_AILERON;
|
||||||
|
m_dir = EXPORT_FIXEDWING_NAME;
|
||||||
return tr("Fixed Wing - Aileron");
|
return tr("Fixed Wing - Aileron");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_FIXEDWINGELEVON:
|
case SystemSettings::AIRFRAMETYPE_FIXEDWINGELEVON:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_FIXEDWING;
|
m_type = VehicleConfigurationSource::VEHICLE_FIXEDWING;
|
||||||
m_subType = VehicleConfigurationSource::FIXED_WING_ELEVON;
|
m_subType = VehicleConfigurationSource::FIXED_WING_ELEVON;
|
||||||
|
m_dir = EXPORT_FIXEDWING_NAME;
|
||||||
return tr("Fixed Wing - Elevon");
|
return tr("Fixed Wing - Elevon");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_FIXEDWINGVTAIL:
|
case SystemSettings::AIRFRAMETYPE_FIXEDWINGVTAIL:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_FIXEDWING;
|
m_type = VehicleConfigurationSource::VEHICLE_FIXEDWING;
|
||||||
m_subType = VehicleConfigurationSource::FIXED_WING_VTAIL;
|
m_subType = VehicleConfigurationSource::FIXED_WING_VTAIL;
|
||||||
|
m_dir = EXPORT_FIXEDWING_NAME;
|
||||||
return tr("Fixed Wing - V-Tail");
|
return tr("Fixed Wing - V-Tail");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_HELICP:
|
case SystemSettings::AIRFRAMETYPE_HELICP:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_HELI;
|
m_type = VehicleConfigurationSource::VEHICLE_HELI;
|
||||||
m_subType = VehicleConfigurationSource::HELI_CCPM;
|
m_subType = VehicleConfigurationSource::HELI_CCPM;
|
||||||
|
m_dir = EXPORT_HELI_NAME;
|
||||||
return tr("Helicopter");
|
return tr("Helicopter");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_TRI:
|
case SystemSettings::AIRFRAMETYPE_TRI:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_TRI_Y;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_TRI_Y;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Tricopter");
|
return tr("Multirotor - Tricopter");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_QUADX:
|
case SystemSettings::AIRFRAMETYPE_QUADX:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_QUAD_X;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_QUAD_X;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Quadrocopter X");
|
return tr("Multirotor - Quadrocopter X");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_QUADP:
|
case SystemSettings::AIRFRAMETYPE_QUADP:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Quadrocopter +");
|
return tr("Multirotor - Quadrocopter +");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_OCTOV:
|
case SystemSettings::AIRFRAMETYPE_OCTOV:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO_V;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO_V;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Octocopter V");
|
return tr("Multirotor - Octocopter V");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_OCTOCOAXX:
|
case SystemSettings::AIRFRAMETYPE_OCTOCOAXX:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Octocopter X8X");
|
return tr("Multirotor - Octocopter X8X");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_OCTOCOAXP:
|
case SystemSettings::AIRFRAMETYPE_OCTOCOAXP:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Octocopter X8+");
|
return tr("Multirotor - Octocopter X8+");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_OCTO:
|
case SystemSettings::AIRFRAMETYPE_OCTO:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Octocopter +");
|
return tr("Multirotor - Octocopter +");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_OCTOX:
|
case SystemSettings::AIRFRAMETYPE_OCTOX:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO_X;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_OCTO_X;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Octocopter X");
|
return tr("Multirotor - Octocopter X");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_HEXAX:
|
case SystemSettings::AIRFRAMETYPE_HEXAX:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_HEXA_X;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_HEXA_X;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Hexacopter X");
|
return tr("Multirotor - Hexacopter X");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_HEXAH:
|
case SystemSettings::AIRFRAMETYPE_HEXAH:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_HEXA_H;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_HEXA_H;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Hexacopter H");
|
return tr("Multirotor - Hexacopter H");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_HEXACOAX:
|
case SystemSettings::AIRFRAMETYPE_HEXACOAX:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Hexacopter Y6");
|
return tr("Multirotor - Hexacopter Y6");
|
||||||
|
|
||||||
case SystemSettings::AIRFRAMETYPE_HEXA:
|
case SystemSettings::AIRFRAMETYPE_HEXA:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
m_type = VehicleConfigurationSource::VEHICLE_MULTI;
|
||||||
m_subType = VehicleConfigurationSource::MULTI_ROTOR_HEXA;
|
m_subType = VehicleConfigurationSource::MULTI_ROTOR_HEXA;
|
||||||
|
m_dir = EXPORT_MULTI_NAME;
|
||||||
return tr("Multirotor - Hexacopter +");
|
return tr("Multirotor - Hexacopter +");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
m_type = VehicleConfigurationSource::VEHICLE_UNKNOWN;
|
m_type = VehicleConfigurationSource::VEHICLE_UNKNOWN;
|
||||||
|
m_dir = "";
|
||||||
return tr("Unsupported");
|
return tr("Unsupported");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,7 +210,7 @@ QString VehicleTemplateExportDialog::fixFilenameString(QString input, int trunca
|
|||||||
.left(truncate);
|
.left(truncate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VehicleTemplateExportDialog::accept()
|
void VehicleTemplateExportDialog::exportTemplate()
|
||||||
{
|
{
|
||||||
QJsonObject exportObject;
|
QJsonObject exportObject;
|
||||||
|
|
||||||
@ -257,6 +289,34 @@ void VehicleTemplateExportDialog::accept()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VehicleTemplateExportDialog::importTemplate()
|
||||||
|
{
|
||||||
|
QJsonObject *tmpl = ui->selectionWidget->selectedTemplate();
|
||||||
|
|
||||||
|
if (tmpl != NULL) {
|
||||||
|
QList<UAVObject *> updatedObjects;
|
||||||
|
m_uavoManager->fromJson(*tmpl, &updatedObjects);
|
||||||
|
UAVObjectUpdaterHelper helper;
|
||||||
|
foreach(UAVObject * object, updatedObjects) {
|
||||||
|
UAVDataObject *dataObj = dynamic_cast<UAVDataObject *>(object);
|
||||||
|
|
||||||
|
if (dataObj != NULL && dataObj->isKnown()) {
|
||||||
|
helper.doObjectAndWait(dataObj);
|
||||||
|
|
||||||
|
ObjectPersistence *objper = ObjectPersistence::GetInstance(m_uavoManager);
|
||||||
|
ObjectPersistence::DataFields data;
|
||||||
|
data.Operation = ObjectPersistence::OPERATION_SAVE;
|
||||||
|
data.Selection = ObjectPersistence::SELECTION_SINGLEOBJECT;
|
||||||
|
data.ObjectID = dataObj->getObjID();
|
||||||
|
data.InstanceID = dataObj->getInstID();
|
||||||
|
objper->setData(data);
|
||||||
|
|
||||||
|
helper.doObjectAndWait(objper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void VehicleTemplateExportDialog::importImage()
|
void VehicleTemplateExportDialog::importImage()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Import Image"), "", tr("Images (*.png *.jpg)"));
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Import Image"), "", tr("Images (*.png *.jpg)"));
|
||||||
@ -269,6 +329,16 @@ void VehicleTemplateExportDialog::importImage()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VehicleTemplateExportDialog::onAutoPilotConnect()
|
||||||
|
{
|
||||||
|
ui->importBtn->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void VehicleTemplateExportDialog::onAutoPilotDisconnect()
|
||||||
|
{
|
||||||
|
ui->importBtn->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
QString VehicleTemplateExportDialog::getTypeDirectory()
|
QString VehicleTemplateExportDialog::getTypeDirectory()
|
||||||
{
|
{
|
||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
@ -291,7 +361,7 @@ QString VehicleTemplateExportDialog::getTypeDirectory()
|
|||||||
|
|
||||||
void VehicleTemplateExportDialog::updateStatus()
|
void VehicleTemplateExportDialog::updateStatus()
|
||||||
{
|
{
|
||||||
ui->acceptBtn->setEnabled(ui->Name->text().length() > 3 && ui->Owner->text().length() > 2 &&
|
ui->exportBtn->setEnabled(ui->Name->text().length() > 3 && ui->Owner->text().length() > 2 &&
|
||||||
ui->ForumNick->text().length() > 2 && ui->Size->text().length() > 0 &&
|
ui->ForumNick->text().length() > 2 && ui->Size->text().length() > 0 &&
|
||||||
ui->Weight->text().length() > 0);
|
ui->Weight->text().length() > 0);
|
||||||
}
|
}
|
||||||
|
@ -51,11 +51,14 @@ public:
|
|||||||
~VehicleTemplateExportDialog();
|
~VehicleTemplateExportDialog();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void accept();
|
void exportTemplate();
|
||||||
|
void importTemplate();
|
||||||
void updateStatus();
|
void updateStatus();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void importImage();
|
void importImage();
|
||||||
|
void onAutoPilotConnect();
|
||||||
|
void onAutoPilotDisconnect();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int IMAGE_SCALE_WIDTH = 500;
|
static const int IMAGE_SCALE_WIDTH = 500;
|
||||||
@ -64,6 +67,7 @@ private:
|
|||||||
UAVObjectManager *m_uavoManager;
|
UAVObjectManager *m_uavoManager;
|
||||||
VehicleConfigurationSource::VEHICLE_TYPE m_type;
|
VehicleConfigurationSource::VEHICLE_TYPE m_type;
|
||||||
VehicleConfigurationSource::VEHICLE_SUB_TYPE m_subType;
|
VehicleConfigurationSource::VEHICLE_SUB_TYPE m_subType;
|
||||||
|
const char *m_dir;
|
||||||
QPixmap m_image;
|
QPixmap m_image;
|
||||||
|
|
||||||
QString fixFilenameString(QString input, int truncate = 100);
|
QString fixFilenameString(QString input, int truncate = 100);
|
||||||
|
@ -36,26 +36,15 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame_2">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="frameShape">
|
<property name="currentIndex">
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QWidget" name="tab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Export template</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame">
|
<widget class="QFrame" name="frame">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -297,9 +286,6 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame_6">
|
<widget class="QFrame" name="frame_6">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
@ -526,7 +512,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="acceptBtn">
|
<widget class="QPushButton" name="exportBtn">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -540,6 +526,113 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="tab_2">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Import template</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="VehicleTemplateSelectorWidget" name="selectionWidget" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_8">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="cancelBtn_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Close</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="importBtn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Import</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_2">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>VehicleTemplateSelectorWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>vehicletemplateselectorwidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>Type</tabstop>
|
<tabstop>Type</tabstop>
|
||||||
<tabstop>Name</tabstop>
|
<tabstop>Name</tabstop>
|
||||||
@ -555,7 +648,7 @@
|
|||||||
<tabstop>Controllers</tabstop>
|
<tabstop>Controllers</tabstop>
|
||||||
<tabstop>Comment</tabstop>
|
<tabstop>Comment</tabstop>
|
||||||
<tabstop>ImportButton</tabstop>
|
<tabstop>ImportButton</tabstop>
|
||||||
<tabstop>acceptBtn</tabstop>
|
<tabstop>exportBtn</tabstop>
|
||||||
<tabstop>cancelBtn</tabstop>
|
<tabstop>cancelBtn</tabstop>
|
||||||
<tabstop>Photo</tabstop>
|
<tabstop>Photo</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
@ -578,7 +671,7 @@
|
|||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>acceptBtn</sender>
|
<sender>exportBtn</sender>
|
||||||
<signal>clicked()</signal>
|
<signal>clicked()</signal>
|
||||||
<receiver>VehicleTemplateExportDialog</receiver>
|
<receiver>VehicleTemplateExportDialog</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
|
@ -54,7 +54,8 @@ VehicleTemplateSelectorWidget::~VehicleTemplateSelectorWidget()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VehicleTemplateSelectorWidget::setTemplateInfo(QString path, int vehicleType, int vehicleSubType) {
|
void VehicleTemplateSelectorWidget::setTemplateInfo(QString path, int vehicleType, int vehicleSubType)
|
||||||
|
{
|
||||||
m_templateFolder = path;
|
m_templateFolder = path;
|
||||||
m_vehicleType = vehicleType;
|
m_vehicleType = vehicleType;
|
||||||
m_vehicleSubType = vehicleSubType;
|
m_vehicleSubType = vehicleSubType;
|
||||||
|
@ -36,8 +36,7 @@ namespace Ui {
|
|||||||
class VehicleTemplateSelectorWidget;
|
class VehicleTemplateSelectorWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class VehicleTemplateSelectorWidget : public QWidget
|
class VehicleTemplateSelectorWidget : public QWidget {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user