--- On Mon, 8/23/10, Alfred Smart <[email protected]> wrote:

From: Alfred Smart <[email protected]>
Subject: patch for tkemc.tcl to try
To: [email protected]
Date: Monday, August 23, 2010, 4:00 AM

 you have to use  COORDINATES   = X Y Z 0 0 0 0 0 W  in the ini file.
and it will make tkemc.tcl display only the axis you want I also made it so it 
will use the ini to display the MACHINE = yours










      


      
From 8bb55c58eb6946cf2c11555a6595d4e39f801371 Mon Sep 17 00:00:00 2001
From: Al Smart <[email protected]>
Date: Sun, 22 Aug 2010 21:30:17 -0400
Subject: [PATCH 1/1] make tkemc show only axis needed & display Machine from ini

diff --git a/tkemc.tcl b/tkemc1.tcl
index d814af1..65c7b4a 100755
--- a/tkemc.tcl
+++ b/tkemc1.tcl
@@ -81,59 +81,57 @@ set worldlabellist ""
 set axiscoordmap ""
 set numaxes [emc_ini "AXES" "TRAJ"]
 set coordnames [ emc_ini "COORDINATES" "TRAJ"]
-
 set numcoords 0
 
-if { [ string first "X" $coordnames ] >= 0 } {
+if { [ string first "X" $coordnames ] >= 0 | [ string first " " $coordnames ] >= 0 } {
     set numcoords $numcoords+1
     set worldlabellist [ concat $worldlabellist X]
     set axiscoordmap [ concat $axiscoordmap 0  ]
 }
 
-if { [ string first "Y" $coordnames ] >= 0 } {
+if { [ string first "Y" $coordnames ] >= 0 | [ string first " " $coordnames ] >= 0  } {
     set numcoords $numcoords+1
     set worldlabellist [ concat $worldlabellist Y]
     set axiscoordmap [ concat $axiscoordmap  1 ]
 }
 
-if { [ string first "Z" $coordnames ] >= 0 } {
+if { [ string first "Z" $coordnames ] >= 0 | [ string first " " $coordnames ] >= 0  } {
     set numcoords $numcoords+1
     set worldlabellist [ concat $worldlabellist Z]
     set axiscoordmap [ concat $axiscoordmap  2 ]
 }
 
-
-if { [ string first "A" $coordnames ] >= 0 } {
+if { [ string first "A" $coordnames ] >= 0 | [ string first " " $coordnames ] >= 0  } {
     set numcoords $numcoords+1
     set worldlabellist [ concat $worldlabellist A]
     set axiscoordmap [ concat $axiscoordmap  3 ]
 }
 
-if { [ string first "B" $coordnames ] >= 0 } {
+if { [ string first "B" $coordnames ] >= 0 | [ string first " " $coordnames ] >= 0  } {
     set numcoords $numcoords+1
     set worldlabellist [ concat $worldlabellist B]
     set axiscoordmap [ concat $axiscoordmap  4 ]
 }
 
-if { [ string first "C" $coordnames ] >= 0 } {
+if { [ string first "C" $coordnames ] >= 0 | [ string first " " $coordnames ] >= 0  } {
     set numcoords $numcoords+1
     set worldlabellist [ concat $worldlabellist C]
     set axiscoordmap [ concat $axiscoordmap  5 ]
 }
 
-if { [ string first "U" $coordnames ] >= 0 } {
+if { [ string first "U" $coordnames ] >= 0 | [ string first " " $coordnames ] >= 0  } {
     set numcoords $numcoords+1
     set worldlabellist [ concat $worldlabellist U]
     set axiscoordmap [ concat $axiscoordmap  6 ]
 }
 
-if { [ string first "V" $coordnames ] >= 0 } {
+if { [ string first "V" $coordnames ] >= 0 | [ string first " " $coordnames ] >= 0  } {
     set numcoords $numcoords+1
     set worldlabellist [ concat $worldlabellist V]
     set axiscoordmap [ concat $axiscoordmap  7 ]
 }
 
-if { [ string first "W" $coordnames ] >= 0 } {
+if { [ string first "W" $coordnames ] >= 0 | [ string first " " $coordnames ] >= 0  } {
     set numcoords $numcoords+1
     set worldlabellist [ concat $worldlabellist W]
     set axiscoordmap [ concat $axiscoordmap  8 ]
@@ -243,23 +241,6 @@ if {[string length $toolfilename] == 0} {
     set toolfilename "emc.tbl"
 }
 
-# pop up the tool table editor
-proc popupToolEditor {} {
-    global toolfilename
-
-    # create an editor as top-level ".toolEditor"
-    if {[file isfile $toolfilename]} {
-        geneditStart toolEditor $toolfilename
-    } else {
-        geneditStart toolEditor [msgcat::mc "untitled"].tbl
-    }
-
-    frame .toolEditor.buttons
-    pack .toolEditor.buttons -side bottom -fill x -pady 2m
-    button .toolEditor.buttons.load -text [msgcat::mc "Load Tool Table"] -command {geneditSaveFile toolEditor; emc_load_tool
-    button .toolEditor.buttons.cancel -text [msgcat::mc "Cancel"] -default active -command {destroy .toolEditor}
-    pack .toolEditor.buttons.load .toolEditor.buttons.cancel -side left -expand 1
-}
 
 set paramfilename [emc_ini "PARAMETER_FILE" "RS274NGC"]
 if {[string length $paramfilename] == 0} {
@@ -758,7 +739,8 @@ proc toggleOptionalStop {} {
 
 
 # use the top-level window as our top-level window, and name it
-wm title . "TkEMC"
+set title [emc_ini "MACHINE" "EMC"]
+ wm title . $title
 
 # create the main window top frame
 set top [frame .top]
@@ -1080,33 +1062,41 @@ set relabssel [frame $coordsel.relabssel]
 set actcmdsel [frame $coordsel.actcmdsel]
 set jog [frame $bun.jog]
 set dojog [frame $jog.dojog]
-
+set axiscount 1
 pack $move -side top -fill both -expand true
 pack $position -side left
 pack $pos0 -side top
-if { $numaxes > 1 } {
+if { $numaxes > 1 && [ string first "Y" $coordnames ] >= 0 } {
     pack $pos1 -side top
+set axisnum $axiscount+1
 }
-if { $numaxes > 2 } {
+if { $numaxes > 2 && [ string first "Z" $coordnames ] >= 0  } {
     pack $pos2 -side top
+set axisnum $axiscount+1
 }
-if { $numaxes > 3 } {
+if { $numaxes > 3 && [ string first "A" $coordnames ] >= 0  } {
     pack $pos3 -side top
+set axisnum $axiscount+1
 }
-if { $numaxes > 4 } {
+if { $numaxes > 4 && [ string first "B" $coordnames ] >= 0  } {
     pack $pos4 -side top
+set axisnum $axiscount+1
 }
-if { $numaxes > 5 } {
+if { $numaxes > 5 && [ string first "C" $coordnames ] >= 0  } {
     pack $pos5 -side top
+set axisnum $axiscount+1
 }
-if { $numaxes > 6 } {
+if { $numaxes > 6 && [ string first "U" $coordnames ] >= 0  } {
     pack $pos6 -side top
+set axisnum $axiscount+1
 }
-if { $numaxes > 7 } {
+if { $numaxes > 7 && [ string first "V" $coordnames ] >= 0 } {
     pack $pos7 -side top
+set axisnum $axiscount+1
 }
-if { $numaxes > 8 } {
+if { $numaxes > 8 && [ string first "W" $coordnames ] >= 0  } {
     pack $pos8 -side top
+set axisnum $axiscount+1
 }
 pack $bun -side right -anchor n ; # don't fill or expand these-- looks funny
 pack $limoride -side top -pady 2m
@@ -1247,7 +1237,7 @@ if {$userfont != ""} {
     set fontstyle [font actual $userfont -weight]
 } elseif {[lsearch [font families] {courier 10 pitch}] != -1} {
     set fontfamily {courier 10 pitch}
-    if {$numaxes > 6} {
+    if {$axiscount <= 3} {
        set fontsize 24
     } else {
        set fontsize 48
@@ -1255,7 +1245,7 @@ if {$userfont != ""} {
     set fontstyle bold
 } else {
     set fontfamily courier
-    if {$numaxes > 6} {
+    if {$axiscount <= 3} {
        set fontsize 24
     } else {
         set fontsize 48

(END) 

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to