diff --git a/ui/src/core/model/skill_model.ts b/ui/src/core/model/skill_model.ts index d9e3a40..b2b78cf 100644 --- a/ui/src/core/model/skill_model.ts +++ b/ui/src/core/model/skill_model.ts @@ -36,7 +36,7 @@ export interface IWeightsDependency { export interface IDeviceDependency { sid: string; } -export interface IDependency {} +export interface IDependency { } export interface IParam { isFilled: boolean; type: string; @@ -276,7 +276,7 @@ export class SkillModel extends ValidationModel implements ISkill { } export class SkillDependency implements IDependency { - constructor(public skills: ISkillDependency[]) {} + constructor(public skills: ISkillDependency[]) { } static empty() { return new SkillDependency([]); } @@ -424,24 +424,27 @@ export class Skills { .flat(1) .filter((el) => el !== ""); - getDependencyBySkillLabelAndType = (skillType: string, sid: string): DependencyViewModel => - this.skills - .reduce((acc, skill) => { - if (skill.sid?.isEqual(sid)) { - skill.BTAction.map((action) => { - action.param.map((param) => { - if (param.type.isEqualR(skillType)) { - acc.push(param?.dependency ?? DependencyViewModel.empty()); - } - return param; - }); - return action; - }); - } + getDependencyBySkillLabelAndType = (skillType: string, sid: string): DependencyViewModel => this.skills + .reduce((acc, skill) => { + if (skill.sid?.isEqual(sid)) { + skill.BTAction.map((action) => { + action.param.map((param) => { - return acc; - }, []) - .at(0) ?? DependencyViewModel.empty(); + if (param.type.isEqual(skillType)) { + + + acc.push(param?.dependency ?? DependencyViewModel.empty()); + } + // console.log(acc); + return param; + }); + return action; + }); + } + + return acc; + }, []) + .at(0) ?? DependencyViewModel.empty() static isEmpty(model: Skills): Result { if (model.skills.isEmpty()) { return Result.error(undefined); diff --git a/ui/src/core/ui/form_builder/forms/select_dataset/presentation/select_process.tsx b/ui/src/core/ui/form_builder/forms/select_dataset/presentation/select_process.tsx index cc732fb..68a80ca 100644 --- a/ui/src/core/ui/form_builder/forms/select_dataset/presentation/select_process.tsx +++ b/ui/src/core/ui/form_builder/forms/select_dataset/presentation/select_process.tsx @@ -13,7 +13,6 @@ import { CalculationModel } from "../../../../../../features/calculation_instanc export const SelectProcess = observer((props: IFormBuilderComponentsProps) => { const [store] = useState(new SelectProcessStore()); useEffect(() => { - console.log(props.dependency); if (typeof props.dependency === "string") { store.loadClassInstance(SelectProcessModel, JSON.parse(props.dependency)); } else { diff --git a/ui/src/features/behavior_tree_builder/presentation/behavior_tree_builder_screen.tsx b/ui/src/features/behavior_tree_builder/presentation/behavior_tree_builder_screen.tsx index 4a746f8..896cb49 100644 --- a/ui/src/features/behavior_tree_builder/presentation/behavior_tree_builder_screen.tsx +++ b/ui/src/features/behavior_tree_builder/presentation/behavior_tree_builder_screen.tsx @@ -49,7 +49,9 @@ export const BehaviorTreeBuilderScreen = observer(() => { if (ref.current) { // @ts-expect-error const domReact: DOMReact = ref.current.getBoundingClientRect(); - store.dragZoneSetOffset(0, domReact.y, domReact.width, domReact.height); + + // УБЕРИ + 300 + store.dragZoneSetOffset(0, domReact.y, domReact.width + 300, domReact.height); } }, [ref.current]); @@ -198,11 +200,13 @@ export const BehaviorTreeBuilderScreen = observer(() => { ) .rFind((form) => form.name.isEqual(formType)) .fold( - (s) => ( -
- {s.component} -
- ), + (s) => { + return ( +
+ {s.component} +
+ ); + }, () => (
Error: Unknown form type {formType} diff --git a/ui/src/features/behavior_tree_builder/presentation/behavior_tree_builder_store.tsx b/ui/src/features/behavior_tree_builder/presentation/behavior_tree_builder_store.tsx index 6a1c487..2e8a6fd 100644 --- a/ui/src/features/behavior_tree_builder/presentation/behavior_tree_builder_store.tsx +++ b/ui/src/features/behavior_tree_builder/presentation/behavior_tree_builder_store.tsx @@ -93,7 +93,7 @@ export class BehaviorTreeBuilderStore extends UiDrawerFormState this.panels.push(new PanelBody(undefined, undefined, undefined)); removePanel = (index: number) => this.panels.length !== 1 @@ -130,6 +130,13 @@ export class BehaviorTreeBuilderStore extends UiDrawerFormState { const drawPoint = { x: x, y: y, w: 1, h: 1 }; + + console.log( + drawPoint.x < this.area!.x + this.area!.w && + drawPoint.x + drawPoint.w > this.area!.x && + drawPoint.y < this.area!.y + this.area!.h && + drawPoint.y + drawPoint.h > this.area!.y + ); if ( drawPoint.x < this.area!.x + this.area!.w && drawPoint.x + drawPoint.w > this.area!.x && @@ -143,7 +150,7 @@ export class BehaviorTreeBuilderStore extends UiDrawerFormState { @@ -235,7 +242,6 @@ export class BehaviorTreeBuilderStore extends UiDrawerFormState { - console.log(xml); this.behaviorTreeModel.skills = this.filledOutTemplates; this.behaviorTreeModel.scene = NodeBehaviorTree.fromReteScene( this.editor as NodeEditor, diff --git a/ui/src/features/behavior_tree_builder/presentation/ui/forms/form_builder/form_builder_form.tsx b/ui/src/features/behavior_tree_builder/presentation/ui/forms/form_builder/form_builder_form.tsx index 26bd6b7..dfffe63 100644 --- a/ui/src/features/behavior_tree_builder/presentation/ui/forms/form_builder/form_builder_form.tsx +++ b/ui/src/features/behavior_tree_builder/presentation/ui/forms/form_builder/form_builder_form.tsx @@ -19,7 +19,7 @@ export const FormBuilderForm = observer((props: IPropsForm +
FormBuilder
{store.isBtScreen ? (
@@ -27,7 +27,6 @@ export const FormBuilderForm = observer((props: IPropsForm { store.viewModel = form; - console.log(form); }} />