Skip to content

Commit 2d9d095

Browse files
committed
Merge remote-tracking branch 'upstream/master' into me/fix_memleak
2 parents 60c4aed + 6f9404f commit 2d9d095

File tree

297 files changed

+1863
-275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+1863
-275
lines changed

.github/workflows/installer.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,26 +132,22 @@ jobs:
132132
run: |
133133
PATH="" $SHELL -c 'for i in "$GITHUB_WORKSPACE"/tests/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".js --generate-mode javascript --close \
134134
-s 5 --script-path "$i".js -m script "$i"; done'
135-
if: ${{ !startsWith(inputs.os, 'macos') }}
136135
timeout-minutes: 15
137136

138137
- name: Run minimal Python interpeter tests in direct script mode
139138
run: |
140139
PATH="" $SHELL -c 'for i in "$GITHUB_WORKSPACE"/tests/*.qrs; do "$TWOD_EXEC_NAME" --generate-path "$i".py \
141140
--close -s 5 --script-path "$i".py -m script "$i"; done'
142-
if: ${{ !startsWith(inputs.os, 'macos') }}
143141
timeout-minutes: 15
144142

145143
- name: Run minimal Javascript interpeter tests as fields in .qrs (For backward compatibility)
146144
run: |
147145
PATH="" $SHELL -c 'for i in "$GITHUB_WORKSPACE"/tests/*.qrs; do "$PATCHER_NAME" -s "$i".js "$i" \
148146
&& "$TWOD_EXEC_NAME" --close -s 5 -m script "$i"; done'
149-
if: ${{ !startsWith(inputs.os, 'macos') }}
150147
timeout-minutes: 5
151148

152149
- name: Run minimal Python interpeter tests as fields in .qrs (For backward compatibility)
153150
run: |
154151
PATH="" $SHELL -c 'for i in "$GITHUB_WORKSPACE"/tests/*.qrs; do "$PATCHER_NAME" -s "$i".py "$i" \
155152
&& "$TWOD_EXEC_NAME" --close -s 5 -m script "$i"; done'
156-
if: ${{ !startsWith(inputs.os, 'macos') }}
157153
timeout-minutes: 5

buildScripts/github/build_installer.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ set -euxo pipefail
33
BRANCH_NAME="${BRANCH_NAME:-${GITHUB_REF#refs/*/}}"
44
BRANCH_NAME=${BRANCH_NAME//\//-}
55

6-
QTBIN=${QTBIN:-$($EXECUTOR bash -c 'eval $(make qmake -n | cut -f 1 -d " ") -query QT_INSTALL_BINS')}
7-
case $RUNNER_OS in
6+
QTBIN="${QTBIN:-$($EXECUTOR bash -c 'eval $(make qmake -n | cut -f 1 -d " ") -query QT_INSTALL_BINS')}"
7+
case "$RUNNER_OS" in
88
macOS)
9-
QTIFWBIN=$HOME/qtifw/bin
9+
QTIFWBIN="$HOME"/qtifw/bin
1010
TSNAME="trik-studio-installer-mac-$BRANCH_NAME.dmg"
1111
;;
1212
Linux)
@@ -19,23 +19,23 @@ df -h .
1919

2020
NEED_DEPLOY=$([[ "$GITHUB_REPOSITORY" == "trikset/trik-studio" && "${PULLREQUESTNUMBER:-false}" == "false" ]] && echo true || echo false )
2121

22-
if $NEED_DEPLOY ; then
22+
if "$NEED_DEPLOY" ; then
2323
$EXECUTOR bash -c "mkdir -p $HOME/.ssh && install -m 600 /dev/null $HOME/.ssh/id_rsa && echo \"$ssh_key\" > $HOME/.ssh/id_rsa"
2424
fi
2525

26-
if [[ $RUNNER_OS == Linux ]] ; then
26+
if [[ "$RUNNER_OS" == Linux ]] ; then
2727
echo Start build checker archive
2828
$EXECUTOR bash -c "bin/build-checker-installer.sh"
29-
if $NEED_DEPLOY ; then
29+
if "$NEED_DEPLOY" ; then
3030
$EXECUTOR bash -c "rsync -v --rsh='ssh -o StrictHostKeyChecking=no -vvv -i $HOME/.ssh/id_rsa' bin/trik_checker.tar.xz $username@$host:~/dl/ts/fresh/checker/checker-linux-$CONFIG-$BRANCH_NAME.tar.xz"
3131
fi
3232
fi
3333

3434
echo Start build installer
3535
$EXECUTOR bash -c "installer/build-trik-studio.sh $QTBIN $QTIFWBIN ."
3636

37-
INSTALLER_NAME=$(find installer -name "trik-studio*installer*" -print -quit)
37+
INSTALLER_NAME=$(find installer -name "trik-studio*installer*" -print -quit | grep . )
3838

