diff --git a/config/config.exs b/config/config.exs
index 167dfd9..cfd15c2 100755
--- a/config/config.exs
+++ b/config/config.exs
@@ -146,10 +146,12 @@ config :pythonx, :uv_init,
version = "0.0.1"
requires-python = "==3.13.*"
dependencies = [
- "secop_check @ git+https://github.com/Bilchreis/secop_check.git",
+ "secop_check @ git+https://github.com/SampleEnvironment/secop-checker.git@work",
"secop-ophyd"
]
"""
+# "secop_check @ git+https://github.com/Bilchreis/secop_check.git",
+
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
diff --git a/lib/secant_service/describe_message_transformer.ex b/lib/secant_service/describe_message_transformer.ex
index 23fdb57..35c1b91 100644
--- a/lib/secant_service/describe_message_transformer.ex
+++ b/lib/secant_service/describe_message_transformer.ex
@@ -29,7 +29,16 @@ defmodule SecantService.DescribeMessageTransformer do
describe_str = Jason.encode!(statem_state[:raw_description])
- check_result = check_description(describe_str)
+ str_version = get_in(statem_state, [:idn, Access.key(:version)]) || "v1.0"
+
+ version =
+ str_version
+ |> String.replace_prefix("v", "")
+ |> String.replace_prefix("V", "")
+
+
+
+ check_result = check_description(describe_str, version)
ophyd_class =
case ophyd_class(describe_str) do
@@ -43,6 +52,7 @@ defmodule SecantService.DescribeMessageTransformer do
host: to_string(statem_state[:host]),
port: statem_state[:port],
description: properties[:description],
+ secop_version: str_version,
firmware: properties[:firmware],
implementor: properties[:implementor],
timeout: properties[:timeout],
@@ -197,6 +207,7 @@ defmodule SecantService.DescribeMessageTransformer do
"""
from secop_check.checker import Checker
+ descr_str = descr.decode('utf-8') if isinstance(descr, bytes) else str(descr)
version_str = version.decode('utf-8') if isinstance(version, bytes) else str(version)
output_str = output.decode('utf-8') if isinstance(output, bytes) else str(output)
@@ -204,22 +215,21 @@ defmodule SecantService.DescribeMessageTransformer do
checker = Checker(version_str, [], output_str)
- checker.check(descr)
+ checker.check(descr_str)
diag_list = []
for diag in checker.get_diags():
step = f' [{diag.step}]' if diag.step else ''
- ctx = ' / '.join(f'{ty} {name}'.strip()
- for ty, name in diag.ctx.path).strip()
+ ctx = ' / '.join(str(item) for item in diag.ctx.path).strip()
if ctx:
ctx += ': '
diag_list.append({"severity": diag.severity.name,
"step": diag.step,
"message": diag.msg,
- "ctx": [ list(node) for node in diag.ctx.path],
+ "ctx": [[type(item).__name__, item.name] for item in diag.ctx.path],
"text":f'{diag.severity.name}{step}: {ctx}{diag.msg}'
})
diff --git a/lib/secant_service/sec_nodes/sec_node.ex b/lib/secant_service/sec_nodes/sec_node.ex
index a6c1d8f..f95ce62 100644
--- a/lib/secant_service/sec_nodes/sec_node.ex
+++ b/lib/secant_service/sec_nodes/sec_node.ex
@@ -111,6 +111,7 @@ defmodule SecantService.SecNodes.SecNode do
:processed_values_pubsub_topic,
:error_pubsub_topic,
:node_id_str,
+ :secop_version,
:display_description,
:display_equipment_id,
:datapoint_count,
@@ -134,6 +135,7 @@ defmodule SecantService.SecNodes.SecNode do
:processed_values_pubsub_topic,
:error_pubsub_topic,
:node_id_str,
+ :secop_version,
:display_description,
:display_equipment_id,
modules: [:parameters, :commands]
@@ -215,6 +217,7 @@ defmodule SecantService.SecNodes.SecNode do
:port,
:description,
:firmware,
+ :secop_version,
:implementor,
:timeout,
:describe_message,
@@ -237,6 +240,7 @@ defmodule SecantService.SecNodes.SecNode do
:port,
:description,
:firmware,
+ :secop_version,
:implementor,
:timeout,
:describe_message,
@@ -257,6 +261,7 @@ defmodule SecantService.SecNodes.SecNode do
:port,
:description,
:firmware,
+ :secop_version,
:implementor,
:timeout,
:describe_message,
@@ -353,6 +358,10 @@ defmodule SecantService.SecNodes.SecNode do
public? true
end
+ attribute :secop_version, :string do
+ public? true
+ end
+
attribute :firmware, :string do
public? true
end
diff --git a/lib/secant_service_web/components/secop_components.ex b/lib/secant_service_web/components/secop_components.ex
index 25f9d55..dc1c49f 100755
--- a/lib/secant_service_web/components/secop_components.ex
+++ b/lib/secant_service_web/components/secop_components.ex
@@ -460,6 +460,12 @@ defmodule SecantServiceWeb.SECoPComponents do
|> DateTime.shift_zone!("Europe/Berlin")
|> Calendar.strftime("%d.%m.%Y %H:%M")}
+ <.property prop_key="SECoP Version">
+ {@node.secop_version || "v1.0"}
+
+
+
+