From c49beb8218bbab457681edd6f98f0e5142f78a03 Mon Sep 17 00:00:00 2001 From: IDONTSUDO Date: Thu, 2 May 2024 17:30:59 +0300 Subject: [PATCH] progress --- .../domain/exec_weights_process_scenario.ts | 10 +-- ui/src/features/skils/skill_card.tsx | 65 +++++-------------- web_p/blender/assets/assets.json | 2 +- 3 files changed, 21 insertions(+), 56 deletions(-) diff --git a/server/src/features/weights/domain/exec_weights_process_scenario.ts b/server/src/features/weights/domain/exec_weights_process_scenario.ts index e22e254..42192be 100644 --- a/server/src/features/weights/domain/exec_weights_process_scenario.ts +++ b/server/src/features/weights/domain/exec_weights_process_scenario.ts @@ -7,6 +7,7 @@ import { MongoIdValidation } from "../../../core/validations/mongo_id_validation import { ProcessWatcherAndDatabaseUpdateService } from "../../datasets/domain/create_dataset_scenario"; import { WeightDBModel, IWeightModel } from "../models/weights_validation_model"; import { match } from "ts-pattern"; +import { FolderStructure } from "../../projects/domain/upload_file_to_to_project_scenario"; export class ExecWeightProcessScenario extends CallbackStrategyWithIdQuery { idValidationExpression = new MongoIdValidation(); @@ -15,8 +16,8 @@ export class ExecWeightProcessScenario extends CallbackStrategyWithIdQuery { return (await new IsHaveActiveProcessUseCase().call()).map(async () => { await WeightDBModel.findById(id).updateOne({ processStatus: "RUN" }); return match(model.processStatus) - .with("exec", "RUN", "none", () => this.exec(id, model, true)) - .with("new", () => this.exec(id, model, false)) + .with("exec", "RUN", "none", () => this.exec(id, model, false)) + .with("exec", "RUN", () => this.exec(id, model, true)) .otherwise(() => Result.error(`model status is ${model.processStatus}`)); }); }); @@ -27,12 +28,11 @@ export class ExecWeightProcessScenario extends CallbackStrategyWithIdQuery { .with(true, async () => { if (typeof model.project === "object" && typeof model.datasetId === "object") { console.log( - `${model.project.rootDir}/`, - `python3 $PYTHON_EDUCATION --path ${model.project.rootDir} --name ${model.name} --datasetName ${model.datasetId.name} --outpath ${model.project.rootDir} --type ${model.datasetId.formBuilder.output.typedataset} --epoch ${model.epoch} --pretrain ${preTrain}` + `python3 $PYTHON_EDUCATION --path ${model.project.rootDir}/${FolderStructure.datasets} --name ${model.name} --datasetName ${model.datasetId.name} --outpath ${model.project.rootDir}/${FolderStructure.weights} --type ${model.datasetId.formBuilder.output.typedataset} --epoch ${model.epoch} --pretrain ${preTrain}` ); return await new ExecProcessUseCase().call( `${model.project.rootDir}/`, - `python3 $PYTHON_EDUCATION --path ${model.project.rootDir} --name ${model.name} --datasetName ${model.datasetId.name} --outpath ${model.project.rootDir} --type ${model.datasetId.formBuilder.output.typedataset} --epoch ${model.epoch} --pretrain ${preTrain}`, + `python3 $PYTHON_EDUCATION --path ${model.project.rootDir}/${FolderStructure.datasets} --name ${model.name} --datasetName ${model.datasetId.name} --outpath ${model.project.rootDir}/${FolderStructure.weights} --type ${model.datasetId.formBuilder.output.typedataset} --epoch ${model.epoch} --pretrain ${preTrain}`, id, new ProcessWatcherAndDatabaseUpdateService(id as unknown as ObjectId, WeightDBModel) ); diff --git a/ui/src/features/skils/skill_card.tsx b/ui/src/features/skils/skill_card.tsx index 57e9c5d..8ba994c 100644 --- a/ui/src/features/skils/skill_card.tsx +++ b/ui/src/features/skils/skill_card.tsx @@ -100,6 +100,21 @@ export const SkillCard = (props: ISkillCardProps) => {
{match(props.processStatus) + .with(ProcessStatus.ERROR, () => ( + <> + { + if (props.startOnClick && props.id) props.startOnClick(props.id); + }} + filled={true} + text="Ошибка" + /> + + )) + .with(ProcessStatus.END, () => ( <> {
); }; -// {props.processStatus === ProcessStatus.NONE ? ( -// <> -//
-// { -// if (props.continueOnClick && props.id) props.continueOnClick(props.id); -// }} -// /> -// -// ) : null} -// {props.processStatus === ProcessStatus.END ? ( -// <> -// { -// if (props.startOnClick && props.id) props.startOnClick(props.id); -// }} -// /> -//
-// { -// if (props.continueOnClick && props.id) props.continueOnClick(props.id); -// }} -// /> -// -// ) : null} -// {props.processStatus === ProcessStatus.RUN ? ( -// <> -// { -// // if (props.type.isEqual(CardDataSetType.COMPLETED) && props.onClickButton && props.id) { -// // props.onClickButton(props.id); -// }} -// block={true} -// text="Стоп" -// /> -// -// ) : null} -// {props.processStatus === ProcessStatus.ERROR ? ( -// {}} -// filled={true} -// text="Ошибка" -// /> -// ) : null} diff --git a/web_p/blender/assets/assets.json b/web_p/blender/assets/assets.json index f661cbb..fb9ae8f 100644 --- a/web_p/blender/assets/assets.json +++ b/web_p/blender/assets/assets.json @@ -1,6 +1,6 @@ { "assets": [ - { "name": "bear_holder", "mesh": "./mesh/fork.stl", "image": "./images/bear_holder_220425.png" }, + { "name": "fork", "mesh": "./mesh/fork.stl", "image": "./images/bear_holder_220425.png" }, { "name": "bear_holder1", "mesh": "./mesh/fork.stl", "image": "./images/bear_holder_220425.png" } ] }