Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -0,0 +1,4 @@
#include "ImageFromSlave.h"

int ImageFromSlave::counterForImage = 0;

65 changes: 65 additions & 0 deletions Master_Slave_Management/Master_Slave_Management/ImageFromSlave.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#pragma once
#include "PointForSlave.h"
class ImageFromSlave
{
private:
int id;
static int counterForImage;
PointForSlave TL;
PointForSlave BR;
int slaveId;
int ReqId;

public:
ImageFromSlave() {};

ImageFromSlave(float top, float left, float bottom, float right, int slavenum, int reqId) :
BR(bottom, right),
TL(top, left),
slaveId(slavenum),
ReqId(reqId),
id(counterForImage++) {};

PointForSlave GetBR()
{
return this->BR;
}

PointForSlave GetTL()
{
return this->TL;
}

int GetSlaveId()
{
return this->slaveId;
};

int GetReqId()
{
return this->ReqId;
}

void SetReqId(int reqID)
{
this->ReqId = reqID;
}
int GetId()
{
return this->id;
}
int getCounter()
{
return this->counterForImage;
}
void setSlaveId(int id)
{
this->slaveId = id;
}




};


Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,31 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>

</ItemGroup>
<ItemGroup>
<ClInclude Include="doctest.h" />
<ClInclude Include="event.h" />
<ClInclude Include="ImageFromSlave.h" />
<ClInclude Include="mapRequest.h" />
<ClInclude Include="Message.h" />
<ClInclude Include="MessageParams.h" />
<ClInclude Include="MessageType.h" />
<ClInclude Include="PointForSlave.h" />
<ClInclude Include="RealImage.h" />
<ClInclude Include="Slave.h" />
<ClInclude Include="SlavesManager.h" />
<ClInclude Include="Structs.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="ImageFromSlave.cpp" />
<ClCompile Include="mapRequest.cpp" />
<ClCompile Include="Message.cpp" />
<ClCompile Include="PointForSlave.cpp" />
<ClCompile Include="Priority.h" />
<ClCompile Include="RealImage.cpp" />
<ClCompile Include="Slave.cpp" />
<ClCompile Include="SlavesManager.cpp" />
<ClCompile Include="Test.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
Expand Down Expand Up @@ -53,27 +77,24 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared" >
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>

<PropertyGroup Label="UserMacros" />

<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand Down Expand Up @@ -130,9 +151,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>

<ItemGroup></ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,71 @@
<UniqueIdentifier>{2854cb75-ba29-441b-8dff-4947a76a6041}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="event.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="ImageFromSlave.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="mapRequest.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="Message.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="MessageParams.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="MessageType.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="PointForSlave.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="RealImage.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="Slave.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="SlavesManager.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="Structs.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
<ClInclude Include="doctest.h">
<Filter>Header Files\MapCreator</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Message.cpp">
<Filter>Header Files\MapCreator</Filter>
</ClCompile>
<ClCompile Include="Priority.h">
<Filter>Header Files\MapCreator</Filter>
</ClCompile>
<ClCompile Include="ImageFromSlave.cpp">
<Filter>Header Files\MapCreator</Filter>
</ClCompile>
<ClCompile Include="mapRequest.cpp">
<Filter>Header Files\MapCreator</Filter>
</ClCompile>
<ClCompile Include="PointForSlave.cpp">
<Filter>Header Files\MapCreator</Filter>
</ClCompile>
<ClCompile Include="RealImage.cpp">
<Filter>Header Files\MapCreator</Filter>
</ClCompile>
<ClCompile Include="Slave.cpp">
<Filter>Header Files\MapCreator</Filter>
</ClCompile>
<ClCompile Include="SlavesManager.cpp">
<Filter>Header Files\MapCreator</Filter>
</ClCompile>
<ClCompile Include="Test.cpp">
<Filter>Header Files\MapCreator</Filter>
</ClCompile>
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions Master_Slave_Management/Master_Slave_Management/Message.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "Message.h"

int Message::counterForMsg = 0;
34 changes: 34 additions & 0 deletions Master_Slave_Management/Master_Slave_Management/Message.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once
#include "MessageParams.h"
#include "Priority.h"
struct Message
{
int messageId;
int reqId;
MessageType messageType;
int droneId;
MessageParams* messageParams;
Priority priority;
Message() :messageId(counterForMsg++), messageParams(new MessageParams) {};
~Message() { delete messageParams; };
// Copy constructor
/*Message(const Message& message)
: messageId(counter++),reqId(message.reqId),messageType(message.messageType),droneId(message.droneId),
messageParams(message.messageParams),priority(message.priority)
{}*/
Message& operator=(const Message& other)
{
if (this != &other)
{
// Note: messageId should remain unique, so we do not copy it.
reqId = other.reqId;
messageType = other.messageType;
droneId = other.droneId;
messageParams = other.messageParams; // Assuming proper copy behavior in MessageParams
priority = other.priority;
}
return *this;
}
private:
int static counterForMsg;
};
Loading