ardtweeno 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,27 @@
1
+ =begin
1
2
  ####################################################################################################
2
3
  # @author David Kirwan https://github.com/davidkirwan/ardtweeno
3
- # @description Ardtweeno SerialParser subsystem
4
+ # @description Ardtweeno Gateway
4
5
  #
5
- # @date 05-06-2013
6
+ # @date 2014-08-12
6
7
  ####################################################################################################
7
8
 
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
8
25
  # Imports
9
26
  require 'rubygems'
10
27
  require 'serialport'
data/public/main.css CHANGED
@@ -494,8 +494,8 @@ table th[class*="span"],
494
494
 
495
495
  .graph-container {
496
496
  box-sizing: border-box;
497
- width: 850px;
498
- height: 450px;
497
+ width: 100%;
498
+ height: 550px;
499
499
  padding: 20px 15px 15px 15px;
500
500
  margin: 15px auto 30px auto;
501
501
  border: 1px solid #ddd;
@@ -513,11 +513,6 @@ table th[class*="span"],
513
513
  }
514
514
 
515
515
 
516
- .graph-container {
517
- width: 85%;
518
- height: 300px;
519
- }
520
-
521
516
  .graph-placeholder {
522
517
  width: 100%;
523
518
  height: 100%;
@@ -537,4 +532,4 @@ table th[class*="span"],
537
532
  #apitable table th, table td { vertical-align: top; border: 1px solid #bbb; padding: 5px; }
538
533
  #apitable code { background: #ffa; }
539
534
  #apitable pre { background: black; color: #0f0; padding: 10px; word-wrap: break-word;}
540
- #apitable table pre { background: #ffa; color: black; }
535
+ #apitable table pre { background: #ffa; color: black; }
data/resources/puma.rb ADDED
@@ -0,0 +1,7 @@
1
+ root = "#{Dir.getwd}"
2
+ bind "unix://#{root}/tmp/puma/socket"
3
+ pidfile "#{root}/tmp/puma/pid"
4
+ state_path "#{root}/tmp/puma/state"
5
+ rackup "#{root}/config.ru"
6
+ threads 4, 8
7
+ activate_control_app
data/test/api_test.rb CHANGED
@@ -1,3 +1,27 @@
1
+ =begin
2
+ ####################################################################################################
3
+ # @author David Kirwan https://github.com/davidkirwan/ardtweeno
4
+ # @description Ardtweeno Gateway
5
+ #
6
+ # @date 2014-08-12
7
+ ####################################################################################################
8
+
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
1
25
  require 'rubygems'
2
26
  require 'test/unit'
3
27
  require 'rack/test'
Binary file
@@ -1,10 +1,27 @@
1
+ =begin
1
2
  ####################################################################################################
2
3
  # @author David Kirwan https://github.com/davidkirwan/ardtweeno
3
- # @description Ardtweeno dispatcher test fixtures
4
+ # @description Ardtweeno Gateway
4
5
  #
5
- # @date 2013-06-14
6
+ # @date 2014-08-12
6
7
  ####################################################################################################
7
8
 
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
8
25
  require 'test/unit'
9
26
  require 'rack/test'
10
27
  require 'ardtweeno'
data/test/node_test.rb CHANGED
@@ -1,10 +1,27 @@
1
+ =begin
1
2
  ####################################################################################################
2
3
  # @author David Kirwan https://github.com/davidkirwan/ardtweeno
3
- # @description Ardtweeno::Node test fixtures
4
+ # @description Ardtweeno Gateway
4
5
  #
5
- # @date 2013-08-18
6
+ # @date 2014-08-12
6
7
  ####################################################################################################
7
8
 
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
8
25
  require 'test/unit'
9
26
  require 'rack/test'
10
27
  require 'ardtweeno'
@@ -1,10 +1,27 @@
1
+ =begin
1
2
  ####################################################################################################
2
3
  # @author David Kirwan https://github.com/davidkirwan/ardtweeno
3
- # @description Ardtweeno::NodeManager test fixtures
4
+ # @description Ardtweeno Gateway
4
5
  #
5
- # @date 2013-08-18
6
+ # @date 2014-08-12
6
7
  ####################################################################################################
7
8
 
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
8
25
  require 'test/unit'
9
26
  require 'rack/test'
10
27
  require 'ardtweeno'
data/test/packet_test.rb CHANGED
@@ -1,10 +1,27 @@
1
- ###################################################################################################
1
+ =begin
2
+ ####################################################################################################
2
3
  # @author David Kirwan https://github.com/davidkirwan/ardtweeno
3
- # @description Ardtweeno::Packet test fixtures
4
+ # @description Ardtweeno Gateway
4
5
  #
5
- # @date 2013-08-18
6
+ # @date 2014-08-12
6
7
  ####################################################################################################
7
8
 
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
8
25
  require 'test/unit'
9
26
  require 'rack/test'
10
27
  require 'ardtweeno'
@@ -29,6 +46,7 @@ class PacketTest < Test::Unit::TestCase
29
46
  @theDate = today.year.to_s() + "-" + "%02d" % today.month.to_s() + "-" + "%02d" % today.day.to_s()
30
47
  @newHour = ("%02d" % today.hour).to_s
31
48
  @newMinute = ("%02d" % today.min).to_s
49
+ @newSecond = ("%02d" % today.sec).to_s
32
50
 
33
51
  # Instantiate the packetArray
34
52
  @packetArray = Array.new
@@ -55,7 +73,7 @@ class PacketTest < Test::Unit::TestCase
55
73
  def test_to_s
56
74
  @packetArray.each do |i|
57
75
  assert_equal(
58
- "Packet No: #{i.seqNo} Key: 0123456789abcdef Node: defaultNode Date: #{@theDate} #{@newHour}:#{@newMinute} Data: [23.5, 997.8, 30]",
76
+ "Packet No: #{i.seqNo} Key: 0123456789abcdef Node: defaultNode Date: #{@theDate} #{@newHour}:#{@newMinute}:#{@newSecond} Data: [23.5, 997.8, 30]",
59
77
  i.to_s
60
78
  )
61
79
  end
@@ -63,8 +81,7 @@ class PacketTest < Test::Unit::TestCase
63
81
 
64
82
  # Test the Ardtweeno::Packet#to_json method
65
83
  def test_to_json
66
- str = "{\"date\":\"#{@theDate}\",\"hour\":\"#{@newHour}\",\"minute\":\"#{@newMinute
67
- }\",\"node\":\"defaultNode\",\"key\":\"0123456789abcdef\",\"seqNo\":0,\"data\":[23.5,997.8,30]}"
84
+ str = "{\"date\":\"#{@theDate}\",\"hour\":\"#{@newHour}\",\"minute\":\"#{@newMinute}\",\"second\":\"#{@newSecond}\",\"node\":\"defaultNode\",\"key\":\"0123456789abcdef\",\"seqNo\":0,\"data\":[23.5,997.8,30]}"
68
85
 
