-
-
Notifications
You must be signed in to change notification settings - Fork 383
feat(HikVision): add ChangeWindowNum function #7436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,14 +26,14 @@ public partial class HikVisions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private string _userName = "admin"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _inited; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _loginStatus => _hikVision.IsLogin; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _logoutStatus => !_hikVision.IsLogin; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _startRealPlayStatus => _hikVision is not { IsLogin: true, IsRealPlaying: false }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _stopRealPlayStatus => _hikVision is not { IsLogin: true, IsRealPlaying: true }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _openSoundStatus => _hikVision is not { IsLogin: true, IsRealPlaying: true, IsOpenSound: false }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _closeSoundStatus => _hikVision is not { IsLogin: true, IsRealPlaying: true, IsOpenSound: true }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _startRecordStatus => _hikVision is not { IsLogin: true, IsRealPlaying: true, IsStartRecord: false }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _stopRecordStatus => _hikVision is not { IsLogin: true, IsRealPlaying: true, IsStartRecord: true }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _loginStatus => _hikVision.IsMultipleWindowType ? false : _hikVision.IsLogin; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _logoutStatus => _hikVision.IsMultipleWindowType ? false : !_hikVision.IsLogin; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _startRealPlayStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: false }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _stopRealPlayStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _openSoundStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true, IsOpenSound: false }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _closeSoundStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true, IsOpenSound: true }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _startRecordStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true, IsStartRecord: false }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _stopRecordStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true, IsStartRecord: true }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+29
to
37
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private bool _loginStatus => _hikVision.IsMultipleWindowType ? false : _hikVision.IsLogin; | |
| private bool _logoutStatus => _hikVision.IsMultipleWindowType ? false : !_hikVision.IsLogin; | |
| private bool _startRealPlayStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: false }; | |
| private bool _stopRealPlayStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true }; | |
| private bool _openSoundStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true, IsOpenSound: false }; | |
| private bool _closeSoundStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true, IsOpenSound: true }; | |
| private bool _startRecordStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true, IsStartRecord: false }; | |
| private bool _stopRecordStatus => _hikVision.IsMultipleWindowType ? false : _hikVision is not { IsLogin: true, IsRealPlaying: true, IsStartRecord: true }; | |
| // true when in single-window mode and the plugin reports a logged-in state | |
| private bool _loginStatus => !_hikVision.IsMultipleWindowType && _hikVision.IsLogin; | |
| // true when in single-window mode and the plugin reports a logged-out state | |
| private bool _logoutStatus => !_hikVision.IsMultipleWindowType && !_hikVision.IsLogin; | |
| // true when in single-window mode and NOT (logged in and currently not playing) | |
| private bool _startRealPlayStatus => | |
| !_hikVision.IsMultipleWindowType && | |
| !(_hikVision.IsLogin && !_hikVision.IsRealPlaying); | |
| // true when in single-window mode and NOT (logged in and currently playing) | |
| private bool _stopRealPlayStatus => | |
| !_hikVision.IsMultipleWindowType && | |
| !(_hikVision.IsLogin && _hikVision.IsRealPlaying); | |
| // true when in single-window mode and NOT (logged in, playing, and sound is closed) | |
| private bool _openSoundStatus => | |
| !_hikVision.IsMultipleWindowType && | |
| !(_hikVision.IsLogin && _hikVision.IsRealPlaying && !_hikVision.IsOpenSound); | |
| // true when in single-window mode and NOT (logged in, playing, and sound is open) | |
| private bool _closeSoundStatus => | |
| !_hikVision.IsMultipleWindowType && | |
| !(_hikVision.IsLogin && _hikVision.IsRealPlaying && _hikVision.IsOpenSound); | |
| // true when in single-window mode and NOT (logged in, playing, and recording is stopped) | |
| private bool _startRecordStatus => | |
| !_hikVision.IsMultipleWindowType && | |
| !(_hikVision.IsLogin && _hikVision.IsRealPlaying && !_hikVision.IsStartRecord); | |
| // true when in single-window mode and NOT (logged in, playing, and recording is started) | |
| private bool _stopRecordStatus => | |
| !_hikVision.IsMultipleWindowType && | |
| !(_hikVision.IsLogin && _hikVision.IsRealPlaying && _hikVision.IsStartRecord); |
Copilot
AI
Dec 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming of this collection is inconsistent with C# naming conventions and lacks clarity. The abbreviation _iWndTypes (presumably "iWindow Types") is unclear. Consider renaming to _windowLayoutTypes or _windowGridTypes to better describe that these represent different grid layout options (1x1, 2x2, etc.) for the video display window.
Copilot
AI
Dec 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming of this variable is inconsistent with the existing naming convention in the file. Other similar variables use camelCase with descriptive names like _streamType, _channelId, but this uses an abbreviation _iWndType. Consider renaming to _windowType or _windowLayoutType for better clarity and consistency with the codebase naming patterns.
Copilot
AI
Dec 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method lacks null safety checking. If item or item.Value is null, this will cause a runtime exception. Consider adding null checks or using null-coalescing operators to handle edge cases gracefully.
| { | |
| { | |
| if (item is null || string.IsNullOrEmpty(item.Value)) | |
| { | |
| return; | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||||||||||
| .hik-controls { | ||||||||||||||
| width: 100%; | ||||||||||||||
| display: grid; | ||||||||||||||
| gap: .5rem; | ||||||||||||||
| grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| .hik-controls ::deep .btn { | ||||||||||||||
| white-space: nowrap; | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+8
to
+10
|
||||||||||||||
| .hik-controls ::deep .btn { | |
| white-space: nowrap; | |
| } | |
| .hik-controls ::deep .btn { | |
| white-space: nowrap; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
IsDisabled="false"attribute is redundant as false is the default value for the IsDisabled property. This explicit assignment should be removed for cleaner code.