gmoccapy_JA_master - ongoing port to JA

Signed-off-by: Norbert Schechner <nieson@web.de>
This commit is contained in:
Norbert Schechner 2016-07-31 16:35:41 +02:00
parent be83f435be
commit 7db4ebb361
5 changed files with 742 additions and 137 deletions

View file

@ -2,14 +2,14 @@
# gmoccapy hal file from Norbert Schechner # # gmoccapy hal file from Norbert Schechner #
################################################################### ###################################################################
net h_hardware_button_0 h_buttonlist.h_button_0 => gmoccapy.h-button-0 net h_hardware_button_0 h_buttonlist.h_button_0 => gmoccapy.h-button.button-0
net h_hardware_button_1 h_buttonlist.h_button_1 => gmoccapy.h-button-1 net h_hardware_button_1 h_buttonlist.h_button_1 => gmoccapy.h-button.button-1
net h_hardware_button_2 h_buttonlist.h_button_2 => gmoccapy.h-button-2 net h_hardware_button_2 h_buttonlist.h_button_2 => gmoccapy.h-button.button-2
net h_hardware_button_3 h_buttonlist.h_button_3 => gmoccapy.h-button-3 net h_hardware_button_3 h_buttonlist.h_button_3 => gmoccapy.h-button.button-3
net h_hardware_button_4 h_buttonlist.h_button_4 => gmoccapy.h-button-4 net h_hardware_button_4 h_buttonlist.h_button_4 => gmoccapy.h-button.button-4
net h_hardware_button_5 h_buttonlist.h_button_5 => gmoccapy.h-button-5 net h_hardware_button_5 h_buttonlist.h_button_5 => gmoccapy.h-button.button-5
net h_hardware_button_6 h_buttonlist.h_button_6 => gmoccapy.h-button-6 net h_hardware_button_6 h_buttonlist.h_button_6 => gmoccapy.h-button.button-6
net h_hardware_button_7 h_buttonlist.h_button_7 => gmoccapy.h-button-7 net h_hardware_button_7 h_buttonlist.h_button_7 => gmoccapy.h-button.button-7
net h_hardware_button_8 h_buttonlist.h_button_8 => gmoccapy.h-button-8 net h_hardware_button_8 h_buttonlist.h_button_8 => gmoccapy.h-button.button-8
net h_hardware_button_9 h_buttonlist.h_button_9 => gmoccapy.h-button-9 net h_hardware_button_9 h_buttonlist.h_button_9 => gmoccapy.h-button.button-9

View file

@ -2,12 +2,12 @@
# gmoccapy hal file from Norbert Schechner # # gmoccapy hal file from Norbert Schechner #
################################################################### ###################################################################
net v_button_0 v_buttonlist.v_button_0 => gmoccapy.v-button-0 net v_button_0 v_buttonlist.v_button_0 => gmoccapy.v-button.button-0
net v_button_1 v_buttonlist.v_button_1 => gmoccapy.v-button-1 net v_button_1 v_buttonlist.v_button_1 => gmoccapy.v-button.button-1
net v_button_2 v_buttonlist.v_button_2 => gmoccapy.v-button-2 net v_button_2 v_buttonlist.v_button_2 => gmoccapy.v-button.button-2
net v_button_3 v_buttonlist.v_button_3 => gmoccapy.v-button-3 net v_button_3 v_buttonlist.v_button_3 => gmoccapy.v-button.button-3
net v_button_4 v_buttonlist.v_button_4 => gmoccapy.v-button-4 net v_button_4 v_buttonlist.v_button_4 => gmoccapy.v-button.button-4
net v_button_5 v_buttonlist.v_button_5 => gmoccapy.v-button-5 net v_button_5 v_buttonlist.v_button_5 => gmoccapy.v-button.button-5
net v_button_6 v_buttonlist.v_button_6 => gmoccapy.v-button-6 net v_button_6 v_buttonlist.v_button_6 => gmoccapy.v-button.button-6

6
scripts/halcmd_twopass Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
DASHI="" INIARG=""
HALLIB_DIR=/home/gmoccapy/linuxcnc-org/lib/hallib; export HALLIB_DIR
LINUXCNC_TCL_DIR=/home/gmoccapy/linuxcnc-org/tcl; export LINUXCNC_TCL_DIR
if [ $# -ne 1 ]; then echo 1>&2 Usage: "$0" inifile; exit 1; fi
exec haltcl -i "$1" /home/gmoccapy/linuxcnc-org/tcl/twopass.tcl

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-requires gladevcp 0.0 --> <!-- interface-requires gladevcp 0.0 -->
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkAdjustment" id="adj_dro_digits"> <object class="GtkAdjustment" id="adj_dro_digits">
<property name="lower">1</property> <property name="lower">1</property>
@ -150,12 +150,6 @@
<object class="GtkFileFilter" id="filefilter1"/> <object class="GtkFileFilter" id="filefilter1"/>
<object class="EMC_Action_Open" id="hal_action_open"/> <object class="EMC_Action_Open" id="hal_action_open"/>
<object class="EMC_Action_Reload" id="hal_action_reload"/> <object class="EMC_Action_Reload" id="hal_action_reload"/>
<object class="EMC_Action_Save" id="hal_action_save">
<property name="textview">gcode_view</property>
</object>
<object class="EMC_Action_SaveAs" id="hal_action_saveas">
<property name="textview">gcode_view</property>
</object>
<object class="EMC_Action_Step" id="hal_action_step"/> <object class="EMC_Action_Step" id="hal_action_step"/>
<object class="EMC_Action_Stop" id="hal_action_stop"/> <object class="EMC_Action_Stop" id="hal_action_stop"/>
<object class="EMC_Stat" id="hal_status"> <object class="EMC_Stat" id="hal_status">
@ -194,6 +188,11 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="icon_name">edit-undo</property> <property name="icon_name">edit-undo</property>
</object> </object>
<object class="GtkImage" id="img_back_ref1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">edit-undo</property>
</object>
<object class="GtkImage" id="img_back_tool"> <object class="GtkImage" id="img_back_tool">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -369,11 +368,26 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="stock">gtk-go-forward</property> <property name="stock">gtk-go-forward</property>
</object> </object>
<object class="GtkImage" id="img_sel_next1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-go-forward</property>
</object>
<object class="GtkImage" id="img_sel_prev"> <object class="GtkImage" id="img_sel_prev">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="stock">gtk-go-back</property> <property name="stock">gtk-go-back</property>
</object> </object>
<object class="GtkImage" id="img_sel_prev1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-go-back</property>
</object>
<object class="GtkImage" id="img_sel_prev2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-go-back</property>
</object>
<object class="GtkImage" id="img_select"> <object class="GtkImage" id="img_select">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -528,6 +542,12 @@
</row> </row>
</data> </data>
</object> </object>
<object class="EMC_Action_Save" id="hal_action_save">
<property name="textview">gcode_view</property>
</object>
<object class="EMC_Action_SaveAs" id="hal_action_saveas">
<property name="textview">gcode_view</property>
</object>
<object class="GtkWindow" id="window1"> <object class="GtkWindow" id="window1">
<property name="width_request">979</property> <property name="width_request">979</property>
<property name="height_request">750</property> <property name="height_request">750</property>
@ -1326,6 +1346,12 @@
<property name="row_spacing">3</property> <property name="row_spacing">3</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<child> <child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkButton" id="btn_y_plus"> <object class="GtkButton" id="btn_y_plus">
<property name="label">Y+</property> <property name="label">Y+</property>
<property name="width_request">50</property> <property name="width_request">50</property>
@ -1519,12 +1545,6 @@
<property name="y_options">GTK_SHRINK</property> <property name="y_options">GTK_SHRINK</property>
</packing> </packing>
</child> </child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object> </object>
</child> </child>
<child type="tab"> <child type="tab">
@ -6437,7 +6457,6 @@ Date</property>
<object class="GtkNotebook" id="ntb_button"> <object class="GtkNotebook" id="ntb_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="show_tabs">False</property>
<property name="show_border">False</property> <property name="show_border">False</property>
<signal name="switch-page" handler="on_ntb_button_switch_page" swapped="no"/> <signal name="switch-page" handler="on_ntb_button_switch_page" swapped="no"/>
<child> <child>
@ -6636,7 +6655,7 @@ F12 or $ key does the same</property>
<object class="GtkLabel" id="lbl_ntb_button_manuel"> <object class="GtkLabel" id="lbl_ntb_button_manuel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label">manuel button list</property> <property name="label">manuel</property>
</object> </object>
<packing> <packing>
<property name="tab_fill">False</property> <property name="tab_fill">False</property>
@ -6709,7 +6728,7 @@ F12 or $ key does the same</property>
<object class="GtkLabel" id="lbl_ntb_button_mdi"> <object class="GtkLabel" id="lbl_ntb_button_mdi">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label">MDI button list</property> <property name="label">MDI</property>
</object> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
@ -6759,6 +6778,7 @@ F12 or $ key does the same</property>
</child> </child>
<child> <child>
<object class="GtkButton" id="btn_stop"> <object class="GtkButton" id="btn_stop">
<property name="related_action">hal_action_stop</property>
<property name="width_request">85</property> <property name="width_request">85</property>
<property name="height_request">56</property> <property name="height_request">56</property>
<property name="visible">True</property> <property name="visible">True</property>
@ -6777,6 +6797,7 @@ F12 or $ key does the same</property>
</child> </child>
<child> <child>
<object class="GtkToggleButton" id="tbtn_pause"> <object class="GtkToggleButton" id="tbtn_pause">
<property name="related_action">hal_tgl_pause</property>
<property name="width_request">85</property> <property name="width_request">85</property>
<property name="height_request">56</property> <property name="height_request">56</property>
<property name="visible">True</property> <property name="visible">True</property>
@ -6804,6 +6825,7 @@ F12 or $ key does the same</property>
</child> </child>
<child> <child>
<object class="GtkButton" id="btn_step"> <object class="GtkButton" id="btn_step">
<property name="related_action">hal_action_step</property>
<property name="width_request">85</property> <property name="width_request">85</property>
<property name="height_request">56</property> <property name="height_request">56</property>
<property name="visible">True</property> <property name="visible">True</property>
@ -6925,7 +6947,7 @@ F12 or $ key does the same</property>
<object class="GtkLabel" id="lbl_ntb_button_auto"> <object class="GtkLabel" id="lbl_ntb_button_auto">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label">Auto button list</property> <property name="label">Auto</property>
</object> </object>
<packing> <packing>
<property name="position">2</property> <property name="position">2</property>
@ -6933,7 +6955,7 @@ F12 or $ key does the same</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkHButtonBox" id="hbtb_ref"> <object class="GtkHButtonBox" id="hbtb_ref_axes">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
@ -7203,7 +7225,7 @@ F12 or $ key does the same</property>
<child type="tab"> <child type="tab">
<object class="GtkLabel" id="lbl_btn_homing"> <object class="GtkLabel" id="lbl_btn_homing">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label">homing button</property> <property name="label">home axes</property>
</object> </object>
<packing> <packing>
<property name="position">3</property> <property name="position">3</property>
@ -7491,7 +7513,7 @@ selected</property>
<object class="GtkLabel" id="lbl_btn_touch_off"> <object class="GtkLabel" id="lbl_btn_touch_off">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label">touch_off button</property> <property name="label">touch_off</property>
</object> </object>
<packing> <packing>
<property name="position">4</property> <property name="position">4</property>
@ -7541,7 +7563,7 @@ selected</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label">&lt;b&gt;gmoccapy <property name="label">&lt;b&gt;gmoccapy
1.0.3&lt;/b&gt;</property> 2.?.??&lt;/b&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</object> </object>
<packing> <packing>
@ -7681,7 +7703,7 @@ selected</property>
<object class="GtkLabel" id="lbl_ntb_button_setup"> <object class="GtkLabel" id="lbl_ntb_button_setup">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label">setup button list</property> <property name="label">setup</property>
</object> </object>
<packing> <packing>
<property name="position">5</property> <property name="position">5</property>
@ -7695,6 +7717,7 @@ selected</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<child> <child>
<object class="GtkButton" id="btn_reload"> <object class="GtkButton" id="btn_reload">
<property name="related_action">hal_action_reload</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
@ -7729,6 +7752,7 @@ selected</property>
</child> </child>
<child> <child>
<object class="GtkButton" id="btn_save"> <object class="GtkButton" id="btn_save">
<property name="related_action">hal_action_save</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
@ -7750,6 +7774,7 @@ selected</property>
</child> </child>
<child> <child>
<object class="GtkButton" id="btn_save_as"> <object class="GtkButton" id="btn_save_as">
<property name="related_action">hal_action_saveas</property>
<property name="width_request">85</property> <property name="width_request">85</property>
<property name="height_request">56</property> <property name="height_request">56</property>
<property name="visible">True</property> <property name="visible">True</property>
@ -7889,7 +7914,7 @@ selected</property>
<object class="GtkLabel" id="lbl_ntb_button_edit"> <object class="GtkLabel" id="lbl_ntb_button_edit">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label">edit buttons</property> <property name="label">edit</property>
</object> </object>
<packing> <packing>
<property name="position">6</property> <property name="position">6</property>
@ -8315,6 +8340,476 @@ selected</property>
<property name="tab_fill">False</property> <property name="tab_fill">False</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkHButtonBox" id="hbtb_ref_joints">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="lbl_space_jall">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_home_j_all">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">home all joints</property>
<property name="tooltip_text" translatable="yes">home all joints</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_btn_home_all_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="img_home_j_all">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/refall.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_space_sel_prev_joints">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_sel_prev_joints">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">Select the previos file</property>
<property name="tooltip_text" translatable="yes">Select the previos file</property>
<property name="use_action_appearance">False</property>
<property name="image">img_sel_prev1</property>
<property name="image_position">top</property>
<signal name="clicked" handler="on_btn_sel_prev_joints_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_home_j0">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">home joint 0</property>
<property name="tooltip_text" translatable="yes">home joint 0</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_btn_home_selected_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="img_home_j0">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/refx.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_space_j1">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_home_j1">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">home joint 1</property>
<property name="tooltip_text" translatable="yes">home joint 1</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_btn_home_selected_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="img_home_j1">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/refy.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_space_j2">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">7</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_home_j2">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">home joint 2</property>
<property name="tooltip_text" translatable="yes">home joint 2</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_btn_home_selected_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="img_home_j2">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/refz.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_space_j3">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">9</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_home_j3">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_markup">home joint 3</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_btn_home_selected_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="img_home_j3">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/refa.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_space_j4">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">11</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_home_j4">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_markup">home joint 4</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_btn_home_selected_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="img_home_j4">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/refb.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">12</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_space_j5">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">13</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_home_j5">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_markup">home joint 5</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_btn_home_selected_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="img_home_j5">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/refb.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">14</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_space_j6">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">15</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_home_j6">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_markup">home joint 6</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_btn_home_selected_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="img_home_j6">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/refb.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">16</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_space_j7">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">17</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_home_j7">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_markup">home joint 7</property>
<property name="use_action_appearance">False</property>
<signal name="clicked" handler="on_btn_home_selected_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="img_home_j7">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/refb.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">18</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lbl_space_sel_next_joints">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">19</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_sel_next_joints">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">Select the next file</property>
<property name="tooltip_text" translatable="yes">Select the next file</property>
<property name="use_action_appearance">False</property>
<property name="image">img_sel_next1</property>
<property name="image_position">top</property>
<signal name="clicked" handler="on_btn_sel_next_joints_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">20</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_unhome_j_all">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">Unhome all axis</property>
<property name="tooltip_text" translatable="yes">Unhome all axis</property>
<property name="use_action_appearance">False</property>
<property name="focus_on_click">False</property>
<child>
<object class="GtkImage" id="img_unhome_j_all">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">images/unhome.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">21</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btn_back_joints">
<property name="width_request">85</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">go back to main button list</property>
<property name="tooltip_text" translatable="yes">go back to main button list</property>
<property name="use_action_appearance">False</property>
<property name="image">img_back_ref1</property>
<signal name="clicked" handler="on_btn_back_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">22</property>
</packing>
</child>
</object>
<packing>
<property name="position">9</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">home joints</property>
</object>
<packing>
<property name="position">9</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

View file

@ -90,6 +90,20 @@ if debug:
_RELEASE = " 2.0.26" _RELEASE = " 2.0.26"
_INCH = 0 # imperial units are active _INCH = 0 # imperial units are active
_MM = 1 # metric units are active _MM = 1 # metric units are active
# set names for the tab numbers, its easier to understand the code
# Bottom Button Tabs
_BB_MANUAL = 0
_BB_MDI = 1
_BB_AUTO = 2
_BB_HOME = 3
_BB_TOUCH_OFF = 4
_BB_SETUP = 5
_BB_EDIT = 6
_BB_TOOL = 7
_BB_LOAD_FILE = 8
#_BB_HOME_JOINTS will not be used, we will reorder the notebooks to get the correct page shown
_TEMPDIR = tempfile.gettempdir() # Now we know where the tempdir is, usualy /tmp _TEMPDIR = tempfile.gettempdir() # Now we know where the tempdir is, usualy /tmp
# set up paths to files # set up paths to files
@ -268,6 +282,7 @@ class gmoccapy(object):
self._init_themes() self._init_themes()
self._init_audio() self._init_audio()
self._init_gremlin() self._init_gremlin()
self._init_hardware_button_order()
self._init_kinematics_type() self._init_kinematics_type()
self._init_hide_cursor() self._init_hide_cursor()
self._init_keyboard() self._init_keyboard()
@ -346,76 +361,6 @@ class gmoccapy(object):
self.widgets.tbtn_edit_offsets.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.color_parse("#FFFF00")) self.widgets.tbtn_edit_offsets.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.color_parse("#FFFF00"))
self.widgets.tbtn_switch_mode.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.color_parse("#FFFF00")) self.widgets.tbtn_switch_mode.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.color_parse("#FFFF00"))
# This is needed only because we connect all the horizontal button
# to hal pins, so the user can connect them to hardware buttons
self.h_tabs = []
tab_main = [(0, "btn_homing"), (1, "btn_touch"), (3, "btn_tool"),
(8, "tbtn_fullsize_preview"), (9, "btn_exit")
]
self.h_tabs.append(tab_main)
tab_mdi = [(9, "btn_show_kbd")]
self.h_tabs.append(tab_mdi)
tab_auto = [(0, "btn_load"), (1, "btn_run"), (2, "btn_stop"), (3, "tbtn_pause"),
(4, "btn_step"), (5, "btn_from_line"), (6, "tbtn_optional_blocks"),
(7, "tbtn_optional_stops"), (8, "tbtn_fullsize_preview1"), (9, "btn_edit")
]
self.h_tabs.append(tab_auto)
tab_ref = [(1, "btn_home_all"), (3, "btn_home_x"),
(5, "btn_home_z"), (8, "btn_unhome_all"), (9, "btn_back_ref")
]
if not self.lathe_mode:
tab_ref.append((4, "btn_home_y"))
if len(self.axis_list) == 4:
tab_ref.append((6, "btn_home_4"))
if len(self.axis_list) == 5:
tab_ref.append((6, "btn_home_4"))
tab_ref.append((7, "btn_home_5"))
self.h_tabs.append(tab_ref)
tab_touch = [(0, "tbtn_edit_offsets"), (1, "btn_set_value_x"), (3, "btn_set_value_z"), (6, "btn_zero_g92"),
(8, "btn_set_selected"), (9, "btn_back_zero")
]
if not self.lathe_mode:
tab_touch.append((2, "btn_set_value_y"))
if len(self.axis_list) == 4:
tab_touch.append((4, "btn_set_value_4"))
if len(self.axis_list) == 5:
tab_touch.append((4, "btn_set_value_4"))
tab_touch.append((5, "btn_set_value_5"))
self.h_tabs.append(tab_touch)
tab_setup = [(0, "btn_delete"), (4, "btn_classicladder"), (5, "btn_hal_scope"), (6, "btn_status"),
(7, "btn_hal_meter"), (8, "btn_calibration"), (9, "btn_show_hal")
]
self.h_tabs.append(tab_setup)
tab_edit = [(0, "btn_open_edit"), (2, "btn_save"), (3, "btn_save_as"), (4, "btn_save_and_run"),
(6, "btn_new"), (8, "btn_keyb"), (9, "btn_back_edit")
]
self.h_tabs.append(tab_edit)
tab_tool = [(0, "btn_delete_tool"), (1, "btn_add_tool"), (2, "btn_reload_tooltable"),
(3, "btn_apply_tool_changes"), (4, "btn_select_tool_by_no"), (5, "btn_index_tool"),
(6, "btn_change_tool"), (8, "btn_tool_touchoff_z"), (9, "btn_back_tool")
]
if self.lathe_mode:
tab_tool.append((7, "btn_tool_touchoff_x"))
self.h_tabs.append(tab_tool)
tab_file = [(0, "btn_home"), (1, "btn_dir_up"), (3, "btn_sel_prev"), (4, "btn_sel_next"),
(5, "btn_jump_to"), (7, "btn_select"), (9, "btn_back_file_load")
]
self.h_tabs.append(tab_file)
self.v_tabs = [(0, "tbtn_estop"), (1, "tbtn_on"), (2, "rbt_manual"), (3, "rbt_mdi"),
(4, "rbt_auto"), (5, "tbtn_setup"), (6, "tbtn_user_tabs")
]
# tool measurement probe settings # tool measurement probe settings
xpos, ypos, zpos, maxprobe = self.get_ini_info.get_tool_sensor_data() xpos, ypos, zpos, maxprobe = self.get_ini_info.get_tool_sensor_data()
if not xpos or not ypos or not zpos or not maxprobe: if not xpos or not ypos or not zpos or not maxprobe:
@ -873,6 +818,35 @@ class gmoccapy(object):
self.widgets["btn_j%s_minus"%joint].hide() self.widgets["btn_j%s_minus"%joint].hide()
self.widgets["btn_j%s_plus"%joint].hide() self.widgets["btn_j%s_plus"%joint].hide()
# This can be done better!!!!
# by putting the labeld on the fly and not within the glade file
#if num_macros < 9:
# for label_space in range(num_macros, 9):
# lbl = "lbl_sp_%s" % label_space
# lbl = gtk.Label(lbl)
# lbl.position = label_space
# lbl.set_text("")
# self.widgets.hbtb_MDI.pack_start(lbl, True, True, 0)
# lbl.show()
#self.widgets.hbtb_MDI.non_homogeneous = False
# and now the joint homing button
# but only 6 joints are shown, so we leave here
if joint == 7:
continue
self.widgets["btn_home_j%s"%joint].hide()
self.widgets["lbl_space_j%s"%joint].show()
if joints_count < 7:
self.widgets.btn_sel_prev_joints.hide()
self.widgets.btn_sel_next_joints.hide()
self.widgets.lbl_space_j7.hide()
if joints_count < 6:
self.widgets.lbl_space_jall.show()
self.widgets.lbl_space_j6.hide()
self.widgets.lbl_space_sel_prev_joints.show()
self.widgets.lbl_space_j5.hide()
# if there are less joints, the above done should work correct
def _init_jog_increments(self): def _init_jog_increments(self):
# Now we will build the option buttons to select the Jog-rates # Now we will build the option buttons to select the Jog-rates
# We do this dynamically, because users are able to set them in INI File # We do this dynamically, because users are able to set them in INI File
@ -1128,6 +1102,84 @@ class gmoccapy(object):
kinstype = self.get_ini_info.get_kinstype()) kinstype = self.get_ini_info.get_kinstype())
self.widgets.eb_program_label.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0, 0, 0)) self.widgets.eb_program_label.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0, 0, 0))
# init the preview
def _init_hardware_button_order( self ):
# This is needed only because we connect all the horizontal button
# to hal pins, so the user can connect them to hardware buttons
self.h_tabs = []
tab_main = [(0, "btn_homing"), (1, "btn_touch"), (3, "btn_tool"),
(8, "tbtn_fullsize_preview"), (9, "btn_exit")
]
self.h_tabs.append(tab_main)
tab_mdi = [(9, "btn_show_kbd")]
self.h_tabs.append(tab_mdi)
tab_auto = [(0, "btn_load"), (1, "btn_run"), (2, "btn_stop"), (3, "tbtn_pause"),
(4, "btn_step"), (5, "btn_from_line"), (6, "tbtn_optional_blocks"),
(7, "tbtn_optional_stops"), (8, "tbtn_fullsize_preview1"), (9, "btn_edit")
]
self.h_tabs.append(tab_auto)
tab_ref = [(1, "btn_home_all"), (3, "btn_home_x"),
(5, "btn_home_z"), (8, "btn_unhome_all"), (9, "btn_back_ref")
]
if not self.lathe_mode:
tab_ref.append((4, "btn_home_y"))
if len(self.axis_list) == 4:
tab_ref.append((6, "btn_home_4"))
if len(self.axis_list) == 5:
tab_ref.append((6, "btn_home_4"))
tab_ref.append((7, "btn_home_5"))
self.h_tabs.append(tab_ref)
tab_touch = [(0, "tbtn_edit_offsets"), (1, "btn_set_value_x"), (3, "btn_set_value_z"), (6, "btn_zero_g92"),
(8, "btn_set_selected"), (9, "btn_back_zero")
]
if not self.lathe_mode:
tab_touch.append((2, "btn_set_value_y"))
if len(self.axis_list) == 4:
tab_touch.append((4, "btn_set_value_4"))
if len(self.axis_list) == 5:
tab_touch.append((4, "btn_set_value_4"))
tab_touch.append((5, "btn_set_value_5"))
self.h_tabs.append(tab_touch)
tab_setup = [(0, "btn_delete"), (4, "btn_classicladder"), (5, "btn_hal_scope"), (6, "btn_status"),
(7, "btn_hal_meter"), (8, "btn_calibration"), (9, "btn_show_hal")
]
self.h_tabs.append(tab_setup)
tab_edit = [(0, "btn_open_edit"), (2, "btn_save"), (3, "btn_save_as"), (4, "btn_save_and_run"),
(6, "btn_new"), (8, "btn_keyb"), (9, "btn_back_edit")
]
self.h_tabs.append(tab_edit)
tab_tool = [(0, "btn_delete_tool"), (1, "btn_add_tool"), (2, "btn_reload_tooltable"),
(3, "btn_apply_tool_changes"), (4, "btn_select_tool_by_no"), (5, "btn_index_tool"),
(6, "btn_change_tool"), (8, "btn_tool_touchoff_z"), (9, "btn_back_tool")
]
if self.lathe_mode:
tab_tool.append((7, "btn_tool_touchoff_x"))
self.h_tabs.append(tab_tool)
tab_file = [(0, "btn_home"), (1, "btn_dir_up"), (3, "btn_sel_prev"), (4, "btn_sel_next"),
(5, "btn_jump_to"), (7, "btn_select"), (9, "btn_back_file_load")
]
self.h_tabs.append(tab_file)
tab_ref_joints = [(0, "btn_home_j_all"), (1, "btn_home_j0"), (2, "btn_home_j1"), (3, "btn_home_j2"), (4, "btn_home_j3"),
(5, "btn_home_j4"), (6, "btn_home_j5"), (7, "btn_sel_next_joints"), (8, "btn_unhome_j_all"), (9, "btn_back_joints")
]
self.h_tabs.append(tab_ref_joints)
self.v_tabs = [(0, "tbtn_estop"), (1, "tbtn_on"), (2, "rbt_manual"), (3, "rbt_mdi"),
(4, "rbt_auto"), (5, "tbtn_setup"), (6, "tbtn_user_tabs")
]
def _init_kinematics_type (self): def _init_kinematics_type (self):
if self.stat.kinematics_type != linuxcnc.KINEMATICS_IDENTITY: if self.stat.kinematics_type != linuxcnc.KINEMATICS_IDENTITY:
self.widgets.gremlin.set_property( "enable_dro", True ) self.widgets.gremlin.set_property( "enable_dro", True )
@ -1138,6 +1190,12 @@ class gmoccapy(object):
self.widgets.tbtn_switch_mode.set_active(True) self.widgets.tbtn_switch_mode.set_active(True)
self.widgets.lbl_replace_mode_btn.hide() self.widgets.lbl_replace_mode_btn.hide()
self.widgets.ntb_jog_JA.set_page(1) self.widgets.ntb_jog_JA.set_page(1)
self.h_tabs[_BB_MANUAL].append((6, "btn_tool"))
page9 = self.widgets.ntb_button.get_nth_page(9)
self.widgets.ntb_button.reorder_child(page9, _BB_HOME)
page4 = self.widgets.ntb_button.get_nth_page(4)
self.widgets.ntb_button.reorder_child(page4, -1)
self._reset_joint_button_order_to_default()
else: else:
self.widgets.gremlin.set_property( "enable_dro", False ) self.widgets.gremlin.set_property( "enable_dro", False )
self.widgets.gremlin.use_joints_mode = False self.widgets.gremlin.use_joints_mode = False
@ -1559,7 +1617,7 @@ class gmoccapy(object):
def on_hal_status_all_homed(self, widget): def on_hal_status_all_homed(self, widget):
print("all joints homed") print("all joints homed")
self.all_homed = True self.all_homed = True
self.widgets.ntb_button.set_current_page(0) self.widgets.ntb_button.set_current_page(_BB_MANUAL)
widgetlist = ["rbt_mdi", "rbt_auto", "btn_index_tool", "btn_change_tool", "btn_select_tool_by_no", widgetlist = ["rbt_mdi", "rbt_auto", "btn_index_tool", "btn_change_tool", "btn_select_tool_by_no",
"btn_tool_touchoff_x", "btn_tool_touchoff_z", "btn_touch", "tbtn_switch_mode" "btn_tool_touchoff_x", "btn_tool_touchoff_z", "btn_touch", "tbtn_switch_mode"
] ]
@ -1659,6 +1717,7 @@ class gmoccapy(object):
self._update_toolinfo(new_tool_no) self._update_toolinfo(new_tool_no)
def on_hal_status_state_estop(self, widget=None): def on_hal_status_state_estop(self, widget=None):
print("EStop")
self.widgets.tbtn_estop.set_active(True) self.widgets.tbtn_estop.set_active(True)
self.widgets.tbtn_estop.set_image(self.widgets.img_emergency) self.widgets.tbtn_estop.set_image(self.widgets.img_emergency)
self.widgets.tbtn_on.set_image(self.widgets.img_machine_on) self.widgets.tbtn_on.set_image(self.widgets.img_machine_on)
@ -1668,6 +1727,7 @@ class gmoccapy(object):
self.command.mode(linuxcnc.MODE_MANUAL) self.command.mode(linuxcnc.MODE_MANUAL)
def on_hal_status_state_estop_reset(self, widget=None): def on_hal_status_state_estop_reset(self, widget=None):
print("EStop reset")
self.widgets.tbtn_estop.set_active(False) self.widgets.tbtn_estop.set_active(False)
self.widgets.tbtn_estop.set_image(self.widgets.img_emergency_off) self.widgets.tbtn_estop.set_image(self.widgets.img_emergency_off)
self.widgets.tbtn_on.set_image(self.widgets.img_machine_off) self.widgets.tbtn_on.set_image(self.widgets.img_machine_off)
@ -1680,6 +1740,7 @@ class gmoccapy(object):
self._check_limits() self._check_limits()
def on_hal_status_state_off(self, widget): def on_hal_status_state_off(self, widget):
print("OFF")
widgetlist = ["rbt_manual", "rbt_mdi", "rbt_auto", "btn_homing", "btn_touch", "btn_tool", widgetlist = ["rbt_manual", "rbt_mdi", "rbt_auto", "btn_homing", "btn_touch", "btn_tool",
"hbox_jog_vel", "ntb_jog_JA", "vbtb_jog_incr", "spc_feed", "btn_feed_100", "rbt_forward", "btn_index_tool", "hbox_jog_vel", "ntb_jog_JA", "vbtb_jog_incr", "spc_feed", "btn_feed_100", "rbt_forward", "btn_index_tool",
"rbt_reverse", "rbt_stop", "tbtn_flood", "tbtn_mist", "btn_change_tool", "btn_select_tool_by_no", "rbt_reverse", "rbt_stop", "tbtn_flood", "tbtn_mist", "btn_change_tool", "btn_select_tool_by_no",
@ -1693,11 +1754,12 @@ class gmoccapy(object):
self.widgets.btn_exit.set_sensitive(True) self.widgets.btn_exit.set_sensitive(True)
self.widgets.chk_ignore_limits.set_sensitive(True) self.widgets.chk_ignore_limits.set_sensitive(True)
self.widgets.ntb_main.set_current_page(0) self.widgets.ntb_main.set_current_page(0)
self.widgets.ntb_button.set_current_page(0) self.widgets.ntb_button.set_current_page(_BB_MANUAL)
self.widgets.ntb_info.set_current_page(0) self.widgets.ntb_info.set_current_page(0)
self.widgets.ntb_jog.set_current_page(0) self.widgets.ntb_jog.set_current_page(0)
def on_hal_status_state_on(self, widget): def on_hal_status_state_on(self, widget):
print("ON")
widgetlist = ["rbt_manual", "btn_homing", "btn_touch", "btn_tool", widgetlist = ["rbt_manual", "btn_homing", "btn_touch", "btn_tool",
"ntb_jog", "spc_feed", "btn_feed_100", "rbt_forward", "ntb_jog", "spc_feed", "btn_feed_100", "rbt_forward",
"rbt_reverse", "rbt_stop", "tbtn_flood", "tbtn_mist", "rbt_reverse", "rbt_stop", "tbtn_flood", "tbtn_mist",
@ -1714,6 +1776,7 @@ class gmoccapy(object):
self.command.wait_complete() self.command.wait_complete()
def on_hal_status_mode_manual(self, widget): def on_hal_status_mode_manual(self, widget):
print("MANUAL")
self.widgets.rbt_manual.set_active(True) self.widgets.rbt_manual.set_active(True)
# if setup page is activated, we must leave here, otherwise the pages will be reset # if setup page is activated, we must leave here, otherwise the pages will be reset
if self.widgets.tbtn_setup.get_active(): if self.widgets.tbtn_setup.get_active():
@ -1722,18 +1785,19 @@ class gmoccapy(object):
if self.widgets.tbtn_user_tabs.get_active(): if self.widgets.tbtn_user_tabs.get_active():
self.widgets.tbtn_user_tabs.set_active(False) self.widgets.tbtn_user_tabs.set_active(False)
self.widgets.ntb_main.set_current_page(0) self.widgets.ntb_main.set_current_page(0)
self.widgets.ntb_button.set_current_page(0) self.widgets.ntb_button.set_current_page(_BB_MANUAL)
self.widgets.ntb_info.set_current_page(0) self.widgets.ntb_info.set_current_page(0)
self.widgets.ntb_jog.set_current_page(0) self.widgets.ntb_jog.set_current_page(0)
self._check_limits() self._check_limits()
def on_hal_status_mode_mdi(self, widget): def on_hal_status_mode_mdi(self, widget):
print("MDI")
# self.tool_change is set only if the tool change was commanded # self.tool_change is set only if the tool change was commanded
# from tooledit widget/page, so we do not want to switch the # from tooledit widget/page, so we do not want to switch the
# screen layout to MDI, but set the manual widgets # screen layout to MDI, but set the manual widgets
if self.tool_change: if self.tool_change:
self.widgets.ntb_main.set_current_page(0) self.widgets.ntb_main.set_current_page(0)
self.widgets.ntb_button.set_current_page(0) self.widgets.ntb_button.set_current_page(_BB_MANUAL)
self.widgets.ntb_info.set_current_page(0) self.widgets.ntb_info.set_current_page(0)
self.widgets.ntb_jog.set_current_page(0) self.widgets.ntb_jog.set_current_page(0)
return return
@ -1755,12 +1819,13 @@ class gmoccapy(object):
else: else:
self.widgets.ntb_info.set_current_page(0) self.widgets.ntb_info.set_current_page(0)
self.widgets.ntb_main.set_current_page(0) self.widgets.ntb_main.set_current_page(0)
self.widgets.ntb_button.set_current_page(1) self.widgets.ntb_button.set_current_page(_BB_MDI)
self.widgets.ntb_jog.set_current_page(1) self.widgets.ntb_jog.set_current_page(1)
self.widgets.hal_mdihistory.entry.grab_focus() self.widgets.hal_mdihistory.entry.grab_focus()
self.widgets.rbt_mdi.set_active(True) self.widgets.rbt_mdi.set_active(True)
def on_hal_status_mode_auto(self, widget): def on_hal_status_mode_auto(self, widget):
print("AUTO")
# if Auto button is not sensitive, we are not ready for AUTO commands # if Auto button is not sensitive, we are not ready for AUTO commands
# so we have to abort external commands and get back to manual mode # so we have to abort external commands and get back to manual mode
# This will happen mostly, if we are in settings mode, as we do disable the mode button # This will happen mostly, if we are in settings mode, as we do disable the mode button
@ -1775,7 +1840,7 @@ class gmoccapy(object):
if self.widgets.tbtn_user_tabs.get_active(): if self.widgets.tbtn_user_tabs.get_active():
self.widgets.tbtn_user_tabs.set_active(False) self.widgets.tbtn_user_tabs.set_active(False)
self.widgets.ntb_main.set_current_page(0) self.widgets.ntb_main.set_current_page(0)
self.widgets.ntb_button.set_current_page(2) self.widgets.ntb_button.set_current_page(_BB_AUTO)
self.widgets.ntb_info.set_current_page(0) self.widgets.ntb_info.set_current_page(0)
self.widgets.ntb_jog.set_current_page(2) self.widgets.ntb_jog.set_current_page(2)
self.widgets.rbt_auto.set_active(True) self.widgets.rbt_auto.set_active(True)
@ -1789,6 +1854,7 @@ class gmoccapy(object):
# so in mode 1 we have to show Joints and in Modes 2 and 3 axis values # so in mode 1 we have to show Joints and in Modes 2 and 3 axis values
widgetlist = ("rbt_mdi", "rbt_auto") widgetlist = ("rbt_mdi", "rbt_auto")
print("ON / OFF = ", self.stat.task_state != linuxcnc.STATE_ON)
if new_mode == 1 and self.stat.kinematics_type != linuxcnc.KINEMATICS_IDENTITY: if new_mode == 1 and self.stat.kinematics_type != linuxcnc.KINEMATICS_IDENTITY:
self.widgets.gremlin.set_property("enable_dro", True) self.widgets.gremlin.set_property("enable_dro", True)
self.widgets.gremlin.use_joints_mode = True self.widgets.gremlin.use_joints_mode = True
@ -1802,6 +1868,8 @@ class gmoccapy(object):
self.widgets.tbtn_switch_mode.set_active(False) self.widgets.tbtn_switch_mode.set_active(False)
self.widgets.ntb_jog_JA.set_page(0) self.widgets.ntb_jog_JA.set_page(0)
state = True state = True
if self.stat.task_state != linuxcnc.STATE_ON:
state = False
self._sensitize_widgets(widgetlist, state) self._sensitize_widgets(widgetlist, state)
# hal status End # hal status End
@ -1977,10 +2045,10 @@ class gmoccapy(object):
# No mode switch to joints on Identity kinematics # No mode switch to joints on Identity kinematics
if self.stat.kinematics_type != linuxcnc.KINEMATICS_IDENTITY: if self.stat.kinematics_type != linuxcnc.KINEMATICS_IDENTITY:
# Mode 1 = joint ; Mode 3 = teleop # Mode 1 = joint ; Mode 3 = teleop
if self.stat.motion_mode == 3: if self.stat.motion_mode != 1:
self.set_motion_mode(0) # set joint mode self.set_motion_mode(0) # set joint mode
else: else:
self.set_motion_mode(1) # set t mode self.set_motion_mode(1) # set teleop mode
return True return True
# This will avoid executing the key press event several times caused by keyboard auto repeat # This will avoid executing the key press event several times caused by keyboard auto repeat
@ -2843,7 +2911,7 @@ class gmoccapy(object):
if code: if code:
self.widgets.ntb_main.set_current_page(1) self.widgets.ntb_main.set_current_page(1)
self.widgets.ntb_setup.set_current_page(0) self.widgets.ntb_setup.set_current_page(0)
self.widgets.ntb_button.set_current_page(5) self.widgets.ntb_button.set_current_page(_BB_SETUP)
else: else:
if self.widgets.rbt_hal_unlock.get_active(): if self.widgets.rbt_hal_unlock.get_active():
message = _("Hal Pin is low, Access denied") message = _("Hal Pin is low, Access denied")
@ -2871,7 +2939,7 @@ class gmoccapy(object):
# this is needed here, because we do not # this is needed here, because we do not
# change mode, so on_hal_status_manual will not be called # change mode, so on_hal_status_manual will not be called
self.widgets.ntb_main.set_current_page(0) self.widgets.ntb_main.set_current_page(0)
self.widgets.ntb_button.set_current_page(0) self.widgets.ntb_button.set_current_page(_BB_MANUAL)
self.widgets.ntb_info.set_current_page(0) self.widgets.ntb_info.set_current_page(0)
self.widgets.ntb_jog.set_current_page(0) self.widgets.ntb_jog.set_current_page(0)
# if we are in user tabs, we must reset the button # if we are in user tabs, we must reset the button
@ -2890,10 +2958,10 @@ class gmoccapy(object):
# ========================================================= # =========================================================
# The homing functions # The homing functions
def on_btn_homing_clicked(self, widget, data=None): def on_btn_homing_clicked(self, widget, data=None):
self.widgets.ntb_button.set_current_page(3) self.widgets.ntb_button.set_current_page(_BB_HOME)
def on_btn_home_all_clicked(self, widget, data=None): def on_btn_home_all_clicked(self, widget, data=None):
if self.stat.motion_mode == 3: if self.stat.motion_mode != 1:
self.set_motion_mode(0) self.set_motion_mode(0)
# home -1 means all # home -1 means all
self.command.home(-1) self.command.home(-1)
@ -2923,6 +2991,41 @@ class gmoccapy(object):
return return
self.command.home(axis) self.command.home(axis)
def on_btn_sel_next_joints_clicked(self, widget, data=None):
widget.hide()
for item in range(0, 3):
self.widgets["btn_home_j%s"%item].hide()
for item in range(5, 8):
self.widgets["btn_home_j%s"%item].show()
self.widgets.btn_sel_prev_joints.show()
#reorder the hardware button handling list
self._replace_list_item(9, "btn_home_j0", "btn_sel_prev_joints")
self._replace_list_item(9, "btn_home_j5", "btn_sel_next_joints")
self._replace_list_item(9, "btn_home_j4", "btn_home_j6")
self._replace_list_item(9, "btn_home_j3", "btn_home_j5")
self._replace_list_item(9, "btn_home_j2", "btn_home_j4")
self._replace_list_item(9, "btn_home_j1", "btn_home_j3")
def on_btn_sel_prev_joints_clicked(self, widget, data=None):
widget.hide()
for item in range(0,3):
self.widgets["btn_home_j%s"%item].show()
for item in range(5,8):
self.widgets["btn_home_j%s"%item].hide()
self.widgets.btn_sel_next_joints.show()
self._reset_joint_button_order_to_default()
def _reset_joint_button_order_to_default(self):
if self.stat.joints < 6:
return
self.h_tabs[_BB_HOME] = [(0, "btn_home_j_all"), (1, "btn_home_j0"), (2, "btn_home_j1"), (3, "btn_home_j2"), (4, "btn_home_j3"),
(5, "btn_home_j4"), (6, "btn_home_j5"), (7, "btn_sel_next_joints"), (8, "btn_unhome_j_all"), (9, "btn_back_joints")
]
# The homing functions
# =========================================================
def _check_limits(self): def _check_limits(self):
for axis in self.axis_list: for axis in self.axis_list:
axisnumber = "xyzabcuvw".index(axis) axisnumber = "xyzabcuvw".index(axis)
@ -3213,7 +3316,7 @@ class gmoccapy(object):
else: else:
self.widgets.ntb_info.set_current_page(1) self.widgets.ntb_info.set_current_page(1)
# special case if we are in edit mode # special case if we are in edit mode
if self.widgets.ntb_button.get_current_page() == 6: if self.widgets.ntb_button.get_current_page() == _BB_EDIT:
if self.widgets.ntb_info.get_visible(): if self.widgets.ntb_info.get_visible():
self.widgets.box_info.set_size_request(-1, 50) self.widgets.box_info.set_size_request(-1, 50)
self.widgets.ntb_info.hide() self.widgets.ntb_info.hide()
@ -3230,20 +3333,20 @@ class gmoccapy(object):
# Three back buttons to be able to leave notebook pages # Three back buttons to be able to leave notebook pages
# All use the same callback offset # All use the same callback offset
def on_btn_back_clicked(self, widget, data=None): def on_btn_back_clicked(self, widget, data=None):
if self.widgets.ntb_button.get_current_page() == 6: # edit mode, go back to auto_buttons if self.widgets.ntb_button.get_current_page() == _BB_EDIT: # edit mode, go back to auto_buttons
self.widgets.ntb_button.set_current_page(2) self.widgets.ntb_button.set_current_page(_BB_AUTO)
if self.widgets.tbtn_fullsize_preview1.get_active(): if self.widgets.tbtn_fullsize_preview1.get_active():
self.widgets.vbx_jog.set_visible(False) self.widgets.vbx_jog.set_visible(False)
elif self.widgets.ntb_button.get_current_page() == 8: # File selection mode elif self.widgets.ntb_button.get_current_page() == _BB_LOAD_FILE: # File selection mode
self.widgets.ntb_button.set_current_page(2) self.widgets.ntb_button.set_current_page(_BB_AUTO)
else: # else we go to main button on manual else: # else we go to main button on manual
self.widgets.ntb_button.set_current_page(0) self.widgets.ntb_button.set_current_page(_BB_MANUAL)
self.widgets.ntb_main.set_current_page(0) self.widgets.ntb_main.set_current_page(0)
self.widgets.ntb_preview.set_current_page(0) self.widgets.ntb_preview.set_current_page(0)
# The offset settings, set to zero # The offset settings, set to zero
def on_btn_touch_clicked(self, widget, data=None): def on_btn_touch_clicked(self, widget, data=None):
self.widgets.ntb_button.set_current_page(4) self.widgets.ntb_button.set_current_page(_BB_TOUCH_OFF)
self._show_offset_tab(True) self._show_offset_tab(True)
if self.widgets.rbtn_show_preview.get_active(): if self.widgets.rbtn_show_preview.get_active():
self.widgets.ntb_preview.set_current_page(0) self.widgets.ntb_preview.set_current_page(0)
@ -3629,7 +3732,7 @@ class gmoccapy(object):
def on_btn_tool_clicked(self, widget, data=None): def on_btn_tool_clicked(self, widget, data=None):
if self.widgets.tbtn_fullsize_preview.get_active(): if self.widgets.tbtn_fullsize_preview.get_active():
self.widgets.tbtn_fullsize_preview.set_active(False) self.widgets.tbtn_fullsize_preview.set_active(False)
self.widgets.ntb_button.set_current_page(7) self.widgets.ntb_button.set_current_page(_BB_TOOL)
self._show_tooledit_tab(True) self._show_tooledit_tab(True)
# Here we create a manual tool change dialog # Here we create a manual tool change dialog
@ -3822,7 +3925,7 @@ class gmoccapy(object):
self.widgets.gcode_view.set_line_number(line) self.widgets.gcode_view.set_line_number(line)
def on_btn_load_clicked(self, widget, data=None): def on_btn_load_clicked(self, widget, data=None):
self.widgets.ntb_button.set_current_page(8) self.widgets.ntb_button.set_current_page(_BB_LOAD_FILE)
self.widgets.ntb_preview.set_current_page(3) self.widgets.ntb_preview.set_current_page(3)
self.widgets.tbtn_fullsize_preview.set_active(True) self.widgets.tbtn_fullsize_preview.set_active(True)
self._show_iconview_tab(True) self._show_iconview_tab(True)
@ -3853,7 +3956,7 @@ class gmoccapy(object):
self.widgets.hal_action_open.load_file(path) self.widgets.hal_action_open.load_file(path)
self.widgets.ntb_preview.set_current_page(0) self.widgets.ntb_preview.set_current_page(0)
self.widgets.tbtn_fullsize_preview.set_active(False) self.widgets.tbtn_fullsize_preview.set_active(False)
self.widgets.ntb_button.set_current_page(2) self.widgets.ntb_button.set_current_page(_BB_AUTO)
self._show_iconview_tab(False) self._show_iconview_tab(False)
def on_IconFileSelection1_sensitive(self, widget, buttonname, state): def on_IconFileSelection1_sensitive(self, widget, buttonname, state):
@ -3866,7 +3969,7 @@ class gmoccapy(object):
# edit a program or make a new one # edit a program or make a new one
def on_btn_edit_clicked(self, widget, data=None): def on_btn_edit_clicked(self, widget, data=None):
self.widgets.ntb_button.set_current_page(6) self.widgets.ntb_button.set_current_page(_BB_EDIT)
self.widgets.ntb_preview.hide() self.widgets.ntb_preview.hide()
self.widgets.hbox_dro.hide() self.widgets.hbox_dro.hide()
width = self.widgets.window1.allocation.width width = self.widgets.window1.allocation.width
@ -3932,7 +4035,7 @@ class gmoccapy(object):
if self.widgets.tbtn_fullsize_preview.get_active(): if self.widgets.tbtn_fullsize_preview.get_active():
self.widgets.tbtn_fullsize_preview.set_active(False) self.widgets.tbtn_fullsize_preview.set_active(False)
if self.widgets.ntb_button.get_current_page() == 6 or self.widgets.ntb_preview.get_current_page() == 3: if self.widgets.ntb_button.get_current_page() == _BB_EDIT or self.widgets.ntb_preview.get_current_page() == _BB_HOME:
self.widgets.ntb_preview.show() self.widgets.ntb_preview.show()
self.widgets.hbox_dro.show() self.widgets.hbox_dro.show()
self.widgets.vbx_jog.set_size_request(360, -1) self.widgets.vbx_jog.set_size_request(360, -1)
@ -4244,10 +4347,11 @@ class gmoccapy(object):
if button: if button:
# only emit a signal if the button is sensitive, otherwise # only emit a signal if the button is sensitive, otherwise
# running actions may be interrupted # running actions may be interrupted
if self.widgets[button].get_sensitive() == False: if not self.widgets[button].get_sensitive():
print("%s not_sensitive" % button) print("%s not_sensitive" % button)
return return
self.widgets[button].emit("clicked") self.widgets[button].emit("clicked")
print("Button %s has been clicked"%button)
else: else:
# as we are generating the macro buttons dynamically, we can"t use the same # as we are generating the macro buttons dynamically, we can"t use the same
# method as above, here is how we do it # method as above, here is how we do it
@ -4256,7 +4360,7 @@ class gmoccapy(object):
if nr < len(self.macrobuttons): if nr < len(self.macrobuttons):
button = self.macrobuttons[nr] # This list is generated in add_macros_buttons(self) button = self.macrobuttons[nr] # This list is generated in add_macros_buttons(self)
# is the button sensitive? # is the button sensitive?
if button.get_sensitive() == False: if not button.get_sensitive():
print("%s not_sensitive" % button) print("%s not_sensitive" % button)
return return
button.emit("pressed") button.emit("pressed")