OpcTreeManager: IsHistorySupport не захватывается и не восстанавливается

Open
#142 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
csharp
Domain
backend

Research direction

Start with NtoLib/OpcTreeManager/Entities/OpcScadaItemDto.cs:144-159 and inspect OpcUaScadaItem's nine-argument constructor and IsHistorySupport access. Then trace snapshot serialization and the planned URI namespace format change. Done means snapshots preserve the history-support flag, restored nodes archive correctly, and section 3.4 of Docs/opc-tree-manager.md is updated.

Written by the indexing model from the issue text.

Description

bug

OpcUaScadaItem.IsHistorySupport имеет закрытый сеттер и заполняется только конструктором с девятью аргументами. Вендор вычисляет значение как (node.AccessLevel & PinType.HistoryRead) != 0.

OpcScadaItemDto строит объект через инициализатор и конструктор без параметров (NtoLib/OpcTreeManager/Entities/OpcScadaItemDto.cs:144-159), поэтому у всех восстановленных узлов значение ложное. Архивирование по ним не ведётся, сообщений об этом нет.

Из существующих снимков значение не восстанавливается: снимок хранит уже замаскированный PinValueType, а исходный признак выводится из AccessLevel.

Что сделать

  1. Добавить isHistorySupport в OpcScadaItemDto, захватывать публичным геттером.
  2. Восстанавливать через конструктор с девятью аргументами вместо инициализатора.
  3. Смена формата снимка. Делать одной версией вместе с переходом на хранение URI namespace, чтобы не было двух миграций подряд.

Раздел 3.4 в Docs/opc-tree-manager.md после правки обновить — ограничение оттуда снимается.

Проверка

Снять снимок с узла, у которого архивирование включено, восстановить, убедиться что признак сохранился и архив пишется.

Причина зафиксирована в Docs/known_issues/15-derived-properties-as-identity.md.

Dominant language
C#
Stars
0
Forks
0
Avg merge
19m
Merged PRs (30d)
2

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Semiteq/NtoLib

All issues in Semiteq/NtoLib

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.