- Finished first workable version of housing. Fine tuning still needed

- Changed batch script to read out framebuffer -> better automatic file naming. Needs to be tested.
This commit is contained in:
2025-09-12 22:25:10 +02:00
parent bdf157168d
commit 30da52f4b0
2 changed files with 51 additions and 70 deletions

View File

@@ -10,7 +10,7 @@ include <RP2350_MIDI_Lighter_Definition.scad>
Show_FAD_Logo = false; Show_FAD_Logo = false;
Show_PCB = false; Show_PCB = false;
Debug_Present = true; Debug_Present = true;
$preview = true; $preview = false;
@@ -27,8 +27,8 @@ if(Show_PCB)
// Top(); // Top();
// Top_Wall(); // Top_Wall();
Bottom(); // Bottom();
// Bottom_Wall(0); Bottom_Wall();
// rotate([0, 180, 0]) // rotate([0, 180, 0])
// translate([0, 0, eps]) Display_GC9A01A_Cover(); // translate([0, 0, eps]) Display_GC9A01A_Cover();
@@ -74,7 +74,7 @@ module Top()
translate(Rotary_Encoder) cylinder(d=15, h=100, center=false, $fn = $preview ? 32 : 100); translate(Rotary_Encoder) cylinder(d=15, h=100, center=false, $fn = $preview ? 32 : 100);
translate([0, 0, -0.5]) // Penetration Depth translate([0, 0, -0.5]) // Penetration Depth
translate(GC9A01A) GC9A01A_Cover_Plate(1, 1.02, true); translate(GC9A01A) GC9A01A_Cover_Plate(1, 1.01, true);
} }
translate([0, 0, -Spacer_Top_Height - PCB_T/2]) PCB_Cutouts_Top_Plate(); translate([0, 0, -Spacer_Top_Height - PCB_T/2]) PCB_Cutouts_Top_Plate();
@@ -270,38 +270,36 @@ module Bottom()
} }
} }
module Bottom_Wall(plate_transition = 1) module Bottom_Wall()
{ {
translate([0, 0, 0]) translate([0, 0, 0])
union() union()
{ {
translate([PCB_W/2, PCB_H/2, -Wall_B_H/2]) difference()
union()
{ {
difference() translate([PCB_W/2, PCB_H/2, -Wall_B_H/2])
{ union()
roundedBox( [PCB_W + 2*Cover_O , PCB_H + 2*Cover_O , 1*Wall_B_H], 2, true, $fn = $preview ? 32 : 100); {
cube( [PCB_W + 0*Cover_O + 0.5, PCB_H + 0*Cover_O + 0.5 , 2*Wall_T_H], center=true); difference()
translate([0, 0, +Cover_B_T/2 - Wall_B_H/2 - eps]) {
cube( [PCB_W + 1*Cover_O + 0.5, PCB_H + 1*Cover_O + 0.5 , Cover_B_T], center=true); roundedBox( [PCB_W + 2*Cover_O , PCB_H + 2*Cover_O , 1*Wall_B_H], 2, true, $fn = $preview ? 32 : 100);
} cube( [PCB_W + 0*Cover_O + 0.5, PCB_H + 0*Cover_O + 0.5 , 2*Wall_T_H], center=true);
translate([0, 0, +Cover_B_T/2 - Wall_B_H/2 - eps])
cube( [PCB_W + 1*Cover_O + 0.5, PCB_H + 1*Cover_O + 0.5 , Cover_B_T], center=true);
}
Bottom_Wall_Add_Part("right" , PCB_T/2 , 9 , Power_Plug[1]-2.4); Bottom_Wall_Add_Part("right" , PCB_T/2 , 9 , Power_Plug[1]-2.4);
Bottom_Wall_Add_Part("right" , PCB_T/2+2.5 , 3 , Button[1]); Bottom_Wall_Add_Part("right" , PCB_T/2+2.5 , 3 , Button[1]);
Bottom_Wall_Add_Part("right" , PCB_T/2+2.0 , 16 , USB_C[1]); Bottom_Wall_Add_Part("right" , PCB_T/2+2.0 , 16 , USB_C[1]);
Bottom_Wall_Add_Part("top" , PCB_T/2 , 10 , MOLEX[0]); Bottom_Wall_Add_Part("top" , PCB_T/2 , 10 , MOLEX[0]);
Bottom_Wall_Add_Part("bottom" , 3.2 , 9.5 , Audio_Jack[0]); Bottom_Wall_Add_Part("bottom" , 3.2 , 9.5 , Audio_Jack[0]);
// Bottom_Wall_Add_Part("bottom" , PCB_T/2+2.5 , PCB_W-1 , PCB_W/2); }
PCB_Cutouts_From_Bottom();
// for (i = MIDI_Plugs) {
// Bottom_Wall_Add_Part("bottom", PCB_T/2+Spacer_Top_Height, 22, i[0]);
// }
} }
Screw_Plate_T = 1.0; Screw_Plate_T = 1.0;
translate([0, 0, -Screw_Plate_T]) translate([0, 0, -Screw_Plate_T])
Top_Wall_Screw_Plates(Screw_Plate_T, -PCB_T/2 - Spacer_Bot_Height); Top_Wall_Screw_Plates(Screw_Plate_T, -PCB_T/2 - Spacer_Bot_Height);
// Top_Wall_Screw_Plates(1.0, PCB_T/2 - Spacer_Bot_Height);
} }
} }

View File

@@ -26,6 +26,9 @@ if not exist "Buffer_Reader.py" (
exit /b 1 exit /b 1
) )
:: Initialize Repeat_Counter for file naming
set /a repeat_counter=1
:: Check command line arguments :: Check command line arguments
if "%~1"=="" goto :interactive_mode if "%~1"=="" goto :interactive_mode
if "%~1"=="/?" goto :show_help if "%~1"=="/?" goto :show_help
@@ -33,8 +36,8 @@ if "%~1"=="--help" goto :show_help
:: Direct mode - use command line arguments :: Direct mode - use command line arguments
set "port_input=%~1" set "port_input=%~1"
set "image_file=%~2" set "image_file_base=%~2"
set "csv_file=%~3" set "csv_file_base=%~3"
:: Process port input - add COM prefix if not present :: Process port input - add COM prefix if not present
if "!port_input:~0,3!"=="COM" ( if "!port_input:~0,3!"=="COM" (
@@ -67,20 +70,31 @@ if "!port_input:~0,3!"=="COM" (
) )
:: Get image filename (optional) :: Get image filename (optional)
set "image_file=" set "image_file_base="
set /p "image_file=Enter image filename (press Enter for default): " set /p "image_file_base=Enter image filename (press Enter for default): "
:: Get CSV filename (optional) :: Get CSV filename (optional)
set "csv_file=" set "csv_file_base="
set /p "csv_file=Enter CSV filename (press Enter for default): " set /p "csv_file_base=Enter CSV filename (press Enter for default): "
:set_default_files :set_default_files
:: Get current timestamp for default filenames if "!image_file_base!"=="" set "image_file_base=capture"
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" if "!csv_file_base!"=="" set "csv_file_base=pixels"
set "timestamp=%dt:~0,4%%dt:~4,2%%dt:~6,2%_%dt:~8,2%%dt:~10,2%%dt:~12,2%"
:: Check if image_file_base has an extension and remove it
for %%f in ("!image_file_base!") do (
set "image_file_base=%%~nf"
)
:: Check if image_file_base has an extension and remove it
for %%f in ("!csv_file_base!") do (
set "csv_file_base=%%~nf"
)
set "image_file=!image_file_base!_!repeat_counter!.png"
set "csv_file=!csv_file_base!_!repeat_counter!.csv"
if "!image_file!"=="" set "image_file=capture_1.png"
if "!csv_file!"=="" set "csv_file=pixels_1.csv"
:main_loop :main_loop
echo. echo.
@@ -131,42 +145,11 @@ set /p "repeat_choice="
:: Check if user pressed just Enter (empty input) :: Check if user pressed just Enter (empty input)
if "!repeat_choice!"=="" ( if "!repeat_choice!"=="" (
:: Increment counter for repeat runs :: Increment counter for repeat runs
if not defined repeat_counter set repeat_counter=0
set /a repeat_counter+=1 set /a repeat_counter+=1
:: Create new filenames with counter suffix set "image_file=!image_file_base!_!repeat_counter!.png"
:: Remove existing counter suffix if present, then add new one set "csv_file=!csv_file_base!_!repeat_counter!.csv"
set "base_image=!image_file!"
set "base_csv=!csv_file!"
:: Remove previous counter from image filename
for /f "tokens=1,2 delims=_" %%a in ("!base_image!") do (
if "%%b" neq "" (
echo %%b | findstr "^[0-9][0-9]*\.png$" >nul
if !errorlevel! equ 0 (
set "base_image=%%a.png"
)
)
)
:: Remove previous counter from csv filename
for /f "tokens=1,2 delims=_" %%a in ("!base_csv!") do (
if "%%b" neq "" (
echo %%b | findstr "^[0-9][0-9]*\.csv$" >nul
if !errorlevel! equ 0 (
set "base_csv=%%a.csv"
)
)
)
:: Add counter to filenames
for %%f in ("!base_image!") do (
set "image_file=%%~nf_!repeat_counter!%%~xf"
)
for %%f in ("!base_csv!") do (
set "csv_file=%%~nf_!repeat_counter!%%~xf"
)
goto :main_loop goto :main_loop
) )