Skip to content

Commit

Permalink
Merge branch 'facontidavide:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpollo authored Nov 12, 2024
2 parents 5f77b1a + 238b203 commit 9a2ada0
Show file tree
Hide file tree
Showing 10 changed files with 311 additions and 47 deletions.
12 changes: 5 additions & 7 deletions 3rdparty/data_tamer_parser/data_tamer_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
#include <array>
#include <cstdint>
#include <cstring>
#include <iostream>
#include <functional>
#include <limits>
#include <map>
#include <optional>
#include <sstream>
#include <string>
#include <unordered_map>
#include <variant>
#include <vector>

Expand Down Expand Up @@ -219,11 +216,11 @@ bool TypeField::operator==(const TypeField& other) const
inline Schema BuilSchemaFromText(const std::string& txt)
{
auto trimString = [](std::string& str) {
while (str.back() == ' ' || str.back() == '\r')
while (!str.empty() && (str.back() == ' ' || str.back() == '\r'))
{
str.pop_back();
}
while (str.front() == ' ' || str.front() == '\r')
while (!str.empty() && (str.front() == ' ' || str.front() == '\r'))
{
str.erase(0, 1);
}
Expand Down Expand Up @@ -284,7 +281,7 @@ inline Schema BuilSchemaFromText(const std::string& txt)
if (str_left == "### hash:" || str_left == "__hash__:")
{
// check compatibility
declared_schema = std::stoul(str_right);
declared_schema = std::stoull(str_right);
continue;
}

Expand Down Expand Up @@ -355,7 +352,8 @@ inline Schema BuilSchemaFromText(const std::string& txt)
}
if (declared_schema != 0 && declared_schema != schema.hash)
{
throw std::runtime_error("Error in hash calculation");
// check temporary disabled. Requires more investigations
// throw std::runtime_error("Error in hash calculation");
}
return schema;
}
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
cmake_minimum_required(VERSION 3.10.2)

PROJECT(plotjuggler LANGUAGES C CXX VERSION 3.9.2)
PROJECT(plotjuggler LANGUAGES C CXX VERSION 3.9.3)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")


add_definitions(
-DPJ_MAJOR_VERSION=${PROJECT_VERSION_MAJOR}
-DPJ_MINOR_VERSION=${PROJECT_VERSION_MINOR}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ sudo snap install plotjuggler-ros
This installer does __not__ include ROS plugins.

**Windows Installer**:
[PlotJuggler-Windows-3.9.0-installer](https://github.com/facontidavide/PlotJuggler/releases/download/3.9.0/PlotJuggler-Windows-3.9.0-installer.exe)
[PlotJuggler-Windows-3.9.3-installer](https://github.com/facontidavide/PlotJuggler/releases/download/3.9.3/PlotJuggler-Windows-3.9.3-installer.exe)

### Debian packages for ROS User

Expand Down
2 changes: 1 addition & 1 deletion installer/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>PlotJuggler</Name>
<Version>3.9.0</Version>
<Version>3.9.3</Version>
<Title>PlotJuggler installer</Title>
<Publisher>Davide Faconti</Publisher>
<StartMenuDir>PlotJuggler</StartMenuDir>
Expand Down
59 changes: 44 additions & 15 deletions installer/io.plotjuggler.application/meta/installscript.qs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
**
****************************************************************************/

var targetDirectoryPage = null;

function Component()
{
// constructor
component.loaded.connect(this, Component.prototype.loaded);
if (!installer.addWizardPage(component, "Page", QInstaller.TargetDirectory))
console.log("Could not add the dynamic page.");
installer.gainAdminRights();
component.loaded.connect(this, this.installerLoaded);
}

Component.prototype.isDefault = function()
Expand All @@ -56,20 +56,49 @@ Component.prototype.createOperations = function()
}
}

Component.prototype.loaded = function ()

// https://stackoverflow.com/a/46614107

Component.prototype.installerLoaded = function()
{
var page = gui.pageByObjectName("DynamicPage");
if (page != null) {
console.log("Connecting the dynamic page entered signal.");
page.entered.connect(Component.prototype.dynamicPageEntered);
}
installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
installer.addWizardPage(component, "TargetWidget", QInstaller.TargetDirectory);

targetDirectoryPage = gui.pageWidgetByObjectName("DynamicTargetWidget");
targetDirectoryPage.windowTitle = "Choose Installation Directory";
targetDirectoryPage.description.setText("Please select where PlotJuggler will be installed:");
targetDirectoryPage.targetDirectory.textChanged.connect(this, this.targetDirectoryChanged);
targetDirectoryPage.targetDirectory.setText(installer.value("TargetDir"));
targetDirectoryPage.targetChooser.released.connect(this, this.targetChooserClicked);

gui.pageById(QInstaller.ComponentSelection).entered.connect(this, this.componentSelectionPageEntered);
}

Component.prototype.targetChooserClicked = function()
{
var dir = QFileDialog.getExistingDirectory("", targetDirectoryPage.targetDirectory.text);
targetDirectoryPage.targetDirectory.setText(dir);
}

Component.prototype.dynamicPageEntered = function ()
Component.prototype.targetDirectoryChanged = function()
{
var pageWidget = gui.pageWidgetByObjectName("DynamicPage");
if (pageWidget != null) {
console.log("Setting the widgets label text.")
pageWidget.m_pageLabel.text = "This is a dynamically created page.";
var dir = targetDirectoryPage.targetDirectory.text;
if (installer.fileExists(dir) && installer.fileExists(dir + "/maintenancetool.exe")) {
targetDirectoryPage.warning.setText("<p style=\"color: red\">Existing installation detected and will be overwritten.</p>");
}
else if (installer.fileExists(dir)) {
targetDirectoryPage.warning.setText("<p style=\"color: red\">Installing in existing directory. It will be wiped on uninstallation.</p>");
}
else {
targetDirectoryPage.warning.setText("");
}
installer.setValue("TargetDir", dir);
}

Component.prototype.componentSelectionPageEntered = function()
{
var dir = installer.value("TargetDir");
if (installer.fileExists(dir) && installer.fileExists(dir + "/maintenancetool.exe")) {
installer.execute(dir + "/maintenancetool.exe", ["purge", "-c"]);
}
}
7 changes: 5 additions & 2 deletions installer/io.plotjuggler.application/meta/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
<Package>
<DisplayName>PlotJuggler Main App</DisplayName>
<Description>Install PlotJuggler with basic plugins.</Description>
<Version>3.9.0</Version>
<ReleaseDate>2024-02-04</ReleaseDate>
<Version>3.9.3</Version>
<ReleaseDate>2024-11-10</ReleaseDate>
<Licenses>
<License name="MPL-2.0" file="license_mpl.txt" />
<License name="LGPL" file="license_lgpl.txt" />
</Licenses>
<Default>script</Default>
<Script>installscript.qs</Script>
<UserInterfaces>
<UserInterface>targetwidget.ui</UserInterface>
</UserInterfaces>
</Package>
113 changes: 113 additions & 0 deletions installer/io.plotjuggler.application/meta/targetwidget.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TargetWidget</class>
<widget class="QWidget" name="TargetWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>491</width>
<height>190</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>491</width>
<height>190</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="description">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="targetDirectory">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="targetChooser">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="warning">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>122</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Loading

0 comments on commit 9a2ada0

Please sign in to comment.