Revision: 41114
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41114&view=rev
Author:   bob1961
Date:     2010-10-20 19:59:45 +0000 (Wed, 20 Oct 2010)

Log Message:
-----------
Added DataUtils::deleteGlobalData for deleting group specific data from a 
specified _GLOBAL attribute.

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/archer/DataUtils.tcl
    brlcad/trunk/src/tclscripts/archer/tclIndex

Modified: brlcad/trunk/src/tclscripts/archer/DataUtils.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/DataUtils.tcl    2010-10-20 04:07:12 UTC 
(rev 41113)
+++ brlcad/trunk/src/tclscripts/archer/DataUtils.tcl    2010-10-20 19:59:45 UTC 
(rev 41114)
@@ -37,6 +37,7 @@
                       _data_axes_name _sdata_axes_name
                       _data_labels_name _sdata_labels_name
                       _data_lines_name _sdata_lines_name}
+       proc deleteGlobalData {_ged _archer _group _attr_name}
        proc measureLastDataPoints {_ged _archer _group _attr_name _pindex 
{_sindex -1}}
        proc updateData {_ged _archer _group
                         _attr_name _data_cmd _data_subcmd}
@@ -50,7 +51,7 @@
                                           _attr_name _data_cmd _data_subcmd
                                           _data _index_begin _index_end} {
     if {$_group == ""} {
-       $_archer putString "Please select a group before creating $_attr_name."
+       $_archer putString "Please select a group before appending to 
$_attr_name."
        return
     }
 
@@ -490,6 +491,26 @@
     }
 }
 
+::itcl::body DataUtils::deleteGlobalData {_ged _archer _group _attr_name} {
+    if {$_group == ""} {
+       $_archer putString "Please select a group before deleting from 
$_attr_name."
+       return
+    }
+
+    if {[catch {$_ged attr get _GLOBAL $_attr_name} dl]} {
+       return
+    }
+
+    # Delete the data list for the specified group
+    set i [lsearch -index 0 $dl $_group]
+    if {$i == -1} {
+       return
+    }
+
+    set dl [lreplace $dl $i $i]
+    $_archer attr set _GLOBAL $_attr_name $dl
+}
+
 ::itcl::body DataUtils::measureLastDataPoints {_ged _archer _group _attr_name 
_pindex {_sindex -1}} {
     if {[catch {$_ged attr get _GLOBAL $_attr_name} dl]} {
        return

Modified: brlcad/trunk/src/tclscripts/archer/tclIndex
===================================================================
--- brlcad/trunk/src/tclscripts/archer/tclIndex 2010-10-20 04:07:12 UTC (rev 
41113)
+++ brlcad/trunk/src/tclscripts/archer/tclIndex 2010-10-20 19:59:45 UTC (rev 
41114)
@@ -682,6 +682,7 @@
 set auto_index(::DataUtils) [list source [file join $dir DataUtils.tcl]]
 set auto_index(::DataUtils::appendGlobalData) [list source [file join $dir 
DataUtils.tcl]]
 set auto_index(::DataUtils::dataPick) [list source [file join $dir 
DataUtils.tcl]]
+set auto_index(::DataUtils::deleteGlobalData) [list source [file join $dir 
DataUtils.tcl]]
 set auto_index(::DataUtils::measureLastDataPoints) [list source [file join 
$dir DataUtils.tcl]]
 set auto_index(::DataUtils::updateData) [list source [file join $dir 
DataUtils.tcl]]
 set auto_index(::DataUtils::updateGlobalData) [list source [file join $dir 
DataUtils.tcl]]


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to