📄 axis.tcl
字号:
# This is a component of AXIS, a front-end for emc# Copyright 2004, 2005, 2006, 2007, 2008 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. configure \ -menu .menumenu .menu \ -cursor {}menu .menu.file \ -tearoff 0menu .menu.machine \ -tearoff 0menu .menu.machine.home \ -tearoff 0menu .menu.view \ -tearoff 0menu .menu.help \ -tearoff 0menu .menu.machine.touchoff \ -tearoff 0menu .menu.machine.clearoffset \ -tearoff 0.menu.file add command \ -accelerator O \ -command open_filesetup_menu_accel .menu.file end [_ "_Open..."].menu.file add command \ -command edit_programsetup_menu_accel .menu.file end [_ "_Edit..."].menu.file add command \ -accelerator [_ "Ctrl-R"] \ -command reload_filesetup_menu_accel .menu.file end [_ "_Reload"].menu.file add command \ -accelerator [_ "Ctrl-S"] \ -command save_gcodesetup_menu_accel .menu.file end [_ "_Save gcode as..."].menu.file add command \ -command gcode_propertiessetup_menu_accel .menu.file end [_ "_Properties..."].menu.file add separator.menu.file add command \ -command edit_tooltablesetup_menu_accel .menu.file end [_ "Edit _tool table..."].menu.file add command \ -command reload_tool_tablesetup_menu_accel .menu.file end [_ "Reload tool ta_ble"].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_clickedsetup_menu_accel .menu.machine end [_ "Toggle _Emergency Stop"].menu.machine add command \ -accelerator F2 \ -command onoff_clickedsetup_menu_accel .menu.machine end [_ "Toggle _Machine Power"].menu.machine add separator.menu.machine add command \ -command set_next_linesetup_menu_accel .menu.machine end [_ "Set _next line"].menu.machine add command \ -accelerator R \ -command task_runsetup_menu_accel .menu.machine end [_ "_Run program"].menu.machine add command \ -accelerator T \ -command task_stepsetup_menu_accel .menu.machine end [_ "S_tep"].menu.machine add command \ -accelerator P \ -command task_pausesetup_menu_accel .menu.machine end [_ "_Pause"].menu.machine add command \ -accelerator S \ -command task_resumesetup_menu_accel .menu.machine end [_ "Re_sume"].menu.machine add command \ -accelerator ESC \ -command task_stopsetup_menu_accel .menu.machine end [_ "Stop"].menu.machine add checkbutton \ -command toggle_optional_stop \ -variable optional_stopsetup_menu_accel .menu.machine end [_ "Stop at M_1"].menu.machine add checkbutton \ -command toggle_block_delete \ -variable block_deletesetup_menu_accel .menu.machine end [_ "Skip lines with '_/'"].menu.machine add separator.menu.machine add command \ -accelerator [_ "Ctrl-M"] \ -command clear_mdi_historysetup_menu_accel .menu.machine end [_ "Clear MDI h_istory"].menu.machine add command \ -accelerator [_ "Ctrl-H"] \ -command mdi_history_hist2clipsetup_menu_accel .menu.machine end [_ "Copy from MDI hist_ory"].menu.machine add command \ -accelerator [_ "Ctrl-Shift-H"] \ -command mdi_history_clip2histsetup_menu_accel .menu.machine end [_ "Paste to MDI histor_y"].menu.machine add separator.menu.machine add command \ -command {exec $env(EMC2_TCL_DIR)/bin/emccalib.tcl -- -ini $emcini &}setup_menu_accel .menu.machine end [_ "_Calibration"].menu.machine add command \ -command {exec $env(EMC2_TCL_DIR)/bin/halshow.tcl -- -ini $emcini &}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 emctop -ini $emcini &}setup_menu_accel .menu.machine end [_ "Sho_w EMC 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.homesetup_menu_accel .menu.machine end [_ "Homin_g"].menu.machine add cascade \ -menu .menu.machine.clearoffsetsetup_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.view add radiobutton \ -command set_view_z \ -variable view_type \ -value 1 \ -accelerator Vsetup_menu_accel .menu.view end [_ "_Top view"].menu.view add radiobutton \ -command set_view_z2 \ -variable view_type \ -value 2 \ -accelerator Vsetup_menu_accel .menu.view end [_ "_Rotated Top view"].menu.view add radiobutton \ -command set_view_x \ -variable view_type \ -value 3 \ -accelerator Vsetup_menu_accel .menu.view end [_ "_Side view"].menu.view add radiobutton \ -command set_view_y \ -variable view_type \ -value 4 \ -accelerator Vsetup_menu_accel .menu.view end [_ "_Front view"].menu.view add radiobutton \ -command set_view_p \ -variable view_type \ -value 5 \ -accelerator Vsetup_menu_accel .menu.view end [_ "_Perspective view"].menu.view add separator.menu.view add radiobutton \ -value 0 \ -variable metric \ -command redrawsetup_menu_accel .menu.view end [_ "Display _Inches"].menu.view add radiobutton \ -value 1 \ -variable metric \ -command redrawsetup_menu_accel .menu.view end [_ "Display _MM"].menu.view add separator.menu.view add checkbutton \ -variable show_program \ -command toggle_show_programsetup_menu_accel .menu.view end [_ "S_how program"].menu.view add checkbutton \ -variable show_live_plot \ -command toggle_show_live_plotsetup_menu_accel .menu.view end [_ "Sho_w live plot"].menu.view add checkbutton \ -variable show_tool \ -command toggle_show_toolsetup_menu_accel .menu.view end [_ "Show too_l"].menu.view add checkbutton \ -variable show_extents \ -command toggle_show_extentssetup_menu_accel .menu.view end [_ "Show e_xtents"].menu.view add checkbutton \ -variable show_machine_limits \ -command toggle_show_machine_limitssetup_menu_accel .menu.view end [_ "Sh_ow machine limits"].menu.view add checkbutton \ -variable show_machine_speed \ -command toggle_show_machine_speedsetup_menu_accel .menu.view end [_ "Show v_elocity"].menu.view add checkbutton \ -variable show_distance_to_go \ -command toggle_show_distance_to_gosetup_menu_accel .menu.view end [_ "Show _distance to go"].menu.view add command \ -accelerator [_ "Ctrl-K"] \ -command clear_live_plotsetup_menu_accel .menu.view end [_ "_Clear live plot"].menu.view add separator.menu.view add radiobutton \ -value 1 \ -variable display_type \ -accelerator @ \ -command redrawsetup_menu_accel .menu.view end [_ "Show commanded position"].menu.view add radiobutton \ -value 0 \ -variable display_type \ -accelerator @ \ -command redrawsetup_menu_accel .menu.view end [_ "Show actual position"].menu.view add separator.menu.view add radiobutton \ -value 0 \ -variable coord_type \ -accelerator # \ -command redrawsetup_menu_accel .menu.view end [_ "Show machine position"].menu.view add radiobutton \ -value 1 \ -variable coord_type \ -accelerator # \ -command redrawsetup_menu_accel .menu.view end [_ "Show relative position"].menu.view add separator.menu.view add radiobutton \ -value 0 \ -variable joint_mode \ -accelerator $ \ -command set_joint_modesetup_menu_accel .menu.view end [_ "Joint mode"].menu.view add radiobutton \ -value 1 \ -variable joint_mode \ -accelerator $ \ -command set_joint_modesetup_menu_accel .menu.view end [_ "World mode"]# ----------------------------------------------------------------------.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.filesetup_menu_accel .menu end [_ _File].menu add cascade \ -menu .menu.machinesetup_menu_accel .menu end [_ _Machine].menu add cascade \ -menu .menu.viewsetup_menu_accel .menu end [_ _View].menu add cascade \ -menu .menu.helpsetup_menu_accel .menu end [_ _Help]frame .toolbar \ -borderwidth 1 \ -relief raisedvrule .toolbar.rule16Button .toolbar.machine_estop \ -helptext [_ "Toggle Emergency Stop \[F1\]"] \ -image [load_image tool_estop] \ -relief sunken \ -takefocus 0bind .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 0setup_widget_accel .toolbar.machine_power {}vrule .toolbar.rule0Button .toolbar.file_open \ -command { open_file } \ -helptext [_ "Open G-Code file \[O\]"] \ -image [load_image tool_open] \ -relief link \ -takefocus 0setup_widget_accel .toolbar.file_open {}Button .toolbar.reload \ -command { reload_file } \ -helptext [_ "Reopen current file \[Control-R\]"] \ -image [load_image tool_reload] \ -relief link \ -takefocus 0setup_widget_accel .toolbar.reload {}vrule .toolbar.rule4Button .toolbar.program_run \ -command task_run \ -helptext [_ "Begin executing current file \[R\]"] \ -image [load_image tool_run] \ -relief link \ -takefocus 0setup_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 0setup_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 0setup_widget_accel .toolbar.program_pause {}Button .toolbar.program_stop \ -command task_stop \ -helptext [_ "Stop program execution \[ESC\]"] \ -image [load_image tool_stop] \ -relief link \ -takefocus 0setup_widget_accel .toolbar.program_stop {}vrule .toolbar.rule8Button .toolbar.view_zoomin \ -command zoomin \ -helptext [_ "Zoom in"] \ -image [load_image tool_zoomin] \ -relief link \ -takefocus 0setup_widget_accel .toolbar.view_zoomin {}Button .toolbar.view_zoomout \ -command zoomout \ -helptext [_ "Zoom out"] \ -image [load_image tool_zoomout] \ -relief link \ -takefocus 0setup_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 0setup_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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -