Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2b4c246
Fix license section in README.md
bytedreamer Jun 29, 2025
7720e3b
Merge pull request #41 from Z-bit-Systems-LLC/main
bytedreamer Jun 29, 2025
cca65b5
Fix license badge
bytedreamer Jun 29, 2025
f21dcbe
Add app store badges
bytedreamer Jun 29, 2025
1780d79
Side by side
bytedreamer Jun 29, 2025
4d01b71
Align badges
bytedreamer Jun 29, 2025
d69d98c
Fix store badges
bytedreamer Jun 29, 2025
6bb4c19
Choose a matching language when starting the app
bytedreamer Jul 1, 2025
3e7484f
New translations resources.resx (French)
bytedreamer Jul 1, 2025
99cef7a
New translations resources.resx (Spanish)
bytedreamer Jul 1, 2025
ade8cba
New translations resources.resx (German)
bytedreamer Jul 1, 2025
c6fdeda
New translations resources.resx (Japanese)
bytedreamer Jul 1, 2025
1b0e00b
New translations resources.resx (Chinese Simplified)
bytedreamer Jul 1, 2025
16eeaa9
Match system language with app
bytedreamer Jul 1, 2025
8d7de95
New translations resources.resx (French)
bytedreamer Jul 1, 2025
4d89e1e
New translations resources.resx (Spanish)
bytedreamer Jul 1, 2025
bcfca8e
New translations resources.resx (German)
bytedreamer Jul 1, 2025
9f0d5d2
New translations resources.resx (Japanese)
bytedreamer Jul 1, 2025
e484f22
New translations resources.resx (Chinese Simplified)
bytedreamer Jul 1, 2025
6d00a03
Fix code inspection issues
bytedreamer Jul 1, 2025
ce0fb8c
Update Nuget packages
bytedreamer Jul 1, 2025
ea9cbfb
Cleanup unused resource strings
bytedreamer Jul 1, 2025
6a59a7a
Proper display with dark theme
bytedreamer Jul 2, 2025
881b40f
Move connection status next to the LED indicators
bytedreamer Jul 2, 2025
2b713f1
New translations resources.resx (French)
bytedreamer Jul 2, 2025
6e04687
New translations resources.resx (Spanish)
bytedreamer Jul 2, 2025
20ce5ba
New translations resources.resx (German)
bytedreamer Jul 2, 2025
bfccb96
New translations resources.resx (Japanese)
bytedreamer Jul 2, 2025
d6d9ae3
New translations resources.resx (Chinese Simplified)
bytedreamer Jul 2, 2025
ee59e86
Move the connection info next to the activity LEDs
bytedreamer Jul 4, 2025
ad24521
New translations resources.resx (French)
bytedreamer Jul 4, 2025
a62ca3e
New translations resources.resx (Spanish)
bytedreamer Jul 4, 2025
78f6985
New translations resources.resx (German)
bytedreamer Jul 4, 2025
cbdcc4c
New translations resources.resx (Japanese)
bytedreamer Jul 4, 2025
d460592
New translations resources.resx (Chinese Simplified)
bytedreamer Jul 4, 2025
625d138
New translations resources.resx (French)
bytedreamer Jul 7, 2025
db5137c
New translations resources.resx (Spanish)
bytedreamer Jul 7, 2025
891750e
New translations resources.resx (German)
bytedreamer Jul 7, 2025
7b856fe
New translations resources.resx (Japanese)
bytedreamer Jul 7, 2025
aa8db42
New translations resources.resx (Chinese Simplified)
bytedreamer Jul 7, 2025
c9e1371
Merge branch 'develop' into l10n_develop
bytedreamer Jul 7, 2025
81181db
Merge pull request #42 from Z-bit-Systems-LLC/l10n_develop
bytedreamer Jul 7, 2025
d5a8618
Create a release PowerShell script
bytedreamer Jul 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions OSDP-Bench.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CRC/@EntryIndexedValue">CRC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=_002EXX/@EntryIndexedValue">.XX</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Acks/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=OSDP/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
A professional tool for configuring and troubleshooting OSDP devices.

