File: orbits.tk

package info (click to toggle)
dstooltk 2.0-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,520 kB
  • ctags: 3,169
  • sloc: ansic: 27,185; tcl: 4,770; makefile: 588; sh: 81; csh: 7
file content (151 lines) | stat: -rw-r--r-- 3,698 bytes parent folder | download | duplicates (2)
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
#
# orbits.tk
#

proc orbits(build) name {
    global Flow Model

    build_Title $name "Orbits"

    build_DismissButtonbar $name dbbar "window(dismiss) orbits" \
	{"Forwards" orbits(forwards) } \
	{"Continue" orbits(continue) } \
	{"Backwards" orbits(backwards) }

    build_Buttonbar $name bb0 \
	{"Clear last" orbits(clear_last) } \
	{"Clear all"  orbits(clear_all) } \
	{"Propagation..." {window(open) prop} }

    pack $name.bb0 -side bottom

    set cmd [build_CmdFrame $name cmd]

    build_LabelEntryColumns $cmd le0 \
	{text {} {"Start:" "Stop:" "Plot factor:"}} \
	{ientry {} {Flow(Start_Save_Points) Flow(Total_Iterates) \
			Flow(Skip_Size)}}
    bind_LabelEntryColumns $cmd.le0 1 <Return> orbits(update)

    if {$Model(Mapping_Flag)} {
	build_LabelEntryColumns $cmd le1
    } else {
	build_LabelEntryColumns $cmd le1 \
	    {text {} {"Step size:"}} {dentry {} {Flow(Stepsize)}}
    }
    bind_LabelEntryColumns $cmd.le1 1 <Return> orbits(update)

    if {$Model(Mapping_Flag)} {
	if {$Flow(Stopping_Condition) > 1} {
	    set Flow(Stopping_Condition) 0
	}
	build_PopupMenu $cmd p1 "Stopping condition:" \
	    Flow(Stopping_Condition) orbits(stop_cond) {"Fixed steps" "Event stopping"}
    } else {
	build_PopupMenu $cmd p1 "Stopping condition:" \
	    Flow(Stopping_Condition) orbits(stop_cond) \
	    [list "Fixed steps" "Event stopping" \
		 "Fixed $Model(Varb_Names,[expr $Model(Varb_Names) - 1])" \
		 "Poincare section"]
    }

    build_LabelEntryColumnsScroll $cmd le3 200\
	[list label {} [ concat \
			     [array_to_list Model Varb_Names] \
			     [array_to_list Model Funct_Names] ] \
	    ] \
	[list dentry {} [ concat \
			      [array_to_list Flow Varb_Event_Values] \
			      [array_to_list Flow Funct_Event_Values] ] \
	    ] \
	[list checkbox {} [ concat \
				[array_to_list Flow Varb_Events] \
				[array_to_list Flow Funct_Events] ] \
	    ]
    bind_LabelEntryColumns $cmd.le3 1 <Return> orbits(update)
    
    pack $cmd -fill both -expand 1

# To make sure panel is configured correctly   BAM 8/16/97
    orbits(stop_cond)

}

proc orbits(enter) {} {
    pm_to_tcl Flow
}

proc orbits(leave) {} {
    orbits(update)
}

proc orbits(update) {} {
    tcl_to_pm Flow
    pm_to_tcl Flow
}

proc orbits(forwards) {} {
    begin_wait "Computing forward orbit..."
    orbits(update)
    pm EXEC Flow.Forwards
    pm_to_tcl Flow Memory Selected
    end_wait
}

proc orbits(continue) {} {
    begin_wait "Continuing orbit..."
    orbits(update)
    pm EXEC Flow.Continue
    pm_to_tcl Flow Memory Selected
    end_wait
}

proc orbits(backwards) {} {
    begin_wait "Computing backward orbit..."
    orbits(update)
    pm EXEC Flow.Backwards
    pm_to_tcl Flow Memory Selected
    end_wait
}

proc orbits(clear_last) {} {
    global Defaults

    begin_wait "Clearing last trajectory..."
    pm EXEC Flow.Clear_Last
    pm_to_tcl Memory
    if {$Defaults(Auto_Refresh) == 1} {
	oneD(refresh_all)
	twoD(refresh_all)
    }
    end_wait "Last trajectory cleared."
}

proc orbits(clear_all) {} {
    global Defaults

    begin_wait "Clearing all trajectories..."
    pm EXEC Flow.Clear_All
    pm_to_tcl Memory
    if {$Defaults(Auto_Refresh) == 1} {
	oneD(refresh_all)
	twoD(refresh_all)
    }	
    end_wait "All trajectories cleared."
}

proc orbits(stop_cond) {} {
    global Flow Defaults

# Modified to change value of Flow(Skip_Size) 8/19/97 BAM 
    if {$Flow(Stopping_Condition) == 3} {
	.orbits.cmd.le0.c0.2 configure -text "Max steps between sections:"
	set Flow(Skip_Size) $Flow(Total_Iterates)
	tcl_to_pm Flow
    } else {
	.orbits.cmd.le0.c0.2 configure -text "Plot factor:"
	set Flow(Skip_Size) $Defaults(Skip_Size)
	tcl_to_pm Flow
    }
    orbits(leave)
}