Автоматизированное рабочее место оператора автоматизированного переговорного пункта и информационной системыРефераты >> Программирование и компьютеры >> Автоматизированное рабочее место оператора автоматизированного переговорного пункта и информационной системы
ПРИЛОЖЕНИЕ 2
Текст программы АРМ АПП АК
iap | |
iap |
;IAKoff;04:04 PM 6 Mar 1996 |
;Обслуживание АПП-РК | |
n %res,%,%NCAB,%OLDTRAPER,%BEEP,%LON,%LOFF | |
s %BEEP=$c(7)_$c(7)_$c(7)_$c(7)_$c(7)_$c(7)_$c(7)_$c(7) | |
s %=$c(30) s %OLDTRAPER=$ztrap | |
s $ztrap="ERROR^iap" | |
s %LON=0,%LOFF=0 | |
reinit | |
i $$INITAPP()=0 q | |
s %NCAB=$$INITCAB() | |
i %NCAB=0 s %res=$$^dp58msg(12,30,"Ошибка в определении кабин",1) q | |
i %NCAB>16 s %NCAB=16 | |
w /color(7,0) d ^dp58box(0,0,24,79,0,$c(177)) | |
w /color(0,7),/c(0,0),$zzr($$DAYNAME^dp58sys()_" "_$$FULLDATE^dp58sys(),80) | |
redraw | |
s %res=$$LIST^dp58Sel("^appstat(""CABLIST"",%i)","%i",0,1,78,%NCAB+1,"N",1,"DOUBLE","Опреатор : "_%APPSYS("NOM_OPER")_$c(30)_" N ЗАДАТОК ОСТАТОК ТАРИФ ВРЕМЯ КОД+ТЕЛЕФОН СОСТ."_$c(30)_"F3-Вкл. F4-Откл. F5-Кв. F6-Прткл. F8-Ручн.заказ. ESC-Выход","DrawCab^iap||OutCab^iap","KEYF3,KEYF4,KEYCRASH,KEYF5,KEYF6,KEYF8") | |
i $p(%res,$c(30),2)="KEYCRASH" d CRASH q | |
i $p(%res,$c(30),2)="KEYENTER" | |
i $p(%res,$c(30),2)="KEYF3" s %LON=$$OPENCAB(%LOFF) s %LOFF="" | |
i $p(%res,$c(30),2)="KEYF4" s %LOFF=$$CLOSECAB(%LON) s %LON="" | |
i $p(%res,$c(30),2)="KEYF5" s %LOFF=$$TICKETS(%LOFF) | |
i $p(%res,$c(30),2)="KEYF6" s %LOFF=$$HISTORY(%LOFF) | |
i $p(%res,$c(30),2)="KEYF8" d ^iaphand | |
i $p(%res,$c(30),2)="KEYESC" s ^appstat(1)="F" q | |
g redraw | |
DrawCab | |
n %s,I,P,%CAB | |
i %dpINDEX="DRAWFREE" w $j("",%dpSX) q | |
s %CAB=^appcab(%i) | |
s %s=$p(%CAB,$c(30),1) | |
s I=$s(%s=-1:7,%s=0:14,%s=1:0,%s=2:14,%s=3:14,%s=4:0,1:7) | |
s P=$s(%s=-1:0,%s=0:0,%s=1:15,%s=2:7,%s=3:0,%s=4:15,1:7) | |
w /color(I,P) | |
w " " | |
w $j(^appstat("CABLIST",%i),2)_" " | |
w /color($p(%dpCOLORS,",",7),$p(%dpCOLORS,",",8)) | |
w " ¦ " | |
i %LON=%i w /color(0,15) | |
w $p($zzc($p(%CAB,$c(30),3),18),".",1) | |
w /color($p(%dpCOLORS,",",7),$p(%dpCOLORS,",",8))," ¦ " | |
i %LOFF=%i w /color(0,15) | |
w $p($zzc($p(%CAB,$c(30),4),18),".",1) | |
w /color($p(%dpCOLORS,",",7),$p(%dpCOLORS,",",8)) | |
w " ¦ ",$p($zzc($p(%CAB,$c(30),6),12),".",1) | |
n %time | |
s %time=$p(%CAB,$c(30),14) | |
i %time=-1 s %time=$p(%CAB,$c(30),13) | |
e d | |
. s %time=$p($h,",",2)-%time | |
. s %s=%time\60 | |
. s %time=$zzj(%s,2)_":"_$zzj(%time#60,2) | |
w " ¦",$j(%time,5) | |
w "¦ ",$j($p(%CAB,$c(30),7)_"-"_$p(%CAB,$c(30),5),11) | |
s %s=$p(%CAB,$c(30),2) | |
w " ¦ ",$s(%s=0:"к",%s=1:"А",%s=2:"Р") | |
s %s=$p(%CAB,$c(30),15)+0 | |
w $s(%s=0:" ",%s=1:" ",%s=2:"--",1:"/\") | |
q | |
OutCab | |
i (^appstat("STATUS")="A") s %dpKEYCODE="KEYCRASH" | |
s %str=$$TIME^dp58sys() | |
w /c(80-$l(%str),0),/color(0,7),%str | |
i %dpKEYCODE="KEYNOPRESS" s %dpKEYCODE="KEYREDRAW" | |
i %dpKEYCODE="KEYDOWN" s %dpKEYCODE="KEYEND" | |
i %dpKEYCODE="KEYUP" s %dpKEYCODE="KEYHOME" | |
i %dpKEYCODE="KEYPAGEDOWN" s %dpKEYCODE="KEYEND" | |
i %dpKEYCODE="KEYPAGEUP" s %dpKEYCODE="KEYHOME" | |
q | |
; ----------------------------------------------------------- | |
INITCAB() | |
n %i,%n | |
s %i="",%n=0 | |
initcab1 | |
s %i=$o(^appstat("CABLIST",%i)) | |
i %i="" q %n | |
s %n=%n+1 | |
g initcab1 | |
; ----------------------------------------------------------- | |
INITAPP() | |
n %res,%ws | |
i $$tstjob^iapmon()'="" g initapp3 | |
w /color(14,0) | |
s %res=$$^dp58msg(12,30,"Запуск монитора",0.1) | |
s %res=$$run^iapmon | |
i %res=1 s %res=$$^dp58msg(12,30,"АПП не подключен"_%_"к вашей станции."_%_"Опишите в устаноквх на АПП",0) q 0 | |
i %res=2 s %res=$$^dp58msg(12,30,"Не верный номер устройства."_%_"Опишите в устаноквх на АПП",0) q 0 | |
h 3 | |
initapp2 | |
s %ws=10 | |
initapp1 | |
w /color(14,0) | |
s %res=$$^dp58msg(12,35,"Ожидание готовности монитора :"_%ws,0.1) h 1 | |
i ^appstat("STATUS")="A" s %res=$$^dp58msg(12,30,"Неполадки ! ! !"_%_"Авария АПП-РК"_%_"Сбросте АПП-РК"_%_"и попытайтесь еще раз.",0) q 0 | |
i ^appstat("STATUS")="H" s %res=$$^dp58msg(12,30,"Неполадки ! ! !"_%_"Сбросте АПП-РК"_%_"и попытайтесь еще раз.",0) q 0 | |
s %ws=%ws-1 i %ws=0 q 0 | |
i ^appstat("CMD")'="R" g initapp1 | |
initapp3 | |
i (^appstat(1)'="F") s %res=$$^dp58msg(12,30,"Второй лишний.",1) q 0 | |
s ^appstat(1)=%APPSYS("NOM_OPER") | |
s ^appstat(1,"NOM_OPER")=%APPSYS("NOM_OPER") | |
s ^appstat(1,"NOM_GOES")=%APPSYS("NOM_GOES") | |
s ^appstat(1,"NOM_MESS")=%APPSYS("NOM_MESS") | |
s ^appstat(1,"NOM_DENN")=%APPSYS("NOM_DENN") | |
s ^appstat(1,"NOM_SMEN")=%APPSYS("NOM_SMEN") | |
s ^appstat("USD_KURS")=%APPSYS("USD_KURS") | |
q 1 | |
; ----------------------------------------------------------- | |
CRASH | |
i $$^dp58msg(8,30,"А В А Р И Я ! ! !"_%_"Нажмите на задней панели АПП-РК"_%_"маленькую беленькую кнопочку"_%_"и затем нажмите на клавиатуре <ENTER>",0)'="KEYENTER" g CRASH | |
s ^appstat(1)="F" | |
q | |
; ----------------------------------------------------------- | |
OPENCAB(%cab) | |
n %forma,%res | |
i (^appstat("STATUS")="A")!(^appstat("STATUS")="H") s %res=$$^dp58msg(12,35,"АВАРИЙНАЯ СИТУАЦИЯ !"_$c(30)_"ВКЛЮЧАТЬ КАБИНЫ НЕЛЬЗЯ.",0) q %cab | |
i $g(%cab)'="" s %forma("CABNUM")=$g(^appstat("CABLIST",%cab)) | |
s %forma("SUMMA")=0 | |
d drscr^uf58("iap!OPEN") | |
i $$get^uf58("iap!OPEN","%forma")="ESC" q %cab | |
s %cab=$$phys(%forma("CABNUM")) | |
i (^appcab(%cab).2=2) d ^AppOnRk58(%cab,"ON") q %cab | |
d cabon(%cab,%forma("SUMMA")) | |
q %cab | |
OutOPCN() | |
n %res,%cab | |
s %cab=$$phys($p(%ufNEWDATA,$c(30),1)) | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q %ufNEWDATA | |
i $g(^appcab(%cab))="" s %res="Неверный номер кабины !" g OPCN1 | |
i ^appcab(%cab).1=-1 s %res="Кабина на ремонте !" g OPCN1 | |
i ^appcab(%cab).1=1 s %res="Кабина занята !" g OPCN1 | |
i ^appcab(%cab).1=2 s %res="В кабине остаток !" g OPCN1 | |
q %ufNEWDATA | |
OPCN1 | |
s %res=$$^dp58msg(3,35,%res,0) | |
d drscr^uf58("iap!OPEN") | |
d redraw^uf58("iap!OPEN","%forma") | |
q "PROBLEM" | |
InOPSM() | |
n %cab | |
s %cab=$$phys($p(%ufNEWDATA,$c(30),1)) | |
i (^appcab(%cab).2=2) q "FIELDOFF" | |
q %ufOLDDATA | |
; ----------------------------------------------------------- | |
CLOSECAB(%cab) | |
n %forma,%res | |
i $g(%cab)'="" s %forma("CABNUM")=$g(^appstat("CABLIST",%cab)) | |
d drscr^uf58("iap!CLOSE") | |
i $$get^uf58("iap!CLOSE","%forma")="ESC" q %cab | |
s %cab=$$phys(%forma("CABNUM")) | |
i (^appcab(%cab).2=2) d ^AppOnRk58(%cab,"OFF") q %cab | |
d caboff(%cab) | |
q %cab | |
OutCLCN() | |
n %res,%cab | |
s %cab=$$phys($p(%ufNEWDATA,$c(30),1)) | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q %ufNEWDATA | |
i $g(^appcab(%cab))="" s %res="Неверный номер кабины !" g CLCN1 | |
i ^appcab(%cab).1=-1 s %res="Кабина на ремонте !" g CLCN1 | |
i ^appcab(%cab).1=0 s %res="Кабина свободна !" g CLCN1 | |
q %ufNEWDATA | |
CLCN1 | |
s %res=$$^dp58msg(3,35,%res,0) | |
d drscr^uf58("iap!CLOSE") | |
d redraw^uf58("iap!CLOSE","%forma") | |
q "PROBLEM" | |
; ----------------------------------------------------------- | |
phys(%l) | |
n %i | |
s %i="" | |
phys1 | |
s %i=$o(^appstat("CABLIST",%i)) | |
i %i="" q 0 | |
i %l=^appstat("CABLIST",%i) q %i | |
g phys1 | |
; ----------------------------------------------------------- | |
cabon(%numcab,%zadat) | |
k ^appticket(%numcab) | |
n %hl | |
s %hl="1" i %numcab>16 s %hl="2" | |
s %cmd="B"_%numcab_" "_%zadat | |
cabon1 | |
i ^appstat("CMD")'="R" g cabon1 | |
s ^appstat("CMD")="WRQ"_%hl | |
i ^appstat("CMD")="WEN"_%hl g cabon3 | |
i ^appstat("CMD")="R" g cabon1 | |
cabon3 | |
s ^appstat("CMD","COM")=%cmd | |
s ^appstat("CMD")="WAC"_%hl | |
q | |
; ----------------------------------------------------------- | |
caboff(%numcab) | |
n %hl,%kk | |
s %hl="1" i %numcab>16 s %hl="2" | |
i ^appstat("STATUS")="A" g caboff6 | |
s %cmd="O"_%numcab | |
caboff1 | |
i ^appstat("CMD")'="R" g caboff1 | |
s ^appstat("CMD")="WRQ"_%hl | |
i ^appstat("CMD")="WEN"_%hl g caboff3 | |
i ^appstat("CMD")="R" g caboff1 | |
caboff3 | |
s ^appstat("CMD","COM")=%cmd | |
s ^appstat("CMD")="WAC"_%hl | |
caboff4 | |
r *%kk:0.1 i %kk'=-1 g caboff5 | |
caboff6 | |
i (^appcab(%numcab).1'=0)&(^appcab(%numcab).1'=2)&(^appcab(%numcab).1'=1) g caboff4 | |
caboff5 | |
q | |
; ----------------------------------------------------------- | |
TICKETS(%cab) | |
n %forma,%res,%sel,%sid,%id | |
i $g(%cab)="" s %cab=0 | |
s %forma("CABNUM")=$g(^appstat("CABLIST",%cab)) | |
d drscr^uf58("iap!TICKET") | |
i $$get^uf58("iap!TICKET","%forma")="ESC" q %cab | |
s %cab=$$phys(%forma("CABNUM")) | |
s %id="" f d s %id=$o(^appticket(%cab,%id)) s:%id'="" %sel(%id)=%id q:%id="" | |
i (^appcab(%cab).2=2) q %cab ; ПЕЧАТЬ КВИТАНЦИЙ ПО РУЧНОЙ КАБИНЕ | |
tickets1 | |
s %res=$$SELECT^dp58Sel("^appticket(%cab,%id)","%id","%sel(%sid)","%sid",10,12,61,9,"",0,"SINGLE","Квитанции по кабине N "_%cab_$c(30)_"ПРОД. КОД ГОРОД РЕГИОН ТЕЛЕФОН СУММА "_$c(30)_"<INS>-ОТМЕТКА <F4>-ПЕЧАТЬ","DrawTicket^iap","KEYF4") | |
i $p(%res,$c(30),2)="KEYESC" q %cab | |
i $p(%res,$c(30),2)="KEYF4" d TICKPRINT q %cab | |
g tickets1 | |
DrawTicket | |
i %dpINDEX="DRAWFREE" w $j("",%dpSX) q | |
w $j($p(^appticket(%cab,%id),$c(30),3),5)_" " | |
w $j($p(^appticket(%cab,%id),$c(30),4),3)_" " | |
w $j($p(^appticket(%cab,%id),$c(30),5),12)_" " | |
w $j($p(^appticket(%cab,%id),$c(30),8),14)_" " | |
w $j($p(^appticket(%cab,%id),$c(30),6),10)_" " | |
w $zzc($p(^appticket(%cab,%id),$c(30),7),12,2) | |
q | |
OutTCCN() | |
n %res,%cab | |
s %cab=$$phys($p(%ufNEWDATA,$c(30),1)) | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q %ufNEWDATA | |
i $g(^appcab(%cab))="" s %res="Неверный номер кабины !" g TCCN1 | |
i ^appcab(%cab).1=-1 s %res="Кабина на ремонте !" g TCCN1 | |
i ^appcab(%cab).1=1 s %res="Кабина занята !" g TCCN1 | |
i $d(^appticket(%cab))=0 s %res="Нет квитанции !" g TCCN1 | |
i ^appcab(%cab).1=2 s %res="В кабине остаток !" g TCCN1 | |
q %ufNEWDATA | |
TCCN1 | |
s %res=$$^dp58msg(3,35,%res,0) | |
d drscr^uf58("iap!TICKET") | |
d redraw^uf58("iap!TICKET","%forma") | |
q "PROBLEM" | |
; ----------------------------------------------------------- | |
TICKPRINT | |
n %KVIT,%sid | |
s %sid=$o(%sel("")) i %sid="" q | |
tickprn1 | |
i $g(%sel(%sid))=0 g tickprn3 | |
s %KVIT(%sid)=<9,$p(^appticket(%cab,%sid),%,7),$p(^appticket(%cab,%sid),%,4)_"-"_$p(^appticket(%cab,%sid),%,6)_" "_$p(^appticket(%cab,%sid),%,3)> | |
tickprn3 | |
s %sid=$o(%sel(%sid)) i %sid'="" g tickprn1 | |
d PrintKvit^AppSysd | |
q | |
; ----------------------------------------------------------- | |
HISTORY(%cab) |
;IAKoff;10:34 PM 26 Aug 1995; |
n %ll,%ee,%id | |
i $g(%cab)="" s %cab=0 | |
s %forma("CABNUM")=$g(^appstat("CABLIST",%cab)) | |
d drscr^uf58("iap!HISTORY") | |
i $$get^uf58("iap!HISTORY","%forma")="ESC" q %cab | |
s %cab=$$phys(%forma("CABNUM")) | |
s %ee="C"_%cab | |
i $d(^appjrn(%ee))=0 g ihlp1 | |
s %ll="^appjrn(%ee,%id)" s %id="" s %id=$o(^appjrn(%ee,%id),-1) | |
s %rr=$$LIST^dp58Sel(%ll,"%id",1,10,76,12,"",0,"DOUBLE"," Журнал ","DrawHist^iap") | |
ihlp1 | |
q %cab | |
OutHSCN() | |
n %res,%cab | |
s %cab=$$phys($p(%ufNEWDATA,$c(30),1)) | |
i $p(%ufNEWDATA,$c(30),2)="KEYESC" q %ufNEWDATA | |
i $g(^appcab(%cab))="" s %res="Неверный номер кабины !" g HSCN1 | |
i ^appcab(%cab).1=-1 s %res="Кабина на ремонте !" g HSCN1 | |
q %ufNEWDATA | |
HSCN1 | |
s %res=$$^dp58msg(3,35,%res,0) | |
d drscr^uf58("iap!HISTORY") | |
d redraw^uf58("iap!HISTORY","%forma") | |
q "PROBLEM" | |
DrawHist | |
n %rrr,%time,%date | |
i %dpINDEX="DRAWFREE" w $j("",%dpSX) q | |
s %rrr=^appjrn(%ee,%id,"MSG") | |
s %time=$j($p(^appjrn(%ee,%id,"TIME"),$c(30),1),8) | |
s %date=$j($p(^appjrn(%ee,%id,"TIME"),$c(30),2),5) | |
i $p(%rrr," ",1)="ON" g drwh1 | |
i $p(%rrr," ",1)="OFF" g drwh2 | |
i $p(%rrr," ",1)="BBB" g drwh3 | |
i $p(%rrr," ",1)="EEE" g drwh4 | |
i $p(%rrr," ",1)="AAA" g drwh5 | |
w $zzr(%rrr,61)_%time_" "_%date_" " q | |
drwh1 | |
w $zzr("Вкл. "_$p(%rrr," ",2),61)_%time_" "_%date_" " q | |
drwh2 | |
w $zzr("Выкл. "_$p(%rrr," ",2),61)_%time_" "_%date_" " q | |
drwh3 | |
w $zzr("Нач. разг. тариф:"_$p(%rrr," ",4)_" тел:"_$p(%rrr," ",6),61)_%time_" "_%date_" " q | |
drwh4 | |
w $zzr("Кон. разг. время:"_$p(%rrr," ",3)_" сумма:"_$p(%rrr," ",5),61)_%time_" "_%date_" " | |
q | |
drwh5 | |
w $zzr("Авар. зав. время:"_$p(%rrr," ",3)_" сумма:"_$p(%rrr," ",5),61)_%time_" "_%date_" " | |
q | |
; ----------------------------------------------------------- | |
ERROR | |
s $ztrap=%OLDTRAPER | |
s ^appstat(1)="F" | |
g @$ztrap |