Differences From Artifact [3601be40d3]:

To Artifact [a8ed17a5f7]:


75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
    foreach name [split \$temp_list \$delim] {
	set list \$list\$delim[reverse_name \$name]
    }
    return \$list
}

proc "sort_list" "list sortorder" {
    puts "sortorder: \$sortorder"
    if ("\$sortorder"=="normal") {
	return [lsort -ascii \$list]
    }
    if ("\$sortorder"=="reverse") {
	return [reverse_sort \$list]
    }
}







<







75
76
77
78
79
80
81

82
83
84
85
86
87
88
    foreach name [split \$temp_list \$delim] {
	set list \$list\$delim[reverse_name \$name]
    }
    return \$list
}

proc "sort_list" "list sortorder" {

    if ("\$sortorder"=="normal") {
	return [lsort -ascii \$list]
    }
    if ("\$sortorder"=="reverse") {
	return [reverse_sort \$list]
    }
}
114
115
116
117
118
119
120
121
122







123
124
125
126
127
128
129
130
131
132
133
134
135

pack .cx.l -expand true -fill both -side left
pack .cy.l -expand true -fill both -side left

pack .cx -expand true -fill both
place .cy -in .cx -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside

radiobutton .states  -text "States"  -value states  -variable view -command { raise .cx } -relief solid
radiobutton .outputs -text "Outputs" -value outputs -variable view -command { raise .cy } -relief solid








pack .states .outputs -side left

pack .quit   -expand false -fill x -side right
pack .print  -expand false -fill x -side right


## map names to column numbers
EOF

gawk '
BEGIN {
    print "proc \"plot\" \"title\" {";







|
|
>
>
>
>
>
>
>





|







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

pack .cx.l -expand true -fill both -side left
pack .cy.l -expand true -fill both -side left

pack .cx -expand true -fill both
place .cy -in .cx -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside

radiobutton .states  -text "States"      -value states  -variable view      -relief solid -command { raise .cx }
radiobutton .outputs -text "Outputs"     -value outputs -variable view      -relief solid -command { raise .cy }

#menubutton .plottype -text "Plot type" -menu .plottype.plottype

#menu .plottype.plottype
tk_optionMenu .plottype plottype "Single Plot"\
                                 "Multi Plot "\
                                 "New Window "

pack .states .outputs -side left

pack .quit   -expand false -fill x -side right
pack .print  -expand false -fill x -side right
pack .plottype   -expand false -fill x -side top

## map names to column numbers
EOF

gawk '
BEGIN {
    print "proc \"plot\" \"title\" {";
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
' Title=\$title Ny=${Ny} ${struc} >> ${out}


cat <<EOF >> ${out}

## call gnuplot
proc "plot_var" "title column" {
    exec echo set grid\; > ${tmp}



    exec echo plot \"${dat2}\" using 1:\$column title \"\$title\" with lines\; >> ${tmp}
    exec echo exit\; >> ${tmp}

    exec gnuplot -geometry 400x300 -persist -title "\$title" ${tmp} &



}

## print output
proc "print" "parameter" {
    set filename [tk_getSaveFile\
	-initialdir ".."\
	-initialfile "\$parameter.ps"\
	-defaultextension ".ps"\
	-filetypes {
	    {{Postscript} {.ps}}
	    {{All files} {*}}
	}
    ]
    if {\$filename != ""} {
	exec echo set term postscript > ${tmp}.print
	exec echo set output \"\$filename\" >> ${tmp}.print
	exec grep -v pause ${tmp} >> ${tmp}.print
	exec gnuplot ${tmp}.print
	puts "Graph printed to \$filename"
    }
}

EOF
chmod +x ${out}







|
>
>
>
|
<
>
|
>
>
>














|
|
<
|
|





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
' Title=\$title Ny=${Ny} ${struc} >> ${out}


cat <<EOF >> ${out}

## call gnuplot
proc "plot_var" "title column" {
    puts "set grid"
    puts "set term X11"
    global plottype
    if {"\$plottype" == "Multi Plot "} {
	puts "replot '${dat2}' using 1:\$column title '\$title' with lines"

    } elseif {"\$plottype" == "New Window "} {
	puts "! echo \"plot '${dat2}' using 1:\$column title '\$title' with lines\" | gnuplot -geometry 400x300 -persist"
    } else {
	puts "plot '${dat2}' using 1:\$column title '\$title' with lines"
    }
}

## print output
proc "print" "parameter" {
    set filename [tk_getSaveFile\
	-initialdir ".."\
	-initialfile "\$parameter.ps"\
	-defaultextension ".ps"\
	-filetypes {
	    {{Postscript} {.ps}}
	    {{All files} {*}}
	}
    ]
    if {\$filename != ""} {
	puts "set term postscript"
	puts "set output \"\$filename\""

	puts "replot"
	tk_dialog ".printed" "Graph Printed!" "PostScript saved as \$filename" "" "0" "Close"
    }
}

EOF
chmod +x ${out}

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]