Syscont (779991), страница 10
Текст из файла (страница 10)
[2310] /*---- Variables */
[2311] char *title="INT.CNT.rev";
[2312] int col_rect=WHITE;
[2313] int bk_txt=CYAN;
[2314] int col_txt=WHITE;
[2315] int bk_val=BLACK;
[2316] int col_val=LIGHTGREEN;
[2317] /*---- Abs. co-ord. window for output memorialize */
[2318] static int lx;
[2319] static int ly;
[2320] static int rx;
[2321] static int ry;
[2322] /*---- Return left_y next window */
[2323] int next_left_y;
[2324] /*---- Display window (one time) */
[2325] if (Flag_ini==NOT_INI)
[2326] {
[2327] next_left_y=Wind_2(title,
[2328] col_rect,bk_txt,col_txt,
[2329] &lx,&ly,&rx,&ry
[2330] /* Abs. co-ord. window for output */);
[2331] return next_left_y;
[2332] }
[2333] /*---- Output to window */
[2334] String_int_counted();
[2335] Wind_out(lx,ly,rx,ry,bk_val,col_val,Str_int_counted);
[2336] /*----*/
[2337] return 0;
[2338] }
[2339] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2340] int Time_ord()
[2341] {
[2342] /*---- Variables */
[2343] char *title="TIME.ORD";
[2344] int col_rect=WHITE;
[2345] int bk_txt=BLUE;
[2346] int col_txt=WHITE;
[2347] int bk_val=BLACK;
[2348] int col_val=YELLOW;
[2349] /*---- Abs. co-ord. window for output memorialize */
[2350] static int lx;
[2351] static int ly;
[2352] static int rx;
[2353] static int ry;
[2354] /*---- Return left_y next window */
[2355] int next_left_y;
[2356] /*---- Display window (one time) */
[2357] if (Flag_ini==NOT_INI)
[2358] {
[2359] next_left_y=Wind_2(title,
[2360] col_rect,bk_txt,col_txt,
[2361] &lx,&ly,&rx,&ry
[2362] /* Abs. co-ord. window for output */);
[2363] return next_left_y;
[2364] }
[2365] /*---- Output to window */
[2366] String_time_pc_ordered();
[2367] Wind_out(lx,ly,rx,ry,bk_val,col_val,Str_time_pc_ordered);
[2368] /*----*/
[2369] return 0;
[2370] }
[2371] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2372] int Time_pc()
[2373] {
[2374] /*---- Variables */
[2375] char *title="TIME.CNT";
[2376] int col_rect=WHITE;
[2377] int bk_txt=BLUE;
[2378] int col_txt=WHITE;
[2379] int bk_val=BLACK;
[2380] int col_val=LIGHTGREEN;
[2381] /*---- Abs. co-ord. window for output memorialize */
[2382] static int lx;
[2383] static int ly;
[2384] static int rx;
[2385] static int ry;
[2386] /*---- Return left_y next window */
[2387] int next_left_y;
[2388] /*---- Display window (one time) */
[2389] if (Flag_ini==NOT_INI)
[2390] {
[2391] next_left_y=Wind_2(title,
[2392] col_rect,bk_txt,col_txt,
[2393] &lx,&ly,&rx,&ry
[2394] /* Abs. co-ord. window for output */);
[2395] return next_left_y;
[2396] }
[2397] /*---- Output to window */
[2398] String_time_pc_counted();
[2399] Wind_out(lx,ly,rx,ry,bk_val,col_val,Str_time_pc_counted);
[2400] /*----*/
[2401] return 0;
[2402] }
[2403] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2404] int Error_sys()
[2405] {
[2406] /*---- Variables */
[2407] char *title="ERR";
[2408] int col_rect=WHITE;
[2409] int bk_txt=RED;
[2410] int col_txt=WHITE;
[2411] int bk_val=BLACK;
[2412] int col_val=LIGHTRED;
[2413] /*---- Abs. co-ord. window for output memorialize */
[2414] static int lx;
[2415] static int ly;
[2416] static int rx;
[2417] static int ry;
[2418] /*---- Return left_y next window */
[2419] int next_left_y;
[2420] /*---- Display window (one time) */
[2421] if (Flag_ini==NOT_INI)
[2422] {
[2423] next_left_y=Wind_1(title,
[2424] col_rect,bk_txt,col_txt,
[2425] &lx,&ly,&rx,&ry
[2426] /* Abs. co-ord. window for output */);
[2427] return next_left_y;
[2428] }
[2429] /*---- Output to window */
[2430] Wind_out(lx,ly,rx,ry,bk_val,col_val,Str_error_sys);
[2431] /*----*/
[2432] return 0;
[2433] }
[2434] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2435] int Reserve()
[2436] {
[2437] /*---- Variables */
[2438] int left_x,right_x;
[2439] int left_y,right_y;
[2440] int dx,dy;
[2441] int th;
[2442] char *title0=" Not room for next window ";
[2443] char *title1="RESERVE";
[2444] int col_rect=WHITE;
[2445] int bk_txt=LIGHTGRAY;
[2446] int col_txt=WHITE;
[2447] /*---- Not room for next window */
[2448] if(Left_y_2>=Maxy)
[2449] {
[2450] Wind_out
[2451] (0,0,Maxx,Maxy,RED,WHITE,title0);
[2452] STOP;
[2453] exit(EXIT_SUCCESS);
[2454] }
[2455] /*---- Co-ordinates of the window */
[2456] left_x=Left_x_2;
[2457] right_x=Right_x_2;
[2458] left_y=Left_y_2;
[2459] right_y=Maxy;
[2460] dx=right_x-left_x;
[2461] dy=right_y-left_y;
[2462] /*---- Window for output */
[2463] setviewport
[2464] (left_x,left_y,right_x,right_y,CLIP_ON);
[2465] clearviewport();
[2466] setbkcolor(BLACK);
[2467] setcolor(col_rect);
[2468] setlinestyle(SOLID_LINE,0,NORM_WIDTH);
[2469] rectangle(0,0,dx,dy);
[2470] /*---- Output to window */
[2471] setfillstyle(SOLID_FILL,bk_txt);
[2472] bar(1,1,dx-1,dy-1);
[2473] setcolor(col_txt);
[2474] settextjustify(CENTER_TEXT,CENTER_TEXT);
[2475] settextstyle(SMALL_FONT,HORIZ_DIR,FONT_DIM_WIND);
[2476] th=textheight("W");
[2477] if(dy>=th) outtextxy(dx/2,dy/2,title1);
[2478] /*----*/
[2479] return 0;
[2480] }
[2481] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2482] int Wind_left_ini()
[2483] {
[2484] /*----*/
[2485] Left_y_1=Title_sys();
[2486] Left_y_1=Address_bus();
[2487] Left_y_1=Mes_exec();
[2488] Left_y_1=Device_bus();
[2489] /*----*/
[2490] return 0;
[2491] }
[2492] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2493] int Title_sys()
[2494] {
[2495] /*---- Variables */
[2496] int col_rect=WHITE;
[2497] int bk_txt=BLUE;
[2498] int col_txt=YELLOW;
[2499] int col_shadow=CYAN;
[2500] /*---- Abs. co-ord. window for output memorialize */
[2501] static int lx;
[2502] static int ly;
[2503] static int rx;
[2504] static int ry;
[2505] /*----*/
[2506] static int dx,dy;
[2507] /*---- Return left_y next window */
[2508] int next_left_y;
[2509] /*---- Display window (one time) */
[2510] next_left_y=Wind_0(col_rect,
[2511] &lx,&ly,&rx,&ry
[2512] /* Abs. co-ord. window for output */);
[2513] dx=rx-lx;
[2514] dy=ry-ly;
[2515] /*---- Window for output */
[2516] setviewport(lx,ly,rx,ry,CLIP_ON);
[2517] clearviewport();
[2518] setfillstyle(SOLID_FILL,bk_txt);
[2519] bar(lx,ly,rx,ry);
[2520] settextjustify(CENTER_TEXT,CENTER_TEXT);
[2521] settextstyle(SMALL_FONT,HORIZ_DIR,FONT_DIM_WIND);
[2522] /*---- Output to window */
[2523] setcolor(col_shadow);
[2524] outtextxy(dx/2,dy/2,Title_2);
[2525] setcolor(col_txt);
[2526] outtextxy(dx/2-1,dy/2-1,Title_2);
[2527] /*----*/
[2528] return next_left_y;
[2529] }
[2530] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2531] int Address_bus()
[2532] {
[2533] /*---- Variables */
[2534] int col_rect=WHITE;
[2535] float compression_y=COMPRESSION_ADD_Y;
[2536] int col=COL_DRAFT_ADD;
[2537] int row=ROW_DRAFT_ADD;
[2538] /*---- Abs. co-ord. window for output memorialize */
[2539] static int lx;
[2540] static int ly;
[2541] static int rx;
[2542] static int ry;
[2543] /*---- Scale= pixels/squares */
[2544] static int kx,ky;
[2545] /*---- Return left_y next window */
[2546] int next_left_y;
[2547] /*---- Display window (one time) */
[2548] if (Flag_ini==NOT_INI)
[2549] {
[2550] next_left_y=Wind_D
[2551] (compression_y,
[2552] col, row,
[2553] col_rect,
[2554] &kx,&ky,
[2555] &lx,&ly,&rx,&ry /* Abs. co-ord. window for output */);
[2556] setviewport(lx,ly,rx,ry,CLIP_ON);
[2557] Addbus3bit(kx,ky);
[2558] return next_left_y;
[2559] }
[2560] /*---- Window for output */
[2561] setviewport(lx,ly,rx,ry,CLIP_ON);
[2562] /*---- Output to window: Draft of the address bus 3 bit */
[2563] if(Flag_ini==YES_INI) Logic_addbus3bit(kx,ky);
[2564] /*----*/
[2565] return 0;
[2566] }
[2567] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2568] int Mes_exec()
[2569] {
[2570] /*---- Variables */
[2571] int col_rect=WHITE;
[2572] int bk_txt=BLUE;
[2573] int col_txt=YELLOW;
[2574] /*---- Abs. co-ord. window for output memorialize */
[2575] static int lx;
[2576] static int ly;
[2577] static int rx;
[2578] static int ry;
[2579] /*----*/
[2580] static int dx,dy;
[2581] /*---- Return left_y next window */
[2582] int next_left_y;
[2583] /*---- Display window (one time) */
[2584] if (Flag_ini==NOT_INI)
[2585] {
[2586] next_left_y=Wind_0(col_rect,
[2587] &lx,&ly,&rx,&ry
[2588] /* Abs. co-ord. window for output */);
[2589] dx=rx-lx;
[2590] dy=ry-ly;
[2591] return next_left_y;
[2592] }
[2593] /*---- Window for output */
[2594] setviewport(lx,ly,rx,ry,CLIP_ON);
[2595] clearviewport();
[2596] setfillstyle(SOLID_FILL,bk_txt);
[2597] bar(lx,ly,rx,ry);
[2598] settextjustify(CENTER_TEXT,CENTER_TEXT);
[2599] settextstyle(SMALL_FONT,HORIZ_DIR,FONT_DIM_WIND);
[2600] /*---- Output to window */
[2601] setcolor(col_txt);
[2602] outtextxy(dx/2,dy/2,Messages_exec);
[2603] /*----*/
[2604] return 0;
[2605] }
[2606] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2607] int Device_bus()
[2608] {
[2609] /*---- Variables */
[2610] int col_rect=WHITE;
[2611] float compression_y;
[2612] int col=COL_DRAFT_DEV;
[2613] int row=ROW_DRAFT_DEV;
[2614] /*---- Abs. co-ord. window for output memorialize */
[2615] static int lx;
[2616] static int ly;
[2617] static int rx;
[2618] static int ry;
[2619] static int dx,dy;
[2620] /*----*/
[2621] static int kx,ky;
[2622] static unsigned int add_previous=1000;
[2623] unsigned int add_exe;
[2624] /*---- Return left_y next window */
[2625] int next_left_y;
[2626] /*---- Display window (one time) */
[2627] compression_y=(float)(Maxy- Left_y_1)/Maxy;
[2628] if (Flag_ini==NOT_INI)
[2629] {
[2630] next_left_y=Wind_D
[2631] (compression_y,
[2632] col, row,
[2633] col_rect,
[2634] &kx,&ky,
[2635] &lx,&ly,&rx,&ry /* Abs. co-ord. window for output */);
[2636] dx=rx-lx;
[2637] dy=ry-ly;
[2638] /*---- Start */
[2639] setviewport(lx,ly,rx,ry,CLIP_ON);
[2640] Start_program(dx,dy);
[2641] return next_left_y;
[2642] }
[2643] /*---- Window for output */
[2644] setviewport(lx,ly,rx,ry,CLIP_ON);
[2645] /*-------- Output to window */
[2646] /***************************** Commutator for devices 0-7 */
[2647] if(Flag_ini==YES_INI)
[2648] {
[2649] add_exe=A2*4+A1*2+A0*1;
[2650] /*---- Music_center */
[2651] if(add_exe==0)
[2652] {
[2653] Music_center(dx,dy);
[2654] }
[2655] /*---- Device_1 */
[2656] if(add_exe==1)
[2657] {
[2658] if(add_exe!=add_previous) Device_1(kx,ky);
[2659] Logic_1(kx,ky);
[2660] }
[2661] /*---- Device_2 */
[2662] if(add_exe==2)
[2663] {
[2664] if(add_exe!=add_previous) Device_2(kx,ky);
[2665] Logic_2(kx,ky);
[2666] }
[2667] /*---- Autopilot */
[2668] if(add_exe==3)
[2669] {
[2670] Autopilote(dx,dy);
[2671] }
[2672] /*---- Memory address */
[2673] add_previous=add_exe;
[2674] }
[2675] /*----*/
[2676] return 0;
[2677] }
[2678] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[2679] int Wind_0
[2680] (int col_rect,
[2681] int *lx,int *ly,int *rx,int *ry
[2682] /* Abs. co-ord. window for output */)
[2683] {