mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-14 13:05:01 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
006ef9e02e |
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: "[BUG]-"
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Stacktrace**
|
||||
|
||||
Include a stack trace of the exception if possible.
|
||||
```
|
||||
Paste stack trace here
|
||||
```
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,21 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: "[FEATURE]-"
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
If this is a request for support for a new device or type, be as specific as possible and include any pertinent manufacturer and model information.
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
49
.github/scripts/GenerateVersionNumber.ps1
vendored
49
.github/scripts/GenerateVersionNumber.ps1
vendored
@@ -1,49 +0,0 @@
|
||||
$latestVersions = $(git tag --merged origin/master)
|
||||
$latestVersion = [version]"0.0.0"
|
||||
Foreach ($version in $latestVersions) {
|
||||
Write-Host $version
|
||||
try {
|
||||
if (([version]$version) -ge $latestVersion) {
|
||||
$latestVersion = $version
|
||||
Write-Host "Setting latest version to: $latestVersion"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host "Unable to convert $($version). Skipping"
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$newVersion = [version]$latestVersion
|
||||
$phase = ""
|
||||
$newVersionString = ""
|
||||
switch -regex ($Env:GITHUB_REF) {
|
||||
'^refs\/heads\/master*.' {
|
||||
$newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build
|
||||
}
|
||||
'^refs\/heads\/feature\/*.' {
|
||||
$phase = 'alpha'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
'^refs\/heads\/release\/*.' {
|
||||
$splitRef = $Env:GITHUB_REF -split "/"
|
||||
$version = [version]($splitRef[-1] -replace "v", "")
|
||||
$phase = 'rc'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $version.Major, $version.Minor, $version.Build, $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
'^refs\/heads\/development*.' {
|
||||
$phase = 'beta'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
'^refs\/heads\/hotfix\/*.' {
|
||||
$phase = 'hotfix'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
'^refs\/heads\/bugfix\/*.' {
|
||||
$phase = 'hotfix'
|
||||
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Write-Output $newVersionString
|
||||
40
.github/scripts/UpdateAssemblyVersion.ps1
vendored
40
.github/scripts/UpdateAssemblyVersion.ps1
vendored
@@ -1,40 +0,0 @@
|
||||
function Update-SourceVersion {
|
||||
Param ([string]$Version)
|
||||
#$fullVersion = $Version
|
||||
$baseVersion = [regex]::Match($Version, "(\d+.\d+.\d+).*").captures.groups[1].value
|
||||
$NewAssemblyVersion = ‘AssemblyVersion("‘ + $baseVersion + ‘.*")’
|
||||
Write-Output "AssemblyVersion = $NewAssemblyVersion"
|
||||
$NewAssemblyInformationalVersion = ‘AssemblyInformationalVersion("‘ + $Version + ‘")’
|
||||
Write-Output "AssemblyInformationalVersion = $NewAssemblyInformationalVersion"
|
||||
|
||||
foreach ($o in $input) {
|
||||
Write-output $o.FullName
|
||||
$TmpFile = $o.FullName + “.tmp”
|
||||
get-content $o.FullName |
|
||||
ForEach-Object {
|
||||
$_ -replace ‘AssemblyVersion\(".*"\)’, $NewAssemblyVersion } |
|
||||
ForEach-Object {
|
||||
$_ -replace ‘AssemblyInformationalVersion\(".*"\)’, $NewAssemblyInformationalVersion
|
||||
} > $TmpFile
|
||||
move-item $TmpFile $o.FullName -force
|
||||
}
|
||||
}
|
||||
|
||||
function Update-AllAssemblyInfoFiles ( $version ) {
|
||||
foreach ($file in “AssemblyInfo.cs”, “AssemblyInfo.vb” ) {
|
||||
get-childitem -Path $Env:GITHUB_WORKSPACE -recurse | Where-Object { $_.Name -eq $file } | Update-SourceVersion $version ;
|
||||
}
|
||||
}
|
||||
|
||||
# validate arguments
|
||||
$r = [System.Text.RegularExpressions.Regex]::Match($args[0], "\d+\.\d+\.\d+.*");
|
||||
if ($r.Success) {
|
||||
Write-Output "Updating Assembly Version to $args ...";
|
||||
Update-AllAssemblyInfoFiles $args[0];
|
||||
}
|
||||
else {
|
||||
Write-Output ” “;
|
||||
Write-Output “Error: Input version does not match x.y.z format!”
|
||||
Write-Output ” “;
|
||||
Write-Output "Unable to apply version to AssemblyInfo.cs files";
|
||||
}
|
||||
44
.github/scripts/ZipBuildOutput.ps1
vendored
44
.github/scripts/ZipBuildOutput.ps1
vendored
@@ -1,44 +0,0 @@
|
||||
# Uncomment these for local testing
|
||||
# $Env:GITHUB_WORKSPACE = "C:\Working Directories\PD\essentials"
|
||||
# $Env:SOLUTION_FILE = "PepperDashEssentials"
|
||||
# $Env:VERSION = "0.0.0-buildType-test"
|
||||
|
||||
# Sets the root directory for the operation
|
||||
$destination = "$($Env:GITHUB_HOME)\output"
|
||||
New-Item -ItemType Directory -Force -Path ($destination)
|
||||
Get-ChildItem ($destination)
|
||||
$exclusions = @(git submodule foreach --quiet 'echo $name')
|
||||
# Trying to get any .json schema files (not currently working)
|
||||
# Gets any files with the listed extensions.
|
||||
Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.dll" | ForEach-Object {
|
||||
$allowed = $true;
|
||||
# Exclude any files in submodules
|
||||
foreach ($exclude in $exclusions) {
|
||||
if ((Split-Path $_.FullName -Parent).contains("$($exclude)")) {
|
||||
$allowed = $false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($allowed) {
|
||||
Write-Host "allowing $($_)"
|
||||
$_;
|
||||
}
|
||||
} | Copy-Item -Destination ($destination) -Force
|
||||
Write-Host "Getting matching files..."
|
||||
# Get any files from the output folder that match the following extensions
|
||||
Get-ChildItem -Path $destination | Where-Object { ($_.Extension -eq ".clz") -or ($_.Extension -eq ".cpz" -or ($_.Extension -eq ".cplz")) } | ForEach-Object {
|
||||
# Replace the extensions with dll and xml and create an array
|
||||
# Removed dll file capture, as previous step should capture all of them. Add if needed-> $($_ -replace "cpz|clz|cplz", "dll"),
|
||||
$filenames = @($($_ -replace "cpz|clz|cplz", "xml"))
|
||||
Write-Host "Filenames:"
|
||||
Write-Host $filenames
|
||||
if ($filenames.length -gt 0) {
|
||||
# Attempt to get the files and return them to the output directory
|
||||
Get-ChildItem -Recurse -Path "$($Env:GITHUB_WORKSPACE)" -include $filenames | Copy-Item -Destination ($destination) -Force
|
||||
}
|
||||
}
|
||||
|
||||
Get-ChildItem -Path $destination\*.cpz | Rename-Item -NewName { "$($_.BaseName)-$($Env:VERSION)$($_.Extension)" }
|
||||
Compress-Archive -Path $destination -DestinationPath "$($Env:GITHUB_WORKSPACE)\$($Env:SOLUTION_FILE)-$($Env:VERSION).zip" -Force
|
||||
Write-Host "Output Contents post Zip"
|
||||
Get-ChildItem -Path $destination
|
||||
270
.github/workflows/docker.yml
vendored
270
.github/workflows/docker.yml
vendored
@@ -1,270 +0,0 @@
|
||||
name: Branch Build Using Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- feature/*
|
||||
- hotfix/*
|
||||
- bugfix/*
|
||||
- release/*
|
||||
- development
|
||||
|
||||
env:
|
||||
# solution path doesn't need slashes unless there it is multiple folders deep
|
||||
# solution name does not include extension. .sln is assumed
|
||||
SOLUTION_PATH: PepperDashEssentials
|
||||
SOLUTION_FILE: PepperDashEssentials
|
||||
# Do not edit this, we're just creating it here
|
||||
VERSION: 0.0.0-buildtype-buildnumber
|
||||
# Defaults to debug for build type
|
||||
BUILD_TYPE: Debug
|
||||
# Defaults to master as the release branch. Change as necessary
|
||||
RELEASE_BRANCH: master
|
||||
jobs:
|
||||
Build_Project:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# First we checkout the source repo
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# And any submodules
|
||||
- name: Checkout submodules
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
||||
# Fetch all tags
|
||||
- name: Fetch tags
|
||||
run: git fetch --tags
|
||||
# Generate the appropriate version number
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
$version = ./.github/scripts/GenerateVersionNumber.ps1
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
# Use the version number to set the version of the assemblies
|
||||
- name: Update AssemblyInfo.cs
|
||||
shell: powershell
|
||||
run: |
|
||||
Write-Output ${{ env.VERSION }}
|
||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||
# Login to Docker
|
||||
- name: Login to Docker
|
||||
uses: azure/docker-login@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
# Build the solutions in the docker image
|
||||
- name: Build Solution
|
||||
shell: powershell
|
||||
run: |
|
||||
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
||||
# Zip up the output files as needed
|
||||
- name: Zip Build Output
|
||||
shell: powershell
|
||||
run: ./.github/scripts/ZipBuildOutput.ps1
|
||||
# Write the version to a file to be consumed by the push jobs
|
||||
- name: Write Version
|
||||
run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt"
|
||||
# Upload the build output as an artifact
|
||||
- name: Upload Build Output
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
# Upload the Version file as an artifact
|
||||
- name: Upload version.txt
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
path: ${{env.GITHUB_HOME}}\output\version.txt
|
||||
# Create the release on the source repo
|
||||
- name: Create tag for non-rc builds
|
||||
if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta')
|
||||
run: |
|
||||
git tag $($Env:VERSION)
|
||||
git push --tags origin
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
# using contributor's version to allow for pointing at the right commit
|
||||
if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-')
|
||||
uses: fleskesvor/create-release@feature/support-target-commitish
|
||||
with:
|
||||
tag_name: ${{ env.VERSION }}
|
||||
release_name: ${{ env.VERSION }}
|
||||
prerelease: ${{contains('debug', env.BUILD_TYPE)}}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Upload the build package to the release
|
||||
- name: Upload Release Package
|
||||
if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-')
|
||||
id: upload_release
|
||||
uses: actions/upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
asset_content_type: application/zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# This step always runs and pushes the build to the internal build rep
|
||||
Internal_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: check Github ref
|
||||
run: ${{toJson(github.ref)}}
|
||||
# Checkout the repo
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash-Engineering/essentials-builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Create new branch
|
||||
run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: |
|
||||
$branch = $($Env:GITHUB_REF) -replace "refs/heads/"
|
||||
Write-Host "Branch: $branch"
|
||||
git push -u origin $($branch) --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
# This step only runs if the branch is master or release/ runs and pushes the build to the public build repo
|
||||
Public_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
if: contains(github.ref, 'master') || contains(github.ref, '/release/')
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: check Github ref
|
||||
run: ${{toJson(github.ref)}}
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash/Essentials-Builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Create new branch
|
||||
run: git checkout -b $($Env:GITHUB_REF -replace "refs/heads/")
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: |
|
||||
$branch = $($Env:GITHUB_REF) -replace "refs/heads/"
|
||||
Write-Host "Branch: $branch"
|
||||
git push -u origin $($branch) --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
232
.github/workflows/master.yml
vendored
232
.github/workflows/master.yml
vendored
@@ -1,232 +0,0 @@
|
||||
name: Master Build using Docker
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
branches:
|
||||
- master
|
||||
env:
|
||||
# solution path doesn't need slashes unless there it is multiple folders deep
|
||||
# solution name does not include extension. .sln is assumed
|
||||
SOLUTION_PATH: PepperDashEssentials
|
||||
SOLUTION_FILE: PepperDashEssentials
|
||||
# Do not edit this, we're just creating it here
|
||||
VERSION: 0.0.0-buildtype-buildnumber
|
||||
# Defaults to debug for build type
|
||||
BUILD_TYPE: Release
|
||||
# Defaults to master as the release branch. Change as necessary
|
||||
RELEASE_BRANCH: master
|
||||
jobs:
|
||||
Build_Project:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# First we checkout the source repo
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
# And any submodules
|
||||
- name: Checkout submodules
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
||||
# Generate the appropriate version number
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
env:
|
||||
TAG_NAME: ${{ github.event.release.tag_name }}
|
||||
run: Write-Output "::set-env name=VERSION::$($Env:TAG_NAME)"
|
||||
# Use the version number to set the version of the assemblies
|
||||
- name: Update AssemblyInfo.cs
|
||||
shell: powershell
|
||||
run: |
|
||||
Write-Output ${{ env.VERSION }}
|
||||
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
|
||||
# Login to Docker
|
||||
- name: Login to Docker
|
||||
uses: azure/docker-login@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
# Build the solutions in the docker image
|
||||
- name: Build Solution
|
||||
shell: powershell
|
||||
run: |
|
||||
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
|
||||
# Zip up the output files as needed
|
||||
- name: Zip Build Output
|
||||
shell: powershell
|
||||
run: ./.github/scripts/ZipBuildOutput.ps1
|
||||
# Write the version to a file to be consumed by the push jobs
|
||||
- name: Write Version
|
||||
run: Write-Output "$($Env:VERSION)" | Out-File -FilePath "$($Env:GITHUB_HOME)\output\version.txt"
|
||||
# Upload the build output as an artifact
|
||||
- name: Upload Build Output
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
# Upload the Version file as an artifact
|
||||
- name: Upload version.txt
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
path: ${{env.GITHUB_HOME}}\output\version.txt
|
||||
# Upload the build package to the release
|
||||
- name: Upload Release Package
|
||||
id: upload_release
|
||||
uses: actions/upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: ./${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
asset_name: ${{ env.SOLUTION_FILE}}-${{ env.VERSION}}.zip
|
||||
asset_content_type: application/zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Internal_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash-Engineering/essentials-builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout/Create the branch
|
||||
- name: Checkout Master branch
|
||||
run: git checkout master
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: git push -u origin master --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
# This step only runs if the branch is master or release/ runs and pushes the build to the public build repo
|
||||
Public_Push_Output:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
# Checkout the repo
|
||||
- name: Checkout Builds Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BUILDS_TOKEN }}
|
||||
repository: PepperDash/Essentials-Builds
|
||||
ref: ${{ Env.GITHUB_REF }}
|
||||
# Download the version artifact from the build job
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Version
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem "./"
|
||||
# Set the version number environment variable from the file we just downloaded
|
||||
- name: Set Version Number
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem "./Version"
|
||||
$version = Get-Content -Path ./Version/version.txt
|
||||
Write-Host "Version: $version"
|
||||
Write-Output "::set-env name=VERSION::$version"
|
||||
Remove-Item -Path ./Version/version.txt
|
||||
Remove-Item -Path ./Version
|
||||
# Checkout master branch
|
||||
- name: Create new branch
|
||||
run: git checkout master
|
||||
# Download the build output into the repo
|
||||
- name: Download Build output
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ./
|
||||
- name: Check directory
|
||||
run: Get-ChildItem ./
|
||||
# Unzip the build package file
|
||||
- name: Unzip Build file
|
||||
run: |
|
||||
Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\
|
||||
Remove-Item -Path .\*.zip
|
||||
- name: Check directory again
|
||||
run: Get-ChildItem ./
|
||||
# Copy Contents of output folder to root directory
|
||||
- name: Copy Files to root & delete output directory
|
||||
run: |
|
||||
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
|
||||
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
|
||||
Remove-Item -Path .\output -Recurse
|
||||
# Commits the build output to the branch and tags it with the version
|
||||
- name: Commit build output and tag the commit
|
||||
shell: powershell
|
||||
run: |
|
||||
git config user.email "actions@pepperdash.com"
|
||||
git config user.name "GitHub Actions"
|
||||
git add .
|
||||
$commit = "Build $($Env:GITHUB_RUN_NUMBER) from commit: https://github.com/$($Env:GITHUB_REPOSITORY)/commit/$($Env:GITHUB_SHA)"
|
||||
Write-Host "Commit: $commit"
|
||||
git commit -m $commit
|
||||
git tag $($Env:VERSION)
|
||||
# Push the commit
|
||||
- name: Push to Builds Repo
|
||||
shell: powershell
|
||||
run: git push -u origin master --force
|
||||
# Push the tags
|
||||
- name: Push tags
|
||||
run: git push --tags origin
|
||||
- name: Check Directory
|
||||
run: Get-ChildItem ./
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -20,8 +20,4 @@ obj/
|
||||
[Rr]elease*/
|
||||
_ReSharper*/
|
||||
SIMPLSharpLogs/
|
||||
*.projectinfo
|
||||
essentials-framework/EssentialDMTestConfig/
|
||||
output/
|
||||
|
||||
PepperDashEssentials-0.0.0-buildType-test.zip
|
||||
*.projectinfo
|
||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,6 +0,0 @@
|
||||
[submodule "essentials-framework/pepperdashcore-builds"]
|
||||
path = essentials-framework/pepperdashcore-builds
|
||||
url = https://github.com/ndorin/PepperDashCore-Builds.git
|
||||
[submodule "Essentials-Template-UI"]
|
||||
path = Essentials-Template-UI
|
||||
url = https://github.com/PepperDash/Essentials-Template-UI.git
|
||||
110
CONTRIBUTING.md
110
CONTRIBUTING.md
@@ -1,110 +0,0 @@
|
||||
# Contributors Guide
|
||||
|
||||
Essentials is an open source project. If you are interested in making it better,
|
||||
there are many ways you can contribute. For example, you can:
|
||||
|
||||
- Submit a bug report
|
||||
- Suggest a new feature
|
||||
- Provide feedback by commenting on feature requests/proposals
|
||||
- Propose a patch by submitting a pull request
|
||||
- Suggest or submit documentation improvements
|
||||
- Review outstanding pull requests
|
||||
- Answer questions from other users
|
||||
- Share the software with other users who are interested
|
||||
- Teach others to use the software
|
||||
|
||||
## Bugs and Feature Requests
|
||||
|
||||
If you believe that you have found a bug or wish to propose a new feature,
|
||||
please first search the existing [issues] to see if it has already been
|
||||
reported. If you are unable to find an existing issue, consider using one of
|
||||
the provided templates to create a new issue and provide as many details as you
|
||||
can to assist in reproducing the bug or explaining your proposed feature.
|
||||
|
||||
## Patch Submission tips
|
||||
|
||||
Patches should be submitted in the form of Pull Requests to the Essentials
|
||||
[repository] on GitHub. But first, consider the following tips to ensure a
|
||||
smooth process when submitting a patch:
|
||||
|
||||
- Ensure that the patch compiles and does not break any build-time tests.
|
||||
- Be understanding, patient, and friendly; developers may need time to review
|
||||
your submissions before they can take action or respond. This does not mean
|
||||
your contribution is not valued. If your contribution has not received a
|
||||
response in a reasonable time, consider commenting with a polite inquiry for
|
||||
an update.
|
||||
- Limit your patches to the smallest reasonable change to achieve your intended
|
||||
goal. For example, do not make unnecessary indentation changes; but don't go
|
||||
out of your way to make the patch so minimal that it isn't easy to read,
|
||||
either. Consider the reviewer's perspective.
|
||||
- Before submission, please squash your commits to using a message that starts
|
||||
with the issue number and a description of the changes.
|
||||
- Isolate multiple patches from each other. If you wish to make several
|
||||
independent patches, do so in separate, smaller pull requests that can be
|
||||
reviewed more easily.
|
||||
- Be prepared to answer questions from reviewers. They may have further
|
||||
questions before accepting your patch, and may even propose changes. Please
|
||||
accept this feedback constructively, and not as a rejection of your proposed
|
||||
change.
|
||||
|
||||
## GitFlow Branch Model
|
||||
This repository adheres to the [GitFlow](https://nvie.com/posts/a-successful-git-branching-model/) branch model and is intitialized for GitFlow to make for consistent branch name prefixes. Please take time to familiarize yourself with this model.
|
||||
|
||||
- `master` will contain the latest stable version of the framework and release builds will be created from tagged commits on `master`.
|
||||
- HotFix/Patch Pull Requests should target `master` as the base branch.
|
||||
- All other Pull Requests (bug fixes, enhancements, etc.) should target `development` as the base branch.
|
||||
- `release/vX.Y.X` branches will be used for release candidates when moving new features from `development` to `master`.
|
||||
Beta builds will be created from tagged commits on release candidate branches.
|
||||
|
||||
## Review
|
||||
|
||||
- We welcome code reviews from anyone. A committer is required to formally
|
||||
accept and merge the changes.
|
||||
- Reviewers will be looking for things like threading issues, performance
|
||||
implications, API design, duplication of existing functionality, readability
|
||||
and code style, avoidance of bloat (scope-creep), etc.
|
||||
- Reviewers will likely ask questions to better understand your change.
|
||||
- Reviewers will make comments about changes to your patch:
|
||||
- MUST means that the change is required
|
||||
- SHOULD means that the change is suggested, further discussion on the
|
||||
subject may be required
|
||||
- COULD means that the change is optional
|
||||
|
||||
## Timeline and Managing Expectations
|
||||
|
||||
As we continue to engage contributors and learn best practices for running a successful open source project, our processes
|
||||
and guidance will likely evolve. We will try to communicate expectations as we are able and to always be responsive. We
|
||||
hope that the community will share their suggestions for improving this engagement. Based on the level of initial interest
|
||||
we receive and the availability of resources to evaluate contributions, we anticipate the following:
|
||||
|
||||
- We will initially prioritize pull requests that include small bug fixes and code that addresses potential vulnerabilities
|
||||
as well as pull requests that include improvements for processor language specifications because these require a
|
||||
reasonable amount of effort to evaluate and will help us exercise and revise our process for accepting contributions. In
|
||||
other words, we are going to start small in order to work out the kinks first.
|
||||
- We are committed to maintaining the integrity and security of our code base. In addition to the careful review the
|
||||
maintainers will give to code contributions to make sure they do not introduce new bugs or vulnerabilities, we will be
|
||||
trying to identify best practices to incorporate with our open source project so that contributors can have more control
|
||||
over whether their contributions are accepted. These might include things like style guides and requirements for tests and
|
||||
documentation to accompany some code contributions. As a result, it may take a long time for some contributions to be
|
||||
accepted. This does not mean we are ignoring them.
|
||||
- We are committed to integrating this GitHub project with our team's regular development work flow so that the open source
|
||||
project remains dynamic and relevant. This may affect our responsiveness and ability to accept pull requests
|
||||
quickly. This does not mean we are ignoring them.
|
||||
- Not all innovative ideas need to be accepted as pull requests into this GitHub project to be valuable to the community.
|
||||
There may be times when we recommend that you just share your code for some enhancement to Ghidra from your own
|
||||
repository. As we identify and recognize extensions that are of general interest to the reverse engineering community, we
|
||||
may seek to incorporate them with our baseline.
|
||||
|
||||
## Legal
|
||||
|
||||
Consistent with Section D.6. of the GitHub Terms of Service as of 2019, and the MIT license, the project maintainer for this project accepts contributions using the inbound=outbound model.
|
||||
When you submit a pull request to this repository (inbound), you are agreeing to license your contribution under the same terms as specified in [LICENSE] (outbound).
|
||||
|
||||
This is an open source project.
|
||||
Contributions you make to this repository are completely voluntary.
|
||||
When you submit an issue, bug report, question, enhancement, pull request, etc., you are offering your contribution without expectation of payment, you expressly waive any future pay claims against PepperDash related to your contribution, and you acknowledge that this does not create an obligation on the part of PepperDash of any kind.
|
||||
Furthermore, your contributing to this project does not create an employer-employee relationship between the PepperDash and the contributor.
|
||||
|
||||
[issues]: https://github.com/PepperDash/Essentials/issues
|
||||
[repository]: https://github.com/PepperDash/Essentials
|
||||
[LICENSE]: https://github.com/PepperDash/Essentials/blob/master/LICENSE.md
|
||||
@@ -6,6 +6,8 @@ using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
@@ -21,57 +23,32 @@ namespace PepperDash.Essentials.Core
|
||||
ComPort Port;
|
||||
ComPort.ComPortSpec Spec;
|
||||
|
||||
public ComPortController(string key, Func<EssentialsControlPropertiesConfig, ComPort> postActivationFunc,
|
||||
ComPort.ComPortSpec spec, EssentialsControlPropertiesConfig config) : base(key)
|
||||
{
|
||||
Spec = spec;
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
Port = postActivationFunc(config);
|
||||
|
||||
RegisterAndConfigureComPort();
|
||||
});
|
||||
}
|
||||
|
||||
public ComPortController(string key, ComPort port, ComPort.ComPortSpec spec)
|
||||
: base(key)
|
||||
{
|
||||
if (port == null)
|
||||
{
|
||||
Debug.Console(0, this, "ERROR: Invalid com port, continuing but comms will not function");
|
||||
return;
|
||||
}
|
||||
|
||||
Port = port;
|
||||
Spec = spec;
|
||||
//IsConnected = new BoolFeedback(CommonBoolCue.IsConnected, () => true);
|
||||
|
||||
RegisterAndConfigureComPort();
|
||||
if (Port.Parent is CrestronControlSystem)
|
||||
{
|
||||
var result = Port.Register();
|
||||
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
Debug.Console(0, this, "WARNING: Cannot register Com port: {0}", result);
|
||||
return; // false
|
||||
}
|
||||
}
|
||||
var specResult = Port.SetComPortSpec(Spec);
|
||||
if (specResult != 0)
|
||||
{
|
||||
Debug.Console(0, this, "WARNING: Cannot set comspec");
|
||||
return; // false
|
||||
}
|
||||
Port.SerialDataReceived += new ComPortDataReceivedEvent(Port_SerialDataReceived);
|
||||
}
|
||||
|
||||
private void RegisterAndConfigureComPort()
|
||||
{
|
||||
if (Port.Parent is CrestronControlSystem)
|
||||
{
|
||||
var result = Port.Register();
|
||||
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
Debug.Console(0, this, "ERROR: Cannot register Com port: {0}", result);
|
||||
return; // false
|
||||
}
|
||||
}
|
||||
|
||||
var specResult = Port.SetComPortSpec(Spec);
|
||||
if (specResult != 0)
|
||||
{
|
||||
Debug.Console(0, this, "WARNING: Cannot set comspec");
|
||||
return;
|
||||
}
|
||||
Port.SerialDataReceived += Port_SerialDataReceived;
|
||||
}
|
||||
|
||||
~ComPortController()
|
||||
~ComPortController()
|
||||
{
|
||||
Port.SerialDataReceived -= Port_SerialDataReceived;
|
||||
}
|
||||
@@ -103,15 +80,11 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public void SendText(string text)
|
||||
{
|
||||
if (Port == null)
|
||||
return;
|
||||
Port.Send(text);
|
||||
}
|
||||
|
||||
public void SendBytes(byte[] bytes)
|
||||
{
|
||||
if (Port == null)
|
||||
return;
|
||||
var text = Encoding.GetEncoding(28591).GetString(bytes, 0, bytes.Length);
|
||||
Port.Send(text);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
@@ -32,7 +31,7 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a comm method of either com port, TCP, SSH, and puts this into the DeviceManager
|
||||
/// Returns a comm method of either com port, TCP, SSH
|
||||
/// </summary>
|
||||
/// <param name="deviceConfig">The Device config object</param>
|
||||
public static IBasicCommunication CreateCommForDevice(DeviceConfig deviceConfig)
|
||||
@@ -48,11 +47,8 @@ namespace PepperDash.Essentials.Core
|
||||
switch (controlConfig.Method)
|
||||
{
|
||||
case eControlMethod.Com:
|
||||
comm = new ComPortController(deviceConfig.Key + "-com", GetComPort, controlConfig.ComParams, controlConfig);
|
||||
comm = new ComPortController(deviceConfig.Key + "-com", GetComPort(controlConfig), controlConfig.ComParams);
|
||||
break;
|
||||
case eControlMethod.Cec:
|
||||
comm = new CecPortController(deviceConfig.Key + "-cec", GetCecPort, controlConfig);
|
||||
break;
|
||||
case eControlMethod.IR:
|
||||
break;
|
||||
case eControlMethod.Ssh:
|
||||
@@ -72,12 +68,6 @@ namespace PepperDash.Essentials.Core
|
||||
tcp.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
|
||||
comm = tcp;
|
||||
break;
|
||||
}
|
||||
case eControlMethod.Udp:
|
||||
{
|
||||
var udp = new GenericUdpServer(deviceConfig.Key + "-udp", c.Address, c.Port, c.BufferSize);
|
||||
comm = udp;
|
||||
break;
|
||||
}
|
||||
case eControlMethod.Telnet:
|
||||
break;
|
||||
@@ -108,33 +98,6 @@ namespace PepperDash.Essentials.Core
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an ICec port from a RoutingInput or RoutingOutput on a device
|
||||
/// </summary>
|
||||
/// <param name="config"></param>
|
||||
/// <returns></returns>
|
||||
public static ICec GetCecPort(ControlPropertiesConfig config)
|
||||
{
|
||||
var dev = DeviceManager.GetDeviceForKey(config.ControlPortDevKey);
|
||||
|
||||
if (dev != null)
|
||||
{
|
||||
var inputPort = (dev as IRoutingInputsOutputs).InputPorts[config.ControlPortName];
|
||||
|
||||
if (inputPort != null)
|
||||
if (inputPort.Port is ICec)
|
||||
return inputPort.Port as ICec;
|
||||
|
||||
var outputPort = (dev as IRoutingInputsOutputs).OutputPorts[config.ControlPortName];
|
||||
|
||||
if (outputPort != null)
|
||||
if (outputPort.Port is ICec)
|
||||
return outputPort.Port as ICec;
|
||||
}
|
||||
Debug.Console(0, "GetCecPort: Device '{0}' does not have a CEC port called: '{1}'", config.ControlPortDevKey, config.ControlPortName);
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper to grab the IComPorts device for this PortDeviceKey. Key "controlSystem" will
|
||||
/// return the ControlSystem object from the Global class.
|
||||
@@ -162,29 +125,43 @@ namespace PepperDash.Essentials.Core
|
||||
public class EssentialsControlPropertiesConfig :
|
||||
PepperDash.Core.ControlPropertiesConfig
|
||||
{
|
||||
// ****** All of these things, except for #Pro-specific com stuff, were
|
||||
// moved into PepperDash.Core to help non-pro PortalSync.
|
||||
|
||||
//public eControlMethod Method { get; set; }
|
||||
|
||||
//public string ControlPortDevKey { get; set; }
|
||||
|
||||
//[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] // In case "null" is present in config on this value
|
||||
//public uint ControlPortNumber { get; set; }
|
||||
|
||||
//public TcpSshPropertiesConfig TcpSshProperties { get; set; }
|
||||
|
||||
//public string IrFile { get; set; }
|
||||
|
||||
//public ComPortConfig ComParams { get; set; }
|
||||
|
||||
[JsonConverter(typeof(ComSpecJsonConverter))]
|
||||
public ComPort.ComPortSpec ComParams { get; set; }
|
||||
|
||||
public string CresnetId { get; set; }
|
||||
//public string IpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to provide uint conversion of string CresnetId
|
||||
/// </summary>
|
||||
public uint CresnetIdInt
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return Convert.ToUInt32(CresnetId, 16);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new FormatException(string.Format("ERROR:Unable to convert Cresnet ID: {0} to hex. Error:\n{1}", CresnetId));
|
||||
}
|
||||
}
|
||||
}
|
||||
//[JsonIgnore]
|
||||
//public uint IpIdInt { get { return Convert.ToUInt32(IpId, 16); } }
|
||||
|
||||
//public char EndOfLineChar { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// Defaults to Environment.NewLine;
|
||||
///// </summary>
|
||||
//public string EndOfLineString { get; set; }
|
||||
|
||||
//public string DeviceReadyResponsePattern { get; set; }
|
||||
|
||||
//public EssentialsControlPropertiesConfig()
|
||||
//{
|
||||
// EndOfLineString = CrestronEnvironment.NewLine;
|
||||
//}
|
||||
}
|
||||
|
||||
public class IrControlSpec
|
||||
@@ -193,4 +170,9 @@ namespace PepperDash.Essentials.Core
|
||||
public uint PortNumber { get; set; }
|
||||
public string File { get; set; }
|
||||
}
|
||||
|
||||
//public enum eControlMethod
|
||||
//{
|
||||
// None = 0, Com, IpId, IR, Ssh, Tcpip, Telnet
|
||||
//}
|
||||
}
|
||||
@@ -5,12 +5,10 @@ using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class ConsoleCommMockDevice : EssentialsDevice, ICommunicationMonitor
|
||||
public class ConsoleCommMockDevice : Device, ICommunicationMonitor
|
||||
{
|
||||
public IBasicCommunication Communication { get; private set; }
|
||||
public CommunicationGather PortGather { get; private set; }
|
||||
@@ -73,21 +71,4 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
|
||||
public class ConsoleCommMockDeviceFactory : EssentialsDeviceFactory<ConsoleCommMockDevice>
|
||||
{
|
||||
public ConsoleCommMockDeviceFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "commmock" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new Comm Mock Device");
|
||||
var comm = CommFactory.CreateCommForDevice(dc);
|
||||
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<ConsoleCommMockDevicePropertiesConfig>(
|
||||
dc.Properties.ToString());
|
||||
return new ConsoleCommMockDevice(dc.Key, dc.Name, props, comm);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
get
|
||||
{
|
||||
return Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
|
||||
return string.Format(@"\NVRAM\Program{0}\IR\", InitialParametersClass.ApplicationNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
|
||||
//public class ComPortConfig
|
||||
//{
|
||||
// //public string ContolPortDevKey { get; set; }
|
||||
|
||||
// //public uint ControlPortNumber { get; set; }
|
||||
|
||||
// [JsonConverter(typeof(ComSpecJsonConverter))]
|
||||
// public ComPort.ComPortSpec ComParams { get; set; }
|
||||
//}
|
||||
}
|
||||
@@ -17,6 +17,9 @@ namespace PepperDash.Essentials.Core.Config
|
||||
[JsonProperty("info")]
|
||||
public InfoConfig Info { get; set; }
|
||||
|
||||
//[JsonProperty("roomLists")]
|
||||
//public Dictionary<string, List<string>> RoomLists { get; set; }
|
||||
|
||||
[JsonProperty("devices")]
|
||||
public List<DeviceConfig> Devices { get; set; }
|
||||
|
||||
@@ -26,9 +29,6 @@ namespace PepperDash.Essentials.Core.Config
|
||||
[JsonProperty("tieLines")]
|
||||
public List<TieLineConfig> TieLines { get; set; }
|
||||
|
||||
[JsonProperty("joinMaps")]
|
||||
public Dictionary<string, string> JoinMaps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Checks SourceLists for a given list and returns it if found. Otherwise, returns null
|
||||
/// </summary>
|
||||
@@ -39,25 +39,5 @@ namespace PepperDash.Essentials.Core.Config
|
||||
|
||||
return SourceLists[key];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null
|
||||
/// </summary>
|
||||
/// <param name="key">Key of desired device</param>
|
||||
/// <returns></returns>
|
||||
public DeviceConfig GetDeviceForKey(string key)
|
||||
{
|
||||
if (string.IsNullOrEmpty(key))
|
||||
return null;
|
||||
|
||||
var deviceConfig = Devices.FirstOrDefault(d => d.Key.Equals(key));
|
||||
|
||||
if (deviceConfig != null)
|
||||
return deviceConfig;
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the info section of a Config file
|
||||
/// </summary>
|
||||
public class InfoConfig
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("date")]
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonProperty("version")]
|
||||
public string Version { get; set; }
|
||||
|
||||
[JsonProperty("comment")]
|
||||
public string Comment { get; set; }
|
||||
|
||||
public InfoConfig()
|
||||
{
|
||||
Name = "";
|
||||
Date = DateTime.Now;
|
||||
Type = "";
|
||||
Version = "";
|
||||
Comment = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
127
Essentials Core/PepperDashEssentialsBase/Constants/CommonCues.cs
Normal file
127
Essentials Core/PepperDashEssentialsBase/Constants/CommonCues.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public static class CommonBoolCue
|
||||
{
|
||||
public static readonly Cue Power = new Cue("Power", 101, eCueType.Bool);
|
||||
public static readonly Cue PowerOn = new Cue("PowerOn", 102, eCueType.Bool);
|
||||
public static readonly Cue PowerOff = new Cue("PowerOff", 103, eCueType.Bool);
|
||||
|
||||
public static readonly Cue HasPowerFeedback = new Cue("HasPowerFeedback", 101, eCueType.Bool);
|
||||
public static readonly Cue PowerOnFeedback = new Cue("PowerOnFeedback", 102, eCueType.Bool);
|
||||
public static readonly Cue IsOnlineFeedback = new Cue("IsOnlineFeedback", 104, eCueType.Bool);
|
||||
public static readonly Cue IsWarmingUp = new Cue("IsWarmingUp", 105, eCueType.Bool);
|
||||
public static readonly Cue IsCoolingDown = new Cue("IsCoolingDown", 106, eCueType.Bool);
|
||||
|
||||
public static readonly Cue Dash = new Cue("Dash", 109, eCueType.Bool);
|
||||
public static readonly Cue Digit0 = new Cue("Digit0", 110, eCueType.Bool);
|
||||
public static readonly Cue Digit1 = new Cue("Digit1", 111, eCueType.Bool);
|
||||
public static readonly Cue Digit2 = new Cue("Digit2", 112, eCueType.Bool);
|
||||
public static readonly Cue Digit3 = new Cue("Digit3", 113, eCueType.Bool);
|
||||
public static readonly Cue Digit4 = new Cue("Digit4", 114, eCueType.Bool);
|
||||
public static readonly Cue Digit5 = new Cue("Digit5", 115, eCueType.Bool);
|
||||
public static readonly Cue Digit6 = new Cue("Digit6", 116, eCueType.Bool);
|
||||
public static readonly Cue Digit7 = new Cue("Digit7", 117, eCueType.Bool);
|
||||
public static readonly Cue Digit8 = new Cue("Digit8", 118, eCueType.Bool);
|
||||
public static readonly Cue Digit9 = new Cue("Digit9", 119, eCueType.Bool);
|
||||
public static readonly Cue KeypadMisc1 = new Cue("KeypadMisc1", 120, eCueType.Bool);
|
||||
public static readonly Cue KeypadMisc2 = new Cue("KeypadMisc2", 121, eCueType.Bool);
|
||||
|
||||
public static readonly Cue NumericEnter = new Cue("Enter", 122, eCueType.Bool);
|
||||
public static readonly Cue ChannelUp = new Cue("ChannelUp", 123, eCueType.Bool);
|
||||
public static readonly Cue ChannelDown = new Cue("ChannelDown", 124, eCueType.Bool);
|
||||
public static readonly Cue Last = new Cue("Last", 125, eCueType.Bool);
|
||||
public static readonly Cue OpenClose = new Cue("OpenClose", 126, eCueType.Bool);
|
||||
public static readonly Cue Subtitle = new Cue("Subtitle", 127, eCueType.Bool);
|
||||
public static readonly Cue Audio = new Cue("Audio", 128, eCueType.Bool);
|
||||
public static readonly Cue Info = new Cue("Info", 129, eCueType.Bool);
|
||||
public static readonly Cue Menu = new Cue("Menu", 130, eCueType.Bool);
|
||||
public static readonly Cue DeviceMenu = new Cue("DeviceMenu", 131, eCueType.Bool);
|
||||
public static readonly Cue Return = new Cue("Return", 132, eCueType.Bool);
|
||||
public static readonly Cue Back = new Cue("Back", 133, eCueType.Bool);
|
||||
public static readonly Cue Exit = new Cue("Exit", 134, eCueType.Bool);
|
||||
public static readonly Cue Clear = new Cue("Clear", 135, eCueType.Bool);
|
||||
public static readonly Cue List = new Cue("List", 136, eCueType.Bool);
|
||||
public static readonly Cue Guide = new Cue("Guide", 137, eCueType.Bool);
|
||||
public static readonly Cue Am = new Cue("Am", 136, eCueType.Bool);
|
||||
public static readonly Cue Fm = new Cue("Fm", 137, eCueType.Bool);
|
||||
public static readonly Cue Up = new Cue("Up", 138, eCueType.Bool);
|
||||
public static readonly Cue Down = new Cue("Down", 139, eCueType.Bool);
|
||||
public static readonly Cue Left = new Cue("Left", 140, eCueType.Bool);
|
||||
public static readonly Cue Right = new Cue("Right", 141, eCueType.Bool);
|
||||
public static readonly Cue Select = new Cue("Select", 142, eCueType.Bool);
|
||||
public static readonly Cue SmartApps = new Cue("SmartApps", 143, eCueType.Bool);
|
||||
public static readonly Cue Dvr = new Cue("Dvr", 144, eCueType.Bool);
|
||||
|
||||
public static readonly Cue Play = new Cue("Play", 145, eCueType.Bool);
|
||||
public static readonly Cue Pause = new Cue("Pause", 146, eCueType.Bool);
|
||||
public static readonly Cue Stop = new Cue("Stop", 147, eCueType.Bool);
|
||||
public static readonly Cue ChapNext = new Cue("ChapNext", 148, eCueType.Bool);
|
||||
public static readonly Cue ChapPrevious = new Cue("ChapPrevious", 149, eCueType.Bool);
|
||||
public static readonly Cue Rewind = new Cue("Rewind", 150, eCueType.Bool);
|
||||
public static readonly Cue Ffwd = new Cue("Ffwd", 151, eCueType.Bool);
|
||||
public static readonly Cue Replay = new Cue("Replay", 152, eCueType.Bool);
|
||||
public static readonly Cue Advance = new Cue("Advance", 153, eCueType.Bool);
|
||||
public static readonly Cue Record = new Cue("Record", 154, eCueType.Bool);
|
||||
public static readonly Cue Red = new Cue("Red", 155, eCueType.Bool);
|
||||
public static readonly Cue Green = new Cue("Green", 156, eCueType.Bool);
|
||||
public static readonly Cue Yellow = new Cue("Yellow", 157, eCueType.Bool);
|
||||
public static readonly Cue Blue = new Cue("Blue", 158, eCueType.Bool);
|
||||
public static readonly Cue Home = new Cue("Home", 159, eCueType.Bool);
|
||||
public static readonly Cue PopUp = new Cue("PopUp", 160, eCueType.Bool);
|
||||
public static readonly Cue PageUp = new Cue("PageUp", 161, eCueType.Bool);
|
||||
public static readonly Cue PageDown = new Cue("PageDown", 162, eCueType.Bool);
|
||||
public static readonly Cue Search = new Cue("Search", 163, eCueType.Bool);
|
||||
public static readonly Cue Setup = new Cue("Setup", 164, eCueType.Bool);
|
||||
public static readonly Cue RStep = new Cue("RStep", 165, eCueType.Bool);
|
||||
public static readonly Cue FStep = new Cue("FStep", 166, eCueType.Bool);
|
||||
|
||||
public static readonly Cue IsConnected = new Cue("IsConnected", 281, eCueType.Bool);
|
||||
public static readonly Cue IsOk = new Cue("IsOk", 282, eCueType.Bool);
|
||||
public static readonly Cue InWarning = new Cue("InWarning", 283, eCueType.Bool);
|
||||
public static readonly Cue InError = new Cue("InError", 284, eCueType.Bool);
|
||||
public static readonly Cue StatusUnknown = new Cue("StatusUnknown", 285, eCueType.Bool);
|
||||
|
||||
public static readonly Cue VolumeUp = new Cue("VolumeUp", 401, eCueType.Bool);
|
||||
public static readonly Cue VolumeDown = new Cue("VolumeDown", 402, eCueType.Bool);
|
||||
public static readonly Cue MuteOn = new Cue("MuteOn", 403, eCueType.Bool);
|
||||
public static readonly Cue MuteOff = new Cue("MuteOff", 404, eCueType.Bool);
|
||||
public static readonly Cue MuteToggle = new Cue("MuteToggle", 405, eCueType.Bool);
|
||||
public static readonly Cue ShowVolumeButtons = new Cue("ShowVolumeButtons", 406, eCueType.Bool);
|
||||
public static readonly Cue ShowVolumeSlider = new Cue("ShowVolumeSlider", 407, eCueType.Bool);
|
||||
|
||||
public static readonly Cue Hdmi1 = new Cue("Hdmi1", 451, eCueType.Bool);
|
||||
public static readonly Cue Hdmi2 = new Cue("Hdmi2", 452, eCueType.Bool);
|
||||
public static readonly Cue Hdmi3 = new Cue("Hdmi3", 453, eCueType.Bool);
|
||||
public static readonly Cue Hdmi4 = new Cue("Hdmi4", 454, eCueType.Bool);
|
||||
public static readonly Cue Hdmi5 = new Cue("Hdmi5", 455, eCueType.Bool);
|
||||
public static readonly Cue Hdmi6 = new Cue("Hdmi6", 456, eCueType.Bool);
|
||||
public static readonly Cue DisplayPort1 = new Cue("DisplayPort1", 457, eCueType.Bool);
|
||||
public static readonly Cue DisplayPort2 = new Cue("DisplayPort2", 458, eCueType.Bool);
|
||||
public static readonly Cue Dvi1 = new Cue("Dvi1", 459, eCueType.Bool);
|
||||
public static readonly Cue Dvi2 = new Cue("Dvi2", 460, eCueType.Bool);
|
||||
public static readonly Cue Video1 = new Cue("Video1", 461, eCueType.Bool);
|
||||
public static readonly Cue Video2 = new Cue("Video2", 462, eCueType.Bool);
|
||||
public static readonly Cue Component1 = new Cue("Component1", 463, eCueType.Bool);
|
||||
public static readonly Cue Component2 = new Cue("Component2", 464, eCueType.Bool);
|
||||
public static readonly Cue Vga1 = new Cue("Vga1", 465, eCueType.Bool);
|
||||
public static readonly Cue Vga2 = new Cue("Vga2", 466, eCueType.Bool);
|
||||
public static readonly Cue Rgb1 = new Cue("Rgb1", 467, eCueType.Bool);
|
||||
public static readonly Cue Rgb2 = new Cue("Rgb2", 468, eCueType.Bool);
|
||||
public static readonly Cue Antenna = new Cue("Antenna", 469, eCueType.Bool);
|
||||
|
||||
public static readonly Cue InCall = new Cue("InCall", 501, eCueType.Bool);
|
||||
}
|
||||
|
||||
public static class CommonIntCue
|
||||
{
|
||||
public static readonly Cue MainVolumeLevel = new Cue("MainVolumeLevel", 401, eCueType.Int);
|
||||
public static readonly Cue MainVolumeLevelFeedback = new Cue("MainVolumeLevelFeedback", 401, eCueType.Int);
|
||||
}
|
||||
|
||||
public static class CommonStringCue
|
||||
{
|
||||
public static readonly Cue IpConnectionsText = new Cue("IpConnectionsText", 9999, eCueType.String);
|
||||
}
|
||||
}
|
||||
@@ -1,128 +1,122 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// A bridge class to cover the basic features of GenericBase hardware
|
||||
/// </summary>
|
||||
public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
|
||||
{
|
||||
public virtual GenericBase Hardware { get; protected set; }
|
||||
|
||||
public BoolFeedback IsOnline { get; private set; }
|
||||
public BoolFeedback IsRegistered { get; private set; }
|
||||
public StringFeedback IpConnectionsText { get; private set; }
|
||||
|
||||
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
||||
: base(key, name)
|
||||
{
|
||||
Hardware = hardware;
|
||||
IsOnline = new BoolFeedback(CommonBoolCue.IsOnlineFeedback, () => Hardware.IsOnline);
|
||||
IsRegistered = new BoolFeedback(new Cue("IsRegistered", 0, eCueType.Bool), () => Hardware.Registered);
|
||||
IpConnectionsText = new StringFeedback(CommonStringCue.IpConnectionsText, () =>
|
||||
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()));
|
||||
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make sure that overriding classes call this!
|
||||
/// Registers the Crestron device, connects up to the base events, starts communication monitor
|
||||
/// </summary>
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
Debug.Console(0, this, "Activating");
|
||||
var response = Hardware.RegisterWithLogging(Key);
|
||||
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
|
||||
return false;
|
||||
}
|
||||
=======
|
||||
Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
|
||||
return false;
|
||||
}
|
||||
>>>>>>> origin/feature/ecs-342-neil
|
||||
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
|
||||
CommunicationMonitor.Start();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This disconnects events and unregisters the base hardware device.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override bool Deactivate()
|
||||
{
|
||||
CommunicationMonitor.Stop();
|
||||
Hardware.OnlineStatusChange -= Hardware_OnlineStatusChange;
|
||||
|
||||
return Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list containing the Outputs that we want to expose.
|
||||
/// </summary>
|
||||
public virtual List<Feedback> Feedbacks
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<Feedback>
|
||||
{
|
||||
IsOnline,
|
||||
IsRegistered,
|
||||
IpConnectionsText
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
{
|
||||
IsOnline.FireUpdate();
|
||||
}
|
||||
|
||||
#region IStatusMonitor Members
|
||||
|
||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||
#endregion
|
||||
|
||||
#region IUsageTracking Members
|
||||
|
||||
public UsageTracking UsageTracker { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//***********************************************************************************
|
||||
public class CrestronGenericBaseDeviceEventIds
|
||||
{
|
||||
public const uint IsOnline = 1;
|
||||
public const uint IpConnectionsText =2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds logging to Register() failure
|
||||
/// </summary>
|
||||
public static class GenericBaseExtensions
|
||||
{
|
||||
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
|
||||
{
|
||||
var result = device.Register();
|
||||
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot register device '{0}': {1}", key, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// A bridge class to cover the basic features of GenericBase hardware
|
||||
/// </summary>
|
||||
public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
|
||||
{
|
||||
public virtual GenericBase Hardware { get; protected set; }
|
||||
|
||||
public BoolFeedback IsOnline { get; private set; }
|
||||
public BoolFeedback IsRegistered { get; private set; }
|
||||
public StringFeedback IpConnectionsText { get; private set; }
|
||||
|
||||
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
||||
: base(key, name)
|
||||
{
|
||||
Hardware = hardware;
|
||||
IsOnline = new BoolFeedback(CommonBoolCue.IsOnlineFeedback, () => Hardware.IsOnline);
|
||||
IsRegistered = new BoolFeedback(new Cue("IsRegistered", 0, eCueType.Bool), () => Hardware.Registered);
|
||||
IpConnectionsText = new StringFeedback(CommonStringCue.IpConnectionsText, () =>
|
||||
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()));
|
||||
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make sure that overriding classes call this!
|
||||
/// Registers the Crestron device, connects up to the base events, starts communication monitor
|
||||
/// </summary>
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
new CTimer(o =>
|
||||
{
|
||||
Debug.Console(1, this, "Activating");
|
||||
var response = Hardware.RegisterWithLogging(Key);
|
||||
if (response == eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
|
||||
CommunicationMonitor.Start();
|
||||
}
|
||||
}, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This disconnects events and unregisters the base hardware device.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override bool Deactivate()
|
||||
{
|
||||
CommunicationMonitor.Stop();
|
||||
Hardware.OnlineStatusChange -= Hardware_OnlineStatusChange;
|
||||
|
||||
return Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list containing the Outputs that we want to expose.
|
||||
/// </summary>
|
||||
public virtual List<Feedback> Feedbacks
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<Feedback>
|
||||
{
|
||||
IsOnline,
|
||||
IsRegistered,
|
||||
IpConnectionsText
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
{
|
||||
IsOnline.FireUpdate();
|
||||
}
|
||||
|
||||
#region IStatusMonitor Members
|
||||
|
||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||
#endregion
|
||||
|
||||
#region IUsageTracking Members
|
||||
|
||||
public UsageTracking UsageTracker { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
//***********************************************************************************
|
||||
public class CrestronGenericBaseDeviceEventIds
|
||||
{
|
||||
public const uint IsOnline = 1;
|
||||
public const uint IpConnectionsText =2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds logging to Register() failure
|
||||
/// </summary>
|
||||
public static class GenericBaseExtensions
|
||||
{
|
||||
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
|
||||
{
|
||||
var result = device.Register();
|
||||
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot register device '{0}': {1}", key, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Encapsulates a string-named, joined and typed command to a device
|
||||
/// </summary>
|
||||
[Obsolete()]
|
||||
public class DevAction
|
||||
{
|
||||
public Cue Cue { get; private set; }
|
||||
public Action<object> Action { get; private set; }
|
||||
|
||||
|
||||
public DevAction(Cue cue, Action<object> action)
|
||||
{
|
||||
Cue = cue;
|
||||
Action = action;
|
||||
}
|
||||
}
|
||||
|
||||
public enum eCueType
|
||||
{
|
||||
Bool, Int, String, Void, Other
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The Cue class is a container to represent a name / join number / type for simplifying
|
||||
/// commands coming into devices.
|
||||
/// </summary>
|
||||
public class Cue
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public uint Number { get; private set; }
|
||||
public eCueType Type { get; private set; }
|
||||
|
||||
public Cue(string name, uint join, eCueType type)
|
||||
{
|
||||
Name = name;
|
||||
Number = join;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override that prints out the cue's data
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} Cue '{1}'-{2}", Type, Name, Number);
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Returns a new Cue with JoinNumber offset
|
||||
///// </summary>
|
||||
//public Cue GetOffsetCopy(uint offset)
|
||||
//{
|
||||
// return new Cue(Name, Number + offset, Type);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to create a Cue of Bool type
|
||||
/// </summary>
|
||||
/// <returns>Cue</returns>
|
||||
public static Cue BoolCue(string name, uint join)
|
||||
{
|
||||
return new Cue(name, join, eCueType.Bool);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to create a Cue of ushort type
|
||||
/// </summary>
|
||||
/// <returns>Cue</returns>
|
||||
public static Cue UShortCue(string name, uint join)
|
||||
{
|
||||
return new Cue(name, join, eCueType.Int);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to create a Cue of string type
|
||||
/// </summary>
|
||||
/// <returns>Cue</returns>
|
||||
public static Cue StringCue(string name, uint join)
|
||||
{
|
||||
return new Cue(name, join, eCueType.String);
|
||||
}
|
||||
|
||||
public static readonly Cue DefaultBoolCue = new Cue("-none-", 0, eCueType.Bool);
|
||||
public static readonly Cue DefaultIntCue = new Cue("-none-", 0, eCueType.Int);
|
||||
public static readonly Cue DefaultStringCue = new Cue("-none-", 0, eCueType.String);
|
||||
}
|
||||
}
|
||||
142
Essentials Core/PepperDashEssentialsBase/Debug/Debug.cs
Normal file
142
Essentials Core/PepperDashEssentialsBase/Debug/Debug.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharp.CrestronDataStore;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public class Debug
|
||||
// {
|
||||
// public static uint Level { get; private set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// This should called from the ControlSystem Initiailize method.
|
||||
// /// </summary>
|
||||
// public static void Initialize()
|
||||
// {
|
||||
// // Add command to console
|
||||
// CrestronConsole.AddNewConsoleCommand(SetDebugFromConsole, "appdebug",
|
||||
// "appdebug:P [0-2]: Sets the application's console debug message level",
|
||||
// ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
// uint level = 0;
|
||||
// var err = CrestronDataStoreStatic.GetGlobalUintValue("DebugLevel", out level);
|
||||
// if (err == CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
|
||||
// SetDebugLevel(level);
|
||||
// else if (err == CrestronDataStore.CDS_ERROR.CDS_RECORD_NOT_FOUND)
|
||||
// CrestronDataStoreStatic.SetGlobalUintValue("DebugLevel", 0);
|
||||
// else
|
||||
// CrestronConsole.PrintLine("Error restoring console debug level setting: {0}", err);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Callback for console command
|
||||
// /// </summary>
|
||||
// /// <param name="levelString"></param>
|
||||
// public static void SetDebugFromConsole(string levelString)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// if (string.IsNullOrEmpty(levelString.Trim()))
|
||||
// {
|
||||
// CrestronConsole.PrintLine("AppDebug level = {0}", Level);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// SetDebugLevel(Convert.ToUInt32(levelString));
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// CrestronConsole.PrintLine("Usage: appdebug:P [0-2]");
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Sets the debug level
|
||||
// /// </summary>
|
||||
// /// <param name="level"> Valid values 0 (no debug), 1 (critical), 2 (all messages)</param>
|
||||
// public static void SetDebugLevel(uint level)
|
||||
// {
|
||||
// if (level <= 2)
|
||||
// {
|
||||
// Level = 2;
|
||||
// CrestronConsole.PrintLine("[Application {0}], Debug level set to {1}",
|
||||
// InitialParametersClass.ApplicationNumber, level);
|
||||
// var err = CrestronDataStoreStatic.SetGlobalUintValue("DebugLevel", level);
|
||||
// if(err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
|
||||
// CrestronConsole.PrintLine("Error saving console debug level setting: {0}", err);
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Prints message to console if current debug level is equal to or higher than the level of this message.
|
||||
// /// Uses CrestronConsole.PrintLine.
|
||||
// /// </summary>
|
||||
// /// <param name="level"></param>
|
||||
// /// <param name="format">Console format string</param>
|
||||
// /// <param name="items">Object parameters</param>
|
||||
// public static void Console(uint level, string format, params object[] items)
|
||||
// {
|
||||
// if (Level >= level)
|
||||
// CrestronConsole.PrintLine("App {0}:{1}", InitialParametersClass.ApplicationNumber,
|
||||
// string.Format(format, items));
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Appends a device Key to the beginning of a message
|
||||
// /// </summary>
|
||||
// public static void Console(uint level, IKeyed dev, string format, params object[] items)
|
||||
// {
|
||||
// if (Level >= level)
|
||||
// Console(level, "[{0}] {1}", dev.Key, string.Format(format, items));
|
||||
// }
|
||||
|
||||
// public static void Console(uint level, IKeyed dev, ErrorLogLevel errorLogLevel,
|
||||
// string format, params object[] items)
|
||||
// {
|
||||
// if (Level >= level)
|
||||
// {
|
||||
// var str = string.Format("[{0}] {1}", dev.Key, string.Format(format, items));
|
||||
// Console(level, str);
|
||||
// LogError(errorLogLevel, str);
|
||||
// }
|
||||
// }
|
||||
|
||||
// public static void Console(uint level, ErrorLogLevel errorLogLevel,
|
||||
// string format, params object[] items)
|
||||
// {
|
||||
// if (Level >= level)
|
||||
// {
|
||||
// var str = string.Format(format, items);
|
||||
// Console(level, str);
|
||||
// LogError(errorLogLevel, str);
|
||||
// }
|
||||
// }
|
||||
|
||||
// public static void LogError(ErrorLogLevel errorLogLevel, string str)
|
||||
// {
|
||||
// string msg = string.Format("App {0}:{1}", InitialParametersClass.ApplicationNumber, str);
|
||||
// switch (errorLogLevel)
|
||||
// {
|
||||
// case ErrorLogLevel.Error:
|
||||
// ErrorLog.Error(msg);
|
||||
// break;
|
||||
// case ErrorLogLevel.Warning:
|
||||
// ErrorLog.Warn(msg);
|
||||
// break;
|
||||
// case ErrorLogLevel.Notice:
|
||||
// ErrorLog.Notice(msg);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// public enum ErrorLogLevel
|
||||
// {
|
||||
// Error, Warning, Notice, None
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,50 +1,50 @@
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.SmartObjects;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IDPad
|
||||
{
|
||||
void Up(bool pressRelease);
|
||||
void Down(bool pressRelease);
|
||||
void Left(bool pressRelease);
|
||||
void Right(bool pressRelease);
|
||||
void Select(bool pressRelease);
|
||||
void Menu(bool pressRelease);
|
||||
void Exit(bool pressRelease);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class IDPadExtensions
|
||||
{
|
||||
public static void LinkButtons(this IDPad dev, BasicTriList triList)
|
||||
{
|
||||
triList.SetBoolSigAction(138, dev.Up);
|
||||
triList.SetBoolSigAction(139, dev.Down);
|
||||
triList.SetBoolSigAction(140, dev.Left);
|
||||
triList.SetBoolSigAction(141, dev.Right);
|
||||
triList.SetBoolSigAction(142, dev.Select);
|
||||
triList.SetBoolSigAction(130, dev.Menu);
|
||||
triList.SetBoolSigAction(134, dev.Exit);
|
||||
}
|
||||
|
||||
public static void UnlinkButtons(this IDPad dev, BasicTriList triList)
|
||||
{
|
||||
triList.ClearBoolSigAction(138);
|
||||
triList.ClearBoolSigAction(139);
|
||||
triList.ClearBoolSigAction(140);
|
||||
triList.ClearBoolSigAction(141);
|
||||
triList.ClearBoolSigAction(142);
|
||||
triList.ClearBoolSigAction(130);
|
||||
triList.ClearBoolSigAction(134);
|
||||
}
|
||||
}
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.SmartObjects;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IDPad
|
||||
{
|
||||
void Up(bool pressRelease);
|
||||
void Down(bool pressRelease);
|
||||
void Left(bool pressRelease);
|
||||
void Right(bool pressRelease);
|
||||
void Select(bool pressRelease);
|
||||
void Menu(bool pressRelease);
|
||||
void Exit(bool pressRelease);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class IDPadExtensions
|
||||
{
|
||||
public static void LinkButtons(this IDPad dev, BasicTriList triList)
|
||||
{
|
||||
triList.SetBoolSigAction(138, dev.Up);
|
||||
triList.SetBoolSigAction(139, dev.Down);
|
||||
triList.SetBoolSigAction(140, dev.Left);
|
||||
triList.SetBoolSigAction(141, dev.Right);
|
||||
triList.SetBoolSigAction(142, dev.Select);
|
||||
triList.SetBoolSigAction(130, dev.Menu);
|
||||
triList.SetBoolSigAction(134, dev.Exit);
|
||||
}
|
||||
|
||||
public static void UnlinkButtons(this IDPad dev, BasicTriList triList)
|
||||
{
|
||||
triList.ClearBoolSigAction(138);
|
||||
triList.ClearBoolSigAction(139);
|
||||
triList.ClearBoolSigAction(140);
|
||||
triList.ClearBoolSigAction(141);
|
||||
triList.ClearBoolSigAction(142);
|
||||
triList.ClearBoolSigAction(130);
|
||||
triList.ClearBoolSigAction(134);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.Fusion;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.SmartObjects;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IPower
|
||||
{
|
||||
void PowerOn();
|
||||
void PowerOff();
|
||||
void PowerToggle();
|
||||
BoolFeedback PowerIsOnFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class IPowerExtensions
|
||||
{
|
||||
public static void LinkButtons(this IPower dev, BasicTriList triList)
|
||||
{
|
||||
triList.SetSigFalseAction(101, dev.PowerOn);
|
||||
triList.SetSigFalseAction(102, dev.PowerOff);
|
||||
triList.SetSigFalseAction(103, dev.PowerToggle);
|
||||
dev.PowerIsOnFeedback.LinkInputSig(triList.BooleanInput[101]);
|
||||
}
|
||||
|
||||
public static void UnlinkButtons(this IPower dev, BasicTriList triList)
|
||||
{
|
||||
triList.ClearBoolSigAction(101);
|
||||
triList.ClearBoolSigAction(102);
|
||||
triList.ClearBoolSigAction(103);
|
||||
dev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.Fusion;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.SmartObjects;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IPower
|
||||
{
|
||||
void PowerOn();
|
||||
void PowerOff();
|
||||
void PowerToggle();
|
||||
BoolFeedback PowerIsOnFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class IPowerExtensions
|
||||
{
|
||||
public static void LinkButtons(this IPower dev, BasicTriList triList)
|
||||
{
|
||||
triList.SetSigFalseAction(101, dev.PowerOn);
|
||||
triList.SetSigFalseAction(102, dev.PowerOff);
|
||||
triList.SetSigFalseAction(103, dev.PowerToggle);
|
||||
dev.PowerIsOnFeedback.LinkInputSig(triList.BooleanInput[101]);
|
||||
}
|
||||
|
||||
public static void UnlinkButtons(this IPower dev, BasicTriList triList)
|
||||
{
|
||||
triList.ClearBoolSigAction(101);
|
||||
triList.ClearBoolSigAction(102);
|
||||
triList.ClearBoolSigAction(103);
|
||||
dev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds control of codec receive volume
|
||||
/// </summary>
|
||||
public interface IReceiveVolume
|
||||
{
|
||||
// Break this out into 3 interfaces
|
||||
void SetReceiveVolume(ushort level);
|
||||
void ReceiveMuteOn();
|
||||
void ReceiveMuteOff();
|
||||
void ReceiveMuteToggle();
|
||||
IntFeedback ReceiveLevelFeedback { get; }
|
||||
BoolFeedback ReceiveMuteIsOnFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds control of codec transmit volume
|
||||
/// </summary>
|
||||
public interface ITransmitVolume
|
||||
{
|
||||
void SetTransmitVolume(ushort level);
|
||||
void TransmitMuteOn();
|
||||
void TransmitMuteOff();
|
||||
void TransmitMuteToggle();
|
||||
IntFeedback TransmitLevelFeedback { get; }
|
||||
BoolFeedback TransmitMuteIsOnFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds control of codec privacy function (microphone mute)
|
||||
/// </summary>
|
||||
public interface IPrivacy
|
||||
{
|
||||
void PrivacyModeOn();
|
||||
void PrivacyModeOff();
|
||||
void PrivacyModeToggle();
|
||||
BoolFeedback PrivacyModeIsOnFeedback { get; }
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds control of codec receive volume
|
||||
/// </summary>
|
||||
public interface IReceiveVolume
|
||||
{
|
||||
// Break this out into 3 interfaces
|
||||
void SetReceiveVolume(ushort level);
|
||||
void ReceiveMuteOn();
|
||||
void ReceiveMuteOff();
|
||||
void ReceiveMuteToggle();
|
||||
IntFeedback ReceiveLevelFeedback { get; }
|
||||
BoolFeedback ReceiveMuteIsOnFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds control of codec transmit volume
|
||||
/// </summary>
|
||||
public interface ITransmitVolume
|
||||
{
|
||||
void SetTransmitVolume(ushort level);
|
||||
void TransmitMuteOn();
|
||||
void TransmitMuteOff();
|
||||
void TransmitMuteToggle();
|
||||
IntFeedback TransmitLevelFeedback { get; }
|
||||
BoolFeedback TransmitMuteIsOnFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds control of codec privacy function (microphone mute)
|
||||
/// </summary>
|
||||
public interface IPrivacy
|
||||
{
|
||||
void PrivacyModeOn();
|
||||
void PrivacyModeOff();
|
||||
void PrivacyModeToggle();
|
||||
BoolFeedback PrivacyModeIsOnFeedback { get; }
|
||||
}
|
||||
}
|
||||
@@ -56,10 +56,12 @@ namespace PepperDash.Essentials.Core
|
||||
System.Globalization.CultureInfo.InvariantCulture))
|
||||
.ToArray();
|
||||
object ret = method.Invoke(obj, convertedParams);
|
||||
//Debug.Console(0, JsonConvert.SerializeObject(ret));
|
||||
// return something?
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the properties on a device
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
@@ -75,34 +77,8 @@ namespace PepperDash.Essentials.Core
|
||||
return JsonConvert.SerializeObject(props, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a property from a device path by name
|
||||
/// </summary>
|
||||
/// <param name="deviceObjectPath"></param>
|
||||
/// <param name="propertyName"></param>
|
||||
/// <returns></returns>
|
||||
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
|
||||
{
|
||||
var obj = FindObjectOnPath(deviceObjectPath);
|
||||
if(obj == null)
|
||||
return "{ \"error\":\"No Device\"}";
|
||||
|
||||
CType t = obj.GetType();
|
||||
|
||||
var prop = t.GetProperty(propertyName);
|
||||
if (prop != null)
|
||||
{
|
||||
return prop;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, "Unable to find Property: {0} on Device with path: {1}", propertyName, deviceObjectPath);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the methods on a device
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
@@ -29,6 +29,10 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public static void Initialize(CrestronControlSystem cs)
|
||||
{
|
||||
//CrestronConsole.AddNewConsoleCommand(ListDeviceCommands, "devcmdlist", "Lists commands",
|
||||
// ConsoleAccessLevelEnum.AccessOperator);
|
||||
//CrestronConsole.AddNewConsoleCommand(DoDeviceCommand, "devcmd", "Runs a command on device - key Name value",
|
||||
// ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(ListDeviceCommStatuses, "devcommstatus", "Lists the communication status of all devices",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(ListDeviceFeedbacks, "devfb", "Lists current feedbacks",
|
||||
@@ -59,31 +63,10 @@ namespace PepperDash.Essentials.Core
|
||||
public static void ActivateAll()
|
||||
{
|
||||
foreach (var d in Devices.Values)
|
||||
<<<<<<< HEAD
|
||||
{
|
||||
try
|
||||
{
|
||||
if (d is Device)
|
||||
(d as Device).Activate();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, d, "ERROR: Device activation failure:\r{0}", e);
|
||||
}
|
||||
if (d is Device)
|
||||
(d as Device).Activate();
|
||||
}
|
||||
=======
|
||||
{
|
||||
try
|
||||
{
|
||||
if (d is Device)
|
||||
(d as Device).Activate();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, d, "ERROR: Device activation failure:\r{0}", e);
|
||||
}
|
||||
}
|
||||
>>>>>>> origin/feature/ecs-342-neil
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -13,7 +13,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// This method shall return a list of all Output objects on a device,
|
||||
/// including all "aggregate" devices.
|
||||
/// </summary>
|
||||
FeedbackCollection<Feedback> Feedbacks { get; }
|
||||
List<Feedback> Feedbacks { get; }
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,9 @@ namespace PepperDash.Essentials.Core
|
||||
// get the properties and set them into a new collection of NameType wrappers
|
||||
var props = t.GetProperties().Select(p => new PropertyNameType(p, t));
|
||||
|
||||
var feedbacks = source.Feedbacks;
|
||||
|
||||
|
||||
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
|
||||
if (feedbacks != null)
|
||||
{
|
||||
Debug.Console(0, source, "\n\nAvailable feedbacks:");
|
||||
@@ -53,7 +55,7 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
Debug.Console(0, "{0,-12} {1, -25} {2}", type,
|
||||
(string.IsNullOrEmpty(f.Key) ? "-no key-" : f.Key), val);
|
||||
(string.IsNullOrEmpty(f.Cue.Name) ? "-no name-" : f.Cue.Name), val);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1,104 +1,104 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public interface IUsageTracking
|
||||
{
|
||||
UsageTracking UsageTracker { get; set; }
|
||||
}
|
||||
|
||||
//public static class IUsageTrackingExtensions
|
||||
//{
|
||||
// public static void EnableUsageTracker(this IUsageTracking device)
|
||||
// {
|
||||
// device.UsageTracker = new UsageTracking();
|
||||
// }
|
||||
//}
|
||||
|
||||
public class UsageTracking
|
||||
{
|
||||
public event EventHandler<DeviceUsageEventArgs> DeviceUsageEnded;
|
||||
|
||||
public InUseTracking InUseTracker { get; protected set; }
|
||||
|
||||
public bool UsageIsTracked { get; set; }
|
||||
|
||||
public bool UsageTrackingStarted { get; protected set; }
|
||||
public DateTime UsageStartTime { get; protected set; }
|
||||
public DateTime UsageEndTime { get; protected set; }
|
||||
|
||||
public Device Parent { get; private set; }
|
||||
|
||||
public UsageTracking(Device parent)
|
||||
{
|
||||
Parent = parent;
|
||||
|
||||
InUseTracker = new InUseTracking();
|
||||
|
||||
InUseTracker.InUseFeedback.OutputChange += InUseFeedback_OutputChange; //new EventHandler<EventArgs>();
|
||||
}
|
||||
|
||||
void InUseFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if(InUseTracker.InUseFeedback.BoolValue)
|
||||
{
|
||||
StartDeviceUsage();
|
||||
}
|
||||
else
|
||||
{
|
||||
EndDeviceUsage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Stores the usage start time
|
||||
/// </summary>
|
||||
public void StartDeviceUsage()
|
||||
{
|
||||
UsageTrackingStarted = true;
|
||||
UsageStartTime = DateTime.Now;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the difference between the usage start and end times, gets the total minutes used and fires an event to pass that info to a consumer
|
||||
/// </summary>
|
||||
public void EndDeviceUsage()
|
||||
{
|
||||
try
|
||||
{
|
||||
UsageTrackingStarted = false;
|
||||
|
||||
UsageEndTime = DateTime.Now;
|
||||
|
||||
if (UsageStartTime != null)
|
||||
{
|
||||
var timeUsed = UsageEndTime - UsageStartTime;
|
||||
|
||||
var handler = DeviceUsageEnded;
|
||||
|
||||
if (handler != null)
|
||||
{
|
||||
Debug.Console(1, "Device Usage Ended for: {0} at {1}. In use for {2} minutes.", Parent.Name, UsageEndTime, timeUsed.Minutes);
|
||||
handler(this, new DeviceUsageEventArgs() { UsageEndTime = UsageEndTime, MinutesUsed = timeUsed.Minutes });
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, "Error ending device usage: {0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DeviceUsageEventArgs : EventArgs
|
||||
{
|
||||
public DateTime UsageEndTime { get; set; }
|
||||
public int MinutesUsed { get; set; }
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public interface IUsageTracking
|
||||
{
|
||||
UsageTracking UsageTracker { get; set; }
|
||||
}
|
||||
|
||||
//public static class IUsageTrackingExtensions
|
||||
//{
|
||||
// public static void EnableUsageTracker(this IUsageTracking device)
|
||||
// {
|
||||
// device.UsageTracker = new UsageTracking();
|
||||
// }
|
||||
//}
|
||||
|
||||
public class UsageTracking
|
||||
{
|
||||
public event EventHandler<DeviceUsageEventArgs> DeviceUsageEnded;
|
||||
|
||||
public InUseTracking InUseTracker { get; protected set; }
|
||||
|
||||
public bool UsageIsTracked { get; set; }
|
||||
|
||||
public bool UsageTrackingStarted { get; protected set; }
|
||||
public DateTime UsageStartTime { get; protected set; }
|
||||
public DateTime UsageEndTime { get; protected set; }
|
||||
|
||||
public Device Parent { get; private set; }
|
||||
|
||||
public UsageTracking(Device parent)
|
||||
{
|
||||
Parent = parent;
|
||||
|
||||
InUseTracker = new InUseTracking();
|
||||
|
||||
InUseTracker.InUseFeedback.OutputChange +=new EventHandler<EventArgs>(InUseFeedback_OutputChange);
|
||||
}
|
||||
|
||||
void InUseFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if(InUseTracker.InUseFeedback.BoolValue)
|
||||
{
|
||||
StartDeviceUsage();
|
||||
}
|
||||
else
|
||||
{
|
||||
EndDeviceUsage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Stores the usage start time
|
||||
/// </summary>
|
||||
public void StartDeviceUsage()
|
||||
{
|
||||
UsageTrackingStarted = true;
|
||||
UsageStartTime = DateTime.Now;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the difference between the usage start and end times, gets the total minutes used and fires an event to pass that info to a consumer
|
||||
/// </summary>
|
||||
public void EndDeviceUsage()
|
||||
{
|
||||
try
|
||||
{
|
||||
UsageTrackingStarted = false;
|
||||
|
||||
UsageEndTime = DateTime.Now;
|
||||
|
||||
if (UsageStartTime != null)
|
||||
{
|
||||
var timeUsed = UsageEndTime - UsageStartTime;
|
||||
|
||||
var handler = DeviceUsageEnded;
|
||||
|
||||
if (handler != null)
|
||||
{
|
||||
Debug.Console(1, "Device Usage Ended for: {0} at {1}. In use for {2} minutes.", Parent.Name, UsageEndTime, timeUsed.Minutes);
|
||||
handler(this, new DeviceUsageEventArgs() { UsageEndTime = UsageEndTime, MinutesUsed = timeUsed.Minutes });
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, "Error ending device usage: {0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DeviceUsageEventArgs : EventArgs
|
||||
{
|
||||
public DateTime UsageEndTime { get; set; }
|
||||
public int MinutesUsed { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,106 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines minimal volume control methods
|
||||
/// </summary>
|
||||
public interface IBasicVolumeControls
|
||||
{
|
||||
void VolumeUp(bool pressRelease);
|
||||
void VolumeDown(bool pressRelease);
|
||||
void MuteToggle();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds feedback and direct volume level set to IBasicVolumeControls
|
||||
/// </summary>
|
||||
public interface IBasicVolumeWithFeedback : IBasicVolumeControls
|
||||
{
|
||||
void SetVolume(ushort level);
|
||||
void MuteOn();
|
||||
void MuteOff();
|
||||
IntFeedback VolumeLevelFeedback { get; }
|
||||
BoolFeedback MuteFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A class that implements this contains a reference to a current IBasicVolumeControls device.
|
||||
/// The class may have multiple IBasicVolumeControls.
|
||||
/// </summary>
|
||||
public interface IHasCurrentVolumeControls
|
||||
{
|
||||
IBasicVolumeControls CurrentVolumeControls { get; }
|
||||
event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IFullAudioSettings : IBasicVolumeWithFeedback
|
||||
{
|
||||
void SetBalance(ushort level);
|
||||
void BalanceLeft(bool pressRelease);
|
||||
void BalanceRight(bool pressRelease);
|
||||
|
||||
void SetBass(ushort level);
|
||||
void BassUp(bool pressRelease);
|
||||
void BassDown(bool pressRelease);
|
||||
|
||||
void SetTreble(ushort level);
|
||||
void TrebleUp(bool pressRelease);
|
||||
void TrebleDown(bool pressRelease);
|
||||
|
||||
bool hasMaxVolume { get; }
|
||||
void SetMaxVolume(ushort level);
|
||||
void MaxVolumeUp(bool pressRelease);
|
||||
void MaxVolumeDown(bool pressRelease);
|
||||
|
||||
bool hasDefaultVolume { get; }
|
||||
void SetDefaultVolume(ushort level);
|
||||
void DefaultVolumeUp(bool pressRelease);
|
||||
void DefaultVolumeDown(bool pressRelease);
|
||||
|
||||
void LoudnessToggle();
|
||||
void MonoToggle();
|
||||
|
||||
BoolFeedback LoudnessFeedback { get; }
|
||||
BoolFeedback MonoFeedback { get; }
|
||||
IntFeedback BalanceFeedback { get; }
|
||||
IntFeedback BassFeedback { get; }
|
||||
IntFeedback TrebleFeedback { get; }
|
||||
IntFeedback MaxVolumeFeedback { get; }
|
||||
IntFeedback DefaultVolumeFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A class that implements this, contains a reference to an IBasicVolumeControls device.
|
||||
/// For example, speakers attached to an audio zone. The speakers can provide reference
|
||||
/// to their linked volume control.
|
||||
/// </summary>
|
||||
public interface IHasVolumeDevice
|
||||
{
|
||||
IBasicVolumeControls VolumeDevice { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifies a device that contains audio zones
|
||||
/// </summary>
|
||||
public interface IAudioZones : IRouting
|
||||
{
|
||||
Dictionary<uint, IAudioZone> Zone { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines minimum functionality for an audio zone
|
||||
/// </summary>
|
||||
public interface IAudioZone : IBasicVolumeWithFeedback
|
||||
{
|
||||
void SelectInput(ushort input);
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines minimal volume control methods
|
||||
/// </summary>
|
||||
public interface IBasicVolumeControls
|
||||
{
|
||||
void VolumeUp(bool pressRelease);
|
||||
void VolumeDown(bool pressRelease);
|
||||
void MuteToggle();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds feedback and direct volume level set to IBasicVolumeControls
|
||||
/// </summary>
|
||||
public interface IBasicVolumeWithFeedback : IBasicVolumeControls
|
||||
{
|
||||
void SetVolume(ushort level);
|
||||
void MuteOn();
|
||||
void MuteOff();
|
||||
IntFeedback VolumeLevelFeedback { get; }
|
||||
BoolFeedback MuteFeedback { get; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IFullAudioSettings : IBasicVolumeWithFeedback
|
||||
{
|
||||
void SetBalance(ushort level);
|
||||
void BalanceLeft(bool pressRelease);
|
||||
void BalanceRight(bool pressRelease);
|
||||
|
||||
void SetBass(ushort level);
|
||||
void BassUp(bool pressRelease);
|
||||
void BassDown(bool pressRelease);
|
||||
|
||||
void SetTreble(ushort level);
|
||||
void TrebleUp(bool pressRelease);
|
||||
void TrebleDown(bool pressRelease);
|
||||
|
||||
bool hasMaxVolume { get; }
|
||||
void SetMaxVolume(ushort level);
|
||||
void MaxVolumeUp(bool pressRelease);
|
||||
void MaxVolumeDown(bool pressRelease);
|
||||
|
||||
bool hasDefaultVolume { get; }
|
||||
void SetDefaultVolume(ushort level);
|
||||
void DefaultVolumeUp(bool pressRelease);
|
||||
void DefaultVolumeDown(bool pressRelease);
|
||||
|
||||
void LoudnessToggle();
|
||||
void MonoToggle();
|
||||
|
||||
BoolFeedback LoudnessFeedback { get; }
|
||||
BoolFeedback MonoFeedback { get; }
|
||||
IntFeedback BalanceFeedback { get; }
|
||||
IntFeedback BassFeedback { get; }
|
||||
IntFeedback TrebleFeedback { get; }
|
||||
IntFeedback MaxVolumeFeedback { get; }
|
||||
IntFeedback DefaultVolumeFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A class that implements this, contains a reference to an IBasicVolumeControls device.
|
||||
/// For example, speakers attached to an audio zone. The speakers can provide reference
|
||||
/// to their linked volume control.
|
||||
/// </summary>
|
||||
public interface IHasVolumeDevice
|
||||
{
|
||||
IBasicVolumeControls VolumeDevice { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifies a device that contains audio zones
|
||||
/// </summary>
|
||||
public interface IAudioZones : IRouting
|
||||
{
|
||||
Dictionary<uint, IAudioZone> Zone { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines minimum functionality for an audio zone
|
||||
/// </summary>
|
||||
public interface IAudioZone : IBasicVolumeWithFeedback
|
||||
{
|
||||
void SelectInput(ushort input);
|
||||
}
|
||||
}
|
||||
@@ -120,5 +120,26 @@ namespace PepperDash.Essentials.Core
|
||||
Key, IrPort.IRDriverFileNameByIRDriverId(IrPortUid), command);
|
||||
}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// When fed a dictionary of uint, string, will return UOs for each item,
|
||||
///// attached to this IrOutputPort
|
||||
///// </summary>
|
||||
///// <param name="numStringDict"></param>
|
||||
///// <returns></returns>
|
||||
//public List<CueActionPair> GetUOsForIrCommands(Dictionary<Cue, string> numStringDict)
|
||||
//{
|
||||
// var funcs = new List<CueActionPair>(numStringDict.Count);
|
||||
// foreach (var kvp in numStringDict)
|
||||
// {
|
||||
// // Have to assign these locally because of kvp's scope
|
||||
// var cue = kvp.Key;
|
||||
// var command = kvp.Value;
|
||||
// funcs.Add(new BoolCueActionPair(cue, b => this.PressRelease(command, b)));
|
||||
// }
|
||||
// return funcs;
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
//public interface IVolumeFunctions
|
||||
//{
|
||||
// BoolCueActionPair VolumeUpCueActionPair { get; }
|
||||
// BoolCueActionPair VolumeDownCueActionPair { get; }
|
||||
// BoolCueActionPair MuteToggleCueActionPair { get; }
|
||||
//}
|
||||
|
||||
//public interface IVolumeTwoWay : IVolumeFunctions
|
||||
//{
|
||||
// IntFeedback VolumeLevelFeedback { get; }
|
||||
// UShortCueActionPair VolumeLevelCueActionPair { get; }
|
||||
// BoolFeedback IsMutedFeedback { get; }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
/////
|
||||
///// </summary>
|
||||
//public static class IFunctionListExtensions
|
||||
//{
|
||||
// public static string GetFunctionsConsoleList(this IHasCueActionList device)
|
||||
// {
|
||||
// var sb = new StringBuilder();
|
||||
// var list = device.CueActionList;
|
||||
// foreach (var cap in list)
|
||||
// sb.AppendFormat("{0,-15} {1,4} {2}\r", cap.Cue.Name, cap.Cue.Number, cap.GetType().Name);
|
||||
// return sb.ToString();
|
||||
// }
|
||||
//}
|
||||
|
||||
public enum AudioChangeType
|
||||
{
|
||||
Mute, Volume
|
||||
}
|
||||
|
||||
public class AudioChangeEventArgs
|
||||
{
|
||||
public AudioChangeType ChangeType { get; private set; }
|
||||
public IBasicVolumeControls AudioDevice { get; private set; }
|
||||
|
||||
public AudioChangeEventArgs(IBasicVolumeControls device, AudioChangeType changeType)
|
||||
{
|
||||
ChangeType = changeType;
|
||||
AudioDevice = device;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum eSourceListItemType
|
||||
{
|
||||
Route, Off, Other, SomethingAwesomerThanThese
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an item in a source list - can be deserialized into.
|
||||
/// </summary>
|
||||
public class SourceListItem
|
||||
{
|
||||
public string SourceKey { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the source Device for this, if it exists in DeviceManager
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public Device SourceDevice
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_SourceDevice == null)
|
||||
_SourceDevice = DeviceManager.GetDeviceForKey(SourceKey) as Device;
|
||||
return _SourceDevice;
|
||||
}
|
||||
}
|
||||
Device _SourceDevice;
|
||||
|
||||
/// <summary>
|
||||
/// Gets either the source's Name or this AlternateName property, if
|
||||
/// defined. If source doesn't exist, returns "Missing source"
|
||||
/// </summary>
|
||||
public string PreferredName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(Name))
|
||||
{
|
||||
if (SourceDevice == null)
|
||||
return "---";
|
||||
return SourceDevice.Name;
|
||||
}
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A name that will override the source's name on the UI
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public string Icon { get; set; }
|
||||
public string AltIcon { get; set; }
|
||||
public bool IncludeInSourceList { get; set; }
|
||||
public int Order { get; set; }
|
||||
public string VolumeControlKey { get; set; }
|
||||
public eSourceListItemType Type { get; set; }
|
||||
public List<SourceRouteListItem> RouteList { get; set; }
|
||||
|
||||
public SourceListItem()
|
||||
{
|
||||
Icon = "Blank";
|
||||
}
|
||||
}
|
||||
|
||||
public class SourceRouteListItem
|
||||
{
|
||||
[JsonProperty("sourceKey")]
|
||||
public string SourceKey { get; set; }
|
||||
|
||||
[JsonProperty("destinationKey")]
|
||||
public string DestinationKey { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public eRoutingSignalType Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,11 @@ using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IBridgeAdvanced
|
||||
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IPower, IWarmingCooling, IRoutingSinkWithSwitching
|
||||
{
|
||||
public IrOutputPortController IrPort { get; private set; }
|
||||
public ushort IrPulseTime { get; set; }
|
||||
@@ -52,19 +50,19 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
InputPorts.AddRange(new RoutingPortCollection<RoutingInputPort>
|
||||
{
|
||||
new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, new Action(Hdmi1), this, false),
|
||||
new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, new Action(Hdmi2), this, false),
|
||||
new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, new Action(Hdmi3), this, false),
|
||||
new RoutingInputPort(RoutingPortNames.HdmiIn4, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
new RoutingInputPort(RoutingPortNames.HdmiIn4, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, new Action(Hdmi4), this, false),
|
||||
new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, new Action(Component1), this, false),
|
||||
new RoutingInputPort(RoutingPortNames.CompositeIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
new RoutingInputPort(RoutingPortNames.CompositeIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, new Action(Video1), this, false),
|
||||
new RoutingInputPort(RoutingPortNames.AntennaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
new RoutingInputPort(RoutingPortNames.AntennaIn, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, new Action(Antenna), this, false),
|
||||
});
|
||||
}
|
||||
@@ -177,7 +175,6 @@ namespace PepperDash.Essentials.Core
|
||||
/// <param name="inputSelector">A delegate containing the input selector method to call</param>
|
||||
public override void ExecuteSwitch(object inputSelector)
|
||||
{
|
||||
Debug.Console(2, this, "Switching to input '{0}'", (inputSelector as Action).ToString());
|
||||
|
||||
Action finishSwitch = () =>
|
||||
{
|
||||
@@ -189,7 +186,7 @@ namespace PepperDash.Essentials.Core
|
||||
if (!PowerIsOnFeedback.BoolValue)
|
||||
{
|
||||
PowerOn();
|
||||
EventHandler<FeedbackEventArgs> oneTimer = null;
|
||||
EventHandler<EventArgs> oneTimer = null;
|
||||
oneTimer = (o, a) =>
|
||||
{
|
||||
if (IsWarmingUpFeedback.BoolValue) return; // Only catch done warming
|
||||
@@ -203,33 +200,5 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
}
|
||||
|
||||
public class BasicIrDisplayFactory : EssentialsDeviceFactory<BasicIrDisplay>
|
||||
{
|
||||
public BasicIrDisplayFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "basicirdisplay" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new BasicIrDisplay Device");
|
||||
var ir = IRPortHelper.GetIrPort(dc.Properties);
|
||||
if (ir != null)
|
||||
{
|
||||
var display = new BasicIrDisplay(dc.Key, dc.Name, ir.Port, ir.FileName);
|
||||
display.IrPulseTime = 200; // Set default pulse time for IR commands.
|
||||
return display;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public abstract class IRDisplayBase : DisplayBase, IHasCueActionList
|
||||
// {
|
||||
// public IrOutputPortController IrPort { get; private set; }
|
||||
// /// <summary>
|
||||
// /// Default to 200ms
|
||||
// /// </summary>
|
||||
// public ushort IrPulseTime { get; set; }
|
||||
// bool _PowerIsOn;
|
||||
// bool _IsWarmingUp;
|
||||
// bool _IsCoolingDown;
|
||||
|
||||
// /// <summary>
|
||||
// /// FunctionList is pre-defined to have power commands.
|
||||
// /// </summary>
|
||||
// public IRDisplayBase(string key, string name, IROutputPort port, string irDriverFilepath)
|
||||
// : base(key, name)
|
||||
// {
|
||||
// IrPort = new IrOutputPortController("ir-" + key, port, irDriverFilepath);
|
||||
// IrPulseTime = 200;
|
||||
// WarmupTime = 7000;
|
||||
// CooldownTime = 10000;
|
||||
|
||||
// CueActionList = new List<CueActionPair>
|
||||
// {
|
||||
// new BoolCueActionPair(CommonBoolCue.Power, b=> PowerToggle()),
|
||||
// new BoolCueActionPair(CommonBoolCue.PowerOn, b=> PowerOn()),
|
||||
// new BoolCueActionPair(CommonBoolCue.PowerOff, b=> PowerOff()),
|
||||
// };
|
||||
// }
|
||||
|
||||
// public override void PowerOn()
|
||||
// {
|
||||
// if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
|
||||
// {
|
||||
// _IsWarmingUp = true;
|
||||
// IsWarmingUpFeedback.FireUpdate();
|
||||
// // Fake power-up cycle
|
||||
// WarmupTimer = new CTimer(o =>
|
||||
// {
|
||||
// _IsWarmingUp = false;
|
||||
// _PowerIsOn = true;
|
||||
// IsWarmingUpFeedback.FireUpdate();
|
||||
// PowerIsOnFeedback.FireUpdate();
|
||||
// }, WarmupTime);
|
||||
// }
|
||||
// IrPort.Pulse(IROutputStandardCommands.IROut_POWER_ON, IrPulseTime);
|
||||
// }
|
||||
|
||||
// public override void PowerOff()
|
||||
// {
|
||||
// // If a display has unreliable-power off feedback, just override this and
|
||||
// // remove this check.
|
||||
// if (PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
|
||||
// {
|
||||
// _IsCoolingDown = true;
|
||||
// _PowerIsOn = false;
|
||||
// PowerIsOnFeedback.FireUpdate();
|
||||
// IsCoolingDownFeedback.FireUpdate();
|
||||
// // Fake cool-down cycle
|
||||
// CooldownTimer = new CTimer(o =>
|
||||
// {
|
||||
// _IsCoolingDown = false;
|
||||
// IsCoolingDownFeedback.FireUpdate();
|
||||
// }, CooldownTime);
|
||||
// }
|
||||
// IrPort.Pulse(IROutputStandardCommands.IROut_POWER_OFF, IrPulseTime);
|
||||
// }
|
||||
|
||||
// public override void PowerToggle()
|
||||
// {
|
||||
// // Not sure how to handle the feedback, but we should default to power off fb.
|
||||
// // Does this need to trigger feedback??
|
||||
// _PowerIsOn = false;
|
||||
// IrPort.Pulse(IROutputStandardCommands.IROut_POWER, IrPulseTime);
|
||||
// }
|
||||
|
||||
// #region IFunctionList Members
|
||||
|
||||
// public List<CueActionPair> CueActionList
|
||||
// {
|
||||
// get;
|
||||
// private set;
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
|
||||
// protected override Func<bool> PowerIsOnOutputFunc { get { return () => _PowerIsOn; } }
|
||||
// protected override Func<bool> IsCoolingDownOutputFunc { get { return () => _IsCoolingDown; } }
|
||||
// protected override Func<bool> IsWarmingUpOutputFunc { get { return () => _IsWarmingUp; } }
|
||||
|
||||
// public override void ExecuteSwitch(object selector)
|
||||
// {
|
||||
// IrPort.Pulse((string)selector, IrPulseTime);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
127
Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
Normal file
127
Essentials Core/PepperDashEssentialsBase/Display/DisplayBase.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
|
||||
{
|
||||
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||
|
||||
public UsageTracking UsageTracker { get; set; }
|
||||
|
||||
public uint WarmupTime { get; set; }
|
||||
public uint CooldownTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Bool Func that will provide a value for the PowerIsOn Output. Must be implemented
|
||||
/// by concrete sub-classes
|
||||
/// </summary>
|
||||
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
|
||||
abstract protected Func<bool> IsCoolingDownFeedbackFunc { get; }
|
||||
abstract protected Func<bool> IsWarmingUpFeedbackFunc { get; }
|
||||
|
||||
|
||||
protected CTimer WarmupTimer;
|
||||
protected CTimer CooldownTimer;
|
||||
|
||||
#region IRoutingInputs Members
|
||||
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public DisplayBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
PowerIsOnFeedback = new BoolFeedback(CommonBoolCue.PowerOnFeedback, PowerIsOnFeedbackFunc);
|
||||
IsCoolingDownFeedback = new BoolFeedback(CommonBoolCue.IsCoolingDown, IsCoolingDownFeedbackFunc);
|
||||
IsWarmingUpFeedback = new BoolFeedback(CommonBoolCue.IsWarmingUp, IsWarmingUpFeedbackFunc);
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||
|
||||
PowerIsOnFeedback.OutputChange += new EventHandler<EventArgs>(PowerIsOnFeedback_OutputChange);
|
||||
}
|
||||
|
||||
void PowerIsOnFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if (UsageTracker != null)
|
||||
{
|
||||
if (PowerIsOnFeedback.BoolValue)
|
||||
UsageTracker.StartDeviceUsage();
|
||||
else
|
||||
UsageTracker.EndDeviceUsage();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void PowerOn();
|
||||
public abstract void PowerOff();
|
||||
public abstract void PowerToggle();
|
||||
|
||||
public virtual List<Feedback> Feedbacks
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<Feedback>
|
||||
{
|
||||
PowerIsOnFeedback,
|
||||
IsCoolingDownFeedback,
|
||||
IsWarmingUpFeedback
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void ExecuteSwitch(object selector);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class TwoWayDisplayBase : DisplayBase
|
||||
{
|
||||
public StringFeedback CurrentInputFeedback { get; private set; }
|
||||
|
||||
abstract protected Func<string> CurrentInputFeedbackFunc { get; }
|
||||
|
||||
|
||||
public static MockDisplay DefaultDisplay
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_DefaultDisplay == null)
|
||||
_DefaultDisplay = new MockDisplay("default", "Default Display");
|
||||
return _DefaultDisplay;
|
||||
}
|
||||
}
|
||||
static MockDisplay _DefaultDisplay;
|
||||
|
||||
public TwoWayDisplayBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
CurrentInputFeedback = new StringFeedback(CurrentInputFeedbackFunc);
|
||||
|
||||
WarmupTime = 7000;
|
||||
CooldownTime = 15000;
|
||||
|
||||
Feedbacks.Add(CurrentInputFeedback);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,200 +1,178 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced
|
||||
|
||||
{
|
||||
public RoutingInputPort HdmiIn1 { get; private set; }
|
||||
public RoutingInputPort HdmiIn2 { get; private set; }
|
||||
public RoutingInputPort HdmiIn3 { get; private set; }
|
||||
public RoutingInputPort ComponentIn1 { get; private set; }
|
||||
public RoutingInputPort VgaIn1 { get; private set; }
|
||||
|
||||
bool _PowerIsOn;
|
||||
bool _IsWarmingUp;
|
||||
bool _IsCoolingDown;
|
||||
|
||||
protected override Func<bool> PowerIsOnFeedbackFunc { get { return () => _PowerIsOn; } }
|
||||
protected override Func<bool> IsCoolingDownFeedbackFunc { get { return () => _IsCoolingDown; } }
|
||||
protected override Func<bool> IsWarmingUpFeedbackFunc { get { return () => _IsWarmingUp; } }
|
||||
protected override Func<string> CurrentInputFeedbackFunc { get { return () => "Not Implemented"; } }
|
||||
|
||||
int VolumeHeldRepeatInterval = 200;
|
||||
ushort VolumeInterval = 655;
|
||||
ushort _FakeVolumeLevel = 31768;
|
||||
bool _IsMuted;
|
||||
|
||||
public MockDisplay(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
HdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
HdmiIn3 = new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
ComponentIn1 = new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Component, null, this);
|
||||
VgaIn1 = new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Composite, null, this);
|
||||
InputPorts.AddRange(new[] { HdmiIn1, HdmiIn2, HdmiIn3, ComponentIn1, VgaIn1 });
|
||||
|
||||
VolumeLevelFeedback = new IntFeedback(() => { return _FakeVolumeLevel; });
|
||||
MuteFeedback = new BoolFeedback("MuteOn", () => _IsMuted);
|
||||
}
|
||||
|
||||
public override void PowerOn()
|
||||
{
|
||||
if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
|
||||
{
|
||||
_IsWarmingUp = true;
|
||||
IsWarmingUpFeedback.InvokeFireUpdate();
|
||||
// Fake power-up cycle
|
||||
WarmupTimer = new CTimer(o =>
|
||||
{
|
||||
_IsWarmingUp = false;
|
||||
_PowerIsOn = true;
|
||||
IsWarmingUpFeedback.InvokeFireUpdate();
|
||||
PowerIsOnFeedback.InvokeFireUpdate();
|
||||
}, WarmupTime);
|
||||
}
|
||||
}
|
||||
|
||||
public override void PowerOff()
|
||||
{
|
||||
// If a display has unreliable-power off feedback, just override this and
|
||||
// remove this check.
|
||||
if (PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
|
||||
{
|
||||
_IsCoolingDown = true;
|
||||
_PowerIsOn = false;
|
||||
PowerIsOnFeedback.InvokeFireUpdate();
|
||||
IsCoolingDownFeedback.InvokeFireUpdate();
|
||||
// Fake cool-down cycle
|
||||
CooldownTimer = new CTimer(o =>
|
||||
{
|
||||
Debug.Console(2, this, "Cooldown timer ending");
|
||||
_IsCoolingDown = false;
|
||||
IsCoolingDownFeedback.InvokeFireUpdate();
|
||||
}, CooldownTime);
|
||||
}
|
||||
}
|
||||
|
||||
public override void PowerToggle()
|
||||
{
|
||||
if (PowerIsOnFeedback.BoolValue && !IsWarmingUpFeedback.BoolValue)
|
||||
PowerOff();
|
||||
else if (!PowerIsOnFeedback.BoolValue && !IsCoolingDownFeedback.BoolValue)
|
||||
PowerOn();
|
||||
}
|
||||
|
||||
public override void ExecuteSwitch(object selector)
|
||||
{
|
||||
Debug.Console(2, this, "ExecuteSwitch: {0}", selector);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region IBasicVolumeWithFeedback Members
|
||||
|
||||
public IntFeedback VolumeLevelFeedback { get; private set; }
|
||||
|
||||
public void SetVolume(ushort level)
|
||||
{
|
||||
_FakeVolumeLevel = level;
|
||||
VolumeLevelFeedback.InvokeFireUpdate();
|
||||
}
|
||||
|
||||
public void MuteOn()
|
||||
{
|
||||
_IsMuted = true;
|
||||
MuteFeedback.InvokeFireUpdate();
|
||||
}
|
||||
|
||||
public void MuteOff()
|
||||
{
|
||||
_IsMuted = false;
|
||||
MuteFeedback.InvokeFireUpdate();
|
||||
}
|
||||
|
||||
public BoolFeedback MuteFeedback { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeControls Members
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
{
|
||||
//while (pressRelease)
|
||||
//{
|
||||
Debug.Console(2, this, "Volume Down {0}", pressRelease);
|
||||
if (pressRelease)
|
||||
{
|
||||
var newLevel = _FakeVolumeLevel + VolumeInterval;
|
||||
SetVolume((ushort)newLevel);
|
||||
CrestronEnvironment.Sleep(VolumeHeldRepeatInterval);
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
public void VolumeDown(bool pressRelease)
|
||||
{
|
||||
//while (pressRelease)
|
||||
//{
|
||||
Debug.Console(2, this, "Volume Up {0}", pressRelease);
|
||||
if (pressRelease)
|
||||
{
|
||||
var newLevel = _FakeVolumeLevel - VolumeInterval;
|
||||
SetVolume((ushort)newLevel);
|
||||
CrestronEnvironment.Sleep(VolumeHeldRepeatInterval);
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
public void MuteToggle()
|
||||
{
|
||||
_IsMuted = !_IsMuted;
|
||||
MuteFeedback.InvokeFireUpdate();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
|
||||
}
|
||||
}
|
||||
|
||||
public class MockDisplayFactory : EssentialsDeviceFactory<MockDisplay>
|
||||
{
|
||||
public MockDisplayFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "mockdisplay" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new Mock Display Device");
|
||||
return new MockDisplay(dc.Key, dc.Name);
|
||||
}
|
||||
}
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback
|
||||
|
||||
{
|
||||
public RoutingInputPort HdmiIn1 { get; private set; }
|
||||
public RoutingInputPort HdmiIn2 { get; private set; }
|
||||
public RoutingInputPort HdmiIn3 { get; private set; }
|
||||
public RoutingInputPort ComponentIn1 { get; private set; }
|
||||
public RoutingInputPort VgaIn1 { get; private set; }
|
||||
|
||||
bool _PowerIsOn;
|
||||
bool _IsWarmingUp;
|
||||
bool _IsCoolingDown;
|
||||
|
||||
protected override Func<bool> PowerIsOnFeedbackFunc { get { return () => _PowerIsOn; } }
|
||||
protected override Func<bool> IsCoolingDownFeedbackFunc { get { return () => _IsCoolingDown; } }
|
||||
protected override Func<bool> IsWarmingUpFeedbackFunc { get { return () => _IsWarmingUp; } }
|
||||
protected override Func<string> CurrentInputFeedbackFunc { get { return () => "Not Implemented"; } }
|
||||
|
||||
int VolumeHeldRepeatInterval = 200;
|
||||
ushort VolumeInterval = 655;
|
||||
ushort _FakeVolumeLevel = 31768;
|
||||
bool _IsMuted;
|
||||
|
||||
public MockDisplay(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
HdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
HdmiIn3 = new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.AudioVideo,
|
||||
eRoutingPortConnectionType.Hdmi, null, this);
|
||||
ComponentIn1 = new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Component, null, this);
|
||||
VgaIn1 = new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Video,
|
||||
eRoutingPortConnectionType.Composite, null, this);
|
||||
InputPorts.AddRange(new[] { HdmiIn1, HdmiIn2, HdmiIn3, ComponentIn1, VgaIn1 });
|
||||
|
||||
VolumeLevelFeedback = new IntFeedback(() => { return _FakeVolumeLevel; });
|
||||
MuteFeedback = new BoolFeedback(CommonBoolCue.MuteOn, () => _IsMuted);
|
||||
}
|
||||
|
||||
public override void PowerOn()
|
||||
{
|
||||
if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
|
||||
{
|
||||
_IsWarmingUp = true;
|
||||
IsWarmingUpFeedback.FireUpdate();
|
||||
// Fake power-up cycle
|
||||
WarmupTimer = new CTimer(o =>
|
||||
{
|
||||
_IsWarmingUp = false;
|
||||
_PowerIsOn = true;
|
||||
IsWarmingUpFeedback.FireUpdate();
|
||||
PowerIsOnFeedback.FireUpdate();
|
||||
}, WarmupTime);
|
||||
}
|
||||
}
|
||||
|
||||
public override void PowerOff()
|
||||
{
|
||||
// If a display has unreliable-power off feedback, just override this and
|
||||
// remove this check.
|
||||
if (PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
|
||||
{
|
||||
_IsCoolingDown = true;
|
||||
_PowerIsOn = false;
|
||||
PowerIsOnFeedback.FireUpdate();
|
||||
IsCoolingDownFeedback.FireUpdate();
|
||||
// Fake cool-down cycle
|
||||
CooldownTimer = new CTimer(o =>
|
||||
{
|
||||
Debug.Console(2, this, "Cooldown timer ending");
|
||||
_IsCoolingDown = false;
|
||||
IsCoolingDownFeedback.FireUpdate();
|
||||
}, CooldownTime);
|
||||
}
|
||||
}
|
||||
|
||||
public override void PowerToggle()
|
||||
{
|
||||
if (PowerIsOnFeedback.BoolValue && !IsWarmingUpFeedback.BoolValue)
|
||||
PowerOff();
|
||||
else if (!PowerIsOnFeedback.BoolValue && !IsCoolingDownFeedback.BoolValue)
|
||||
PowerOn();
|
||||
}
|
||||
|
||||
public override void ExecuteSwitch(object selector)
|
||||
{
|
||||
Debug.Console(2, this, "ExecuteSwitch: {0}", selector);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region IBasicVolumeWithFeedback Members
|
||||
|
||||
public IntFeedback VolumeLevelFeedback { get; private set; }
|
||||
|
||||
public void SetVolume(ushort level)
|
||||
{
|
||||
_FakeVolumeLevel = level;
|
||||
VolumeLevelFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
public void MuteOn()
|
||||
{
|
||||
_IsMuted = true;
|
||||
MuteFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
public void MuteOff()
|
||||
{
|
||||
_IsMuted = false;
|
||||
MuteFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
public BoolFeedback MuteFeedback { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeControls Members
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
{
|
||||
//while (pressRelease)
|
||||
//{
|
||||
Debug.Console(2, this, "Volume Down {0}", pressRelease);
|
||||
if (pressRelease)
|
||||
{
|
||||
var newLevel = _FakeVolumeLevel + VolumeInterval;
|
||||
SetVolume((ushort)newLevel);
|
||||
CrestronEnvironment.Sleep(VolumeHeldRepeatInterval);
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
public void VolumeDown(bool pressRelease)
|
||||
{
|
||||
//while (pressRelease)
|
||||
//{
|
||||
Debug.Console(2, this, "Volume Up {0}", pressRelease);
|
||||
if (pressRelease)
|
||||
{
|
||||
var newLevel = _FakeVolumeLevel - VolumeInterval;
|
||||
SetVolume((ushort)newLevel);
|
||||
CrestronEnvironment.Sleep(VolumeHeldRepeatInterval);
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
public void MuteToggle()
|
||||
{
|
||||
_IsMuted = !_IsMuted;
|
||||
MuteFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -10,24 +10,35 @@ namespace PepperDash.Essentials.Core.Ethernet
|
||||
{
|
||||
public static class EthernetSettings
|
||||
{
|
||||
public static readonly BoolFeedback LinkActive = new BoolFeedback("LinkActive",
|
||||
public static readonly BoolFeedback LinkActive = new BoolFeedback(EthernetCue.LinkActive,
|
||||
() => true);
|
||||
public static readonly BoolFeedback DhcpActive = new BoolFeedback("DhcpActive",
|
||||
public static readonly BoolFeedback DhcpActive = new BoolFeedback(EthernetCue.DhcpActive,
|
||||
() => CrestronEthernetHelper.GetEthernetParameter(
|
||||
CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_DHCP_STATE, 0) == "ON");
|
||||
|
||||
|
||||
public static readonly StringFeedback Hostname = new StringFeedback("Hostname",
|
||||
public static readonly StringFeedback Hostname = new StringFeedback(EthernetCue.Hostname,
|
||||
() => CrestronEthernetHelper.GetEthernetParameter(
|
||||
CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, 0));
|
||||
public static readonly StringFeedback IpAddress0 = new StringFeedback("IpAddress0",
|
||||
public static readonly StringFeedback IpAddress0 = new StringFeedback(EthernetCue.IpAddress0,
|
||||
() => CrestronEthernetHelper.GetEthernetParameter(
|
||||
CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
|
||||
public static readonly StringFeedback SubnetMask0 = new StringFeedback("SubnetMask0",
|
||||
public static readonly StringFeedback SubnetMask0 = new StringFeedback(EthernetCue.SubnetMask0,
|
||||
() => CrestronEthernetHelper.GetEthernetParameter(
|
||||
CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, 0));
|
||||
public static readonly StringFeedback DefaultGateway0 = new StringFeedback("DefaultGateway0",
|
||||
public static readonly StringFeedback DefaultGateway0 = new StringFeedback(EthernetCue.DefaultGateway0,
|
||||
() => CrestronEthernetHelper.GetEthernetParameter(
|
||||
CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, 0));
|
||||
}
|
||||
|
||||
public static class EthernetCue
|
||||
{
|
||||
public static readonly Cue LinkActive = Cue.BoolCue("LinkActive", 1);
|
||||
public static readonly Cue DhcpActive = Cue.BoolCue("DhcpActive", 2);
|
||||
|
||||
public static readonly Cue Hostname = Cue.StringCue("Hostname", 1);
|
||||
public static readonly Cue IpAddress0 = Cue.StringCue("IpAddress0", 2);
|
||||
public static readonly Cue SubnetMask0 = Cue.StringCue("SubnetMask0", 3);
|
||||
public static readonly Cue DefaultGateway0 = Cue.StringCue("DefaultGateway0", 4);
|
||||
}
|
||||
}
|
||||
235
Essentials Core/PepperDashEssentialsBase/Feedbacks/Feedbacks.cs
Normal file
235
Essentials Core/PepperDashEssentialsBase/Feedbacks/Feedbacks.cs
Normal file
@@ -0,0 +1,235 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public abstract class Feedback
|
||||
{
|
||||
public event EventHandler<EventArgs> OutputChange;
|
||||
|
||||
public virtual bool BoolValue { get { return false; } }
|
||||
public virtual int IntValue { get { return 0; } }
|
||||
public virtual string StringValue { get { return ""; } }
|
||||
|
||||
public Cue Cue { get; private set; }
|
||||
|
||||
public abstract eCueType Type { get; }
|
||||
|
||||
protected Feedback()
|
||||
{
|
||||
}
|
||||
|
||||
protected Feedback(Cue cue)
|
||||
{
|
||||
Cue = cue;
|
||||
}
|
||||
|
||||
public abstract void FireUpdate();
|
||||
|
||||
protected void OnOutputChange()
|
||||
{
|
||||
if (OutputChange != null) OutputChange(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Feedback whose output is derived from the return value of a provided Func.
|
||||
/// </summary>
|
||||
public class BoolFeedback : Feedback
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the current value of the feedback, derived from the ValueFunc
|
||||
/// </summary>
|
||||
public override bool BoolValue { get { return _BoolValue; } }
|
||||
bool _BoolValue;
|
||||
|
||||
public override eCueType Type { get { return eCueType.Bool; } }
|
||||
|
||||
public Func<bool> ValueFunc { get; private set; }
|
||||
/// <summary>
|
||||
/// The last value delivered on FireUpdate
|
||||
/// </summary>
|
||||
//public bool PreviousValue { get; private set; }
|
||||
List<BoolInputSig> LinkedInputSigs = new List<BoolInputSig>();
|
||||
List<BoolInputSig> LinkedComplementInputSigs = new List<BoolInputSig>();
|
||||
|
||||
public BoolFeedback(Func<bool> valueFunc)
|
||||
: this(Cue.DefaultBoolCue, valueFunc)
|
||||
{
|
||||
}
|
||||
|
||||
public BoolFeedback(Cue cue, Func<bool> valueFunc)
|
||||
: base(cue)
|
||||
{
|
||||
if (cue == null) throw new ArgumentNullException("cue");
|
||||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
public override void FireUpdate()
|
||||
{
|
||||
var newValue = ValueFunc.Invoke();
|
||||
if (newValue != _BoolValue)
|
||||
{
|
||||
_BoolValue = newValue;
|
||||
LinkedInputSigs.ForEach(s => UpdateSig(s));
|
||||
LinkedComplementInputSigs.ForEach(s => UpdateComplementSig(s));
|
||||
OnOutputChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void LinkInputSig(BoolInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Add(sig);
|
||||
UpdateSig(sig);
|
||||
}
|
||||
|
||||
public void UnlinkInputSig(BoolInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Remove(sig);
|
||||
}
|
||||
|
||||
public void LinkComplementInputSig(BoolInputSig sig)
|
||||
{
|
||||
LinkedComplementInputSigs.Add(sig);
|
||||
UpdateComplementSig(sig);
|
||||
}
|
||||
|
||||
public void UnlinkComplementInputSig(BoolInputSig sig)
|
||||
{
|
||||
LinkedComplementInputSigs.Remove(sig);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return BoolValue.ToString();
|
||||
}
|
||||
|
||||
void UpdateSig(BoolInputSig sig)
|
||||
{
|
||||
sig.BoolValue = _BoolValue;
|
||||
}
|
||||
|
||||
void UpdateComplementSig(BoolInputSig sig)
|
||||
{
|
||||
sig.BoolValue = !_BoolValue;
|
||||
}
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
public class IntFeedback : Feedback
|
||||
{
|
||||
public override int IntValue { get { return _IntValue; } } // ValueFunc.Invoke(); } }
|
||||
int _IntValue;
|
||||
public ushort UShortValue { get { return (ushort)_IntValue; } }
|
||||
public override eCueType Type { get { return eCueType.Int; } }
|
||||
//public int PreviousValue { get; private set; }
|
||||
|
||||
Func<int> ValueFunc;
|
||||
List<UShortInputSig> LinkedInputSigs = new List<UShortInputSig>();
|
||||
|
||||
public IntFeedback(Func<int> valueFunc)
|
||||
: this(Cue.DefaultIntCue, valueFunc)
|
||||
{
|
||||
}
|
||||
|
||||
public IntFeedback(Cue cue, Func<int> valueFunc)
|
||||
: base(cue)
|
||||
{
|
||||
if (cue == null) throw new ArgumentNullException("cue");
|
||||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
public override void FireUpdate()
|
||||
{
|
||||
var newValue = ValueFunc.Invoke();
|
||||
if (newValue != _IntValue)
|
||||
{
|
||||
_IntValue = newValue;
|
||||
LinkedInputSigs.ForEach(s => UpdateSig(s));
|
||||
OnOutputChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void LinkInputSig(UShortInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Add(sig);
|
||||
UpdateSig(sig);
|
||||
}
|
||||
|
||||
public void UnlinkInputSig(UShortInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Remove(sig);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return IntValue.ToString();
|
||||
}
|
||||
|
||||
void UpdateSig(UShortInputSig sig)
|
||||
{
|
||||
sig.UShortValue = UShortValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
public class StringFeedback : Feedback
|
||||
{
|
||||
public override string StringValue { get { return _StringValue; } } // ValueFunc.Invoke(); } }
|
||||
string _StringValue;
|
||||
public override eCueType Type { get { return eCueType.String; } }
|
||||
//public string PreviousValue { get; private set; }
|
||||
public Func<string> ValueFunc { get; private set; }
|
||||
List<StringInputSig> LinkedInputSigs = new List<StringInputSig>();
|
||||
|
||||
public StringFeedback(Func<string> valueFunc)
|
||||
: this(Cue.DefaultStringCue, valueFunc)
|
||||
{
|
||||
}
|
||||
|
||||
public StringFeedback(Cue cue, Func<string> valueFunc)
|
||||
: base(cue)
|
||||
{
|
||||
if (cue == null) throw new ArgumentNullException("cue");
|
||||
ValueFunc = valueFunc;
|
||||
|
||||
}
|
||||
|
||||
public override void FireUpdate()
|
||||
{
|
||||
var newValue = ValueFunc.Invoke();
|
||||
if (newValue != _StringValue)
|
||||
{
|
||||
_StringValue = newValue;
|
||||
LinkedInputSigs.ForEach(s => UpdateSig(s));
|
||||
OnOutputChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void LinkInputSig(StringInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Add(sig);
|
||||
UpdateSig(sig);
|
||||
}
|
||||
|
||||
public void UnlinkInputSig(StringInputSig sig)
|
||||
{
|
||||
LinkedInputSigs.Remove(sig);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return StringValue;
|
||||
}
|
||||
|
||||
void UpdateSig(StringInputSig sig)
|
||||
{
|
||||
sig.StringValue = _StringValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,377 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using Crestron.SimplSharpPro.Fusion;
|
||||
//using PepperDash.Essentials.Core;
|
||||
|
||||
//using PepperDash.Core;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core.Fusion
|
||||
//{
|
||||
// public class EssentialsHuddleSpaceFusionSystemController : Device
|
||||
// {
|
||||
// FusionRoom FusionRoom;
|
||||
// Room Room;
|
||||
// Dictionary<IPresentationSource, BoolInputSig> SourceToFeedbackSigs = new Dictionary<IPresentationSource, BoolInputSig>();
|
||||
|
||||
// StatusMonitorCollection ErrorMessageRollUp;
|
||||
|
||||
// public EssentialsHuddleSpaceFusionSystemController(HuddleSpaceRoom room, uint ipId)
|
||||
// : base(room.Key + "-fusion")
|
||||
// {
|
||||
// Room = room;
|
||||
|
||||
// FusionRoom = new FusionRoom(ipId, Global.ControlSystem, room.Name, "awesomeGuid-" + room.Key);
|
||||
// FusionRoom.Register();
|
||||
|
||||
// FusionRoom.FusionStateChange += new FusionStateEventHandler(FusionRoom_FusionStateChange);
|
||||
|
||||
// // Room to fusion room
|
||||
// room.RoomIsOn.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
||||
// var srcName = FusionRoom.CreateOffsetStringSig(50, "Source - Name", eSigIoMask.InputSigOnly);
|
||||
// room.CurrentSourceName.LinkInputSig(srcName.InputSig);
|
||||
|
||||
// FusionRoom.SystemPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (b) room.RoomOn(null); });
|
||||
// FusionRoom.SystemPowerOff.OutputSig.UserObject = new Action<bool>(b => { if (b) room.RoomOff(); });
|
||||
// // NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
|
||||
// FusionRoom.ErrorMessage.InputSig.StringValue = "3: 7 Errors: This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;";
|
||||
|
||||
// // Sources
|
||||
// foreach (var src in room.Sources)
|
||||
// {
|
||||
// var srcNum = src.Key;
|
||||
// var pSrc = src.Value as IPresentationSource;
|
||||
// var keyNum = ExtractNumberFromKey(pSrc.Key);
|
||||
// if (keyNum == -1)
|
||||
// {
|
||||
// Debug.Console(1, this, "WARNING: Cannot link source '{0}' to numbered Fusion attributes", pSrc.Key);
|
||||
// continue;
|
||||
// }
|
||||
// string attrName = null;
|
||||
// uint attrNum = Convert.ToUInt32(keyNum);
|
||||
// switch (pSrc.Type)
|
||||
// {
|
||||
// case PresentationSourceType.None:
|
||||
// break;
|
||||
// case PresentationSourceType.SetTopBox:
|
||||
// attrName = "Source - TV " + keyNum;
|
||||
// attrNum += 115; // TV starts at 116
|
||||
// break;
|
||||
// case PresentationSourceType.Dvd:
|
||||
// attrName = "Source - DVD " + keyNum;
|
||||
// attrNum += 120; // DVD starts at 121
|
||||
// break;
|
||||
// case PresentationSourceType.PC:
|
||||
// attrName = "Source - PC " + keyNum;
|
||||
// attrNum += 110; // PC starts at 111
|
||||
// break;
|
||||
// case PresentationSourceType.Laptop:
|
||||
// attrName = "Source - Laptop " + keyNum;
|
||||
// attrNum += 100; // Laptops start at 101
|
||||
// break;
|
||||
// case PresentationSourceType.VCR:
|
||||
// attrName = "Source - VCR " + keyNum;
|
||||
// attrNum += 125; // VCRs start at 126
|
||||
// break;
|
||||
// }
|
||||
// if (attrName == null)
|
||||
// {
|
||||
// Debug.Console(1, this, "Source type {0} does not have corresponsing Fusion attribute type, skipping", pSrc.Type);
|
||||
// continue;
|
||||
// }
|
||||
// Debug.Console(2, this, "Creating attribute '{0}' with join {1} for source {2}", attrName, attrNum, pSrc.Key);
|
||||
// var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputOutputSig);
|
||||
// // Need feedback when this source is selected
|
||||
// // Event handler, added below, will compare source changes with this sig dict
|
||||
// SourceToFeedbackSigs.Add(pSrc, sigD.InputSig);
|
||||
|
||||
// // And respond to selection in Fusion
|
||||
// sigD.OutputSig.UserObject = new Action<bool>(b => { if(b) room.SelectSource(pSrc); });
|
||||
// }
|
||||
|
||||
// // Attach to all room's devices with monitors.
|
||||
// //foreach (var dev in DeviceManager.Devices)
|
||||
// foreach (var dev in DeviceManager.GetDevices())
|
||||
// {
|
||||
// if (!(dev is ICommunicationMonitor))
|
||||
// continue;
|
||||
|
||||
// var keyNum = ExtractNumberFromKey(dev.Key);
|
||||
// if (keyNum == -1)
|
||||
// {
|
||||
// Debug.Console(1, this, "WARNING: Cannot link device '{0}' to numbered Fusion monitoring attributes", dev.Key);
|
||||
// continue;
|
||||
// }
|
||||
// string attrName = null;
|
||||
// uint attrNum = Convert.ToUInt32(keyNum);
|
||||
|
||||
// //if (dev is SmartGraphicsTouchpanelControllerBase)
|
||||
// //{
|
||||
// // if (attrNum > 10)
|
||||
// // continue;
|
||||
// // attrName = "Device Ok - Touch Panel " + attrNum;
|
||||
// // attrNum += 200;
|
||||
// //}
|
||||
// //// add xpanel here
|
||||
|
||||
// //else
|
||||
// if (dev is DisplayBase)
|
||||
// {
|
||||
// if (attrNum > 10)
|
||||
// continue;
|
||||
// attrName = "Device Ok - Display " + attrNum;
|
||||
// attrNum += 240;
|
||||
// }
|
||||
// //else if (dev is DvdDeviceBase)
|
||||
// //{
|
||||
// // if (attrNum > 5)
|
||||
// // continue;
|
||||
// // attrName = "Device Ok - DVD " + attrNum;
|
||||
// // attrNum += 260;
|
||||
// //}
|
||||
// // add set top box
|
||||
|
||||
// // add Cresnet roll-up
|
||||
|
||||
// // add DM-devices roll-up
|
||||
|
||||
// if (attrName != null)
|
||||
// {
|
||||
// // Link comm status to sig and update
|
||||
// var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputSigOnly);
|
||||
// var smd = dev as ICommunicationMonitor;
|
||||
// sigD.InputSig.BoolValue = smd.CommunicationMonitor.Status == MonitorStatus.IsOk;
|
||||
// smd.CommunicationMonitor.StatusChange += (o, a) => { sigD.InputSig.BoolValue = a.Status == MonitorStatus.IsOk; };
|
||||
// Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", dev.Key, attrName);
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Don't think we need to get current status of this as nothing should be alive yet.
|
||||
// room.PresentationSourceChange += Room_PresentationSourceChange;
|
||||
|
||||
// // these get used in multiple places
|
||||
// var display = room.Display;
|
||||
// var dispPowerOnAction = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
||||
// var dispPowerOffAction = new Action<bool>(b => { if (!b) display.PowerOff(); });
|
||||
|
||||
// // Display to fusion room sigs
|
||||
// FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||
// FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||
// display.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||
// if (display is IDisplayUsage)
|
||||
// (display as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||
|
||||
// // Roll up ALL device errors
|
||||
// ErrorMessageRollUp = new StatusMonitorCollection(this);
|
||||
// foreach (var dev in DeviceManager.GetDevices())
|
||||
// {
|
||||
// var md = dev as ICommunicationMonitor;
|
||||
// if (md != null)
|
||||
// {
|
||||
// ErrorMessageRollUp.AddMonitor(md.CommunicationMonitor);
|
||||
// Debug.Console(2, this, "Adding '{0}' to room's overall error monitor", md.CommunicationMonitor.Parent.Key);
|
||||
// }
|
||||
// }
|
||||
// ErrorMessageRollUp.Start();
|
||||
// FusionRoom.ErrorMessage.InputSig.StringValue = ErrorMessageRollUp.Message;
|
||||
// ErrorMessageRollUp.StatusChange += (o, a) => {
|
||||
// FusionRoom.ErrorMessage.InputSig.StringValue = ErrorMessageRollUp.Message; };
|
||||
|
||||
|
||||
// // static assets --------------- testing
|
||||
|
||||
// // test assets --- THESE ARE BOTH WIRED TO AssetUsage somewhere internally.
|
||||
// var ta1 = FusionRoom.CreateStaticAsset(1, "Test asset 1", "Awesome Asset", "Awesome123");
|
||||
// ta1.AssetError.InputSig.StringValue = "This should be error";
|
||||
|
||||
|
||||
// var ta2 = FusionRoom.CreateStaticAsset(2, "Test asset 2", "Awesome Asset", "Awesome1232");
|
||||
// ta2.AssetUsage.InputSig.StringValue = "This should be usage";
|
||||
|
||||
|
||||
// // Make a display asset
|
||||
// var dispAsset = FusionRoom.CreateStaticAsset(3, display.Name, "Display", "awesomeDisplayId" + room.Key);
|
||||
// dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||
// dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||
// display.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||
// // NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
|
||||
// // Use extension methods
|
||||
// dispAsset.TrySetMakeModel(display);
|
||||
// dispAsset.TryLinkAssetErrorToCommunication(display);
|
||||
|
||||
|
||||
// // Make it so!
|
||||
// FusionRVI.GenerateFileForAllFusionDevices();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Helper to get the number from the end of a device's key string
|
||||
// /// </summary>
|
||||
// /// <returns>-1 if no number matched</returns>
|
||||
// int ExtractNumberFromKey(string key)
|
||||
// {
|
||||
// var capture = System.Text.RegularExpressions.Regex.Match(key, @"\D+(\d+)");
|
||||
// if (!capture.Success)
|
||||
// return -1;
|
||||
// else return Convert.ToInt32(capture.Groups[1].Value);
|
||||
// }
|
||||
|
||||
// void Room_PresentationSourceChange(object sender, EssentialsRoomSourceChangeEventArgs e)
|
||||
// {
|
||||
// if (e.OldSource != null)
|
||||
// {
|
||||
// if (SourceToFeedbackSigs.ContainsKey(e.OldSource))
|
||||
// SourceToFeedbackSigs[e.OldSource].BoolValue = false;
|
||||
// }
|
||||
// if (e.NewSource != null)
|
||||
// {
|
||||
// if (SourceToFeedbackSigs.ContainsKey(e.NewSource))
|
||||
// SourceToFeedbackSigs[e.NewSource].BoolValue = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// void FusionRoom_FusionStateChange(FusionBase device, FusionStateEventArgs args)
|
||||
// {
|
||||
|
||||
// // The sig/UO method: Need separate handlers for fixed and user sigs, all flavors,
|
||||
// // even though they all contain sigs.
|
||||
|
||||
// var sigData = (args.UserConfiguredSigDetail as BooleanSigDataFixedName);
|
||||
// if (sigData != null)
|
||||
// {
|
||||
// var outSig = sigData.OutputSig;
|
||||
// if (outSig.UserObject is Action<bool>)
|
||||
// (outSig.UserObject as Action<bool>).Invoke(outSig.BoolValue);
|
||||
// else if (outSig.UserObject is Action<ushort>)
|
||||
// (outSig.UserObject as Action<ushort>).Invoke(outSig.UShortValue);
|
||||
// else if (outSig.UserObject is Action<string>)
|
||||
// (outSig.UserObject as Action<string>).Invoke(outSig.StringValue);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// var attrData = (args.UserConfiguredSigDetail as BooleanSigData);
|
||||
// if (attrData != null)
|
||||
// {
|
||||
// var outSig = attrData.OutputSig;
|
||||
// if (outSig.UserObject is Action<bool>)
|
||||
// (outSig.UserObject as Action<bool>).Invoke(outSig.BoolValue);
|
||||
// else if (outSig.UserObject is Action<ushort>)
|
||||
// (outSig.UserObject as Action<ushort>).Invoke(outSig.UShortValue);
|
||||
// else if (outSig.UserObject is Action<string>)
|
||||
// (outSig.UserObject as Action<string>).Invoke(outSig.StringValue);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// public static class FusionRoomExtensions
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// Creates and returns a fusion attribute. The join number will match the established Simpl
|
||||
// /// standard of 50+, and will generate a 50+ join in the RVI. It calls
|
||||
// /// FusionRoom.AddSig with join number - 49
|
||||
// /// </summary>
|
||||
// /// <returns>The new attribute</returns>
|
||||
// public static BooleanSigData CreateOffsetBoolSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
|
||||
// {
|
||||
// if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
|
||||
// number -= 49;
|
||||
// fr.AddSig(eSigType.Bool, number, name, mask);
|
||||
// return fr.UserDefinedBooleanSigDetails[number];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Creates and returns a fusion attribute. The join number will match the established Simpl
|
||||
// /// standard of 50+, and will generate a 50+ join in the RVI. It calls
|
||||
// /// FusionRoom.AddSig with join number - 49
|
||||
// /// </summary>
|
||||
// /// <returns>The new attribute</returns>
|
||||
// public static UShortSigData CreateOffsetUshortSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
|
||||
// {
|
||||
// if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
|
||||
// number -= 49;
|
||||
// fr.AddSig(eSigType.UShort, number, name, mask);
|
||||
// return fr.UserDefinedUShortSigDetails[number];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Creates and returns a fusion attribute. The join number will match the established Simpl
|
||||
// /// standard of 50+, and will generate a 50+ join in the RVI. It calls
|
||||
// /// FusionRoom.AddSig with join number - 49
|
||||
// /// </summary>
|
||||
// /// <returns>The new attribute</returns>
|
||||
// public static StringSigData CreateOffsetStringSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
|
||||
// {
|
||||
// if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
|
||||
// number -= 49;
|
||||
// fr.AddSig(eSigType.String, number, name, mask);
|
||||
// return fr.UserDefinedStringSigDetails[number];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Creates and returns a static asset
|
||||
// /// </summary>
|
||||
// /// <returns>the new asset</returns>
|
||||
// public static FusionStaticAsset CreateStaticAsset(this FusionRoom fr, uint number, string name, string type, string instanceId)
|
||||
// {
|
||||
// fr.AddAsset(eAssetType.StaticAsset, number, name, type, instanceId);
|
||||
// return fr.UserConfigurableAssetDetails[number].Asset as FusionStaticAsset;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //************************************************************************************************
|
||||
// /// <summary>
|
||||
// /// Extensions to enhance Fusion room, asset and signal creation.
|
||||
// /// </summary>
|
||||
// public static class FusionStaticAssetExtensions
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// Tries to set a Fusion asset with the make and model of a device.
|
||||
// /// If the provided Device is IMakeModel, will set the corresponding parameters on the fusion static asset.
|
||||
// /// Otherwise, does nothing.
|
||||
// /// </summary>
|
||||
// public static void TrySetMakeModel(this FusionStaticAsset asset, Device device)
|
||||
// {
|
||||
// var mm = device as IMakeModel;
|
||||
// if (mm != null)
|
||||
// {
|
||||
// asset.ParamMake.Value = mm.DeviceMake;
|
||||
// asset.ParamModel.Value = mm.DeviceModel;
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Tries to attach the AssetError input on a Fusion asset to a Device's
|
||||
// /// CommunicationMonitor.StatusChange event. Does nothing if the device is not
|
||||
// /// IStatusMonitor
|
||||
// /// </summary>
|
||||
// /// <param name="asset"></param>
|
||||
// /// <param name="device"></param>
|
||||
// public static void TryLinkAssetErrorToCommunication(this FusionStaticAsset asset, Device device)
|
||||
// {
|
||||
// if (device is ICommunicationMonitor)
|
||||
// {
|
||||
// var monitor = (device as ICommunicationMonitor).CommunicationMonitor;
|
||||
// monitor.StatusChange += (o, a) =>
|
||||
// {
|
||||
// // Link connected and error inputs on asset
|
||||
// asset.Connected.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
|
||||
// asset.AssetError.InputSig.StringValue = a.Status.ToString();
|
||||
// };
|
||||
// // set current value
|
||||
// asset.Connected.InputSig.BoolValue = monitor.Status == MonitorStatus.IsOk;
|
||||
// asset.AssetError.InputSig.StringValue = monitor.Status.ToString();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
42
Essentials Core/PepperDashEssentialsBase/Global/Global.cs
Normal file
42
Essentials Core/PepperDashEssentialsBase/Global/Global.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronDataStore;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
//using PepperDash.Essentials.Core.Http;
|
||||
using PepperDash.Essentials.License;
|
||||
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public static class Global
|
||||
{
|
||||
public static CrestronControlSystem ControlSystem { get; set; }
|
||||
|
||||
public static LicenseManager LicenseManager { get; set; }
|
||||
|
||||
//public static EssentialsHttpServer HttpConfigServer
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (_HttpConfigServer == null)
|
||||
// _HttpConfigServer = new EssentialsHttpServer();
|
||||
// return _HttpConfigServer;
|
||||
// }
|
||||
//}
|
||||
//static EssentialsHttpServer _HttpConfigServer;
|
||||
|
||||
|
||||
static Global()
|
||||
{
|
||||
// Fire up CrestronDataStoreStatic
|
||||
var err = CrestronDataStoreStatic.InitCrestronDataStore();
|
||||
if (err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
|
||||
{
|
||||
CrestronConsole.PrintLine("Error starting CrestronDataStoreStatic: {0}", err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,6 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public enum eJobTimerCycleTypes
|
||||
{
|
||||
RunEveryDay,
|
||||
RunEveryHour,
|
||||
RunEveryHalfHour,
|
||||
RunEveryMinute
|
||||
@@ -49,7 +49,7 @@ namespace PepperDash.Essentials.License
|
||||
|
||||
MockEssentialsLicenseManager() : base()
|
||||
{
|
||||
LicenseIsValid = new BoolFeedback("LicenseIsValid",
|
||||
LicenseIsValid = new BoolFeedback(LicenseCue.LicenseIsValid,
|
||||
() => { return IsValid; });
|
||||
CrestronConsole.AddNewConsoleCommand(
|
||||
s => SetFromConsole(s.Equals("true", StringComparison.OrdinalIgnoreCase)),
|
||||
@@ -83,4 +83,16 @@ namespace PepperDash.Essentials.License
|
||||
return string.Format("License Status: {0}", IsValid ? "Valid" : "Not Valid");
|
||||
}
|
||||
}
|
||||
|
||||
public class EssentialsLicenseManager
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class LicenseCue
|
||||
{
|
||||
public static Cue LicenseIsValid = Cue.BoolCue("LicenseIsValid", 15991);
|
||||
|
||||
public static Cue LicenseMessage = Cue.StringCue("LicenseMessage", 15991);
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,6 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
Status = MonitorStatus.IsOk;
|
||||
ResetErrorTimers();
|
||||
//
|
||||
}
|
||||
|
||||
void Poll()
|
||||
@@ -12,7 +12,6 @@ namespace PepperDash.Essentials.Core
|
||||
event EventHandler<MonitorStatusChangeEventArgs> StatusChange;
|
||||
MonitorStatus Status { get; }
|
||||
string Message { get; }
|
||||
BoolFeedback IsOnlineFeedback { get; set; }
|
||||
void Start();
|
||||
void Stop();
|
||||
}
|
||||
@@ -41,7 +40,7 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public MonitorStatus Status { get; private set; }
|
||||
public string Message { get; private set; }
|
||||
|
||||
|
||||
public MonitorStatusChangeEventArgs(MonitorStatus status)
|
||||
{
|
||||
Status = status;
|
||||
@@ -26,10 +26,6 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public IKeyed Parent { get; private set; }
|
||||
|
||||
public BoolFeedback IsOnlineFeedback { get; set; }
|
||||
|
||||
public bool IsOnline;
|
||||
|
||||
public MonitorStatus Status
|
||||
{
|
||||
get { return _Status; }
|
||||
@@ -38,7 +34,6 @@ namespace PepperDash.Essentials.Core
|
||||
if (value != _Status)
|
||||
{
|
||||
_Status = value;
|
||||
|
||||
OnStatusChange(value);
|
||||
}
|
||||
}
|
||||
@@ -71,7 +66,6 @@ namespace PepperDash.Essentials.Core
|
||||
if (warningTime < 5000 || errorTime < 5000)
|
||||
throw new ArgumentException("time values cannot be less that 5000 ms");
|
||||
|
||||
IsOnlineFeedback = new BoolFeedback(() => { return IsOnline; });
|
||||
Status = MonitorStatus.StatusUnknown;
|
||||
WarningTime = warningTime;
|
||||
ErrorTime = errorTime;
|
||||
@@ -82,11 +76,6 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
protected void OnStatusChange(MonitorStatus status)
|
||||
{
|
||||
if (_Status == MonitorStatus.IsOk)
|
||||
IsOnline = true;
|
||||
else
|
||||
IsOnline = false;
|
||||
IsOnlineFeedback.FireUpdate();
|
||||
var handler = StatusChange;
|
||||
if (handler != null)
|
||||
handler(this, new MonitorStatusChangeEventArgs(status));
|
||||
@@ -94,11 +83,6 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
protected void OnStatusChange(MonitorStatus status, string message)
|
||||
{
|
||||
if (_Status == MonitorStatus.IsOk)
|
||||
IsOnline = true;
|
||||
else
|
||||
IsOnline = false;
|
||||
IsOnlineFeedback.FireUpdate();
|
||||
var handler = StatusChange;
|
||||
if (handler != null)
|
||||
handler(this, new MonitorStatusChangeEventArgs(status, message));
|
||||
@@ -30,7 +30,6 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public string Message { get; private set; }
|
||||
|
||||
public BoolFeedback IsOnlineFeedback { get; set; }
|
||||
|
||||
public StatusMonitorCollection(IKeyed parent)
|
||||
{
|
||||
@@ -7,7 +7,7 @@
|
||||
<ProjectGuid>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PepperDash_Essentials_Core</RootNamespace>
|
||||
<RootNamespace>PepperDash.Essentials.Core</RootNamespace>
|
||||
<AssemblyName>PepperDash_Essentials_Core</AssemblyName>
|
||||
<ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92300};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<PlatformFamilyName>WindowsCE</PlatformFamilyName>
|
||||
@@ -48,154 +48,75 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="PepperDash_Core, Version=1.0.26.30384, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Reference Include="PepperDash_Core, Version=1.0.0.16459, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\pepperdashcore-builds\PepperDash_Core.dll</HintPath>
|
||||
<HintPath>..\..\..\pepperdash-simplsharp-core\Pepperdash Core\CLZ Builds\PepperDash_Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<Reference Include="SimplSharpPro, Version=1.5.0.7, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpTimerEventInterface, Version=1.0.6197.20052, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Bridges\BridgeBase.cs" />
|
||||
<Compile Include="Bridges\IBridge.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\AirMediaControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\CameraControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\CenOdtOccupancySensorBaseJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DigitalLoggerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DisplayControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmChassisControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmpsAudioOutputControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmpsRoutingControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmRmcControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmTxControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\GenericLightingJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\GenericRelayControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\HdMdxxxCEControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\IDigitalInputJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
|
||||
<Compile Include="Config\Comm and IR\CecPortController.cs" />
|
||||
<Compile Include="Config\Comm and IR\GenericComm.cs" />
|
||||
<Compile Include="Config\Comm and IR\GenericHttpClient.cs" />
|
||||
<Compile Include="Config\Essentials\ConfigUpdater.cs" />
|
||||
<Compile Include="Config\Essentials\ConfigReader.cs" />
|
||||
<Compile Include="Config\Essentials\ConfigWriter.cs" />
|
||||
<Compile Include="Config\Essentials\EssentialsConfig.cs" />
|
||||
<Compile Include="Config\SourceDevicePropertiesConfigBase.cs" />
|
||||
<Compile Include="Crestron IO\C2nRts\C2nRthsController.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\CenIoDigIn104Controller.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
||||
<Compile Include="Crestron IO\IOPortConfig.cs" />
|
||||
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
||||
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
||||
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
||||
<Compile Include="Devices\CodecInterfaces.cs" />
|
||||
<Compile Include="Devices\CrestronProcessor.cs" />
|
||||
<Compile Include="Devices\DeviceApiBase.cs" />
|
||||
<Compile Include="Devices\DeviceFeedbackExtensions.cs" />
|
||||
<Compile Include="Devices\EssentialsBridgeableDevice.cs" />
|
||||
<Compile Include="Devices\EssentialsDevice.cs" />
|
||||
<Compile Include="Devices\PC\InRoomPc.cs" />
|
||||
<Compile Include="Devices\PC\Laptop.cs" />
|
||||
<Compile Include="Devices\ReconfigurableDevice.cs" />
|
||||
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
|
||||
<Compile Include="Factory\DeviceFactory.cs" />
|
||||
<Compile Include="Factory\IDeviceFactory.cs" />
|
||||
<Compile Include="Feedbacks\BoolFeedback.cs" />
|
||||
<Compile Include="Feedbacks\FeedbackCollection.cs" />
|
||||
<Compile Include="Feedbacks\FeedbackEventArgs.cs" />
|
||||
<Compile Include="Feedbacks\IntFeedback.cs" />
|
||||
<Compile Include="Feedbacks\SerialFeedback.cs" />
|
||||
<Compile Include="Feedbacks\StringFeedback.cs" />
|
||||
<Compile Include="Fusion\EssentialsHuddleSpaceFusionSystemControllerBase.cs" />
|
||||
<Compile Include="Fusion\FusionCustomPropertiesBridge.cs" />
|
||||
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
||||
<Compile Include="Fusion\FusionProcessorQueries.cs" />
|
||||
<Compile Include="Fusion\FusionRviDataClasses.cs" />
|
||||
<Compile Include="Global\JobTimer.cs" />
|
||||
<Compile Include="Global\Scheduler.cs" />
|
||||
<Compile Include="JoinMaps\JoinMapBase.cs" />
|
||||
<Compile Include="Lighting\Lighting Interfaces.cs" />
|
||||
<Compile Include="Lighting\LightingBase.cs" />
|
||||
<Compile Include="Monitoring\SystemMonitorController.cs" />
|
||||
<Compile Include="Microphone Privacy\MicrophonePrivacyController.cs" />
|
||||
<Compile Include="Microphone Privacy\MicrophonePrivacyControllerConfig.cs" />
|
||||
<Compile Include="Plugins\PluginLoader.cs" />
|
||||
<Compile Include="Presets\PresetBase.cs" />
|
||||
<Compile Include="Plugins\IPluginDeviceFactory.cs" />
|
||||
<Compile Include="Ramps and Increments\ActionIncrementer.cs" />
|
||||
<Compile Include="Config\Comm and IR\CommFactory.cs" />
|
||||
<Compile Include="Config\Comm and IR\CommunicationExtras.cs" />
|
||||
<Compile Include="Config\Comm and IR\ComSpecJsonConverter.cs" />
|
||||
<Compile Include="Config\Comm and IR\ConsoleCommMockDevice.cs" />
|
||||
<Compile Include="Config\Comm and IR\IRPortHelper.cs" />
|
||||
<Compile Include="Comm and IR\CommFactory.cs" />
|
||||
<Compile Include="Comm and IR\CommunicationExtras.cs" />
|
||||
<Compile Include="Comm and IR\REMOVE ComPortConfig.cs" />
|
||||
<Compile Include="Comm and IR\ComSpecJsonConverter.cs" />
|
||||
<Compile Include="Comm and IR\ConsoleCommMockDevice.cs" />
|
||||
<Compile Include="Comm and IR\IRPortHelper.cs" />
|
||||
<Compile Include="Config\BasicConfig.cs" />
|
||||
<Compile Include="Config\ConfigPropertiesHelpers.cs" />
|
||||
<Compile Include="Config\InfoConfig.cs" />
|
||||
<Compile Include="Config\DeviceConfig.cs" />
|
||||
<Compile Include="Constants\CommonCues.cs" />
|
||||
<Compile Include="Devices\DisplayUiConstants.cs" />
|
||||
<Compile Include="Devices\IUsageTracking.cs" />
|
||||
<Compile Include="Devices\DeviceJsonApi.cs" />
|
||||
@@ -220,10 +141,6 @@
|
||||
<Compile Include="Feedbacks\BoolFeedbackOneShot.cs" />
|
||||
<Compile Include="Ramps and Increments\NumericalHelpers.cs" />
|
||||
<Compile Include="Ramps and Increments\UshortSigIncrementer.cs" />
|
||||
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
||||
<Compile Include="Room\EssentialsRoomBase.cs" />
|
||||
<Compile Include="Room\Interfaces.cs" />
|
||||
<Compile Include="Room\iOccupancyStatusProvider.cs" />
|
||||
<Compile Include="Routing\DummyRoutingInputsDevice.cs" />
|
||||
<Compile Include="Routing\ICardPortsDevice.cs" />
|
||||
<Compile Include="InUseTracking\IInUseTracking.cs" />
|
||||
@@ -232,15 +149,17 @@
|
||||
<Compile Include="Monitoring\StatusMonitorCollection.cs" />
|
||||
<Compile Include="Monitoring\CrestronGenericBaseCommunicationMonitor.cs" />
|
||||
<Compile Include="Monitoring\StatusMonitorBase.cs" />
|
||||
<Compile Include="Monitoring\Interfaces.cs" />
|
||||
<Compile Include="Monitoring\Interfaces and things.cs" />
|
||||
<Compile Include="Monitoring\GenericCommunicationMonitor.cs" />
|
||||
<Compile Include="Devices\AudioInterfaces.cs" />
|
||||
<Compile Include="Devices\NewInterfaces.cs" />
|
||||
<Compile Include="Devices\IAttachVideoStatusExtensions.cs" />
|
||||
<Compile Include="Devices\IHasFeedbacks.cs" />
|
||||
<Compile Include="Devices\SmartObjectBaseTypes.cs" />
|
||||
<Compile Include="Devices\PresentationDeviceType.cs" />
|
||||
<Compile Include="Display\DELETE IRDisplayBase.cs" />
|
||||
<Compile Include="Display\MockDisplay.cs" />
|
||||
<Compile Include="Ethernet\EthernetStatistics.cs" />
|
||||
<Compile Include="Fusion\MOVED FusionSystemController.cs" />
|
||||
<Compile Include="Global\Global.cs" />
|
||||
<Compile Include="License\EssentialsLicenseManager.cs" />
|
||||
<Compile Include="Feedbacks\BoolOutputLogicals.cs" />
|
||||
@@ -255,45 +174,52 @@
|
||||
<Compile Include="Feedbacks\BoolFeedbackPulseExtender.cs" />
|
||||
<Compile Include="Routing\RoutingPortNames.cs" />
|
||||
<Compile Include="Routing\TieLineConfig.cs" />
|
||||
<Compile Include="Shades\Shade Interfaces.cs" />
|
||||
<Compile Include="Shades\ShadeBase.cs" />
|
||||
<Compile Include="Shades\ShadeController.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectNumeric.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectDynamicList.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectDPad.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectHelper.cs" />
|
||||
<Compile Include="SmartObjects\SmartObjectHelperBase.cs" />
|
||||
<Compile Include="Routing\TieLine.cs" />
|
||||
<Compile Include="Timers\CountdownTimer.cs" />
|
||||
<Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" />
|
||||
<Compile Include="Touchpanels\Interfaces.cs" />
|
||||
<Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" />
|
||||
<Compile Include="Touchpanels\Mpc3Touchpanel.cs" />
|
||||
<Compile Include="Touchpanels\MOVED LargeTouchpanelControllerBase.cs" />
|
||||
<Compile Include="Touchpanels\TriListExtensions.cs" />
|
||||
<Compile Include="Touchpanels\MOVED UIControllers\DevicePageControllerBase.cs" />
|
||||
<Compile Include="UI PageManagers\BlurayPageManager.cs" />
|
||||
<Compile Include="UI PageManagers\SetTopBoxThreePanelPageManager.cs" />
|
||||
<Compile Include="UI PageManagers\SinglePageManager.cs" />
|
||||
<Compile Include="UI PageManagers\PageManager.cs" />
|
||||
<Compile Include="UI PageManagers\SetTopBoxTwoPanelPageManager.cs" />
|
||||
<Compile Include="VideoStatus\VideoStatusOutputs.cs" />
|
||||
<Compile Include="Config\Comm and IR\ComPortController.cs" />
|
||||
<Compile Include="VideoStatus\VideoStatusCues.cs" />
|
||||
<Compile Include="Cues and DevAction\Cues.cs" />
|
||||
<Compile Include="Comm and IR\ComPortController.cs" />
|
||||
<Compile Include="Crestron\CrestronGenericBaseDevice.cs" />
|
||||
<Compile Include="Debug\Debug.cs" />
|
||||
<Compile Include="DeviceControlsParentInterfaces\IPresentationSource.cs" />
|
||||
<Compile Include="Devices\DeviceManager.cs" />
|
||||
<Compile Include="Devices\IrOutputPortController.cs" />
|
||||
<Compile Include="Display\DisplayBase.cs" />
|
||||
<Compile Include="Feedbacks\FeedbackBase.cs" />
|
||||
<Compile Include="Feedbacks\Feedbacks.cs" />
|
||||
<Compile Include="Room\Room.cs" />
|
||||
<Compile Include="Room\RoomCues.cs" />
|
||||
<Compile Include="Room\MOVED RoomEventArgs.cs" />
|
||||
<Compile Include="SmartObjects\SubpageReferencList\SourceListSubpageReferenceList.cs" />
|
||||
<Compile Include="Touchpanels\ModalDialog.cs" />
|
||||
<Compile Include="Touchpanels\SmartGraphicsTouchpanelControllerBase.cs" />
|
||||
<Compile Include="TriListBridges\HandlerBridge.cs" />
|
||||
<Compile Include="Devices\FIND HOMES Interfaces.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SigHelper.cs" />
|
||||
<Compile Include="REMOVE SigId.cs" />
|
||||
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceList.cs" />
|
||||
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceListItem.cs" />
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\ControlSystem.cfg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="bin\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyTitle("PepperDashEssentialsBase")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PepperDashEssentialsBase")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyVersion("1.0.0.*")]
|
||||
|
||||
37
Essentials Core/PepperDashEssentialsBase/REMOVE SigId.cs
Normal file
37
Essentials Core/PepperDashEssentialsBase/REMOVE SigId.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public class SigId
|
||||
// {
|
||||
// public uint Number { get; private set; }
|
||||
// public eSigType Type { get; private set; }
|
||||
|
||||
// public SigId(eSigType type, uint number)
|
||||
// {
|
||||
// Type = type;
|
||||
// Number = number;
|
||||
// }
|
||||
|
||||
// public override bool Equals(object id)
|
||||
// {
|
||||
// if (id is SigId)
|
||||
// {
|
||||
// var sigId = id as SigId;
|
||||
// return this.Number == sigId.Number && this.Type == sigId.Type;
|
||||
// }
|
||||
// else
|
||||
// return base.Equals(id);
|
||||
// }
|
||||
|
||||
// public override int GetHashCode()
|
||||
// {
|
||||
// return base.GetHashCode();
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user