diff --git a/Housing/RP2350_MIDI_Lighter_Housing.scad b/Housing/RP2350_MIDI_Lighter_Housing.scad index 68552ac..9e84a66 100644 --- a/Housing/RP2350_MIDI_Lighter_Housing.scad +++ b/Housing/RP2350_MIDI_Lighter_Housing.scad @@ -10,7 +10,7 @@ include Show_FAD_Logo = false; Show_PCB = false; Debug_Present = true; -$preview = true; +$preview = false; @@ -27,8 +27,8 @@ if(Show_PCB) // Top(); // Top_Wall(); -Bottom(); -// Bottom_Wall(0); +// Bottom(); +Bottom_Wall(); // rotate([0, 180, 0]) // 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([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(); @@ -270,38 +270,36 @@ module Bottom() } } -module Bottom_Wall(plate_transition = 1) +module Bottom_Wall() { translate([0, 0, 0]) union() { - translate([PCB_W/2, PCB_H/2, -Wall_B_H/2]) - union() + difference() { - difference() - { - 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); - } + translate([PCB_W/2, PCB_H/2, -Wall_B_H/2]) + union() + { + difference() + { + 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+2.5 , 3 , Button[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("bottom" , 3.2 , 9.5 , Audio_Jack[0]); - // Bottom_Wall_Add_Part("bottom" , PCB_T/2+2.5 , PCB_W-1 , PCB_W/2); - - // for (i = MIDI_Plugs) { - // Bottom_Wall_Add_Part("bottom", PCB_T/2+Spacer_Top_Height, 22, i[0]); - // } + 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.0 , 16 , USB_C[1]); + Bottom_Wall_Add_Part("top" , PCB_T/2 , 10 , MOLEX[0]); + Bottom_Wall_Add_Part("bottom" , 3.2 , 9.5 , Audio_Jack[0]); + } + PCB_Cutouts_From_Bottom(); } Screw_Plate_T = 1.0; translate([0, 0, -Screw_Plate_T]) 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); } } diff --git a/Python/Buffer_Reader.cmd b/Python/Buffer_Reader.cmd index 52e5bfc..df43184 100644 --- a/Python/Buffer_Reader.cmd +++ b/Python/Buffer_Reader.cmd @@ -26,6 +26,9 @@ if not exist "Buffer_Reader.py" ( exit /b 1 ) +:: Initialize Repeat_Counter for file naming +set /a repeat_counter=1 + :: Check command line arguments if "%~1"=="" goto :interactive_mode if "%~1"=="/?" goto :show_help @@ -33,8 +36,8 @@ if "%~1"=="--help" goto :show_help :: Direct mode - use command line arguments set "port_input=%~1" -set "image_file=%~2" -set "csv_file=%~3" +set "image_file_base=%~2" +set "csv_file_base=%~3" :: Process port input - add COM prefix if not present if "!port_input:~0,3!"=="COM" ( @@ -67,20 +70,31 @@ if "!port_input:~0,3!"=="COM" ( ) :: Get image filename (optional) -set "image_file=" -set /p "image_file=Enter image filename (press Enter for default): " +set "image_file_base=" +set /p "image_file_base=Enter image filename (press Enter for default): " :: Get CSV filename (optional) -set "csv_file=" -set /p "csv_file=Enter CSV filename (press Enter for default): " +set "csv_file_base=" +set /p "csv_file_base=Enter CSV filename (press Enter for default): " + :set_default_files -:: Get current timestamp for default filenames -for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" -set "timestamp=%dt:~0,4%%dt:~4,2%%dt:~6,2%_%dt:~8,2%%dt:~10,2%%dt:~12,2%" +if "!image_file_base!"=="" set "image_file_base=capture" +if "!csv_file_base!"=="" set "csv_file_base=pixels" + +:: 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 echo. @@ -131,42 +145,11 @@ set /p "repeat_choice=" :: Check if user pressed just Enter (empty input) if "!repeat_choice!"=="" ( :: Increment counter for repeat runs - if not defined repeat_counter set repeat_counter=0 set /a repeat_counter+=1 - :: Create new filenames with counter suffix - :: Remove existing counter suffix if present, then add new one - 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" - ) - + set "image_file=!image_file_base!_!repeat_counter!.png" + set "csv_file=!csv_file_base!_!repeat_counter!.csv" + goto :main_loop )