Merge lp:~dangarner/xibo/ticker-improvements-102 into lp:xibo/1.0
- ticker-improvements-102
- Merge into halley
Proposed by
Dan Garner
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~dangarner/xibo/ticker-improvements-102 |
Merge into: | lp:xibo/1.0 |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~dangarner/xibo/ticker-improvements-102 |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xibo Maintainters | Pending | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'client/dotNET/Region.cs' |
2 | --- client/dotNET/Region.cs 2009-03-08 11:40:17 +0000 |
3 | +++ client/dotNET/Region.cs 2009-06-17 21:57:35 +0000 |
4 | @@ -197,6 +197,8 @@ |
5 | options.text = ""; |
6 | options.documentTemplate = ""; |
7 | options.copyrightNotice = ""; |
8 | + options.scrollSpeed = 1; |
9 | + options.updateInterval = 6; |
10 | options.uri = ""; |
11 | |
12 | // Get a media node |
13 | @@ -266,6 +268,28 @@ |
14 | { |
15 | options.copyrightNotice = option.InnerText; |
16 | } |
17 | + else if (option.Name == "scrollSpeed") |
18 | + { |
19 | + try |
20 | + { |
21 | + options.scrollSpeed = int.Parse(option.InnerText); |
22 | + } |
23 | + catch |
24 | + { |
25 | + System.Diagnostics.Trace.WriteLine("Non integer scrollSpeed in XLF", "Region - SetNextMediaNode"); |
26 | + } |
27 | + } |
28 | + else if (option.Name == "updateInverval") |
29 | + { |
30 | + try |
31 | + { |
32 | + options.updateInterval = int.Parse(option.InnerText); |
33 | + } |
34 | + catch |
35 | + { |
36 | + System.Diagnostics.Trace.WriteLine("Non integer updateInterval in XLF", "Region - SetNextMediaNode"); |
37 | + } |
38 | + } |
39 | } |
40 | |
41 | // And some stuff on Raw nodes |
42 | @@ -398,6 +422,8 @@ |
43 | public string text; |
44 | public string documentTemplate; |
45 | public string copyrightNotice; |
46 | + public int updateInterval; |
47 | + public int scrollSpeed; |
48 | |
49 | //The identification for this region |
50 | public string mediaid; |
51 | |
52 | === modified file 'client/dotNET/Rss.cs' |
53 | --- client/dotNET/Rss.cs 2009-03-13 09:21:56 +0000 |
54 | +++ client/dotNET/Rss.cs 2009-06-18 18:36:21 +0000 |
55 | @@ -64,6 +64,12 @@ |
56 | scheduleId = options.scheduleId; |
57 | layoutId = options.layoutId; |
58 | |
59 | + // Update interval and scrolling speed |
60 | + _updateInterval = options.updateInterval; |
61 | + _scrollSpeed = options.scrollSpeed; |
62 | + |
63 | + System.Diagnostics.Trace.WriteLine(String.Format("Scrolling Speed: {0}, Update Interval: {1})", _scrollSpeed.ToString(), _updateInterval.ToString()), "Rss - Constructor"); |
64 | + |
65 | // Set up the backgrounds |
66 | backgroundTop = options.backgroundTop + "px"; |
67 | backgroundLeft = options.backgroundLeft + "px"; |
68 | @@ -96,6 +102,9 @@ |
69 | try |
70 | { |
71 | wc = new System.Net.WebClient(); |
72 | + wc.Encoding = System.Text.Encoding.UTF8; |
73 | + |
74 | + System.Diagnostics.Debug.WriteLine("Created at WebClient and set the Encoding to UTF8", "RSS - Refresh local RSS"); |
75 | |
76 | wc.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(wc_OpenReadCompleted); |
77 | |
78 | @@ -109,6 +118,8 @@ |
79 | |
80 | void wc_OpenReadCompleted(object sender, System.Net.OpenReadCompletedEventArgs e) |
81 | { |
82 | + String rssContents; |
83 | + |
84 | if (e.Error != null) |
85 | { |
86 | System.Diagnostics.Trace.WriteLine(String.Format("[*]ScheduleID:{1},LayoutID:{2},MediaID:{3},Message:{0}", e.Error, scheduleId, layoutId, mediaid)); |
87 | @@ -122,11 +133,14 @@ |
88 | |
89 | try |
90 | { |
91 | - System.IO.StreamReader sr = new System.IO.StreamReader(data); |
92 | + System.IO.StreamReader sr = new System.IO.StreamReader(data, true); |
93 | + rssContents = sr.ReadToEnd(); |
94 | |
95 | StreamWriter sw = new StreamWriter(File.Open(rssFilePath, FileMode.Create, FileAccess.Write, FileShare.Read)); |
96 | |
97 | - sw.Write(sr.ReadToEnd()); |
98 | + System.Diagnostics.Debug.WriteLine("Retrieved RSS - about to write it", "RSS - wc_OpenReadCompleted"); |
99 | + |
100 | + sw.Write(rssContents); |
101 | |
102 | sr.Close(); |
103 | sw.Close(); |
104 | @@ -172,16 +186,23 @@ |
105 | } |
106 | else |
107 | { |
108 | - // It exists - therefore we want to get the last time it was updated |
109 | - DateTime lastWriteDate = System.IO.File.GetLastWriteTime(rssFilePath); |
110 | - |
111 | - if (DateTime.Now.CompareTo(lastWriteDate.AddHours(6.0)) > 0) |
112 | + if (_updateInterval == 0) |
113 | { |
114 | refreshLocalRss(); |
115 | } |
116 | else |
117 | { |
118 | - rssReady = true; |
119 | + // It exists - therefore we want to get the last time it was updated |
120 | + DateTime lastWriteDate = System.IO.File.GetLastWriteTime(rssFilePath); |
121 | + |
122 | + if (DateTime.Now.CompareTo(lastWriteDate.AddHours(_updateInterval * 1.0 / 60.0)) > 0) |
123 | + { |
124 | + refreshLocalRss(); |
125 | + } |
126 | + else |
127 | + { |
128 | + rssReady = true; |
129 | + } |
130 | } |
131 | } |
132 | |
133 | @@ -330,7 +351,7 @@ |
134 | // Call the JavaScript on the page |
135 | Object[] objArray = new Object[2]; |
136 | objArray[0] = direction; |
137 | - objArray[1] = 30; |
138 | + objArray[1] = _scrollSpeed; |
139 | |
140 | htmlDoc.InvokeScript("init", objArray); |
141 | } |
142 | @@ -451,6 +472,8 @@ |
143 | private WebBrowser webBrowser; |
144 | private string copyrightNotice; |
145 | private string mediaid; |
146 | + private int _updateInterval; |
147 | + private int _scrollSpeed; |
148 | |
149 | private string rssFilePath; |
150 | |
151 | |
152 | === modified file 'client/dotNET/Schedule.cs' |
153 | --- client/dotNET/Schedule.cs 2009-03-08 11:40:17 +0000 |
154 | +++ client/dotNET/Schedule.cs 2009-06-18 18:36:21 +0000 |
155 | @@ -69,6 +69,7 @@ |
156 | xmds2.RequiredFilesCompleted += new XiboClient.xmds.RequiredFilesCompletedEventHandler(xmds2_RequiredFilesCompleted); |
157 | xmds2.ScheduleCompleted += new XiboClient.xmds.ScheduleCompletedEventHandler(xmds2_ScheduleCompleted); |
158 | |
159 | + System.Diagnostics.Trace.WriteLine(String.Format("Collection Interval: {0}", Properties.Settings.Default.collectInterval), "Schedule - InitializeComponents"); |
160 | // |
161 | // The Timer for the Service call |
162 | // |
163 | |
164 | === modified file 'client/dotNET/VideoPlayer.resx' |
165 | --- client/dotNET/VideoPlayer.resx 2008-12-19 23:34:13 +0000 |
166 | +++ client/dotNET/VideoPlayer.resx 2009-05-24 10:19:36 +0000 |
167 | @@ -123,8 +123,8 @@ |
168 | LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 |
169 | ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAuQAAAAIB |
170 | AAAAAQAAAAAAAAAAAAAAAKQAAAAAAwAACAACAAAAAAAFAAAAAAAAAPA/AwAAAAAABQAAAAAAAAAAAAgA |
171 | - AgAAAAAAAwABAAAACwD//wMAAAAAAAsA//8IAAIAAAAAAAMAMgAAAAsAAAAIAAoAAABuAG8AbgBlAAAA |
172 | - CwD//wsA//8LAAAACwAAAAsAAAAIAAIAAAAAAAgAAgAAAAAACAACAAAAAAAIAAIAAAAAAAsAAAATHgAA |
173 | + AgAAAAAAAwABAAAACwD//wMAAAAAAAsAAAAIAAIAAAAAAAMAMgAAAAsAAAAIAAoAAABuAG8AbgBlAAAA |
174 | + CwD//wsAAAALAAAACwAAAAsAAAAIAAIAAAAAAAgAAgAAAAAACAACAAAAAAAIAAIAAAAAAAsAAAATHgAA |
175 | zRsAAAs= |
176 | </value> |
177 | </data> |
178 | |
179 | === modified file 'client/dotNET/bin/Release/XiboClient.XmlSerializers.dll' |
180 | Binary files client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-03-28 19:13:50 +0000 and client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-06-18 18:36:21 +0000 differ |
181 | === modified file 'client/dotNET/bin/Release/XiboClient.exe' |
182 | Binary files client/dotNET/bin/Release/XiboClient.exe 2009-03-28 19:13:50 +0000 and client/dotNET/bin/Release/XiboClient.exe 2009-06-18 18:36:21 +0000 differ |
183 | === modified file 'client/dotNET/bin/Release/XiboClient.pdb' |
184 | Binary files client/dotNET/bin/Release/XiboClient.pdb 2009-03-28 19:13:50 +0000 and client/dotNET/bin/Release/XiboClient.pdb 2009-06-18 18:36:21 +0000 differ |
185 | === modified file 'server/modules/ticker.module.php' |
186 | --- server/modules/ticker.module.php 2009-03-13 09:30:23 +0000 |
187 | +++ server/modules/ticker.module.php 2009-06-18 18:36:21 +0000 |
188 | @@ -48,7 +48,7 @@ |
189 | $rWidth = Kit::GetParam('rWidth', _REQUEST, _STRING); |
190 | $rHeight = Kit::GetParam('rHeight', _REQUEST, _STRING); |
191 | |
192 | - $direction_list = listcontent("none|None,left|Left,right|Right,up|Up,down|Down", "direction"); |
193 | + $direction_list = listcontent("none|None,left|Left,right|Right,up|Up,down|Down,single|Single", "direction"); |
194 | |
195 | $form = <<<FORM |
196 | <form class="XiboTextForm" method="post" action="index.php?p=module&mod=ticker&q=Exec&method=AddMedia"> |
197 | @@ -68,6 +68,12 @@ |
198 | <td><input id="duration" name="duration" type="text"></td> |
199 | </tr> |
200 | <tr> |
201 | + <td><label for="scrollSpeed" title="The scroll speed of the ticker.">Scroll Speed<span class="required">*</span> (lower is faster)</label></td> |
202 | + <td><input id="scrollSpeed" name="scrollSpeed" type="text" value="30"></td> |
203 | + <td><label for="updateInterval" title="The Interval at which the client should cache the feed.">Update Interval (mins)<span class="required">*</span></label></td> |
204 | + <td><input id="updateInterval" name="updateInterval" type="text" value="360"></td> |
205 | + </tr> |
206 | + <tr> |
207 | <td colspan="4"> |
208 | <textarea id="ta_text" name="ta_text"> |
209 | [Title] - [Date] - [Description] |
210 | @@ -104,9 +110,11 @@ |
211 | $regionid = $this->regionid; |
212 | $mediaid = $this->mediaid; |
213 | |
214 | - $direction = $this->GetOption('direction'); |
215 | - $copyright = $this->GetOption('copyright'); |
216 | - $uri = urldecode($this->GetOption('uri')); |
217 | + $direction = $this->GetOption('direction'); |
218 | + $copyright = $this->GetOption('copyright'); |
219 | + $scrollSpeed = $this->GetOption('scrollSpeed'); |
220 | + $updateInterval = $this->GetOption('updateInterval'); |
221 | + $uri = urldecode($this->GetOption('uri')); |
222 | |
223 | // Get the text out of RAW |
224 | $rawXml = new DOMDocument(); |
225 | @@ -119,7 +127,7 @@ |
226 | $textNode = $textNodes->item(0); |
227 | $text = $textNode->nodeValue; |
228 | |
229 | - $direction_list = listcontent("none|None,left|Left,right|Right,up|Up,down|Down", "direction", $direction); |
230 | + $direction_list = listcontent("none|None,left|Left,right|Right,up|Up,down|Down,single|Single", "direction", $direction); |
231 | |
232 | //Output the form |
233 | $form = <<<FORM |
234 | @@ -141,6 +149,12 @@ |
235 | <td><input id="duration" name="duration" value="$this->duration" type="text"></td> |
236 | </tr> |
237 | <tr> |
238 | + <td><label for="scrollSpeed" title="The scroll speed of the ticker.">Scroll Speed<span class="required">*</span> (lower is faster)</label></td> |
239 | + <td><input id="scrollSpeed" name="scrollSpeed" type="text" value="$scrollSpeed"></td> |
240 | + <td><label for="updateInterval" title="The Interval at which the client should cache the feed.">Update Interval (mins)<span class="required">*</span></label></td> |
241 | + <td><input id="updateInterval" name="updateInterval" type="text" value="$updateInterval"></td> |
242 | + </tr> |
243 | + <tr> |
244 | <td colspan="4"> |
245 | <textarea id="ta_text" name="ta_text">$text</textarea> |
246 | </td> |
247 | @@ -179,6 +193,8 @@ |
248 | $uri = Kit::GetParam('uri', _POST, _URI); |
249 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); |
250 | $duration = Kit::GetParam('duration', _POST, _INT, 0); |
251 | + $scrollSpeed = Kit::GetParam('scrollSpeed', _POST, _INT, 30); |
252 | + $updateInterval = Kit::GetParam('updateInterval', _POST, _INT, 360); |
253 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); |
254 | $copyright = Kit::GetParam('copyright', _POST, _STRING); |
255 | |
256 | @@ -214,6 +230,8 @@ |
257 | // Any Options |
258 | $this->SetOption('direction', $direction); |
259 | $this->SetOption('copyright', $copyright); |
260 | + $this->SetOption('scrollSpeed', $scrollSpeed); |
261 | + $this->SetOption('updateInterval', $updateInterval); |
262 | $this->SetOption('uri', $uri); |
263 | |
264 | $this->SetRaw('<template><![CDATA[' . $text . ']]></template>'); |
265 | @@ -249,6 +267,8 @@ |
266 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); |
267 | $duration = Kit::GetParam('duration', _POST, _INT, 0); |
268 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); |
269 | + $scrollSpeed = Kit::GetParam('scrollSpeed', _POST, _INT, 30); |
270 | + $updateInterval = Kit::GetParam('updateInterval', _POST, _INT, 360); |
271 | $copyright = Kit::GetParam('copyright', _POST, _STRING); |
272 | |
273 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
274 | @@ -282,6 +302,8 @@ |
275 | // Any Options |
276 | $this->SetOption('direction', $direction); |
277 | $this->SetOption('copyright', $copyright); |
278 | + $this->SetOption('scrollSpeed', $scrollSpeed); |
279 | + $this->SetOption('updateInterval', $updateInterval); |
280 | $this->SetOption('uri', $uri); |
281 | |
282 | $this->SetRaw('<template><![CDATA[' . $text . ']]></template>'); |