Skip to content

Trik Studio 3D Visualization#1526

Open
ladaegorova18 wants to merge 32 commits intotrikset:masterfrom
ladaegorova18:master
Open

Trik Studio 3D Visualization#1526
ladaegorova18 wants to merge 32 commits intotrikset:masterfrom
ladaegorova18:master

Conversation

@ladaegorova18
Copy link

No description provided.

$$PWD/src/engine/view/twoDModelWidget.ui \

DISTFILES += \
$$PWD/src/engine/trajectory/frames.proto
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мусор

# limitations under the License.

QT += widgets xml svg
QT += network
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем отдельная строка?

{
if (connToVizualizator == nullptr) {
connToVizualizator = new ConnectionToVizualizator();
connToVizualizator->setPort(8080);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Порт должен быть в опциях, хотя бы в Settings.


/// saving it to file
QFile file("trajectory.json");
if( file.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет обработки ошибки, хотя бы QLOG_ERROR () <<


try {
sendTrajectory(data);
} catch (exception e) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исключения надо ловить по ссылке. Но это дурной тон ловить std::exception

TrajectorySaver::TrajectorySaver(QObject *parent)
: QObject(parent)
{
connToVizualizator = new ConnectionToVizualizator();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кто и когда удаляет?

QTcpSocket *socket;
QTimer *keepaliveTimer;

QString Ip {"10.0.5.2"};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Параметры сетевого соединения должны быть в настройках


public:
// ConnectionToVizualizator(QString ip, int port);
ConnectionToVizualizator();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возможно, конструктору нужен параметр QObject *parent, раз уж это Q_OBJECT

#include <QTimer>

/// Connection to Unity to send frames and run/stop/restart
class alignas(8) ConnectionToVizualizator : public QObject
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем тут alignas(8)? Такой код нельзя без комментария.


private:
QTcpSocket *socket;
QTimer *keepaliveTimer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В продукте принята схема именования полей с префиксом, то есть mSocket и подобное.

Copy link
Contributor

@IKhonakhbeeva IKhonakhbeeva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RobotModel::deserialize и serialize должны выглядеть как "до изменений" (то есть после моего пулреквеста с форматом сейва). Ни на что в этом пул реквесте это на первый поверхностный вгляд повлиять не должно

После этого билды должны починиться

#include "twoDModel/engine/twoDModelDisplayWidget.h"

#include "twoDModel/twoDModelDeclSpec.h"
#include "plugins/robots/common/twoDModel/src/engine/trajectory/connectionToVizualizator.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем этот #include?

QDomDocument generateWorldModelWithBlobsXml() const;
QDomDocument generateWorldModelXml() const;
QDomDocument generateBlobsXml() const;
ConnectionToVizualizator *mConnToVizualizator;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отсутствует инициализация {}, не указано, кто владеет объектом

, mWorld(new b2World(b2Vec2(0, 0)))
, mPrevPosition(b2Vec2(0, 0))
, mPrevAngle(0)
, mTrajSaver(new TrajectorySaver(nullptr))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю, что тут надо бы не nullptr

item->setPos(scenePos - item->boundingRect().center());
item->setRotation(angleToScene(mBox2DDynamicItems[item]->getRotation()));
}
auto *abstractItem = dynamic_cast<graphicsUtils::AbstractItem *>(item);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qobject_cast не подойдёт?

@@ -0,0 +1,166 @@
/* Copyright 2022 Lada Egorova
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По-моему, тут где-то обычно запятая есть. Но хоть так.

<string>Network Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="2">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не надо перетаскивать элементы в XML, это лишь увеличивает diff

@ladaegorova18 ladaegorova18 changed the title Trik Studio 3D Visualisation Trik Studio 3D Visualization May 11, 2022
@iakov iakov force-pushed the master branch 8 times, most recently from cd7a4ab to ff6360f Compare February 11, 2023 17:45
@iakov iakov force-pushed the master branch 3 times, most recently from dde4319 to 06af258 Compare July 20, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants