📄 moldbase._ls
字号:
(defun IniMoldSpec()
(if MoldSpecNum
(progn
(set_tile "SpecValue" MoldSpecNum)
(if erpZ
(set_tile "erp" (itoa erpZ))
)
(if epZ
(set_tile "ep" (itoa epZ))
)
(if tpZ
(set_tile "tp" (itoa tpZ))
)
(if bpZ
(set_tile "bp" (itoa bpZ))
)
(if rpZ
(set_tile "rp" (itoa rpZ))
)
(if spZ
(set_tile "sp" (itoa spZ))
)
(if stZ
(set_tile "st" (itoa stZ))
)
)
(mode_tile "option" 1)
)
(if aPThk
(set_tile "aPlateThk" (itoa aPThk))
)
(if bPThk
(set_tile "bPlateThk" (itoa bPThk))
)
(if sbPThk
(set_tile "sbPlateThk" (itoa sbPThk))
)
(if (not (and MoldSpecNum aPThk bPThk sbPThk))
(mode_tile "next34" 1)
)
)
(defun MoldSpecSel(SysVar / SpecLst MoldSpecItem)
;-------------------------------------------
;Defun Mold Base Specification list
;-------------------------------------------
(setq SGSpecLst '("1515" "1520" "1525" "1820" "1823" "1825" "2020" "2023" "2025" "2030" "2035" "2330" "2335"
"2525" "2527" "2530" "2535" "2540" "2550" "2730" "2735" "2740" "3030" "3035" "3040" "3045"
"3050" "3060" "3535" "3540" "3545" "3550" "3560" "3570" "4040" "4045" "4050" "4055" "4060"
"4070" "4545" "4550" "4555" "4560" "4570" "5050" "5055" "5060" "5070" "5555" "5560" "5565"
"5570" "6060" "6065" "6070" "6075" "6080"))
(setq TPSpecLst '("1520" "1525" "1820" "1823" "1825" "2020" "2023" "2025" "2030" "2035" "2330" "2335" "2525"
"2527" "2530" "2535" "2540" "2550" "2730" "2735" "2740" "3030" "3035" "3040"))
(setq PPSpecLst '("2025" "2030" "2035" "2330" "2335" "2525" "2527" "2530" "2535" "2540" "2550" "2730" "2735"
"2740" "3030" "3035" "3040" "3045" "3050" "3060" "3535" "3540" "3545" "3550" "3560" "3570"
"4040" "4045" "4050" "4055" "4060" "4070" "4545" "4550" "4555" "4560" "4570" "5050" "5055"
"5060" "5070"))
(if (not (new_dialog "mold31" MoldDclId))
(exit)
)
(cond
((= "SG" MoldSysNum)
(ini_list "MoldSpecLst" SGSpecLst)
)
((= "TP" MoldSysNum)
(ini_list "MoldSpecLst" TPSpecLst)
)
((= "PP" MoldSysNum)
(ini_list "MoldSpecLst" PPSpecLst)
)
)
(action_tile "MoldSpecLst" "(setMoldSpec)")
(action_tile "accept" "(exitMoldLst)")
;**************************************************OK(ABOVE)
(start_dialog)
;**************************************************OK(ABOVE)
(getMoldBaseData)
(if (and MoldSpecNum aPThk bPThk sbPThk)
(progn
(mode_tile "next34" 0)
(mode_tile "next34" 2)
)
)
)
;*************OK******START
(defun setMoldSpec()
(setq MoldSpecItem (get_tile "MoldSpecLst"))
(cond
((= "SG" MoldSysNum)
(setq MoldSpecNum (nth (atoi MoldSpecItem) SGSpecLst))
(set_tile "MoldSpecValue" (strcat "You select: SG" MoldSpecNum))
)
((= "TP" MoldSysNum)
(setq MoldSpecNum (nth (atoi MoldSpecItem) TPSpecLst))
(set_tile "MoldSpecValue" (strcat "You select: TP" MoldSpecNum))
)
((= "PP" MoldSysNum)
(setq MoldSpecNum (nth (atoi MoldSpecItem) PPSpecLst))
(set_tile "MoldSpecValue" (strcat "You select: PP" MoldSpecNum))
)
)
;(set_tile "MoldSpecValue" (strcat "You select: " MoldSpecNum))
(mode_tile "accept" 2)
)
;*************OK******END
;*************OK******START
(defun exitMoldLst()
(if (not MoldSpecItem)
(set_tile "MSG" "You did not select any item!")
(done_dialog)
)
)
;*************OK******END
;*****eg / TempData fn /*MoldBaseData/* err_msg***
(defun getMoldBaseData()
(setq fn (open (findfile "MoldBase.lib") "r"))
(setq MoldSysSpec (read (strcat MoldSysNum MoldSpecNum)))
(setq aa MoldSysSpec)
(setq MoldBaseData (read (read-line fn)))
(while (and (/= MoldSysSpec (car MoldBaseData)) MoldBaseData)
(if (setq TempData (read-line fn))
(setq MoldBaseData (read TempData))
(setq MoldBaseData nil)
)
)
(close fn)
(if (not MoldBaseData)
(setq err_msg "Invalid!")
(progn
(setq MoldBaseData (cadr MoldBaseData))
(setq TempData (assoc 'PT MoldBaseData))
(setq cpX (car (nth 1 TempData))
cpY (cadr (nth 1 TempData))
tpX (car (nth 2 TempData))
tpY (cadr (nth 2 TempData))
sbX1 (car (nth 3 TempData))
sbX2 cpx
sbY (cadr (nth 3 TempData))
epX (car (nth 4 TempData))
epY (cadr (nth 4 TempData))
)
(setq TempData (assoc 'PLATE MoldBaseData))
(setq erpZ (cadr (nth 1 TempData))
epZ (cadr (nth 2 TempData))
tpZ (cadr (nth 3 TempData))
bpZ (cadr (nth 4 TempData))
rpZ (cadr (nth 5 TempData))
stZ (cadr (nth 6 TempData))
spZ (cadr (nth 7 TempData))
)
(setq TempData (assoc 'PIN MoldBaseData))
(setq gpnD (nth 1 (nth 1 TempData))
gpnNum (nth 2 (nth 1 TempData))
gpnX (car (nth 3 (nth 1 TempData)))
gpnY (cadr (nth 3 (nth 1 TempData)))
rpnD (nth 1 (nth 2 TempData))
rpnNum (nth 2 (nth 2 TempData))
rpnX (car (nth 3 (nth 2 TempData)))
rpnY (cadr (nth 3 (nth 2 TempData)))
)
(if (= "PP" MoldSysNum)
(setq spnD (nth 1 (nth 3 TempData))
spnNum (nth 2 (nth 3 TempData))
spnX (car (nth 3 (nth 3 TempData)))
spnY (cadr (nth 3 (nth 3 TempData)))
)
)
(setq TempData (assoc 'SCREW MoldBaseData))
(setq scr1D (nth 0 (nth 1 TempData))
scr1Num (nth 1 (nth 1 TempData))
scr1X (car (nth 2 (nth 1 TempData)))
scr1Y (cadr (nth 2 (nth 1 TempData)))
scr2D (nth 0 (nth 2 TempData))
scr2Num (nth 1 (nth 2 TempData))
scr2X (car (nth 2 (nth 2 TempData)))
scr2Y (cadr (nth 2 (nth 2 TempData)))
scr3D (nth 0 (nth 3 TempData))
scr3Num (nth 1 (nth 3 TempData))
scr3X (car (nth 2 (nth 3 TempData)))
scr3Y (cadr (nth 2 (nth 3 TempData)))
)
(if (= 16 scr3Num)
(setq scr3Y2 (caddr (nth 2 (nth 3 TempData))))
)
)
)
(if (not err_msg)
(progn
(cond
((= "SG" MoldSysNum)
(if (/= "I" (substr MoldTypeNum 2 1))
(setq tpX cpX)
)
(if (= "A" (substr MoldTypeNum 1 1))
(setq stZ 0)
)
(if (= "C" (substr MoldTypeNum 1 1))
(setq stZ 0
spZ 0
)
)
(if (= "D" (substr MoldTypeNum 1 1))
(setq spZ 0)
)
(if (= "H" (substr MoldTypeNum 2 1))
(setq tpZ 0)
)
)
((= "TP" MoldSysNum)
(if (= "H" (substr MoldTypeNum 3 1))
(setq tpX cpX)
)
(if (= "FC" (substr MoldTypeNum 1 2))
(setq spZ 0)
)
(if (= "GA" (substr MoldTypeNum 1 2))
(setq rpZ 0)
)
(if (= "GC" (substr MoldTypeNum 1 2))
(setq spZ 0
rpZ 0)
)
)
((= "PP" MoldSysNum)
(if (= "E" (substr MoldTypeNum 1 1))
(setq rpZ 0)
)
(if (= "A" (substr MoldTypeNum 2 1))
(setq stZ 0)
)
(if (= "D" (substr MoldTypeNum 2 1))
(setq spZ 0)
)
(if (= "C" (substr MoldTypeNum 2 1))
(setq stZ 0
spZ 0)
)
)
)
(set_tile "erp" (itoa erpZ))
(set_tile "ep" (itoa epZ))
(set_tile "tp" (itoa tpZ))
(set_tile "bp" (itoa bpZ))
(set_tile "rp" (itoa rpZ))
(set_tile "st" (itoa stZ))
(set_tile "sp" (itoa spZ))
(set_tile "SpecValue" MoldSpecNum)
(mode_tile "option" 0)
)
(progn
(set_tile "SpecValue" err_msg)
(setq MoldSpecNum nil)
)
)
)
(defun PlateThkSel(PlateNum / PlateLst PlateThkItem)
(setq plateLst '("25" "30" "35" "40" "50" "60" "70" "80" "90" "100" "110" "120" "130" "140" "150" "160"
"170" "180" "190" "200" "210")
)
(if (not (new_dialog "mold32" MoldDclId))
(exit)
)
(ini_list "Lst" PlateLst)
(action_tile "Lst" "(setPlateThk)")
(action_tile "accept" "(exitPlateLst)")
(start_dialog)
(if aPThk
(set_tile "aPlateThk" (itoa aPThk))
)
(if bPThk
(set_tile "bPlateThk" (itoa bPThk))
)
(if sbPThk
(set_tile "sbPlateThk" (itoa sbPThk))
)
(if (and aPThk bPThk sbPThk)
(progn
(mode_tile "next34" 0)
(mode_tile "next34" 2)
)
)
)
(defun setPlateThk()
(setq PlateThkItem (get_tile "Lst"))
(cond
((= 1 PlateNum)
(setq aPThk (nth (atoi PlateThkItem) PlateLst))
(set_tile "Value" (strcat "You select: " aPThk))
(setq aPThk (atoi aPThk))
)
((= 2 PlateNum)
(setq bPThk (nth (atoi PlateThkItem) PlateLst))
(set_tile "Value" (strcat "You select: " bPThk))
(setq bPThk (atoi bPThk))
)
((= 3 PlateNum)
(setq sbPThk (nth (atoi PlateThkItem) PlateLst))
(set_tile "Value" (strcat "You select: " sbPThk))
(setq sbPThk (atoi sbPThk))
)
)
(mode_tile "accept" 2)
)
(defun exitPlateLst()
(if (not PlateThkItem)
(set_tile "MSG" "You did not select any item!")
(done_dialog)
)
)
(defun SpecVerify()
(if (= 2 SpecValidNum)
(progn
(setq MoldSpecNum (lxy_trim (get_tile "SpecValue")))
(getMoldBaseData)
(if (and MoldSpecNum aPThk bPThk sbPThk)
(progn
(mode_tile "next34" 0)
(mode_tile "next34" 2)
)
)
)
)
)
(defun PTVerify(PlateNum)
(cond
((= 1 PlateNum)
(setq PThk (get_tile "aPlateThk"))
(if (>= (atof PThk) 25)
(setq aPThk (atof PThk)
err_PT1 nil)
(setq err_PT1 "Invalid!"
aPThk nil)
)
(if err_PT1
(set_tile "aPlateThk" err_PT1)
)
)
((= 2 PlateNum)
(setq PThk (get_tile "bPlateThk"))
(if (>= (atoi PThk) 25)
(setq bPThk (atof PThk)
err_PT2 nil)
(setq err_PT2 "Invalid!"
bPThk nil)
)
(if err_PT2
(set_tile "bPlateThk" err_PT2)
)
)
((= 3 PlateNum)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -