Skip to content

Commit cdb6e31

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pull/1882
2 parents 3dfdca3 + 8a4cf6b commit cdb6e31

File tree

6 files changed

+34
-46
lines changed

6 files changed

+34
-46
lines changed

plugins/robots/generators/nxt/nxtOsekCGenerator/nxtOsekCGeneratorPlugin.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ NxtOsekCGeneratorPlugin::NxtOsekCGeneratorPlugin()
3434
, mFlashRobotAction(new QAction(this))
3535
, mUploadProgramAction(new QAction(this))
3636
, mNxtToolsPresent(false)
37-
, mMasterGenerator(nullptr)
3837
, mCommunicator(utils::Singleton<communication::UsbRobotCommunicationThread>::instance())
3938
{
4039
const QString key = "pathToArmNoneEabi";
@@ -184,21 +183,24 @@ void NxtOsekCGeneratorPlugin::onUploadingComplete(bool success)
184183

185184
generatorBase::MasterGeneratorBase *NxtOsekCGeneratorPlugin::masterGenerator()
186185
{
187-
mMasterGenerator = new NxtOsekCMasterGenerator(*mRepo
186+
return new NxtOsekCMasterGenerator(*mRepo
188187
, *mMainWindowInterface->errorReporter()
189188
, *mParserErrorReporter
190189
, *mRobotModelManager
191190
, *mTextLanguage
192191
, mMainWindowInterface->activeDiagram()
193192
, generatorName());
194-
return mMasterGenerator;
195193
}
196194

197195
void NxtOsekCGeneratorPlugin::regenerateExtraFiles(const QFileInfo &newFileInfo)
198196
{
199-
mMasterGenerator->initialize();
200-
mMasterGenerator->setProjectDir(newFileInfo);
201-
mMasterGenerator->generateOilAndMakeFiles();
197+
// Static cast is possible and correct, but dynamic will be more flexible.
198+
if (auto nxtGenerator = qobject_cast<NxtOsekCMasterGenerator*>(masterGenerator())) {
199+
QScopedPointer<NxtOsekCMasterGenerator> generator(nxtGenerator);
200+
generator->initialize();
201+
generator->setProjectDir(newFileInfo);
202+
generator->generateOilAndMakeFiles();
203+
}
202204
}
203205

204206
void NxtOsekCGeneratorPlugin::flashRobot()

plugins/robots/generators/nxt/nxtOsekCGenerator/nxtOsekCGeneratorPlugin.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ private slots:
8989
bool mNxtToolsPresent { false };
9090
/// Flasher object
9191
QScopedPointer<NxtFlashTool> mFlashTool;
92-
93-
NxtOsekCMasterGenerator *mMasterGenerator;
9492
const QSharedPointer<communication::UsbRobotCommunicationThread> mCommunicator;
9593
};
9694

qrtranslations/fr/plugins/robots/nxtOsekCGenerator_fr.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@
8282
<translation>Échec de téléversement du programme. Assurez-vous que le robot soit connecté et qu&apos;il ne soit pas éteint</translation>
8383
</message>
8484
<message>
85-
<location line="+43"/>
85+
<location line="+2"/>
86+
<source>If you are using GNU/Linux visit https://help.trikset.com/nxt/run-upload-programs to get instructions</source>
87+
<translation type="unfinished"></translation>
88+
</message>
89+
<message>
90+
<location line="+41"/>
8691
<source>Error in reading from firmware file: %1</source>
8792
<translation type="unfinished"></translation>
8893
</message>
@@ -152,12 +157,7 @@
152157
<translation type="unfinished"></translation>
153158
</message>
154159
<message>
155-
<location line="+48"/>
156-
<source>If you are using GNU/Linux visit https://help.trikset.com/nxt/run-upload-programs to get instructions</source>
157-
<translation type="unfinished"></translation>
158-
</message>
159-
<message>
160-
<location line="+7"/>
160+
<location line="+55"/>
161161
<source>QReal requires superuser privileges to upload programs on NXT robot</source>
162162
<translation>QReal necessite les droits de superutilisateur pour mettre à jour le programme du robot NXT</translation>
163163
</message>
@@ -170,13 +170,13 @@
170170
<translation>Génération (NXT OSEK C)</translation>
171171
</message>
172172
<message>
173-
<location line="+58"/>
174-
<location line="+128"/>
173+
<location line="+57"/>
174+
<location line="+131"/>
175175
<source>NXT tools package is not installed</source>
176176
<translation type="unfinished"></translation>
177177
</message>
178178
<message>
179-
<location line="-82"/>
179+
<location line="-85"/>
180180
<source>Generate code</source>
181181
<translation>Générer le code</translation>
182182
</message>
@@ -201,7 +201,7 @@
201201
<translation>Téléverser le programme sur le dispositif NXT</translation>
202202
</message>
203203
<message>
204-
<location line="+50"/>
204+
<location line="+53"/>
205205
<source>flash.sh not found. Make sure it is present in QReal installation directory</source>
206206
<translation>flash.sh n&apos;est pas trouvé. Assurez-vous qu&apos;il soit présent dans le repertoire de QReal</translation>
207207
</message>

qrtranslations/ru/plugins/robots/nxtKitInterpreter_ru.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
<message>
4040
<location line="-35"/>
4141
<source>nxtOSEK Generator Settings</source>
42-
<translation>Настройки генерации кода nxtOSEK</translation>
42+
<translation type="unfinished"></translation>
4343
</message>
4444
<message>
4545
<location line="+6"/>
4646
<source>TextLabel</source>
47-
<translation></translation>
47+
<translation type="unfinished"></translation>
4848
</message>
4949
<message>
5050
<location line="+42"/>
@@ -77,14 +77,13 @@
7777
<message>
7878
<location line="+2"/>
7979
<source>Path to arm-none-eabi:</source>
80-
<translation>Путь к кросс-компилятору</translation>
80+
<translation type="unfinished"></translation>
8181
</message>
8282
<message>
8383
<location line="+23"/>
8484
<source>WARNING: Current directory doesn&apos;t exist.
8585
Open &lt;a href=&quot;https://help.trikset.com/nxt/run-upload-programs&quot;&gt;link&lt;/a&gt; for instructions</source>
86-
<translation>ВНИМАНИЕ: Выбранная директория не существует.
87-
Откройте &lt;a href=&quot;https://help.trikset.com/nxt/run-upload-programs&quot;&gt;ссылку&lt;/a&gt; для дальнейших инструкций</translation>
86+
<translation type="unfinished"></translation>
8887
</message>
8988
</context>
9089
<context>

qrtranslations/ru/plugins/robots/nxtOsekCGenerator_ru.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@
8282
<translation>Не удалось загрузить программу в робота. Убедитесь, что робот включен и подсоединен к компьютеру</translation>
8383
</message>
8484
<message>
85-
<location line="+43"/>
85+
<location line="+2"/>
86+
<source>If you are using GNU/Linux visit https://help.trikset.com/nxt/run-upload-programs to get instructions</source>
87+
<translation type="unfinished"></translation>
88+
</message>
89+
<message>
90+
<location line="+41"/>
8691
<source>Error in reading from firmware file: %1</source>
8792
<translation>Ошибка чтения из файла с прошивкой %1</translation>
8893
</message>
@@ -152,16 +157,7 @@
152157
<translation>Загрузка программы не удалась. Возможно, стоит попробовать перезапустить среду с правами суперпользователя</translation>
153158
</message>
154159
<message>
155-
<source>Could not upload program. Make sure the robot is connected and ON.</source>
156-
<translation type="vanished">Не удалось загрузить программу. Убедитесь, что робот подключен и включен.</translation>
157-
</message>
158-
<message>
159-
<location line="+48"/>
160-
<source>If you are using GNU/Linux visit https://help.trikset.com/nxt/run-upload-programs to get instructions</source>
161-
<translation>Если вы пользователь ОС GNU/Linux, перейдите по ссылке https://help.trikset.com/nxt/run-upload-programs для получения инструкций.</translation>
162-
</message>
163-
<message>
164-
<location line="+7"/>
160+
<location line="+55"/>
165161
<source>QReal requires superuser privileges to upload programs on NXT robot</source>
166162
<translation>Для загрузки программ в робота требуется запустить TRIKStudio с правами администратора</translation>
167163
</message>
@@ -178,13 +174,13 @@
178174
<translation>Генерация (C)</translation>
179175
</message>
180176
<message>
181-
<location line="+58"/>
182-
<location line="+128"/>
177+
<location line="+57"/>
178+
<location line="+131"/>
183179
<source>NXT tools package is not installed</source>
184180
<translation>Пакет &quot;Инструменты NXT&quot; не установлен</translation>
185181
</message>
186182
<message>
187-
<location line="-82"/>
183+
<location line="-85"/>
188184
<source>Generate code</source>
189185
<translation>Генерировать код</translation>
190186
</message>
@@ -209,7 +205,7 @@
209205
<translation>Загрузить программу на устройство NXT</translation>
210206
</message>
211207
<message>
212-
<location line="+50"/>
208+
<location line="+53"/>
213209
<source>flash.sh not found. Make sure it is present in QReal installation directory</source>
214210
<translation>Не найден скрипт flash.sh. Убедитесь, что пакет nxt-tools установлен корректно</translation>
215211
</message>

qrtranslations/ru/qrutils_ru.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,13 +632,6 @@
632632
<translation>&lt;строка&gt;:&lt;столбец&gt;</translation>
633633
</message>
634634
</context>
635-
<context>
636-
<name>qReal::ui::dirPicker</name>
637-
<message>
638-
<source>Browse...</source>
639-
<translation type="vanished">Обзор...</translation>
640-
</message>
641-
</context>
642635
<context>
643636
<name>utils::MetamodelGeneratorSupport</name>
644637
<message>

0 commit comments

Comments
 (0)