wiseml-ruby 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +4 -0
  3. data/README.md +0 -0
  4. data/Rakefile +2 -0
  5. data/lib/version.rb +3 -0
  6. data/lib/wise_ml.rb +6 -0
  7. data/lib/wiseconfig/application.rb +5 -0
  8. data/lib/wiseconfig/configuration.rb +5 -0
  9. data/lib/wiseconfig/nodename.rb +5 -0
  10. data/lib/wiseconfig/nodes.rb +5 -0
  11. data/lib/wiseconfig/portal_app.rb +5 -0
  12. data/lib/wiseconfig/protobuf_interface.rb +5 -0
  13. data/lib/wiseconfig/server_connection.rb +5 -0
  14. data/lib/wiseconfig/testbed_configuration.rb +5 -0
  15. data/lib/wiseconfig/web_service.rb +5 -0
  16. data/lib/wiseconfig/wsn_device.rb +5 -0
  17. data/lib/wiseml/all.rb +66 -0
  18. data/lib/wiseml/scenario/disable_link.rb +15 -0
  19. data/lib/wiseml/scenario/disable_node.rb +12 -0
  20. data/lib/wiseml/scenario/enable_link.rb +14 -0
  21. data/lib/wiseml/scenario/enable_node.rb +13 -0
  22. data/lib/wiseml/scenario/scenario.rb +17 -0
  23. data/lib/wiseml/scenario/timestamp.rb +20 -0
  24. data/lib/wiseml/setup/capability.rb +19 -0
  25. data/lib/wiseml/setup/data.rb +15 -0
  26. data/lib/wiseml/setup/defaults.rb +14 -0
  27. data/lib/wiseml/setup/link.rb +20 -0
  28. data/lib/wiseml/setup/node.rb +23 -0
  29. data/lib/wiseml/setup/origin.rb +18 -0
  30. data/lib/wiseml/setup/position.rb +17 -0
  31. data/lib/wiseml/setup/rssi.rb +15 -0
  32. data/lib/wiseml/setup/setup.rb +21 -0
  33. data/lib/wiseml/setup/time_info.rb +16 -0
  34. data/lib/wiseml/trace/message.rb +15 -0
  35. data/lib/wiseml/trace/trace.rb +15 -0
  36. data/lib/wiseml/wise_ml.rb +17 -0
  37. data/test/test_xml.rb +33 -0
  38. data/test/wisebed_uzl_demo.json +3153 -0
  39. data/test/wisebed_uzl_demo.xml +3038 -0
  40. data/test/wiseml.model.xsd +89 -0
  41. data/wiseml-ruby.gemspec +20 -0
  42. metadata +122 -0
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ .idea
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in wiseml-ruby.gemspec
4
+ gemspec
data/README.md ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module WiseML
2
+ VERSION = "0.0.1"
3
+ end
data/lib/wise_ml.rb ADDED
@@ -0,0 +1,6 @@
1
+ require 'roxml'
2
+
3
+ require File.dirname(__FILE__)+'/version.rb'
4
+ require File.dirname(__FILE__) + '/wiseml/all.rb'
5
+ Dir[File.dirname(__FILE__) + '/wiseml/*/*.rb'].each { |file| require file }
6
+ require File.dirname(__FILE__) + '/wiseml/wise_ml.rb'
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class Application
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class Configuration
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class Nodename
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class Nodes
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class PortalApp
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class ProtobufInterface
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class ServerConnection
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class TestbedConfiguration
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class WebService
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module WiseConfig
2
+ class WsnDevice
3
+ # To change this template use File | Settings | File Templates.
4
+ end
5
+ end
data/lib/wiseml/all.rb ADDED
@@ -0,0 +1,66 @@
1
+ # this file simply loads all the classes but without actual
2
+ # definitions. This ensures that when loading them in abitrary order,
3
+ # no NameError are raised.
4
+
5
+ module WiseML
6
+ module Setup
7
+ class Capability
8
+ include ROXML
9
+ end
10
+ class Data
11
+ include ROXML
12
+ end
13
+ class Defaults
14
+ include ROXML
15
+ end
16
+ class Link
17
+ include ROXML
18
+ end
19
+ class Node
20
+ include ROXML
21
+ end
22
+ class Origin
23
+ include ROXML
24
+ end
25
+ class Position
26
+ include ROXML
27
+ end
28
+ class Rssi
29
+ include ROXML
30
+ end
31
+ class Setup
32
+ include ROXML
33
+ end
34
+ class TimeInfo
35
+ include ROXML
36
+ end
37
+ end
38
+ module Scenario
39
+ class DisableLink
40
+ include ROXML
41
+ end
42
+ class DisableNode
43
+ include ROXML
44
+ end
45
+ class EnableLink
46
+ include ROXML
47
+ end
48
+ class EnableNode
49
+ include ROXML
50
+ end
51
+ class Scenario
52
+ include ROXML
53
+ end
54
+ class Timestamp
55
+ include ROXML
56
+ end
57
+ end
58
+ module Trace
59
+ class Message
60
+ include ROXML
61
+ end
62
+ class Trace
63
+ include ROXML
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,15 @@
1
+ module WiseML
2
+ module Scenario
3
+ class DisableLink
4
+
5
+ # This is a persistent class for the object DisableLink that has the
6
+ # properties of a DisableLink. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :source
10
+ xml_accessor :target
11
+
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ module WiseML
2
+ module Scenario
3
+ class DisableNode
4
+
5
+ # This is a persistent class for the object DisableNode that has the
6
+ # properties of a DisableNode. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :id, :as => Integer
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ module WiseML
2
+ module Scenario
3
+ class EnableLink
4
+
5
+ # This is a persistent class for the object EnableLink that has the
6
+ # properties of a EnableLink. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :source
10
+ xml_accessor :target
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ module WiseML
2
+ module Scenario
3
+ class EnableNode
4
+
5
+ # This is a persistent class for the object EnableNode that has the
6
+ # properties of a EnableNode. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :id, :as => Integer
10
+
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ module WiseML
2
+ module Scenario
3
+ class Scenario
4
+
5
+ # This is a persistent class for the object Scenario that has the
6
+ # properties of a Scenario. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :id, :as => Integer
10
+ xml_accessor :timestamp, :as => [Timestamp]
11
+ xml_accessor :data, :as => Setup::Data
12
+ xml_accessor :children
13
+
14
+ end
15
+ end
16
+ end
17
+
@@ -0,0 +1,20 @@
1
+ module WiseML
2
+ module Scenario
3
+ class Timestamp
4
+
5
+ # This is a persistent class for the object Timestamp that has the
6
+ # properties of a Timestamp. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :value
10
+ xml_accessor :enableNode, :as => EnableNode
11
+ xml_accessor :disableNode, :as => DisableNode
12
+ xml_accessor :enableLink, :as => EnableLink
13
+ xml_accessor :disableLink, :as => DisableLink
14
+ xml_accessor :node, :as => [Setup::Node]
15
+ xml_accessor :message, :as => [Trace::Message]
16
+ xml_accessor :link, :as => [Setup::Link]
17
+
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,19 @@
1
+ module WiseML
2
+ module Setup
3
+ class Capability
4
+
5
+ # This is a persistant class for the object capability that has the
6
+ # properties of a capability. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :name
10
+ xml_accessor :datatype
11
+ xml_accessor :unit
12
+ xml_accessor :defaultValue
13
+ xml_accessor :nodes, :as => [Node]
14
+ xml_accessor :links, :as => [Link]
15
+ xml_accessor :description
16
+
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ module WiseML
2
+ module Setup
3
+ class Data
4
+
5
+ # This is a persistent class for the object data that has the
6
+ # properties of a data. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :key
10
+ xml_accessor :value
11
+ xml_accessor :message, :as => Trace::Message
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ module WiseML
2
+ module Setup
3
+ class Defaults
4
+
5
+ # This is a persistent class for the object defaults that has the
6
+ # properties of a defaults. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :node, :as => Node
10
+ xml_accessor :link, :as => Link
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ module WiseML
2
+ module Setup
3
+ class Link
4
+
5
+ # This is a persistent class for the object link that has the
6
+ # properties of a link. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :source
10
+ xml_accessor :target
11
+ xml_accessor :encrypted
12
+ xml_accessor :virtual
13
+ xml_accessor :capabilities, :as => [Capability]
14
+ xml_accessor :rssi, :as => Rssi
15
+ xml_accessor :data, :as => [Data]
16
+ xml_accessor :setup, :as => Setup
17
+
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,23 @@
1
+ module WiseML
2
+ module Setup
3
+ class Node
4
+
5
+ # This is a persistent class for the object node that has the
6
+ # properties of a node. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :id, :as => Integer
10
+ xml_accessor :capabilities, :as => [Capability]
11
+ xml_accessor :position, :as => Position
12
+ xml_accessor :nodeType
13
+ xml_accessor :description
14
+ xml_accessor :gateway
15
+ xml_accessor :programDetails
16
+ xml_accessor :data, :as => [Data]
17
+ xml_accessor :message, :as => Trace::Message
18
+ xml_accessor :setup, :as => Setup
19
+
20
+ end
21
+ end
22
+ end
23
+
@@ -0,0 +1,18 @@
1
+ module WiseML
2
+ module Setup
3
+ class Origin
4
+
5
+ # This is a persistent class for the object origin that has the
6
+ # properties of a origin. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :x, :as => Float
10
+ xml_accessor :y, :as => Float
11
+ xml_accessor :z, :as => Float
12
+ xml_accessor :phi, :as => Float
13
+ xml_accessor :theta, :as => Float
14
+
15
+
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ module WiseML
2
+ module Setup
3
+ class Position
4
+
5
+ # This is a persistent class for the object position that has the
6
+ # properties of a position. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :x, :as => Float
10
+ xml_accessor :y, :as => Float
11
+ xml_accessor :z, :as => Float
12
+ xml_accessor :phi, :as => Float
13
+ xml_accessor :theta, :as => Float
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ module WiseML
2
+ module Setup
3
+ class Rssi
4
+
5
+ # This is a persistent class for the object rssi that has the
6
+ # properties of a rssi. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :datatype
10
+ xml_accessor :unit
11
+ xml_accessor :value
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,21 @@
1
+ module WiseML
2
+ module Setup
3
+ class Setup
4
+
5
+ # This is a persistant class for the object setup that has the
6
+ # properties of a setup. Setters and getters are implicitly defined
7
+ # trough the accesors
8
+
9
+ xml_accessor :id
10
+ xml_accessor :origin, :as => Origin
11
+ xml_accessor :timeinfo, :as => TimeInfo
12
+ xml_accessor :interpolation
13
+ xml_accessor :description
14
+ xml_accessor :coordinateType
15
+ xml_accessor :defaults, :as => Defaults
16
+ xml_accessor :nodes, :as => [Node]
17
+ xml_accessor :link, :as => [Link]
18
+
19
+ end
20
+ end
21
+ end