Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototypical addition of an automatic patient tray (Thesis of @ClFeSc) #450

Draft
wants to merge 27 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4088e02
Initial thesis commit
ClFeSc Jun 14, 2022
0df9156
Add `isAutomaticPatientField` to `Viewport`
ClFeSc Jun 23, 2022
9e7e903
Add algorithm
ClFeSc Jun 23, 2022
f5b41e9
Call automatic patient fields in tick
ClFeSc Jun 23, 2022
f515b38
Track TODOs in one central file
ClFeSc Jun 23, 2022
00bfb36
Merge pull request #1 from ClFeSc/feature/algorithm
ClFeSc Jun 23, 2022
22baf73
Add ability to set whether a viewport should be automated
ClFeSc Jun 23, 2022
a45b1ba
Add information about automated viewports to viewport popup
ClFeSc Jun 26, 2022
3b323c3
Fix multiple issues in Frontend
ClFeSc Jun 27, 2022
d664265
Only display information when > 0
ClFeSc Jun 27, 2022
c59ebe3
Prevent viewport popup content from floating out of the box
ClFeSc Jun 27, 2022
d8a86e5
Add TODOs to todo file
ClFeSc Jun 27, 2022
7fc8d3e
Merge pull request #2 from ClFeSc/feature/ui
ClFeSc Jun 27, 2022
55a94f1
Always position material, personnel & vehicles
ClFeSc Jun 27, 2022
5a7e2e9
Start adding transfer code
ClFeSc Jun 27, 2022
9b26e0e
Fix multiple issues & bump state version to 3
ClFeSc Jun 28, 2022
cd50401
Add UI to change transfer
ClFeSc Jun 28, 2022
7fba6a6
Merge pull request #3 from ClFeSc/feature/transport-patients
ClFeSc Jun 28, 2022
59a8a68
Fix some issues
ClFeSc Jun 29, 2022
a6dae78
Re-enable occasional treat & fix error with green, non-walkable patients
ClFeSc Jun 30, 2022
2b16eb7
Remove outdated comment
ClFeSc Jun 30, 2022
2d13414
Fix spelling in comment
ClFeSc Jul 9, 2022
1ac12df
Add script to create scenario
ClFeSc Jul 10, 2022
87ed714
Merge pull request #4 from ClFeSc/feature/script
ClFeSc Jul 10, 2022
bd23e00
Improve performance
ClFeSc Jul 11, 2022
15cf86f
Fix problem where vehicles would be picked for transport that are unable
ClFeSc Jul 11, 2022
ab1a6e3
Remove console statement about thesis
ClFeSc Jul 22, 2022
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
3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"migration:run:windows": "npm run typeorm:cli:windows migration:run",
"migration:revert": "npm run typeorm:cli migration:revert",
"migration:revert:windows": "npm run typeorm:cli:windows migration:revert",
"db:purge": "node --experimental-specifier-resolution=node --loader ts-node/esm src/database/scripts/purge.ts"
"db:purge": "node --experimental-specifier-resolution=node --loader ts-node/esm src/database/scripts/purge.ts",
"generate:exercise": "node --experimental-specifier-resolution=node --loader ts-node/esm src/generate-exercise.ts"
},
"private": true,
"engines": {
Expand Down
16 changes: 16 additions & 0 deletions backend/src/database/state-migrations/disallow-migration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { UUID } from 'digital-fuesim-manv-shared';
import type { ExerciseWrapper } from 'exercise/exercise-wrapper';
import type { EntityManager } from 'typeorm';
import { RestoreError } from '../../utils/restore-error';

export const disallowMigration = {
database: (_entityManager: EntityManager, exerciseId: UUID) => {
throw new RestoreError('The migration is not possible', exerciseId);
},
inMemory: (exerciseWrapper: ExerciseWrapper) => {
throw new RestoreError(
'The migration is not possible',
exerciseWrapper.id ?? 'unknown id'
);
},
};
16 changes: 4 additions & 12 deletions backend/src/database/state-migrations/migrations.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { UUID } from 'digital-fuesim-manv-shared';
import type { EntityManager } from 'typeorm';
import type { ExerciseWrapper } from '../../exercise/exercise-wrapper';
import { RestoreError } from '../../utils/restore-error';
import { disallowMigration } from './disallow-migration';

/**
* Such a function MUST update the initial state of the exercise with the provided {@link exerciseId} as well as every action associated with it from its current state version to the next version in a way that they are valid states/actions.
Expand Down Expand Up @@ -36,17 +36,9 @@ export interface MigrationFunctions {
export const migrations: {
[key: number]: MigrationFunctions;
} = {
2: {
database: (_entityManager: EntityManager, exerciseId: UUID) => {
throw new RestoreError('The migration is not possible', exerciseId);
},
inMemory: (exerciseWrapper: ExerciseWrapper) => {
throw new RestoreError(
'The migration is not possible',
exerciseWrapper.id ?? 'unknown id'
);
},
},
2: disallowMigration,
// TODO: Activate migration
3: disallowMigration,
};

export async function migrateInDatabaseTo(
Expand Down
Loading