Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
78e8957
added trajectory saving
ladaegorova18 Mar 11, 2022
861d908
Added net connection, trajectory serialization to json and pause/run …
Apr 10, 2022
21156a0
Removed .proto file
Apr 10, 2022
3d6e534
added net connection run/pause/restart from Unity, renamed trajectory…
Apr 15, 2022
710e851
added some comments, fixed tabulations
Apr 15, 2022
ac8c00e
Added sending run/pause/restart signals from TRIK Studio to Unity
Apr 20, 2022
53a413d
added checkBox sendData and comboBox UnityIp to additionalPreferences
Apr 24, 2022
cc7c592
fixed vera errors, added license
May 5, 2022
7a87218
Merged upstream/master
May 5, 2022
21400ba
lupdate
May 5, 2022
65e7037
added QT += network
May 5, 2022
64df440
renamed some variables to mVariables
May 6, 2022
5ef1af1
removed some empty strings
May 6, 2022
8688514
lupdate
May 6, 2022
c738a8f
added passing parameters by link
May 10, 2022
441910c
lupdate
May 10, 2022
8b6149b
added forward declarations
May 10, 2022
40b7ffd
changed lines length
May 11, 2022
169906c
lupdate
May 11, 2022
d0b13f5
renamed ConnectionToVizualizator -> ConnectionToVisualizer
May 11, 2022
5131260
added QScopedPointers, separated saving position and rotation
May 12, 2022
b3c21e3
added comments
May 12, 2022
0d5d1f1
changed lines length
May 11, 2022
c2c4e10
renamed ConnectionToVizualizator -> ConnectionToVisualizer
May 11, 2022
5989474
added QScopedPointers, separated saving position and rotation
May 12, 2022
45e25cf
added comments
May 12, 2022
6437234
rebased upstream/master
May 12, 2022
57566f2
Merge branch 'master' into master
ladaegorova18 May 12, 2022
56f96e2
lupdate
May 12, 2022
33286dd
removed sizeof(8)
May 13, 2022
3d94758
removed qcsopedpointers
May 13, 2022
f8d9ce5
added endState in the end of trajectory
May 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class TWO_D_MODEL_EXPORT RobotModel : public QObject

bool isRiding() const;

void serialize(QDomElement &parent) const;
QDomElement serialize(QDomElement &parent) const;
void serializeWorldModel(QDomElement &parent) const;
void deserialize(const QDomElement &robotElement);
void deserializeWorldModel(const QDomElement &world);
Expand Down
40 changes: 22 additions & 18 deletions plugins/robots/common/twoDModel/src/engine/model/robotModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,23 +427,19 @@ bool RobotModel::onTheGround() const
return mIsOnTheGround;
}

void RobotModel::serialize(QDomElement &parent) const
{
QDomElement curRobot = parent.ownerDocument().createElement("robot");
curRobot.setAttribute("id", mRobotModel.robotId());
mSensorsConfiguration.serialize(curRobot);
serializeWheels(curRobot);

bool replaced = false;
for (QDomElement robot = parent.firstChildElement("robot"); !robot.isNull()
; robot = robot.nextSiblingElement("robot")) {
if (robot.attribute("id") == mRobotModel.robotId()) {
parent.replaceChild(curRobot, robot);
replaced = true;
break;
}
}
if (!replaced) parent.appendChild(curRobot);
QDomElement RobotModel::serialize(QDomElement &parent) const
{
QDomElement robot = parent.ownerDocument().createElement("robot");
parent.appendChild(robot);
robot.setAttribute("id", mRobotModel.robotId());
robot.setAttribute("position", QString::number(mPos.x()) + ":" + QString::number(mPos.y()));
robot.setAttribute("direction", QString::number(mAngle));

mSensorsConfiguration.serialize(robot);
mStartPositionMarker->serialize(robot);
serializeWheels(robot);

return robot;
}

void RobotModel::serializeWorldModel(QDomElement &parent) const
Expand Down Expand Up @@ -483,8 +479,16 @@ void RobotModel::deserializeWorldModel(const QDomElement &world)

void RobotModel::deserialize(const QDomElement &robotElement)
{
const QString positionStr = robotElement.attribute("position", "0:0");
const QStringList splittedStr = positionStr.split(":");
const qreal x = static_cast<qreal>(splittedStr[0].toDouble());
const qreal y = static_cast<qreal>(splittedStr[1].toDouble());
onRobotReturnedOnGround();
setPosition(QPointF(x, y));
setRotation(robotElement.attribute("direction", "0").toDouble());
mStartPositionMarker->deserializeCompatibly(robotElement);
deserializeWheels(robotElement);
configuration().deserialize(robotElement);
emit deserialized(QPointF(x, y), robotElement.attribute("direction", "0").toDouble());
nextFragment();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* limitations under the License. */

#include <QEventLoop>
#include <QtNetwork/QNetworkProxy>
#include "connectionToVizualizator.h"
#include <qrkernel/settingsManager.h>
#include <qrkernel/settingsListener.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#pragma once

#include <QtNetwork/QNetworkProxy>
#include <QtNetwork/QTcpSocket>
#include <QtCore/QIODevice>
#include <QScopedPointer>
Expand Down
1 change: 1 addition & 0 deletions plugins/robots/common/twoDModel/twoDModel.pri
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# 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.

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


DEFINES += TWO_D_MODEL_LIBRARY

Expand Down