『楼 主』:
[原创salvagnini 编程软件
@echo off
cd\
title=salvagnini
color 1f
for /l %%i in (10 1 30) do (mode con cols=70 lines=%%i & ping -n 1 127.1>nul)
set filePath=C:\Salvagnini\syscon\P4M_310_1199\production
:FileSelect
color 0a
cls
set fuhao= -------------------------------------------------------
echo.
echo 文件夹列表注意选择
echo %fuhao%
echo [ 1 ]: CE_SEC12 │ [ 2 ]: CE_SEC15
echo %fuhao%
echo [ 3 ]: CE_SUS15 │ [ 4 ]: CP_SEC12
echo %fuhao%
echo [ 5 ]: CP_SEC15 │ [ 6 ]: CP_SUS10
echo %fuhao%
echo [ 7 ]: CP_SUS15 │ [ 8 ]: CP_SUS439
echo %fuhao%
echo [ 9 ]: DO_SEC12 │ [ 10]: DO_SEC15
echo %fuhao%
echo [ 11]: DO_SUS10 │ [ 12]: DO_SUS15
echo %fuhao%
echo [ 13]: DO_SUS439 │ [ 14]: NON_CP_MI10
echo %fuhao%
echo [ 15]: NON_CP_SEC12 │ [ 16]: NON_CP_SEC15
echo %fuhao%
echo [ 17]: NON_CP_SUS10 │ [ 18]: NON_CP_SUS15
echo %fuhao%
echo [ 19]: NON_CP_SUS439 │ [ 20]: NON_DO_SEC12
echo %fuhao%
echo [ 21]: NON_DO_SEC15 │ [ 22]: NON_DO_SUS10
echo %fuhao%
echo [ 23]: NON_DO_SUS15 │ [ 24]: NON_DO_SUS439
echo %fuhao%
echo [ 25]: SanJian │
echo %fuhao%
set filenum=
set /p filenum= 请选择要保存的文件夹位置[ 1 / 25 ]:
if "%filenum%"=="" goto :FileSelect
if %filenum% LSS 1 goto :FileSelect
if %filenum% GTR 25 goto :FileSelect
if "%filenum%"=="1" set filename=CE_SEC12
if "%filenum%"=="2" set filename=CE_SEC15
if "%filenum%"=="3" set filename=CE_SUS15
if "%filenum%"=="4" set filename=CP_SEC12
if "%filenum%"=="5" set filename=CP_SEC15
if "%filenum%"=="6" set filename=CP_SUS10
if "%filenum%"=="7" set filename=CE_CP_SUS15
if "%filenum%"=="8" set filename=CP_SUS439
if "%filenum%"=="9" set filename=DO_SEC12
if "%filenum%"=="10" set filename=DO_SEC15
if "%filenum%"=="11" set filename=DO_SUS10
if "%filenum%"=="12" set filename=DO_SUS15
if "%filenum%"=="13" set filename=DO_SUS439
if "%filenum%"=="14" set filename=NON_CP_MI10
if "%filenum%"=="15" set filename=NON_CP_SEC12
if "%filenum%"=="16" set filename=NON_CP_SEC15
if "%filenum%"=="17" set filename=NON_CP_SUS10
if "%filenum%"=="18" set filename=NON_CP_SUS15
if "%filenum%"=="19" set filename=NON_CP_SUS439
if "%filenum%"=="20" set filename=NON_DO_SEC12
if "%filenum%"=="21" set filename=NON_DO_SEC15
if "%filenum%"=="22" set filename=NON_DO_SUS10
if "%filenum%"=="23" set filename=NON_DO_SUS15
if "%filenum%"=="24" set filename=NON_DO_SUS439
if "%filenum%"=="25" set filename=SanJian
set filestr=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
set /a filenum=filenum
for /f "tokens=%filenum% delims= " %%a in ("%filestr%") do (
if "%filenum%"=="%%a" call :mdfile
)
:mdfile
cls
echo.&echo %fuhao%
echo 你的选择是: %filename% 文件夹
echo %fuhao%
echo.
if not exist %filePath%\%filename% md %filePath%\%filename%
:start
color 0b
echo.
echo.
echo.
echo salvagnini 折弯编程系统
echo 测试版 ver: 1.0
echo.
echo. & echo.
set partname=
set /p partname= ..........请输入零件名称:
if %partname%=="" goto start else
dir /b %filePath%\%filename% | find /i "%partname%.P4">NUL
if "%errorlevel%"=="0" goto Warning
goto MAT
:MAT
color 0c
cls
echo.
echo.
echo 零件名称: %partname%
echo.
echo %fuhao%
echo [1]:不锈钢 'SUS304'
echo %fuhao%
echo [2]:不锈铁 'SUS439'
echo %fuhao%
echo [3]:冷 板 'SPCC'
echo %fuhao%
echo [4]:镀锌板 'SECC'
echo %fuhao%
echo [5]:热镀锌板 'SGCC'
echo %fuhao%
echo.
echo. & echo.
set Choice=
set /p Choice=请选择材质类型[1 / 5]:
if "%Choice%"=="" goto MAT
if "%Choice%"=="1" set Material=SUS304&goto Thickness
if "%Choice%"=="2" set Material=SUS439&goto Thickness
if "%Choice%"=="3" set Material=SPCC&goto Thickness
if "%Choice%"=="4" set Material=SECC&goto Thickness
if "%Choice%"=="5" set Material=SGCC&goto Thickness else
goto MatErr
:Thickness
color 0d
cls
echo.
echo %fuhao%
echo 零件名称: %partname%
echo %fuhao%
echo.
echo.
echo. & echo.
set Thickness=
set /p Thickness= 请输入零件板厚:
if %Thickness%=="" goto Thickness else
goto DIM-XZS
:DIM-XZS
title=salvagnini_零件名称:%partname%_材质:%Material%_板厚:%Thickness%
color 0e
echo.&echo.
set X=
set /P X= 请输入零件成型尺寸长度尺寸:X=
set Z=
set /P Z= 请输入零件成型尺寸宽度尺寸:Z=
echo %fuhao%
color 5e
echo X1 -- 确定坯件的 "左" 侧以对正 "X" 轴
echo.
set X1=
set /p X1= 请输入长度尺寸 "X1" 的值(可以支持公式形式):
echo %fuhao%
color 0f
echo X2 -- 确定坯件的 "右" 侧以对正 "X" 轴
echo.
echo 直接回车默认 "X2=X1" X1=%X1%
set X2=
set /p X2= 请输入长度尺寸 "X2" 的值(可以支持公式形式):
if "%X2%"=="" set X2=%X1%
color 1a
cls
echo %fuhao%
echo Z1 -- 确定坯件的 "左" 侧以对正 "Z" 轴
echo %fuhao%
echo.
set Z1=
set /p Z1= 请输入长度尺寸 "Z1" 的值(可以支持公式形式):
echo %fuhao%
color 1b
echo Z2 -- 确定坯件的 "右" 侧以对正 "Z" 轴
echo %fuhao%
echo.
echo 直接回车默认 "Z2=Z1" Z1=%Z1%
echo %fuhao%
set Z2=
set /p Z2= 请输入长度尺寸 "Z2" 的值(可以支持公式):
if "%Z2%"=="" set Z2=%Z1%
cls
echo %fuhao%
color 1c
echo X3 -- 确定上料小车夹钳在毛坯件上的夹持点
echo %fuhao%
echo 确定上料小车夹钳在毛坯件上的夹持点 "X3" 的值
echo %fuhao%
set X3=
set /p X3= 请输入长度尺寸 "X3" 的值(可以支持公式形式):
echo.
:N
cls
echo %fuhao%
echo %fuhao%
echo [0] N -- 无缺角的金属板料中心定位
echo %fuhao%
echo [1] N1 -- "左" 侧无缺角的金属板料中心定位
echo %fuhao%
echo [2] N2 -- "右" 侧无缺角的金属板料中心定位
echo %fuhao%
set n=
set /p n= 请选择板料的切角方式(直接回车默认是 "N" = )[ 0 / 2]:
if "%n%"=="" goto setn
if "%n%"=="0" goto setn
if "%n%"=="1" goto setn
if "%n%"=="2" goto setn&else
goto :n
:setn
if "%n%"=="" set n=
if "%n%"=="0" set n=N
if "%n%"=="1" set n=N1
if "%n%"=="2" set n=N2
color 1d
cls
echo %fuhao%
color 1e
echo [0]: 不翻转零件
echo %fuhao%
set round=
set /p round= 请选择是否翻转零件(直接回车是翻转零件)[0]:
if "%round%"=="" set round=1
:order
color 1f
echo.
echo %fuhao%
echo 4
echo ┌─────────┐
echo 1│ │2
echo └─────────┘
echo 3
echo %fuhao%
echo.
echo 折弯边顺序选择排序
set order=
set /p order= 请输入顺序号(例如:1234):
if "%order%"=="" goto :order
goto Write
:Write
set outfile=%filePath%\%filename%\%partname%
color 2a
echo COD: '%partname%'>"%outfile%.P4"
echo ***:>>"%outfile%.P4"
echo ***:Material '%Material%'>>"%outfile%.P4"
echo ***:Thickness '%Thickness%'>>"%outfile%.P4"
echo ***:Created By '%username%'>>"%outfile%.P4"
echo ***:Createion Time %date:~4,4%.%date:~9,2%.%date:~12,2% >>"%outfile%.P4"
echo ***:Comments>>"%outfile%.P4"
echo.>>"%outfile%.P4"
echo.>>"%outfile%.P4"
echo DIM: X %X%>>"%outfile%.P4"
echo Z %Z%>>"%outfile%.P4"
echo S %Thickness% >>"%outfile%.P4"
if "%Material%"=="SUS304" echo VINYL 0.1 STAINLESS 0>>"%outfile%.P4"
if "%Material%"=="SUS439" echo VINYL 0.1>>"%outfile%.P4"
echo REF: X1 %X1%>>"%outfile%.P4"
echo X2 %X2%>>"%outfile%.P4"
echo Z1 %Z1%>>"%outfile%.P4"
echo Z2 %Z2%>>"%outfile%.P4"
echo X3 %X3% %n%>>"%outfile%.P4"
if "%round%"=="1" echo POS: TURN_AROUND>>"%outfile%.P4"
@echo off&setlocal Enabledelayedexpansion
set num=-1
:begin
set /a num+=1
set numa=!order:~%num%,1!
if "%num%"=="" goto order
if "%num%"=="0" set num0=%numa%
if "%num%"=="1" set num1=%numa%
if "%num%"=="2" set num2=%numa%
if "%num%"=="3" set num3=%numa%
if "%numa%"=="" call :Count
call :begin
:Count
for /l %%b in (70 1 95) do mode con cols=%%b lines=30
set number=-1
:number
color 2b
cls
set /a number+=1
if "!num%number%!"=="" call :jiewei
if not "num%number%"=="num" echo ROT:S !num%number%!>>"%outfile%.P4"
echo %fuhao%%fuhao:~2,35%
echo 特别说明
echo %fuhao%%fuhao:~2,35%
echo 在出现负折弯的情况下输入的格式会有所变化的.例如要折边长是“10毫米”尺寸补偿是“1”折弯
echo %fuhao%%fuhao:~2,35%
echo 角度是“45度”角度的补偿值是“3度”输入的格式是 “-10/1/45/3” 如果“10”不需要补偿值,
echo %fuhao%%fuhao:~2,35%
echo 格式是“-10/0/45/3”.如果“45度”不需要补偿值的话格式是“-10/0/45/0”.其他正常情况折弯
echo %fuhao%%fuhao:~2,35%
echo 默认角度是“90度”默认角度补偿值是“3度”不需要补偿值格式是“-10”.折两道弯的格式是
echo %fuhao%%fuhao:~2,35%
echo “-10/1/45/3 10/1”.
echo %fuhao%%fuhao:~2,35%
echo.
set foldnum=
set /p foldnum= 请输入第 !num%number%! 边折几道弯:
set foldDIM=
set /p foldDIM= 请输入折弯的尺寸值(以 " " 隔开 如:10 20 30):
for /f "delims=" %%c in ("%foldDIM%") do call :fenge %%c
:fenge
if not "%1"=="" set dim0=%1
if not "%2"=="" set dim1=%2
if not "%3"=="" set dim2=%3
if not "%4"=="" set dim3=%4
set funum=-1
:fuhao
set /a funum+=1
for /f "tokens=1 delims=*" %%d in ("!dim%funum%!") do (
set fuzhi=%%d)
if "%fuzhi:~0,1%"=="-" set fu=-
if not "%fuzhi:~0,1%"=="-" set fu=
for /f "tokens=1-4 delims=/" %%e in ("!dim%funum%!") do (
set dimc=%%e
set dimb=%%f
set jiaoc=%%g
set jiaocb=%%h)
if "%dimc:~0,1%"=="-" set dimc=%dimc:~1%
if "%dimb%"=="" set dimb=0
if "%jiaoc%"=="" set jiaoc=90
if "%jiaocb%"=="" set jiaocb=3
if not "!dim%funum%!"=="" call :BEN
if "!dim%funum%!"=="" call :number
:BEN
echo BEN%fu%:L %dimc% LC %dimb% A %jiaoc% AC %jiaocb% >>"%outfile%.P4"
call :fuhao
:jiewei
color 3b
echo END:>>"%outfile%.P4"
echo.
echo %fuhao%
echo 程序写入已经完成,请编译后,折弯模拟检查一下程序.
echo %fuhao%
set colornum=-1
:colorSelect
set /a colornum+=1
set colorstr=edcba
color 0!colorstr:~%colornum%,1! & ping -n 2 127.1>nul
if not "%colornum%"=="4" goto :colorSelect
goto :endnum
:Warning
color 3e
echo %fuhao%
echo.
echo "%partname%.P4" 文件已经存在是否覆盖还是要退出
echo.
echo [1] 覆盖
echo %fuhao%
set overlay=
set /p overlay= 请选择(直接回车不覆盖退出):
if "%overlay%"=="" goto End
if "%overlay%"=="1" goto MAT
:MatErr
color 2d
echo 你输入的材质不存在请按任意键返回
pause>nul
goto MAT
:endnum
cls
set colsnum=95
set linesnum=30
echo.
echo 正在退出程序...
echo.
goto :end
:End
color 1e
set /a colsnum-=6
set /a linesnum-=2
mode con cols=%colsnum% lines=%linesnum% & ping -n 1 127.1>nul
if not "%colsnum%"=="17" goto :end
EXIT [ Last edited by glbosom on 2008-12-20 at 22:47 ]
|