Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ПРОГРАММИРОВАНИЕ_САУ_КМО.doc
Скачиваний:
12
Добавлен:
06.11.2018
Размер:
918.02 Кб
Скачать

16. Файл sys_dv0.H. Программная заглушка программы scont.C.

[1] /*########################################################*/

[2] /*

[3] Copyright (C) 2008 by A.E.Stefanovich tel. 236-2729, 268-3916

[4] Moscow State University of the Instrumentation and Informatics

[5] MGUPI

[6] Chair Information Maintenance of Systems Robototechnical and Mechatronic

[7] IS 5

[8] */

[9] /*########################################################*/

[10] /*

[11] File: SYSDV0.h

[12]

[13] */

[14] /*################################################ LEGEND */

[15] /*

[16] Year: 2008

[17] */

[18] /*########################################################*/

[19] /*============================= Declarations */

[20] int Dev0_pct(int kx,int ky); /* Picture */

[21] int Dev0_log(int kx,int ky); /* Logic */

[22] int Dev0_bc(); /*Black Case */

[23] /*###################################### SUB_PROGRAMMS */

[24] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIII*/

[25] int Dev0_pct(int kx,int ky) /* Picture */

[26] {

[27] int dx=kx*COL_DRAFT_DEV;

[28] int dy=ky*ROW_DRAFT_DEV;

[29] int x=dx/2,y=dy/2;

[30] clearviewport();

[31] /*---- Text */

[32] setcolor(RED);

[33] setbkcolor(BLACK);

[34] settextstyle(SMALL_FONT,HORIZ_DIR,5);

[35] settextjustify(CENTER_TEXT,CENTER_TEXT);

[36] outtextxy(x,y," Device_0 is not connected ");

[37] return 0;

[38] }

[39] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIII*/

[40] int Dev0_log(int kx,int ky) /* Logic */

[41] {

[42] int dx=kx*COL_DRAFT_DEV;

[43] int dy=ky*ROW_DRAFT_DEV;

[44] int x=dx/2,y=dy-5;

[45] /*---- Text */

[46] setcolor(RED);

[47] setbkcolor(BLACK);

[48] settextstyle(SMALL_FONT,HORIZ_DIR,5);

[49] settextjustify(CENTER_TEXT,CENTER_TEXT);

[50] outtextxy(x,y," Logic of Device_0 is not displaied ");

[51] return 0;

[52] }

[53] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIII*/

[54] int Dev0_bc() /*Black Case */

[55] {

[56] /*---- Variables */

[57] extern int Flag_ini;

[58] /*----*/

[59] if(Flag_ini==NOT_INI)

[60] {/*--------------------Beguin block NOT_INI */

[61] /*---- Openfile BLACK CASE */

[62] if((FpBC_0=fopen("BLACKcs0","w"))==NULL)

[63] {

[64] ALERT_SIGNAL;

[65] perror("Filure openfile BLACKcs0"); STOP;

[66] exit(EXIT_FAILURE);

[67] }

[68] /*---- Date, File entry, File exit */

[69] Get_date_pc_counted();

[70] fprintf(FpBC_0,"%s\n",Str_date_pc_counted);

[71] fprintf(FpBC_0,"File entry: %s\n",Fname_entry);

[72] fprintf(FpBC_0,"File exit: BLACKcs0\n");

[73] /*---- Regime */

[74] if(Regime_work[0]=='0')

[75] fprintf(FpBC_0,

[76] "REGIME: 0.\nEXIT\n");

[77] if(Regime_work[0]=='1')

[78] fprintf(FpBC_0,

[79] "EGIME: 1.\nHand Command\n");

[80] if(Regime_work[0]=='2')

[81] fprintf(FpBC_0,

[82] "REGIME: 2.\nHand Time - Hand Command\n");

[83] if(Regime_work[0]=='3')

[84] fprintf(FpBC_0,

[85] "REGIME: 3.\nCommands file. \n Hand Interval const.\n");

[86] if(Regime_work[0]=='4')

[87] fprintf(FpBC_0,

[88] "REGIME: 4.\nCommands file with Intervals variable.\n");

[89] if(Regime_work[0]=='5')

[90] fprintf(FpBC_0,

[91] "REGIME: 5.\nCommands file with Times.\n");

[92] if(Regime_work[0]=='6')

[93] fprintf(FpBC_0,

[94] "REGIME: 6.\nStep by step.\n");

[95] fprintf(FpBC_0,

[96] "###############################################\n");

[97] }/*--------------------End block NOT_INI */

[98] /*==============================*/

[99] if(Flag_ini==YES_INI)

[100] {/*--------------------Beguin block YES_INI */

[101] /*---- Counter com.,H,M,S, ADDRESS, COMMAND */

[102] fprintf(FpBC_0,

[103] "- COUNTER - Hour - Min - Sec - Address - Commands -\n");

[104] fprintf(FpBC_0,

[105] "Counter_commands---,H,M,S\n");

[106] fprintf(FpBC_0,

[107] "%ld---%1d:%1d:%1d\n",

[108] Counter_commands,H,M,S);

[109] /**/

[110] fprintf(FpBC_0,

[111] "A2,A1,A0---,C2,C1,C0\n");

[112] fprintf(FpBC_0,

[113] "%1d%1d%1d---%1d%1d%1d\n",

[114] A2,A1,A0,C2,C1,C0);

[115] /**/

[116] fprintf(FpBC_0,

[117] "AI2,AI1,AI0---,CI2,CI1,CI0\n");

[118] fprintf(FpBC_0,

[119] "%1d%1d%1d---%1d%1d%1d\n",

[120] AI2,AI1,AI0,CI2,CI1,CI0);

[121] fprintf(FpBC_0,

[122] "###############################################\n");

[123] }/*--------------------End block YES_INI */

[124] /*----*/

[125] return 0;

[126] }

[127] /*########################################################*/

* * *