GuidoScript scripts/dtmutilities.tcl
global dtm_loc
global object_id
global trisolation_id
global obj_name
global tri_name
global expression
global scrollblock
global dtm_field
proc clearDescriptionFieldsMap {} {
set buffer [GuidoExecServer ClearDescriptionFieldsMap {}]
}
proc validateLocationFieldForNullvalue {dtmFile} {
set no_dtm_file 0
set return_code true
global scrollblock
for {set row 0} {$row < [$scrollblock getRowCount]} {incr row} {
if {[$dtmFile getCurrentValue $row] != ""} {
incr no_dtm_file
set filename ""
set name [$dtmFile getCurrentValue $row]
append filename $name ".dtm"
set buffer [GuidoExecServer DoesFileExist [subst {FILE_NAME = "$filename"}]]
set status [GuidoGetParamBufferValue $buffer status]
if {$status < 0} {
GuidoMessage warning FILE_DOES_NOT_EXIST $filename
set return_code false
}
}
}
if {"$return_code" == "false"} {
return false
}
if {"$no_dtm_file" == 0} {
GuidoMessage error APP_NEED_ATLEAST_ONE_DTM
return false
}
}
proc validateExpression {exp} {
global scrollblock
set currentExpression [$exp getCurrentValue]
set count [$scrollblock getRowCount]
set buffer [GuidoExecServer ValidateDTMExpression [subst {EXPRESSION = "$currentExpression" ROWCOUNT = "$count"}]]
set status [GuidoGetParamBufferValue $buffer status]
if {$status >= 0} {
return true
} else {
GuidoMessage warning VALIDATION_FAILED $currentExpression
return false
}
}
GuidoForm frm00517 {
-action initial { [ getObjectsTrisolationsForMultipleDTMS $dtm_loc $object_id $obj_name $trisolation_id $tri_name]}
-action initial {[getDFieldNamesForMultipleDTMS $dtm_loc $dtm_field]}
-default_buttons
-label "DTM maths"
-layout BoxLayout Y_AXIS
-tip 00517_TIP_0
-action final {[clearDescriptionFieldsMap]}
-action final {[destroyMultipleDtms]}
GuidoFiller filler {
-height 0.05
}
GuidoLabel frm00517_2 {
-label FRM_00517_1
}
GuidoFiller filler {
-height 0.05
}
GuidoScrollPane frm00517_59 {
-height 9
-width 63
GuidoTable scrollblock {
-instances 2 1 26
-interactive true
-row_headings a b c d e f g h i j k l m n o p q r s t u v w x y z
GuidoFileBrowserField dtm_loc {
-action focusGained { [ getObjectsTrisolationsForMultipleDTMS $dtm_loc $object_id $obj_name $trisolation_id $tri_name]}
-display_length 11
-file_mask *.dtm
-format none
-label "DTM location"
-max_length 252
-tip 00517_LOCATION
-translate lower
-extension false
-validation {[validateLocationFieldForNullvalue $dtm_loc]}
-action focusGained {[getDFieldNamesForMultipleDTMS $dtm_loc $dtm_field]}
-next_focus object_id
}
GuidoComboBox object_id {
-action focusGained {[updateObjectDetailsForMultipleDtms $dtm_loc $object_id $trisolation_id]}
-label "Object ID"
-display_length 2
-default 1
-format none
-max_length 5
-translate none
-exclusive false
-tip 04949_TIP_1
-action valueChanged {[triobjectChanged $dtm_loc $object_id $obj_name $trisolation_id $tri_name]}
-next_focus trisolation_id
}
GuidoLabel obj_name {
-label "Object name"
}
GuidoComboBox trisolation_id {
-action focusGained {[updateTrisolationDetailsForMultipleDtms $dtm_loc $object_id $trisolation_id]}
-label "Trisolation ID"
-display_length 5
-format none
-default 1
-max_length 32
-translate none
-exclusive false
-tip 04949_TIP_2
-action valueChanged {[trisolationChanged $dtm_loc $object_id $trisolation_id $tri_name]}
-next_focus dtm_field
}
GuidoLabel tri_name {
-label "Trisolation name"
}
GuidoComboBox dtm_field {
-default Z
-display_length 2
-format none
-label Field
-max_length 4
-no_mlt
-tip 00517_TIP_2
-exclusive false
-action focusGained { [ refreshDfieldNamesForMultipleDTMs $dtm_loc $dtm_field]}
-next_focus dtm_default
}
GuidoField dtm_default {
-default 0
-display_length 2
-format double
-label Default
-max_length 16
-null false
-tip 00517_TIP_3
-translate upper
-next_focus bdy_loc
}
GuidoFileBrowserField bdy_loc {
-display_length 8
-file_mask *.str
-format none
-label "Bdy location"
-max_length 252
-tip 00517_TIP_4
-translate lower
-extension false
-next_focus bdy_string_id
}
GuidoField bdy_string_id {
-default 1
-display_length 2
-format integer
-high_bound 32000
-label String
-low_bound 1
-max_length 5
-null false
-tip 00517_TIP_4
-translate none
}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoPanel frm00517_68 {
-border etched true
-label "Define the new DTM and the expression for combining the input DTMs"
-layout BoxLayout X_AXIS
GuidoPanel frm00126_02 {
-border etched true
-layout BoxLayout Y_AXIS
GuidoPanel frm00126_02 {
-layout CentreLineLayout Vertical Left
GuidoFileBrowserField new_dtm_loc {
-label "Location"
-display_length 24
-file_access write
-file_mask *.dtm
-format none
-max_length 252
-tip 00517_NEW_DTM
-translate lower
-extension false
-null false
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField newobject_id {
-display_length 8
-input true
-null false
-format integer
-label "Object ID"
-default 1
-low_bound 1
-max_length 5
-high_bound 32000
-tip 00126_TIP_0010
-next_focus newobj_name
}
GuidoFiller filler {
-height 0.05
}
GuidoFiller filler {
-height 0.05
}
GuidoField newobj_name {
-display_length 8
-label "Object name"
-input true
-tip 00126_TIP_0011
-max_length FIO_MAX_LOCATION_LENGTH
-next_focus newbdyloc
}
}
}
GuidoPanel frm00126_02 {
-border etched true
-layout BoxLayout Y_AXIS
GuidoPanel frm00126_02 {
-layout CentreLineLayout Vertical Left
GuidoField expression {
-label "Algebraic expression"
-display_length 20
-format none
-legacy_validation
-max_length 512
-tip 00517_TIP_7
-translate lower
-null false
-validation {[validateExpression $expression]}
}
}
GuidoFiller filler {
-height 0.05
}
GuidoPanel frm00126_02 {
-layout CentreLineLayout Vertical Left
GuidoFiller filler {
-width 8.5
}
GuidoPanel frm00126_02 {
-layout CentreLineLayout Vertical Left
GuidoCheckBox keep_descriptions {
-default false
-selected_value Y
-tip 00517_TIP_6
-unselected_value N
}
GuidoLabel keep_descriptions_label {
-label "Retain descriptions"
}
}
}
GuidoFiller filler {
-height 1.1
}
}
}
}
