This file is indexed.

/usr/share/elmerfront/tcl/ecif_tk_modelInfoPanel.tcl is in elmer-common 6.1.0.svn.5396.dfsg2-4ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
#/*****************************************************************************/
# *
# *  Elmer, A Finite Element Software for Multiphysical Problems
# *
# *  Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland
# * 
# *  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 (in file fem/GPL-2); if not, write to the 
# *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
# *  Boston, MA 02110-1301, USA.
# *
# *****************************************************************************/
 
#***********************************************************************
#Program:   ELMER Front 
#Module:    ecif_tk_modelInfoPanel.tcl
#Language:  Tcl
#Date:      23.10.98
#Version:   1.00
#Author(s): Martti Verho
#Revisions: 
#
#Abstract:  A panel for general model information.
#
#************************************************************************
 
#------Model info proc------
#
# This procedure displays the model statistic-info screen
# NOTE: This is an info panel, but Cad input file and Mesh input file
# names are editable here. These names are however just for info, changing
# them does not affect anything in the model. This feature is provided
# mainly for the possibilty to keep this info sensible when model files are
# moved from a machine/platform to an other.
#
proc ModelInfo::openPanel { } {
  # Global variables
  global Info Model ModelProperty ModelInfo

  set w $ModelInfo(winName)
  set wgeom $ModelInfo(winGeometry)

  set id [winfo atom $w]
  set ModelInfo(winId) $id

  set Info(thisWindow) $w

  if { 1 == [Util::checkPanelWindow ModelInfo $id $ModelInfo(winTitle) $wgeom] } {
    return
  }  
 
  # Create local value for this panel (for backup etc.)
  set ModelInfo(cadPath)  $Model(cadPath)
  set ModelInfo(meshPath) $Model(meshPath)
  set ModelInfo(created)  $Model(created)

  set ModelInfo(dataChanged) 0
  set ModelInfo(dataModified) 0

  toplevel $w
  focus $w
  set this $w

  wm title $w $ModelInfo(winTitle)
  wm geometry $w $wgeom 

  #-Frame padding parameters
  set fpx1 $Info(framePadX1)
  set fpy1 $Info(framePadY1)
  set fpx2 $Info(framePadX2)
  set fpy2 $Info(framePadY2)
  set fpx3 $Info(framePadX3)
  set fpy3 $Info(framePadY3)

  set Model(nofMeshElements_) [expr $Model(nofMeshElements) - $Model(nofMeshSplittedElements)]

  #-Entry descriptions:
  # Lbl, Lbl width, Array, Variable, Editable flag, Width, Left justify flag

  set x_lbl [Util::getCoordinateLabel 1]
  set y_lbl [Util::getCoordinateLabel 2]
  set z_lbl [Util::getCoordinateLabel 3]

  set fieldInfos ""
  lappend fieldInfos "\"Cad input file:\"             12  Model cadPath             1 55 1"
  lappend fieldInfos "\"Mesh input file:\"            12  Model meshPath            1 55 1"
  lappend fieldInfos "\"Model created:\"              12  Model created             1 55 1"
  lappend fieldInfos "\"Model file:\"                 12  Model EMF_PATH            0 55 1"
  lappend fieldInfos "\"Model directory:\"            12  ModelProperty MODEL_DIRECTORY,absolute   0 55 1"
  lappend fieldInfos "\"Include path:\"               12  ModelProperty INCLUDE_PATH,absolute      0 55 1"
  lappend fieldInfos "\"Results dir:\"                12  ModelProperty RESULTS_DIRECTORY,absolute 0 55 1"
  lappend fieldInfos "\"Log dir:\"                    12  ModelProperty LOG_DIRECTORY,absolute     0 55 1"
  lappend fieldInfos "\"Nof bodies:\"                 24  Model nofBodies           0 20 0"
  lappend fieldInfos "\"Nof boundaries:\"             24  Model nofElements         0 20 0"
  lappend fieldInfos "\"Nof outer boundaries:\"       24  Model nofOuterBoundaries  0 20 0"
  lappend fieldInfos "\"Nof inner boundaries:\"       24  Model nofInnerBoundaries  0 20 0"
  lappend fieldInfos "\"Nof vertices:\"               24  Model nofVertices         0 20 0"
  lappend fieldInfos "\"Model  $x_lbl dimensions \[m\]:\"  24  Model {minX maxX}         0 20 0"
  lappend fieldInfos "\"Model  $y_lbl dimensions \[m\]:\"  24  Model {minY maxY}         0 20 0"
  lappend fieldInfos "\"Model  $z_lbl dimensions \[m\]:\"  24  Model {minZ maxZ}         0 20 0"
  lappend fieldInfos "\"Minimum edge size:\"          24  Model minEdgeSize         0 20 0"
  lappend fieldInfos "\"Current mesh:\"               12  ModelProperty CURRENT_MESH_DIRECTORY,absolute   0 55 1"
  lappend fieldInfos "\"Nof mesh nodes:\"             24  Model nofMeshNodes        0 20 0"
  lappend fieldInfos "\"Nof mesh elements:\"          24  Model nofMeshElements_    0 20 0"
  lappend fieldInfos "\"Nof mesh boundary elements:\" 24  Model nofMeshBndrElements 0 20 0"

  # Create labels and variable entries
  # ==================================

  set index 0
  foreach fi $fieldInfos {

    incr index

    #--Frame 
    set m [frame $w.f$index]

    #--Label
    set txt [lindex $fi 0]
    set wid [lindex $fi 1]
    label $m.l -width $wid -text $txt -anchor w

    # Pack frame and label
    pack $m -side top -expand 0 -fill x -padx $fpx1 -pady $fpy2
    pack $m.l -side left -anchor w -in $m 

    #--Entries
    set arr   [lindex $fi 2]
    set vars  [lindex $fi 3]
    set edit  [lindex $fi 4]
    set wid   [lindex $fi 5]
    set ljust [lindex $fi 6]

    if {$edit} {
      set state normal
      set bgcolor white
      set relief $Info(activeRelief)
    } else {
      set state disabled
      set bgcolor $Info(nonActiveBgLight)
      set relief $Info(nonActiveRelief)
    }

    if {$ljust} {
      set just left
    } else {
      set just center
    }


    set count 0
    foreach var $vars {
      incr count

      set txtvar $arr

      append txtvar "($var)"    

      set wdg [entry $m.d$count -width $wid -relief $relief -textvariable $txtvar \
                                -justify $just -state $state  -bg $bgcolor ]
      
      set ModelInfo(allWidgets,$var) $wdg

      if { $state == "normal" } {
        bind  $wdg <KeyRelease> "Panel::panelDataChanged 1 ModelInfo"
      }
                        
      pack $m.d$count -side left -in $m -padx $fpx1
    }
  }


  # Create buttons
  # ===============

  frame $w.fB

  set ap $Info(defaultApplyState)
  set ca $Info(defaultCancelState)

  #-Ok button
  set ok_btn [button $w.fB.ok -text OK -command "ModelInfo::panelOk $this"]
  set cn_btn [button $w.fB.cancel -text Cancel -command "ModelInfo::panelCancel $this" \
                                  -state $ca]
  set ap_btn [button $w.fB.apply -text Apply -command "ModelInfo::panelApply" \
                                 -state $ap]

  focus $ok_btn
  set ModelInfo(applyButton)  $ap_btn
  set ModelInfo(cancelButton) $cn_btn

  pack $w.fB
  pack $ok_btn $cn_btn $ap_btn -side left -expand 1 -padx $fpx1
}