[![.NET](https://img.shields.io/badge/.NET-8.0-blue)](https://dotnet.microsoft.com/)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](LICENSE)
[![Platform](https://img.shields.io/badge/Platform-Windows-lightgrey)](https://docs.microsoft.com/en-us/windows/)
[![License](https://img.shields.io/badge/License-Eclipse%202.0-green.svg)](LICENSE)

## About

Expand All @@ -21,6 +20,15 @@ Core functionality is under an open source license to help increase the adoption
- **Multi-language Support** - Available in multiple languages
- **Cross-platform** - Built on .NET 8.0 for modern compatibility

## Get OSDP Bench

### Download the App

OSDP Bench is available for purchase on multiple platforms:

[![Microsoft Store](https://get.microsoft.com/images/en-us%20dark.svg)](ms-windows-store://pdp/?productid=9N3W7QR3R5S7&cid=&mode=mini)
[![Google Play](src/Assets/google-play.svg)](https://play.google.com/store/apps/details?id=com.z_bitco.com.osdpbenchmobile)

## Getting Started

### Prerequisites
Expand All @@ -29,7 +37,7 @@ Core functionality is under an open source license to help increase the adoption
- Windows 10/11 (for WinUI version)
- Serial port access for device communication

### Installation
### Building from Source

1. Clone the repository:
```bash
Expand Down Expand Up @@ -84,9 +92,27 @@ For documentation contributions:
3. Update this README to include the new file
4. Follow the existing documentation style and structure

### Release Process

To create a new release:

1. Ensure you're on the `develop` branch with all changes committed
2. Run the release script:
```powershell
./ci/release.ps1
```
3. The script will:
- Verify no uncommitted changes exist
- Check that develop is ahead of main
- Display changes to be released
- Merge develop into main (with confirmation)
- Push to trigger automated CI/CD pipeline

The CI pipeline will automatically handle version bumping and release creation.

## License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
This project is licensed under the Eclipse Public License 2.0 - see the [LICENSE](LICENSE) file for details.

## Contact

Expand Down
65 changes: 65 additions & 0 deletions ci/azure-pipeline-resource-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Azure DevOps Pipeline for Resource Usage Analysis
# This pipeline runs the PowerShell resource usage checker

trigger:
branches:
include:
- main
- develop
paths:
include:
- 'src/Core/Resources/*'
- 'src/**/*.cs'
- 'src/**/*.xaml'

pr:
branches:
include:
- main
- develop
paths:
include:
- 'src/Core/Resources/*'
- 'src/**/*.cs'
- 'src/**/*.xaml'

pool:
vmImage: 'windows-latest'

variables:
buildConfiguration: 'Release'

steps:
- checkout: self
displayName: 'Checkout source code'

- task: PowerShell@2
displayName: 'Check Resource Usage'
inputs:
filePath: 'check_resource_usage.ps1'
arguments: '-Verbose'
pwsh: true
workingDirectory: '$(Build.SourcesDirectory)'
continueOnError: true

- task: PowerShell@2
displayName: 'Resource Check Summary'
inputs:
targetType: 'inline'
script: |
Write-Host "##[section]Resource Usage Analysis Complete"
Write-Host "##[command]Review the output above for any unused resources or missing definitions"
Write-Host "##[command]Consider cleaning up unused resources to maintain code quality"
pwsh: true
condition: always()

# Optional: Fail the build if critical issues are found
# Uncomment the following task if you want the pipeline to fail on resource issues
# - task: PowerShell@2
# displayName: 'Fail on Critical Resource Issues'
# inputs:
# filePath: 'check_resource_usage.ps1'
# arguments: '-Verbose'
# pwsh: true
# workingDirectory: '$(Build.SourcesDirectory)'
# condition: always()
239 changes: 239 additions & 0 deletions ci/check_resource_usage.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
# OSDP-Bench Resource Usage Checker (With Progress Indicator)

Write-Host "=== OSDP-Bench Resource Usage Analysis ===" -ForegroundColor Cyan
Write-Host

$ResourceFile = "src/Core/Resources/Resources.resx"

# Phase 1: Extract resource keys
Write-Host "Phase 1: Extracting resource keys from Resources.resx..." -ForegroundColor Yellow

if (-not (Test-Path $ResourceFile)) {
Write-Host "Error: Resources.resx not found at $ResourceFile" -ForegroundColor Red
exit 1
}

[xml]$resourceXml = Get-Content $ResourceFile
$resourceKeys = $resourceXml.root.data | Where-Object { $_.name } | Select-Object -ExpandProperty name | Sort-Object

Write-Host "Found $($resourceKeys.Count) resource keys" -ForegroundColor Green
Write-Host

# Phase 2: Check usage with progress
Write-Host "Phase 2: Checking usage of each resource key..." -ForegroundColor Yellow

$usedKeys = @()
$unusedKeys = @()
$total = $resourceKeys.Count
$current = 0

# Check if ripgrep is available for faster processing
$rgAvailable = $null -ne (Get-Command "rg" -ErrorAction SilentlyContinue)
if ($rgAvailable) {
Write-Host "Using ripgrep for fast searching..." -ForegroundColor Gray
} else {
Write-Host "Using PowerShell Select-String (slower fallback)..." -ForegroundColor Gray
}

foreach ($key in $resourceKeys) {
$current++
$percentComplete = [math]::Round(($current / $total) * 100, 1)

# Update progress bar
Write-Progress -Activity "Checking Resource Usage" -Status "Processing $key ($current of $total)" -PercentComplete $percentComplete

$found = $false

if ($rgAvailable) {
# Use ripgrep patterns - simplified for speed
try {
& rg -q $key "src" "test" --glob="*.cs" --glob="*.xaml" 2>$null
if ($LASTEXITCODE -eq 0) {
$found = $true
}
}
catch {
# Continue if rg fails
}
}
else {
# Fallback to Select-String
$files = Get-ChildItem -Path "src", "test" -Recurse -Include "*.cs", "*.xaml" -ErrorAction SilentlyContinue

if ($files | Select-String -Pattern $key -Quiet) {
$found = $true
}
}

if ($found) {
$usedKeys += $key
Write-Host "✓ $key" -ForegroundColor Green
}
else {
$unusedKeys += $key
Write-Host "✗ $key" -ForegroundColor Red
}
}

# Clear progress bar
Write-Progress -Activity "Checking Resource Usage" -Completed

Write-Host
Write-Host "=== SUMMARY ===" -ForegroundColor Cyan
Write-Host "Used resource keys: $($usedKeys.Count)" -ForegroundColor Green
Write-Host "Unused resource keys: $($unusedKeys.Count)" -ForegroundColor Red

if ($unusedKeys.Count -gt 0) {
Write-Host
Write-Host "=== UNUSED RESOURCE KEYS ===" -ForegroundColor Yellow

foreach ($key in $unusedKeys) {
$dataNode = $resourceXml.root.data | Where-Object { $_.name -eq $key }
$value = if ($dataNode.value) { $dataNode.value } else { "" }
$comment = if ($dataNode.comment) { $dataNode.comment } else { "" }

Write-Host $key -ForegroundColor Red
Write-Host " Value: `"$value`""
if ($comment) {
Write-Host " Comment: $comment"
}
Write-Host
}

Write-Host "Consider removing these unused resource strings to clean up the codebase." -ForegroundColor Yellow
}
else {
Write-Host "All resource strings are being used! 🎉" -ForegroundColor Green
}

Write-Host

# Phase 3: Check for missing resource definitions
Write-Host "Phase 3: Checking for resource lookups without definitions..." -ForegroundColor Yellow

$missingKeys = @()
$missingDetails = @()

# Get all source files
$allFiles = Get-ChildItem -Path "src", "test" -Recurse -Include "*.cs", "*.xaml" -ErrorAction SilentlyContinue

Write-Host "Found $($allFiles.Count) source files to scan..." -ForegroundColor Gray
Write-Progress -Activity "Phase 3: Scanning for Missing Definitions" -Status "Initializing scan..." -PercentComplete 0

$fileCount = 0
$totalFiles = $allFiles.Count

foreach ($file in $allFiles) {
$fileCount++
$percentComplete = [math]::Round(($fileCount / $totalFiles) * 100, 1)

Write-Progress -Activity "Phase 3: Scanning for Missing Definitions" -Status "Scanning $($file.Name) ($fileCount of $totalFiles) - $($percentComplete)%" -PercentComplete $percentComplete

# Show periodic status updates
if ($fileCount % 10 -eq 0 -or $fileCount -eq $totalFiles) {
Write-Host " Processed $fileCount of $totalFiles files..." -ForegroundColor Gray
}

try {
$content = Get-Content $file.FullName -Raw -ErrorAction SilentlyContinue
if (-not $content) { continue }

# Pattern 1: {markup:Localize KeyName}
$matches = [regex]::Matches($content, '\{markup:Localize\s+([^}]+)\}')
foreach ($match in $matches) {
$key = $match.Groups[1].Value.Trim()
if ($key -notin $resourceKeys -and $key -notin $missingKeys) {
$missingKeys += $key
$missingDetails += @{
Key = $key
File = $file.Name
Pattern = "{markup:Localize $key}"
}
}
}

# Pattern 2: GetString("KeyName")
$matches = [regex]::Matches($content, 'GetString\s*\(\s*"([^"]+)"\s*\)')
foreach ($match in $matches) {
$key = $match.Groups[1].Value
if ($key -notin $resourceKeys -and $key -notin $missingKeys) {
$missingKeys += $key
$missingDetails += @{
Key = $key
File = $file.Name
Pattern = "GetString(`"$key`")"
}
}
}

# Pattern 3: Resources.KeyName (exclude common properties)
$matches = [regex]::Matches($content, 'Resources\.([A-Za-z_][A-Za-z0-9_]*)')
foreach ($match in $matches) {
$key = $match.Groups[1].Value
if ($key -notin @("ResourceManager", "Culture", "GetString", "Resources") -and
$key -notin $resourceKeys -and $key -notin $missingKeys) {
$missingKeys += $key
$missingDetails += @{
Key = $key
File = $file.Name
Pattern = "Resources.$key"
}
}
}
}
catch {
# Skip files that can't be processed
continue
}
}

# Clear progress bar
Write-Progress -Activity "Phase 3: Scanning for Missing Definitions" -Completed
Write-Host "Completed scanning $totalFiles files for missing definitions." -ForegroundColor Gray

# Filter out common false positives
$actualMissingKeys = $missingKeys | Where-Object {
$_ -notin @("AssemblyAssociatedContentFileAttribute", "GetString", "Resources") -and
$_ -ne ""
} | Sort-Object -Unique

if ($actualMissingKeys.Count -gt 0) {
Write-Host
Write-Host "=== MISSING RESOURCE DEFINITIONS ===" -ForegroundColor Yellow
Write-Host "Found $($actualMissingKeys.Count) resource lookups without definitions:" -ForegroundColor Red
Write-Host

foreach ($key in $actualMissingKeys) {
Write-Host "Missing: $key" -ForegroundColor Red
# Show where it's referenced
$keyDetails = $missingDetails | Where-Object { $_.Key -eq $key }
foreach ($detail in $keyDetails) {
Write-Host " Used in: $($detail.File)" -ForegroundColor Blue -NoNewline
Write-Host " as $($detail.Pattern)"
}
Write-Host
}

Write-Host "These resource keys are referenced in code but not defined in Resources.resx" -ForegroundColor Yellow
}
else {
Write-Host "All resource lookups have corresponding definitions! ✓" -ForegroundColor Green
}

Write-Host
Write-Host "=== FINAL SUMMARY ===" -ForegroundColor Cyan
Write-Host "Used resource keys: $($usedKeys.Count)" -ForegroundColor Green
Write-Host "Unused resource keys: $($unusedKeys.Count)" -ForegroundColor Red
Write-Host "Missing definitions: $($actualMissingKeys.Count)" -ForegroundColor Red

if ($unusedKeys.Count -gt 0 -or $actualMissingKeys.Count -gt 0) {
Write-Host
Write-Host "⚠️ Resource issues found. Consider cleaning up unused resources and adding missing definitions." -ForegroundColor Yellow
}
else {
Write-Host
Write-Host "✅ All resource strings are properly managed!" -ForegroundColor Green
}

Write-Host
Write-Host "Analysis complete." -ForegroundColor Cyan
Loading