Додаток. Тексти програм

 

*PROCEDURE TIM_UZL

* процедура розрахунку часу затримки повідомлення СК у вузлах СК

STORE 4 TO liamda && інтенсивність надходження вимоги.

STORE 5 TO mju && час обслуговування

STORE 0 TO summa,p0,pq,t_uzl

STORE 1 TO k,m,FL

IF.NOT. USED("TIM_UZEL")

SELECT 0

USE TIM_UZEL

ELSE

SELECT TIM_UZEL

ENDIF

SET ORDER TO TAG prib

GO TOP

DO WHILE k<=5 && число транзитів

DO WHILE m<=10 && число обслуговування приладів n=1

s_slag1=0

slag1=0

ro=liamda/(m*mju)

DO WHILE n<=m-1 && опит. сум. 1-го додат. опит.

fact=factor(n)

slag1=STEPEN(m*ro,n)

slag1=slag1/fact && перший додаток для опит. імовірності

s_slag1=s_slag1+slag1 && сум. значення 1-го додат. от n=1 до n=m-1

n=n+1

ENDDO

fact=factor(m)

slag2=STEPEN(m*ro,m)

slag2=slag2/(fact*(1-ro)) && другий додаток для опит. імовірності

p0=1/(s_slag1+slag2)

pq=p0*slag2

t_uzl=(1/mju+pq/(m*mju-liamda))*k

nam_pol='TR'+LTRIM(STR(K,3))

SEEK STR(m,3)

IF FOUND()

REPLACE NEXT 1 &nam_pol WITH t_uzl

ENDIF

m=m+1

ENDDO && m<=10

m=1

k=k+1

ENDDO

USE

RETURN

FUNCTION FACTOR

* функція визначення f факторіалу

PARAMETER f

r=1

c=1

DO WHILE c<f

r=r*(c+1)

c=c+1

ENDDO

RETURN r

FUNCTION STEPEN

* функція возведення числа p в ступінь q

PARAMETER p,q

c=1

stp=p

DO WHILE c<q

stp=stp*p

c=c+1

ENDDO

RETURN stp

 

*PROCEDURE PROP_SPS

* процедура розрахунку середньої пропускної здатності галузі СК

PUBLIC DIMENSION M_P(10,3)

* M_P(N,1)- число об’єктів керув.

* M_P(N,2)- кіл-сть інф.

* M_P(N,3)- пропуск. здатність

M_N=1

m.n_ko=10

DO WHILE M_N<=10

M_P(M_N,1)=m.n_ko

IF.NOT. USED("RESULT")

SELECT 0

USE RESULT

ENDIF

SELECT RESULT

SET ORDER TO TAG np

GO TOP

DO WHILE .NOT. EOF()

REPLACE NEXT 1 res1 WITH 0

REPLACE NEXT 1 res2 WITH 0

REPLACE NEXT 1 res3 WITH 0

REPLACE NEXT 1 res4 WITH 0

REPLACE NEXT 1 res5 WITH 0

SKIP

ENDDO

USE

IF.NOT. USED("SPRAVKA")

SELECT 0

USE SPRAVKA

ENDIF

SELECT SPRAVKA

SET ORDER TO TAG np

GO TOP

DO WHILE .NOT. EOF()

REPLACE NEXT 1 sost WITH 1 for typ_ko#0

REPLACE NEXT 1 n_ko WITH m.n_ko for typ_ko#0

SKIP

ENDDO

DO CALC

IF.NOT. USED("RESULT")

SELECT 0

USE RESULT

ENDIF

SELECT RESULT

SET ORDER TO TAG np

SEEK("99")

IF FOUND()

M_P(M_N,2)=res4

ENDIF

M_P(M_N,3)=CALC_P(res4)

M_N=M_N+1

m.n_ko=m.n_ko+10

ENDDO && M_N<=10

RETURN

FUNCTION CALC_P

PARAMETER n_inf

STORE 25 TO liamda && інтенсивність надходження треб.

STORE 1 TO liamda_i && інтенсивність надходження треб.

STORE 5 TO mju,nju && час обслуговування

STORE 5 TO mju,nju && час обслуговування

*STORE 0 TO summa,p0,pq,t_uzl

*STORE 1 TO k,m,FL

