diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b99703..32e8590 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ if (INSTALL_Q3DMASC_PLUGIN) project( Q3DMASC_PLUGIN ) AddPlugin( NAME ${PROJECT_NAME} ) - set(Q3DMASC_PLUGIN_VERSION "0.3+") + set(Q3DMASC_PLUGIN_VERSION "0.4") include( CMakePolicies NO_POLICY_SCOPE ) diff --git a/q3DMASC.cpp b/q3DMASC.cpp index 88f201d..4d7359f 100644 --- a/q3DMASC.cpp +++ b/q3DMASC.cpp @@ -697,16 +697,18 @@ void q3DMASCPlugin::doTrainAction() QString tracePath = trainDlg.getTracePath(); if (!tracePath.isEmpty()) { - QString outputFilename = tracePath + "/run_" + QString::number(trainDlg.getRun()) + ".txt"; - if (masc::Tools::SaveClassifier(outputFilename, features, mainCloudLabel, classifier, m_app->getMainWindow())) + QString outputFilePath = tracePath + "/run_" + QString::number(trainDlg.getRun()) + ".txt"; + if (masc::Tools::SaveClassifier(outputFilePath, features, mainCloudLabel, classifier, m_app->getMainWindow())) { - m_app->dispToConsole("Classifier succesfully saved to " + outputFilename, ccMainAppInterface::STD_CONSOLE_MESSAGE); + m_app->dispToConsole("Classifier succesfully saved to " + outputFilePath, ccMainAppInterface::STD_CONSOLE_MESSAGE); trainDlg.setClassifierSaved(); } else { m_app->dispToConsole("Failed to save classifier file"); } + QString exportFilePath = tracePath + "/run_" + QString::number(trainDlg.getRun()) + ".csv"; + } } } @@ -719,6 +721,8 @@ void q3DMASCPlugin::doTrainAction() { saveTrainParameters(s_params); //the dialog can be closed + if (trainDlg.keepAttributesCheckBox->isChecked()) + s_keepAttributes = true; generatedScalarFields.releaseSFs(s_keepAttributes); generatedScalarFieldsTest.releaseSFs(s_keepAttributes); return; diff --git a/qTrain3DMASCDialog.cpp b/qTrain3DMASCDialog.cpp index 1a424e9..6194117 100644 --- a/qTrain3DMASCDialog.cpp +++ b/qTrain3DMASCDialog.cpp @@ -47,7 +47,8 @@ Train3DMASCDialog::Train3DMASCDialog(QWidget* parent/*=nullptr*/) setupUi(this); QDateTime dateTime = QDateTime::currentDateTime(); - m_baseName = "3dmasc_" + dateTime.toString("yyyyMMdd") + "_" + dateTime.toString("hh") + "h" + dateTime.toString("mm"); + m_baseName = "3dmasc_" + dateTime.toString("yyyyMMdd_hh") + + "h" + dateTime.toString("mm"); readSettings(); @@ -199,7 +200,7 @@ void Train3DMASCDialog::onSave() accept(); } -void Train3DMASCDialog::onExportResults() +void Train3DMASCDialog::onExportResults(QString filePath/*=""*/) { QSettings settings; settings.beginGroup("3DMASC"); @@ -266,6 +267,11 @@ bool Train3DMASCDialog::openTraceFile() m_tracePath = parameterDir.absolutePath() + "/" + m_baseName; traceFileName = m_baseName + ".txt"; + if (parameterDir.exists(m_baseName)) + { + QDateTime dateTime = QDateTime::currentDateTime(); + m_baseName += "min" + dateTime.toString("ss") + "s"; + } if (!parameterDir.mkdir(m_baseName)) // create a specific directory to store the traces { ccLog::Error("impossible to save in the default directory: " + m_tracePath); diff --git a/qTrain3DMASCDialog.h b/qTrain3DMASCDialog.h index 92b3948..21a171b 100644 --- a/qTrain3DMASCDialog.h +++ b/qTrain3DMASCDialog.h @@ -73,7 +73,7 @@ protected slots: void onClose(); void onSave(); - void onExportResults(); + void onExportResults(QString filePath = ""); protected: //members