Syscont (779991), страница 7
Текст из файла (страница 7)
[1253] outtextxy(36*kx,9*ky,"((~C0* C0)*(~C2+~C1))");
[1254] /*---- NE */
[1255] E("~",2,6,3,3,3,kx,ky);
[1256] E("~",1,6,7,3,3,kx,ky);
[1257] E("~",0,6,11,3,3,kx,ky);
[1258] /*---- COMMUTATOR */
[1259] B("C",2,13,14,3,11,kx,ky);
[1260] /*---- ELEMENTS Range 1 */
[1261] E("|",1,17,14,3,3,kx,ky);
[1262] E("&",1,17,18,3,3,kx,ky);
[1263] E("|",2,17,22,3,3,kx,ky);
[1264] /*---- ELEMENTS Range 2 */
[1265] E("&",2,24,14,3,3,kx,ky);
[1266] E("|",3,28,14,3,3,kx,ky);
[1267] E("&",3,32,14,3,3,kx,ky);
[1268] /*---- ELEMENTS Range 3 */
[1269] E("|",4,24,20,7,3,kx,ky);
[1270] E("~",1,32,20,3,3,kx,ky);
[1271] /*---- Entry, Exit */
[1272] settextstyle(SMALL_FONT,HORIZ_DIR,FONT_DIM_DRAFT);
[1273] settextjustify(CENTER_TEXT,CENTER_TEXT);
[1274] setcolor(LIGHTGREEN);
[1275] outtextxy( 3*kx,28*ky,"2");
[1276] outtextxy( 4*kx,28*ky,"1");
[1277] outtextxy( 5*kx,28*ky,"0");
[1278] outtextxy( 4*kx,30*ky,"ENTRY");
[1279] setcolor(YELLOW);
[1280] outtextxy(31*kx,30*ky,"EXIT");
[1281] outtextxy(28*kx,28*ky,"Z1");
[1282] outtextxy(34*kx,28*ky,"Z0");
[1283] /*---- Entry Invert. */
[1284] setcolor(WHITE);
[1285] outtextxy(10*kx,28*ky,"0");
[1286] outtextxy(11*kx,28*ky,"1");
[1287] outtextxy(12*kx,28*ky,"2");
[1288] outtextxy(11*kx,30*ky,"INVER");
[1289] /*----*/
[1290] return 0;
[1291] }
[1292] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[1293] int Logic_2(int kx,int ky)
[1294] {
[1295] /*---- Entry */
[1296] Bit(3*kx,26*ky,C2); /* bit C2 */
[1297] Bit(4*kx,26*ky,C1); /* bit C1 */
[1298] Bit(5*kx,26*ky,C0); /* bit C0 */
[1299] /*---- Devices Inventor 1-3 */
[1300] CI0=~C0&1;
[1301] CI1=~C1&1;
[1302] CI2=~C2&1;
[1303] Bit(10*kx,26*ky,CI0); /* bit CI0 */
[1304] Bit(11*kx,26*ky,CI1); /* bit CI1 */
[1305] Bit(12*kx,26*ky,CI2); /* bit CI2 */
[1306] /*---- Devices Range 1 */
[1307] Or1 =CI2 | CI1; /* 0 */
[1308] And1=CI0 & C0; /* 1 */
[1309] Or2 =C1 | C2; /* 2 */
[1310] Bit(23*kx,26*ky,Or1); /* Or 1 */
[1311] Bit(22*kx,26*ky,And1); /* And 1 */
[1312] Bit(21*kx,26*ky,Or2); /* Or 2 */
[1313] /*---- Devices Range 2 */
[1314] And2=And1 & Or1; /* 2 */
[1315] Or3 =Or2 | And1; /* 1 */
[1316] And3=Or1 & Or2; /* 0 */
[1317] Bit(25*kx,18*ky,And2); /* And 2 */
[1318] Bit(29*kx,18*ky,Or3); /* Or 3 */
[1319] Bit(33*kx,18*ky,And3); /* And 3 */
[1320] /*---- Devices Range 3 */
[1321] Inv1=~And3&1; /* 0 */
[1322] Or4 =Or3 | And2; /* 1 */
[1323] Bit(28*kx,26*ky,Or4); /* Or 4 */
[1324] Bit(34*kx,26*ky,Inv1); /* Inv 1 */
[1325] /*----*/
[1326] return 0;
[1327] }
[1328] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[1329] int Music_center(int dx,int dy)
[1330] {
[1331] int x,y;
[1332] int c_exe;
[1333] /********************************************** Vitrage */
[1334] /*---- Viewport*/
[1335] clearviewport();
[1336] /*---- Ellipse */
[1337] setcolor(LIGHTRED);
[1338] EllipseN
[1339] (dx/2,dy/2,0,360,(dx/2-20)-1,(dy/2-20)-1,2);
[1340] setcolor(WHITE);
[1341] EllipseN
[1342] (dx/2,dy/2,0,360,(dx/2-20)-3,(dy/2-20)-3,4);
[1343] setcolor(LIGHTBLUE);
[1344] EllipseN
[1345] (dx/2,dy/2,0,360,(dx/2-20)-7,(dy/2-20)-7,6);
[1346] x=dx/2;
[1347] y=dy/2-20;
[1348] setfillstyle(SOLID_FILL,BLACK);
[1349] floodfill(x,y,LIGHTBLUE);
[1350] /*---- Text */
[1351] settextstyle(TRIPLEX_FONT,HORIZ_DIR,0);
[1352] setusercharsize(3,2,5,1);
[1353] settextjustify(CENTER_TEXT,CENTER_TEXT);
[1354] setcolor(LIGHTCYAN);
[1355] outtextxy(x,y," M U S I C ");
[1356] setcolor(LIGHTGRAY);
[1357] outtextxy(x-1,y-1," M U S I C ");
[1358] setcolor(LIGHTMAGENTA);
[1359] outtextxy(x-2,y-2," M U S I C ");
[1360] setcolor(LIGHTBLUE);
[1361] outtextxy(x-3,y-3," M U S I C ");
[1362] /*---- Asterix */
[1363] x=30;
[1364] y=40;
[1365] setcolor(LIGHTCYAN);
[1366] outtextxy(x,y," * ");
[1367] setcolor(LIGHTGRAY);
[1368] outtextxy(x-1,y-1," * ");
[1369] setcolor(LIGHTBLUE);
[1370] outtextxy(x-2,y-2," * ");
[1371] x=dx-30;
[1372] y=40;
[1373] setcolor(LIGHTCYAN);
[1374] outtextxy(x,y," * ");
[1375] setcolor(LIGHTGRAY);
[1376] outtextxy(x-1,y-1," * ");
[1377] setcolor(LIGHTBLUE);
[1378] outtextxy(x-2,y-2," * ");
[1379] x=30;
[1380] y=dy-40;
[1381] setcolor(LIGHTCYAN);
[1382] outtextxy(x,y," * ");
[1383] setcolor(LIGHTGRAY);
[1384] outtextxy(x-1,y-1," * ");
[1385] setcolor(LIGHTBLUE);
[1386] outtextxy(x-2,y-2," * ");
[1387] x=dx-30;
[1388] y=dy-40;
[1389] setcolor(LIGHTCYAN);
[1390] outtextxy(x,y," * ");
[1391] setcolor(LIGHTGRAY);
[1392] outtextxy(x-1,y-1," * ");
[1393] setcolor(LIGHTBLUE);
[1394] outtextxy(x-2,y-2," * ");
[1395] /*********************************************** Logic */
[1396] c_exe=(C2*4+C1*2+C0*1);
[1397] /*----*/
[1398] settextstyle(Font[7],HORIZ_DIR,4);
[1399] settextjustify(CENTER_TEXT,CENTER_TEXT);
[1400] setcolor(YELLOW);
[1401] x=dx/2;
[1402] y=dy/2+10;
[1403] if(c_exe==0)
[1404] {
[1405] setcolor(LIGHTBLUE);
[1406] outtextxy(x,y," Beethoven ~Sonata 17~ ");
[1407] setcolor(YELLOW);
[1408] outtextxy(x-1,y-1," Beethoven ~Sonata 17~ ");
[1409] /*
[1410] sonata17(MODERATO);
[1411] */
[1412] }
[1413] /*----*/
[1414] if(c_exe==1)
[1415] {
[1416] setcolor(
[1417] CYAN);
[1418] outtextxy(x,y," Beethoven ~Elise~ ");
[1419] setcolor(YELLOW);
[1420] outtextxy(x-1,y-1," Beethoven ~Elise~ ");
[1421] /*
[1422] elise(MODERATO);
[1423] */
[1424] }
[1425] return 0;
[1426] }
[1427] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[1428] int Autopilote(int dx,int dy)
[1429] {
[1430] int x0=dx/2;
[1431] int y0=dy/2;
[1432] int a=7;
[1433] int r=dy/2-30;
[1434] int c_exe;
[1435] /*---- Viewport */
[1436] clearviewport();
[1437] /****************************** Compas */
[1438] /*---- NW-S0, NO-SW */
[1439] setcolor(LIGHTCYAN);
[1440] line(x0+(-r/1.41),y0+(r/1.41),x0+(r/1.41),y0+(-r/1.41));
[1441] line(x0+(-r/1.41),y0+(-r/1.41),x0+(r/1.41),y0+(r/1.41));
[1442] /*---- N, E, S, O */
[1443] setcolor(WHITE);
[1444] /*---- Nord */
[1445] line((x0-a),(y0-a),(x0),(y0-r));
[1446] line((x0+a),(y0-a),(x0),(y0-r));
[1447] /*---- Est */
[1448] line((x0+a),(y0-a),(x0+r),(y0));
[1449] line((x0+a),(y0+a),(x0+r),(y0));
[1450] /*---- Sud */
[1451] line((x0+a),(y0+a),(x0),(y0+r));
[1452] line((x0-a),(y0+a),(x0),(y0+r));
[1453] /*---- West */
[1454] line((x0-a),(y0+a),(x0-r),(y0));
[1455] line((x0-a),(y0-a),(x0-r),(y0));
[1456] /*---- Circle */
[1457] setcolor(LIGHTBLUE);
[1458] circle(x0,y0,r);
[1459] /*---- Center circle */
[1460] setcolor(WHITE);
[1461] ellipse
[1462] (dx/2,dy/2,0,360,6,6);
[1463] setfillstyle(SOLID_FILL,YELLOW);
[1464] floodfill(x0,y0,WHITE);
[1465] /*----*/
[1466] setfillstyle(SOLID_FILL,BLUE);
[1467] floodfill(x0-10,y0,WHITE);
[1468] /*---- N, O, S, W */
[1469] settextstyle(SMALL_FONT,HORIZ_DIR,FONT_DIM_DRAFT+2);
[1470] /* setusercharsize(3,2,3,1); */
[1471] setcolor(WHITE);
[1472] settextjustify(CENTER_TEXT,BOTTOM_TEXT);
[1473] outtextxy(x0,y0-r-3," N ");
[1474] settextjustify(LEFT_TEXT,CENTER_TEXT);
[1475] outtextxy(x0+r-3,y0-3," O ");
[1476] settextjustify(CENTER_TEXT,TOP_TEXT);
[1477] outtextxy(x0,y0+r," S ");
[1478] settextjustify(RIGHT_TEXT,CENTER_TEXT);
[1479] outtextxy(x0-r+3,y0," W ");
[1480] /*---- N0, NW, SO, SW */
[1481] settextstyle(SMALL_FONT,HORIZ_DIR,FONT_DIM_DRAFT);
[1482] /* setusercharsize(3,2,3,1); */
[1483] setcolor(CYAN);
[1484] settextjustify(RIGHT_TEXT,CENTER_TEXT);
[1485] outtextxy(x0+(-r/1.41),y0+(-r/1.41)," NW ");
[1486] settextjustify(LEFT_TEXT,CENTER_TEXT);
[1487] outtextxy(x0+(r/1.41),y0+(-r/1.41)," NO ");
[1488] settextjustify(RIGHT_TEXT,TOP_TEXT);
[1489] outtextxy(x0+(-r/1.41),y0+(r/1.41)," SW ");
[1490] settextjustify(LEFT_TEXT,CENTER_TEXT);
[1491] outtextxy(x0+(r/1.41),y0+(r/1.41)," SO ");
[1492] /****************************** Logic */
[1493] c_exe=(C2*4+C1*2+C0*1);
[1494] setcolor(YELLOW
[1495] );
[1496] setlinestyle(SOLID_LINE,0,THICK_WIDTH);
[1497] r=r-10;
[1498] /*---- Cours 0 */
[1499] if(c_exe==0)
[1500] {
[1501] moveto(x0,y0);
[1502] linerel(0,-r);
[1503] }
[1504] /*---- Cours 45 */
[1505] if(c_exe==1)
[1506] {
[1507] moveto(x0,y0);
[1508] linerel(r/1.41,-r/1.41);
[1509] }
[1510] /*---- Cours 90 */
[1511] if(c_exe==2)
[1512] {
[1513] moveto(x0,y0);
[1514] linerel(r,0);
[1515] }
[1516] /*---- Cours 135 */
[1517] if(c_exe==3)
[1518] {
[1519] moveto(x0,y0);
[1520] linerel(r/1.41,r/1.41);
[1521] }
[1522] /*---- Cours 180 */
[1523] if(c_exe==4)
[1524] {
[1525] moveto(x0,y0);
[1526] linerel(0,r);
[1527] }
[1528] /*---- Cours 225 */
[1529] if(c_exe==5)
[1530] {
[1531] moveto(x0,y0);
[1532] linerel(-r/1.41,r/1.41);
[1533] }
[1534] /*---- Cours 270 */
[1535] if(c_exe==6)
[1536] {
[1537] moveto(x0,y0);
[1538] linerel(-r,0);
[1539] }
[1540] /*---- Cours 315 */
[1541] if(c_exe==7)
[1542] {
[1543] moveto(x0,y0);
[1544] linerel(-r/1.41,-r/1.41);
[1545] }
[1546] /*----*/
[1547] return 0;
[1548] }
[1549] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[1550] Choice_regime_work()
[1551] {
[1552] Text_regime();
[1553] /*---- Variants */
[1554] printf
[1555] ("\n Regimes of the work:\n");
[1556] printf
[1557] ("\n---------------\n");
[1558] printf
[1559] ("\n 0 - Exit \n");
[1560] printf
[1561] ("\n 1 - Hand Command. \n");
[1562] printf
[1563] ("\n 2 - Hand Time - Hand Command.\n");
[1564] printf
[1565] ("\n 3 - Aut. Commands'file. Hand Interval const.\n");
[1566] printf
[1567] ("\n 4 - Aut. Commands'file and Intervals var.\n");
[1568] printf
[1569] ("\n 5 - Aut. Commands'file with Times.\n");
[1570] printf
[1571] ("\n 6 - Aut. Step by step.\n");
[1572] printf
[1573] ("\n---------------\n");
[1574] /*---- Choice of the variant */
[1575] do
[1576] {
[1577] BELL;
[1578] cputs("\n\r Regime of the Work (1 - 6), Exit (0) --> ");
[1579] scanf("%s",&Regime_work);
[1580] } while(Regime_work[0]!='0' &&
[1581] Regime_work[0]!='1' &&
[1582] Regime_work[0]!='2' &&
[1583] Regime_work[0]!='3' &&
[1584] Regime_work[0]!='4' &&
[1585] Regime_work[0]!='5' &&
[1586] Regime_work[0]!='6' ||
[1587] Regime_work[1]!='\0'
[1588] );
[1589] return 0;
[1590] }
[1591] /*IIIIIIIIIIIIIIIIIIIIIIIIIIIIII*/
[1592] int Openfile_entry()
[1593] {
[1594] BELL;
[1595] cputs(" File_name_entry --> ");
[1596] scanf("%s",&Fname_entry);