Skip to content

Commit 40b2682

Browse files
committed
Merge branch 'device_manager_improvements' into main
2 parents ee4d2fd + 024221e commit 40b2682

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

utilities/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build/
2+
*.spec
3+
dist/

utilities/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,18 @@ This folder contains DepthAI utility tools.
77
![Device Manager](https://user-images.githubusercontent.com/18037362/171629704-0f78f31a-1778-4338-8ac0-bdfb0d2d593f.png)
88

99
``device_manager.py`` helps interfacing with the device [Bootloader](https://docs.luxonis.com/projects/api/en/latest/components/bootloader) and bootloader configuration. See [Device Manager Usage](https://docs.luxonis.com/projects/api/en/latest/components/bootloader/#device-manager-usage) to see how to use this utility.
10+
11+
## Standalone executable
12+
13+
Requirements:
14+
```
15+
# Linux/macOS
16+
python3 -m pip install pyinstaller
17+
# Windows
18+
python -m pip install pyinstaller
19+
```
20+
21+
To build standalone executable issue the following command:
22+
```sh
23+
pyinstaller --onefile -w --icon=assets/icon.ico --add-data="assets/icon.ico;assets" --add-data="assets/icon.png;assets" device_manager.py
24+
```

utilities/assets/icon.ico

39.7 KB
Binary file not shown.

utilities/device_manager.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
import tempfile
66
import PySimpleGUI as sg
77
import sys
8+
import platform
9+
import os
10+
11+
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
12+
13+
if platform.system() == 'Windows':
14+
sg.set_global_icon(f'{SCRIPT_DIR}/assets/icon.ico')
15+
else:
16+
sg.set_global_icon(f'{SCRIPT_DIR}/assets/icon.png')
817

918
CONF_TEXT_POE = ['ipTypeText', 'ipText', 'maskText', 'gatewayText', 'dnsText', 'dnsAltText', 'networkTimeoutText', 'macText']
1019
CONF_INPUT_POE = ['staticBut', 'dynamicBut', 'ip', 'mask', 'gateway', 'dns', 'dnsAlt', 'networkTimeout', 'mac']
@@ -512,7 +521,6 @@ def deviceStateTxt(state: dai.XLinkDeviceState) -> str:
512521
bl = None
513522

514523
window = sg.Window(title="Device Manager",
515-
icon="assets/icon.png",
516524
layout=layout,
517525
size=(645, 380),
518526
finalize=True # So we can do First search for devices

0 commit comments

Comments
 (0)