diff --git a/App.tsx b/App.tsx index bf46ece..562885e 100644 --- a/App.tsx +++ b/App.tsx @@ -180,9 +180,9 @@ const App: React.FC = () => { }, [addLog]); // Tag Transmission Logic - const sendTag = useCallback((tagId: string) => { + const sendTag = useCallback((tagId: string | number) => { if (agvSerialRef.current) { - const paddedId = tagId.padStart(6, '0').slice(-6); + const paddedId = String(tagId).padStart(6, '0').slice(-6); const encoder = new TextEncoder(); const cmdBytes = encoder.encode("TAG"); const valBytes = encoder.encode(paddedId); @@ -704,7 +704,7 @@ const App: React.FC = () => { return; } - const id = 1; // Default AGV ID + const id = 0; // Default ACS ID = 0 const len = 1 + 1 + payload.length; // ID + CMD + DATA const buffer = [0x02, len, id, cmd, ...payload]; diff --git a/NewMap.json b/NewMap.json index 2e25694..818c2a4 100644 --- a/NewMap.json +++ b/NewMap.json @@ -1,1219 +1,1041 @@ { "Nodes": [ { - "Id": "N001", "Text": "Unloader", - "Position": "99, 251", - "Type": 0, "StationType": 3, + "CanDocking": true, + "DockDirection": 0, "ConnectedNodes": [ - "N002" + "12", + "14" ], - "RfidId": "0001", + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 1, "NodeTextForeColor": "White", - "NodeTextFontSize": 30, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": true, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N002", - "Text": "", - "Position": "249, 250", + "NodeTextFontSize": 30.0, + "Id": "N001", "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N001", - "N003" - ], - "RfidId": "0002", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true + "Position": "298, 270" }, { - "Id": "N003", - "Text": "", - "Position": "350, 301", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N002", - "N011", - "N022", - "N031" - ], - "RfidId": "0003", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N006", - "Text": "", - "Position": "527, 254", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N007", - "N022", - "N023" - ], - "RfidId": "0013", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N007", - "Text": "", - "Position": "609, 227", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N006", - "N019" - ], - "RfidId": "0014", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N008", - "Text": "", - "Position": "275, 441", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N009", - "N031" - ], - "RfidId": "0009", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N009", - "Text": "", - "Position": "184, 466", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N008", - "N010" - ], - "RfidId": "0010", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N010", "Text": "Cleaner", - "Position": "92, 465", - "Type": 0, "StationType": 2, - "ConnectedNodes": [ - "N009" - ], - "RfidId": "0011", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, "CanDocking": true, "DockDirection": 1, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N011", - "Text": "", - "Position": "450, 399", - "Type": 0, - "StationType": 0, "ConnectedNodes": [ - "N003", - "N012", - "N015", - "N031", - "N022" + "5", + "15" ], - "RfidId": "0005", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true - }, - { - "Id": "N012", - "Text": "", - "Position": "549, 450", + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 11, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N010", "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N011", - "N013", - "N015" - ], - "RfidId": "0006", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true + "Position": "298, 446" }, { - "Id": "N013", - "Text": "", - "Position": "616, 492", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N012", - "N014" - ], - "RfidId": "0007", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N014", "Text": "Loader", - "Position": "670, 526", - "Type": 0, "StationType": 1, - "ConnectedNodes": [ - "N013" - ], - "RfidId": "0008", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, "CanDocking": true, "DockDirection": 0, + "ConnectedNodes": [ + "6", + "16" + ], "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 8, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N014", + "Type": 0, + "Position": "520, 653" }, { - "Id": "N019", "Text": "Chg #1", - "Position": "668, 223", - "Type": 0, "StationType": 5, - "ConnectedNodes": [ - "N007" - ], - "RfidId": "0015", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, "CanDocking": true, "DockDirection": 1, + "ConnectedNodes": [], "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true - }, - { - "Id": "N022", - "Text": "", - "Position": "450, 300", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N003", - "N006", - "N011", - "N023", - "N031" - ], - "RfidId": "0012", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N023", - "Text": "", - "Position": "480, 183", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N006", - "N022", - "N024" - ], - "RfidId": "0016", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N024", - "Text": "", - "Position": "500, 135", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N023", - "N025" - ], - "RfidId": "0017", + "IsActive": true, + "RfidId": 15, "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N025", - "Text": "", - "Position": "573, 97", + "NodeTextFontSize": 7.0, + "Id": "N019", "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N024", - "N026" - ], - "RfidId": "0018", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true + "Position": "402, 375" }, { - "Id": "N026", "Text": "Chg #2", - "Position": "649, 87", - "Type": 0, "StationType": 5, - "ConnectedNodes": [ - "N025" - ], - "RfidId": "0019", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, "CanDocking": true, "DockDirection": 1, + "ConnectedNodes": [], "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 19, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N026", + "Type": 0, + "Position": "541, 570" }, { - "Id": "N015", "Text": "", - "Position": "449, 499", - "Type": 0, "StationType": 0, - "ConnectedNodes": [ - "N011", - "N012", - "N016" - ], - "RfidId": "0037", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, "CanDocking": false, "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N016", - "Text": "", - "Position": "422, 537", - "Type": 0, - "StationType": 0, "ConnectedNodes": [ - "N015", - "N017" - ], - "RfidId": "0036", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N017", - "Text": "", - "Position": "380, 557", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N016", - "N018" - ], - "RfidId": "0035", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, - "CanTurnLeft": true, - "CanTurnRight": true, - "DisableCross": false, - "IsActive": true - }, - { - "Id": "N018", - "Text": "", - "Position": "329, 561", - "Type": 0, - "StationType": 0, - "ConnectedNodes": [ - "N017", "N030", - "N005" + "N005", + "1" ], - "RfidId": "0034", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 34, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N018", + "Type": 0, + "Position": "213, 630" }, { - "Id": "N005", "Text": "", - "Position": "233, 561", - "Type": 0, "StationType": 0, + "CanDocking": false, + "DockDirection": 0, "ConnectedNodes": [ "N018", "N020", "N029" ], - "RfidId": "0033", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 33, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N005", + "Type": 0, + "Position": "113, 629" }, { - "Id": "N020", "Text": "", - "Position": "155, 560", - "Type": 0, "StationType": 0, + "CanDocking": false, + "DockDirection": 0, "ConnectedNodes": [ "N005", "N021", "N028" ], - "RfidId": "0032", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 32, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N020", + "Type": 0, + "Position": "38, 626" }, { - "Id": "N021", "Text": "", - "Position": "68, 558", - "Type": 0, "StationType": 0, + "CanDocking": false, + "DockDirection": 0, "ConnectedNodes": [ "N020", - "N027" + "N027", + "11" ], - "RfidId": "0031", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": false, - "DockDirection": 0, "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 31, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N021", + "Type": 0, + "Position": "-54, 626" }, { - "Id": "N027", "Text": "Buf #1", - "Position": "38, 637", - "Type": 0, "StationType": 4, + "CanDocking": true, + "DockDirection": 0, "ConnectedNodes": [ "N021" ], - "RfidId": "0041", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": true, - "DockDirection": 0, "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 41, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N027", + "Type": 0, + "Position": "-76, 676" }, { - "Id": "N028", "Text": "Buf #2", - "Position": "125, 639", - "Type": 0, "StationType": 4, + "CanDocking": true, + "DockDirection": 0, "ConnectedNodes": [ "N020" ], - "RfidId": "0040", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": true, - "DockDirection": 0, "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 40, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N028", + "Type": 0, + "Position": "12, 676" }, { - "Id": "N029", "Text": "Buf #3", - "Position": "203, 635", - "Type": 0, "StationType": 4, + "CanDocking": true, + "DockDirection": 0, "ConnectedNodes": [ "N005" ], - "RfidId": "0039", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": true, - "DockDirection": 0, "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 39, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N029", + "Type": 0, + "Position": "89, 674" }, { - "Id": "N030", "Text": "Buf #4", - "Position": "296, 638", - "Type": 0, "StationType": 4, + "CanDocking": true, + "DockDirection": 0, "ConnectedNodes": [ "N018" ], - "RfidId": "0038", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, - "CanDocking": true, - "DockDirection": 0, "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 38, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "N030", + "Type": 0, + "Position": "183, 675" }, { - "Id": "N031", "Text": "", - "Position": "350, 400", - "Type": 0, "StationType": 0, - "ConnectedNodes": [ - "N003", - "N008", - "N011", - "N022" - ], - "RfidId": "0030", - "NodeTextForeColor": "", - "NodeTextFontSize": 7, - "AliasName": "", - "SpeedLimit": 0, "CanDocking": false, "DockDirection": 0, + "ConnectedNodes": [ + "N018", + "2" + ], "CanTurnLeft": true, "CanTurnRight": true, "DisableCross": false, - "IsActive": true + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 2, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "1", + "Type": 0, + "Position": "285, 628" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "1", + "3" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 4, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "2", + "Type": 0, + "Position": "354, 628" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "2", + "4" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 3, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "3", + "Type": 0, + "Position": "400, 578" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "3", + "5" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 5, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "4", + "Type": 0, + "Position": "400, 499" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "4", + "6", + "7", + "N010" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 6, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "5", + "Type": 0, + "Position": "462, 451" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "5", + "N014" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 13, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "6", + "Type": 0, + "Position": "518, 519" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "5", + "8" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 7, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "7", + "Type": 0, + "Position": "517, 400" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "7", + "9", + "13" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 9, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "8", + "Type": 0, + "Position": "474, 353" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "8", + "10" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 10, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "9", + "Type": 0, + "Position": "517, 311" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "9", + "12" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 12, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "10", + "Type": 0, + "Position": "458, 268" + }, + { + "Text": "", + "StationType": 6, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "N021" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 14, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "11", + "Type": 0, + "Position": "-120, 625" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "10", + "N001" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 16, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "12", + "Type": 0, + "Position": "389, 270" + }, + { + "Text": "", + "StationType": 0, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "8" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 17, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "13", + "Type": 0, + "Position": "350, 353" + }, + { + "Text": "", + "StationType": 6, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "N001" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 18, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "14", + "Type": 0, + "Position": "224, 272" + }, + { + "Text": "", + "StationType": 6, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "N010" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 20, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "15", + "Type": 0, + "Position": "247, 449" + }, + { + "Text": "", + "StationType": 6, + "CanDocking": false, + "DockDirection": 0, + "ConnectedNodes": [ + "N014" + ], + "CanTurnLeft": true, + "CanTurnRight": true, + "DisableCross": false, + "SpeedLimit": 0, + "AliasName": "", + "IsActive": true, + "RfidId": 21, + "NodeTextForeColor": "", + "NodeTextFontSize": 7.0, + "Id": "16", + "Type": 0, + "Position": "517, 721" } ], "Labels": [ { - "Id": "LBL001", - "Type": 1, "Text": "Amkor Technology Korea", - "Position": "180, 105", "ForeColor": "White", "BackColor": "MidnightBlue", "FontFamily": "Arial", - "FontSize": 20, + "FontSize": 20.0, "FontStyle": 0, - "Padding": 5 + "Padding": 5, + "Id": "LBL001", + "Type": 1, + "Position": "180, 105" } ], "Images": [ { - "Id": "IMG001", - "Type": 2, "Name": "Image", - "Position": "633, 310", "ImagePath": "", "ImageBase64": "", "Scale": "1, 1", - "Opacity": 1, - "Rotation": 0 - } - ], - "Magnets": [ - { - "Id": "92130fcc-1d99-4a1c-99d6-7d48072d9a3f", - "Type": 4, - "P1": { - "X": 52, - "Y": 466 - }, - "P2": { - "X": 183, - "Y": 465 - }, - "ControlPoint": null - }, - { - "Id": "6d5f514a-c84d-42fd-951d-cc1836a02eb9", - "Type": 4, - "P1": { - "X": 315.7142857142857, - "Y": 562 - }, - "P2": { - "X": 449.7142857142857, - "Y": 399.2857142857143 - }, - "ControlPoint": { - "X": 485.39960039960044, - "Y": 568.185814185814 - } - }, - { - "Id": "fe5f3cc4-f995-4fa2-a55d-1bd77792c062", - "Type": 4, - "P1": { - "X": 449, - "Y": 498.6190476190476 - }, - "P2": { - "X": 549.2857142857142, - "Y": 449.4761904761904 - }, - "ControlPoint": { - "X": 469.6853146853147, - "Y": 417.5191475191474 - } - }, - { - "Id": "5a0edec2-7ac3-4c99-bbb4-8debde0c1d07", - "Type": 4, - "P1": { - "X": 317.14285714285717, - "Y": 562.7142857142857 - }, - "P2": { - "X": -8.270406275571691, - "Y": 556.7518162503355 - }, - "ControlPoint": null - }, - { - "Id": "def7c4b9-86db-42eb-aae6-0c6c9bedcc30", - "Type": 4, - "P1": { - "X": 38.24242424242431, - "Y": 675.8533133533133 - }, - "P2": { - "X": 40.39960039960053, - "Y": 561.0429570429569 - }, - "ControlPoint": null - }, - { - "Id": "624327ee-be0f-4373-b60a-786a93c1eabf", - "Type": 4, - "P1": { - "X": 124.90909090909095, - "Y": 676.51998001998 - }, - "P2": { - "X": 125.39960039960052, - "Y": 559.6620046620044 - }, - "ControlPoint": null - }, - { - "Id": "f1e885ae-55f7-42e9-b3aa-648541e97da0", - "Type": 4, - "P1": { - "X": 202.24242424242428, - "Y": 675.1866466866467 - }, - "P2": { - "X": 203.25674325674333, - "Y": 560.3286713286711 - }, - "ControlPoint": null - }, - { - "Id": "dc3e8061-2c99-4f24-ac9b-4020dd91fa8b", - "Type": 4, - "P1": { - "X": 296.9090909090909, - "Y": 675.1866466866467 - }, - "P2": { - "X": 295.39960039960044, - "Y": 562.4715284715284 - }, - "ControlPoint": null - }, - { - "Id": "e8242b99-ab7a-453f-b074-516cf7f8aa6b", - "Type": 4, - "P1": { - "X": 549.2857142857142, - "Y": 450.1428571428571 - }, - "P2": { - "X": 719, - "Y": 558 - }, - "ControlPoint": null - }, - { - "Id": "d9b18933-d211-4a46-9265-6d2543abc8f2", - "Type": 4, - "P1": { - "X": 349.85714285714283, - "Y": 399.71428571428567 - }, - "P2": { - "X": 449.7142857142857, - "Y": 399.2857142857143 - }, - "ControlPoint": { - "X": 400.39960039960044, - "Y": 349.6143856143856 - } - }, - { - "Id": "4ec4e1cd-2b6b-4e22-a0e3-1e91f83c90a6", - "Type": 4, - "P1": { - "X": 449.7142857142857, - "Y": 399.2857142857143 - }, - "P2": { - "X": 450.42857142857144, - "Y": 299.85714285714283 - }, - "ControlPoint": { - "X": 399.6853146853147, - "Y": 349.6143856143856 - } - }, - { - "Id": "c3de9569-3278-4b45-8c73-554e9a2241ad", - "Type": 4, - "P1": { - "X": 350.1428571428571, - "Y": 300.5714285714286 - }, - "P2": { - "X": 450.42857142857144, - "Y": 299.85714285714283 - }, - "ControlPoint": { - "X": 399.6853146853147, - "Y": 349.6143856143856 - } - }, - { - "Id": "c49475f5-5bae-49d1-aec9-8972b35f0624", - "Type": 4, - "P1": { - "X": 349.85714285714283, - "Y": 399.71428571428567 - }, - "P2": { - "X": 350.1428571428571, - "Y": 300.5714285714286 - }, - "ControlPoint": { - "X": 398.971028971029, - "Y": 349.6143856143856 - } - }, - { - "Id": "e47ba9a3-4678-4df6-bfbd-0f43cfd9dc40", - "Type": 4, - "P1": { - "X": 450, - "Y": 300 - }, - "P2": { - "X": 480, - "Y": 183 - }, - "ControlPoint": { - "X": 476, - "Y": 235 - } - }, - { - "Id": "d183c4a4-7de8-421a-bed2-4caa2e4b6e27", - "Type": 4, - "P1": { - "X": 480, - "Y": 183 - }, - "P2": { - "X": 700.2567432567432, - "Y": 90.47152847152849 - }, - "ControlPoint": { - "X": 493.88778460102014, - "Y": 76.24977555124613 - } - }, - { - "Id": "3e2ae683-f783-4001-a2a4-d56664ca89b8", - "Type": 4, - "P1": { - "X": 183, - "Y": 465 - }, - "P2": { - "X": 349.85714285714283, - "Y": 399.71428571428567 - }, - "ControlPoint": { - "X": 265.42857142857144, - "Y": 459.4597069597069 - } - }, - { - "Id": "b2b3d68a-2fe0-4bcd-b6de-0463a2b604e0", - "Type": 4, - "P1": { - "X": 350.1428571428571, - "Y": 300.5714285714286 - }, - "P2": { - "X": 41.113886113886245, - "Y": 266.75724275724275 - }, - "ControlPoint": { - "X": 223.25674325674333, - "Y": 201.75724275724275 - } - }, - { - "Id": "9bf4a200-eeb2-4a42-851c-1e596ac16c06", - "Type": 4, - "P1": { - "X": 450, - "Y": 300 - }, - "P2": { - "X": 716.7171740797905, - "Y": 226.11091587291276 - }, - "ControlPoint": { - "X": 550.92770039558, - "Y": 215.05828429396541 - } - }, - { - "Id": "5d340580-bb09-42d9-81ed-43e69f8921c3", - "Type": 4, - "P1": { - "X": 480, - "Y": 183 - }, - "P2": { - "X": 526.5263157894736, - "Y": 253.52631578947367 - }, - "ControlPoint": { - "X": 469.8750688166326, - "Y": 260.32144218870224 - } - }, - { - "Id": "f659dce6-5b29-44d7-9e51-e148dab3b02e", - "Type": 4, - "P1": { - "X": 350, - "Y": 301 - }, - "P2": { - "X": 450, - "Y": 399 - }, - "ControlPoint": null - }, - { - "Id": "10e46540-7a48-4f44-8b88-029c5a5115f1", - "Type": 4, - "P1": { - "X": 350, - "Y": 400 - }, - "P2": { - "X": 450, - "Y": 300 - }, - "ControlPoint": null - }, - { - "Id": "0417e191-5169-46be-ad45-607abdeae8a6", - "Type": 4, - "P1": { - "X": 450, - "Y": 399 - }, - "P2": { - "X": 549, - "Y": 450 - }, - "ControlPoint": null - }, - { - "Id": "26663018-221d-4ece-9dc0-7b40c19d31d8", - "Type": 4, - "P1": { - "X": 40.469394855230796, - "Y": 558.2519551312122 - }, - "P2": { - "X": 41.969394855230796, - "Y": 496.7519551312122 - }, - "ControlPoint": null - }, - { - "Id": "67eebd44-9a87-4298-be19-f8757c741b54", - "Type": 4, - "P1": { - "X": 125.96939485523076, - "Y": 563.2519551312122 - }, - "P2": { - "X": 125.96939485523076, - "Y": 495.7519551312122 - }, - "ControlPoint": null - }, - { - "Id": "5c4bdbc0-46b8-4e17-a6cc-43365d0f3bcb", - "Type": 4, - "P1": { - "X": 203.96939485523072, - "Y": 563.7519551312122 - }, - "P2": { - "X": 204.96939485523072, - "Y": 492.7519551312122 - }, - "ControlPoint": null - }, - { - "Id": "f67f7595-8f73-47e9-87be-4583239bb8e5", - "Type": 4, - "P1": { - "X": 296.9693948552307, - "Y": 564.7519551312122 - }, - "P2": { - "X": 295.4693948552307, - "Y": 493.2519551312122 - }, - "ControlPoint": null + "Opacity": 1.0, + "Rotation": 0.0, + "Id": "IMG001", + "Type": 2, + "Position": "633, 310" } ], "Marks": [ { + "X": 520.0, + "Y": 690.0, + "Rotation": -178.01940688369234, "Id": "2cb51787-c8cf-4ddb-97f0-b71f519d47dc", "Type": 3, - "Position": "684, 539", - "X": 684, - "Y": 539, - "Rotation": 119.877727797857 + "Position": "520, 690" }, { + "X": -74.0, + "Y": 624.0, + "Rotation": 90.0, "Id": "f704ebe0-1653-4559-b06f-1eaecafbefba", "Type": 3, - "Position": "40, 559", - "X": 40, - "Y": 559, - "Rotation": 90 + "Position": "-74, 624" }, { + "X": 12.0, + "Y": 625.0, + "Rotation": 90.0, "Id": "d5b27365-79a2-4351-84c3-6767941ec0be", "Type": 3, - "Position": "126, 560", - "X": 126, - "Y": 560, - "Rotation": 90 + "Position": "12, 625" }, { + "X": 91.0, + "Y": 625.0, + "Rotation": 89.2872271068898, "Id": "0367cafb-9f85-4440-b6b4-c802a58e6181", "Type": 3, - "Position": "203, 558", - "X": 203, - "Y": 558, - "Rotation": 89.2872271068898 + "Position": "91, 625" }, { + "X": 183.0, + "Y": 622.0, + "Rotation": 88.405167720722616, "Id": "1f4ab2c9-07f8-4675-802d-9b4824b55198", "Type": 3, - "Position": "296, 560", - "X": 296, - "Y": 560, - "Rotation": 88.40516772072262 + "Position": "183, 622" }, { + "X": 275.0, + "Y": 269.0, + "Rotation": 91.712220129051758, "Id": "15fddfa4-ff74-48ff-b922-4aacdce1960b", "Type": 3, - "Position": "81, 256", - "X": 81, - "Y": 256, - "Rotation": 74.50226651936697 - }, - { - "Id": "962bb671-6932-477d-9209-2c2a076cfb22", - "Type": 3, - "Position": "73, 466", - "X": 73, - "Y": 466, - "Rotation": 90 - }, - { - "Id": "cd9f8434-f223-4532-9b3e-5b44c738abbb", - "Type": 3, - "Position": "686, 196", - "X": 686, - "Y": 196, - "Rotation": 90 - }, - { - "Id": "61c6d1dd-6a39-4931-a530-9b44d2010139", - "Type": 3, - "Position": "669, 84", - "X": 669, - "Y": 84, - "Rotation": 90 + "Position": "275, 269" }, { + "X": 89.0, + "Y": 697.0, + "Rotation": 0.38243447796178032, "Id": "4b699847-36d4-471c-b990-4ad37967c2dc", "Type": 3, - "Position": "204, 655", - "X": 204, - "Y": 655, - "Rotation": 0.3824344779617803 + "Position": "89, 697" }, { + "X": 183.0, + "Y": 699.0, + "Rotation": -1.3380194104322385, "Id": "a9f68317-f1c2-47d8-b029-348b5428be9f", "Type": 3, - "Position": "296, 657", - "X": 296, - "Y": 657, - "Rotation": -1.3380194104322385 + "Position": "183, 699" }, { + "X": 9.0, + "Y": 699.0, + "Rotation": 0.84311038333069632, "Id": "fe227205-2a65-4ba9-bb4a-4efb4ed0a7b0", "Type": 3, - "Position": "122, 657", - "X": 122, - "Y": 657, - "Rotation": 0.8431103833306963 + "Position": "9, 699" }, { + "X": -74.0, + "Y": 697.0, + "Rotation": 1.659829660758831, "Id": "5dd29191-798c-480c-b066-7947bfcc4fb7", "Type": 3, - "Position": "40, 657", - "X": 40, - "Y": 657, - "Rotation": 1.659829660758831 + "Position": "-74, 697" }, { + "X": -71.0, + "Y": 596.0, + "Rotation": 0.0, "Id": "649729f0-ff04-4e11-8869-f6a39d815427", "Type": 3, - "Position": "39, 534", - "X": 39.4693948552308, - "Y": 533.7519551312122, - "Rotation": 0 + "Position": "-71, 596" }, { + "X": 10.0, + "Y": 601.0, + "Rotation": 0.0, "Id": "2bb9a821-f86b-4190-a182-64abe2c940ed", "Type": 3, - "Position": "125, 534", - "X": 125.46939485523076, - "Y": 533.7519551312122, - "Rotation": 0 + "Position": "10, 601" }, { + "X": 91.0, + "Y": 598.0, + "Rotation": 0.0, "Id": "821598e1-091a-4884-96fe-6ed5f43c4f62", "Type": 3, - "Position": "203, 532", - "X": 203.46939485523072, - "Y": 532.2519551312122, - "Rotation": 0 + "Position": "91, 598" }, { + "X": 184.0, + "Y": 596.0, + "Rotation": 0.0, "Id": "66c1bbee-89a8-45a9-b585-ddfd59768f6b", "Type": 3, - "Position": "295, 533", - "X": 295.4693948552307, - "Y": 533.2519551312122, - "Rotation": 0 + "Position": "184, 596" + }, + { + "X": 381.0, + "Y": 355.0, + "Rotation": 91.245364266768377, + "Id": "06a10f46-bda8-4b0f-9e7a-63d66bd2f7e4", + "Type": 3, + "Position": "381, 355" + }, + { + "X": 519.0, + "Y": 550.0, + "Rotation": 0.0, + "Id": "835b8982-042b-4e2e-a83b-19b32e55cd5b", + "Type": 3, + "Position": "519, 550" + } + ], + "Magnets": [ + { + "P1": { + "X": 358.53781512605048, + "Y": 628.438429217841 + }, + "P2": { + "X": -119.57759581805529, + "Y": 626.78449598889756 + }, + "ControlPoint": null, + "Id": "5a0edec2-7ac3-4c99-bbb4-8debde0c1d07", + "Type": 4 + }, + { + "P1": { + "X": -75.0847526191485, + "Y": 716.14155614369508 + }, + "P2": { + "X": -73.1298113651053, + "Y": 561.63119233707459 + }, + "ControlPoint": null, + "Id": "def7c4b9-86db-42eb-aae6-0c6c9bedcc30", + "Type": 4 + }, + { + "P1": { + "X": 12.69302515862924, + "Y": 717.25266725480617 + }, + "P2": { + "X": 11.870188634894689, + "Y": 560.25023995612207 + }, + "ControlPoint": null, + "Id": "624327ee-be0f-4373-b60a-786a93c1eabf", + "Type": 4 + }, + { + "P1": { + "X": 90.470802936406983, + "Y": 716.14155614369508 + }, + "P2": { + "X": 89.727331492037507, + "Y": 560.91690662278882 + }, + "ControlPoint": null, + "Id": "f1e885ae-55f7-42e9-b3aa-648541e97da0", + "Type": 4 + }, + { + "P1": { + "X": 185.470802936407, + "Y": 725.03044503258388 + }, + "P2": { + "X": 181.87018863489462, + "Y": 563.059763765646 + }, + "ControlPoint": null, + "Id": "dc3e8061-2c99-4f24-ac9b-4020dd91fa8b", + "Type": 4 + }, + { + "P1": { + "X": 343.98784548784573, + "Y": 353.92216117216128 + }, + "P2": { + "X": 472.59413991107186, + "Y": 353.73144759338567 + }, + "ControlPoint": null, + "Id": "f4c97a5a-2c2c-4b5e-9dd5-332b1670b827", + "Type": 4 + }, + { + "P1": { + "X": 519.32722832722823, + "Y": 720.25490196078408 + }, + "P2": { + "X": 516.16556848250036, + "Y": 309.44573330767145 + }, + "ControlPoint": null, + "Id": "a5424add-e8c9-483c-a5db-733dca1b8f57", + "Type": 4 + }, + { + "P1": { + "X": 249.62404756406329, + "Y": 449.77059623383167 + }, + "P2": { + "X": 518.08558602560174, + "Y": 452.84751931075476 + }, + "ControlPoint": null, + "Id": "0bbb27a4-2355-4294-9f2d-a40e4d3d2930", + "Type": 4 + }, + { + "P1": { + "X": 225.77789371790945, + "Y": 271.30905777229322 + }, + "P2": { + "X": 463.66556848250042, + "Y": 269.44573330767145 + }, + "ControlPoint": null, + "Id": "92527d4a-8e63-404f-86e8-37568bd4790e", + "Type": 4 + }, + { + "P1": { + "X": 463.41452991452985, + "Y": 270.25490196078431 + }, + "P2": { + "X": 515.08119658119654, + "Y": 310.25490196078425 + }, + "ControlPoint": { + "X": 517.85897435897425, + "Y": 266.3660130718954 + }, + "Id": "0db9553a-f203-478d-8c17-e07f00987828", + "Type": 4 + }, + { + "P1": { + "X": 473.41452991452985, + "Y": 353.032679738562 + }, + "P2": { + "X": 515.63675213675208, + "Y": 399.14379084967311 + }, + "ControlPoint": { + "X": 521.74786324786317, + "Y": 351.3660130718954 + }, + "Id": "0650b2cb-57f9-44ec-9787-fab878cf2b47", + "Type": 4 + }, + { + "P1": { + "X": 465.08119658119654, + "Y": 450.2549019607842 + }, + "P2": { + "X": 518.24918584253533, + "Y": 519.05971509141114 + }, + "ControlPoint": { + "X": 522.85897435897425, + "Y": 450.8104575163398 + }, + "Id": "7007db10-b61b-4726-9775-417951454ddf", + "Type": 4 + }, + { + "P1": { + "X": 473.30842562535759, + "Y": 351.58859045052856 + }, + "P2": { + "X": 515.4512827682147, + "Y": 309.80287616481428 + }, + "ControlPoint": { + "X": 519.02271133964325, + "Y": 358.01716187909994 + }, + "Id": "4ef4bfd0-8fc4-48a5-a490-92b35c7fd1c3", + "Type": 4 + }, + { + "P1": { + "X": 464.73699705392903, + "Y": 450.51716187909989 + }, + "P2": { + "X": 516.52271133964325, + "Y": 402.66001902195711 + }, + "ControlPoint": { + "X": 516.16556848250036, + "Y": 454.44573330767133 + }, + "Id": "7d18ae7e-7926-4cf4-8dd6-861462e31352", + "Type": 4 + }, + { + "P1": { + "X": 399.76697627462613, + "Y": 521.72108802571984 + }, + "P2": { + "X": 462.61739821419411, + "Y": 449.66152357736206 + }, + "ControlPoint": { + "X": 391.99239821419411, + "Y": 447.16152357736206 + }, + "Id": "532be14d-170e-45c5-adcf-0d555b83b010", + "Type": 4 + }, + { + "P1": { + "X": 399.05269056034041, + "Y": 523.50680231143417 + }, + "P2": { + "X": 400.11132581222392, + "Y": 580.622765294022 + }, + "ControlPoint": null, + "Id": "086955e0-0542-4ab5-9ccf-8880e749722a", + "Type": 4 + }, + { + "P1": { + "X": 353.86132581222392, + "Y": 629.37276529402186 + }, + "P2": { + "X": 400.11132581222392, + "Y": 576.872765294022 + }, + "ControlPoint": { + "X": 404.48632581222392, + "Y": 630.62276529402186 + }, + "Id": "2ac7d720-a6df-4174-be74-15ddfe96459b", + "Type": 4 } ], "Settings": { "BackgroundColorArgb": -14671840, "ShowGrid": false }, - "CreatedDate": "2025-12-16T10:58:08.630Z", + "CreatedDate": "2025-12-22T13:52:46.9307488+09:00", "Version": "1.3" } \ No newline at end of file diff --git a/components/AcsControls.tsx b/components/AcsControls.tsx index 2058e25..d99e341 100644 --- a/components/AcsControls.tsx +++ b/components/AcsControls.tsx @@ -11,6 +11,7 @@ interface AcsControlsProps { const AcsControls: React.FC = ({ onSend, isConnected, mapData }) => { const [tagId, setTagId] = useState('0001'); const [alias, setAlias] = useState('charger1'); + const [targetId, setTargetId] = useState(11); // Default Target ID const PRESET_ALIASES = [ 'charger1', 'charger2', @@ -21,15 +22,16 @@ const AcsControls: React.FC = ({ onSend, isConnected, mapData const availableTags = useMemo(() => { // Extract unique, non-empty RFID tags from map nodes const tags = mapData.nodes - .filter(n => n.rfidId && n.rfidId.trim() !== '') - .map(n => n.rfidId); + .filter(n => n.rfidId && String(n.rfidId).trim() !== '') + .map(n => String(n.rfidId)); return Array.from(new Set(tags)).sort(); }, [mapData]); const handleSend = (cmd: number, dataStr?: string, dataByte?: number) => { if (!isConnected) return; - let payload: number[] = []; + // Payload always starts with Target ID + let payload: number[] = [targetId]; if (dataStr !== undefined) { // Convert string to ASCII bytes @@ -50,6 +52,31 @@ const AcsControls: React.FC = ({ onSend, isConnected, mapData EXT CMD + {/* Target ID Selection */} +
+ Target AGV: + + +
+ {/* Navigation Commands */}
{/* Goto Tag */} @@ -71,7 +98,7 @@ const AcsControls: React.FC = ({ onSend, isConnected, mapData
- - + + + {/* System Controls (New) */}

System Control

-
- - -
-
- Mark Stop -
- - -
+
+ + +
diff --git a/components/SimulationCanvas.tsx b/components/SimulationCanvas.tsx index fdaf6e4..ce8ca8b 100644 --- a/components/SimulationCanvas.tsx +++ b/components/SimulationCanvas.tsx @@ -1211,7 +1211,7 @@ const SimulationCanvas: React.FC = ({ activeTool, mapData return { x: rawX, y: rawY }; }; - const handleWheel = (e: React.WheelEvent) => { + const handleWheel = useCallback((e: WheelEvent) => { e.preventDefault(); const rect = canvasRef.current?.getBoundingClientRect(); if (!rect) return; @@ -1234,7 +1234,20 @@ const SimulationCanvas: React.FC = ({ activeTool, mapData const newY = screenY - worldY * newScale; viewRef.current = { x: newX, y: newY, scale: newScale }; - }; + }, []); + + // Attach non-passive wheel listener + useEffect(() => { + const canvas = canvasRef.current; + if (canvas) { + canvas.addEventListener('wheel', handleWheel, { passive: false }); + } + return () => { + if (canvas) { + canvas.removeEventListener('wheel', handleWheel); + } + }; + }, [handleWheel]); const handleMouseMove = (e: React.MouseEvent) => { const rect = canvasRef.current?.getBoundingClientRect(); @@ -1547,7 +1560,7 @@ const SimulationCanvas: React.FC = ({ activeTool, mapData setSelectedItemIds(newSelection); // Prepare Multi-Drag - const initialStates: Record = {}; + const initialStates: any = {}; newSelection.forEach(id => { const n = mapData.nodes.find(o => o.id === id); if (n) initialStates[id] = { x: n.x, y: n.y }; @@ -1648,7 +1661,6 @@ const SimulationCanvas: React.FC = ({ activeTool, mapData ref={canvasRef} width={dimensions.width} height={dimensions.height} - onWheel={handleWheel} onMouseDown={handleMouseDown} onMouseMove={handleMouseMove} onMouseUp={handleMouseUp}