ro=liamda/(mju*n_inf)

n_=liamda/nju

* c_i=(liamda_i/mju)+n_inf*(1-n_*ro)*sqrt(liamda_i)/sqrt(liamda)

c_i=(liamda_i/mju)+n_inf*(1-n_*ro)/25

RETURN c_i

 

 

 

 

 

 

 

 

 

 

* * 02.08.99 MAIN_MNU.SPR 08:39:52

* Процедура головного меню

* *********************************************************

#REGION 0

REGIONAL m.currarea, m.talkstat, m.compstat

IF SET("TALK") = "ON"

SET TALK OFF

m.talkstat = "ON"

ELSE

m.talkstat = "OFF"

ENDIF

m.compstat = SET("COMPATIBLE")

SET COMPATIBLE FOXPLUS

m.rborder = SET("READBORDER")

SET READBORDER ON

* *********************************************************

* * Windows Window definitions

* *********************************************************

IF NOT WEXIST("main_mnu") ;

OR UPPER(WTITLE("MAIN_MNU")) == "MAIN_MNU.PJX" ;

OR UPPER(WTITLE("MAIN_MNU")) == "MAIN_MNU.SCX" ;

OR UPPER(WTITLE("MAIN_MNU")) == "MAIN_MNU.MNX" ;

OR UPPER(WTITLE("MAIN_MNU")) == "MAIN_MNU.PRG" ;

OR UPPER(WTITLE("MAIN_MNU")) == "MAIN_MNU.FRX" ;

OR UPPER(WTITLE("MAIN_MNU")) == "MAIN_MNU.QPR"

DEFINE WINDOW main_mnu ;

AT 8.692, 14.000 ;

SIZE 18.188,91.286 ;

FONT "MS Sans Serif", 8 ;

NOFLOAT ;

NOCLOSE ;

NOMINIMIZE ;

HALFHEIGHT ;

COLOR RGB(,,,192,192,192)

ENDIF

 

* *********************************************************

* * MAIN_MNU/Windows Setup Code - SECTION 2

* *********************************************************

*

#REGION 1

DEFINE POPUP MAINMENU RELATIVE IN SCREEN SCROLL

DEFINE BAR 1 OF MAINMENU PROMPT ' РОЗРАХУНОК КІЛЬКІСТІ ІНФОРМАЦІЇ'

DEFINE BAR 2 OF MAINMENU PROMPT ' РОЗРАХУНОК ЗАТРИМКИ ЧАСУ '

DEFINE BAR 3 OF MAINMENU PROMPT ' ВИХІД '

ON SELECTION POPUP MAINMENU DO VIBOR

* *********************************************************

* * MAIN_MNU/Windows Screen Layout

* *********************************************************

#REGION 1

IF WVISIBLE("main_mnu")

ACTIVATE WINDOW main_mnu SAME

ELSE

ACTIVATE WINDOW main_mnu NOSHOW

ENDIF

@ 3.688,5.286 GET M.MNU ;

PICTURE "@&N" ;

POPUP MAINMENU ;

SIZE 3.182,42.385 ;

DEFAULT " " ;

FONT "Pragmatica", 20 ;

STYLE "B" ;

WHEN _s770ikjyn() ;

VALID _s770ikjyz() ;

COLOR RGB(0,0,0,0,128,128),RGB(0,0,0,0,128,128)

@ 1.125,19.143 SAY "ВИБЕРИТЕ" ;

PICTURE "@I" ;

FONT "Pragmatica", 14 ;

STYLE "BT" ;

COLOR RGB(128,0,0,128,0,0)

@ 1.125,39.429 SAY "РЕЖИМ" ;

PICTURE "@I" ;

FONT "Pragmatica", 14 ;

STYLE "BT" ;

COLOR RGB(128,0,0,128,0,0)

@ 1.125,54.714 SAY "РОБОТИ" ;

PICTURE "@I" ;

FONT "Pragmatica", 14 ;

STYLE "BT" ;

COLOR RGB(128,0,0,128,0,0)

@ 11.875,18.857 SAY " ВИБОРУ " ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,30.857 SAY "ПУНКТА" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,,,,)

