添加仿真命令文件
This commit is contained in:
parent
209d3efe02
commit
bfd45c3a4a
@ -1762,21 +1762,32 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.ui" line="63"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.ui" line="94"/>
|
||||
<source>...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.ui" line="74"/>
|
||||
<source>commond Path</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.ui" line="87"/>
|
||||
<source>select commond file path</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.ui" line="105"/>
|
||||
<source>describe</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.ui" line="101"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.ui" line="132"/>
|
||||
<source>Sure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.ui" line="108"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.ui" line="139"/>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1786,49 +1797,54 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="51"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="57"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="67"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="74"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="83"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="89"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="52"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="58"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="68"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="75"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="84"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="90"/>
|
||||
<source>warning</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="51"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="52"/>
|
||||
<source>name or save path is empty, please check it</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="57"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="58"/>
|
||||
<source>save current workspace?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="67"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="68"/>
|
||||
<source>current path is contains current folder, do you want to overwrite it?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="74"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="75"/>
|
||||
<source>removeRecursively failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="83"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="84"/>
|
||||
<source>mkpath failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="89"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="90"/>
|
||||
<source>name is exits</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="104"/>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="106"/>
|
||||
<source>save spaceWork directory</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/WorkSpace/WorkSpaceDlg.cpp" line="119"/>
|
||||
<source>select commond file directory</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@ -33,6 +33,7 @@ void WorkSpaceDlg::InitConnect() {
|
||||
connect(ui->pbSure, &QPushButton::clicked, this, &WorkSpaceDlg::OnSure);
|
||||
connect(ui->pbCancel, &QPushButton::clicked, this, &WorkSpaceDlg::reject);
|
||||
connect(ui->tbPath, &QPushButton::clicked, this, &WorkSpaceDlg::OnSelectSavePath);
|
||||
connect(ui->tbCommondPath, &QPushButton::clicked, this, &WorkSpaceDlg::OnSelectCommondPath);
|
||||
connect(ui->leName, &QLineEdit::textChanged, [this](const QString& txt) {
|
||||
QString path = QString("%1/%2").arg(path_).arg(txt);
|
||||
ui->lePath->setText(path);
|
||||
@ -93,6 +94,7 @@ void WorkSpaceDlg::OnSure() {
|
||||
workspacePath += QString("/%1.dyt").arg(name);
|
||||
WorkSpace* workSpace = WorkSpaceManager::Get().GetOrCreate(workspacePath, name);
|
||||
workSpace->SetDescribe(ui->etDescribe->toPlainText());
|
||||
workSpace->SetCommondFilePath(commondPath_);
|
||||
|
||||
WorkSpaceManager::Get().SetCurrent(workSpace);
|
||||
accept();
|
||||
@ -110,6 +112,19 @@ void WorkSpaceDlg::OnSelectSavePath() {
|
||||
ui->lePath->setText(QString("%1/%2").arg(path_).arg(ui->leName->text()));
|
||||
LOG_INFO("save path: {}", path_.toLocal8Bit().constData());
|
||||
}
|
||||
|
||||
void WorkSpaceDlg::OnSelectCommondPath() {
|
||||
const QString workspacePath = Application::GetWorkSpacePath();
|
||||
const QString savePath = QFileDialog::getExistingDirectory(this,
|
||||
tr("select commond file directory"), workspacePath, QFileDialog::DontResolveSymlinks);
|
||||
if (savePath.isEmpty()) {
|
||||
LOG_WARN("save commond file is empty");
|
||||
return;
|
||||
}
|
||||
commondPath_ = savePath;
|
||||
ui->leCommondPath->setText(QString("%1").arg(commondPath_));
|
||||
LOG_INFO("select path: {}", commondPath_.toLocal8Bit().constData());
|
||||
}
|
||||
//
|
||||
//void WorkSpaceDlg::InitFrame() {
|
||||
// FrameTitleBar* titleBar = new FrameTitleBar(this);
|
||||
|
||||
@ -18,10 +18,12 @@ protected:
|
||||
|
||||
void OnSure();
|
||||
void OnSelectSavePath();
|
||||
void OnSelectCommondPath();
|
||||
|
||||
//void InitFrame();
|
||||
|
||||
private:
|
||||
Ui::WorkSpaceDlg* ui;
|
||||
QString path_;
|
||||
QString commondPath_;
|
||||
};
|
||||
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>345</width>
|
||||
<height>243</height>
|
||||
<width>528</width>
|
||||
<height>418</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -66,6 +66,37 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>commond Path</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="leCommondPath">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>select commond file path</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="tbCommondPath">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
@ -113,8 +144,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../Hydro.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@ -39,6 +39,22 @@ const QString WorkSpace::GetDir() const {
|
||||
return info.absolutePath();
|
||||
}
|
||||
|
||||
void WorkSpace::SetCommondFilePath(const QString& path) {
|
||||
QFileInfo fileInfo(path);
|
||||
QString dirPath = QString("%1/%2").arg(GetDir(), fileInfo.fileName());
|
||||
bool sucess = FileUtils::CopyFileToPath(path, dirPath, true);
|
||||
LOG_INFO("copy commond file {}: {} to {}",
|
||||
path.toLocal8Bit().data(),
|
||||
dirPath.toLocal8Bit().data(),
|
||||
sucess);
|
||||
commondPath_ = fileInfo.fileName();
|
||||
}
|
||||
|
||||
const QString WorkSpace::GetCommondFilePath() const {
|
||||
QString path = QString("%1/%2").arg(GetDir(), commondPath_);
|
||||
return path;
|
||||
}
|
||||
|
||||
void WorkSpace::SetSimMatlab(const QString& path) {
|
||||
QFileInfo fileInfo(path);
|
||||
QString dirPath = QString("%1/%2").arg(GetDir(), fileInfo.fileName());
|
||||
|
||||
@ -46,6 +46,10 @@ public:
|
||||
inline const QString& GetDescribe() const {
|
||||
return describe_;
|
||||
}
|
||||
|
||||
void SetCommondFilePath(const QString& path);
|
||||
const QString GetCommondFilePath() const;
|
||||
|
||||
void SetSimMatlab(const QString& path);
|
||||
const QString GetSimMatlab() const;
|
||||
|
||||
@ -134,6 +138,7 @@ private:
|
||||
QString uuid_;
|
||||
QString describe_;
|
||||
QString path_;
|
||||
QString commondPath_;
|
||||
QString simMatlabPath_;
|
||||
|
||||
QString waveFile_;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user