Skip to content

Commit

Permalink
Use huldra as testing facility
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Dec 8, 2023
1 parent e5db609 commit 50a4c20
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
43 changes: 14 additions & 29 deletions backend/api/Database/Context/InitDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,16 @@ private static List<AccessRole> GetAccessRoles()
};

var accessRole2 = new AccessRole
{
AccessLevel = RoleAccessLevel.ADMIN,
RoleName = "Role.Admin"
};

var accessRole3 = new AccessRole
{
Installation = installations[0],
AccessLevel = RoleAccessLevel.ADMIN,
RoleName = "Role.User.JSV"
RoleName = "Role.User.HUA"
};

return new List<AccessRole>(new[]
{
accessRole1,
accessRole2,
accessRole3
accessRole2
});
}

Expand All @@ -77,23 +70,15 @@ private static List<Installation> GetInstallations()
var installation1 = new Installation
{
Id = Guid.NewGuid().ToString(),
Name = "Johan Sverdrup",
InstallationCode = "JSV"
Name = "Huldra",
InstallationCode = "HUA"
};

/* // Adding another installation makes the tests fail
var installation2 = new Installation
{
Id = Guid.NewGuid().ToString(),
Name = "Kårstø Nature Gas",
InstallationCode = "KAA"
};
*/
// Adding another installation makes the tests fail currently

return new List<Installation>(new[]
{
installation1,
//installation2
installation1
});
}

Expand All @@ -103,7 +88,7 @@ private static List<Plant> GetPlants()
{
Id = Guid.NewGuid().ToString(),
Installation = installations[0],
Name = "Johan Sverdrup - P1",
Name = "HULDRA - P1",
PlantCode = "P1"
};

Expand Down Expand Up @@ -244,19 +229,19 @@ private static List<Source> GetSources()
{
var source1 = new Source
{
SourceId = "791",
SourceId = "986",
Type = MissionSourceType.Echo
};

var source2 = new Source
{
SourceId = "792",
SourceId = "990",
Type = MissionSourceType.Echo
};

var source3 = new Source
{
SourceId = "793",
SourceId = "991",
Type = MissionSourceType.Echo
};

Expand Down Expand Up @@ -410,7 +395,7 @@ private static List<MissionTask> GetMissionTasks()
PlanOrder = 0,
Pose = new Pose(300.0f, 50.0f, 200.0f, 0.0f, 0.0f, 0.0f, 1.0f),
URL = new Uri(
"https://stid.equinor.com/jsv/tag?tagNo=ABCD"
"https://stid.equinor.com/hua/tag?tagNo=ABCD"
),
Inspections = new List<EchoInspection>
{
Expand All @@ -426,7 +411,7 @@ private static List<MissionTask> GetMissionTasks()
PlanOrder = 0,
Pose = new Pose(300.0f, 50.0f, 200.0f, 0.0f, 0.0f, 0.0f, 1.0f),
URL = new Uri(
"https://stid.equinor.com/jsv/tag?tagNo=ABCD"
"https://stid.equinor.com/hua/tag?tagNo=ABCD"
),
Inspections = new List<EchoInspection>
{
Expand All @@ -446,7 +431,7 @@ private static List<MissionTask> GetMissionTasks()
PlanOrder = 0,
Pose = new Pose(300.0f, 50.0f, 200.0f, 0.0f, 0.0f, 0.0f, 1.0f),
URL = new Uri(
"https://stid.equinor.com/jsv/tag?tagNo=ABCD"
"https://stid.equinor.com/hua/tag?tagNo=ABCD"
),
Inspections = new List<EchoInspection>
{
Expand All @@ -466,7 +451,7 @@ private static List<MissionTask> GetMissionTasks()
PlanOrder = 0,
Pose = new Pose(300.0f, 50.0f, 200.0f, 0.0f, 0.0f, 0.0f, 1.0f),
URL = new Uri(
"https://stid.equinor.com/jsv/tag?tagNo=ABCD"
"https://stid.equinor.com/hua/tag?tagNo=ABCD"
),
Inspections = new List<EchoInspection>
{
Expand Down
2 changes: 1 addition & 1 deletion backend/api/Services/RobotService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public async Task<IEnumerable<Robot>> ReadAll()

public async Task<IEnumerable<string>> ReadAllActivePlants()
{
return await context.Robots.Where(r => r.Enabled && r.CurrentInstallation != null).Select(r => r.CurrentInstallation!.InstallationCode).ToListAsync();
return await GetRobotsWithSubModels().Where(r => r.Enabled && r.CurrentInstallation != null).Select(r => r.CurrentInstallation!.InstallationCode).ToListAsync();
}

public async Task<Robot> Update(Robot robot)
Expand Down
Empty file added backend/d1.py
Empty file.

0 comments on commit 50a4c20

Please sign in to comment.