Mercurial > hg > ltpda
comparison m-toolbox/test/test_getAOsInTimeSpan.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 | |
2 % A test function for the AO method getAOsInTimeSpan. | |
3 % | |
4 % M Hewitson 25-02-08 | |
5 % | |
6 % $Id: test_getAOsInTimeSpan.m,v 1.2 2008/09/19 14:03:50 ingo Exp $ | |
7 % | |
8 | |
9 clear | |
10 | |
11 | |
12 %% Test with no connection input | |
13 hostname = '130.75.117.67'; | |
14 dbname = 'ltpda_test'; | |
15 channels = {'channelX', 'channelZ'}; | |
16 ts = timespan('2007-01-01 12:10:00', '2007-01-01 12:40:00'); | |
17 | |
18 | |
19 % Build plist | |
20 pl = plist('hostname', hostname, 'database', dbname, 'channels', channels, 'timespan', ts); | |
21 | |
22 objs = ltpda_getAOsInTimeSpan(pl); | |
23 | |
24 iplot(objs) | |
25 | |
26 %% Test with input connection | |
27 | |
28 server = '130.75.117.67'; | |
29 dbname = 'ltpda_test'; | |
30 channels = {'channelX', 'channelZ'}; | |
31 ts = timespan('2007-01-01 12:10:00', '2007-01-01 12:40:00'); | |
32 | |
33 % Make db connection | |
34 conn = mysql_connect(server, dbname); | |
35 | |
36 % Build plist | |
37 pl = plist('conn', conn, 'channels', channels, 'timespan', ts); | |
38 | |
39 objs = ltpda_getAOsInTimeSpan(pl); | |
40 | |
41 % Close connection | |
42 close(conn); | |
43 | |
44 iplot(objs) | |
45 |