proc setHistoBarValues {cht xTicks values} {
set number [llength $xTicks]
set translated_cat [GuidoMessage translate "Number of Triangles"]
for {set i 0} {$i < $number} {incr i} {
$cht setCategoryValue $translated_cat [lindex $xTicks $i] [lindex $values $i]
}
$cht drawChart
}
proc setHistoValuesFromServer {cht valuesKey} {
set buffer [GuidoExecServer getChartHistogramValues [subst {chartkey = "$valuesKey" numBuckets = 16}]]
setHistoBarValues $cht  [GuidoGetParamBufferValue $buffer xLabels] [GuidoGetParamBufferValue $buffer values]
}
GuidoForm TrisolStats {
-add_button default_cancel "Close"
-add_button default_help
-label "Trisolation Statistics"
-layout BoxLayout Y_AXIS
-tip TRISOLSTATS_1
-help_id 1627
GuidoTabbedPane TrisolStats_tabs {
-selected_index 0
GuidoPanel TrisolStats_10 {
-label "Statistics"
-layout BoxLayout Y_AXIS
GuidoFiller space {
-height 0.3
}
GuidoPanel TrisolStats_100 {
-layout CentreLineLayout VERTICAL LEFT
GuidoLabel labelLayer {
-width 12
-label "Layer name"
}
GuidoLabel layer {
-font_style bold
}
GuidoPanel labelPanel {
-layout BoxLayout Y_AXIS
GuidoLabel obj_label {
-label "Object Range"
-height 1
}
GuidoLabel trisol_label {
-label "Trisolation Range"
-height 1
}
}
GuidoPanel rightPanel {
-layout BoxLayout X_AXIS
GuidoPanel labelPanel {
-layout BoxLayout Y_AXIS
-alignmentY middle
GuidoField obj_range {
-format range
-display_length 16
-max_length MAX_RNG_LENGTH
-tip "Enter the object range for processing"
}
GuidoField trisol_range {
-format range
-display_length 16
-max_length MAX_RNG_LENGTH
-tip "Enter the trisolation range for processing"
}
}
GuidoPanel buttonPanel {
-alignmentY middle
GuidoButton refresh_button {
-icon "icons/24/refresh.png"
-legacy_button
-selected_value refresh
-tip TRISOLSTATS_3
}
}
}
GuidoFiller space {
-height 0.5
}
GuidoFiller space {
-height 0.5
}
GuidoLabel rpt_file_label {
-label "Report file"
-height 1
}
GuidoPanel rightPanel {
-layout BoxLayout X_AXIS
GuidoFileBrowserField report_file {
-alignmentX left
-default valid
-display_length 16
-file_mask reports
-format none
-null true
-max_length 252
-tip TRISOLSTATS_2
-translate none
}
GuidoFiller space {
-width 0.5
}
GuidoButton report_button {
-icon "icons/16/group_report.png"
-legacy_button
-selected_value report
-tip "Produce a report of the current statistics"
}
}
}
GuidoFiller Separate_Entry_And_Results {
-height 0.5
}
GuidoPanel TrisolStats_Totals {
-layout CentreLineLayout vertical perimeter
GuidoLabel total_objects_label {
-width 12
-label "Number of Objects"
}
GuidoLabel total_objects     {}
GuidoLabel total_trisols_label {
-label "Number of Trisolations"
}
GuidoLabel total_trisols     {}
GuidoLabel total_triangles_label {
-label "Number of triangles"
}
GuidoLabel total_triangles {}
GuidoLabel total_vertices_label {
-label "Number of vertices"
}
GuidoLabel total_vertices {}
GuidoLabel total_area_label {
-label TRISOL_STATS_TOTAL_AREA
}
GuidoLabel total_area {}
}
GuidoFiller Separate_Totals_and_Table {
-height 0.5
}
GuidoScrollPane StatsScroller {
-height 7
GuidoTable TrisolStats_Results {
-instances 4 4 4
-interactive false
-column_sorting false
-row_headings_visible false
GuidoLabel heading {
-font_style bold
-width 15
-input false
}
GuidoLabel largest_col {
-label "Largest"
-text_alignmentX right
-width 8
}
GuidoLabel smallest_col {
-label "Smallest"
-text_alignmentX right
-width 8
}
GuidoLabel average_col {
-label "Average"
-text_alignmentX right
-width 8
}
GuidoLabel stddev_col {
-label "Std Dev."
-text_alignmentX right
-width 8
}
}
}
GuidoFiller Separate_Totals_and_Table {
-height 0.5
}
}
GuidoPanel TrisolStats_20 {
-label "Areas"
GuidoChart AreasChart {
-width 50
-height 20
-legend false
-chartType "Bar"
-chartTitle "Triangles Counted by Areas"
-display_values true
-xAxisLabelAngle vertical
-xAxisLabel "Areas"
-yAxisLabel "Number of Triangles"
-simpleChartContextMenu true
-action initial {[setHistoValuesFromServer $AreasChart "TrisolStats_AreasChart"]}
}
}
GuidoPanel TrisolStats_30 {
-label "Small Angles"
GuidoChart SmallAnglesChart {
-width 50
-height 20
-legend false
-chartType "Bar"
-chartTitle "Triangles Counted by Small Angles"
-display_values true
-xAxisLabelAngle vertical
-xAxisLabel "TRISOLSTATS_ANGLES_0_60_DEGREES"
-yAxisLabel "Number of Triangles"
-simpleChartContextMenu true
-action initial {[setHistoValuesFromServer $SmallAnglesChart "TrisolStats_SmallAnglesChart"]}
}
}
GuidoPanel TrisolStats_40 {
-label "Large Angles"
GuidoChart LargeAnglesChart {
-width 50
-height 20
-legend false
-chartType "Bar"
-chartTitle "Triangles Counted by Large Angles"
-display_values true
-xAxisLabelAngle vertical
-xAxisLabel "TRISOLSTATS_ANGLES_60_180_DEGREES"
-yAxisLabel "Number of Triangles"
-simpleChartContextMenu true
-action initial {[setHistoValuesFromServer $LargeAnglesChart "TrisolStats_LargeAnglesChart"]}
}
}
GuidoPanel TrisolStats_50 {
-label "H/W Ratios"
GuidoChart WHRatiosChart {
-width 50
-height 20
-legend false
-chartType "Bar"
-chartTitle "Triangles Counted by Height/Width Ratios"
-display_values true
-xAxisLabelAngle vertical
-xAxisLabel "TRISOLSTATS_RATIO_0_1"
-yAxisLabel "Number of Triangles"
-simpleChartContextMenu true
-action initial {[setHistoValuesFromServer $WHRatiosChart "TrisolStats_WHRatiosChart"]}
}
}
}
}
