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

Merge branch 'develop' into 'master'

update

See merge request digital-twin/twinzo/tdevkit!10
parents 11f738a9 055424c8
No related branches found
No related tags found
No related merge requests found
Showing
with 98 additions and 102 deletions
......@@ -3,8 +3,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<AssemblyVersion>2021.6.16.2</AssemblyVersion>
<FileVersion>2021.6.16.2</FileVersion>
<AssemblyVersion>2021.6.22.8</AssemblyVersion>
<FileVersion>2021.6.22.8</FileVersion>
</PropertyGroup>
<ItemGroup>
......
......@@ -12,17 +12,17 @@ namespace SDK.Contracts.Communication
{
public int Id { get; set; }
public int SectorId { get; set; }
public int? SectorId { get; set; }
public int BranchId { get; set; }
public string Mac { get; set; }
public double X { get; set; }
public double? X { get; set; }
public double Y { get; set; }
public double? Y { get; set; }
public double Z { get; set; }
public double? Z { get; set; }
public string Title { get; set; }
......@@ -30,15 +30,15 @@ namespace SDK.Contracts.Communication
public bool Position { get; set; }
public int TypeId { get; set; }
public int? TypeId { get; set; }
public bool Geofence { get; set; }
public double GeofenceRange { get; set; }
public double? GeofenceRange { get; set; }
public string Cluster { get; set; }
public long LastTimeOnline { get; set; }
public long? LastTimeOnline { get; set; }
public bool UseGps { get; set; }
......
using SDK.Communication;
using Core.Enum;
using SDK.Communication;
using SDK.Models;
using System;
using System.Collections.Generic;
......@@ -16,33 +17,33 @@ namespace SDK.Contracts.Communication
public int BranchId { get; set; }
public int SectorId { get; set; }
public int? SectorId { get; set; }
public int ValidSectorId { get; set; }
public int? ValidSectorId { get; set; }
public string Title { get; set; }
public string Note { get; set; }
public long LastTimeOnline { get; set; }
public long? LastTimeOnline { get; set; }
public long ValidLastTimeOnline { get; set; }
public long? ValidLastTimeOnline { get; set; }
public float X { get; set; }
public float? X { get; set; }
public float Y { get; set; }
public float? Y { get; set; }
public float ValidX { get; set; }
public float? ValidX { get; set; }
public float ValidY { get; set; }
public float? ValidY { get; set; }
public string AppVersion { get; set; }
public bool IsMoving { get; set; }
public int FallStatus { get; set; }
public FallType FallStatus { get; set; }
public float Battery { get; set; }
public float? Battery { get; set; }
public int DeviceTypeId { get; set; }
......@@ -52,7 +53,7 @@ namespace SDK.Contracts.Communication
public bool Geofence { get; set; }
public float GeofenceRange { get; set; }
public float? GeofenceRange { get; set; }
public string Login { get; set; }
......
......@@ -9,29 +9,21 @@ using System.Threading.Tasks;
namespace SDK.Contracts.Communication
{
[DataContract]
public class AddLocatizationDataResponseContract : PostResponseContract
{
[DataMember(Order = 1)]
public string Login { get; set; }
[DataMember(Order = 2)]
public List<LocationResponseContract> Locations { get; set; }
}
[DataContract]
public class LocationResponseContract
{
[DataMember(Order = 1)]
public long Timestamp { get; set; }
[DataMember(Order = 2)]
public string Action { get; set; }
[DataMember(Order = 3)]
public bool Success { get; set; }
[DataMember(Order = 4)]
public string ErrorMessage { get; set; }
}
}
......@@ -28,15 +28,15 @@ namespace SDK.Contracts.Communication
public long Modified { get; set; }
public GpsItemContract[] GpsItems { get; set; }
public GpsItemContract[]? GpsItems { get; set; }
public AreaContract[] Areas { get; set; }
public AreaContract[]? Areas { get; set; }
public BarrierContract[] Barriers { get; set; }
public BarrierContract[]? Barriers { get; set; }
public BeaconContract[] Beacons { get; set; }
public BeaconContract[]? Beacons { get; set; }
public SensorContract[] Sensors { get; set; }
public SensorContract[]? Sensors { get; set; }
public static explicit operator SectorContract(AddSectorResponseContract addSectorResponseContract)
{
......
......@@ -12,41 +12,47 @@ namespace SDK.Contracts.Communication
{
public int Id { get; set; }
public string Login { get; set; }
public string Password { get; set; }
public string Salt { get; set; }
public string Title { get; set; }
public string Mac { get; set; }
public double X { get; set; }
public string Note { get; set; }
public double Y { get; set; }
public double? X { get; set; }
public double? Y { get; set; }
public int? Battery { get; set; }
public int SectorId { get; set; }
public SensorDataContract[] SensorData { get; set; }
public int AreaId { get; set; }
public int? AreaId { get; set; }
public string Login { get; set; }
//public string Password { get; set; }
//public string Salt { get; set; }
public static explicit operator SensorContract(AddSensorResponseContract addSensorResponseContract)
{
return new SensorContract
{
Id = addSensorResponseContract.Id,
Login = addSensorResponseContract.Login,
//Password = addSensorResponseContract.Password,
//Salt = addSensorResponseContract.Salt,
Title = addSensorResponseContract.Title,
Mac = addSensorResponseContract.Mac,
Note = addSensorResponseContract.Note,
X = addSensorResponseContract.X,
Y = addSensorResponseContract.Y,
Battery = addSensorResponseContract.Battery,
SectorId = addSensorResponseContract.SectorId,
SensorData = addSensorResponseContract.SensorData,
AreaId = addSensorResponseContract.AreaId
AreaId = addSensorResponseContract.AreaId,
Login = addSensorResponseContract.Login,
//Password = addSensorResponseContract.Password,
//Salt = addSensorResponseContract.Salt,
};
}
}
......
using SDK.Contracts.Data;
using Core.Enum;
using SDK.Contracts.Data;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -41,7 +42,7 @@ namespace SDK.Models
public bool IsMoving { get; set; }
public int FallStatus { get; set; }
public FallType FallStatus { get; set; }
public float? Battery { get; set; }
......
......@@ -8,7 +8,6 @@ using System.Threading.Tasks;
namespace SDK.Contracts.Data
{
[DataContract]
public class DeviceLocationContract
{
[Required]
......@@ -17,7 +16,6 @@ namespace SDK.Contracts.Data
public LocationContract[] Locations { get; set; }
}
[DataContract]
public class LocationContract
{
[Required]
......@@ -40,7 +38,6 @@ namespace SDK.Contracts.Data
public DistanceContract[] Distances { get; set; }
}
[DataContract]
public class DistanceContract
{
public int BeaconId { get; set; }
......
......@@ -26,15 +26,15 @@ namespace SDK.Models
public long Modified { get; set; }
public GpsItemContract[] GpsItems { get; set; }
public GpsItemContract[]? GpsItems { get; set; }
public AreaContract[] Areas { get; set; }
public AreaContract[]? Areas { get; set; }
public BarrierContract[] Barriers { get; set; }
public BarrierContract[]? Barriers { get; set; }
public BeaconContract[] Beacons { get; set; }
public BeaconContract[]? Beacons { get; set; }
public SensorContract[] Sensors { get; set; }
public SensorContract[]? Sensors { get; set; }
}
public class BarrierContract
......
......@@ -27,6 +27,6 @@ namespace SDK.Models
public SensorDataContract[] SensorData { get; set; }
public int AreaId { get; set; }
public int? AreaId { get; set; }
}
}
namespace Core.Enum
{
public enum FallType : byte
{
OK = 0,
ManDown = 1,
ManDownControl = 2,
ManDownPositive = 3,
ManDownNegative = 4,
ManDownNegativeAfterLimit = 5
}
}
......@@ -3,9 +3,9 @@
<PropertyGroup>
<PackageId>tDevKit</PackageId>
<TargetFramework>net5.0</TargetFramework>
<AssemblyVersion>2021.6.16.2</AssemblyVersion>
<FileVersion>2021.6.16.2</FileVersion>
<Version>2021.6.0</Version>
<AssemblyVersion>2021.6.22.23</AssemblyVersion>
<FileVersion>2021.6.22.23</FileVersion>
<Version>2021.6.21</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
......
......@@ -26,19 +26,5 @@ namespace Test
return (DevkitConnectorV3)DevkitFactory.CreateDevkitConnector(connectionOptions);
}
public static DevkitConnectorV3 GetConnector2()
{
ConnectionOptionsBuilder optionsBuilder = new ConnectionOptionsBuilder();
ConnectionOptions connectionOptions = optionsBuilder
.Url("http://twin.develop.rtls.solutions:8080/api/")
.Client("whirlpool")
.ClientGuid("a4b82880-9dca-41f1-971a-73690dd8b222")
.BranchGuid("87bdd503-fd94-46b7-ad0a-9e33fdd0c598")
.ApiKey("cmtOlrZbFUiEFjnXHpeMMjXkXOU2X6BYpcbICJBK")
.Version(ConnectionOptions.VERSION_3)
.Build();
return (DevkitConnectorV3)DevkitFactory.CreateDevkitConnector(connectionOptions);
}
}
}
......@@ -5,9 +5,9 @@
<IsPackable>false</IsPackable>
<AssemblyVersion>2021.6.16.2</AssemblyVersion>
<AssemblyVersion>2021.6.22.40</AssemblyVersion>
<FileVersion>2021.6.16.2</FileVersion>
<FileVersion>2021.6.22.40</FileVersion>
</PropertyGroup>
<ItemGroup>
......
using SDK.Contracts.Data;
using Core.Enum;
using SDK.Contracts.Data;
using SDK.Models;
using System;
using System.Collections.Generic;
......@@ -65,7 +66,7 @@ namespace Main
Y = 10.0,
//AppVersion = "1.0",
IsMoving = false,
//FallStatus = 0,
FallStatus = FallType.OK,
//Battery = 46f,
DeviceTypeId = 8,
Position = false,
......@@ -152,13 +153,13 @@ namespace Main
SensorContract sensor = new SensorContract
{
Id = 7351,
//Id = 7351,
Login = "sdk-sensor",
//Password = "sdk",
Title = "sdk-sensor",
SectorId = 2,
SensorData = sensorDataContracts,
AreaId = 19
//AreaId = 19
};
return sensor;
......
......@@ -30,7 +30,7 @@ namespace Test
{
area2 = await devkitConnector.GetArea(3);
}
catch (NotFoundException) {}
catch (NotFoundException exception) { }
Assert.IsNotNull(area1);
Assert.IsNull(area2);
await A_DeleteToken();
......
......@@ -32,7 +32,7 @@ namespace Test
{
beacon2 = await devkitConnector.GetBeacon(1);
}
catch (NotFoundException) { }
catch (NotFoundException exception) { }
Assert.IsNotNull(beacon1);
Assert.IsNull(beacon2);
await A_DeleteToken();
......@@ -48,7 +48,7 @@ namespace Test
{
beacon2 = await devkitConnector.AddBeacon(TestData.GetBeacon());
}
catch (BadRequestException)
catch (BadRequestException exception)
{
Assert.IsNull(null);
}
......@@ -60,7 +60,7 @@ namespace Test
{
beacon2 = await devkitConnector.GetBeacon(beacon.Id);
}
catch { }
catch (NotFoundException exception) { }
Assert.IsNull(beacon2);
await A_DeleteToken();
}
......@@ -81,7 +81,7 @@ namespace Test
var message = await devkitConnector.UpdateBeacon(beacon);
var temp = 0;
}
catch (BadRequestException)
catch (BadRequestException exception)
{
Assert.IsNotNull(null);
}
......
......@@ -31,7 +31,7 @@ namespace Test
{
branch2 = await devkitConnector.GetBranch(3);
}
catch (NotFoundException) { }
catch (NotFoundException exception) { }
Assert.IsNotNull(branch1);
Assert.IsNull(branch2);
await A_DeleteToken();
......
......@@ -17,15 +17,15 @@ namespace Test
//[TestMethod]
public async Task Devices0()
{
DevkitConnectorV3 temp = Helper.GetConnector2();
await devkitConnector.AddDevice(
new DeviceContract()
{
Title = "testt",
Login = "testt",
DeviceTypeId = 4
}
);
//DevkitConnectorV3 temp = Helper.GetConnectorWhirpool();
//await devkitConnector.AddDevice(
// new DeviceContract()
// {
// Title = "testt",
// Login = "testt",
// DeviceTypeId = 4
// }
//);
}
[TestMethod]
......@@ -47,7 +47,7 @@ namespace Test
{
device2 = await devkitConnector.GetDevice(1);
}
catch (NotFoundException) { }
catch (NotFoundException exception) { }
Assert.IsNotNull(device1);
Assert.IsNull(device2);
await A_DeleteToken();
......@@ -63,7 +63,7 @@ namespace Test
{
device2 = await devkitConnector.GetDevice("sdk-device2");
}
catch (NotFoundException) { }
catch (NotFoundException exception) { }
Assert.IsNotNull(device1);
Assert.IsNull(device2);
await A_DeleteToken();
......@@ -97,7 +97,7 @@ namespace Test
{
device2 = await devkitConnector.AddDevice(TestData.GetDevice());
}
catch (BadRequestException)
catch (BadRequestException exception)
{
Assert.IsNull(null);
}
......@@ -109,7 +109,7 @@ namespace Test
{
device2 = await devkitConnector.GetDevice(device.Id);
}
catch { }
catch (NotFoundException exception) { }
Assert.IsNull(device2);
await A_DeleteToken();
}
......@@ -130,7 +130,7 @@ namespace Test
var message = await devkitConnector.UpdateDevice(device);
var temp = 0;
}
catch (BadRequestException b)
catch (BadRequestException exception)
{
Assert.IsNotNull(null);
}
......
......@@ -31,7 +31,7 @@ namespace Test
{
layer2 = await devkitConnector.GetLayer(14);
}
catch (NotFoundException) { }
catch (NotFoundException exception) { }
Assert.IsNotNull(layer1);
Assert.IsNull(layer2);
await A_DeleteToken();
......
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