69
86
  assert_equal(str, @packetArray.first.to_json)
70
87
 
data/test/parser_test.rb CHANGED
@@ -1,10 +1,27 @@
1
+ =begin
1
2
  ####################################################################################################
2
3
  # @author David Kirwan https://github.com/davidkirwan/ardtweeno
3
- # @description Ardtweeno serialparser subsystem test fixtures
4
+ # @description Ardtweeno Gateway
4
5
  #
5
- # @date 2013-08-18
6
+ # @date 2014-08-12
6
7
  ####################################################################################################
7
8
 
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
8
25
  require 'rubygems'
9
26
  require 'test/unit'
10
27
  require 'rack/test'
@@ -1,3 +1,27 @@
1
+ =begin
2
+ ####################################################################################################
3
+ # @author David Kirwan https://github.com/davidkirwan/ardtweeno
4
+ # @description Ardtweeno Gateway
5
+ #
6
+ # @date 2014-08-12
7
+ ####################################################################################################
8
+
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
1
25
  ENV['RACK_ENV'] = 'test'
2
26
 
3
27
  require 'rubygems' # Require the REST API Sinatra app
@@ -1,10 +1,27 @@
1
+ =begin
1
2
  ####################################################################################################
2
3
  # @author David Kirwan https://github.com/davidkirwan/ardtweeno
3
- # @description Ardtweeno::RingBuffer test fixtures
4
+ # @description Ardtweeno Gateway
4
5
  #
5
- # @date 2013-08-17
6
+ # @date 2014-08-12
6
7
  ####################################################################################################
7
8
 
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
8
25
  require 'test/unit'
9
26
  require 'ardtweeno'
10
27
  require 'rack/test'
@@ -1,10 +1,27 @@
1
+ =begin
1
2
  ####################################################################################################
2
3
  # @author David Kirwan https://github.com/davidkirwan/ardtweeno
3
- # @description Ardtweeno serial device mock
4
+ # @description Ardtweeno Gateway
4
5
  #
5
- # @date 05-06-2013
6
+ # @date 2014-08-12
6
7
  ####################################################################################################
7
8
 
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
8
25
  # Imports
9
26
  require "rubygems"
10
27
  require "serialport"
data/test/test_helper.rb CHANGED
@@ -1,10 +1,27 @@
1
+ =begin
1
2
  ####################################################################################################
2
3
  # @author David Kirwan https://github.com/davidkirwan/ardtweeno
