progress scene builder
This commit is contained in:
parent
0a4eea19c5
commit
50d0c4c12b
64 changed files with 858 additions and 1315 deletions
|
@ -8,6 +8,7 @@ import {
|
|||
InstanceType,
|
||||
SceneSimpleObject,
|
||||
} from "../../../core/model/robossembler_assets";
|
||||
import { Result } from "../../../core/helper/result";
|
||||
|
||||
export enum RobossemblerFiles {
|
||||
robossemblerAssets = "robossembler_assets.json",
|
||||
|
@ -137,19 +138,11 @@ export class CameraViewModel extends BaseSceneItemModel {
|
|||
};
|
||||
}
|
||||
|
||||
validate(cameraLinksNames: string[]) {
|
||||
if (cameraLinksNames.filter((el) => this.cameraLink === el).isNotEmpty()) {
|
||||
return { cameraLink: "the name for the camera is not unique" };
|
||||
}
|
||||
validate(): Result<string, CameraViewModel> {
|
||||
if (this.cameraLink.isEmpty()) {
|
||||
return { cameraLink: "is empty" };
|
||||
}
|
||||
if (this.topicImage.isEmpty()) {
|
||||
return { topicImage: "is empty" };
|
||||
}
|
||||
if (this.topicCameraInfo.isEmpty()) {
|
||||
return { topicCameraInfo: "is empty" };
|
||||
return Result.error("cameraLink is empty");
|
||||
}
|
||||
return Result.ok(this);
|
||||
}
|
||||
|
||||
mapPerspectiveCamera(htmlSceneWidth: number, htmlSceneHeight: number) {
|
||||
|
|
4
ui/src/features/scene_manager/model/scene_model.ts
Normal file
4
ui/src/features/scene_manager/model/scene_model.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export interface SceneModel {
|
||||
_id: string;
|
||||
name: string;
|
||||
}
|
17
ui/src/features/scene_manager/model/scene_view_model.ts
Normal file
17
ui/src/features/scene_manager/model/scene_view_model.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { Result } from "../../../core/helper/result";
|
||||
|
||||
export class SceneViewModel {
|
||||
name: string;
|
||||
constructor(name: string) {
|
||||
this.name = name;
|
||||
}
|
||||
static empty() {
|
||||
return new SceneViewModel("");
|
||||
}
|
||||
valid = (): Result<string,SceneViewModel> => {
|
||||
if (this.name.isEmpty()) {
|
||||
return Result.error("name is empty");
|
||||
}
|
||||
return Result.ok(this);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue