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
return response;
}
public async Task<PostResponseContract[]> AddLocalizationData(LocationContract[] locationContract)
public async Task<PostResponseContract> AddLocalizationData(LocationContract[] locationContract)
{
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[i].Locations != null)
for (int j = 0; j < response[i].Locations.Count; j++)
if (response.Locations != null)
for (int i = 0; i < response.Locations.Count; i++)
{
var dataResult = response[i].Locations[j];
var dataResult = response.Locations[i];
if (dataResult.ErrorMessage != null)
{
throw new ServerResponseException(ServerResponseException.message + dataResult.ErrorMessage);
}
}
if (response[i].ErrorMessage != null)
throw new ServerResponseException(ServerResponseException.message + " " + response[i].ErrorMessage);
}
if (response.ErrorMessage != null)
throw new ServerResponseException(ServerResponseException.message + " " + response.ErrorMessage);
return response;
}
......
......@@ -28,6 +28,8 @@ namespace SDK.Contracts.Communication
public long Modified { get; set; }
public string Configuration { get; set; }
public GpsItemContract[]? GpsItems { get; set; }
public AreaContract[]? Areas { get; set; }
......@@ -51,6 +53,7 @@ namespace SDK.Contracts.Communication
SectorWidth = addSectorResponseContract.SectorWidth,
SectorHeight = addSectorResponseContract.SectorHeight,
Modified = addSectorResponseContract.Modified,
Configuration = addSectorResponseContract.Configuration,
GpsItems = addSectorResponseContract.GpsItems,
Areas = addSectorResponseContract.Areas,
Barriers = addSectorResponseContract.Barriers,
......
......@@ -26,6 +26,8 @@ namespace SDK.Models
public long Modified { get; set; }
public string Configuration { get; set; }
public GpsItemContract[]? GpsItems { get; set; }
public AreaContract[]? Areas { get; set; }
......
......@@ -29,7 +29,7 @@ namespace Test
LayerContract layer2 = null;
try
{
layer2 = await devkitConnector.GetLayer(14);
layer2 = await devkitConnector.GetLayer(15);
}
catch (NotFoundException exception) { }
Assert.IsNotNull(layer1);
......
......@@ -25,8 +25,8 @@ namespace Test
public async Task Localization2()
{
await devkitConnector.Authenticate("rtu-sdk", "RONsM9KzoiRW2vO", false);
PostResponseContract[] local = await devkitConnector.AddLocalizationData(TestData.GetLocalizationData());
Assert.IsTrue(local[0].Success);
PostResponseContract local = await devkitConnector.AddLocalizationData(TestData.GetLocalizationData());
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