Skip to content

Commit

Permalink
platform code for pcb2gcode
Browse files Browse the repository at this point in the history
  • Loading branch information
justind000 committed Jul 4, 2024
1 parent c5f5a2e commit bebfe8e
Show file tree
Hide file tree
Showing 42 changed files with 76 additions and 16 deletions.
50 changes: 50 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tauri-build = { version = "1.5.2", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.6.5", features = [ "path-all", "shell-all", "fs-all", "dialog-all"] }
tauri = { version = "1.6.5", features = [ "os-all", "path-all", "shell-all", "fs-all", "dialog-all"] }

[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
Expand Down
Binary file removed src-tauri/binaries/pcb2gcode.exe
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"distDir": "../build"
},
"package": {
"productName": "pcb2cnc",
"version": "0.1.0"
"productName": "KiCNC",
"version": "0.9.0"
},
"tauri": {
"allowlist": {
Expand All @@ -19,8 +19,8 @@
"open": true,
"scope": [
{
"name": "pcb2gcode",
"cmd": "$RESOURCE/.libs/pcb2gcode.exe",
"name": "pcb2gcode-win32",
"cmd": "$RESOURCE/binaries/win32/.libs/pcb2gcode.exe",
"args": true
}
]
Expand All @@ -46,9 +46,12 @@
"exists": true,
"scope": ["**", "$RESOURCE/*"]
},
"path": {
"all": true
}
"path": {
"all": true
},
"os": {
"all": true
}
},
"bundle": {
"active": true,
Expand All @@ -74,10 +77,7 @@
"providerShortName": null,
"signingIdentity": null
},
"resources": [
"binaries/pcb2gcode.exe",
"binaries/.libs/*"
],
"resources": ["binaries/*"],
"shortDescription": "",
"targets": "all",
"windows": {
Expand Down
11 changes: 8 additions & 3 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import { Command } from '@tauri-apps/api/shell';
import { CircuitBoard } from 'lucide-svelte';
import { ModeWatcher } from 'mode-watcher';
import { platform } from '@tauri-apps/api/os';
import '../app.css';
const sidebarNavItems = [
Expand Down Expand Up @@ -208,21 +210,24 @@
_stdout = '';
_stderr = '';
const command = new Command('pcb2gcode', _command_arguments, { cwd: $project_dir });
const platform_name = await platform();
const pcb2gcode_arch = `pcb2gcode-${platform_name}`
const command = new Command(pcb2gcode_arch, _command_arguments, { cwd: $project_dir });
command.on('error', (error) => console.error(`command error: "${error}"`));
command.stdout.on('data', (line) => (_stdout += line + '<br>'));
command.stderr.on('data', (line) => (_stderr += line + '<br>'));
await command.execute();
_stdout += '<strong>Making stencil</strong>' + '<br>';
const stencil_command = new Command('pcb2gcode', _stencil_arguments, { cwd: $project_dir });
const stencil_command = new Command(pcb2gcode_arch, _stencil_arguments, { cwd: $project_dir });
stencil_command.on('error', (error) => console.error(`command error: "${error}"`));
stencil_command.stdout.on('data', (line) => (_stdout += line + '<br>'));
stencil_command.stderr.on('data', (line) => (_stderr += line + '<br>'));
await stencil_command.execute();
_stdout += '<strong>Making mask</strong>' + '<br>';
const mask_command = new Command('pcb2gcode', _mask_arguments, { cwd: $project_dir });
const mask_command = new Command(pcb2gcode_arch, _mask_arguments, { cwd: $project_dir });
mask_command.on('error', (error) => console.error(`command error: "${error}"`));
mask_command.stdout.on('data', (line) => (_stdout += line + '<br>'));
mask_command.stderr.on('data', (line) => (_stderr += line + '<br>'));
Expand Down
7 changes: 6 additions & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,9 @@
rel="noopener noreferrer">https://github.com/u-fire/kicnc</a
>
<p class="font-medium">Version: <span class="text-sm text-muted-foreground">0.9.0</span></p>

<a
class="font-medium text-primary underline underline-offset-4"
href="https://microfire.co"
target="_blank"
rel="noopener noreferrer">Microfire LLC</a
>

0 comments on commit bebfe8e

Please sign in to comment.