@ 11.875,51.429 SAY "НАТИСНИТЕТЕ " ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,13.714 SAY "ДЛЯ" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 13.375,29.143 SAY 'ДВІЧИ КЛАЦНИТЕ "МИШОЮ"' ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,41.143 SAY "МЕНЮ" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,49.714 SAY "-" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,68.571 SAY "<ENTER>" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 13.375,22.286 SAY "АБО" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.250,10.286 TO 15.313,79.143 ;

PEN 2, 8 ;

STYLE "16" ;

COLOR RGB(0,0,255,0,0,255)

IF NOT WVISIBLE("main_mnu")

ACTIVATE WINDOW main_mnu

ENDIF

READ CYCLE

RELEASE WINDOW main_mnu

#REGION 0

SET READBORDER &rborder

IF m.talkstat = "ON"

SET TALK ON

ENDIF

IF m.compstat = "ON"

SET COMPATIBLE ON

ENDIF

* *********************************************************

* * MAIN_MNU/Windows Cleanup Code

* *********************************************************

#REGION 1

RELEASE POPUP MAINMENU

CLEAR READ

* *********************************************************

* *

* * MAIN_MNU/Windows Supporting Procedures and Functions

* *

* *********************************************************

#REGION 1

PROCEDURE VIBOR

REVN=BAR()

RETURN

* *********************************************************

* *

* * _S770IKJYN M.MNU WHEN

* *

* * Function Origin:

* *********************************************************

*

FUNCTION _s770ikjyn && M.MNU WHEN

#REGION 1

A=POPUP()

 

 

* *********************************************************

* *

* * _S770IKJYZ M.MNU VALID

* *

* * Function Origin:

* *

* * From Platform: Windows

* * From Screen: MAIN_MNU, Record Number: 3

* * Variable: M.MNU

* * Called By: VALID Clause

* * Object Type: List

* * Snippet Number: 2

* *

* *********************************************************

*

FUNCTION _s770ikjyz && M.MNU VALID

#REGION 1

DO VIBOR

CLEAR READ* MENU1, MENU2 - процедура формування та виводу на термінал меню режиму робіт

* *********************************************************

* *

* * 11.05.99 MENU1.SPR 13:15:33

* *

* *********************************************************

* * Author's Name

* * Copyright (c) 1999 Company Name

* * Address

* * City, Zip

* * Description:

* * This program was automatically generated by GENSCRN.

* *********************************************************

#REGION 0

REGIONAL m.currarea, m.talkstat, m.compstat

IF SET("TALK") = "ON"

SET TALK OFF

m.talkstat = "ON"

ELSE

m.talkstat = "OFF"

ENDIF

m.compstat = SET("COMPATIBLE")

SET COMPATIBLE FOXPLUS

m.rborder = SET("READBORDER")

SET READBORDER ON

* *********************************************************

* * Windows Window definitions

* *********************************************************

IF NOT WEXIST("menu1") ;

OR UPPER(WTITLE("MENU1")) == "MENU1.PJX" ;

OR UPPER(WTITLE("MENU1")) == "MENU1.SCX" ;

OR UPPER(WTITLE("MENU1")) == "MENU1.MNX" ;

OR UPPER(WTITLE("MENU1")) == "MENU1.PRG" ;

OR UPPER(WTITLE("MENU1")) == "MENU1.FRX" ;

OR UPPER(WTITLE("MENU1")) == "MENU1.QPR"

DEFINE WINDOW menu1 ;

AT 8.692, 14.000 ;

SIZE 18.188,91.286 ;

FONT "MS Sans Serif", 8 ;

NOFLOAT ;

NOCLOSE ;

NOMINIMIZE ;

HALFHEIGHT ;

COLOR RGB(,,,192,192,192)

ENDIF

* *********************************************************

* * MENU1/Windows Setup Code - SECTION 2

* *********************************************************

#REGION 1

DEFINE POPUP MAINMENU RELATIVE IN SCREEN SCROLL

DEFINE BAR 1 OF MAINMENU PROMPT ' ВИВОД НА ТЕРМІНАЛ '

DEFINE BAR 2 OF MAINMENU PROMPT ' ВИВОД НА ДРУК '

DEFINE BAR 3 OF MAINMENU PROMPT ' ВИХІД '

ON SELECTION POPUP MAINMENU DO VIBOR

* *********************************************************

