Skip to content

Commit

Permalink
prefix and merge checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed Jan 15, 2024
1 parent f293991 commit 7385862
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 19 deletions.
6 changes: 2 additions & 4 deletions plotjuggler_app/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <functional>
#include <stdio.h>
#include <numeric>

#include <QApplication>
#include <QActionGroup>
Expand Down Expand Up @@ -42,7 +41,6 @@
#include "curvelist_panel.h"
#include "tabbedplotwidget.h"
#include "PlotJuggler/plotdata.h"
#include "qwt_plot_canvas.h"
#include "transforms/function_editor.h"
#include "transforms/lua_custom_function.h"
#include "utils.h"
Expand Down Expand Up @@ -1369,7 +1367,7 @@ bool MainWindow::loadDataFromFiles(QStringList filenames)
filenames.sort();
std::map<QString, QString> filename_prefix;

if (filenames.size() > 1)
if (filenames.size() > 1 || ui->checkBoxAddPrefixAndMerge->isChecked())
{
DialogMultifilePrefix dialog(filenames, this);
int ret = dialog.exec();
Expand Down Expand Up @@ -1409,7 +1407,7 @@ bool MainWindow::loadDataFromFiles(QStringList filenames)
{
data_replaced_entirely = true;
}
else
else if(!ui->checkBoxAddPrefixAndMerge->isChecked())
{
QMessageBox::StandardButton reply;
reply = QMessageBox::question(
Expand Down
46 changes: 33 additions & 13 deletions plotjuggler_app/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>822</width>
<width>825</width>
<height>720</height>
</rect>
</property>
Expand Down Expand Up @@ -147,7 +147,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
Expand Down Expand Up @@ -275,6 +274,29 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxAddPrefixAndMerge">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Useful when comparing 2 or more files containing the same timeseries.&lt;br/&gt;&lt;br/&gt;You will be asked to add a prefix to the name of the timeseries, and you will &lt;span style=&quot; font-weight:700;&quot;&gt;not&lt;/span&gt; remove previously loaded data.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Add prefix and merge</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="topMargin">
Expand Down Expand Up @@ -481,7 +503,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
Expand Down Expand Up @@ -892,7 +913,6 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
Expand Down Expand Up @@ -1161,7 +1181,7 @@
<string>tt</string>
</property>
<property name="icon">
<iconset>
<iconset resource="resource.qrc">
<normaloff>:/style_light/line_tracker_1.png</normaloff>:/style_light/line_tracker_1.png</iconset>
</property>
<property name="iconSize">
Expand Down Expand Up @@ -1376,7 +1396,7 @@
<string/>
</property>
<property name="icon">
<iconset>
<iconset resource="resource.qrc">
<normaloff>:/resources/svg/t0.svg</normaloff>:/resources/svg/t0.svg</iconset>
</property>
<property name="iconSize">
Expand Down Expand Up @@ -1426,7 +1446,7 @@
<string/>
</property>
<property name="icon">
<iconset>
<iconset resource="resource.qrc">
<normaloff>:/resources/svg/ratio.svg</normaloff>:/resources/svg/ratio.svg</iconset>
</property>
<property name="iconSize">
Expand Down Expand Up @@ -1702,7 +1722,6 @@
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
Expand Down Expand Up @@ -1752,7 +1771,6 @@
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
Expand Down Expand Up @@ -1811,7 +1829,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>822</width>
<width>825</width>
<height>26</height>
</rect>
</property>
Expand Down Expand Up @@ -1887,7 +1905,7 @@
</action>
<action name="actionReportBug">
<property name="icon">
<iconset>
<iconset resource="resource.qrc">
<normaloff>:/resources/github.png</normaloff>:/resources/github.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -1948,7 +1966,7 @@
</action>
<action name="actionShare_the_love">
<property name="icon">
<iconset>
<iconset resource="resource.qrc">
<normaloff>:/resources/twitter.png</normaloff>:/resources/twitter.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -1979,6 +1997,8 @@
<header location="global">menubar.h</header>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="resource.qrc"/>
</resources>
<connections/>
</ui>
4 changes: 2 additions & 2 deletions plotjuggler_app/multifile_prefix.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Add prefix</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Multiple files are being loaded. A &lt;span style=&quot; font-weight:600;&quot;&gt;prefix&lt;/span&gt; will be added.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Specify a prefix to be added to the loaded timeseries:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
Expand Down

0 comments on commit 7385862

Please sign in to comment.