3
- # @description Ardtweeno Gateway test helper
4
+ # @description Ardtweeno Gateway
4
5
  #
5
- # @date 05-06-2013
6
+ # @date 2014-08-12
6
7
  ####################################################################################################
7
8
 
9
+ This file is part of Ardtweeno.
10
+
11
+ Ardtweeno is free software: you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation, either version 3 of the License, or
14
+ any later version.
15
+
16
+ Ardtweeno is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23
+ =end
24
+
8
25
  #require the Ardtweeno codebase
9
26
  require File.join(File.dirname(__FILE__), '../lib/ardtweeno.rb')
10
27
 
data/views/index.erb CHANGED
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <title>Ardtweeno Application Gateway</title>
5
+ <title>Ardtweeno Application</title>
6
6
  <link href="/main.css" media="screen" rel="stylesheet" type="text/css" />
7
7
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
8
8
  <link rel="stylesheet" href="/highlightjs/styles/monokai.css" />
@@ -10,24 +10,20 @@
10
10
  </head>
11
11
  <body>
12
12
  <div id="header">
13
- <div id="logo">Ardtweeno Application Gateway</div>
13
+ <div id="logo">Ardtweeno</div>
14
14
  <ul id="navigation">
15
15
  <% if running == true %>
16
16
  <li><a href="">Status [<img title="Running" id="status" src="/img/glossy_green_button.svg" height="25" width="25"></img>]</a></li>
17
17
  <% else %>
18
18
  <li><a href="">Status [<img title="Stopped" id="status" src="/img/glossy_red_button.svg" height="25" width="25"></img>]</a></li>
19
19
  <% end %>
20
- <li><a href="http://donttase.me/aboutme">About Me</a></li>
21
- <li><a href="http://donttase.me/blog">Blog</a></li>
22
- <li><a href="http://donttase.me/github">Github</a></li>
23
- <li><a href="http://donttase.me/linkedin">LinkedIn</a></li>
24
20
  </ul>
25
21
  </div>
26
22
 
27
23
  <div id="content">
28
24
  <ul class="mytabs" id="tabs">
29
- <li class="current"><a href="/home">Home</a></li>
30
- <li><a href="/status">Status</a></li>
25
+ <li class="current"><a href="/home">Ardtweeno Status</a></li>
26
+ <li><a href="/status">Host Status</a></li>
31
27
  <li><a href="/topology">Topology</a></li>
32
28
  <li><a href="/api">API</a></li>
33
29
  </ul>
@@ -56,4 +52,4 @@
56
52
  <script type="text/javascript" src="/highlightjs/highlight.pack.js"></script>
57
53
  <script type="text/javascript">hljs.initHighlightingOnLoad();</script>
58
54
  </body>
59
- </html>
55
+ </html>
@@ -0,0 +1,55 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <% if defined? node %>
6
+ <title>Ardtweeno <%= node %> Line Plot Graph</title>
7
+ <% else %>
8
+ <title>Ardtweeno Line Plot Graph</title>
9
+ <% end %>
10
+ <link href="/main.css" media="screen" rel="stylesheet" type="text/css" />
11
+
12
+ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
13
+
14
+ <link href="/bootstrap/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css" />
15
+ <script type="text/javascript" src="/jquery/jquery-2.0.2.min.js"></script>
16
+ <script type="text/javascript" src="/bootstrap/bootstrap.min.js"></script>
17
+ <script language="javascript" type="text/javascript" src="/flot/jquery.flot.js"></script>
18
+ <script language="javascript" type="text/javascript" src="/flot/jquery.flot.time.js"></script>
19
+
20
+ <script type="text/javascript">
21
+ $(function() {
22
+
23
+ var options = {
24
+ xaxis: { mode: 'time' },
25
+ legend: { show: true,
26
+ container: null,
27
+ position: 'ne',
28
+ backgroundColor: '#DBBFFF',
29
+ backgroundOpacity: 0.5 }
30
+ };
31
+
32
+ var graph_data = <%= data %>;
33
+ $.plot("#placeholder", graph_data, options);
34
+
35
+ });
36
+ </script>
37
+ </head>
38
+
39
+ <body>
40
+ <div id="content">
41
+ <a href="/"><button id="punchcard-home" class="btn btn-large btn-inverse" type="button">Home</button></a>
42
+ <div class="graph-container">
43
+ <% if defined? node %>
44
+ <h3 id="punchcard-title">Ardtweeno <%= node %> Line Plot Graph</h3>
45
+ <% else %>
46
+ <h3 id="punchcard-title">Ardtweeno Line Plot Graph</h3>
47
+ <% end %>
48
+
49
+ <div id="placeholder" class="graph-placeholder"></div>
50
+ </div>
51
+ </div>
52
+ </body>
53
+
54
+ </html>
55
+