* * MENU1/Windows Screen Layout

* *********************************************************

#REGION 1

IF WVISIBLE("menu1")

ACTIVATE WINDOW menu1 SAME

ELSE

ACTIVATE WINDOW menu1 NOSHOW

ENDIF

@ 3.688,13.857 GET M.MNU ;

PICTURE "@&N" ;

POPUP MAINMENU ;

SIZE 3.194,28.733 ;

DEFAULT " " ;

FONT "Pragmatica", 20 ;

STYLE "B" ;

WHEN _s4w0sf3dy() ;

VALID _s4w0sf3en() ;

COLOR RGB(0,0,0,0,128,128),RGB(0,0,0,0,128,128)

@ 1.125,19.571 SAY "ВИБЕРИТЕ" ;

PICTURE "@I" ;

FONT "Pragmatica", 14 ;

STYLE "BT" ;

COLOR RGB(128,0,0,128,0,0)

@ 1.125,39.429 SAY "РЕЖИМ" ;

PICTURE "@I" ;

FONT "Pragmatica", 14 ;

STYLE "BT" ;

COLOR RGB(128,0,0,128,0,0)

@ 1.125,55.000 SAY "РОБОТИ" ;

PICTURE "@I" ;

FONT "Pragmatica", 14 ;

STYLE "BT" ;

COLOR RGB(128,0,0,128,0,0)

@ 11.875,18.857 SAY " ВИБОРУ " ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,30.857 SAY "ПУНКТА" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,,,,)

@ 11.875,51.429 SAY "НАТИСНИТЕТЕ " ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,13.714 SAY "ДЛЯ" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 13.375,29.143 SAY 'ДВІЧИ КЛАЦНИТЕ "МИШОЮ"' ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,41.143 SAY "МЕНЮ" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,49.714 SAY "-" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.875,68.571 SAY "<ENTER>" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 13.375,22.286 SAY "АБО" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 11.250,10.286 TO 15.313,79.143 ;

PEN 2, 8 ;

STYLE "16" ;

COLOR RGB(0,0,255,0,0,255)

IF NOT WVISIBLE("menu1")

ACTIVATE WINDOW menu1

ENDIF

READ CYCLE

RELEASE WINDOW menu1

#REGION 0

SET READBORDER &rborder

IF m.talkstat = "ON"

SET TALK ON

ENDIF

IF m.compstat = "ON"

SET COMPATIBLE ON

ENDIF

* *********************************************************

* * MENU1/Windows Cleanup Code

* *********************************************************

#REGION 1

RELEASE POPUP MAINMENU

CLEAR READ

* *********************************************************

* * MENU1/Windows Supporting Procedures and Functions

* *********************************************************

#REGION 1

PROCEDURE VIBOR

REVM=BAR()

RETURN

* *********************************************************

* * _S4W0SF3DY M.MNU WHEN

* * Function Origin:

* * From Platform: Windows

* *********************************************************

FUNCTION _s4w0sf3dy && M.MNU WHEN

#REGION 1

A=POPUP()

* *********************************************************

* * _S4W0SF3EN M.MNU VALID

* * Function Origin:

* * From Platform: Windows

* *********************************************************

FUNCTION _s4w0sf3en && M.MNU VALID

#REGION 1

DO VIBOR

CLEAR READ

* *********************************************************

* * 19.05.99 MENU2.SPR 10:09:35

* *********************************************************

* * This program was automatically generated by GENSCRN.

* *********************************************************

#REGION 0

REGIONAL m.currarea, m.talkstat, m.compstat

IF SET("TALK") = "ON"

SET TALK OFF

m.talkstat = "ON"

ELSE

m.talkstat = "OFF"

ENDIF

m.compstat = SET("COMPATIBLE")

SET COMPATIBLE FOXPLUS

m.rborder = SET("READBORDER")

SET READBORDER ON

* *********************************************************

* * Windows Window definitions

* *********************************************************

IF NOT WEXIST("menu2") ;

OR UPPER(WTITLE("MENU2")) == "MENU2.PJX" ;

OR UPPER(WTITLE("MENU2")) == "MENU2.SCX" ;

OR UPPER(WTITLE("MENU2")) == "MENU2.MNX" ;

