Changeset 78e136b in tol


Ignore:
Timestamp:
Jun 11, 2012, 9:54:04 AM (14 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
5140c94
Parents:
7efc7be
Message:

refs #1375, plotea una selección de Matrix compatible en número de filas, hay que corregir que en el plot inicial sean visibles todo el rango de datos

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@4788 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/toltk/tolinspe.tcl

    r7efc7be r78e136b  
    21562156    toltcl::eval $tolexpr
    21572157  }
     2158}
     2159
     2160proc TolGui_InsertEntriesMatrixChart { mm selection } {
     2161  if {  ![ llength $selection ] } {
     2162    return 0
     2163  }
     2164  set lst_addr {}
     2165  foreach r $selection {
     2166    set a [ tol::info address $r ]
     2167    lappend lst_addr \"$a\"
     2168  }
     2169  set set_addr "\[\[ [join $lst_addr ,] \]\]"
     2170  set tolexpr [ string map [ list %L $set_addr ] {
     2171    Real {
     2172      Set all_mat = EvalSet( %L, Matrix( Text addr ) {
     2173        GetObjectFromAddress( addr )
     2174      } );
     2175      Real R = Rows( all_mat[1] );
     2176      Set st = EvalSet( all_mat, Real( Matrix it ) {
     2177        Real EQ( R, Rows( it ) )
     2178      } );
     2179      Real BinGroup( "And", st )
     2180    }
     2181  } ]
     2182  set couldChart [ toltcl::eval $tolexpr ]
     2183  if { $couldChart } {
     2184    $mm add command -label [ mc "Draw matrix selection (natural)" ] \
     2185        -command [ list TolGui_ChartMatrix $selection ]
     2186  }
     2187}
     2188
     2189proc TolGui_ChartMatrix { selection } {
     2190  set lst_addr {}
     2191  foreach r $selection {
     2192    set a [ tol::info address $r ]
     2193    lappend lst_addr \"$a\"
     2194  }
     2195  set set_addr "\[\[ [join $lst_addr ,] \]\]"
     2196  set tolexpr [ string map [ list %L $set_addr ] {
     2197    Real {
     2198      Set all_mat = EvalSet( %L, Matrix( Text addr ) {
     2199        GetObjectFromAddress( addr )
     2200      } );
     2201      Set names = Copy( Empty );
     2202      Set For( 1, Card( all_mat ), Real( Real k ) {
     2203        Text _n = Name( all_mat[ k ] );
     2204        Text n = If( _n == "", "unamed", _n );
     2205        Set Append( names, If( Columns( all_mat[ k ] ) == 1, [[ n ]], {
     2206          Set For( 1, Columns( all_mat[ k ] ), Text( Real k ) {
     2207            Text n << "[" << k << "]"
     2208          } )
     2209        } ) );
     2210        Real 1
     2211      } );
     2212      Matrix groupMat = BinGroup( "|", all_mat );
     2213      Text TclChartMatrix( groupMat,
     2214                           SetOfSet (
     2215                                     @TclArgSt("-title",    "Matrix Chart" ),
     2216                                     @TclArgSt("-type"    , "2"            ),
     2217                                     @TclArgSt("-names",    TxtListTcl(names) ) ) )
     2218    }
     2219  } ]
     2220  toltcl::eval $tolexpr
    21582221}
    21592222
    … …  
    23712434                  $data_menu(Matrix,Draw) add command -label [lindex $objInfo 1] \
    23722435                    -command [list ::TolInspector::DrawMatrix [lindex $objInfo 0]]
     2436                }
     2437                if { $grammar eq "Matrix" } {
     2438                  set all_matrix {}
     2439                  foreach m $options_selected(Matrix) {
     2440                    lappend all_matrix [ lindex $m 0 ]
     2441                  }
     2442                  TolGui_InsertEntriesMatrixChart $data_menu(main) $all_matrix
    23732443                }
    23742444              }
Note: See TracChangeset for help on using the changeset viewer.