From e87f9db0365d4e2d02ae8e4c34d0599925bf45fa Mon Sep 17 00:00:00 2001 From: MinyazevR <89993880+MinyazevR@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:03:41 +0300 Subject: [PATCH] Add translations to TrikJoinNetwork block and change UI (#1859) --- .../robots/editor/trik/generated/elements.h | 18 +-- plugins/robots/editor/trik/trikMetamodel.xml | 9 +- .../trikJoinNetworkGenerator.cpp | 2 +- .../fr/plugins/robots/trikMetamodel_fr.ts | 105 ++++++++-------- .../ru/plugins/robots/trikMetamodel_ru.ts | 113 +++++++++--------- 5 files changed, 118 insertions(+), 129 deletions(-) diff --git a/plugins/robots/editor/trik/generated/elements.h b/plugins/robots/editor/trik/generated/elements.h index d0453664a1..edb2090c9a 100644 --- a/plugins/robots/editor/trik/generated/elements.h +++ b/plugins/robots/editor/trik/generated/elements.h @@ -744,7 +744,7 @@ setName("TrikJoinNetwork"); setFriendlyName(QObject::tr("Join Network")); setDiagram("RobotsDiagram"); - setDescription(QObject::tr("Sets hull number of this robot and connects to robot by IP and port.")); + setDescription(QObject::tr("Sets the hull number and connects with a peer by a (host)name or an IP-address. Target IP-port can be changed too if required.")); QSharedPointer label_1(new qReal::LabelProperties(1, 0.9, 1.2, "Address", false, 0)); label_1->setBackground(Qt::white); label_1->setScalingX(false); @@ -753,22 +753,14 @@ label_1->setPlainTextMode(false); label_1->setPrefix(QObject::tr("Address:")); addLabel(label_1); - QSharedPointer label_2(new qReal::LabelProperties(2, 0.9, 1.8, "IPPort", false, 0)); + QSharedPointer label_2(new qReal::LabelProperties(2, 0.9, 1.8, "HullNumber", false, 0)); label_2->setBackground(Qt::white); label_2->setScalingX(false); label_2->setScalingY(false); label_2->setHard(false); label_2->setPlainTextMode(false); - label_2->setPrefix(QObject::tr("Port:")); + label_2->setPrefix(QObject::tr("Hull number:")); addLabel(label_2); - QSharedPointer label_3(new qReal::LabelProperties(3, 0.9, 2.4, "HullNumber", false, 0)); - label_3->setBackground(Qt::white); - label_3->setScalingX(false); - label_3->setScalingY(false); - label_3->setHard(false); - label_3->setPlainTextMode(false); - label_3->setPrefix(QObject::tr("Hull number:")); - addLabel(label_3); loadSdf(utils::xmlUtils::loadDocument(":/generated/shapes/TrikJoinNetworkClass.sdf").documentElement()); setSize(QSizeF(50, 50)); initProperties(); @@ -792,8 +784,8 @@ void initProperties() { addProperty("Address", "string", QObject::tr("192.168.77.1"), QObject::tr("Address"), QObject::tr(""), false); - addProperty("HullNumber", "int", QString::fromUtf8("-1"), QObject::tr("Hull Number"), QObject::tr(""), false); - addProperty("IPPort", "int", QString::fromUtf8("-1"), QObject::tr("Port"), QObject::tr(""), false); + addProperty("HullNumber", "int", QString::fromUtf8("1"), QObject::tr("Hull Number"), QObject::tr(""), false); + addProperty("IPPort", "int", QString::fromUtf8("8889"), QObject::tr("Port"), QObject::tr(""), false); } }; diff --git a/plugins/robots/editor/trik/trikMetamodel.xml b/plugins/robots/editor/trik/trikMetamodel.xml index 5b5d188690..ded0302697 100644 --- a/plugins/robots/editor/trik/trikMetamodel.xml +++ b/plugins/robots/editor/trik/trikMetamodel.xml @@ -1275,15 +1275,14 @@ - + @@ -1293,10 +1292,10 @@ 192.168.77.1 - -1 + 8889 - -1 + 1 diff --git a/plugins/robots/generators/trik/trikGeneratorBase/src/simpleGenerators/trikJoinNetworkGenerator.cpp b/plugins/robots/generators/trik/trikGeneratorBase/src/simpleGenerators/trikJoinNetworkGenerator.cpp index 01a3f4663b..a823a4d18f 100644 --- a/plugins/robots/generators/trik/trikGeneratorBase/src/simpleGenerators/trikJoinNetworkGenerator.cpp +++ b/plugins/robots/generators/trik/trikGeneratorBase/src/simpleGenerators/trikJoinNetworkGenerator.cpp @@ -30,7 +30,7 @@ TrikJoinNetworkGenerator::TrikJoinNetworkGenerator(const qrRepo::RepoApi &repo , utils::StringUtils::wrap( utils::StringUtils::dequote(repo.stringProperty(id, "Address"))) , customizer.factory()->stringPropertyConverter(id, "Address")) - , Binding::createDirect("@@PORT@@", "Port") + , Binding::createDirect("@@PORT@@", "IPPort") , Binding::createDirect("@@HULL_NUMBER@@", "HullNumber") } , parent) { diff --git a/qrtranslations/fr/plugins/robots/trikMetamodel_fr.ts b/qrtranslations/fr/plugins/robots/trikMetamodel_fr.ts index c0c27ddf1a..11dc0f9a0e 100644 --- a/qrtranslations/fr/plugins/robots/trikMetamodel_fr.ts +++ b/qrtranslations/fr/plugins/robots/trikMetamodel_fr.ts @@ -11,7 +11,7 @@ - + @@ -22,20 +22,20 @@ - - + + Angular Servo - - + + Manages angular servomotor. Sets up rotation angle on the given port in degrees. Values from 0 to 90 are correspond to a clockwise rotation and values from -90 to 0 correspond to counterclockwise rotation. - - + + @@ -45,26 +45,26 @@ - - + + Angle: - - + + ° - + E1 - + @@ -75,7 +75,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -95,13 +95,13 @@ - - + + Angle (degrees) - + Detect by Videocamera @@ -114,20 +114,20 @@ - + Mode: - + - + Mode - + Line Detector into Variable @@ -139,24 +139,24 @@ - + Variable: - + err - + Variable - + TrikDigitalSensorBlock @@ -175,29 +175,29 @@ - + X: - + - + Y: - + - + Width: - + Height: @@ -238,13 +238,13 @@ - + Redraw - + SpanAngle @@ -257,30 +257,30 @@ - + Width - + - + X - + - + Y - + Draw Ellipse @@ -404,7 +404,12 @@ Qualité - + + Sets the hull number and connects with a peer by a (host)name or an IP-address. Target IP-port can be changed too if required. + + + + Led @@ -483,7 +488,7 @@ - + Calibrate gyroscope @@ -498,7 +503,7 @@ - + Duration: @@ -791,8 +796,7 @@ - - + @@ -803,22 +807,17 @@ - + Join Network - - Sets hull number of this robot and connects to robot by IP and port. - - - - + Address: - + 192.168.77.1 diff --git a/qrtranslations/ru/plugins/robots/trikMetamodel_ru.ts b/qrtranslations/ru/plugins/robots/trikMetamodel_ru.ts index 66ddf230a8..623cf4f4be 100644 --- a/qrtranslations/ru/plugins/robots/trikMetamodel_ru.ts +++ b/qrtranslations/ru/plugins/robots/trikMetamodel_ru.ts @@ -11,7 +11,7 @@ - + @@ -22,20 +22,20 @@ Порт - - + + Angular Servo Угловой сервомотор - - + + Manages angular servomotor. Sets up rotation angle on the given port in degrees. Values from 0 to 90 are correspond to a clockwise rotation and values from -90 to 0 correspond to counterclockwise rotation. Управление угловым сервомотором. Устанавливает угол поворота вала мотора на данном порту (в градусах). Значения от 0 до 90 соотвествуют повороту по часовой, значения от -90 до 0 --- повороту против часовой. - - + + @@ -45,26 +45,26 @@ Порты: - - + + Angle: Угол: - - + + ° ° - + E1 E1 - + @@ -75,7 +75,7 @@ Порты - + @@ -84,7 +84,7 @@ - + @@ -95,13 +95,13 @@ 0 - - + + Angle (degrees) Угол (градусы) - + Detect by Videocamera Детектировать по камере @@ -114,20 +114,20 @@ - + Mode: Режим: - + - + Mode Режим - + Line Detector into Variable Датчик линии в переменную @@ -139,24 +139,24 @@ - + Variable: Переменная: - + err err - + Variable Переменная - + TrikDigitalSensorBlock Базовый блок цифровых сенсоров TRIK @@ -175,29 +175,29 @@ - + X: X: - + - + Y: Y: - + - + Width: Ширина: - + Height: @@ -238,13 +238,13 @@ - + Redraw Обновить картинку - + SpanAngle Размах @@ -257,30 +257,30 @@ - + Width Ширина - + - + X X - + - + Y Y - + Draw Ellipse Нарисовать эллипс @@ -406,32 +406,27 @@ Join Network - + Присоединиться к сети - - Sets hull number of this robot and connects to robot by IP and port. - - - - + Address: - + Адрес: - + 192.168.77.1 - 192.168.77.1 + 192.168.77.1 Address - + Адрес Hull Number - Бортномер + Бортномер @@ -513,7 +508,7 @@ мс - + Calibrate gyroscope Калибровка гироскопа @@ -528,7 +523,7 @@ Вывести на экран - + Duration: Длительность: @@ -680,7 +675,12 @@ 1 - + + Sets the hull number and connects with a peer by a (host)name or an IP-address. Target IP-port can be changed too if required. + Устанавливает бортовой номер и подключается по имени (хоста) или IP-адресу к другому роботу. При необходимости целевой IP-порт также может быть изменен. + + + Print Text Напечатать текст @@ -821,8 +821,7 @@ Ждать, пока показания счетчика количества оборотов на заданном моторе не достинут указанного в значении параметра 'Предел оборотов'. - - +