Backend changes (C#): - Add SelectRecipe method to MachineBridge for recipe selection - Add currentRecipeId tracking in MainForm - Implement SELECT_RECIPE handler in WebSocketServer Frontend changes (React/TypeScript): - Add selectRecipe method to communication layer - Update handleSelectRecipe to call backend and handle response - Recipe selection updates ModelInfoPanel automatically - Add error handling and logging for recipe operations Layout improvements: - Add Layout component with persistent Header and Footer - Create separate IOMonitorPage for full-screen I/O monitoring - Add dynamic IO tab switcher in Header (Inputs/Outputs) - Ensure consistent UI across all pages 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
75 lines
1.6 KiB
TypeScript
75 lines
1.6 KiB
TypeScript
export enum SystemState {
|
|
IDLE = 'IDLE',
|
|
RUNNING = 'RUNNING',
|
|
ERROR = 'ERROR',
|
|
PAUSED = 'PAUSED',
|
|
}
|
|
|
|
export interface AxisPosition {
|
|
id: string;
|
|
name: string;
|
|
axis: 'X' | 'Y' | 'Z';
|
|
value: number;
|
|
speed: number;
|
|
acc: number;
|
|
dec: number;
|
|
}
|
|
|
|
export interface Recipe {
|
|
id: string;
|
|
name: string;
|
|
lastModified: string;
|
|
}
|
|
|
|
export interface IOPoint {
|
|
id: number;
|
|
name: string;
|
|
type: 'input' | 'output';
|
|
state: boolean;
|
|
}
|
|
|
|
export interface LogEntry {
|
|
id: number;
|
|
timestamp: string;
|
|
message: string;
|
|
type: 'info' | 'warning' | 'error';
|
|
}
|
|
|
|
export interface RobotTarget {
|
|
x: number;
|
|
y: number;
|
|
z: number;
|
|
}
|
|
|
|
// WebView2 Native Bridge Types
|
|
export interface ConfigItem {
|
|
Key: string;
|
|
Value: string;
|
|
Group: string;
|
|
Type: 'String' | 'Number' | 'Boolean';
|
|
Description: string;
|
|
}
|
|
|
|
declare global {
|
|
interface Window {
|
|
chrome: {
|
|
webview: {
|
|
hostObjects: {
|
|
machine: {
|
|
MoveAxis(axis: string, value: number): Promise<void>;
|
|
SetIO(id: number, isInput: boolean, state: boolean): Promise<void>;
|
|
SystemControl(command: string): Promise<void>;
|
|
LoadRecipe(recipeId: string): Promise<void>;
|
|
GetConfig(): Promise<string>;
|
|
GetIOList(): Promise<string>;
|
|
GetRecipeList(): Promise<string>;
|
|
SaveConfig(configJson: string): Promise<void>;
|
|
}
|
|
};
|
|
addEventListener(type: string, listener: (event: any) => void): void;
|
|
removeEventListener(type: string, listener: (event: any) => void): void;
|
|
postMessage(message: any): void;
|
|
}
|
|
}
|
|
}
|
|
} |