Portal/rsconcept/frontend/src/features/oss/models/oss.ts

108 lines
2.1 KiB
TypeScript
Raw Normal View History

2024-06-07 20:17:03 +03:00
/**
* Module: Schema of Synthesis Operations.
*/
import { ILibraryItemData } from '@/features/library/models/library';
import { ICstSubstitute } from '@/features/rsform';
2025-02-12 21:36:03 +03:00
import { Graph } from '@/models/Graph';
2024-06-07 20:17:03 +03:00
2024-07-20 18:26:32 +03:00
/**
* Represents {@link IOperation} type.
*/
export enum OperationType {
INPUT = 'input',
SYNTHESIS = 'synthesis'
}
/**
* Represents Operation.
*/
export interface IOperation {
2025-02-17 15:11:32 +03:00
id: number;
2024-07-20 18:26:32 +03:00
operation_type: OperationType;
2025-02-12 15:12:59 +03:00
oss: number;
2024-07-20 18:26:32 +03:00
alias: string;
title: string;
comment: string;
2024-07-24 22:23:05 +03:00
2024-07-20 18:26:32 +03:00
position_x: number;
position_y: number;
2025-02-12 15:12:59 +03:00
result: number | null;
is_owned: boolean;
2024-08-17 12:16:50 +03:00
is_consolidation: boolean; // aka 'diamond synthesis'
substitutions: ICstSubstituteEx[];
2025-02-17 15:11:32 +03:00
arguments: number[];
2024-07-20 18:26:32 +03:00
}
/**
* Represents {@link IOperation} Argument.
*/
export interface IArgument {
2025-02-17 15:11:32 +03:00
operation: number;
argument: number;
2024-07-20 18:26:32 +03:00
}
/**
* Represents {@link ICstSubstitute} extended data.
*/
export interface ICstSubstituteEx extends ICstSubstitute {
2025-02-17 15:11:32 +03:00
operation: number;
2024-07-20 18:26:32 +03:00
original_alias: string;
original_term: string;
substitution_alias: string;
substitution_term: string;
}
2024-07-26 00:33:22 +03:00
/**
* Represents {@link IOperationSchema} statistics.
*/
export interface IOperationSchemaStats {
count_operations: number;
count_inputs: number;
count_synthesis: number;
count_schemas: number;
2024-08-23 21:28:54 +03:00
count_owned: number;
2024-07-26 00:33:22 +03:00
}
2024-07-20 18:26:32 +03:00
/**
* Represents OperationSchema.
2024-06-07 20:17:03 +03:00
*/
export interface IOperationSchema extends ILibraryItemData {
items: IOperation[];
2024-07-20 18:26:32 +03:00
arguments: IArgument[];
substitutions: ICstSubstituteEx[];
2024-06-07 20:17:03 +03:00
2024-07-20 18:26:32 +03:00
graph: Graph;
2025-02-12 15:12:59 +03:00
schemas: number[];
2024-07-26 00:33:22 +03:00
stats: IOperationSchemaStats;
2025-02-17 15:11:32 +03:00
operationByID: Map<number, IOperation>;
2024-07-20 18:26:32 +03:00
}
2024-08-26 17:24:46 +03:00
/**
* Represents substitution error description.
*/
export interface ISubstitutionErrorDescription {
errorType: SubstitutionErrorType;
params: string[];
}
/**
* Represents Substitution table error types.
*/
export enum SubstitutionErrorType {
invalidIDs,
incorrectCst,
2024-08-26 17:24:46 +03:00
invalidClasses,
invalidBasic,
invalidConstant,
typificationCycle,
baseSubstitutionNotSet,
unequalTypification,
unequalExpressions,
unequalArgsCount,
unequalArgs
2024-08-26 17:24:46 +03:00
}