39-
if $NEED_DEPLOY ; then
39+
if "$NEED_DEPLOY" ; then
4040
$EXECUTOR bash -c "rsync -v --rsh='ssh -o StrictHostKeyChecking=no -vvv -i $HOME/.ssh/id_rsa' $INSTALLER_NAME $username@$host:~/dl/ts/fresh/installer/$TSNAME"
4141
fi

buildScripts/github/install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22
set -euxo pipefail
3+
BUILD_INSTALLER=${BUILD_INSTALLER:-true}
4+
TRIK_QT_VERSION=${TRIK_QT_VERSION:-5.15}
5+
XCODE_VERSION=${XCODE_VERSION:-14.3} # 14.3 on GHA worker is compatible with Qt5.15
6+
TRIK_PYTHON3_VERSION_MINOR=${TRIK_PYTHON3_VERSION_MINOR:-11}
7+
8+
39
TRIK_PYTHON=python3.${TRIK_PYTHON3_VERSION_MINOR}
410

511
install_qt(){

installer/build-installer.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,19 @@ find $PWD/packages/$PRODUCT -name prebuild-$OS.sh | bash -xe
8181
find . -type d -empty -delete
8282

8383
#echo "Building online installer..."
84-
#$QTIFW_DIR/binarycreator --online-only -c config/$PRODUCT-$OS_EXT.xml -p packages/qreal-base -p packages/$PRODUCT ${*:4} $PRODUCT-online-$OS_EXT-installer
84+
#$QTIFW_DIR/binarycreator --verbose --online-only -c config/$PRODUCT-$OS_EXT.xml -p packages/qreal-base -p packages/$PRODUCT ${*:4} $PRODUCT-online-$OS_EXT-installer
8585

8686
echo "Building offline installer..."
8787
case $(uname -s || echo None) in
8888
Linux) INSTALLER_EXT=.run;;
8989
Darwin) INSTALLER_EXT=.dmg;;
9090
*) INSTALLER_EXT=.exe;;
9191
esac
92-
$QTIFW_DIR/binarycreator --offline-only -c config/$PRODUCT-$OS_EXT.xml -p packages/qreal-base -p packages/$PRODUCT $PRODUCT-offline-$OS_EXT-installer$ADD_BIT-${FULL_VERSION}${INSTALLER_EXT}
92+
"$QTIFW_DIR"/binarycreator --verbose --offline-only -c "config/$PRODUCT-$OS_EXT.xml" -p packages/qreal-base -p "packages/$PRODUCT" "$PRODUCT-offline-$OS_EXT-installer$ADD_BIT-${FULL_VERSION}${INSTALLER_EXT}"
9393

9494
grep -r -l --include=*.xml '<Version>.*</Version>' . | xargs $GNU_SED_COMMAND -i -e "s/<Version>.*<\/Version>/<Version><\/Version>/"
9595

96-
[ -f $SSH_DIR/id_rsa ] && : || { echo "Done"; exit 0; }
96+
[ -f "$SSH_DIR/id_rsa" ] && : || { echo "Done"; exit 0; }
9797

9898
#echo "Building updates repository... This step can be safely skipped, the offline installer is already ready, press Ctrl+C if you are not sure what to do next."
9999
#rm -rf $PRODUCT-repository
@@ -103,6 +103,6 @@ grep -r -l --include=*.xml '<Version>.*</Version>' . | xargs $GNU_SED_COMMAND -i
103103
#scp -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -r $PRODUCT-repository/* qrealproject@195.19.241.150:/home/qrealproject/public/packages/$PRODUCT-repo-$OS_EXT
104104

105105
echo "Removing temporary files..."
106-
rm -rf $PRODUCT-repository
106+
rm -rf "$PRODUCT-repository"
107107

108108
echo "Done"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pyinstaller==6.11.1
2-
numpy==2.2.1; python_version >= "3.11"
2+
numpy==2.2.2; python_version >= "3.11"
33
numpy==2.0.1; python_version < "3.11"
44

installer/platform/trik-studio-safe.cmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ SETLOCAL ENABLEEXTENSIONS
33
IF ERRORLEVEL 1 ECHO Failed to enable extensions
44
TITLE TRIK Studio Safe Mode
55
rem if JAVA_HOME is missing try to find the first Java executable in PATH
6-
IF DEFINED JAVA_HOME (ECHO JAVA_HOME is "%JAVA_HOME%" && set JAVA_PATH=%JAVA_HOME%\bin) ^
6+
IF DEFINED JAVA_HOME (ECHO JAVA_HOME is "%JAVA_HOME%" && set "JAVA_PATH=%JAVA_HOME%\bin") ^
77
ELSE (
88
java -version 2>NUL
99
IF ERRORLEVEL 1 ECHO Missing working java.exe in PATH="%PATH%"
10-
FOR /f "usebackq tokens=1* delims=:" %%F IN (`where java 2^>NUL ^| findstr /n "^"`) DO @IF %%F == 1 ( ECHO Using Java: "%%G" && SET JAVA_PATH=%%~dpG)
10+
FOR /f "usebackq tokens=1* delims=:" %%F IN (`where java 2^>NUL ^| findstr /n "^"`) DO @IF %%F == 1 ( ECHO Using Java: "%%G" && SET "JAVA_PATH=%%~dpG")
1111
)
1212
rem Clear PATH after Java detection attempt
13-
SET PATH=%SystemRoot%;%SystemRoot%\system32
14-
IF "%JAVA_PATH%" == "" ( ECHO Failed to detect Java/JRE ) ELSE (SET PATH=%PATH%;%JAVA_PATH%&& java -version)
13+
SET "PATH=%SystemRoot%;%SystemRoot%\system32"
14+
IF "%JAVA_PATH%" == "" ( ECHO Failed to detect Java/JRE ) ELSE (SET "PATH=%PATH%;%JAVA_PATH%" && java -version)
1515
ENDLOCAL
1616

