eva-shell 0.2.38__tar.gz → 0.2.39__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eva-shell
3
- Version: 0.2.38
3
+ Version: 0.2.39
4
4
  Summary: EVA ICS v4 shell
5
5
  Home-page: https://github.com/eva-ics/eva4
6
6
  Author: Bohemia Automation / Altertech
@@ -1,3 +1,3 @@
1
- __version__ = '0.2.38'
1
+ __version__ = '0.2.39'
2
2
 
3
3
  DEFAULT_REPOSITORY_URL = 'https://pub.bma.ai/eva4'
@@ -770,6 +770,9 @@ def append_item_cli(root_sp):
770
770
  p.add_argument('i', metavar='MASK').completer = ComplOID('state')
771
771
  p.add_argument('-y', '--full', action='store_true')
772
772
 
773
+ p = sp.add_parser('stream-info', help='item stream info')
774
+ p.add_argument('i', metavar='MASK').completer = ComplOID('state')
775
+
773
776
  p = sp.add_parser('history', help='item state history')
774
777
  p.add_argument('i', metavar='OID').completer = ComplOID('state')
775
778
  p.add_argument('-a',
@@ -6,7 +6,7 @@ from functools import partial
6
6
  from collections import OrderedDict
7
7
 
8
8
  import busrt
9
- from evaics.sdk import pack
9
+ from evaics.sdk import pack, VideoFrame
10
10
  from neotermcolor import colored
11
11
  from rapidtables import format_table, FORMAT_GENERATOR, FORMAT_GENERATOR_COLS
12
12
 
@@ -1190,6 +1190,33 @@ class CLI:
1190
1190
  't|n=set time|f=time', 'node', 'connected', 'act'
1191
1191
  ])
1192
1192
 
1193
+ def item_stream_info(self, i):
1194
+ data = call_rpc(
1195
+ 'item.state',
1196
+ dict(i=i, include_binary_values=True),
1197
+ )
1198
+ for d in data:
1199
+ value = d['value']
1200
+ del d['value']
1201
+ if value is None:
1202
+ d['format'] = 'nodata'
1203
+ else:
1204
+ try:
1205
+ frame = VideoFrame(value)
1206
+ d['format'] = frame.format_name()
1207
+ d['dims'] = [frame.width, frame.height]
1208
+ except:
1209
+ d['format'] = 'not-a-stream'
1210
+
1211
+ print_result(data,
1212
+ cols=[
1213
+ 'oid',
1214
+ 'status',
1215
+ 'format',
1216
+ 'dims',
1217
+ 't|n=set time|f=time',
1218
+ ])
1219
+
1193
1220
  def item_slog(self, i, db_svc, time_start, time_end, time_zone, limit):
1194
1221
  time_start = prepare_time(time_start)
1195
1222
  time_end = prepare_time(time_end)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eva-shell
3
- Version: 0.2.38
3
+ Version: 0.2.39
4
4
  Summary: EVA ICS v4 shell
5
5
  Home-page: https://github.com/eva-ics/eva4
6
6
  Author: Bohemia Automation / Altertech
@@ -1,4 +1,4 @@
1
- __version__ = '0.2.38'
1
+ __version__ = '0.2.39'
2
2
 
3
3
  import setuptools
4
4
 
File without changes
File without changes
File without changes
File without changes