cpee-handlerwrapper-opcua 0.7 → 0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c53decc037d22d3802022844c8483b9e680121f36e28ad05ce3e3250126de6ef
4
- data.tar.gz: 999c8f9bd81fc344214559f82ab0e53b88212c4a49d37de1deb066ae0cf85905
3
+ metadata.gz: a352e4ef2e00edcbbe1fdb1b9c0315631ed1f507f2e4c3d427dfd9b0a82e3a24
4
+ data.tar.gz: 9eda6cf84e69203d0d7e019dfe726d5c97b0ecdaf56295273d3689efc3a19813
5
5
  SHA512:
6
- metadata.gz: 5f6f022ce8b077f2fa01ed2527f4a007847d97b63982b5334f9febd76f8829d4ff04ac250ac8bb320e786f7bac88ca9e1007c7872a183f45778dc046e000213b
7
- data.tar.gz: a1560af1df4d1eb928717ba8b6c200c2929266df7af7ba31d0a3a9066c6ee67cd8c3ae1167eaa76a13b373621a8d4e2af18efe7250e66dd2d970bec78326b394
6
+ metadata.gz: 84b81740c9cf68c1b9b300ab756c923370511ae160bb3a483952b70ac1eb6daf318fd4b5b23cd6b9bf1d30cf32865e1b4e8dac6ba2a47ce49d32d84d29ccdbcf
7
+ data.tar.gz: d121a4fd0bf9d32c429126e38e55a78a5fe1ada093317a786a97f315459a2ae33124fd0ffe3c05d9059bdc2922311c2a0e4c55e88b1b6baeb76d41648d99f55f
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-handlerwrapper-opcua"
3
- s.version = "0.7"
3
+ s.version = "0.8"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "OPCUA for CPEE HandlerWrapper. Use opc.tcp-read|write|exececute:// links."
@@ -45,6 +45,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
45
45
  @handler_passthrough = nil
46
46
  @handler_returnValue = nil
47
47
  @handler_returnOptions = nil
48
+ @handler_activity_uuid = Digest::MD5.hexdigest(Kernel::rand().to_s)
48
49
  @label = ''
49
50
  end # }}}
50
51
 
@@ -198,7 +199,7 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
198
199
  @sensors = parameters.dig(:stream,:sensors)
199
200
  @aggregators = parameters.dig(:stream,:aggregators)
200
201
  @costs = parameters.dig(:stream,:costs)
201
- @controller.notify("activity/calling", :instance => @controller.instance, :instance_uuid => @controller.uuid, :label => @label, :instance_name => @controller.info, :activity => @handler_position, :passthrough => passthrough, :endpoint => @handler_endpoint, :parameters => parameters, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
202
+ @controller.notify("activity/calling", :activity_uuid => @handler_activity_uuid, :instance => @controller.instance, :instance_uuid => @controller.uuid, :label => @label, :instance_name => @controller.info, :activity => @handler_position, :passthrough => passthrough, :endpoint => @handler_endpoint, :parameters => parameters, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
202
203
  if passthrough.to_s.empty?
203
204
  if @handler_endpoint.start_with?('opc.tcp')
204
205
  proto_opcua parameters
@@ -235,15 +236,15 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
235
236
  end # }}}
236
237
 
237
238
  def inform_activity_done # {{{
238
- @controller.notify("activity/done", :endpoint => @handler_endpoint, :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
239
+ @controller.notify("activity/done", :activity_uuid => @handler_activity_uuid, :endpoint => @handler_endpoint, :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
239
240
  end # }}}
240
241
  def inform_activity_manipulate # {{{
241
- @controller.notify("activity/manipulating", :endpoint => @handler_endpoint, :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
242
+ @controller.notify("activity/manipulating", :activity_uuid => @handler_activity_uuid, :endpoint => @handler_endpoint, :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
242
243
  end # }}}
243
244
  def inform_activity_failed(err) # {{{
244
245
  puts err.message
245
246
  puts err.backtrace
246
- @controller.notify("activity/failed", :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :message => err.message, :line => err.backtrace[0].match(/(.*?):(\d+):/)[2], :where => err.backtrace[0].match(/(.*?):(\d+):/)[1], :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
247
+ @controller.notify("activity/failed", :activity_uuid => @handler_activity_uuid, :endpoint => @handler_endpoint, :label => @label, :instance_name => @controller.info, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :message => err.message, :line => err.backtrace[0].match(/(.*?):(\d+):/)[2], :where => err.backtrace[0].match(/(.*?):(\d+):/)[1], :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
247
248
  end # }}}
248
249
  def inform_manipulate_change(status,changed_dataelements,changed_endpoints,dataelements,endpoints) # {{{
249
250
  unless status.nil?
@@ -261,10 +262,10 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
261
262
  end # }}}
262
263
 
263
264
  def vote_sync_after # {{{
264
- @controller.call_vote("activity/syncing_after", :endpoint => @handler_endpoint, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
265
+ @controller.call_vote("activity/syncing_after", :activity_uuid => @handler_activity_uuid, :endpoint => @handler_endpoint, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
265
266
  end # }}}
266
267
  def vote_sync_before(parameters=nil) # {{{
267
- @controller.call_vote("activity/syncing_before", :endpoint => @handler_endpoint, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :parameters => parameters, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
268
+ @controller.call_vote("activity/syncing_before", :activity_uuid => @handler_activity_uuid, :endpoint => @handler_endpoint, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :parameters => parameters, :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"))
268
269
  end # }}}
269
270
 
270
271
  def simplify_result(result)
@@ -323,13 +324,13 @@ class DefaultHandlerWrapper < WEEL::HandlerWrapperBase
323
324
  end
324
325
 
325
326
  def callback(result=nil,options={})
326
- @controller.notify("activity/receiving", :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => structurize_result(result), :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated, :sensors => @sensors, :aggregators => @aggregators, :costs => @costs)
327
+ @controller.notify("activity/receiving", :activity_uuid => @handler_activity_uuid, :instance => @controller.instance, :label => @label, :instance_name => @controller.info, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :received => structurize_result(result), :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated, :sensors => @sensors, :aggregators => @aggregators, :costs => @costs)
327
328
  result = simplify_result(result)
328
329
  @handler_returnValue = result
329
330
  @handler_returnOptions = options
330
331
  if options['CPEE_UPDATE']
331
332
  if options['CPEE_UPDATE_STATUS']
332
- @controller.notify("activity/status", :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :status => options['CPEE_UPDATE_STATUS'], :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
333
+ @controller.notify("activity/status", :activity_uuid => @handler_activity_uuid, :instance => @controller.instance, :instance_uuid => @controller.uuid, :activity => @handler_position, :endpoint => @handler_endpoint, :status => options['CPEE_UPDATE_STATUS'], :timestamp => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%L%:z"), :attributes => @controller.attributes_translated)
333
334
  end
334
335
  @handler_continue.continue WEEL::Signal::Again
335
336
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-handlerwrapper-opcua
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: '0.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
8
8
  autorequire:
9
9
  bindir: tools
10
10
  cert_chain: []
11
- date: 2019-11-22 00:00:00.000000000 Z
11
+ date: 2019-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cpee