feat: Migrate IO and Recipe systems to use real data sources

- Enhanced GetIOList() to read from DIO library (inputs, outputs, interlocks)
- Added interlock display to IOMonitorPage with 3-tab layout
- Migrated GetRecipeList() to use PUB.mdm.dataSet.OPModel table
- Migrated GetRecipe() to read from OPModel DataRow
- Migrated SaveRecipe() to save to OPModel table with type conversion
- Updated frontend to handle new structured IO format
- All methods now use real hardware/database instead of mock data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-25 21:09:23 +09:00
parent c625947b2e
commit 8364f7478c
5 changed files with 432 additions and 158 deletions

View File

@@ -94,7 +94,21 @@ export default function App() {
try {
const ioStr = await comms.getIOList();
const ioData = JSON.parse(ioStr);
setIoPoints(ioData);
// Handle new structured format: { inputs: [...], outputs: [...], interlocks: [...] }
let flatIoList: IOPoint[] = [];
if (ioData.inputs && ioData.outputs) {
// New format - flatten inputs and outputs
flatIoList = [
...ioData.outputs.map((io: any) => ({ id: io.id, name: io.name, type: 'output' as const, state: io.state })),
...ioData.inputs.map((io: any) => ({ id: io.id, name: io.name, type: 'input' as const, state: io.state }))
];
} else if (Array.isArray(ioData)) {
// Old format - already flat array
flatIoList = ioData;
}
setIoPoints(flatIoList);
addLog("IO LIST LOADED", "info");
} catch (e) {
addLog("FAILED TO LOAD IO DATA", "error");