OR UPPER(WTITLE("MENU2")) == "MENU2.PRG" ;

OR UPPER(WTITLE("MENU2")) == "MENU2.FRX" ;

OR UPPER(WTITLE("MENU2")) == "MENU2.QPR"

DEFINE WINDOW menu2 ;

AT 8.000, 14.000 ;

SIZE 21.500,90.429 ;

FONT "MS Sans Serif", 8 ;

NOFLOAT ;

NOCLOSE ;

NOMINIMIZE ;

HALFHEIGHT ;

COLOR RGB(,,,192,192,192)

ENDIF

* *********************************************************

* * MENU2/Windows Setup Code - SECTION 2

* *********************************************************

#REGION 1

DEFINE POPUP MAINMENU RELATIVE IN SCREEN SCROLL

DEFINE BAR 1 OF MAINMENU PROMPT ' ТАБЛИЦЯ ПАРАМЕТРІВ 'DEFINE BAR 2 OF MAINMENU PROMPT ' ТАБЛИЦЯ РОЗКИДУ ПАРАМЕТРІВ '

DEFINE BAR 3 OF MAINMENU PROMPT ' ТАБЛИЦЯ ЗА РЕЗУЛЬТАТАМИ (проміжна) '

DEFINE BAR 4 OF MAINMENU PROMPT ' ТАБЛИЦЯ ЗА РЕЗУЛЬТАТАМИ (підсумкова)'

DEFINE BAR 5 OF MAINMENU PROMPT ' ВИХІД '

ON SELECTION POPUP MAINMENU DO VIBOR

* *********************************************************

* * MENU2/Windows Screen Layout

* *********************************************************

#REGION 1

IF WVISIBLE("menu2")

ACTIVATE WINDOW menu2 SAME

ELSE

ACTIVATE WINDOW menu2 NOSHOW

ENDIF

@ 3.688,8.857 GET M.MNU ;

PICTURE "@&N" ;

POPUP MAINMENU ;

SIZE 5.303,38.615 ;

DEFAULT " " ;

FONT "Pragmatica", 20 ;

STYLE "B" ;

WHEN _s540lryc5() ;

VALID _s540lrycm() ;

COLOR RGB(0,0,0,0,128,128),RGB(0,0,0,0,128,128)

@ 1.125,27.429 SAY "ВИБЕРИТЕ" ;

PICTURE "@I" ;

FONT "Pragmatica", 14 ;

STYLE "BT" ;

COLOR RGB(128,0,0,128,0,0)

@ 1.125,49.714 SAY "ТАБЛИЦЮ" ;

PICTURE "@I" ;

FONT "Pragmatica", 14 ;

STYLE "BT" ;

COLOR RGB(128,0,0,128,0,0)

@ 17.125,20.571 SAY " ВИБОРУ " ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 17.125,32.571 SAY "ПУНКТА" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,,,,)

@ 17.125,54.857 SAY "НАТИСНИТЕ " ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 17.125,15.429 SAY "ДЛЯ" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 18.625,30.857 SAY 'ДВІЧИ КЛАЦНИТЕ "МИШОЮ"' ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 17.125,42.857 SAY "МЕНЮ" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 17.125,51.429 SAY "-" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 17.125,68.571 SAY "<ENTER>" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 18.625,24.000 SAY "АБО" ;

FONT "Arial Cyr", 11 ;

STYLE "BT" ;

COLOR RGB(0,0,255,255,255,0)

@ 16.500,12.000 TO 20.563,80.857 ;

PEN 2, 8 ;

STYLE "16" ;

COLOR RGB(0,0,255,0,0,255)

IF NOT WVISIBLE("menu2")

ACTIVATE WINDOW menu2

ENDIF

READ CYCLE

RELEASE WINDOW menu2

#REGION 0

SET READBORDER &rborder

IF m.talkstat = "ON"

SET TALK ON

ENDIF

IF m.compstat = "ON"

SET COMPATIBLE ON

ENDIF

* *********************************************************

* * MENU2/Windows Cleanup Code

* *********************************************************

#REGION 1

RELEASE POPUP MAINMENU

CLEAR READ

* *********************************************************

* * MENU2/Windows Supporting Procedures and Functions

* *********************************************************

#REGION 1

Hosted by uCoz