Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ae91d59a authored by Maxence Dunnewind's avatar Maxence Dunnewind
Browse files

fix grenoble pdu generator

parent 1282b7a8
Branches
No related tags found
No related merge requests found
...@@ -34,71 +34,77 @@ site :grenoble do |site_uid| ...@@ -34,71 +34,77 @@ site :grenoble do |site_uid|
} }
} }
] ]
}, }
#à faire 2 x ].concat(
{ (1..2).map { |j|
:uid => "block-1", {
:measures => [ :uid => "block-#{j}",
{ :measures => [
:currentW => { {
:unit => "W", :currentW => {
:shared => true, :unit => "W",
:oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.1"], :shared => true,
:api => "block-1-currentW" :oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.#{j}"],
} :api => "block-#{j}-currentW"
}, }
{ },
:current => { {
:unit => "VA", :current => {
:shared => "true", :unit => "VA",
:oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.1"], :shared => "true",
:api => "block-1-current" :oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.#{j}"],
} :api => "block-#{j}-current"
}, }
{ },
:total => { {
:unit => "W.h", :total => {
:shared => "true", :unit => "W.h",
:oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.1",], :shared => "true",
:api => "block-1-total" :oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.#{j}",],
:api => "block-#{j}-total"
}
} }
} ],
], :parent => "global"
:parent => "global" }
}, }).concat(
(0..1).collect { |k|
(1..12).map { |j|
#à faire 12 fois par block #à faire 12 fois par block
{ {
:uid => "outlet-1", :uid => "outlet-#{k*12+j}",
:measures => [ :measures => [
{ {
:currentW => { :currentW => {
:unit => "W", :unit => "W",
:shared => true, :shared => true,
:oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.1"], :oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.#{k*12+j}"],
:api => "outlet-1-currentW" :api => "outlet-#{k*12+j}-currentW"
} }
}, },
{ {
:current => { :current => {
:unit => "VA", :unit => "VA",
:shared => "true", :shared => "true",
:oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.1"], :oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.#{k*12+j}"],
:api => "outlet-1-current" :api => "outlet-#{k*12+j}-current"
} }
}, },
{ {
:total => { :total => {
:unit => "W.h", :unit => "W.h",
:shared => "true", :shared => "true",
:oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.1", :oid => ["iso.3.6.1.4.1.534.6.6.7.5.5.1.3.0.#{k*12+j}"],
:api => "outlet-1-total" :api => "outlet-#{k*12+j}-total"
} }
} }
], ],
:parent => "block-X" :parent => "block-#{k+1}"
}, }
] }
} }.flatten
)
}
] ]
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment