@@ -1,211 +1,237 | |||||
1 | from django.shortcuts import render_to_response, redirect |
|
1 | from django.shortcuts import render_to_response, redirect | |
No newline at end of file |
|
2 | from abscontrol.models import Profile, Pattern, AntennaDown, AntennaUp No newline at end of file | ||
2 | from abscontrol.models import Profile, Pattern No newline at end of file |
|
|||
3 | No newline at end of file |
|
3 | ||
4 | txtAntenna = "[[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \ No newline at end of file |
|
4 | txtAntenna = "[[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \ | |
5 | "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \ No newline at end of file |
|
5 | "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \ | |
6 | "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \ No newline at end of file |
|
6 | "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \ | |
7 | "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \ No newline at end of file |
|
7 | "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \ | |
8 | "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \ No newline at end of file |
|
8 | "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \ | |
9 | "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \ No newline at end of file |
|
9 | "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]," \ | |
10 | "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \ No newline at end of file |
|
10 | "[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]," \ | |
11 | "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]]" No newline at end of file |
|
11 | "[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5]]" | |
12 | No newline at end of file |
|
12 | ||
13 | txtTxUp = "[[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
13 | txtTxUp = "[[1,1,1,1,1,1,1,1]," \ | |
14 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
14 | "[1,1,1,1,1,1,1,1]," \ | |
15 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
15 | "[1,1,1,1,1,1,1,1]," \ | |
16 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
16 | "[1,1,1,1,1,1,1,1]," \ | |
17 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
17 | "[1,1,1,1,1,1,1,1]," \ | |
18 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
18 | "[1,1,1,1,1,1,1,1]," \ | |
19 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
19 | "[1,1,1,1,1,1,1,1]," \ | |
20 | "[1,1,1,1,1,1,1,1]]" No newline at end of file |
|
20 | "[1,1,1,1,1,1,1,1]]" | |
21 | No newline at end of file |
|
21 | ||
22 | txtTxDown = "[[1,1,1,1,0,0,0,0]," \ No newline at end of file |
|
22 | txtTxDown = "[[1,1,1,1,0,0,0,0]," \ | |
23 | "[1,1,1,1,0,0,0,0]," \ No newline at end of file |
|
23 | "[1,1,1,1,0,0,0,0]," \ | |
24 | "[1,1,1,1,0,0,0,0]," \ No newline at end of file |
|
24 | "[1,1,1,1,0,0,0,0]," \ | |
25 | "[1,1,1,1,0,0,0,0]," \ No newline at end of file |
|
25 | "[1,1,1,1,0,0,0,0]," \ | |
26 | "[0,0,0,0,1,1,1,1]," \ No newline at end of file |
|
26 | "[0,0,0,0,1,1,1,1]," \ | |
27 | "[0,0,0,0,1,1,1,1]," \ No newline at end of file |
|
27 | "[0,0,0,0,1,1,1,1]," \ | |
28 | "[0,0,0,0,1,1,1,1]," \ No newline at end of file |
|
28 | "[0,0,0,0,1,1,1,1]," \ | |
29 | "[0,0,0,0,1,1,1,1]]" No newline at end of file |
|
29 | "[0,0,0,0,1,1,1,1]]" | |
30 | No newline at end of file |
|
30 | ||
31 | txtRxUp = "[[0,0,0,0,1,1,1,1]," \ No newline at end of file |
|
31 | txtRxUp = "[[0,0,0,0,1,1,1,1]," \ | |
32 | "[0,0,0,0,1,1,1,1]," \ No newline at end of file |
|
32 | "[0,0,0,0,1,1,1,1]," \ | |
33 | "[0,0,0,0,1,1,1,1]," \ No newline at end of file |
|
33 | "[0,0,0,0,1,1,1,1]," \ | |
34 | "[0,0,0,0,1,1,1,1]," \ No newline at end of file |
|
34 | "[0,0,0,0,1,1,1,1]," \ | |
35 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
35 | "[1,1,1,1,1,1,1,1]," \ | |
36 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
36 | "[1,1,1,1,1,1,1,1]," \ | |
37 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
37 | "[1,1,1,1,1,1,1,1]," \ | |
38 | "[1,1,1,1,1,1,1,1]]" No newline at end of file |
|
38 | "[1,1,1,1,1,1,1,1]]" | |
39 | No newline at end of file |
|
39 | ||
40 | txtRxDown = "[[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
40 | txtRxDown = "[[1,1,1,1,1,1,1,1]," \ | |
41 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
41 | "[1,1,1,1,1,1,1,1]," \ | |
42 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
42 | "[1,1,1,1,1,1,1,1]," \ | |
43 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
43 | "[1,1,1,1,1,1,1,1]," \ | |
44 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
44 | "[1,1,1,1,1,1,1,1]," \ | |
45 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
45 | "[1,1,1,1,1,1,1,1]," \ | |
46 | "[1,1,1,1,1,1,1,1]," \ No newline at end of file |
|
46 | "[1,1,1,1,1,1,1,1]," \ | |
47 | "[1,1,1,1,1,1,1,1]]" No newline at end of file |
|
47 | "[1,1,1,1,1,1,1,1]]" | |
48 | No newline at end of file |
|
48 | ||
49 | txtUes = "[0.533333,0.00000,1.06667,0.00000]" No newline at end of file |
|
49 | txtUes = "[0.533333,0.00000,1.06667,0.00000]" | |
50 | No newline at end of file |
|
50 | ||
51 | def index(request): No newline at end of file |
|
51 | def index(request): | |
52 | #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5] No newline at end of file |
|
52 | #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5] | |
53 | profile_list = Profile.objects.all() No newline at end of file |
|
53 | profile_list = Profile.objects.all() | |
54 | return render_to_response('abscontrol/index.html', {'profile_list': profile_list}) No newline at end of file |
|
54 | return render_to_response('abscontrol/index.html', {'profile_list': profile_list}) | |
55 | No newline at end of file |
|
55 | ||
56 | def new(request): No newline at end of file |
|
56 | def new(request): | |
57 | profile_list = Profile.objects.all() No newline at end of file |
|
57 | profile_list = Profile.objects.all() | |
58 | No newline at end of file |
|
58 | ||
59 | return render_to_response('abscontrol/new.html', {'profile_list': profile_list, No newline at end of file |
|
59 | return render_to_response('abscontrol/new.html', {'profile_list': profile_list, | |
60 | 'txtAntenna' : txtAntenna, No newline at end of file |
|
60 | 'txtAntenna' : txtAntenna, | |
61 | 'txtUes' : txtUes, 'txtTxUp' : txtTxUp, No newline at end of file |
|
61 | 'txtUes' : txtUes, 'txtTxUp' : txtTxUp, | |
62 | 'txtTxDown' : txtTxDown, 'txtRxUp' : txtRxUp, No newline at end of file |
|
62 | 'txtTxDown' : txtTxDown, 'txtRxUp' : txtRxUp, | |
63 | 'txtRxDown' : txtRxDown, No newline at end of file |
|
63 | 'txtRxDown' : txtRxDown, | |
64 | }) No newline at end of file |
|
64 | }) | |
65 | No newline at end of file |
|
65 | ||
66 | def save(request): No newline at end of file |
|
66 | def save(request): | |
67 | No newline at end of file |
|
67 | ||
68 | txtProfile = request.POST["txtProfile"] No newline at end of file |
|
68 | txtProfile = request.POST["txtProfile"] | |
69 | No newline at end of file |
|
69 | ||
70 | txtAntennaUp = request.POST["txtAntennaUp"] No newline at end of file |
|
70 | txtAntennaUp = request.POST["txtAntennaUp"] | |
71 | txtTxUp = request.POST["txtTxUp"] No newline at end of file |
|
71 | txtTxUp = request.POST["txtTxUp"] | |
72 | txtRxUp = request.POST["txtRxUp"] No newline at end of file |
|
72 | txtRxUp = request.POST["txtRxUp"] | |
73 | txtUesUp = request.POST["txtUesUp"] No newline at end of file |
|
73 | txtUesUp = request.POST["txtUesUp"] | |
74 | No newline at end of file |
|
74 | ||
75 | txtAntennaDown = request.POST["txtAntennaDown"] No newline at end of file |
|
75 | txtAntennaDown = request.POST["txtAntennaDown"] | |
76 | txtTxDown = request.POST["txtTxDown"] No newline at end of file |
|
76 | txtTxDown = request.POST["txtTxDown"] | |
77 | txtRxDown = request.POST["txtRxDown"] No newline at end of file |
|
77 | txtRxDown = request.POST["txtRxDown"] | |
78 | txtUesDown = request.POST["txtUesDown"] No newline at end of file |
|
78 | txtUesDown = request.POST["txtUesDown"] | |
79 | No newline at end of file |
|
79 | ||
80 | newprofile = Profile(name=txtProfile) No newline at end of file |
|
80 | newprofile = Profile(name=txtProfile) | |
81 | newprofile.save() No newline at end of file |
|
81 | newprofile.save() | |
82 | No newline at end of file |
|
82 | ||
83 | newpattern = newprofile.pattern_set.create(value=1) No newline at end of file |
|
83 | newpattern = newprofile.pattern_set.create(value=1) | |
84 | newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp) No newline at end of file |
|
84 | newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp) | |
85 | newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown) No newline at end of file |
|
85 | newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown) | |
86 | No newline at end of file |
|
86 | ||
87 | newurl = '/abscontrol/view/%d' % newprofile.id No newline at end of file |
|
87 | newurl = '/abscontrol/view/%d' % newprofile.id | |
88 | No newline at end of file |
|
88 | ||
89 | return redirect(newurl) No newline at end of file |
|
89 | return redirect(newurl) | |
90 | No newline at end of file |
|
90 | ||
91 | def view(request, profile_id): No newline at end of file |
|
91 | def view(request, profile_id): | |
92 | nextPattern = 0 No newline at end of file |
|
92 | nextPattern = 0 | |
93 | No newline at end of file |
|
93 | ||
94 | if request.method == 'GET' and 'pattern' in request.GET: No newline at end of file |
|
94 | if request.method == 'GET' and 'pattern' in request.GET: | |
95 | pattern_value = request.GET["pattern"] No newline at end of file |
|
95 | pattern_value = request.GET["pattern"] | |
96 | else: No newline at end of file |
|
96 | else: | |
97 | pattern_value = 1 No newline at end of file |
|
97 | pattern_value = 1 | |
98 | No newline at end of file |
|
98 | ||
99 | profile_list = Profile.objects.all() No newline at end of file |
|
99 | profile_list = Profile.objects.all() | |
100 | objProfile = Profile.objects.get(pk=profile_id) No newline at end of file |
|
100 | objProfile = Profile.objects.get(pk=profile_id) | |
101 | No newline at end of file |
|
101 | ||
102 | lsPatterns = objProfile.pattern_set.all() No newline at end of file |
|
102 | lsPatterns = objProfile.pattern_set.all() | |
103 | patternChoosen = objProfile.pattern_set.get(value=pattern_value) No newline at end of file |
|
103 | patternChoosen = objProfile.pattern_set.get(value=pattern_value) | |
104 | objAntennaUp = patternChoosen.antennaup_set.get() No newline at end of file |
|
104 | objAntennaUp = patternChoosen.antennaup_set.get() | |
105 | objAntennaDown = patternChoosen.antennadown_set.get() No newline at end of file |
|
105 | objAntennaDown = patternChoosen.antennadown_set.get() | |
106 | No newline at end of file |
|
106 | ||
107 | if len(lsPatterns) > 1: No newline at end of file |
|
107 | if len(lsPatterns) > 1: | |
108 | if pattern_value == 1: No newline at end of file |
|
108 | if pattern_value == 1: | |
109 | nextValuePattern = pattern_value + 1 No newline at end of file |
|
109 | nextValuePattern = pattern_value + 1 | |
110 | nextPattern = objProfile.pattern_set.get(value=nextValuePattern) No newline at end of file |
|
110 | nextPattern = objProfile.pattern_set.get(value=nextValuePattern) | |
111 | No newline at end of file |
|
111 | ||
112 | No newline at end of file |
|
112 | ||
113 | return render_to_response('abscontrol/view.html', {'objProfile': objProfile, 'profile_list': profile_list, No newline at end of file |
|
113 | return render_to_response('abscontrol/view.html', {'objProfile': objProfile, 'profile_list': profile_list, | |
114 | 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns, No newline at end of file |
|
114 | 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns, | |
115 | 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown, No newline at end of file |
|
115 | 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown, | |
116 | 'nextPattern' : nextPattern, No newline at end of file |
|
116 | 'nextPattern' : nextPattern, | |
117 | }) No newline at end of file |
|
117 | }) | |
118 | No newline at end of file |
|
118 | ||
119 | def edit(request, profile_id): No newline at end of file |
|
119 | def edit(request, profile_id): | |
120 | if request.method == 'GET' and 'pattern' in request.GET: No newline at end of file |
|
120 | if request.method == 'GET' and 'pattern' in request.GET: | |
121 | pattern_value = request.GET["pattern"] No newline at end of file |
|
121 | pattern_value = request.GET["pattern"] | |
122 | else: No newline at end of file |
|
122 | else: | |
123 | pattern_value = 1 No newline at end of file |
|
123 | pattern_value = 1 | |
124 | No newline at end of file |
|
124 | ||
125 | profile_list = Profile.objects.all() No newline at end of file |
|
125 | profile_list = Profile.objects.all() | |
126 | objProfile = Profile.objects.get(pk=profile_id) No newline at end of file |
|
126 | objProfile = Profile.objects.get(pk=profile_id) | |
127 | No newline at end of file |
|
127 | ||
128 | lsPatterns = objProfile.pattern_set.all() No newline at end of file |
|
128 | lsPatterns = objProfile.pattern_set.all() | |
129 | patternChoosen = objProfile.pattern_set.get(value=pattern_value) No newline at end of file |
|
129 | patternChoosen = objProfile.pattern_set.get(value=pattern_value) | |
130 | objAntennaUp = patternChoosen.antennaup_set.get() No newline at end of file |
|
130 | objAntennaUp = patternChoosen.antennaup_set.get() | |
131 | objAntennaDown = patternChoosen.antennadown_set.get() No newline at end of file |
|
131 | objAntennaDown = patternChoosen.antennadown_set.get() | |
132 | No newline at end of file |
|
132 | ||
133 | return render_to_response('abscontrol/edit.html', {'objProfile': objProfile, 'profile_list': profile_list, No newline at end of file |
|
133 | return render_to_response('abscontrol/edit.html', {'objProfile': objProfile, 'profile_list': profile_list, | |
134 | 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns, No newline at end of file |
|
134 | 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns, | |
135 | 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown, No newline at end of file |
|
135 | 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown, | |
136 | }) No newline at end of file |
|
136 | }) | |
137 | No newline at end of file |
|
137 | ||
138 | def addPattern(request, profile_id): No newline at end of file |
|
138 | def addPattern(request, profile_id): | |
139 | profile_list = Profile.objects.all() No newline at end of file |
|
139 | profile_list = Profile.objects.all() | |
140 | objProfile = Profile.objects.get(pk=profile_id) No newline at end of file |
|
140 | objProfile = Profile.objects.get(pk=profile_id) | |
141 | No newline at end of file |
|
141 | ||
142 | return render_to_response('abscontrol/addPattern.html', {'objProfile': objProfile, 'profile_list': profile_list, No newline at end of file |
|
142 | return render_to_response('abscontrol/addPattern.html', {'objProfile': objProfile, 'profile_list': profile_list, | |
143 | 'txtAntenna' : txtAntenna, 'txtUes' : txtUes, No newline at end of file |
|
143 | 'txtAntenna' : txtAntenna, 'txtUes' : txtUes, | |
144 | 'txtTxUp' : txtTxUp, 'txtTxDown' : txtTxDown, No newline at end of file |
|
144 | 'txtTxUp' : txtTxUp, 'txtTxDown' : txtTxDown, | |
145 | 'txtRxUp' : txtRxUp, 'txtRxDown' : txtRxDown, No newline at end of file |
|
145 | 'txtRxUp' : txtRxUp, 'txtRxDown' : txtRxDown, | |
146 | }) No newline at end of file |
|
146 | }) | |
147 | No newline at end of file |
|
147 | ||
148 | def editPattern(request, profile_id, pattern_id): No newline at end of file |
|
148 | def editPattern(request, profile_id, pattern_id): | |
149 | profile_list = Profile.objects.all() No newline at end of file |
|
149 | profile_list = Profile.objects.all() | |
150 | objProfile = Profile.objects.get(pk=profile_id) No newline at end of file |
|
150 | objProfile = Profile.objects.get(pk=profile_id) | |
151 | lsPatterns = objProfile.pattern_set.all() No newline at end of file |
|
151 | lsPatterns = objProfile.pattern_set.all() | |
152 | patternChoosen = Pattern.objects.get(pk=pattern_id) No newline at end of file |
|
152 | patternChoosen = Pattern.objects.get(pk=pattern_id) | |
153 | objAntennaUp = patternChoosen.antennaup_set.get() No newline at end of file |
|
153 | objAntennaUp = patternChoosen.antennaup_set.get() | |
154 | objAntennaDown = patternChoosen.antennadown_set.get() No newline at end of file |
|
154 | objAntennaDown = patternChoosen.antennadown_set.get() | |
155 | No newline at end of file |
|
155 | ||
156 | return render_to_response('abscontrol/editPattern.html', {'objProfile': objProfile, 'profile_list': profile_list, No newline at end of file |
|
156 | return render_to_response('abscontrol/editPattern.html', {'objProfile': objProfile, 'profile_list': profile_list, | |
157 | 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns, No newline at end of file |
|
157 | 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns, | |
158 | 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown, No newline at end of file |
|
158 | 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown, | |
159 | }) No newline at end of file |
|
159 | }) | |
160 | No newline at end of file |
|
160 | ||
161 | def savePattern(request, profile_id): No newline at end of file |
|
161 | def savePattern(request, profile_id): | |
|
162 | pattern_id = 0 | |||
|
No newline at end of file | ||||
|
163 | method = "save" | |||
|
No newline at end of file | ||||
|
164 | ||||
|
No newline at end of file | ||||
|
165 | if 'pattern_id' in request.POST: | |||
|
No newline at end of file | ||||
|
166 | pattern_id = request.POST["pattern_id"] | |||
|
No newline at end of file | ||||
|
167 | method = "update" | |||
|
No newline at end of file | ||||
|
168 | No newline at end of file | |||
162 | maxValuePattern = 0 No newline at end of file |
|
169 | maxValuePattern = 0 | |
163 | txtAntennaUp = request.POST["txtAntennaUp"] No newline at end of file |
|
170 | txtAntennaUp = request.POST["txtAntennaUp"] | |
164 | txtTxUp = request.POST["txtTxUp"] No newline at end of file |
|
171 | txtTxUp = request.POST["txtTxUp"] | |
165 | txtRxUp = request.POST["txtRxUp"] No newline at end of file |
|
172 | txtRxUp = request.POST["txtRxUp"] | |
166 | txtUesUp = request.POST["txtUesUp"] No newline at end of file |
|
173 | txtUesUp = request.POST["txtUesUp"] | |
167 | No newline at end of file |
|
174 | ||
168 | txtAntennaDown = request.POST["txtAntennaDown"] No newline at end of file |
|
175 | txtAntennaDown = request.POST["txtAntennaDown"] | |
169 | txtTxDown = request.POST["txtTxDown"] No newline at end of file |
|
176 | txtTxDown = request.POST["txtTxDown"] | |
170 | txtRxDown = request.POST["txtRxDown"] No newline at end of file |
|
177 | txtRxDown = request.POST["txtRxDown"] | |
171 | txtUesDown = request.POST["txtUesDown"] No newline at end of file |
|
178 | txtUesDown = request.POST["txtUesDown"] | |
172 | No newline at end of file |
|
179 | ||
|
180 | if method == "save": No newline at end of file | |||
173 | objProfile = Profile.objects.get(pk=profile_id) No newline at end of file |
|
181 | objProfile = Profile.objects.get(pk=profile_id) | |
174 | lsPatterns = objProfile.pattern_set.all() No newline at end of file |
|
182 | lsPatterns = objProfile.pattern_set.all() | |
175 | for element in lsPatterns: No newline at end of file |
|
183 | for element in lsPatterns: | |
176 | if element.value > maxValuePattern: No newline at end of file |
|
184 | if element.value > maxValuePattern: | |
177 | maxPattern = element.value No newline at end of file |
|
185 | maxPattern = element.value | |
178 | No newline at end of file |
|
186 | ||
179 | if maxPattern < 10 : No newline at end of file |
|
187 | if maxPattern < 10 : | |
180 | newValuePattern = maxPattern + 1 No newline at end of file |
|
188 | newValuePattern = maxPattern + 1 | |
181 | newpattern = objProfile.pattern_set.create(value=newValuePattern) No newline at end of file |
|
189 | newpattern = objProfile.pattern_set.create(value=newValuePattern) | |
182 | newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp) No newline at end of file |
|
190 | newpattern.antennaup_set.create(value=txtAntennaUp,tx=txtTxUp,rx=txtRxUp,ues=txtUesUp) | |
183 | newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown) No newline at end of file |
|
191 | newpattern.antennadown_set.create(value=txtAntennaDown,tx=txtTxDown,rx=txtRxDown,ues=txtUesDown) | |
184 | No newline at end of file |
|
192 | ||
185 | newurl = '/abscontrol/%d/view/%d' % (int(profile_id), newpattern.id) No newline at end of file |
|
193 | newurl = '/abscontrol/%d/view/%d' % (int(profile_id), newpattern.id) | |
186 | else: No newline at end of file |
|
194 | else: | |
187 | newurl = '/abscontrol/edit/%d' % (int(profile_id)) No newline at end of file |
|
195 | newurl = '/abscontrol/edit/%d' % (int(profile_id)) | |
|
196 | else: | |||
|
No newline at end of file | ||||
|
197 | txtAntennaUpId = request.POST["txtAntennaUpId"] | |||
|
No newline at end of file | ||||
|
198 | objAntennaUp = AntennaUp.objects.get(pk=txtAntennaUpId) | |||
|
No newline at end of file | ||||
|
199 | objAntennaUp.value = txtAntennaUp | |||
|
No newline at end of file | ||||
|
200 | objAntennaUp.tx = txtTxUp | |||
|
No newline at end of file | ||||
|
201 | objAntennaUp.rx = txtRxUp | |||
|
No newline at end of file | ||||
|
202 | objAntennaUp.ues = txtUesUp | |||
|
No newline at end of file | ||||
|
203 | objAntennaUp.save() | |||
|
No newline at end of file | ||||
|
204 | ||||
|
No newline at end of file | ||||
|
205 | txtAntennaDownId = request.POST["txtAntennaDownId"] | |||
|
No newline at end of file | ||||
|
206 | objAntennaDown = AntennaDown.objects.get(pk=txtAntennaDownId) | |||
|
No newline at end of file | ||||
|
207 | objAntennaDown.value = txtAntennaDown | |||
|
No newline at end of file | ||||
|
208 | objAntennaDown.tx = txtTxDown | |||
|
No newline at end of file | ||||
|
209 | objAntennaDown.rx = txtRxDown | |||
|
No newline at end of file | ||||
|
210 | objAntennaDown.ues = txtUesDown | |||
|
No newline at end of file | ||||
|
211 | objAntennaDown.save() | |||
|
No newline at end of file | ||||
|
212 | ||||
|
No newline at end of file | ||||
|
213 | newurl = '/abscontrol/%d/view/%d' % (int(profile_id), int(pattern_id)) No newline at end of file | |||
188 | No newline at end of file |
|
214 | ||
189 | return redirect(newurl) No newline at end of file |
|
215 | return redirect(newurl) | |
190 | No newline at end of file |
|
216 | ||
191 | def viewPattern(request, profile_id, pattern_id): No newline at end of file |
|
217 | def viewPattern(request, profile_id, pattern_id): | |
192 | No newline at end of file |
|
218 | ||
193 | profile_list = Profile.objects.all() No newline at end of file |
|
219 | profile_list = Profile.objects.all() | |
194 | objProfile = Profile.objects.get(pk=profile_id) No newline at end of file |
|
220 | objProfile = Profile.objects.get(pk=profile_id) | |
195 | No newline at end of file |
|
221 | ||
196 | patternChoosen = Pattern.objects.get(pk=pattern_id) No newline at end of file |
|
222 | patternChoosen = Pattern.objects.get(pk=pattern_id) | |
197 | No newline at end of file |
|
223 | ||
198 | objAntennaUp = patternChoosen.antennaup_set.get() No newline at end of file |
|
224 | objAntennaUp = patternChoosen.antennaup_set.get() | |
199 | objAntennaDown = patternChoosen.antennadown_set.get() No newline at end of file |
|
225 | objAntennaDown = patternChoosen.antennadown_set.get() | |
200 | No newline at end of file |
|
226 | ||
201 | lsPatterns = objProfile.pattern_set.all() No newline at end of file |
|
227 | lsPatterns = objProfile.pattern_set.all() | |
202 | No newline at end of file |
|
228 | ||
203 | return render_to_response('abscontrol/viewPattern.html', {'objProfile': objProfile, 'profile_list': profile_list, No newline at end of file |
|
229 | return render_to_response('abscontrol/viewPattern.html', {'objProfile': objProfile, 'profile_list': profile_list, | |
204 | 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns, No newline at end of file |
|
230 | 'patternChoosen' : patternChoosen, 'lsPatterns' : lsPatterns, | |
205 | 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown, No newline at end of file |
|
231 | 'antennaUp' : objAntennaUp, 'antennaDown' : objAntennaDown, | |
206 | }) No newline at end of file |
|
232 | }) | |
207 | No newline at end of file |
|
233 | ||
208 | def deletePattern(request, profile_id, pattern_id): No newline at end of file |
|
234 | def deletePattern(request, profile_id, pattern_id): | |
209 | newurl = '/abscontrol/edit/%d' % int(profile_id) No newline at end of file |
|
235 | newurl = '/abscontrol/edit/%d' % int(profile_id) | |
210 | No newline at end of file |
|
236 | ||
211 | return redirect(newurl) No newline at end of file |
|
237 | return redirect(newurl) |
@@ -1,65 +1,64 | |||||
1 | {% extends "abscontrol/edit.html" %} No newline at end of file |
|
1 | {% extends "abscontrol/edit.html" %} | |
2 | No newline at end of file |
|
2 | ||
3 | {% block mnuPattern %} No newline at end of file |
|
3 | {% block mnuPattern %} | |
4 | <div class="divMenu" id="divMnuPattern"> No newline at end of file |
|
4 | <div class="divMenu" id="divMnuPattern"> | |
5 | <nav class="MnuHorizontal"> No newline at end of file |
|
5 | <nav class="MnuHorizontal"> | |
6 | <ul class="mnu" id="mnuPattern"> No newline at end of file |
|
6 | <ul class="mnu" id="mnuPattern"> | |
7 | <li><a href="#" id="lnkSave">Save</a></li> No newline at end of file |
|
7 | <li><a href="#" id="lnkSave">Save</a></li> | |
8 | <li><a href="#" id="lnkCancel">Cancel</a></li> No newline at end of file |
|
8 | <li><a href="#" id="lnkCancel">Cancel</a></li> | |
9 | </ul> No newline at end of file |
|
9 | </ul> | |
10 | </nav> No newline at end of file |
|
10 | </nav> | |
11 | </div> No newline at end of file |
|
11 | </div> | |
12 | <div class="cleardivs"></div> No newline at end of file |
|
12 | <div class="cleardivs"></div> | |
13 | {% endblock %} No newline at end of file |
|
13 | {% endblock %} | |
14 | {% block pattern %} No newline at end of file |
|
14 | {% block pattern %} | |
15 | <div id="infoPattern"> No newline at end of file |
|
15 | <div id="infoPattern"> | |
16 | <form action="/abscontrol/{{ objProfile.id }}/save/" id="frmPattern" method="post"> No newline at end of file |
|
16 | <form action="/abscontrol/{{ objProfile.id }}/save/" id="frmPattern" method="post"> | |
17 | <div id="antennaUp"> No newline at end of file |
|
17 | <div id="antennaUp"> | |
18 | <fieldset class="flsAntenna"> No newline at end of file |
|
18 | <fieldset class="flsAntenna"> | |
19 | <legend>UP</legend> No newline at end of file |
|
19 | <legend>UP</legend> | |
20 | <div class="divAntenna"> No newline at end of file |
|
20 | <div class="divAntenna"> | |
21 | <label for="lblAntenna">Antenna</label> No newline at end of file |
|
21 | <label for="lblAntenna">Antenna</label> | |
22 | <textarea name="txtAntennaUp" class="txtAntenna" cols="38" rows="8">{{ txtAntenna }}</textarea> No newline at end of file |
|
22 | <textarea name="txtAntennaUp" class="txtAntenna" cols="38" rows="8">{{ txtAntenna }}</textarea> | |
23 | </div> No newline at end of file |
|
23 | </div> | |
24 | <div class="divTx"> No newline at end of file |
|
24 | <div class="divTx"> | |
25 | <label for="lblTx">Tx</label> No newline at end of file |
|
25 | <label for="lblTx">Tx</label> | |
26 | <textarea name="txtTxUp" class="txtTR" cols="20" rows="8">{{ txtTxUp }}</textarea> No newline at end of file |
|
26 | <textarea name="txtTxUp" class="txtTR" cols="20" rows="8">{{ txtTxUp }}</textarea> | |
27 | </div> No newline at end of file |
|
27 | </div> | |
28 | <div class="divTx"> No newline at end of file |
|
28 | <div class="divTx"> | |
29 | <label for="lblRx">Rx</label> No newline at end of file |
|
29 | <label for="lblRx">Rx</label> | |
30 | <textarea name="txtRxUp" class="txtTR" cols="20" rows="8">{{ txtRxUp }}</textarea> No newline at end of file |
|
30 | <textarea name="txtRxUp" class="txtTR" cols="20" rows="8">{{ txtRxUp }}</textarea> | |
31 | </div> No newline at end of file |
|
31 | </div> | |
32 | <div class="cleardivs"></div> No newline at end of file |
|
32 | <div class="cleardivs"></div> | |
33 | <div class="divUes"> No newline at end of file |
|
33 | <div class="divUes"> | |
34 | <label for="lblUes">Ues:</label> No newline at end of file |
|
34 | <label for="lblUes">Ues:</label> | |
35 | <input type="text" name="txtUesUp" value="{{ txtUes }}" /> No newline at end of file |
|
35 | <input type="text" name="txtUesUp" value="{{ txtUes }}" /> | |
36 | </div> No newline at end of file |
|
36 | </div> | |
37 | </fieldset> No newline at end of file |
|
37 | </fieldset> | |
38 | </div> No newline at end of file |
|
38 | </div> | |
39 | <div id="antennaDown"> No newline at end of file |
|
39 | <div id="antennaDown"> | |
40 | <fieldset class="flsAntenna"> No newline at end of file |
|
40 | <fieldset class="flsAntenna"> | |
41 | <legend>DOWN</legend> No newline at end of file |
|
41 | <legend>DOWN</legend> | |
42 | <div class="divAntenna"> No newline at end of file |
|
42 | <div class="divAntenna"> | |
43 | <label for="lblAntenna">Antenna</label> No newline at end of file |
|
43 | <label for="lblAntenna">Antenna</label> | |
44 | <textarea name="txtAntennaDown" class="txtAntenna" cols="38" rows="8">{{ txtAntenna }}</textarea> No newline at end of file |
|
44 | <textarea name="txtAntennaDown" class="txtAntenna" cols="38" rows="8">{{ txtAntenna }}</textarea> | |
45 | </div> No newline at end of file |
|
45 | </div> | |
46 | <div class="divTx"> No newline at end of file |
|
46 | <div class="divTx"> | |
47 | <label for="lblTx">Tx</label> No newline at end of file |
|
47 | <label for="lblTx">Tx</label> | |
48 | <textarea name="txtTxDown" class="txtTR" cols="20" rows="8">{{ txtTxDown }}</textarea> No newline at end of file |
|
48 | <textarea name="txtTxDown" class="txtTR" cols="20" rows="8">{{ txtTxDown }}</textarea> | |
49 | </div> No newline at end of file |
|
49 | </div> | |
50 | <div class="divTx"> No newline at end of file |
|
50 | <div class="divTx"> | |
51 | <label for="lblRx">Rx</label> No newline at end of file |
|
51 | <label for="lblRx">Rx</label> | |
52 | <textarea name="txtRxDown" class="txtTR" cols="20" rows="8">{{ txtRxDown }}</textarea> No newline at end of file |
|
52 | <textarea name="txtRxDown" class="txtTR" cols="20" rows="8">{{ txtRxDown }}</textarea> | |
53 | </div> No newline at end of file |
|
53 | </div> | |
54 | <div class="cleardivs"></div> No newline at end of file |
|
54 | <div class="cleardivs"></div> | |
55 | <div class="divUes"> No newline at end of file |
|
55 | <div class="divUes"> | |
56 | <label for="lblUes">Ues:</label> No newline at end of file |
|
56 | <label for="lblUes">Ues:</label> | |
57 | <input type="text" name="txtUesDown" value="{{ txtUes }}" /> No newline at end of file |
|
57 | <input type="text" name="txtUesDown" value="{{ txtUes }}" /> | |
58 | </div> No newline at end of file |
|
58 | </div> | |
59 | </fieldset> No newline at end of file |
|
59 | </fieldset> | |
60 | </div> |
|
60 | </div> | |
No newline at end of file |
|
||||
61 | <input type="hidden" name="pattern_id" id="pattern_id" value="0" /> No newline at end of file |
|
|||
62 | <input type="hidden" name="profile_id" id="profile_id" value="{{ objProfile.id }}" /> No newline at end of file |
|
61 | <input type="hidden" name="profile_id" id="profile_id" value="{{ objProfile.id }}" /> | |
63 | </form> No newline at end of file |
|
62 | </form> | |
64 | </div> No newline at end of file |
|
63 | </div> | |
65 | {% endblock %} No newline at end of file |
|
64 | {% endblock %} |
@@ -1,69 +1,73 | |||||
1 | {% extends "abscontrol/edit.html" %} No newline at end of file |
|
1 | {% extends "abscontrol/edit.html" %} | |
2 | No newline at end of file |
|
2 | ||
3 | {% block mnuPattern %} No newline at end of file |
|
3 | {% block mnuPattern %} | |
4 | <div class="divMenu" id="divMnuPattern"> No newline at end of file |
|
4 | <div class="divMenu" id="divMnuPattern"> | |
5 | <nav class="MnuHorizontal"> No newline at end of file |
|
5 | <nav class="MnuHorizontal"> | |
6 | <ul class="mnu" id="mnuPattern"> No newline at end of file |
|
6 | <ul class="mnu" id="mnuPattern"> | |
7 | <li><a href="#" id="lnkSave">Save</a></li> No newline at end of file |
|
7 | <li><a href="#" id="lnkSave">Save</a></li> | |
8 | <li><a href="#" id="lnkCancel">Cancel</a></li> No newline at end of file |
|
8 | <li><a href="#" id="lnkCancel">Cancel</a></li> | |
9 | </ul> No newline at end of file |
|
9 | </ul> | |
10 | </nav> No newline at end of file |
|
10 | </nav> | |
11 | </div> No newline at end of file |
|
11 | </div> | |
12 | <div class="cleardivs"></div> No newline at end of file |
|
12 | <div class="cleardivs"></div> | |
13 | {% endblock %} No newline at end of file |
|
13 | {% endblock %} | |
14 | {% block pattern %} No newline at end of file |
|
14 | {% block pattern %} | |
15 | <div id="infoPattern"> No newline at end of file |
|
15 | <div id="infoPattern"> | |
16 | {% if patternChoosen %} No newline at end of file |
|
16 | {% if patternChoosen %} | |
17 | <div id="navPatterns"> No newline at end of file |
|
17 | <div id="navPatterns"> | |
18 | <label for="lblValue">Pattern:</label> No newline at end of file |
|
18 | <label for="lblValue">Pattern:</label> | |
19 | <label for="lblPatternValue">{{ patternChoosen.value }}</label> No newline at end of file |
|
19 | <label for="lblPatternValue">{{ patternChoosen.value }}</label> | |
20 | </div> No newline at end of file |
|
20 | </div> | |
21 | {% endif %} No newline at end of file |
|
21 | {% endif %} | |
|
22 | <form action="/abscontrol/{{ objProfile.id }}/save/" id="frmPattern" method="post"> No newline at end of file | |||
22 | <div id="antennaUp"> No newline at end of file |
|
23 | <div id="antennaUp"> | |
23 | <fieldset class="flsAntenna"> No newline at end of file |
|
24 | <fieldset class="flsAntenna"> | |
24 | <legend>UP</legend> No newline at end of file |
|
25 | <legend>UP</legend> | |
25 | <div class="divAntenna"> No newline at end of file |
|
26 | <div class="divAntenna"> | |
26 | <label for="lblAntenna">Antenna</label> No newline at end of file |
|
27 | <label for="lblAntenna">Antenna</label> | |
27 | <textarea name="txtAntennaUp" class="txtAntenna" cols="38" rows="8">{{ antennaUp.value }}</textarea> No newline at end of file |
|
28 | <textarea name="txtAntennaUp" class="txtAntenna" cols="38" rows="8">{{ antennaUp.value }}</textarea> | |
28 | </div> No newline at end of file |
|
29 | </div> | |
29 | <div class="divTx"> No newline at end of file |
|
30 | <div class="divTx"> | |
30 | <label for="lblTx">Tx</label> No newline at end of file |
|
31 | <label for="lblTx">Tx</label> | |
31 | <textarea name="txtTxUp" class="txtTR" cols="20" rows="8">{{ antennaUp.tx }}</textarea> No newline at end of file |
|
32 | <textarea name="txtTxUp" class="txtTR" cols="20" rows="8">{{ antennaUp.tx }}</textarea> | |
32 | </div> No newline at end of file |
|
33 | </div> | |
33 | <div class="divTx"> No newline at end of file |
|
34 | <div class="divTx"> | |
34 | <label for="lblRx">Rx</label> No newline at end of file |
|
35 | <label for="lblRx">Rx</label> | |
35 | <textarea name="txtRxUp" class="txtTR" cols="20" rows="8">{{ antennaUp.rx }}</textarea> No newline at end of file |
|
36 | <textarea name="txtRxUp" class="txtTR" cols="20" rows="8">{{ antennaUp.rx }}</textarea> | |
36 | </div> No newline at end of file |
|
37 | </div> | |
37 | <div class="cleardivs"></div> No newline at end of file |
|
38 | <div class="cleardivs"></div> | |
38 | <div class="divUes"> No newline at end of file |
|
39 | <div class="divUes"> | |
39 | <label for="lblUes">Ues:</label> No newline at end of file |
|
40 | <label for="lblUes">Ues:</label> | |
40 | <input type="text" name="txtUesUp" value="{{ antennaUp.ues }}" /> No newline at end of file |
|
41 | <input type="text" name="txtUesUp" value="{{ antennaUp.ues }}" /> | |
41 | </div> No newline at end of file |
|
42 | </div> | |
|
43 | <input type="hidden" name="txtAntennaUpId" value="{{ antennaUp.id }}" /> No newline at end of file | |||
42 | </fieldset> No newline at end of file |
|
44 | </fieldset> | |
43 | </div> No newline at end of file |
|
45 | </div> | |
44 | <div id="antennaDown"> No newline at end of file |
|
46 | <div id="antennaDown"> | |
45 | <fieldset class="flsAntenna"> No newline at end of file |
|
47 | <fieldset class="flsAntenna"> | |
46 | <legend>DOWN</legend> No newline at end of file |
|
48 | <legend>DOWN</legend> | |
47 | <div class="divAntenna"> No newline at end of file |
|
49 | <div class="divAntenna"> | |
48 | <label for="lblAntenna">Antenna</label> No newline at end of file |
|
50 | <label for="lblAntenna">Antenna</label> | |
49 | <textarea name="txtAntennaDown" class="txtAntenna" cols="38" rows="8">{{ antennaDown.value }}</textarea> No newline at end of file |
|
51 | <textarea name="txtAntennaDown" class="txtAntenna" cols="38" rows="8">{{ antennaDown.value }}</textarea> | |
50 | </div> No newline at end of file |
|
52 | </div> | |
51 | <div class="divTx"> No newline at end of file |
|
53 | <div class="divTx"> | |
52 | <label for="lblTx">Tx</label> No newline at end of file |
|
54 | <label for="lblTx">Tx</label> | |
53 | <textarea name="txtTxDown" class="txtTR" cols="20" rows="8">{{ antennaDown.tx }}</textarea> No newline at end of file |
|
55 | <textarea name="txtTxDown" class="txtTR" cols="20" rows="8">{{ antennaDown.tx }}</textarea> | |
54 | </div> No newline at end of file |
|
56 | </div> | |
55 | <div class="divTx"> No newline at end of file |
|
57 | <div class="divTx"> | |
56 | <label for="lblRx">Rx</label> No newline at end of file |
|
58 | <label for="lblRx">Rx</label> | |
57 | <textarea name="txtRxDown" class="txtTR" cols="20" rows="8">{{ antennaDown.rx }}</textarea> No newline at end of file |
|
59 | <textarea name="txtRxDown" class="txtTR" cols="20" rows="8">{{ antennaDown.rx }}</textarea> | |
58 | </div> No newline at end of file |
|
60 | </div> | |
59 | <div class="cleardivs"></div> No newline at end of file |
|
61 | <div class="cleardivs"></div> | |
60 | <div class="divUes"> No newline at end of file |
|
62 | <div class="divUes"> | |
61 | <label for="lblUes">Ues:</label> No newline at end of file |
|
63 | <label for="lblUes">Ues:</label> | |
62 | <input type="text" name="txtUesDown" value="{{ antennaDown.ues }}" /> No newline at end of file |
|
64 | <input type="text" name="txtUesDown" value="{{ antennaDown.ues }}" /> | |
63 | </div> No newline at end of file |
|
65 | </div> | |
|
66 | <input type="hidden" name="txtAntennaDownId" value="{{ antennaDown.id }}" /> No newline at end of file | |||
64 | </fieldset> No newline at end of file |
|
67 | </fieldset> | |
65 | </div> No newline at end of file |
|
68 | </div> | |
66 | <input type="hidden" name="pattern_id" id="pattern_id" value="{{ patternChoosen.id }}" /> No newline at end of file |
|
69 | <input type="hidden" name="pattern_id" id="pattern_id" value="{{ patternChoosen.id }}" /> | |
67 | <input type="hidden" name="profile_id" id="profile_id" value="{{ objProfile.id }}" /> No newline at end of file |
|
70 | <input type="hidden" name="profile_id" id="profile_id" value="{{ objProfile.id }}" /> | |
|
71 | </form> No newline at end of file | |||
68 | </div> No newline at end of file |
|
72 | </div> | |
69 | {% endblock %} No newline at end of file |
|
73 | {% endblock %} |
General Comments 0
You need to be logged in to leave comments.
Login now