1717
%~dp0trik-studio.exe "%*"

plugins/robots/checker/twoDModelRunner/reporter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ enum class Level
3737
/// Collects information about the interpretation process and writes it into the given file as JSON report.
3838
class Reporter : public QObject
3939
{
40+
Q_OBJECT
4041
public:
4142
/// Constructor.
4243
/// @param messagesFile If non-empty the information about all error reporter messages will be stored there in JSON.

plugins/robots/common/kitBase/include/kitBase/blocksBase/common/calibrateGyroscopeBlock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ namespace common {
3232
class ROBOTS_KIT_BASE_EXPORT CalibrateGyroscopeBlock :
3333
public kitBase::blocksBase::common::DeviceBlock<kitBase::robotModel::robotParts::GyroscopeSensor>
3434
{
35+
Q_OBJECT
3536
public:
3637
explicit CalibrateGyroscopeBlock(kitBase::robotModel::RobotModelInterface &robotModel);
3738

plugins/robots/common/kitBase/include/kitBase/blocksBase/common/deviceBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DeviceBlock : public RobotsBlock
3636

3737
void run() override
3838
{
39-
const robotModel::DeviceInfo deviceInfo = robotModel::DeviceInfo::create<Device>();
39+
const robotModel::DeviceInfo &deviceInfo = robotModel::DeviceInfo::create<Device>();
4040
const QString portProperty = eval<QString>("Port");
4141
const QString port = !portProperty.isEmpty() ? portProperty :
4242
deviceInfo.name()[0].toUpper() + deviceInfo.name().mid(1) + "Port";

plugins/robots/common/kitBase/include/kitBase/robotModel/deviceInfo.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <QtCore/QMetaObject>
2020
#include <QtCore/QMetaProperty>
2121

22+
#include <QReadWriteLock>
23+
2224
#include "direction.h"
2325
#include "kitBase/kitBaseDeclSpec.h"
2426

@@ -30,12 +32,15 @@ namespace robotModel {
3032
class ROBOTS_KIT_BASE_EXPORT DeviceInfo
3133
{
3234
public:
35+
/// Constructs invalid DeviceInfo instance.
36+
DeviceInfo();
37+
3338
/// Creates a new instance of a Device descriptor. The resulting object will
3439
/// correspond to a given type only if Q_OBJECT macro is used inside its declaration.
3540
/// @warning Given device type must contain friendlyName() and direction() static functions
3641
/// and Q_OBJECT macro.
3742
template <typename T>
38-
static DeviceInfo create()
43+
static DeviceInfo &create()
3944
{
4045
// This line performs Q_OBJECT macro checking in the given type declaration.
4146
// Without Q_OBJECT macro incorrect metaObject will be passed and it will lead
@@ -47,15 +52,13 @@ class ROBOTS_KIT_BASE_EXPORT DeviceInfo
4752
const bool simulated = property(metaObject, "simulated") == "true";
4853
const Direction direction = property(metaObject, "direction").toLower() == "input" ? input : output;
4954
DeviceInfo result(metaObject, name, friendlyName, simulated, direction);
50-
mCreatedInfos[QString(metaObject->className())] = result;
51-
return result;
55+
QWriteLocker w(&mRWLock);
56+
auto &r = mCreatedInfos[QString(metaObject->className())] = std::move(result);
57+
return r;
5258
}
5359

5460
/// Deserializes inner string representation obtained by toString().
55-
static DeviceInfo fromString(const QString &string);
56-
57-
/// Constructs invalid DeviceInfo instance.
58-
DeviceInfo();
61+
static DeviceInfo &fromString(const QString &string);
5962

6063
/// Serializes given device info into inner string representation.
6164
QString toString() const;
@@ -115,6 +118,7 @@ class ROBOTS_KIT_BASE_EXPORT DeviceInfo
115118

116119
static QString property(const QMetaObject * const metaObject, const QString &name);
117120

121+
static QReadWriteLock mRWLock;
118122
static QMap<QString, DeviceInfo> mCreatedInfos;
119123

120124
const QMetaObject *mDeviceType;

0 commit comments

Comments
 (0)