(event, apiKey, baseURL, model, service)
| 8562 | label: 'Open in Slicer', |
| 8563 | submenu: slicers.map(slicer => ({ |
| 8564 | label: slicer.name, |
| 8565 | click: async () => { |
| 8566 | try { |
| 8567 | // In server mode, "Open in Slicer" should execute on the client machine, not the server |
| 8568 | // Send command to client to execute locally |
| 8569 | if (isServerMode) { |
| 8570 | let modelPath = filePaths[0]; |
| 8571 | |
| 8572 | // If it's a zip entry, we need to handle it (extract on client or download) |
| 8573 | if (isZipEntry && pathInfo) { |
| 8574 | // For zip entries, send both zip path and entry path |
| 8575 | modelPath = `${pathInfo.zipPath}::${pathInfo.entryPath}`; |
| 8576 | } |
| 8577 | |
| 8578 | // Send command to client to execute slicer locally |
| 8579 | if (global.broadcastEvent) { |
| 8580 | global.broadcastEvent('execute-client-command', { |
| 8581 | type: 'open-in-slicer', |
| 8582 | filePath: modelPath, |
| 8583 | slicerName: slicer.name, |
| 8584 | slicerPath: slicer.path, |
| 8585 | isZipEntry: isZipEntry || false, |
| 8586 | zipPath: isZipEntry ? pathInfo.zipPath : null, |
| 8587 | entryPath: isZipEntry ? pathInfo.entryPath : null |
| 8588 | }); |
| 8589 | } else { |
| 8590 | event.sender.send('execute-client-command', { |
| 8591 | type: 'open-in-slicer', |
| 8592 | filePath: modelPath, |
| 8593 | slicerName: slicer.name, |
| 8594 | slicerPath: slicer.path, |
| 8595 | isZipEntry: isZipEntry || false, |
| 8596 | zipPath: isZipEntry ? pathInfo.zipPath : null, |
nothing calls this directly
no test coverage detected