(defun c:two() (setvar "cmdecho" 0) (setq wei1_list '("白炽灯" "荧光灯(单管)" "荧光灯(双管)" "荧光灯(多管)" "高强气体放电灯" "卤钨灯")) (setq wei2_list '("清洁" "一般" "污染")) (setq li1_list '("0.5" "0.6" "0.7" "0.8" "0.9" "1.0" "1.1" "1.25" "1.5" "1.75" "2.0" "2.25" "2.5" "3.0" "3.5" "4.0" "5.0")) (setq li2_list '("30,10" "30,30" "50,10" "50,30" "50;50" "70,10" "70,30" "70,50" "70,70" "30,10,10" "30,30,10" "50,30,10" "50,30,30" "50,50,10" "50,50,30" "70,30,10" "70,30,30" "70,50,10" "70,50,30")) (dcl_1st) (prin1) ) (defun dcl_1st() (setq dcl_id(load_dialog "two")) (new_dialog "two" dcl_id) (show_list "wei1" wei1_list) (show_list "wei2" wei2_list) (show_list "li1" li1_list) (show_list "li2" li2_list) (setq wei1 (get_tile "wei1") wei2 (get_tile "wei2") whxs (get_tile "whxs") li1 (get_tile "li1") li2 (get_tile "li2")) (action_tile "wei1" "(setq wei1 $value)(sub_wei)") (action_tile "wei2" "(setq wei2 $value)(sub_wei)") (action_tile "whxs" "(setq whxs $value)(sub_wei)") (action_tile "li1" "(setq li1 $value)(sub_wei)") (action_tile "li2" "(setq li2 $value)(sub_wei)") (action_tile "accept" "(ok_1st)(done_dialog)") (start_dialog) ) (defun ok_1st() (setq lyxs(get_tile "lyxs")) ) (defun show_list(key newlist) (start_list key) (mapcar 'add_list newlist) (end_list) ) (defun sub_wei() (cond ((and (= wei1 "0") (= wei2 "0")) (set_tile "whxs" "0.75")) ((and (= wei1 "0") (= wei2 "1")) (set_tile "whxs" "0.70")) ((and (= wei1 "0") (= wei2 "2")) (set_tile "whxs" "0.65")) ((if(= wei1 "0") (setq li1 '("0.6" "0.7" "0.8" "0.9" "1.0" "1.1" "1.25" "1.5" "1.75" "2.0" "2.25" "2.5" "3.0" "3.5" "4.0" "5.0") li2 '("50,30,10" "50,30,30" "50,50,10" "50,50,30" "70,30,10" "70,30,30" "70,50,10" "70,50,30"))) ((and(= li1 "0") (= li2 "0")) (set_tile "lyxs" "0.13")) ((and(= li1 "0") (= li2 "1")) (set_tile "lyxs" "0.14")) ((and(= li1 "0") (= li2 "2")) (set_tile "lyxs" "0.16")) ((and(= li1 "0") (= li2 "3")) (set_tile "lyxs" "0.17")) ((and(= li1 "0") (= li2 "4")) (set_tile "lyxs" "0.14")) ((and(= li1 "0") (= li2 "5")) (set_tile "lyxs" "0.15")) ((and(= li1 "0") (= li2 "6")) (set_tile "lyxs" "0.18")) ((and(= li1 "0") (= li2 "7")) (set_tile "lyxs" "0.19")) ((and(= li1 "1") (= li2 "0")) (set_tile "lyxs" "0.16")) ((and(= li1 "1") (= li2 "1")) (set_tile "lyxs" "0.17")) ((and(= li1 "1") (= li2 "2")) (set_tile "lyxs" "0.20")) ((and(= li1 "1") (= li2 "3")) (set_tile "lyxs" "0.20")) ((and(= li1 "1") (= li2 "4")) (set_tile "lyxs" "0.18")) ((and(= li1 "1") (= li2 "5")) (set_tile "lyxs" "0.19")) ((and(= li1 "1") (= li2 "6")) (set_tile "lyxs" "0.22")) ((and(= li1 "1") (= li2 "7")) (set_tile "lyxs" "0.23")) ((and(= li1 "2") (= li2 "0")) (set_tile "lyxs" "0.18")) ((and(= li1 "2") (= li2 "1")) (set_tile "lyxs" "0.19")) ((and(= li1 "2") (= li2 "2")) (set_tile "lyxs" "0.22")) ((and(= li1 "2") (= li2 "3")) (set_tile "lyxs" "0.22")) ((and(= li1 "2") (= li2 "4")) (set_tile "lyxs" "0.21")) ((and(= li1 "2") (= li2 "5")) (set_tile "lyxs" "0.22")) ((and(= li1 "2") (= li2 "6")) (set_tile "lyxs" "0.24")) ((and(= li1 "2") (= li2 "7")) (set_tile "lyxs" "0.25")) ((and(= li1 "3") (= li2 "0")) (set_tile "lyxs" "0.20")) ((and(= li1 "3") (= li2 "1")) (set_tile "lyxs" "0.21")) ((and(= li1 "3") (= li2 "2")) (set_tile "lyxs" "0.24")) ((and(= li1 "3") (= li2 "3")) (set_tile "lyxs" "0.24")) ((and(= li1 "3") (= li2 "4")) (set_tile "lyxs" "0.22")) ((and(= li1 "3") (= li2 "5")) (set_tile "lyxs" "0.23")) ((and(= li1 "3") (= li2 "6")) (set_tile "lyxs" "0.26")) ((and(= li1 "3") (= li2 "7")) (set_tile "lyxs" "0.28")) ) ((and (= wei1 "1") (= wei2 "0")) (set_tile "whxs" "0.75")) ((and (= wei1 "1") (= wei2 "1")) (set_tile "whxs" "0.70")) ((and (= wei1 "1") (= wei2 "2")) (set_tile "whxs" "0.65")) ((and (= wei1 "2") (= wei2 "0")) (set_tile "whxs" "0.75")) ((and (= wei1 "2") (= wei2 "1")) (set_tile "whxs" "0.70")) ((and (= wei1 "2") (= wei2 "2")) (set_tile "whxs" "0.65")) ((and (= wei1 "3") (= wei2 "0")) (set_tile "whxs" "0.75")) ((and (= wei1 "3") (= wei2 "1")) (set_tile "whxs" "0.70")) ((and (= wei1 "3") (= wei2 "2")) (set_tile "whxs" "0.65")) ((and (= wei1 "4") (= wei2 "0")) (set_tile "whxs" "0.75")) ((and (= wei1 "4") (= wei2 "1")) (set_tile "whxs" "0.70")) ((and (= wei1 "4") (= wei2 "2")) (set_tile "whxs" "0.65")) ((and (= wei1 "5") (= wei2 "0")) (set_tile "whxs" "0.85")) ((and (= wei1 "5") (= wei2 "1")) (set_tile "whxs" "0.75")) ((and (= wei1 "5") (= wei2 "2")) (set_tile "whxs" "0.70")) ) ) DCL程序 two:dialog{ label="电气计算软件系列—照度计算"; :boxed_column{ label="维护系数:"; :row{ :popup_list{ label="灯具类型:"; key="wei1"; width=24; height=10; } :popup_list{ label="污染特性:"; key="wei2"; width=24; height=10; } :edit_box{ label="维护系数:"; key="whxs"; width=24; } } } :boxed_column{ label="利用系数:"; :row{ :popup_list{ label="室内指数:"; key="li1"; width=24; height=10; } :popup_list{ label="反射系数:"; key="li2"; width=24; height=10; } :edit_box{ label="利用系数:"; key="lyxs"; width=24; } } } ok_cancel; } 求高手帮忙看看LSP程序,主要是子函数sub_wei中的IF后面那段 怎么都实现不了 ,我想当wei1选择白炽灯时,li1显示除去0.5以外的所有li1_list,怎么去实现啊,貌似我写的那个实现不了。 求帮忙 |