1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300
|
# This is a component of AXIS, a front-end for LinuxCNC
# Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
# Jeff Epler <jepler@unpythonic.net> and Chris Radek <chris@timeguy.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Supply bindings missing from tcl8.6
if {[bind Scale <Left>] == ""} {
bind Scale <Left> { tk::ScaleIncrement %W up little noRepeat }
}
if {[bind Scale <Right>] == ""} {
bind Scale <Right> { tk::ScaleIncrement %W down little noRepeat }
}
lappend auto_path $::linuxcnc::TCL_LIB_DIR
. configure \
-menu .menu
menu .menu \
-cursor {}
menu .menu.file \
-tearoff 0
menu .menu.file.recent \
-tearoff 0
menu .menu.machine \
-tearoff 1
menu .menu.machine.home \
-tearoff 1
menu .menu.machine.unhome \
-tearoff 1
menu .menu.view \
-tearoff 0
menu .menu.help \
-tearoff 0
menu .menu.machine.touchoff \
-tearoff 0
menu .menu.machine.clearoffset \
-tearoff 0
.menu.file add command \
-accelerator O \
-command open_file
setup_menu_accel .menu.file end [_ "_Open..."]
.menu.file add cascade \
-menu .menu.file.recent
setup_menu_accel .menu.file end [_ "Recent _Files"]
.menu.file add command \
-command edit_program
setup_menu_accel .menu.file end [_ "_Edit..."]
.menu.file add command \
-accelerator [_ "Ctrl-R"] \
-command reload_file
setup_menu_accel .menu.file end [_ "_Reload"]
.menu.file add command \
-accelerator [_ "Ctrl-S"] \
-command save_gcode
setup_menu_accel .menu.file end [_ "_Save G-code as..."]
.menu.file add command \
-command gcode_properties
setup_menu_accel .menu.file end [_ "_Properties..."]
.menu.file add separator
.menu.file add command \
-command edit_tooltable
setup_menu_accel .menu.file end [_ "Edit _tool data..."]
.menu.file add command \
-command reload_tool_table
setup_menu_accel .menu.file end [_ "Reload tool _data"]
.menu.file add separator
.menu.file add command \
-command {exec classicladder &}
setup_menu_accel .menu.file end [_ "_Ladder Editor..."]
.menu.file add separator
.menu.file add command \
-command {destroy .}
setup_menu_accel .menu.file end [_ "_Quit"]
# ----------------------------------------------------------------------
.menu.machine add command \
-accelerator F1 \
-command estop_clicked
setup_menu_accel .menu.machine end [_ "Toggle _Emergency Stop"]
.menu.machine add command \
-accelerator F2 \
-command onoff_clicked
setup_menu_accel .menu.machine end [_ "Toggle _Machine Power"]
.menu.machine add separator
.menu.machine add command \
-accelerator R \
-command task_run
setup_menu_accel .menu.machine end [_ "_Run program"]
.menu.machine add command \
-command task_run_line
setup_menu_accel .menu.machine end [_ "Ru_n from selected line"]
.menu.machine add command \
-accelerator T \
-command task_step
setup_menu_accel .menu.machine end [_ "S_tep"]
.menu.machine add command \
-accelerator P \
-command task_pause
setup_menu_accel .menu.machine end [_ "_Pause"]
.menu.machine add command \
-accelerator S \
-command task_resume
setup_menu_accel .menu.machine end [_ "Re_sume"]
.menu.machine add command \
-accelerator ESC \
-command task_stop
setup_menu_accel .menu.machine end [_ "Stop"]
.menu.machine add checkbutton \
-command toggle_optional_stop \
-variable optional_stop
setup_menu_accel .menu.machine end [_ "Stop at M_1"]
.menu.machine add checkbutton \
-command toggle_block_delete \
-variable block_delete
setup_menu_accel .menu.machine end [_ "Skip lines with '_/'"]
.menu.machine add separator
.menu.machine add command \
-accelerator [_ "Ctrl-M"] \
-command clear_mdi_history
setup_menu_accel .menu.machine end [_ "Clear MDI h_istory"]
.menu.machine add command \
-accelerator [_ "Ctrl-H"] \
-command mdi_history_hist2clip
setup_menu_accel .menu.machine end [_ "Copy from MDI hist_ory"]
.menu.machine add command \
-accelerator [_ "Ctrl-Shift-H"] \
-command mdi_history_clip2hist
setup_menu_accel .menu.machine end [_ "Paste to MDI histor_y"]
.menu.machine add separator
.menu.machine add command \
-command {exec $env(LINUXCNC_TCL_DIR)/bin/emccalib.tcl -- -ini $emcini &}
setup_menu_accel .menu.machine end [_ "_Calibration"]
.menu.machine add command \
-command {exec $env(LINUXCNC_TCL_DIR)/bin/halshow.tcl &}
setup_menu_accel .menu.machine end [_ "Show _Hal Configuration"]
.menu.machine add command \
-command {exec halmeter &}
setup_menu_accel .menu.machine end [_ "H_al Meter"]
.menu.machine add command \
-command {exec halscope -- -ini $emcini &}
setup_menu_accel .menu.machine end [_ "Ha_l Scope"]
.menu.machine add command \
-command {exec linuxcnctop -ini $emcini &}
setup_menu_accel .menu.machine end [_ "Sho_w LinuxCNC Status"]
.menu.machine add command \
-command {exec debuglevel -ini $emcini &}
setup_menu_accel .menu.machine end [_ "Set _Debug Level"]
.menu.machine add separator
.menu.machine add cascade \
-menu .menu.machine.home
setup_menu_accel .menu.machine end [_ "Homin_g"]
.menu.machine add cascade \
-menu .menu.machine.unhome
setup_menu_accel .menu.machine end [_ "_Unhoming"]
.menu.machine add cascade \
-menu .menu.machine.clearoffset
setup_menu_accel .menu.machine end [_ "_Zero coordinate system"]
.menu.machine.clearoffset add command \
-command [list clear_offset 1]
setup_menu_accel .menu.machine.clearoffset end [_ "P1 G5_4"]
.menu.machine.clearoffset add command \
-command [list clear_offset 2]
setup_menu_accel .menu.machine.clearoffset end [_ "P2 G5_5"]
.menu.machine.clearoffset add command \
-command [list clear_offset 3]
setup_menu_accel .menu.machine.clearoffset end [_ "P3 G5_6"]
.menu.machine.clearoffset add command \
-command [list clear_offset 4]
setup_menu_accel .menu.machine.clearoffset end [_ "P4 G5_7"]
.menu.machine.clearoffset add command \
-command [list clear_offset 5]
setup_menu_accel .menu.machine.clearoffset end [_ "P5 G5_8"]
.menu.machine.clearoffset add command \
-command [list clear_offset 6]
setup_menu_accel .menu.machine.clearoffset end [_ "P6 G5_9"]
.menu.machine.clearoffset add command \
-command [list clear_offset 7]
setup_menu_accel .menu.machine.clearoffset end [_ "P7 G59._1"]
.menu.machine.clearoffset add command \
-command [list clear_offset 8]
setup_menu_accel .menu.machine.clearoffset end [_ "P8 G59._2"]
.menu.machine.clearoffset add command \
-command [list clear_offset 9]
setup_menu_accel .menu.machine.clearoffset end [_ "P9 G59._3"]
.menu.machine.clearoffset add command \
-command [list clear_offset G92]
setup_menu_accel .menu.machine.clearoffset end [_ "_G92"]
.menu.machine add separator
.menu.machine add radiobutton \
-variable tto_g11 \
-value 0 \
-command toggle_tto_g11
setup_menu_accel .menu.machine end [_ "Tool touch off to wor_kpiece"]
.menu.machine add radiobutton \
-variable tto_g11 \
-value 1 \
-command toggle_tto_g11
setup_menu_accel .menu.machine end [_ "Tool touch off to _fixture"]
# ----------------------------------------------------------------------
.menu.view add radiobutton \
-command set_view_z \
-variable view_type \
-value 1 \
-accelerator V
setup_menu_accel .menu.view end [_ "_Top view"]
.menu.view add radiobutton \
-command set_view_z2 \
-variable view_type \
-value 2 \
-accelerator V
setup_menu_accel .menu.view end [_ "_Rotated Top view"]
.menu.view add radiobutton \
-command set_view_x \
-variable view_type \
-value 3 \
-accelerator V
setup_menu_accel .menu.view end [_ "_Side view"]
.menu.view add radiobutton \
-command set_view_y \
-variable view_type \
-value 4 \
-accelerator V
setup_menu_accel .menu.view end [_ "_Front view"]
.menu.view add radiobutton \
-command set_view_p \
-variable view_type \
-value 5 \
-accelerator V
setup_menu_accel .menu.view end [_ "_Perspective view"]
.menu.view add separator
.menu.view add radiobutton \
-value 0 \
-variable metric \
-command redraw \
-accelerator !
setup_menu_accel .menu.view end [_ "Display _Inches"]
.menu.view add radiobutton \
-value 1 \
-variable metric \
-command redraw \
-accelerator !
setup_menu_accel .menu.view end [_ "Display _MM"]
.menu.view add separator
.menu.view add checkbutton \
-variable show_program \
-command toggle_show_program
setup_menu_accel .menu.view end [_ "S_how program"]
.menu.view add checkbutton \
-variable show_rapids \
-command toggle_show_rapids
setup_menu_accel .menu.view end [_ "Show program r_apids"]
.menu.view add checkbutton \
-variable program_alpha \
-command toggle_program_alpha
setup_menu_accel .menu.view end [_ "Alpha-_blend program"]
.menu.view add checkbutton \
-variable show_live_plot \
-command toggle_show_live_plot
setup_menu_accel .menu.view end [_ "Sho_w live plot"]
.menu.view add checkbutton \
-variable show_tool \
-command toggle_show_tool
setup_menu_accel .menu.view end [_ "Show too_l"]
.menu.view add checkbutton \
-variable show_extents \
-command toggle_show_extents
setup_menu_accel .menu.view end [_ "Show e_xtents"]
.menu.view add cascade \
-menu .menu.view.grid
setup_menu_accel .menu.view end [_ "_Grid"]
.menu.view add checkbutton \
-variable show_offsets \
-command toggle_show_offsets
setup_menu_accel .menu.view end [_ "Show o_ffsets"]
.menu.view add checkbutton \
-variable show_machine_limits \
-command toggle_show_machine_limits
setup_menu_accel .menu.view end [_ "Sh_ow machine limits"]
.menu.view add checkbutton \
-variable show_machine_speed \
-command toggle_show_machine_speed
setup_menu_accel .menu.view end [_ "Show v_elocity"]
.menu.view add checkbutton \
-variable show_distance_to_go \
-command toggle_show_distance_to_go
setup_menu_accel .menu.view end [_ "Show _distance to go"]
.menu.view add checkbutton \
-variable dro_large_font \
-command toggle_dro_large_font
setup_menu_accel .menu.view end [_ "Large coordinate fo_nt"]
.menu.view add command \
-accelerator [_ "Ctrl-K"] \
-command clear_live_plot
setup_menu_accel .menu.view end [_ "_Clear live plot"]
.menu.view add checkbutton \
-variable show_pyvcppanel \
-accelerator [_ "Ctrl-E"] \
-command toggle_show_pyvcppanel
setup_menu_accel .menu.view end [_ "Show PyVCP pan_el"]
.menu.view add separator
.menu.view add radiobutton \
-value 1 \
-variable display_type \
-accelerator @ \
-command redraw
setup_menu_accel .menu.view end [_ "Show commanded position"]
.menu.view add radiobutton \
-value 0 \
-variable display_type \
-accelerator @ \
-command redraw
setup_menu_accel .menu.view end [_ "Show actual position"]
.menu.view add separator
.menu.view add radiobutton \
-value 0 \
-variable coord_type \
-accelerator # \
-command redraw
setup_menu_accel .menu.view end [_ "Show machine position"]
.menu.view add radiobutton \
-value 1 \
-variable coord_type \
-accelerator # \
-command redraw
setup_menu_accel .menu.view end [_ "Show relative position"]
.menu.view add separator
.menu.view add radiobutton \
-value 0 \
-variable teleop_mode \
-accelerator $ \
-command set_teleop_mode
setup_menu_accel .menu.view end [_ "Joint mode"]
.menu.view add radiobutton \
-value 1 \
-variable teleop_mode \
-accelerator $ \
-command set_teleop_mode
setup_menu_accel .menu.view end [_ "World mode"]
menu .menu.view.grid
.menu.view.grid add radiobutton \
-value 0 \
-variable grid_size \
-command set_grid_size
setup_menu_accel .menu.view.grid end [_ "_Off"]
.menu.view.grid add radiobutton \
-value -1 \
-variable grid_size \
-command set_grid_size_custom
setup_menu_accel .menu.view.grid end [_ "_Custom"]
# ----------------------------------------------------------------------
.menu.help add command \
-command {
wm transient .about .;
wm deiconify .about;
show_all .about.message;
focus .about.ok
}
setup_menu_accel .menu.help end [_ "_About AXIS"]
.menu.help add command \
-command {wm transient .keys .;wm deiconify .keys; focus .keys.ok}
setup_menu_accel .menu.help end [_ "Quick _Reference"]
# ----------------------------------------------------------------------
.menu add cascade \
-menu .menu.file
setup_menu_accel .menu end [_ _File]
.menu add cascade \
-menu .menu.machine
setup_menu_accel .menu end [_ _Machine]
.menu add cascade \
-menu .menu.view
setup_menu_accel .menu end [_ _View]
.menu add cascade \
-menu .menu.help
setup_menu_accel .menu end [_ _Help]
frame .toolbar \
-borderwidth 1 \
-relief raised
vrule .toolbar.rule16
Button .toolbar.machine_estop \
-helptext [_ "Toggle Emergency Stop \[F1\]"] \
-image [load_image tool_estop] \
-relief sunken \
-takefocus 0
bind .toolbar.machine_estop <Button-1> { estop_clicked }
setup_widget_accel .toolbar.machine_estop {}
Button .toolbar.machine_power \
-command onoff_clicked \
-helptext [_ "Toggle Machine power \[F2\]"] \
-image [load_image tool_power] \
-relief link \
-state disabled \
-takefocus 0
setup_widget_accel .toolbar.machine_power {}
vrule .toolbar.rule0
Button .toolbar.file_open \
-command { open_file } \
-helptext [_ "Open G-Code file \[O\]"] \
-image [load_image tool_open] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.file_open {}
Button .toolbar.reload \
-command { reload_file } \
-helptext [_ "Reopen current file \[Ctrl-R\]"] \
-image [load_image tool_reload] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.reload {}
vrule .toolbar.rule4
Button .toolbar.program_run \
-command task_run \
-helptext [_ "Begin executing current file \[R\]"] \
-image [load_image tool_run] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.program_run {}
Button .toolbar.program_step \
-command task_step \
-helptext [_ "Execute next line \[T\]"] \
-image [load_image tool_step] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.program_step {}
Button .toolbar.program_pause \
-command task_pauseresume \
-helptext [_ "Pause \[P\] / resume \[S\] execution"] \
-image [load_image tool_pause] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.program_pause {}
proc pause_image_normal {} {
.toolbar.program_pause configure -image [load_image tool_pause]
}
proc pause_image_override {} {
.toolbar.program_pause configure -image [load_image resume_inhibit]
}
Button .toolbar.program_stop \
-command task_stop \
-helptext [_ "Stop program execution \[ESC\]"] \
-image [load_image tool_stop] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.program_stop {}
vrule .toolbar.rule8
Button .toolbar.program_blockdelete \
-command { set block_delete [expr {!$block_delete}]; toggle_block_delete } \
-helptext [_ "Toggle skip lines with '/' \[Alt-M /\]"] \
-image [load_image tool_blockdelete] \
-relief link \
-takefocus 0
Button .toolbar.program_optpause \
-command { set optional_stop [expr {!$optional_stop}]; toggle_optional_stop } \
-helptext [_ "Toggle optional pause \[Alt-M 1\]"] \
-image [load_image tool_optpause] \
-relief link \
-takefocus 0
vrule .toolbar.rule9
Button .toolbar.view_zoomin \
-command zoomin \
-helptext [_ "Zoom in"] \
-image [load_image tool_zoomin] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.view_zoomin {}
Button .toolbar.view_zoomout \
-command zoomout \
-helptext [_ "Zoom out"] \
-image [load_image tool_zoomout] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.view_zoomout {}
Button .toolbar.view_z \
-command set_view_z \
-helptext [_ "Top view"] \
-image [load_image tool_axis_z] \
-relief sunken \
-takefocus 0
setup_widget_accel .toolbar.view_z {}
Button .toolbar.view_z2 \
-command set_view_z2 \
-helptext [_ "Rotated top view"] \
-image [load_image tool_axis_z2] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.view_z2 {}
Button .toolbar.view_x \
-command set_view_x \
-helptext [_ "Side view"] \
-image [load_image tool_axis_x] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.view_x {}
Button .toolbar.view_y \
-command set_view_y \
-helptext [_ "Front view"] \
-image [load_image tool_axis_y] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.view_y {}
Button .toolbar.view_y2 \
-command set_view_y2 \
-helptext [_ "Inverted Front view"] \
-image [load_image tool_axis_y2] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.view_y2 {}
Button .toolbar.view_p \
-command set_view_p \
-helptext [_ "Perspective view"] \
-image [load_image tool_axis_p] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.view_p {}
Button .toolbar.rotate \
-image [load_image tool_rotate] \
-helptext [_ "Toggle between Drag and Rotate Mode \[D\]"] \
-relief link \
-command {
set rotate_mode [expr {!$rotate_mode}]
if {$rotate_mode} {
.toolbar.rotate configure -relief sunken
} else {
.toolbar.rotate configure -relief link
}
}
vrule .toolbar.rule12
Button .toolbar.clear_plot \
-command clear_live_plot \
-helptext [_ "Clear live plot \[Ctrl-K\]"] \
-image [load_image tool_clear] \
-relief link \
-takefocus 0
setup_widget_accel .toolbar.clear_plot {}
# Pack widget .toolbar.machine_estop
pack .toolbar.machine_estop \
-side left
# Pack widget .toolbar.machine_power
pack .toolbar.machine_power \
-side left
# Pack widget .toolbar.rule0
pack .toolbar.rule0 \
-fill y \
-padx 4 \
-pady 4 \
-side left
# Pack widget .toolbar.file_open
pack .toolbar.file_open \
-side left
# Pack widget .toolbar.reload
pack .toolbar.reload \
-side left
# Pack widget .toolbar.rule4
pack .toolbar.rule4 \
-fill y \
-padx 4 \
-pady 4 \
-side left
# Pack widget .toolbar.program_run
pack .toolbar.program_run \
-side left
# Pack widget .toolbar.program_step
pack .toolbar.program_step \
-side left
# Pack widget .toolbar.program_pause
pack .toolbar.program_pause \
-side left
# Pack widget .toolbar.program_stop
pack .toolbar.program_stop \
-side left
# Pack widget .toolbar.rule8
pack .toolbar.rule8 \
-fill y \
-padx 4 \
-pady 4 \
-side left
# Pack widget .toolbar.program_blockdelete
pack .toolbar.program_blockdelete \
-side left
# Pack widget .toolbar.program_optpause
pack .toolbar.program_optpause \
-side left
# Pack widget .toolbar.rule9
pack .toolbar.rule9 \
-fill y \
-padx 4 \
-pady 4 \
-side left
# Pack widget .toolbar.view_zoomin
pack .toolbar.view_zoomin \
-side left
# Pack widget .toolbar.view_zoomout
pack .toolbar.view_zoomout \
-side left
# Pack widget .toolbar.view_z
pack .toolbar.view_z \
-side left
# Pack widget .toolbar.view_z2
pack .toolbar.view_z2 \
-side left
# Pack widget .toolbar.view_x
pack .toolbar.view_x \
-side left
# Pack widget .toolbar.view_y
pack .toolbar.view_y \
-side left
# Pack widget .toolbar.view_y2
pack .toolbar.view_y2 \
-side left
# Pack widget .toolbar.view_p
pack .toolbar.view_p \
-side left
# Pack widget .toolbar.rotate
pack .toolbar.rotate \
-side left
# Pack widget .toolbar.rule12
pack .toolbar.rule12 \
-fill y \
-padx 4 \
-pady 4 \
-side left
# Pack widget .toolbar.clear_plot
pack .toolbar.clear_plot \
-side left
panedwindow .pane \
-borderwidth 0 \
-handlesize 5 \
-orient v \
-sashpad 0 \
-showhandle 1
set pane_top [frame .pane.top]
set pane_bottom [frame .pane.bottom]
.pane add $pane_top -sticky nsew
.pane add $pane_bottom -sticky nsew
catch {
.pane paneconfigure $pane_top -stretch always
.pane paneconfigure $pane_bottom -stretch never
}
NoteBook ${pane_top}.tabs \
-borderwidth 2 \
-arcradius 3
proc show_all_tabs w {
upvar 0 NoteBook::$w data
set a [winfo reqwidth $w]
set b [expr $data(wpage) + 3]
if {$a < $b} { $w configure -width $b }
}
after 1 after idle show_all_tabs ${pane_top}.tabs
proc set_pane_minsize {} {
global pane_bottom pane_top
.pane paneconfigure $pane_top -minsize [winfo reqheight $pane_top]
.pane paneconfigure $pane_bottom -minsize [winfo reqheight $pane_bottom]
}
after 1 after idle set_pane_minsize
set _tabs_manual [${pane_top}.tabs insert end manual -text [_ "Manual Control \[F3\]"] -raisecmd {focus .; ensure_manual}]
set _tabs_mdi [${pane_top}.tabs insert end mdi -text [_ "MDI \[F5\]"]]
$_tabs_manual configure -borderwidth 2
$_tabs_mdi configure -borderwidth 2
${pane_top}.tabs itemconfigure mdi -raisecmd "[list focus ${_tabs_mdi}.command];"
#${pane_top}.tabs raise manual
after idle {
${pane_top}.tabs raise manual
${pane_top}.right raise preview
after idle ${pane_top}.tabs compute_size
after idle ${pane_top}.right compute_size
}
label $_tabs_manual.axis
setup_widget_accel $_tabs_manual.axis [_ Axis:]
frame $_tabs_manual.axes
# Axis select radiobuttons
# These set the variable ja_rbutton to alphabetic value
foreach {letter} {x y z a b c u v w} {
radiobutton $_tabs_manual.axes.axis$letter \
-anchor w \
-padx 0 \
-value $letter \
-variable ja_rbutton \
-width 2 \
-text [string toupper $letter] \
-command axis_activated
}
# grid for Axis select radiobuttons
set ano 0; set aletters {x y z a b c u v w}
for {set row 0} {$row < 3} {incr row} {
for {set col 0} {$col < 3} {incr col} {
grid $_tabs_manual.axes.axis[lindex $aletters $ano] \
-column $col -row $row -padx 4
incr ano
}
}
frame $_tabs_manual.joints
# Joints select radiobuttons
# These set the variable ja_rbutton to numeric values [0,MAX_JOINTS)
for {set num 0} {$num < $::MAX_JOINTS} {incr num} {
radiobutton $_tabs_manual.joints.joint$num \
-anchor w \
-padx 0 \
-value $num \
-variable ja_rbutton \
-width 2 \
-text $num \
-command axis_activated
}
# grid for Joint select radiobuttons
set jno 0
set rows [expr $::MAX_JOINTS / 3]
for {set row 0} {$row < [expr 1 + $rows]} {incr row} {
for {set col 0} {$col < 3} {incr col} {
grid $_tabs_manual.joints.joint$jno \
-column $col -row $row -padx 4
incr jno
if {$jno >= $::MAX_JOINTS} break
}
if {$jno >= $::MAX_JOINTS} break
}
frame $_tabs_manual.jogf
frame $_tabs_manual.jogf.jog
button $_tabs_manual.jogf.jog.jogminus \
-command {if {![is_continuous]} {jog_minus 1}} \
-padx 0 \
-pady 0 \
-width 2 \
-text -
bind $_tabs_manual.jogf.jog.jogminus <Button-1> {
if {[is_continuous]} { jog_minus }
}
bind $_tabs_manual.jogf.jog.jogminus <ButtonRelease-1> {
if {[is_continuous]} { jog_stop }
}
button $_tabs_manual.jogf.jog.jogplus \
-command {if {![is_continuous]} {jog_plus 1}} \
-padx 0 \
-pady 0 \
-width 2 \
-text +
bind $_tabs_manual.jogf.jog.jogplus <Button-1> {
if {[is_continuous]} { jog_plus }
}
bind $_tabs_manual.jogf.jog.jogplus <ButtonRelease-1> {
if {[is_continuous]} { jog_stop }
}
combobox $_tabs_manual.jogf.jog.jogincr \
-editable 0 \
-textvariable jogincrement \
-value [_ Continuous] \
-width 10
$_tabs_manual.jogf.jog.jogincr list insert end [_ Continuous] 0.1000 0.0100 0.0010 0.0001
frame $_tabs_manual.jogf.zerohome
button $_tabs_manual.jogf.zerohome.home \
-command home_joint \
-padx 2m \
-pady 0
setup_widget_accel $_tabs_manual.jogf.zerohome.home [_ "Home Axis"]
button $_tabs_manual.jogf.zerohome.zero \
-command touch_off_system \
-padx 2m \
-pady 0
setup_widget_accel $_tabs_manual.jogf.zerohome.zero [_ "Touch Off"]
button $_tabs_manual.jogf.zerohome.tooltouch \
-command touch_off_tool \
-padx 2m \
-pady 0
setup_widget_accel $_tabs_manual.jogf.zerohome.tooltouch [_ "Tool Touch Off"]
checkbutton $_tabs_manual.jogf.override \
-command toggle_override_limits \
-variable override_limits
setup_widget_accel $_tabs_manual.jogf.override [_ "Override Limits"]
grid $_tabs_manual.jogf.zerohome \
-column 0 \
-row 1 \
-columnspan 3 \
-sticky w
grid $_tabs_manual.jogf.jog \
-column 0 \
-row 0 \
-columnspan 3 \
-sticky w
# Grid widget $_tabs_manual.jogf.zerohome.home
grid $_tabs_manual.jogf.zerohome.home \
-column 0 \
-row 0 \
-ipadx 2 \
-pady 2 \
-sticky w
# Grid widget $_tabs_manual.jogf.zerohome.zero
grid $_tabs_manual.jogf.zerohome.zero \
-column 1 \
-row 0 \
-ipadx 2 \
-pady 2 \
-sticky w
# Grid widget $_tabs_manual.jogf.zerohome.tooltouch
grid $_tabs_manual.jogf.zerohome.tooltouch \
-column 1 \
-row 2 \
-ipadx 2 \
-pady 2 \
-sticky w
# Grid widget $_tabs_manual.jogf.override
grid $_tabs_manual.jogf.override \
-column 0 \
-row 3 \
-columnspan 3 \
-pady 2 \
-sticky w
# Grid widget $_tabs_manual.jogf.jog.jogminus
grid $_tabs_manual.jogf.jog.jogminus \
-column 0 \
-row 0 \
-pady 2 \
-sticky nsw
# Grid widget $_tabs_manual.jogf.jog.jogplus
grid $_tabs_manual.jogf.jog.jogplus \
-column 1 \
-row 0 \
-pady 2 \
-sticky nsw
# Grid widget $_tabs_manual.jogf.jog.jogincr
grid $_tabs_manual.jogf.jog.jogincr \
-column 2 \
-row 0 \
-pady 2 \
-sticky nsw
vspace $_tabs_manual.space1 \
-height 12
label $_tabs_manual.spindlel
setup_widget_accel $_tabs_manual.spindlel [_ Spindle:]
frame $_tabs_manual.spindlef
frame $_tabs_manual.spindlef.row1
frame $_tabs_manual.spindlef.row2
radiobutton $_tabs_manual.spindlef.ccw \
-borderwidth 2 \
-command spindle \
-image [load_image spindle_ccw] \
-indicatoron 0 \
-selectcolor [systembuttonface] \
-value -1 \
-variable spindledir
setup_widget_accel $_tabs_manual.spindlef.ccw {}
radiobutton $_tabs_manual.spindlef.stop \
-borderwidth 2 \
-command spindle \
-indicatoron 0 \
-selectcolor [systembuttonface] \
-value 0 \
-variable spindledir
setup_widget_accel $_tabs_manual.spindlef.stop [_ Stop]
radiobutton $_tabs_manual.spindlef.cw \
-borderwidth 2 \
-command spindle \
-image [load_image spindle_cw] \
-indicatoron 0 \
-selectcolor [systembuttonface] \
-value 1 \
-variable spindledir
setup_widget_accel $_tabs_manual.spindlef.cw {}
button $_tabs_manual.spindlef.spindleminus \
-padx 0 \
-pady 0 \
-width 2
bind $_tabs_manual.spindlef.spindleminus <Button-1> {
if {[%W cget -state] == "disabled"} { continue }
spindle_decrease
}
bind $_tabs_manual.spindlef.spindleminus <ButtonRelease-1> {
if {[%W cget -state] == "disabled"} { continue }
spindle_constant
}
setup_widget_accel $_tabs_manual.spindlef.spindleminus [_ -]
button $_tabs_manual.spindlef.spindleplus \
-padx 0 \
-pady 0 \
-width 2
bind $_tabs_manual.spindlef.spindleplus <Button-1> {
if {[%W cget -state] == "disabled"} { continue }
spindle_increase
}
bind $_tabs_manual.spindlef.spindleplus <ButtonRelease-1> {
if {[%W cget -state] == "disabled"} { continue }
spindle_constant
}
setup_widget_accel $_tabs_manual.spindlef.spindleplus [_ +]
checkbutton $_tabs_manual.spindlef.brake \
-command brake \
-variable brake
setup_widget_accel $_tabs_manual.spindlef.brake [_ Brake]
# Grid widget $_tabs_manual.spindlef.brake
grid $_tabs_manual.spindlef.brake \
-column 0 \
-row 3 \
-pady 2 \
-sticky w
grid $_tabs_manual.spindlef.row1 -row 1 -column 0 -sticky nw
grid $_tabs_manual.spindlef.row2 -row 2 -column 0 -sticky nw
# Grid widget $_tabs_manual.spindlef.ccw
pack $_tabs_manual.spindlef.ccw \
-in $_tabs_manual.spindlef.row1 \
-side left \
-pady 2
# Grid widget $_tabs_manual.spindlef.stop
pack $_tabs_manual.spindlef.stop \
-in $_tabs_manual.spindlef.row1 \
-side left \
-pady 2 \
-ipadx 8
# Grid widget $_tabs_manual.spindlef.cw
pack $_tabs_manual.spindlef.cw \
-in $_tabs_manual.spindlef.row1 \
-side left \
-pady 2
# Grid widget $_tabs_manual.spindlef.spindleminus
pack $_tabs_manual.spindlef.spindleminus \
-in $_tabs_manual.spindlef.row2 \
-side left \
-pady 2
# Grid widget $_tabs_manual.spindlef.spindleplus
pack $_tabs_manual.spindlef.spindleplus \
-in $_tabs_manual.spindlef.row2 \
-side left \
-pady 2
vspace $_tabs_manual.space2 \
-height 12
label $_tabs_manual.coolant
setup_widget_accel $_tabs_manual.coolant [_ Coolant:]
checkbutton $_tabs_manual.mist \
-command mist \
-variable mist
setup_widget_accel $_tabs_manual.mist [_ Mist]
checkbutton $_tabs_manual.flood \
-command flood \
-variable flood
setup_widget_accel $_tabs_manual.flood [_ Flood]
grid rowconfigure $_tabs_manual 99 -weight 1
grid columnconfigure $_tabs_manual 99 -weight 1
# Grid widget $_tabs_manual.axes
grid $_tabs_manual.axes \
-column 1 \
-row 0 \
-padx 0 \
-sticky w
# Grid widget $_tabs_manual.axis
grid $_tabs_manual.axis \
-column 0 \
-row 0 \
-pady 1 \
-sticky nw
# Grid widget $_tabs_manual.coolant
grid $_tabs_manual.coolant \
-column 0 \
-row 5 \
-sticky w
# Grid widget $_tabs_manual.flood
grid $_tabs_manual.flood \
-column 1 \
-row 6 \
-columnspan 2 \
-padx 4 \
-sticky w
# Grid widget $_tabs_manual.jogf
grid $_tabs_manual.jogf \
-column 1 \
-row 1 \
-padx 4 \
-sticky w
# Grid widget $_tabs_manual.mist
grid $_tabs_manual.mist \
-column 1 \
-row 5 \
-columnspan 2 \
-padx 4 \
-sticky w
# Grid widget $_tabs_manual.space1
grid $_tabs_manual.space1 \
-column 0 \
-row 2
# Grid widget $_tabs_manual.space2
grid $_tabs_manual.space2 \
-column 0 \
-row 4
# Grid widget $_tabs_manual.spindlef
grid $_tabs_manual.spindlef \
-column 1 \
-row 3 \
-padx 4 \
-sticky w
# Grid widget $_tabs_manual.spindlel
grid $_tabs_manual.spindlel \
-column 0 \
-row 3 \
-pady 2 \
-sticky nw
label $_tabs_mdi.historyl
setup_widget_accel $_tabs_mdi.historyl [_ History:]
# MDI-history listbox
listbox $_tabs_mdi.history \
-width 40 \
-height 8 \
-exportselection 0 \
-selectmode extended \
-relief flat \
-highlightthickness 0 \
-takefocus 0 \
-yscrollcommand "$_tabs_mdi.history.sby set"
# always have an empty element at the end
$_tabs_mdi.history insert end ""
scrollbar $_tabs_mdi.history.sby -borderwidth 0 -command "$_tabs_mdi.history yview"
pack $_tabs_mdi.history.sby -side right -fill y
grid rowconfigure $_tabs_mdi.history 0 -weight 1
vspace $_tabs_mdi.vs1 \
-height 12
label $_tabs_mdi.commandl
setup_widget_accel $_tabs_mdi.commandl [_ "MDI Command:"]
entry $_tabs_mdi.command \
-textvariable mdi_command
button $_tabs_mdi.go \
-command send_mdi \
-padx 1m \
-pady 0
setup_widget_accel $_tabs_mdi.go [_ Go]
vspace $_tabs_mdi.vs2 \
-height 12
# Grid widget $_tabs_mdi.command
grid $_tabs_mdi.command \
-column 0 \
-row 4 \
-sticky ew
# Grid widget $_tabs_mdi.commandl
grid $_tabs_mdi.commandl \
-column 0 \
-row 3 \
-sticky w
# Grid widget $_tabs_mdi.go
grid $_tabs_mdi.go \
-column 1 \
-row 4
# Grid widget $_tabs_mdi.history
grid $_tabs_mdi.history \
-column 0 \
-row 1 \
-columnspan 2 \
-sticky nesw
# Grid widget $_tabs_mdi.historyl
grid $_tabs_mdi.historyl \
-column 0 \
-row 0 \
-sticky w
# Grid widget $_tabs_mdi.vs1
grid $_tabs_mdi.vs1 \
-column 0 \
-row 2
# Grid widget $_tabs_mdi.vs2
grid $_tabs_mdi.vs2 \
-column 0 \
-row 5
grid columnconfigure $_tabs_mdi 0 -weight 1
grid rowconfigure $_tabs_mdi 1 -weight 1
NoteBook ${pane_top}.right \
-borderwidth 2 \
-arcradius 3
after 1 after idle show_all_tabs ${pane_top}.right
set _tabs_preview [${pane_top}.right insert end preview -text [_ "Preview"]]
set _tabs_numbers [${pane_top}.right insert end numbers -text [_ "DRO"] -raisecmd redraw_dro]
$_tabs_preview configure -borderwidth 1
$_tabs_numbers configure -borderwidth 1
text ${_tabs_numbers}.text -width 1 -height 1 -wrap none \
-background [systembuttonface] \
-borderwidth 0 \
-undo 0 \
-relief flat
pack ${_tabs_numbers}.text -fill both -expand 1
bindtags ${_tabs_numbers}.text [list ${_tabs_numbers}.text . all]
frame .info
label .info.task_state \
-anchor w \
-borderwidth 2 \
-relief sunken \
-textvariable task_state_string \
-width 14
setup_widget_accel .info.task_state {}
label .info.tool \
-anchor w \
-borderwidth 2 \
-relief sunken \
-textvariable ::tool \
-width 30
label .info.position \
-anchor w \
-borderwidth 2 \
-relief sunken \
-textvariable ::position \
-width 25
# Pack widget .info.task_state
pack .info.task_state \
-side left
# Pack widget .info.tool
pack .info.tool \
-side left \
-fill x -expand 1
# Pack widget .info.position
pack .info.position \
-side left
frame ${pane_bottom}.t \
-borderwidth 2 \
-relief sunken \
-highlightthickness 1
text ${pane_bottom}.t.text \
-borderwidth 0 \
-exportselection 0 \
-height 9 \
-highlightthickness 0 \
-relief flat \
-takefocus 0 \
-undo 0 \
-yscrollcommand [list ${pane_bottom}.t.sb set]
${pane_bottom}.t.text insert end {}
bind ${pane_bottom}.t.text <Configure> { goto_sensible_line }
scrollbar ${pane_bottom}.t.sb \
-borderwidth 0 \
-command [list ${pane_bottom}.t.text yview] \
-highlightthickness 0
# Pack widget ${pane_bottom}.t.text
pack ${pane_bottom}.t.text \
-expand 1 \
-fill both \
-side left
# Pack widget ${pane_bottom}.t.sb
pack ${pane_bottom}.t.sb \
-fill y \
-side left
label ${pane_top}.gcodel
setup_widget_accel ${pane_top}.gcodel [_ "Active G-Codes:"]
text ${pane_top}.gcodes \
-height 2 \
-width 40 \
-undo 0 \
-wrap word
${pane_top}.gcodes insert end {}
${pane_top}.gcodes configure -state disabled
frame ${pane_top}.ajogspeed
label ${pane_top}.ajogspeed.l0 -text [_ "Jog Speed:"]
label ${pane_top}.ajogspeed.l1
scale ${pane_top}.ajogspeed.s -bigincrement 0 -from .06 -to 1 -resolution .020 -showvalue 0 -variable ajog_slider_val -command update_ajog_slider_vel -orient h -takefocus 0
label ${pane_top}.ajogspeed.l -textv jog_aspeed -width 6 -anchor e
pack ${pane_top}.ajogspeed.l0 -side left
pack ${pane_top}.ajogspeed.s -side right
pack ${pane_top}.ajogspeed.l1 -side right
pack ${pane_top}.ajogspeed.l -side right
bind . <less> [regsub %W [bind Scale <Left>] ${pane_top}.ajogspeed.s]
bind . <greater> [regsub %W [bind Scale <Right>] ${pane_top}.ajogspeed.s]
frame ${pane_top}.jogspeed
label ${pane_top}.jogspeed.l0 -text [_ "Jog Speed:"]
label ${pane_top}.jogspeed.l1
scale ${pane_top}.jogspeed.s -bigincrement 0 -from .06 -to 1 -resolution .020 -showvalue 0 -variable jog_slider_val -command update_jog_slider_vel -orient h -takefocus 0
label ${pane_top}.jogspeed.l -textv jog_speed -width 6 -anchor e
pack ${pane_top}.jogspeed.l0 -side left
pack ${pane_top}.jogspeed.s -side right
pack ${pane_top}.jogspeed.l1 -side right
pack ${pane_top}.jogspeed.l -side right
bind . , [regsub %W [bind Scale <Left>] ${pane_top}.jogspeed.s]
bind . . [regsub %W [bind Scale <Right>] ${pane_top}.jogspeed.s]
frame ${pane_top}.maxvel
label ${pane_top}.maxvel.l0 -text [_ "Max Velocity:"]
label ${pane_top}.maxvel.l1
scale ${pane_top}.maxvel.s -bigincrement 0 -from .06 -to 1 -resolution .020 -showvalue 0 -variable maxvel_slider_val -command update_maxvel_slider_vel -orient h -takefocus 0
label ${pane_top}.maxvel.l -textv maxvel_speed -width 6 -anchor e
pack ${pane_top}.maxvel.l0 -side left
pack ${pane_top}.maxvel.s -side right
pack ${pane_top}.maxvel.l1 -side right
pack ${pane_top}.maxvel.l -side right
bind . <semicolon> [regsub %W [bind Scale <Left>] ${pane_top}.maxvel.s]
bind . ' [regsub %W [bind Scale <Right>] ${pane_top}.maxvel.s]
frame ${pane_top}.spinoverride
label ${pane_top}.spinoverride.foentry \
-textvariable spindlerate \
-width 3 \
-anchor e
setup_widget_accel ${pane_top}.spinoverride.foentry 0
scale ${pane_top}.spinoverride.foscale \
-command set_spindlerate \
-orient horizontal \
-resolution 1.0 \
-showvalue 0 \
-takefocus 0 \
-to 120.0 \
-variable spindlerate
label ${pane_top}.spinoverride.l
setup_widget_accel ${pane_top}.spinoverride.l [_ "Spindle Override:"]
label ${pane_top}.spinoverride.m -width 1
setup_widget_accel ${pane_top}.spinoverride.m [_ "%"]
# Pack widget ${pane_top}.spinoverride.l
pack ${pane_top}.spinoverride.l \
-side left
# Pack widget ${pane_top}.spinoverride.foscale
pack ${pane_top}.spinoverride.foscale \
-side right
# Pack widget ${pane_top}.spinoverride.foentry
pack ${pane_top}.spinoverride.m \
-side right
# Pack widget ${pane_top}.spinoverride.foentry
pack ${pane_top}.spinoverride.foentry \
-side right
frame ${pane_top}.feedoverride
label ${pane_top}.feedoverride.foentry \
-textvariable feedrate \
-width 4 \
-anchor e
setup_widget_accel ${pane_top}.feedoverride.foentry 0
scale ${pane_top}.feedoverride.foscale \
-command set_feedrate \
-orient horizontal \
-resolution 1.0 \
-showvalue 0 \
-takefocus 0 \
-to 120.0 \
-variable feedrate
label ${pane_top}.feedoverride.l
setup_widget_accel ${pane_top}.feedoverride.l [_ "Feed Override:"]
label ${pane_top}.feedoverride.m -width 1
setup_widget_accel ${pane_top}.feedoverride.m [_ "%"]
# Pack widget ${pane_top}.feedoverride.l
pack ${pane_top}.feedoverride.l \
-side left
# Pack widget ${pane_top}.feedoverride.foscale
pack ${pane_top}.feedoverride.foscale \
-side right
# Pack widget ${pane_top}.feedoverride.foentry
pack ${pane_top}.feedoverride.m \
-side right
# Pack widget ${pane_top}.feedoverride.foentry
pack ${pane_top}.feedoverride.foentry \
-side right
frame ${pane_top}.rapidoverride
label ${pane_top}.rapidoverride.foentry \
-textvariable rapidrate \
-width 4 \
-anchor e
setup_widget_accel ${pane_top}.rapidoverride.foentry 0
scale ${pane_top}.rapidoverride.foscale \
-command set_rapidrate \
-orient horizontal \
-resolution 1.0 \
-showvalue 0 \
-takefocus 0 \
-to 120.0 \
-variable rapidrate
label ${pane_top}.rapidoverride.l
setup_widget_accel ${pane_top}.rapidoverride.l [_ "Rapid Override:"]
label ${pane_top}.rapidoverride.m -width 1
setup_widget_accel ${pane_top}.rapidoverride.m [_ "%"]
# Pack widget ${pane_top}.rapidoverride.l
pack ${pane_top}.rapidoverride.l \
-side left
# Pack widget ${pane_top}.rapidoverride.foscale
pack ${pane_top}.rapidoverride.foscale \
-side right
# Pack widget ${pane_top}.rapidoverride.foentry
pack ${pane_top}.rapidoverride.m \
-side right
# Pack widget ${pane_top}.rapidoverride.foentry
pack ${pane_top}.rapidoverride.foentry \
-side right
toplevel .about
bind .about <Key-Return> { wm wi .about }
bind .about <Key-Escape> { wm wi .about }
text .about.message \
-background [systembuttonface] \
-borderwidth 0 \
-relief flat \
-width 40 \
-height 11 \
-wrap word \
-cursor {}
.about.message tag configure link \
-underline 1 -foreground blue
.about.message tag bind link <Leave> {
.about.message configure -cursor {}
.about.message tag configure link -foreground blue}
.about.message tag bind link <Enter> {
.about.message configure -cursor hand2
.about.message tag configure link -foreground red}
.about.message tag bind link <ButtonPress-1><ButtonRelease-1> {launch_website}
.about.message insert end [subst [_ "LinuxCNC/AXIS version \$version\n\nCopyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Jeff Epler and Chris Radek.\n\nThis is free software, and you are welcome to redistribute it under certain conditions. See the file COPYING, included with LinuxCNC.\n\nVisit the LinuxCNC web site: "]] {} {http://www.linuxcnc.org/} link
.about.message configure -state disabled
button .about.ok \
-command {wm wi .about} \
-default active \
-padx 0 \
-pady 0 \
-width 10
setup_widget_accel .about.ok [_ OK]
label .about.image \
-borderwidth 0 \
-image [load_image banner]
setup_widget_accel .about.image {}
# Pack widget .about.image
pack .about.image
# Pack widget .about.message
pack .about.message \
-expand 1 \
-fill both
# Pack widget .about.ok
pack .about.ok
# Configure widget .about
wm title .about [_ "About AXIS"]
wm iconname .about {}
wm resiz .about 0 0
wm minsize .about 1 1
wm protocol .about WM_DELETE_WINDOW {wm wi .about}
toplevel .keys
bind .keys <Key-Return> { wm withdraw .keys }
bind .keys <Key-Escape> { wm withdraw .keys }
frame .keys.text \
button .keys.ok \
-command {wm wi .keys} \
-default active \
-padx 0 \
-pady 0 \
-width 10
setup_widget_accel .keys.ok [_ OK]
# Pack widget .keys.text
pack .keys.text \
-expand 1 \
-fill y
# Pack widget .keys.ok
pack .keys.ok
# Configure widget .keys
wm title .keys [_ "AXIS Quick Reference"]
wm iconname .keys {}
wm resiz .keys 0 0
wm minsize .keys 1 1
wm protocol .keys WM_DELETE_WINDOW {wm wi .keys}
# Grid widget ${pane_top}.feedoverride
grid ${pane_top}.feedoverride \
-column 0 \
-row 2 \
-sticky new
# Grid widget ${pane_top}.rapidoverride
grid ${pane_top}.rapidoverride \
-column 0 \
-row 3 \
-sticky new
# Grid widget ${pane_top}.spinoverride
grid ${pane_top}.spinoverride \
-column 0 \
-row 4 \
-sticky new
grid ${pane_top}.jogspeed \
-column 0 \
-row 5 \
-sticky new
grid ${pane_top}.ajogspeed \
-column 0 \
-row 6 \
-sticky new
grid ${pane_top}.maxvel \
-column 0 \
-row 7 \
-sticky new
grid ${pane_top}.gcodel -column 0 -row 8 -sticky nw
grid ${pane_top}.gcodes -column 0 -row 9 -sticky new
# Grid widget .info
grid .info \
-column 0 \
-row 6 \
-columnspan 2 \
-sticky ew
# Grid widget ${pane_top}.right
grid ${pane_top}.right \
-column 1 \
-row 1 \
-columnspan 2 \
-padx 2 \
-pady 2 \
-rowspan 99 \
-sticky nesw
grid ${pane_top}.tabs \
-column 0 \
-row 1 \
-sticky nesw \
-padx 2 \
-pady 2
grid rowconfigure ${pane_top} 1 -weight 1
grid columnconfigure ${pane_top} 1 -weight 1
grid ${pane_bottom}.t \
-column 1 \
-row 1 \
-sticky nesw
grid rowconfigure ${pane_bottom} 1 -weight 1
grid columnconfigure ${pane_bottom} 1 -weight 1
grid .pane -column 0 -row 1 -sticky nsew -rowspan 2
# Grid widget .toolbar
grid .toolbar \
-column 0 \
-row 0 \
-columnspan 3 \
-sticky nesw
grid columnconfigure . 0 -weight 1
grid rowconfigure . 1 -weight 1
# vim:ts=8:sts=8:noet:sw=8
set manualgroup [concat [winfo children $_tabs_manual.axes] \
$_tabs_manual.jogf.zerohome.home \
$_tabs_manual.jogf.jog.jogminus \
$_tabs_manual.jogf.jog.jogplus \
$_tabs_manual.spindlef.cw $_tabs_manual.spindlef.ccw \
$_tabs_manual.spindlef.stop $_tabs_manual.spindlef.brake \
$_tabs_manual.flood $_tabs_manual.mist]
set mdigroup [concat $_tabs_mdi.command $_tabs_mdi.go $_tabs_mdi.history]
proc disable_group {ws} { foreach w $ws { $w configure -state disabled } }
proc enable_group {ws} { foreach w $ws { $w configure -state normal } }
proc state {e args} {
set e [uplevel \#0 [list expr $e]]
if {$e} { set newstate normal } else {set newstate disabled}
foreach w $args {
if {[llength $w] > 1} {
set m [lindex $w 0]
for {set i 1} {$i < [llength $w]} {incr i} {
set idx [extract_text [_ [lindex $w $i]]]
set oldstate [$m entrycget $idx -state]
if {$oldstate != $newstate} {
$m entryconfigure $idx -state $newstate
}
}
} else {
set oldstate [$w cget -state]
if {$oldstate != $newstate} {
$w configure -state $newstate
}
}
}
}
proc relief {e args} {
set e [uplevel \#0 [list expr $e]]
if {$e} { set newstate sunken } else {set newstate link }
foreach w $args { $w configure -relief $newstate }
}
proc update_title {args} {
set basetitle [subst [_ "AXIS \$::version on \$::machine"]]
if {$::taskfile == ""} {
set nofile [_ "(no file)"]
wm ti . "$basetitle $nofile"
wm iconname . "AXIS"
} else {
wm ti . "[lindex [file split $::taskfile] end] - $basetitle"
wm iconname . "[lindex [file split $::taskfile] end]"
}
}
proc update_state {args} {
# (The preferred exactly-two-argument form of switch cannot be used
# as the patterns must undergo $-expansion)
switch -- $::task_state \
$::STATE_ESTOP { set ::task_state_string [_ "ESTOP"] } \
$::STATE_ESTOP_RESET { set ::task_state_string [_ "OFF"] } \
$::STATE_ON { set ::task_state_string [_ "ON"] }
relief {$task_state == $STATE_ESTOP} .toolbar.machine_estop
state {$task_state != $STATE_ESTOP} \
.toolbar.machine_power {.menu.machine "Toggle _Machine Power"}
relief {$task_state == $STATE_ON} .toolbar.machine_power
state {$interp_state == $INTERP_IDLE && $taskfile != ""} \
.toolbar.reload {.menu.file "_Reload"}
state {$taskfile != ""} \
{.menu.file "_Save G-code as..."}
state {$interp_state == $INTERP_IDLE && $taskfile != "" && $::has_editor} \
{.menu.file "_Edit..."}
state {$taskfile != ""} {.menu.file "_Properties..."}
state {$interp_state == $INTERP_IDLE} .toolbar.file_open \
{.menu.file "_Open..." "_Quit" "Recent _Files"} \
{.menu.machine "Skip lines with '_/'"} .toolbar.program_blockdelete
state {$task_state == $STATE_ON && $interp_state == $INTERP_IDLE } \
.toolbar.program_run {.menu.machine "_Run program"} \
{.menu.file "Reload tool _data"}
state {$interp_state == $INTERP_IDLE} \
{.menu.file "Edit _tool data..."}
state {$task_state == $STATE_ON && $interp_state == $INTERP_IDLE} \
{.menu.machine "Homin_g" "_Unhoming" "_Zero coordinate system"}
relief {$interp_state != $INTERP_IDLE} .toolbar.program_run
state {$task_state == $STATE_ON && $taskfile != ""} \
.toolbar.program_step {.menu.machine "S_tep"}
state {$task_state == $STATE_ON && \
($interp_state == $INTERP_READING || $interp_state == $INTERP_WAITING) } \
{.menu.machine "_Pause"}
state {$task_state == $STATE_ON && $interp_state == $INTERP_PAUSED } \
{.menu.machine "Re_sume"}
state {$task_state == $STATE_ON && $interp_state != $INTERP_IDLE} \
.toolbar.program_pause
relief {$interp_pause != 0} \
.toolbar.program_pause
relief {$block_delete != 0} \
.toolbar.program_blockdelete
relief {$optional_stop != 0} \
.toolbar.program_optpause
state {$task_state == $STATE_ON && $interp_state != $INTERP_IDLE} \
.toolbar.program_stop {.menu.machine "Stop"}
relief {$interp_state == $INTERP_IDLE} \
.toolbar.program_stop
state {$::has_ladder} {.menu.file "_Ladder Editor..."}
state {$task_state == $STATE_ON \
&& $interp_state == $INTERP_IDLE && $highlight_line != -1} \
{.menu.machine "Ru_n from selected line"}
state {$::task_state == $::STATE_ON && $::interp_state == $::INTERP_IDLE\
&& $spindledir != 0} \
$::_tabs_manual.spindlef.spindleminus \
$::_tabs_manual.spindlef.spindleplus
if { $::motion_mode == $::TRAJ_MODE_FREE
&& $::kinematics_type != $::KINEMATICS_IDENTITY
} {
set ::position [concat [_ "Position:"] Joint]
} else {
set coord_str [lindex [list [_ Machine] [_ Relative]] $::coord_type]
set display_str [lindex [list [_ Actual] [_ Commanded]] $::display_type]
set ::position [concat [_ "Position:"] $coord_str $display_str]
}
if {$::task_state == $::STATE_ON && $::interp_state == $::INTERP_IDLE} {
if { ($::last_interp_state != $::INTERP_IDLE || $::last_task_state != $::task_state) \
&& $::task_mode == $::TASK_MODE_AUTO} {
set_mode_from_tab
}
enable_group $::manualgroup
} else {
disable_group $::manualgroup
}
if {$::task_state == $::STATE_ON && $::queued_mdi_commands < $::max_queued_mdi_commands } {
enable_group $::mdigroup
} else {
disable_group $::mdigroup
}
if { $::task_state == $::STATE_ON
&& $::interp_state == $::INTERP_IDLE
&& ( $::motion_mode != $::TRAJ_MODE_FREE
|| $::kinematics_type == $::KINEMATICS_IDENTITY
)} {
$::_tabs_manual.jogf.zerohome.zero configure -state normal
} else {
$::_tabs_manual.jogf.zerohome.zero configure -state disabled
}
if { $::task_state == $::STATE_ON
&& $::interp_state == $::INTERP_IDLE
&& ( $::motion_mode != $::TRAJ_MODE_FREE
|| $::kinematics_type == $::KINEMATICS_IDENTITY
)
&& ("$::tool" != "" && "$::tool" != [_ "No tool"])
} {
$::_tabs_manual.jogf.zerohome.tooltouch configure -state normal
} else {
$::_tabs_manual.jogf.zerohome.tooltouch configure -state disabled
}
set ::last_interp_state $::interp_state
set ::last_task_state $::task_state
if {$::on_any_limit} {
$::_tabs_manual.jogf.override configure -state normal
} else {
$::_tabs_manual.jogf.override configure -state disabled
}
}
proc set_mode_from_tab {} {
set page [${::pane_top}.tabs raise]
switch $page {
mdi { ensure_mdi }
default { ensure_manual
focus $::pane_top.tabs.fmanual
}
}
}
# trace var: motion_mode
proc joint_mode_switch {args} {
# note: test for existence of ::trajcoordinates because it is not avail first timeo
# todo: save and restore last value of ::ja_rbutton for joints,axes
if { $::motion_mode == $::TRAJ_MODE_FREE
&& $::kinematics_type != $::KINEMATICS_IDENTITY
} {
grid forget $::_tabs_manual.axes
grid $::_tabs_manual.joints -column 1 -row 0 -padx 0 -pady 0 -sticky w
setup_widget_accel $::_tabs_manual.axis [_ Joint:]
# Joints: need number for ja_rbutton
if {[info exists ::trajcoordinates]} {
# make first (leftmost) radiobutton active
for {set i 0} {$i < $::MAX_AXIS} {incr i} {lappend anums $i}
# typ anums is {0 ... 8}
if { [lsearch $anums $::ja_rbutton] < 0 } {
set ::ja_rbutton 0
}
}
} else {
grid forget $::_tabs_manual.joints
grid $::_tabs_manual.axes -column 1 -row 0 -padx 0 -pady 0 -sticky w
setup_widget_accel $::_tabs_manual.axis [_ Axis:]
# Axes: need letter for ja_rbutton
if {[info exists ::trajcoordinates]} {
# make first (leftmost) radiobutton active
for {set i 0} {$i < $::MAX_JOINTS} {incr i} {lappend jnums $i}
# typ jnums is {0 ... 8}
if { [lsearch $jnums $::ja_rbutton] >= 0 } {
set ::ja_rbutton [string range $::trajcoordinates 0 0]
}
}
}
}
proc queue_update_state {args} {
after cancel update_state
after idle update_state
}
set rotate_mode 0
set taskfile ""
set machine ""
set task_state -1
set has_editor 1
set has_ladder 0
set last_task_state 0
set task_mode -1
set task_paused 0
set optional_stop 0
set block_delete 0
set interp_pause 0
set last_interp_state 0
set interp_state 0
set running_line -1
set highlight_line -1
set coord_type 1
set display_type 0
set spindledir {}
set motion_mode 0
set kinematics_type -1
set metric 0
set max_speed 1
set queued_mdi_commands 0
set max_queued_mdi_commands 10
trace variable taskfile w update_title
trace variable machine w update_title
trace variable taskfile w queue_update_state
trace variable task_state w queue_update_state
trace variable task_mode w queue_update_state
trace variable task_paused w queue_update_state
trace variable optional_stop w queue_update_state
trace variable block_delete w queue_update_state
trace variable interp_pause w queue_update_state
trace variable interp_state w queue_update_state
trace variable running_line w queue_update_state
trace variable highlight_line w queue_update_state
trace variable spindledir w queue_update_state
trace variable coord_type w queue_update_state
trace variable display_type w queue_update_state
trace variable motion_mode w queue_update_state
trace variable kinematics_type w queue_update_state
trace variable on_any_limit w queue_update_state
trace variable motion_mode w joint_mode_switch
trace variable queued_mdi_commands w queue_update_state
set editor_deleted 0
bind . <Control-Tab> {
set page [${pane_top}.tabs raise]
switch $page {
mdi { ${pane_top}.tabs raise manual }
default { ${pane_top}.tabs raise mdi }
}
break
}
# Handle Tk 8.6+ where virtual events are used for cursor motion
foreach {k v} {
Left PrevChar Right NextChar
Up PrevLine Down NextLine
Home LineStart End LineEnd
} {
set b [bind Entry <<$v>>]
if {$b != {}} { bind Entry <$k> $b }
}
# any key that causes an entry or spinbox action should not continue to perform
# a binding on "."
foreach c {Entry Spinbox} {
foreach b [bind $c] {
switch -glob $b {
<*-Key-*> {
bind $c $b {+if {[%W cget -state] == "normal"} break}
}
}
}
foreach b { Left Right
Up Down Prior Next Home
End } {
bind $c <KeyPress-$b> {+if {[%W cget -state] == "normal"} break}
bind $c <KeyRelease-$b> {+if {[%W cget -state] == "normal"} break}
}
bind $c <Control-KeyPress-Home> {+if {[%W cget -state] == "normal"} break}
bind $c <Control-KeyRelease-Home> {+if {[%W cget -state] == "normal"} \
break}
bind $c <Control-KeyPress-KP_Home> {+if {[%W cget -state] == "normal"} \
break}
bind $c <Control-KeyRelease-KP_Home> {+if {[%W cget -state] == "normal"} \
break}
set bb [bind $c <KeyPress>]
foreach k { Left Right Up Down Prior Next
Home End } {
set b [bind $c <$k>]
if {$b == {}} { set b $bb }
bind $c <KeyPress-KP_$k> "if {%A == \"\"} { $b } { $bb; break }"
bind $c <KeyRelease-KP_$k> {+if {[%W cget -state] == "normal"} break}
}
foreach k {0 1 2 3 4 5 6 7 8 9} {
bind $c <KeyPress-KP_$k> "$bb; break"
bind $c <KeyRelease-KP_$k> {+if {[%W cget -state] == "normal"} break}
}
bind $c <Key> {+if {[%W cget -state] == "normal" && [string length %A]} \
break}
}
proc is_continuous {} {
expr {"[$::_tabs_manual.jogf.jog.jogincr get]" == [_ "Continuous"]}
}
proc show_all text {
$text yview moveto 0.0
update
set fy [lindex [$text yview] 1]
set ch [$text cget -height]
$text configure -height [expr {ceil($ch/$fy)}]
}
proc delete_all text {
set nl [lindex [split [$text index end] .] 0]
while {$nl >= 1500} {
$text delete 1.0 1000.end
incr nl -1000
}
$text delete 1.0 end
}
proc size_combobox_to_entries c {
set fo [$c cget -font]
set wi [font measure $fo 0]
set sz 4
foreach i [$c list get 0 end] {
set li [expr ([font measure $fo $i] + $wi - 1)/$wi]
if {$li > $sz} { set sz $li }
}
$c configure -width $sz
}
proc size_label_to_strings {w args} {
set fo [$w cget -font]
set wi [font measure $fo 0]
set sz 4
foreach i args {
set li [expr ([font measure $fo $i] + $wi - 1)/$wi]
if {$li > $sz} { set sz $li }
}
$w configure -width $sz
}
proc size_menubutton_to_entries {w} {
set m $w.menu
set fo [$w cget -font]
set wi [font measure $fo 0]
set sz 4
for {set i 0} {$i <= [$m index end]} {incr i} {
set type [$m type $i]
if {$type == "separator" || $type == "tearoff"} continue
set text [$m entrycget $i -label]
set li [expr ([font measure $fo $text] + $wi - 1)/$wi]
if {$li > $sz} { set sz $li }
}
$w configure -width $sz
}
size_combobox_to_entries $_tabs_manual.jogf.jog.jogincr
size_label_to_strings $_tabs_manual.axis [_ Joint:] [_ Axis:]
proc setval {vel max_speed} {
if {$vel == 0} { return 0 }
if {$vel >= 60*$max_speed} { set vel [expr 60*$max_speed] }
set x [expr {-1/(log($vel/60./$max_speed)-1)}]
expr {round($x * 200.) / 200.}
}
proc val2vel {val max_speed} {
if {$val == 0} { return 0 }
if {$val == 1} { format "%32.5f" [expr {$max_speed * 60.}]
} else { format "%32.5f" [expr {60 * $max_speed * exp(-1/$val + 1)}] }
}
proc places {s1 s2} {
if {$s1 > 1 && int($s1) != int($s2)} {
return [expr {[string first . $s1]-1}]
}
set l1 [string length $s1]
set l2 [string length $s2]
for {set i 15} {$i < $l1 && $i < $l2} {incr i} {
set c1 [string index $s1 $i]
set c2 [string index $s2 $i]
if {$c1 != "0" && $c1 != "." && $c1 != $c2} { return $i }
}
return [string length $s1]
}
proc val2vel_show {val maxvel} {
set this_vel [val2vel $val $maxvel]
set next_places 0
set last_places 0
if {$val > .005} {
set next_vel [val2vel [expr {$val - .005}] $maxvel]
set next_places [places $this_vel $next_vel]
}
if {$val < .995} {
set prev_vel [val2vel [expr {$val + .005}] $maxvel]
set prev_places [places $this_vel $prev_vel]
}
if {$next_places > $last_places} {
string trim [string range $this_vel 0 $next_places]
} {
string trim [string range $this_vel 0 $last_places]
}
}
proc set_slider_min {minval} {
global pane_top
global max_speed
${pane_top}.jogspeed.s configure -from [setval $minval $max_speed]
}
proc set_aslider_min {minval} {
global pane_top
global max_aspeed
${pane_top}.ajogspeed.s configure -from [setval $minval $max_aspeed]
}
proc update_jog_slider_vel {newval} {
global jog_speed max_speed
set max_speed_units [to_internal_linear_unit $max_speed]
if {$max_speed_units == {None}} return
if {$::metric} { set max_speed_units [expr {25.4 * $max_speed_units}] }
set speed [val2vel_show $newval $max_speed_units];
set jog_speed $speed
}
proc update_maxvel_slider_vel {newval} {
global maxvel_speed max_maxvel
set max_speed_units [to_internal_linear_unit $max_maxvel]
if {$max_speed_units == {None}} return
if {$::metric} { set max_speed_units [expr {25.4 * $max_speed_units}] }
set speed [val2vel_show $newval $max_speed_units];
set maxvel_speed $speed
set_maxvel $speed
}
proc update_maxvel_slider {} {
global maxvel_speed max_maxvel maxvel_slider_val
set max_speed_units [to_internal_linear_unit $max_maxvel]
if {$max_speed_units == {None}} return
if {$::metric} { set max_speed_units [expr {25.4 * $max_speed_units}] }
set maxvel_slider_val [setval $maxvel_speed $max_speed_units]
}
proc update_units {args} {
if {$::metric} {
${::pane_top}.jogspeed.l1 configure -text mm/min
${::pane_top}.maxvel.l1 configure -text mm/min
} else {
${::pane_top}.jogspeed.l1 configure -text in/min
${::pane_top}.maxvel.l1 configure -text in/min
}
update_jog_slider_vel $::jog_slider_val
update_maxvel_slider_vel $::maxvel_slider_val
}
proc update_ajog_slider_vel {newval} {
global jog_aspeed max_aspeed
set jog_aspeed [val2vel_show $newval $max_aspeed];
}
proc update_recent {args} {
.menu.file.recent delete 0 end
set i 1
foreach f $args {
if {$i < 10} { set und 0 } \
elseif {$i == 10} { set und 1 } \
else { set und -1 }
.menu.file.recent add command -underline $und \
-label "$i: [file tail $f]" \
-command [list open_file_name $f]
incr i
}
if {0 != [llength $args]} {
.menu.file.recent add separator
.menu.file.recent add command \
-command clear_recent_files
setup_menu_accel .menu.file.recent end [_ "_Clear Recents List"]
}
}
bind . <Configure> {
if {"%W" == "."} {
set msz [wm minsize %W]
set nmsz [list [winfo reqwidth %W] [expr [winfo reqheight %W]+4]]
if {$msz != $nmsz} { eval wm minsize %W $nmsz }
}
}
bind . <Alt-v> [bind all <Alt-Key>]
bind . <Alt-v> {+break}
bind . <Key-Return> {focus .}
wm withdraw .about
wm withdraw .keys
DynamicHelp::add $_tabs_manual.spindlef.ccw -text [_ "Turn spindle counterclockwise \[F10\]"]
DynamicHelp::add $_tabs_manual.spindlef.cw -text [_ "Turn spindle clockwise \[F9\]"]
DynamicHelp::add $_tabs_manual.spindlef.stop -text [_ "Stop spindle \[F9/F10\]"]
DynamicHelp::add $_tabs_manual.spindlef.spindleplus -text [_ "Turn spindle Faster \[F12\]"]
DynamicHelp::add $_tabs_manual.spindlef.spindleminus -text [_ "Turn spindle Slower \[F11\]"]
DynamicHelp::add $_tabs_manual.spindlef.brake -text [_ "Turn spindle brake on \[Shift-B\] or off \[B\]"]
DynamicHelp::add $_tabs_manual.flood -text [_ "Turn flood on or off \[F8\]"]
DynamicHelp::add $_tabs_manual.mist -text [_ "Turn mist on or off \[F7\]"]
DynamicHelp::add $_tabs_manual.jogf.zerohome.home -text [_ "Send active axis home \[Home\]"]
DynamicHelp::add $_tabs_manual.jogf.zerohome.zero -text [_ "Set G54 offset for active axis \[End\]"]
DynamicHelp::add $_tabs_manual.jogf.zerohome.tooltouch -text [_ "Set tool offset for loaded tool \[Ctrl-End\]"]
DynamicHelp::add $_tabs_manual.axes.axisx -text [_ "Activate axis \[X\]"]
DynamicHelp::add $_tabs_manual.axes.axisy -text [_ "Activate axis \[Y\]"]
DynamicHelp::add $_tabs_manual.axes.axisz -text [_ "Activate axis \[Z\]"]
DynamicHelp::add $_tabs_manual.axes.axisa -text [_ "Activate axis \[A\]"]
DynamicHelp::add $_tabs_manual.axes.axisb -text [_ "Activate axis \[4\]"]
DynamicHelp::add $_tabs_manual.axes.axisc -text [_ "Activate axis \[5\]"]
DynamicHelp::add $_tabs_manual.jogf.jog.jogminus -text [_ "Jog selected axis"]
DynamicHelp::add $_tabs_manual.jogf.jog.jogplus -text [_ "Jog selected axis"]
DynamicHelp::add $_tabs_manual.jogf.jog.jogincr -text [_ "Select jog increment"]
DynamicHelp::add $_tabs_manual.jogf.override -text [_ "Temporarily allow jogging outside machine limits \[L\]"]
# On at least some versions of Tk (tk8.4 on ubuntu 6.06), this hides files
# beginning with "." from the open dialog. Who knows what it does on other
# versions.
catch {
auto_load ::tk::dialog::file::
namespace eval ::tk::dialog::file {}
set ::tk::dialog::file::showHiddenBtn 1
set ::tk::dialog::file::showHiddenVar 0
}
# Show what alphabetic letters are left for a specific menu
proc show_menu_available {m} {
for {set i 0} {$i < [$m index end]} {incr i} {
set t [$m type $i]
if {$t == "separator" || $t == "tearoff"} {continue}
set u [$m entrycget $i -underline]
if {$u == -1} {continue}
set l [$m entrycget $i -label]
set c [string tolower [string range $l $u $u]]
if {[info exists used($c)]} { puts "Duplicate: $c" }
set used($c) {}
}
foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
if {![info exists used($i)]} { puts "Available: $i" }
}
}
# vim:ts=8:sts=4:et:sw=4:
|