@flexabrain/mcp-server
Version:
Advanced electrical schematic analysis MCP server with rail engineering expertise
205 lines • 6.11 kB
TypeScript
/**
* FlexaBrain MCP Server - PDF Schematic Processing Types
*
* Enhanced type definitions for multi-page PDF schematic processing,
* specifically designed for traction generator monitoring control systems.
*/
import { ElectricalComponent, BoundingBox } from './electrical.js';
import { OCRResult } from './schematic.js';
export interface PDFDocumentMetadata {
filename: string;
version?: string;
title?: string;
subject?: string;
creator?: string;
creation_date?: Date;
modification_date?: Date;
pages_count: number;
document_type: 'traction_control' | 'generator_monitoring' | 'power_distribution' | 'general';
rail_system_type?: string;
voltage_system?: string;
}
export interface SchematicPage {
page_number: number;
title: string;
schematic_type: SchematicPageType;
image_data: Buffer;
image_path: string;
dimensions: {
width: number;
height: number;
dpi: number;
};
components: ElectricalComponent[];
connections: PageConnection[];
ocr_results: OCRResult;
processing_time: number;
quality_score: number;
}
export declare enum SchematicPageType {
OVERVIEW = "overview",
DETAIL = "detail",
CONTROL_LOGIC = "control_logic",
WIRING_DIAGRAM = "wiring_diagram",
GENERATOR_MONITORING = "generator_monitoring",
COMPONENT_LIST = "component_list",
LEGEND = "legend"
}
export interface PageConnection {
id: string;
from_component: string;
to_component: string;
connection_type: 'power' | 'control' | 'signal' | 'data';
wire_reference?: string;
cable_reference?: string;
confidence: number;
path_coordinates?: BoundingBox[];
}
export interface CrossPageReference {
id: string;
source: ComponentReference;
target: ComponentReference;
reference_type: CrossReferenceType;
reference_text?: string;
confidence: number;
verified: boolean;
}
export interface ComponentReference {
component_id: string;
page_number: number;
component_type: string;
location: BoundingBox;
}
export declare enum CrossReferenceType {
CONTINUATION = "continuation",// Component continues on another page
DETAIL = "detail",// Detailed view on another page
CONTROL_SIGNAL = "control_signal",// Control signal reference
POWER_CONNECTION = "power_connection",// Power connection reference
MONITORING_POINT = "monitoring_point",// Generator monitoring reference
WIRE_REFERENCE = "wire_reference"
}
export interface PDFProcessingOptions {
extract_images: boolean;
enhance_quality: boolean;
detect_rotation: boolean;
extract_cross_references: boolean;
enable_line_detection: boolean;
processing_dpi: number;
ocr_language: string;
component_confidence_threshold: number;
}
export interface PDFProcessingResult {
document_id: string;
metadata: PDFDocumentMetadata;
pages: SchematicPage[];
cross_references: CrossPageReference[];
processing_stats: {
total_processing_time: number;
pages_processed: number;
components_found: number;
cross_references_found: number;
average_confidence: number;
};
errors: ProcessingError[];
warnings: ProcessingWarning[];
}
export interface ProcessingError {
code: string;
message: string;
page_number?: number;
component_id?: string;
severity: 'low' | 'medium' | 'high' | 'critical';
recovery_suggestions?: string[];
}
export interface ProcessingWarning {
code: string;
message: string;
page_number?: number;
component_id?: string;
impact: 'minimal' | 'moderate' | 'significant';
}
export interface GeneratorMonitoringComponents {
generators: GeneratorComponent[];
monitoring_points: MonitoringPoint[];
control_systems: ControlSystem[];
safety_systems: SafetySystem[];
}
export interface GeneratorComponent {
id: string;
type: 'main_generator' | 'auxiliary_generator' | 'exciter';
rating: PowerRating;
monitoring_sensors: string[];
control_interfaces: string[];
safety_interlocks: string[];
}
export interface MonitoringPoint {
id: string;
parameter_type: 'temperature' | 'pressure' | 'vibration' | 'voltage' | 'current' | 'frequency';
sensor_type: string;
measurement_range: {
min: number;
max: number;
unit: string;
};
alarm_thresholds: {
warning: number;
alarm: number;
trip: number;
};
connected_to: string[];
}
export interface ControlSystem {
id: string;
system_type: 'excitation_control' | 'voltage_regulation' | 'frequency_control' | 'protection';
control_loops: ControlLoop[];
interfaces: string[];
}
export interface ControlLoop {
id: string;
input_signals: string[];
output_signals: string[];
control_algorithm: string;
parameters: Record<string, number>;
}
export interface SafetySystem {
id: string;
protection_type: 'overcurrent' | 'overvoltage' | 'overtemperature' | 'differential' | 'ground_fault';
trip_conditions: TripCondition[];
bypass_conditions?: string[];
}
export interface TripCondition {
parameter: string;
threshold: number;
time_delay: number;
action: 'alarm' | 'trip' | 'lockout';
}
export interface PowerRating {
nominal_power: number;
power_unit: 'kW' | 'MW';
voltage: number;
voltage_unit: 'V' | 'kV';
current: number;
current_unit: 'A' | 'kA';
frequency: number;
power_factor: number;
}
export interface GeneratorComponentPattern {
component_type: string;
patterns: RegExp[];
prefixes: string[];
context_clues: string[];
confidence_boost: number;
typical_locations: string[];
associated_parameters: string[];
}
export interface TechnicalDrawingFeatures {
has_title_block: boolean;
has_component_list: boolean;
has_wire_numbers: boolean;
has_terminal_references: boolean;
has_cross_references: boolean;
drawing_scale?: string;
sheet_size?: string;
revision?: string;
}
//# sourceMappingURL=pdf-schematic.d.ts.map