fist config json file

This commit is contained in:
bluepulsar
2025-12-25 12:28:19 +08:00
parent a62f3aa283
commit 64f07fdfb9
2 changed files with 37 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import json
from pathlib import Path
CONFIG_DIR = Path(__file__).parent
def load_config(config_name: str):
config_path = CONFIG_DIR / f"{config_name}.json"
with open(config_path, 'r') as f:
return json.load(f)
def save_config(config: dict, config_name: str):
config_path = CONFIG_DIR / f"{config_name}.json"
with open(config_path, 'w') as f:
json.dump(config, f, indent=4)
+23
View File
@@ -0,0 +1,23 @@
{
"name": "prototype",
"version": "1.0",
"camera": {
"resolution_raw": [1920, 1080],
"fps": 60,
"units": 15,
"resolution_stitch": [400, 400]
},
"elastomer": {
"thickness_mm": 3.0,
"marker_pattern": "random_color",
"marker_version": "1.0"
},
"mechanical":{
"width_mm": 10,
"height_mm": 10,
"depth_mm": 10
}
}