Skip to content
Snippets Groups Projects
Commit 864bd5c9 authored by Michal Ondrejička's avatar Michal Ondrejička
Browse files

Merge branch 'develop' into 'master'

- config added to sectors

See merge request digital-twin/twinzo/tdevkit!12
parents 2a288295 d2ee7ec8
No related branches found
No related tags found
No related merge requests found
...@@ -36,25 +36,23 @@ namespace tDevkit ...@@ -36,25 +36,23 @@ namespace tDevkit
return response; return response;
} }
public async Task<PostResponseContract[]> AddLocalizationData(LocationContract[] locationContract) public async Task<PostResponseContract> AddLocalizationData(LocationContract[] locationContract)
{ {
string subUrl = Address.LocalizationAddData; string subUrl = Address.LocalizationAddData;
var response = await PostRequest<AddLocatizationDataResponseContract[]>(subUrl, locationContract); var response = await PostRequest<AddLocatizationDataResponseContract>(subUrl, locationContract);
for (int i = 0; i < response.Length; i++)
{ if (response.Locations != null)
if (response[i].Locations != null) for (int i = 0; i < response.Locations.Count; i++)
for (int j = 0; j < response[i].Locations.Count; j++)
{ {
var dataResult = response[i].Locations[j]; var dataResult = response.Locations[i];
if (dataResult.ErrorMessage != null) if (dataResult.ErrorMessage != null)
{ {
throw new ServerResponseException(ServerResponseException.message + dataResult.ErrorMessage); throw new ServerResponseException(ServerResponseException.message + dataResult.ErrorMessage);
} }
} }
if (response[i].ErrorMessage != null) if (response.ErrorMessage != null)
throw new ServerResponseException(ServerResponseException.message + " " + response[i].ErrorMessage); throw new ServerResponseException(ServerResponseException.message + " " + response.ErrorMessage);
}
return response; return response;
} }
......
...@@ -28,6 +28,8 @@ namespace SDK.Contracts.Communication ...@@ -28,6 +28,8 @@ namespace SDK.Contracts.Communication
public long Modified { get; set; } public long Modified { get; set; }
public string Configuration { get; set; }
public GpsItemContract[]? GpsItems { get; set; } public GpsItemContract[]? GpsItems { get; set; }
public AreaContract[]? Areas { get; set; } public AreaContract[]? Areas { get; set; }
...@@ -51,6 +53,7 @@ namespace SDK.Contracts.Communication ...@@ -51,6 +53,7 @@ namespace SDK.Contracts.Communication
SectorWidth = addSectorResponseContract.SectorWidth, SectorWidth = addSectorResponseContract.SectorWidth,
SectorHeight = addSectorResponseContract.SectorHeight, SectorHeight = addSectorResponseContract.SectorHeight,
Modified = addSectorResponseContract.Modified, Modified = addSectorResponseContract.Modified,
Configuration = addSectorResponseContract.Configuration,
GpsItems = addSectorResponseContract.GpsItems, GpsItems = addSectorResponseContract.GpsItems,
Areas = addSectorResponseContract.Areas, Areas = addSectorResponseContract.Areas,
Barriers = addSectorResponseContract.Barriers, Barriers = addSectorResponseContract.Barriers,
......
...@@ -26,6 +26,8 @@ namespace SDK.Models ...@@ -26,6 +26,8 @@ namespace SDK.Models
public long Modified { get; set; } public long Modified { get; set; }
public string Configuration { get; set; }
public GpsItemContract[]? GpsItems { get; set; } public GpsItemContract[]? GpsItems { get; set; }
public AreaContract[]? Areas { get; set; } public AreaContract[]? Areas { get; set; }
......
...@@ -29,7 +29,7 @@ namespace Test ...@@ -29,7 +29,7 @@ namespace Test
LayerContract layer2 = null; LayerContract layer2 = null;
try try
{ {
layer2 = await devkitConnector.GetLayer(14); layer2 = await devkitConnector.GetLayer(15);
} }
catch (NotFoundException exception) { } catch (NotFoundException exception) { }
Assert.IsNotNull(layer1); Assert.IsNotNull(layer1);
......
...@@ -25,8 +25,8 @@ namespace Test ...@@ -25,8 +25,8 @@ namespace Test
public async Task Localization2() public async Task Localization2()
{ {
await devkitConnector.Authenticate("rtu-sdk", "RONsM9KzoiRW2vO", false); await devkitConnector.Authenticate("rtu-sdk", "RONsM9KzoiRW2vO", false);
PostResponseContract[] local = await devkitConnector.AddLocalizationData(TestData.GetLocalizationData()); PostResponseContract local = await devkitConnector.AddLocalizationData(TestData.GetLocalizationData());
Assert.IsTrue(local[0].Success); Assert.IsTrue(local.Success);
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment