DreamineVMS 1.0.0.0
Windows PC의 RTSP·USB 카메라 영상을 HLS로 변환해 원격 CCTV Viewer에 전달하는 데스크톱 에이전트입니다.
로딩중...
검색중...
일치하는것 없음
DreamineVMS.Services.Dashboard.VmsDashboardStateService 클래스 참조sealed

더 자세히 ...

DreamineVMS.Services.Dashboard.VmsDashboardStateService에 대한 상속 다이어그램 :
DreamineVMS.Services.Dashboard.VmsDashboardStateService에 대한 협력 다이어그램:

Public 멤버 함수

 VmsDashboardStateService (IVmsCameraRepository repository, ICameraRuntimeStateService runtimeState, IHybridStateStore< VmsDashboardState > stateStore)
void Start ()
void Refresh (string? lastEvent=null)
void Dispose ()

Private 멤버 함수

void OnRuntimeStateChanged (object? sender, CameraRuntimeState e)

Private 속성

readonly IVmsCameraRepository _repository
readonly ICameraRuntimeStateService _runtimeState
readonly IHybridStateStore< VmsDashboardState_stateStore
readonly object _gate = new()
bool _isStarted
bool _isDisposed

상세한 설명

카메라 Repository / RuntimeState 변경을 구독하여 VmsDashboardState를 자동 갱신하는 도메인 서비스입니다.

이 서비스는 UI 계층(WPF ViewModel, Blazor ViewModel)에 의존하지 않습니다. WPF Window가 떠 있는지와 무관하게 상태 스토어가 항상 최신을 유지합니다.

VmsDashboardStateService.cs 파일의 25 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ VmsDashboardStateService()

DreamineVMS.Services.Dashboard.VmsDashboardStateService.VmsDashboardStateService ( IVmsCameraRepository repository,
ICameraRuntimeStateService runtimeState,
IHybridStateStore< VmsDashboardState > stateStore )
inline

VmsDashboardStateService 클래스의 새 인스턴스를 초기화합니다.

매개변수
repository카메라 저장소입니다.
runtimeState카메라 런타임 상태 서비스입니다.
stateStore대시보드 상태 저장소입니다.
예외
ArgumentNullException필수 입력 인자 중 하나가 null인 경우 발생합니다.

VmsDashboardStateService.cs 파일의 122 번째 라인에서 정의되었습니다.

126 {
127 _repository = repository ?? throw new ArgumentNullException(nameof(repository));
128 _runtimeState = runtimeState ?? throw new ArgumentNullException(nameof(runtimeState));
129 _stateStore = stateStore ?? throw new ArgumentNullException(nameof(stateStore));
130 }

다음을 참조함 : _repository, _runtimeState, _stateStore.

멤버 함수 문서화

◆ Dispose()

void DreamineVMS.Services.Dashboard.VmsDashboardStateService.Dispose ( )
inline

이 인스턴스가 소유한 리소스를 해제합니다.

VmsDashboardStateService.cs 파일의 206 번째 라인에서 정의되었습니다.

207 {
208 lock (_gate)
209 {
210 if (_isDisposed)
211 {
212 return;
213 }
214
215 if (_isStarted)
216 {
217 _runtimeState.StateChanged -= OnRuntimeStateChanged;
218 _isStarted = false;
219 }
220
221 _isDisposed = true;
222 }
223 }

다음을 참조함 : _gate, _isDisposed, _isStarted, OnRuntimeStateChanged().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ OnRuntimeStateChanged()

void DreamineVMS.Services.Dashboard.VmsDashboardStateService.OnRuntimeStateChanged ( object? sender,
CameraRuntimeState e )
inlineprivate

Runtime State Changed 이벤트 또는 상태 변경을 처리합니다.

매개변수
sender이벤트를 발생시킨 객체입니다.
e이벤트와 관련된 데이터를 포함합니다.

VmsDashboardStateService.cs 파일의 249 번째 라인에서 정의되었습니다.

250 {
251 Refresh(e.LastMessage);
252 }

다음을 참조함 : DreamineVMS.Models.CameraRuntimeState.LastMessage, Refresh().

다음에 의해서 참조됨 : Dispose(), Start().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Refresh()

void DreamineVMS.Services.Dashboard.VmsDashboardStateService.Refresh ( string? lastEvent = null)
inline

Refresh 작업을 수행합니다.

매개변수
lastEventlast Event에 사용할 string? 값입니다.

DreamineVMS.Services.Dashboard.IVmsDashboardStateService를 구현.

VmsDashboardStateService.cs 파일의 173 번째 라인에서 정의되었습니다.

174 {
175 if (_isDisposed)
176 {
177 return;
178 }
179
180 IReadOnlyList<CameraDevice> cameras = _repository.GetAll();
181 IReadOnlyList<CameraRuntimeState> states = _runtimeState.GetAll();
182
183 int connectedCount = states.Count(state => state.State == CameraConnectionState.Connected);
184
185 VmsDashboardState previous = _stateStore.State;
186 string finalLastEvent = lastEvent ?? previous.LastEvent;
187
188 _stateStore.SetState(new VmsDashboardState
189 {
190 TotalCameraCount = cameras.Count,
191 ConnectedCameraCount = connectedCount,
192 RecordingCameraCount = 0,
193 LastEvent = finalLastEvent,
194 LastUpdated = DateTimeOffset.Now
195 });
196 }

다음을 참조함 : _isDisposed, _repository, _runtimeState, _stateStore, DreamineVMS.States.VmsDashboardState.LastEvent.

다음에 의해서 참조됨 : OnRuntimeStateChanged(), Start().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Start()

void DreamineVMS.Services.Dashboard.VmsDashboardStateService.Start ( )
inline

Start 작업을 수행합니다.

DreamineVMS.Services.Dashboard.IVmsDashboardStateService를 구현.

VmsDashboardStateService.cs 파일의 140 번째 라인에서 정의되었습니다.

141 {
142 lock (_gate)
143 {
144 if (_isStarted || _isDisposed)
145 {
146 return;
147 }
148
149 _runtimeState.StateChanged += OnRuntimeStateChanged;
150 _isStarted = true;
151 }
152
153 // 시작 시 1회 초기 동기화.
154 Refresh("VMS application started.");
155 }

다음을 참조함 : _gate, _isDisposed, _isStarted, OnRuntimeStateChanged(), Refresh().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ _gate

readonly object DreamineVMS.Services.Dashboard.VmsDashboardStateService._gate = new()
private

gate 값을 보관합니다.

VmsDashboardStateService.cs 파일의 62 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Dispose(), Start().

◆ _isDisposed

bool DreamineVMS.Services.Dashboard.VmsDashboardStateService._isDisposed
private

is Disposed 값을 보관합니다.

VmsDashboardStateService.cs 파일의 80 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Dispose(), Refresh(), Start().

◆ _isStarted

bool DreamineVMS.Services.Dashboard.VmsDashboardStateService._isStarted
private

is Started 값을 보관합니다.

VmsDashboardStateService.cs 파일의 71 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Dispose(), Start().

◆ _repository

readonly IVmsCameraRepository DreamineVMS.Services.Dashboard.VmsDashboardStateService._repository
private

repository 값을 보관합니다.

VmsDashboardStateService.cs 파일의 35 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Refresh(), VmsDashboardStateService().

◆ _runtimeState

readonly ICameraRuntimeStateService DreamineVMS.Services.Dashboard.VmsDashboardStateService._runtimeState
private

runtime State 값을 보관합니다.

VmsDashboardStateService.cs 파일의 44 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Refresh(), VmsDashboardStateService().

◆ _stateStore

readonly IHybridStateStore<VmsDashboardState> DreamineVMS.Services.Dashboard.VmsDashboardStateService._stateStore
private

state Store 값을 보관합니다.

VmsDashboardStateService.cs 파일의 53 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Refresh(), VmsDashboardStateService().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: