Overview
Comment:Added print dialogue to allow user to select print filename.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 9b57cd0c838d3e59d21fe5f155e146bc90d0b762d483bcfbe85afcffaa7da828
User & Date: geraint@users.sourceforge.net on 2001-10-16 02:15:58
Other Links: branch diff | manifest | tags
Context
2001-10-26
01:01:49
fixcc when rdae_is_dae (-cr). check-in: ea6687ef53 user: geraint@users.sourceforge.net tags: origin/master, trunk
2001-10-16
02:15:58
Added print dialogue to allow user to select print filename. check-in: 9b57cd0c83 user: geraint@users.sourceforge.net tags: origin/master, trunk
2001-10-15
14:29:50
Added documentaton on [1:N] style port labels check-in: ad9f307e9e user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/struc2gnuplot_txt2wish from [bbec88ea64] to [083c34c2f1].

17
18
19
20
21
22
23

24







25
26
27
28
29
30
31
#!/bin/sh
# Next line replaces shell with wish\\
exec wish "\$0" "\$@"

## main window
wm title . "MTT Viewer: ${sys}"


button .print -text "Print" -command print







button .quit  -text "Quit"  -command exit

## states canvas
canvas		.cx
listbox		.cx.l
scrollbar	.cx.sy	-orient v
checkbutton    	.cx.t	-text		"States"







>
|
>
>
>
>
>
>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# Next line replaces shell with wish\\
exec wish "\$0" "\$@"

## main window
wm title . "MTT Viewer: ${sys}"

set parameter ""
button .print -text "Print" -command { 
    global parameter;
    if {"\$parameter"==""} {
	tk_dialog ".mtt_Print_Error" "Print Error" "Select a parameter!" "" "0" "Try Again"
    } else {
	print \$parameter
    }
}
button .quit  -text "Quit"  -command exit

## states canvas
canvas		.cx
listbox		.cx.l
scrollbar	.cx.sy	-orient v
checkbutton    	.cx.t	-text		"States"
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## configure scrollbars
.cx.sy configure -command ".cx.l yview"
.cy.sy configure -command ".cy.l yview"
.cx.l configure -yscrollcommand ".cx.sy set"
.cy.l configure -yscrollcommand ".cy.sy set"

## bind lists
bind .cx.l <<ListboxSelect>> { plot [ .cx.l get anchor ] }
bind .cy.l <<ListboxSelect>> { plot [ .cy.l get anchor ] }

proc "reverse_name" "name" {
    set delim "_"
    set split_name [split \$name \$delim]
    set reversed_name [lindex \$split_name 0]
    for {set i 1} {\$i<[llength \$split_name]} {incr i} {
        set reversed_name [lindex \$split_name \$i]\$delim\$reversed_name







|
|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
## configure scrollbars
.cx.sy configure -command ".cx.l yview"
.cy.sy configure -command ".cy.l yview"
.cx.l configure -yscrollcommand ".cx.sy set"
.cy.l configure -yscrollcommand ".cy.sy set"

## bind lists
bind .cx.l <<ListboxSelect>> { set parameter [ .cx.l get anchor ] ; plot \$parameter }
bind .cy.l <<ListboxSelect>> { set parameter [ .cy.l get anchor ] ; plot \$parameter }

proc "reverse_name" "name" {
    set delim "_"
    set split_name [split \$name \$delim]
    set reversed_name [lindex \$split_name 0]
    for {set i 1} {\$i<[llength \$split_name]} {incr i} {
        set reversed_name [lindex \$split_name \$i]\$delim\$reversed_name
144
145
146
147
148
149
150
151










152
153
154
155
156

157
158
159
160
proc "plot_var" "title column" {
    exec echo plot \"${dat2}\" using 1:\$column title \"\$title\" with lines > ${tmp}
    exec echo pause -1 >> ${tmp}
    exec gnuplot -title "\$title" ${tmp} &
}

## print output
proc "print" "" {










    exec echo set term postscript > ${tmp}.print
    exec echo set output \"../${sys}_gnuplot.ps\" >> ${tmp}.print
    exec grep -v pause ${tmp} >> ${tmp}.print
    exec gnuplot ${tmp}.print
    puts "Graph printed to ${sys}_gnuplot.ps"

}

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
proc "plot_var" "title column" {
    exec echo plot \"${dat2}\" using 1:\$column title \"\$title\" with lines > ${tmp}
    exec echo pause -1 >> ${tmp}
    exec gnuplot -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}


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