# This does not actually save anything, just updates
# modified states
# Changes are stored directly to Model-array vars
#
proc ModelInfo::panelSave { {inform_front 1} } {
  global ModelInfo Model

  # Backup values
  set ModelInfo(cadPath)  $Model(cadPath)
  set ModelInfo(meshPath) $Model(meshPath)

  #--Write data into model
  if {$inform_front} {
    set Model(Front,needsUpdate) 1
  }

  Panel::panelDataChanged 0 ModelInfo 
  Panel::panelDataModified 0 ModelInfo 

  Util::updateMainWindowTitle
}


proc ModelInfo::panelOk {w} {
  global ModelInfo

  #---No changes
  if { !$ModelInfo(dataChanged) } {
    Panel::cancel $w; return
  }

  #---Error in data
  if { ![ModelInfo::panelCheck] } {
    return
  }

  ModelInfo::panelSave
  Panel::cancel $w
}

proc ModelInfo::panelApply {} {
  global ModelInfo

  #---No changes
  if { !$ModelInfo(dataChanged) } {
    return
  }

  #---Error in data
  if { ![ModelInfo::panelCheck] } {
    return
  }

  ModelInfo::panelSave
}

proc ModelInfo::panelCancel {w} {
  global ModelInfo Model

  if { ![Panel::verifyCancel ModelInfo] } {
    return
  }

  # Restore values
  set Model(cadPath)  $ModelInfo(cadPath)
  set Model(meshPath) $ModelInfo(meshPath)
  set Model(created)  $ModelInfo(created)

  Panel::cancel $w
}


proc ModelInfo::panelCheck {} {
  return 1
}

# end ecif_tk_modelInfoPanel.tcl
# ********************