9 Commits

Author SHA1 Message Date
Simone Terzi 972e9d9c49 Sviluppo Test 2019-08-09 15:50:12 +02:00
Simone Terzi 82b34d6e22 Sviluppo Test 2019-08-08 15:44:45 +02:00
Simone Terzi 27a5a8f111 Sviluppo Test 2019-08-07 15:41:26 +02:00
Simone Terzi c41964222c Sviluppo test... 2019-08-06 15:51:33 +02:00
Simone Terzi 3d82b58326 Sviluppo test 2019-08-05 15:40:48 +02:00
Simone Terzi 81bc796ab5 Sviluppo Test 2019-08-02 15:52:46 +02:00
Simone Terzi 620962cb1e Svilupppo Test (RedisSampler) 2019-08-01 15:52:50 +02:00
Simone Terzi 55bbc80a3d Merge remote-tracking branch 'origin/UnitTesting' into UnitTesting 2019-07-31 15:54:08 +02:00
Simone Terzi 8a9c6f477f Sviluppo test 2019-07-31 15:53:54 +02:00
93 changed files with 6532 additions and 10667 deletions
-153
View File
@@ -1,153 +0,0 @@
variables:
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
NEXUS_PATH: 'OPC-UA-REDIS/SOUR'
APP_NAME: 'SOUR'
SOL_NAME: 'SOUR'
VERS_MAIN: '1.2'
NEW_REL: ''
OUTPUT_DIR: ''
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
.nuget-fix: &nuget-fix
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
if ($hasSource -eq 0) {
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
}
echo $hasSource
# helper x fix version number
.version-fix: &version-fix
- |
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date format yyMM)+"."+$CI_PIPELINE_IID
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
$newContenuto | Set-Content -Path 'VersGen\VersGen.cs'
echo "Set vers: $env:NEW_REL"
# helper pulizia files zip
.cleanup-zip: &cleanup-zip
- |
$env:OUTPUT_DIR = "Releases\" + $CI_COMMIT_BRANCH + "\*"
if ((Test-Path $env:OUTPUT_DIR))
{
Remove-Item $env:OUTPUT_DIR -Force -Recurse -ErrorAction Ignore
}
echo "Clening ZIP dir: $env:OUTPUT_DIR"
# helper creazione files zip
.zipper: &zipper
- |
$7zipPath = $env:ProgramFiles+"\7-Zip\7z.exe"
if (-not (Test-Path -Path $7zipPath -PathType Leaf)) {
throw "7 zip file '$7zipPath' not found"
}
Set-Alias 7zip $7zipPath
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
$Source = "$env:APP_NAME\bin\*"
7zip a -tzip $Target $Source
echo "called ZIP $Source --> $Target"
# helper creazione hash files
.hashBuild: &hashBuild
- |
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
$MD5 = Get-FileHash $Target -Algorithm MD5
$SHA1 = Get-FileHash $Target -Algorithm SHA1
New-Item $Target".md5"
New-Item $Target".sha1"
$MD5.Hash | Set-Content -Path $Target".md5"
$SHA1.Hash | Set-Content -Path $Target".sha1"
echo "Created HASH files for $Target"
# helper x send su NEXUS
.nexusUpload: &nexusUpload
- |
Set-Alias mCurl C:\Windows\system32\curl.exe
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$VersNumb = $env:NEW_REL
echo "Curr Version: $VersNumb"
$FileManIn="VersGen\manifest.xml"
$FileManOut=$env:APP_NAME +"\Resources\manifest.xml"
$FileCLogIn="VersGen\ChangeLog.html"
$FileCLogOut=$env:APP_NAME +"\Resources\ChangeLog.html"
echo "Manifest path: $FileManOut"
echo "ChangeLog path: $FileCLogOut"
if($CI_COMMIT_BRANCH -eq "master")
{
$version = "stable"
}
else
{
$version = "unstable"
}
$manData = Get-Content $FileManIn
$manData = $manData -replace "1.0.0.0", $VersNumb
$manData = $manData -replace "{{DIRNAME}}", $env:NEXUS_PATH
$manData = $manData -replace "{{BRANCHNAME}}", "$version/LAST"
$manData = $manData -replace "{{PACKNAME}}", $env:APP_NAME
Set-Content -Path $FileManOut -Value $manData
$clogData = Get-Content $FileCLogIn
$clogData = $clogData -replace "{{CURRENT-REL}}", $VersNumb
Set-Content -Path $FileCLogOut -Value $clogData
$File2Send = Get-ChildItem("Releases\$CI_COMMIT_BRANCH\*")
ForEach ($File in $File2Send) {
$FileName = Split-Path $File -leaf
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName
}
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileManOut https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileManOut https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
echo "mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileCLogOut https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html"
mCurl -s -u GitLab:$NEXUS_PASSWD --upload-file $FileCLogOut https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
# $File2Send = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
# mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$CI_COMMIT_BRANCH/LAST/$env:APP_NAME-$version.zip
# mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$CI_COMMIT_BRANCH/ARCHIVE/$VersNumb/$env:APP_NAME-$version.zip
# mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send".md5" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".md5
# mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File2Send".sha1" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip".sha1"
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
stages:
- build
- deploy
PUB:Build:
stage: build
tags:
- win
#variables:
# - APP_NAME: 'PUB'
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore $env:SOL_NAME.sln' # path alla solution corrente
- *version-fix
script:
- '& "$env:MSBUILD_PATH" src\$env:APP_NAME\$env:APP_NAME.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m'
PUB:Deploy:
stage: deploy
tags:
- win
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore $env:SOL_NAME.sln' # path alla solution corrente
- *version-fix
- *cleanup-zip
script:
- '& "$env:MSBUILD_PATH" src\$env:APP_NAME\$env:APP_NAME.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m'
- *zipper
- *hashBuild
- *nexusUpload
needs: ["PUB:Build"]
Vendored
-169
View File
@@ -1,169 +0,0 @@
pipeline {
agent none
environment {
EMAIL_RECIPIENTS = 'samuele@steamware.net'
}
stages {
stage('Checkout') {
agent any
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=291']) {
// env.versionNumber = VersionNumber(versionNumberString : '2.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '2.3.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'SOUR'
}
}
script {
currentBuild.displayName = "${env.versionNumber}"
if (env.BRANCH_NAME == "develop" || env.BRANCH_NAME.contains("DEMO") || env.BRANCH_NAME.contains("UnitTesting")) {
currentBuild.description = "TEST ${env.versionNumber}"
}
else {
currentBuild.description = "BUILD ${env.versionNumber}"
}
}
/* CAMBIO numero versione in file sorgente!!! */
bat "e:\\fart.exe src\\SharedAssemblyInfo.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0"
}
}
stage('Build') {
agent any
steps {
script {
// calcolo il config...
if (env.BRANCH_NAME == "develop") {
env.config = "Debug"
}
else if (env.BRANCH_NAME == "master") {
env.config = "Release"
}
// compilo installers in base al BRANCH...
if (env.BRANCH_NAME == "develop" || env.BRANCH_NAME == "master") {
// CAMBIO numero versione in file sorgente!!!
bat "e:\\fart.exe src\\SharedAssemblyInfo.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0"
// restore nuget packages
bat "e:\\nuget.exe restore ${WORKSPACE}\\src\\SOUR.sln"
// BUILD Develop!
bat "\"${tool 'MSBuild-16.0'}\" src/SOUR/SOUR.csproj -target:Build /p:Configuration=${env.config} /p:Platform=\"x86\" /p:OutputPath=bin/${env.config}/ /m"
}
else {
echo 'NON faccio test di Build se non per BRANCH DEVELOP...'
}
}
}
}
stage('Test') {
steps {
echo 'Testing.. 2 be done...'
}
}
stage('Deploy') {
agent any
steps {
// in primis compilo a seconda del branch... TUTTO tranne develop...
script {
// calcolo il config...
if (env.BRANCH_NAME == "develop") {
env.config = "Debug"
env.classifier = "unstable"
}
else if (env.BRANCH_NAME == "master") {
env.config = "Release"
env.classifier = ""
}
// procedo solo se NON si tratta di commit in ramo UnitTesting...
if (env.BRANCH_NAME != "UnitTesting") {
// CAMBIO numero versione in file sorgente!!!
bat "e:\\fart.exe src\\SharedAssemblyInfo.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0"
// restore nuget packages
bat "e:\\nuget.exe restore ${WORKSPACE}\\src\\SOUR.sln"
// BUILD!
bat "\"${tool 'MSBuild-16.0'}\" src/SOUR/SOUR.csproj -target:Build /p:Configuration=${env.config} /p:Platform=\"x86\" /p:OutputPath=bin/ /m"
// creo installer MSI...
bat "\"${tool 'MSBuild-16.0'}\" src/SOUR.Setup/SOUR.Setup.wixproj /p:Configuration=${env.config} /p:ProdVersion=${env.versionNumber} /p:Platform=\"x86\" /p:OutputPath=bin/ /m"
}
else
{
echo 'Nessun Deploy x UnitTesting'
}
}
// ora mi occupo delle operazioni di invio a NEXUS...
script {
if (env.BRANCH_NAME != "UnitTesting") {
nexusArtifactUploader(
nexusVersion: 'nexus3',
protocol: 'https',
nexusUrl: 'repository.scmgroup.com',
//groupId: 'SOUR',
version: "${env.versionNumber}",
repository: 'mconnect-raw',
credentialsId: 'b1dcea22-0d35-4092-80a1-973e6be41c78',
artifacts: [
[artifactId: 'SOUR',
classifier: "${env.classifier}",
file: "src\\SOUR.Setup\\bin\\SOUR.msi",
type: 'msi']
]
)
}
}
}
}
}
post {
success {
sendSlack("Successful", "good")
}
failure {
sendSlack("Failed", "danger")
}
unstable {
sendSlack("Unstable", "warning")
}
}
}
@NonCPS
def getChangeString() {
MAX_MSG_LEN = 100
def changeString = ""
echo "Gathering SCM changes"
def changeLogSets = currentBuild.changeSets
for (int i = 0; i < changeLogSets.size(); i++) {
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
def entry = entries[j]
truncated_msg = entry.msg.take(MAX_MSG_LEN)
changeString += " - ${truncated_msg} [${entry.author}]\n"
}
}
if (!changeString) {
changeString = " - Nessuna Modifica"
}
return changeString
}
def sendEmail(status) {
mail (
to: "$EMAIL_RECIPIENTS",
subject: "Build $BUILD_NUMBER - " + status + " ($JOB_NAME)",
body: "Modifiche:\n " + getChangeString() + "\n\n Verifica console output: $BUILD_URL/console" + "\n")
}
// Funzione x invio slack
def sendSlack(status, colorCode) {
slackSend (
color: colorCode,
channel: "#sour-dev",
message: "${env.JOB_NAME} ${env.versionNumber} | " + status + ": Build ${env.BUILD_NUMBER}\n\n" +
"Modifiche:\n " + getChangeString() + "\n\n Verifica build: <${env.BUILD_URL}|Apri>" + "\n"
)
}
+1 -26
View File
@@ -6,8 +6,6 @@ Progetto per l'implementazione del server OPC-UA di gruppo basato su REDIS per a
- [SOUR (SCM OPC-UA REDIS)](#sour-scm-opc-ua-redis) - [SOUR (SCM OPC-UA REDIS)](#sour-scm-opc-ua-redis)
- [Organizzazione documenti e codice](#organizzazione-documenti-e-codice) - [Organizzazione documenti e codice](#organizzazione-documenti-e-codice)
- [MQTT](#mqtt)
- [MSI installer](#msi-installer)
- [Versioni](#versioni) - [Versioni](#versioni)
## Organizzazione documenti e codice ## Organizzazione documenti e codice
@@ -16,35 +14,13 @@ Progetto per l'implementazione del server OPC-UA di gruppo basato su REDIS per a
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| images | Files supporto documentazione | | images | Files supporto documentazione |
| LogConversion | Gestione conversione traccaito di LOG SOUR in formato leggibile per MSIM (superato da versioni > 1.*) | | LogConversion | Gestione conversione traccaito di LOG SOUR in formato leggibile per MSIM (superato da versioni > 1.*) |
| Rilasci | Folder dei rilasci (in versione release/debug) del server SOUR, IN PHASE OUT con impiego del nuovo server NEXUS | | Rilasci | Folder dei rilasci (in versione release/debug) del server SOUR |
| Specifiche.pdf | File contenente le specifiche di interfaccia per SOUR (che devono essere note ai vari Adapters) e tutte le definizioni a livello di interfaccia | | Specifiche.pdf | File contenente le specifiche di interfaccia per SOUR (che devono essere note ai vari Adapters) e tutte le definizioni a livello di interfaccia |
| Specifiche.md | File sorgente (in formato Markdown) delle specifiche | | Specifiche.md | File sorgente (in formato Markdown) delle specifiche |
| src | Folder contenente i sorgenti di SOUR | | src | Folder contenente i sorgenti di SOUR |
| TestClients | Client di riferimento per testing funzionalità OPC-UA | | TestClients | Client di riferimento per testing funzionalità OPC-UA |
| Utility | script ed utility varie |
| Varie | Documentazioni ed esempi a corredo |
| Video | Brevi demo dell'utilizzo | | Video | Brevi demo dell'utilizzo |
## MQTT
Dalla versione 2.2 è attivo un broker di pubblicazione MQTT verso il cloud.
Condizioni necessarie al funzionamento:
- Non sia presente la chiave di vet in REDIS all'indirizzo `SOUR:GwHw:Vers`, se vuoto/nullo = nessun veto, se presente il numero di versioni (o anceh solo una stringa non vuota) riferita al Gateway Hw viene inibito il funzionamento della sezione MQTT
- macchina attivata con SDK (quindi disponibili le informaizoni di user e pwd per il broker)
## MSI installer
Aggiunto il progetto di generazione installer con wix, il processo jenkis crea l'installer come ultimo step di deploy
Modalità di installaizone file installer msi:
```powershell
SOUR.Setup.msi INSTALLFOLDER=C:\IOT\SOUR /quiet
```
## Versioni ## Versioni
@@ -52,4 +28,3 @@ SOUR.Setup.msi INSTALLFOLDER=C:\IOT\SOUR /quiet
| ------ | ---------- | --------------------------------------------------------------------------------------------------------- | | ------ | ---------- | --------------------------------------------------------------------------------------------------------- |
| <= 1.2 | 2018.12.06 | Documento impiegato epr definizione specifiche SOUR | | <= 1.2 | 2018.12.06 | Documento impiegato epr definizione specifiche SOUR |
| >= 1.3 | 2018.12.06 | Documento suddiviso tra organizzaizone progetto (corrente) e specifiche progetto SOUR (Specifiche.md/pdf) | | >= 1.3 | 2018.12.06 | Documento suddiviso tra organizzaizone progetto (corrente) e specifiche progetto SOUR (Specifiche.md/pdf) |
| >= 2.2 | 2019.08.02 | Aggiunta MQTT server embedded, generazione installer msi |
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -34
View File
@@ -12,15 +12,12 @@ Progetto per l'implementazione del server OPC-UA di gruppo basato su REDIS per a
- [Requisiti per installazione](#requisiti-per-installazione) - [Requisiti per installazione](#requisiti-per-installazione)
- [Regole di Naming](#regole-di-naming) - [Regole di Naming](#regole-di-naming)
- [Schemi di dettaglio](#schemi-di-dettaglio) - [Schemi di dettaglio](#schemi-di-dettaglio)
- [Riferimenti importanti](#riferimenti-importanti)
- [MQTT](#mqtt)
- [MSI installer](#msi-installer)
- [Elementi della soluzione](#elementi-della-soluzione) - [Elementi della soluzione](#elementi-della-soluzione)
- [SPECIALIZED ADAPTER --> REDIS SERVER](#specialized-adapter----redis-server) - [SPECIALIZED ADAPTER --> REDIS SERVER](#specialized-adapter----redis-server)
- [OPC-UA SERVER --> REDIS SERVER](#opc-ua-server----redis-server) - [OPC-UA SERVER --> REDIS SERVER](#opc-ua-server----redis-server)
- [DataModel](#datamodel) - [DataModel](#datamodel)
- [Riferimenti per il server OPC-UA](#riferimenti-per-il-server-opc-ua) - [Riferimenti per il server OPC-UA](#riferimenti-per-il-server-opc-ua)
- [Modalità di funzionamento SOUR](#modalit%c3%a0-di-funzionamento-sour) - [Modalità di funzionamento SOUR](#modalit%C3%A0-di-funzionamento-sour)
- [Dettaglio struttura memoria DB del server REDIS](#dettaglio-struttura-memoria-db-del-server-redis) - [Dettaglio struttura memoria DB del server REDIS](#dettaglio-struttura-memoria-db-del-server-redis)
- [Adapter - Adp](#adapter---adp) - [Adapter - Adp](#adapter---adp)
- [Adapter - AdpConf](#adapter---adpconf) - [Adapter - AdpConf](#adapter---adpconf)
@@ -30,7 +27,7 @@ Progetto per l'implementazione del server OPC-UA di gruppo basato su REDIS per a
- [Adapter - MConnect](#adapter---mconnect) - [Adapter - MConnect](#adapter---mconnect)
- [Dettaglio protocollo comunicazione HMI - Maestro Connect](#dettaglio-protocollo-comunicazione-hmi---maestro-connect) - [Dettaglio protocollo comunicazione HMI - Maestro Connect](#dettaglio-protocollo-comunicazione-hmi---maestro-connect)
- [Aspetti tecnici salienti](#aspetti-tecnici-salienti) - [Aspetti tecnici salienti](#aspetti-tecnici-salienti)
- [Schema Funzionalità](#schema-funzionalit%c3%a0) - [Schema Funzionalità](#schema-funzionalit%C3%A0)
- [**ChannelsIN**: notifica info dal Cloud / richiesta esecuzione task -> HMI](#channelsin-notifica-info-dal-cloud--richiesta-esecuzione-task---hmi) - [**ChannelsIN**: notifica info dal Cloud / richiesta esecuzione task -> HMI](#channelsin-notifica-info-dal-cloud--richiesta-esecuzione-task---hmi)
- [Caso duso ChannelsIN:DataError](#caso-duso-channelsindataerror) - [Caso duso ChannelsIN:DataError](#caso-duso-channelsindataerror)
- [Caso duso ChannelsIN:AlertHMI](#caso-duso-channelsinalerthmi) - [Caso duso ChannelsIN:AlertHMI](#caso-duso-channelsinalerthmi)
@@ -65,10 +62,6 @@ Le versioni rilasciate della documentazione e del server SOUR sono le seguenti:
| 1.2.6 | 2018.12.06 | Completata documentazione area REDIS e aggiornamento server (1.2.1812.185) | | 1.2.6 | 2018.12.06 | Completata documentazione area REDIS e aggiornamento server (1.2.1812.185) |
| 1.3.1 | 2019.01.31 | Implementata gestione nuovi parametri in DataModel per SampleGroup, DeadBand, VisibilityGroup --> testing con FANUC/SIEMENS ed adapter CMS (1.3.1901.195) | | 1.3.1 | 2019.01.31 | Implementata gestione nuovi parametri in DataModel per SampleGroup, DeadBand, VisibilityGroup --> testing con FANUC/SIEMENS ed adapter CMS (1.3.1901.195) |
| 1.3.2 | 2019.02.03 | Review documentazione x definizione modelli tracciati JSON per log eventi/allarmi/produzione su base riunione 2018.01.30 (1.3.1902.196) | | 1.3.2 | 2019.02.03 | Review documentazione x definizione modelli tracciati JSON per log eventi/allarmi/produzione su base riunione 2018.01.30 (1.3.1902.196) |
| 1.4 | 2019.02.18 | Cambio Namespace, fix gestione allarmi |
| 2.0 | 2019.03.08 | Prima release 2.0 stabile |
| 2.1 | 2019.04.12 | modifica comportamento in avvio per sincronizzazione allarmi, sincronizzazione variabili e proprietà |
| 2.2 | 2019.08.01 | Prima release 2.2 con MQTT, fix comportamento invio allarmi 8gestione memoria persistente precedente invio stato allarmi), nuovo installer MSI |
<div style="page-break-after: always;"></div> <div style="page-break-after: always;"></div>
@@ -193,31 +186,6 @@ A valle di questo si trova il server REDIS che persiste le informaizone e fa da
<div style="page-break-after: always;"></div> <div style="page-break-after: always;"></div>
## Riferimenti importanti
Alcune note importatnti riguardo l'installer MSI di SOUR e il broker MQTT embedded in SOUR
### MQTT
Dalla versione 2.2 è attivo un broker di pubblicazione MQTT verso il cloud.
Condizioni necessarie al funzionamento:
- Non sia presente la chiave di vet in REDIS all'indirizzo `SOUR:GwHw:Vers`, se vuoto/nullo = nessun veto, se presente il numero di versioni (o anceh solo una stringa non vuota) riferita al Gateway Hw viene inibito il funzionamento della sezione MQTT
- macchina attivata con SDK (quindi disponibili le informaizoni di user e pwd per il broker)
### MSI installer
Aggiunto il progetto di generazione installer con wix, il processo jenkis crea l'installer come ultimo step di deploy
Modalità di installaizone file installer msi:
```powershell
SOUR.Setup.msi INSTALLFOLDER=C:\IOT\SOUR /quiet
```
## Elementi della soluzione ## Elementi della soluzione
Di seguito sono indicati i vari elementi in gioco nel sistema e le specifiche di impiego e funzionamento. Di seguito sono indicati i vari elementi in gioco nel sistema e le specifiche di impiego e funzionamento.
BIN
View File
Binary file not shown.
-7
View File
@@ -1,7 +0,0 @@
------------------------------------------------
- Check e todo's
------------------------------------------------
OK - Inserire Costura Fody x fare ILMerge di dll + assembly vari x SOUR
- Verifica distinzione caso release e debug: https://tech.trailmax.info/2014/01/bundling-all-your-assemblies-into-one-or-alternative-to-ilmerge/
- Continuare costruzione MSI con WIX con soli files di assembly merged...
File diff suppressed because it is too large Load Diff
+6 -7
View File
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpcUaCommon</RootNamespace> <RootNamespace>OpcUaCommon</RootNamespace>
<AssemblyName>OpcUaCommon</AssemblyName> <AssemblyName>OpcUaCommon</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
@@ -35,14 +35,14 @@
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="MQTTnet, Version=3.0.8.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL"> <Reference Include="MQTTnet, Version=3.0.5.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL">
<HintPath>..\packages\MQTTnet.3.0.8\lib\net461\MQTTnet.dll</HintPath> <HintPath>..\packages\MQTTnet.3.0.5\lib\net461\MQTTnet.dll</HintPath>
</Reference> </Reference>
<Reference Include="MQTTnet.Extensions.ManagedClient, Version=3.0.8.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL"> <Reference Include="MQTTnet.Extensions.ManagedClient, Version=3.0.5.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7, processorArchitecture=MSIL">
<HintPath>..\packages\MQTTnet.Extensions.ManagedClient.3.0.8\lib\net452\MQTTnet.Extensions.ManagedClient.dll</HintPath> <HintPath>..\packages\MQTTnet.Extensions.ManagedClient.3.0.5\lib\net452\MQTTnet.Extensions.ManagedClient.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@@ -77,7 +77,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\ConsolePrinter.cs" /> <Compile Include="Services\ConsolePrinter.cs" />
<Compile Include="Services\CryptoUtils.cs" />
<Compile Include="Services\DataRecorder.cs" /> <Compile Include="Services\DataRecorder.cs" />
<Compile Include="Services\IPrinter.cs" /> <Compile Include="Services\IPrinter.cs" />
<Compile Include="Services\LogPrinter.cs" /> <Compile Include="Services\LogPrinter.cs" />
-154
View File
@@ -1,154 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace OpcUaCommon.Services
{
/// <summary>
/// utils x cifrature passeword e Crypto functionality in genere
/// </summary>
public static class CryptoUtils
{
#region Public Methods
/// <summary>
/// Decifra un messaggio AES
/// </summary>
/// <param name="Message"></param>
/// <param name="Passphrase"></param>
/// <returns></returns>
public static string DecryptString(string Message, string Passphrase)
{
string answ = Message;
byte[] Results = null;
UTF8Encoding UTF8 = new UTF8Encoding();
// Step 1. faccio hash per ottenere la Key a 128 bit + l'InitVector a 256 bit
// - MD5 hash generator --> 128 bit byte array
// - Sha256 hash generator --> 256 bit byte array
MD5CryptoServiceProvider MD5HashProv = new MD5CryptoServiceProvider();
SHA256CryptoServiceProvider Sha256HashProv = new SHA256CryptoServiceProvider();
byte[] AESKey = Sha256HashProv.ComputeHash(UTF8.GetBytes(Passphrase));
byte[] AESIV = MD5HashProv.ComputeHash(UTF8.GetBytes(Passphrase));
// Step 2. Crea oggett AESCryptoServiceProvider
AesCryptoServiceProvider AESAlgorithm = new AesCryptoServiceProvider();
// Step 3. Setup del dencoder
AESAlgorithm.Key = AESKey;
AESAlgorithm.IV = AESIV;
// Step 4. Conversione della stringa in ingresso in un byte[]
byte[] DataToDecrypt = null;
try
{
DataToDecrypt = Convert.FromBase64String(Message);
}
catch
{ }
if (DataToDecrypt != null)
{
// Step 5. Attempt to decrypt the string
try
{
ICryptoTransform Decryptor = AESAlgorithm.CreateDecryptor();
Results = Decryptor.TransformFinalBlock(DataToDecrypt, 0, DataToDecrypt.Length);
}
finally
{
// Clear the TripleDes and Hashprovider services of any sensitive information
AESAlgorithm.Clear();
MD5HashProv.Clear();
Sha256HashProv.Clear();
}
// Step 6. Return the decrypted string in UTF8 format
answ = UTF8.GetString(Results);
}
return answ;
}
/// <summary>
/// Cifra un messaggio con AES
/// </summary>
/// <param name="Message">Messaggio da cifrare (la password)</param>
/// <param name="Passphrase">Stringa usate per generare le key/IV da 128/256bit</param>
/// <returns></returns>
public static string EncryptString(string Message, string Passphrase)
{
byte[] Results;
UTF8Encoding UTF8 = new UTF8Encoding();
// Step 1. faccio hash per ottenere la Key a 128 bit + l'InitVector a 256 bit
// - MD5 hash generator --> 128 bit byte array
// - Sha256 hash generator --> 256 bit byte array
MD5CryptoServiceProvider MD5HashProv = new MD5CryptoServiceProvider();
SHA256CryptoServiceProvider Sha256HashProv = new SHA256CryptoServiceProvider();
byte[] AESKey = Sha256HashProv.ComputeHash(UTF8.GetBytes(Passphrase));
byte[] AESIV = MD5HashProv.ComputeHash(UTF8.GetBytes(Passphrase));
// Step 2. Crea oggett AESCryptoServiceProvider
AesCryptoServiceProvider AESAlgorithm = new AesCryptoServiceProvider();
// Step 3. Setup dell'encoder
AESAlgorithm.Key = AESKey;
AESAlgorithm.IV = AESIV;
// Step 4. Conversione della stringa in ingresso in un byte[]
byte[] DataToEncrypt = UTF8.GetBytes(Message);
// Step 5. Attempt to encrypt the string
try
{
ICryptoTransform Encryptor = AESAlgorithm.CreateEncryptor();
Results = Encryptor.TransformFinalBlock(DataToEncrypt, 0, DataToEncrypt.Length);
}
finally
{
// ripulisce il provider di ogni informazione sensibile
AESAlgorithm.Clear();
MD5HashProv.Clear();
Sha256HashProv.Clear();
}
// Step 6. Restitusice stringa cifrata come una "base64 encoded string"
return Convert.ToBase64String(Results);
}
/// <summary>
/// Genera una password valida
/// </summary>
/// <param name="userName"></param>
/// <param name="passphrase"></param>
/// <returns></returns>
public static string generatePwd(string userName, string passphrase)
{
// Check preliminare della "master password"
return EncryptString(userName, passphrase);
}
/// <summary>
/// Effettua validazione password
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <param name="passphrase"></param>
/// <returns></returns>
public static bool validateUserPwd(string userName, string password, string passphrase)
{
// Check preliminare della "master password"
bool answ = (userName == "scmAdmin" && password == "1PasswordDavveroDifficil3!");
// verifico password avanzata
if (!answ)
{
string plainText = DecryptString(password, passphrase);
answ = (userName == plainText);
}
return answ;
}
#endregion Public Methods
}
}
+268 -388
View File
@@ -6,147 +6,108 @@ using Newtonsoft.Json.Converters;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
namespace OpcUaCommon.Services namespace OpcUaCommon.Services
{ {
/// <summary>
/// Enum stati allarmi
/// </summary>
public enum alarmState
{
Active,
Inactive
}
/// <summary>
/// Classe del contenuto DATA dell'oggetto (base)
/// </summary>
public class alarmPayload : dataPayload
{
#region Public Properties
/// <summary>
/// Stato corrente della condition
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public alarmState activeState { get; set; } = alarmState.Inactive;
/// <summary>
/// Chiave univoca allarme (CODICE|SEVERITY)
/// </summary>
public string conditionName { get; set; } = "";
/// <summary>
/// K rappresenta il channel della condition
/// </summary>
public string eventType { get; set; } = "AlarmConditionType";
/// <summary>
/// K rappresenta il channel della condition
/// </summary>
public string k { get; set; } = "";
/// <summary>
/// rappresenta la severity della condition (0..1000) calcolata in automatico dalla condition name (dopo il simbolo pipe "|")
/// </summary>
public string severity
{
get
{
string answ = "0";
int idx = conditionName.IndexOf("|");
if (idx > 0)
{
try
{
answ = conditionName.Substring(idx + 1);
}
catch
{ }
}
return answ;
}
}
#endregion Public Properties
}
/// <summary>
/// Classe del contenuto DATA dell'oggetto (base)
/// </summary>
public class dataPayload
{
#region Public Properties
/// <summary>
/// ts = timestamp server
/// </summary>
public string ts { get; set; } = DTUtils.timestamp;
/// <summary>
/// v = value
/// </summary>
public string v { get; set; } = "";
#endregion Public Properties
}
public class MQTT_Client public class MQTT_Client
{ {
#region Private Fields /// <summary>
/// Classe di configurazione per accesso MQTT
private readonly IPrinter _printer; /// "plugId": "dev-5c86dced371e9e980142167d", "auth_password": "9c4173da75"
/// </summary>
#endregion Private Fields public class confData
{
#region Protected Fields /// <summary>
/// Determina se sia abilitato o meno il protocollo
/// </summary>
public bool isEnabled = false;
/// <summary>
/// Base NameSpace (se manca lo aggiunge al channel in fase di invio...
/// </summary>
public string baseNS { get; set; } = "data/";
/// <summary>
/// URL del brooker
/// api.cloudplugs.com
/// </summary>
public string broker_address { get; set; }
/// <summary>
/// PORT del broker
/// </summary>
public int port_broker { get; set; }
/// <summary>
/// Tempo di attesa prima di tentare una auto-reconnect (in ms)
/// </summary>
public int autoReconnectDelayMs { get; set; }
/// <summary>
/// User - da API mconnect
/// "plugId": "dev-5c86dced371e9e980142167d"
/// </summary>
public string usr_broker { get; set; }
/// <summary>
/// Password - da API mconnect
/// "auth_password": "9c4173da75"
/// </summary>
public string pwd_broker { get; set; }
}
/// <summary> /// <summary>
/// Configurazione attiva /// Configurazione attiva
/// </summary> /// </summary>
protected confData _currConf; protected confData _currConf;
/// <summary>
/// Obj factory MQTT
/// </summary>
protected MqttFactory factory;
/// <summary>
/// Opzioni di connessione (managed client)
/// </summary>
protected ManagedMqttClientOptions options;
/// <summary>
/// Client MQTT (managed)
/// </summary>
protected IManagedMqttClient mqttClientMan;
/// <summary> /// <summary>
/// Cancellation token /// Cancellation token
/// </summary> /// </summary>
protected System.Threading.CancellationToken cancellationToken; protected System.Threading.CancellationToken cancellationToken;
/// <summary>
/// Obj factory MQTT
/// </summary>
protected MqttFactory factory;
/// <summary>
/// Client MQTT (managed)
/// </summary>
protected IManagedMqttClient mqttClientMan;
/// <summary>
/// Opzioni di connessione (managed client)
/// </summary>
protected ManagedMqttClientOptions options;
#endregion Protected Fields
#region Public Constructors
/// <summary> /// <summary>
/// Inizializzazione obj gestione MQTT /// Inizializzazione obj gestione MQTT
/// </summary> /// </summary>
/// <param name="currConfig"></param> /// <param name="currConfig"></param>
/// <param name="printer"></param> public MQTT_Client(confData currConfig)
public MQTT_Client(confData currConfig, IPrinter printer)
{ {
// salvo config // salvo config
_currConf = currConfig; _currConf = currConfig;
_printer = printer;
mqttClientMan = new MqttFactory().CreateManagedMqttClient(); mqttClientMan = new MqttFactory().CreateManagedMqttClient();
} }
/// <summary>
/// Avvio del client MQTT
/// </summary>
public async Task startAsync()
{
// preparo token cancellazione
cancellationToken = new System.Threading.CancellationToken();
#endregion Public Constructors Guid newGuid = Guid.NewGuid();
string clientId = $"SOUR-SRG-{newGuid}";
#region Protected Methods
// Setup and start del client MQTT managed.
options = new ManagedMqttClientOptionsBuilder()
.WithAutoReconnectDelay(TimeSpan.FromMilliseconds(_currConf.autoReconnectDelayMs))
.WithClientOptions(new MqttClientOptionsBuilder()
.WithClientId(clientId)
.WithTcpServer(_currConf.broker_address, _currConf.port_broker)
.WithCredentials(_currConf.usr_broker, _currConf.pwd_broker)
//.WithTls()
.Build())
.Build();
// avvio client MQTT
await mqttClientMan.StartAsync(options);
}
/// <summary> /// <summary>
/// COntrolla se il channel contenga il valore baseNS da config, altrimenti aggiunge... /// COntrolla se il channel contenga il valore baseNS da config, altrimenti aggiunge...
/// </summary> /// </summary>
@@ -160,46 +121,109 @@ namespace OpcUaCommon.Services
answ = answ.Replace(":", "/"); answ = answ.Replace(":", "/");
return answ; return answ;
} }
#endregion Protected Methods
#region Public Methods
/// <summary> /// <summary>
/// Formatta il payload in modo che sia un JSon valido x gli allarmi da trasmettere... /// Invia messaggio richiesto
/// </summary> /// </summary>
/// <param name="conditionKey">KEY della condition nel formato codice+severity (codice_allarme|severity)</param> /// <param name="channel">Channel su cui pubblicare</param>
/// <param name="conditionValue">Valore condition = TESTO dell'allarme</param> /// <param name="valore">Valore da trasmettere</param>
/// <param name="alrmState">Stato dell'allarme</param>
/// <param name="baseNS">Componente NS da togliere nel valore "K" del payload dell'allarme</param>
/// <param name="ttlSec">TTL da impostare: -1 = never, null = default 100gg, >=0 imposta TTL</param> /// <param name="ttlSec">TTL da impostare: -1 = never, null = default 100gg, >=0 imposta TTL</param>
/// <returns></returns> /// <returns></returns>
public static string createAlarmPayload(string channel, string conditionKey, string conditionValue, alarmState alrmState, string baseNS, int? ttlSec) public async Task<bool> sendValueAsync(string channel, string valore, int? ttlSec)
{ {
string jsonData = ""; bool answ = false;
// se ttl null --> imposto default 100 gg // invio SOLO SE il valore è != ""...
ttlSec = ttlSec == null ? 86400 * 100 : ttlSec; if (valore != "")
// se ttl < 0 --> imposto null (never expiry...)
ttlSec = ttlSec < 0 ? null : ttlSec;
// preparo oggetto
mqttConditionPayload currData = new mqttConditionPayload()
{ {
data = new alarmPayload() try
{ {
k = channel.Replace(baseNS, ""), string payload = createValuePayload(valore, ttlSec);
v = conditionValue, // registro esito...
conditionName = conditionKey, answ = await sendPayloadAsync(channel, payload);
activeState = alrmState
},
ttl = ttlSec,
at = DTUtils.dtAtMqtt(DateTime.UtcNow)
};
// serializzo
jsonData = JsonConvert.SerializeObject(currData);
// restituisco!
return jsonData;
} }
catch
{ }
}
else
{
// no invio se vuoto...
}
// restituico esito...
return answ;
}
/// <summary>
/// Invia messaggio richiesto
/// </summary>
/// <param name="channel">Channel su cui pubblicare</param>
/// <param name="conditionKey">KEY della condition nel formato codice+severity (codice_allarme|severity)</param>
/// <param name="conditionValue">Valore condition = TESTO dell'allarme</param>
/// <param name="activeState">Stato dell'allarme</param>
/// <param name="ttlSec">TTL da impostare: -1 = never, null = default 100gg, >=0 imposta TTL</param>
/// <returns></returns>
public async Task<bool> sendAlarmAsync(string channel, string conditionKey, string conditionValue, alarmState activeState, int? ttlSec)
{
bool answ = false;
// invio SOLO SE il valore è != ""...
if (conditionKey != "")
{
try
{
string payload = createAlarmPayload(channel, conditionKey, conditionValue, activeState, _currConf.baseNS, ttlSec);
// registro esito...
answ = await sendPayloadAsync($"{channel}/{conditionKey}", payload);
}
catch(Exception exc)
{ }
}
else
{
// no invio se vuoto...
}
// restituico esito...
return answ;
}
/// <summary>
/// Invia messaggio richiesto
/// </summary>
/// <param name="channel">Channel su cui pubblicare</param>
/// <param name="payload">Payload da trasmettere</param>
/// <returns></returns>
public async Task<bool> sendPayloadAsync(string channel, string payload)
{
bool answ = false;
try
{
// impacchetto il messaggio
var message = new MqttApplicationMessageBuilder()
.WithTopic($"{_currConf.usr_broker}/{fixChannel(channel)}")
.WithPayload(payload)
.WithExactlyOnceQoS()
.WithRetainFlag()
.Build();
// invio in modalità async
await mqttClientMan.PublishAsync(message, cancellationToken);
// registro esito...
answ = true;
}
catch (Exception exc)
{ }
// restituico esito...
return answ;
}
/// <summary>
/// Invia 1:1 le stringhe di payload ricevute
/// </summary>
/// <param name="rowList">Array di linee da registrare</param>
public void Send(List<string> rowList)
{
// spacchetta i payload
foreach (var item in rowList)
{
// e li invia 1:1...
//string jsonData = MQTT_Client.createPayload("Starting", null);
//await mqttCli.sendMessageAsync("data/SRG", jsonData);
}
}
/// <summary> /// <summary>
/// Formatta il payload in modo che sia un JSon valido partendo dal VALUE che si vuole trasmettere... /// Formatta il payload in modo che sia un JSon valido partendo dal VALUE che si vuole trasmettere...
/// </summary> /// </summary>
@@ -228,15 +252,16 @@ namespace OpcUaCommon.Services
// restituisco! // restituisco!
return jsonData; return jsonData;
} }
/// <summary> /// <summary>
/// Formatta il payload in modo che sia un JSon valido partendo dal VALUE che si vuole trasmettere... /// Formatta il payload in modo che sia un JSon valido x gli allarmi da trasmettere...
/// </summary> /// </summary>
/// <param name="valore">Valore da inviare</param> /// <param name="conditionKey">KEY della condition nel formato codice+severity (codice_allarme|severity)</param>
/// <param name="ttlSec">Indica un TTL (inserisce meta se non vuoto)</param> /// <param name="conditionValue">Valore condition = TESTO dell'allarme</param>
/// <param name="EventDT">Data-ora dell'evento da creare</param> /// <param name="activeState">Stato dell'allarme</param>
/// <param name="baseNS">Componente NS da togliere nel valore "K" del payload dell'allarme</param>
/// <param name="ttlSec">TTL da impostare: -1 = never, null = default 100gg, >=0 imposta TTL</param>
/// <returns></returns> /// <returns></returns>
public static string createValuePayload(string valore, int? ttlSec, DateTime EventDT) public static string createAlarmPayload(string channel, string conditionKey, string conditionValue, alarmState activeState, string baseNS, int? ttlSec)
{ {
string jsonData = ""; string jsonData = "";
// se ttl null --> imposto default 100 gg // se ttl null --> imposto default 100 gg
@@ -244,269 +269,124 @@ namespace OpcUaCommon.Services
// se ttl < 0 --> imposto null (never expiry...) // se ttl < 0 --> imposto null (never expiry...)
ttlSec = ttlSec < 0 ? null : ttlSec; ttlSec = ttlSec < 0 ? null : ttlSec;
// preparo oggetto // preparo oggetto
mqttValuePayload currData = new mqttValuePayload() mqttConditionPayload currData = new mqttConditionPayload()
{ {
data = new dataPayload() data = new alarmPayload()
{ {
v = valore k = channel.Replace(baseNS, ""),
v = conditionValue,
conditionName = conditionKey,
currState = activeState
}, },
ttl = ttlSec, ttl = ttlSec,
at = DTUtils.dtAtMqtt(EventDT) at = DTUtils.dtAtMqtt(DateTime.UtcNow)
}; };
// serializzo // serializzo
jsonData = JsonConvert.SerializeObject(currData); jsonData = JsonConvert.SerializeObject(currData);
// restituisco! // restituisco!
return jsonData; return jsonData;
} }
/// <summary>
/// Invia 1:1 le stringhe di payload ricevute
/// </summary>
/// <param name="rowList">Array di linee da registrare</param>
public void Send(List<string> rowList)
{
// spacchetta i payload
foreach (var item in rowList)
{
// e li invia 1:1...
//string jsonData = MQTT_Client.createPayload("Starting", null);
//await mqttCli.sendMessageAsync("data/SRG", jsonData);
} }
}
/// <summary>
/// Invia messaggio richiesto
/// </summary>
/// <param name="channel">Channel su cui pubblicare</param>
/// <param name="conditionKey">KEY della condition nel formato codice+severity (codice_allarme|severity)</param>
/// <param name="conditionValue">Valore condition = TESTO dell'allarme</param>
/// <param name="activeState">Stato dell'allarme</param>
/// <param name="ttlSec">TTL da impostare: -1 = never, null = default 100gg, >=0 imposta TTL</param>
/// <returns></returns>
public async Task<bool> sendAlarmAsync(string channel, string conditionKey, string conditionValue, alarmState activeState, int? ttlSec)
{
bool answ = false;
// invio SOLO SE il valore è != ""...
if (conditionKey != "")
{
try
{
string payload = createAlarmPayload(channel, conditionKey, conditionValue, activeState, _currConf.baseNS, ttlSec);
// registro esito...
answ = await sendPayloadAsync($"{channel}/{conditionKey}", payload);
}
catch (Exception exc)
{
_printer.Print($"EXCEPTION during sendAlarmAsync: channel {channel} | conditionKey = {conditionKey} | conditionValue = {conditionValue} | activeState = {activeState} | TTL = {ttlSec}");
_printer.Print(exc.ToString());
}
}
else
{
// no invio se vuoto...
}
// restituico esito...
return answ;
}
/// <summary>
/// Invia messaggio richiesto
/// </summary>
/// <param name="channel">Channel su cui pubblicare</param>
/// <param name="payload">Payload da trasmettere</param>
/// <returns></returns>
public async Task<bool> sendPayloadAsync(string channel, string payload)
{
bool answ = false;
try
{
// impacchetto il messaggio
var message = new MqttApplicationMessageBuilder()
.WithTopic($"{_currConf.usr_broker}/{fixChannel(channel)}")
.WithPayload(payload)
.WithExactlyOnceQoS()
.WithRetainFlag()
.Build();
// invio in modalità async
await mqttClientMan.PublishAsync(message, cancellationToken);
// registro esito...
answ = true;
}
catch (Exception exc)
{
_printer.Print($"EXCEPTION during sendPayloadAsync: channel {channel} | payload = {payload}");
_printer.Print(exc.ToString());
}
// restituico esito...
return answ;
}
/// <summary>
/// Invia messaggio richiesto
/// </summary>
/// <param name="channel">Channel su cui pubblicare</param>
/// <param name="valore">Valore da trasmettere</param>
/// <param name="ttlSec">TTL da impostare: -1 = never, null = default 100gg, >=0 imposta TTL</param>
/// <returns></returns>
public async Task<bool> sendValueAsync(string channel, string valore, int? ttlSec)
{
bool answ = false;
// invio SOLO SE il valore è != ""...
if (!string.IsNullOrEmpty(valore))
{
try
{
string payload = createValuePayload(valore, ttlSec);
// registro esito...
answ = await sendPayloadAsync(channel, payload);
}
catch (Exception exc)
{
_printer.Print($"EXCEPTION during sendValueAsync: channel {channel} | valore = {valore} | TTL = {ttlSec}");
_printer.Print(exc.ToString());
}
}
else
{
// no invio se vuoto...
}
// restituico esito...
return answ;
}
/// <summary>
/// Avvio del client MQTT
/// </summary>
public async Task startAsync()
{
// preparo token cancellazione
cancellationToken = new System.Threading.CancellationToken();
Guid newGuid = Guid.NewGuid();
string clientId = $"SOUR-SRG-{newGuid}";
// Setup and start del client MQTT managed.
options = new ManagedMqttClientOptionsBuilder()
.WithAutoReconnectDelay(TimeSpan.FromMilliseconds(_currConf.autoReconnectDelayMs))
.WithClientOptions(new MqttClientOptionsBuilder()
.WithClientId(clientId)
.WithTcpServer(_currConf.broker_address, _currConf.port_broker)
.WithCredentials(_currConf.usr_broker, _currConf.pwd_broker)
//.WithTls()
.Build())
.Build();
// avvio client MQTT
await mqttClientMan.StartAsync(options);
}
#endregion Public Methods
#region Public Classes
/// <summary>
/// Classe di configurazione per accesso MQTT
/// "plugId": "dev-5c86dced371e9e980142167d", "auth_password": "9c4173da75"
/// </summary>
public class confData
{
#region Public Fields
/// <summary>
/// Determina se sia abilitato o meno il protocollo
/// </summary>
public bool isEnabled = false;
#endregion Public Fields
#region Public Properties
/// <summary>
/// Tempo di attesa prima di tentare una auto-reconnect (in ms)
/// </summary>
public int autoReconnectDelayMs { get; set; }
/// <summary>
/// Base NameSpace (se manca lo aggiunge al channel in fase di invio...
/// </summary>
public string baseNS { get; set; } = "data/";
/// <summary>
/// URL del brooker
/// api.cloudplugs.com
/// </summary>
public string broker_address { get; set; }
/// <summary>
/// PORT del broker
/// </summary>
public int port_broker { get; set; }
/// <summary>
/// Password - da API mconnect
/// "auth_password": "9c4173da75"
/// </summary>
public string pwd_broker { get; set; }
/// <summary>
/// User - da API mconnect
/// "plugId": "dev-5c86dced371e9e980142167d"
/// </summary>
public string usr_broker { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
/// <summary>
/// Classe costruzione di un payload MQTT di tipo CONDITION da serializzare
/// </summary>
public class mqttConditionPayload
{
#region Public Properties
/// <summary>
/// ts = timestamp pubblicazione
/// </summary>
public ulong at { get; set; } = DTUtils.dtAtMqtt(DateTime.UtcNow);
/// <summary>
/// Payload del messaggio MQTT
/// </summary>
public alarmPayload data { get; set; }
/// <summary>
/// Time To Live, IN SECONDI, default 100 gg (86'400 * 100)
/// </summary>
public int? ttl { get; set; } = 8640000;
#endregion Public Properties
}
/// <summary> /// <summary>
/// Classe costruzione di un payload MQTT di tipo VALORE STANDARD da serializzare /// Classe costruzione di un payload MQTT di tipo VALORE STANDARD da serializzare
/// </summary> /// </summary>
public class mqttValuePayload public class mqttValuePayload
{ {
#region Public Properties
/// <summary> /// <summary>
/// ts = timestamp pubblicazione /// ts = timestamp pubblicazione
/// </summary> /// </summary>
public ulong at { get; set; } = DTUtils.dtAtMqtt(DateTime.UtcNow); public ulong at { get; set; } = DTUtils.dtAtMqtt(DateTime.UtcNow);
/// <summary> /// <summary>
/// Payload del messaggio MQTT /// Payload del messaggio MQTT
/// </summary> /// </summary>
public dataPayload data { get; set; } public dataPayload data { get; set; }
/// <summary> /// <summary>
/// Time To Live, IN SECONDI, default 100 gg (86'400 * 100) /// Time To Live, IN SECONDI, default 100 gg (86'400 * 100)
/// </summary> /// </summary>
public int? ttl { get; set; } = 8640000; public int? ttl { get; set; } = 8640000;
}
#endregion Public Properties /// <summary>
/// Classe costruzione di un payload MQTT di tipo CONDITION da serializzare
/// </summary>
public class mqttConditionPayload
{
/// <summary>
/// ts = timestamp pubblicazione
/// </summary>
public ulong at { get; set; } = DTUtils.dtAtMqtt(DateTime.UtcNow);
/// <summary>
/// Payload del messaggio MQTT
/// </summary>
public alarmPayload data { get; set; }
/// <summary>
/// Time To Live, IN SECONDI, default 100 gg (86'400 * 100)
/// </summary>
public int? ttl { get; set; } = 8640000;
}
/// <summary>
/// Classe del contenuto DATA dell'oggetto (base)
/// </summary>
public class dataPayload
{
/// <summary>
/// ts = timestamp server
/// </summary>
public string ts { get; set; } = DTUtils.timestamp;
/// <summary>
/// v = value
/// </summary>
public string v { get; set; } = "";
}
/// <summary>
/// Classe del contenuto DATA dell'oggetto (base)
/// </summary>
public class alarmPayload : dataPayload
{
/// <summary>
/// K rappresenta il channel della condition
/// </summary>
public string k { get; set; } = "";
/// <summary>
/// rappresenta la severity della condition (0..1000) calcolata in automatico dalla condition name (dopo il simbolo pipe "|")
/// </summary>
public string severity
{
get
{
string answ = "0";
int idx = conditionName.IndexOf("|");
if (idx > 0)
{
try
{
answ = conditionName.Substring(idx + 1);
}
catch
{ }
}
return answ;
}
}
/// <summary>
/// K rappresenta il channel della condition
/// </summary>
public string eventType { get; set; } = "AlarmConditionType";
/// <summary>
/// Chiave univoca allarme (CODICE|SEVERITY)
/// </summary>
public string conditionName { get; set; } = "";
/// <summary>
/// Stato corrente della condition
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public alarmState currState { get; set; } = alarmState.Inactive;
}
/// <summary>
/// Enum stati allarmi
/// </summary>
public enum alarmState
{
Active,
Inactive
} }
} }
+4 -4
View File
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="log4net" version="2.0.8" targetFramework="net461" /> <package id="log4net" version="2.0.8" targetFramework="net461" />
<package id="Microsoft.NETCore.Platforms" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.NETCore.Platforms" version="2.2.2" targetFramework="net461" />
<package id="MQTTnet" version="3.0.8" targetFramework="net461" /> <package id="MQTTnet" version="3.0.5" targetFramework="net461" />
<package id="MQTTnet.Extensions.ManagedClient" version="3.0.8" targetFramework="net461" /> <package id="MQTTnet.Extensions.ManagedClient" version="3.0.5" targetFramework="net461" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="net461" /> <package id="NETStandard.Library" version="2.0.3" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
<package id="System.Net.Security" version="4.3.2" targetFramework="net461" /> <package id="System.Net.Security" version="4.3.2" targetFramework="net461" />
<package id="System.Net.WebSockets" version="4.3.0" targetFramework="net461" /> <package id="System.Net.WebSockets" version="4.3.0" targetFramework="net461" />
<package id="System.Net.WebSockets.Client" version="4.3.2" targetFramework="net461" /> <package id="System.Net.WebSockets.Client" version="4.3.2" targetFramework="net461" />
+7 -91
View File
@@ -13,7 +13,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.4.0" newVersion="1.2.4.0" /> <bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
@@ -25,7 +25,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
@@ -33,7 +33,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Hosting" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Hosting" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.7.0" newVersion="2.2.7.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Https" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Https" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -49,7 +49,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -77,7 +77,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -85,7 +85,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Http.Features" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Http.Features" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Http" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -93,7 +93,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.2.0" newVersion="4.3.2.0" /> <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -103,90 +103,6 @@
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Connections.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.FileProviders.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.Binder" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Hosting.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.EnvironmentVariables" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.FileExtensions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.FileProviders.Physical" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.ObjectPool" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.4.4.0" newVersion="1.4.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Principal.Windows" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.DispatchProxy" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Xml" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
@@ -0,0 +1,131 @@
<ModelDesign>
<Machine DefaultGenerationRate="2000">
<Property SymbolicName="ModelName" BrowseName="ModelName" DataType="ua:String" ValueRank="Scalar" Value="Morbidelli P200 - SOUR" />
<Property SymbolicName="MachineID" BrowseName="MachineID" DataType="ua:String" ValueRank="Scalar" Value="SOUR/0001" />
<Property SymbolicName="Matricola" BrowseName="Matricola" DataType="ua:String" ValueRank="Scalar" Value="SOUR/0001" />
<Property SymbolicName="ManufacturerName" BrowseName="ManufacturerName" DataType="ua:String" ValueRank="Scalar" Value="SCM" />
<Variable SymbolicName="AlarmState" BrowseName="AlarmState" DataType="ua:Boolean" ValueRank="Scalar" GenerationRate="" Range="[0,1]" Units="Enumeration" />
<Variable SymbolicName="EmergencyState" BrowseName="EmergencyState" DataType="ua:Boolean" ValueRank="Scalar" GenerationRate="" Range="[0,1]" Units="Enumeration" />
<Variable SymbolicName="ExecutionState" BrowseName="ExecutionState" DataType="ua:Boolean" ValueRank="Scalar" GenerationRate="" Range="[0,1]" Units="Enumeration" />
<Variable SymbolicName="HoldState" BrowseName="HoldState" DataType="ua:Boolean" ValueRank="Scalar" GenerationRate="" Range="[0,1]" Units="Enumeration" />
<Variable SymbolicName="Power" BrowseName="Power" DataType="ua:Boolean" ValueRank="Scalar" GenerationRate="" Range="[1,1]" Units="Enumeration" />
<Variable SymbolicName="Mode" BrowseName="Mode" DataType="ua:String" ValueRank="Scalar" GenerationRate="" Range="[Auto,MDI,Manual,Calibration]" Units="Enumeration" />
<Condition SymbolicName="CNC" BrowseName="CNC" DataType="ua:String" ValueRank="Scalar" type="OffNormalAlarmState" Severity="high" GenerationRate="10000" Range="[]" Units="" />
<Condition SymbolicName="PLC" BrowseName="PLC" DataType="ua:String" ValueRank="Scalar" type="OffNormalAlarmState" Severity="high" GenerationRate="5000" Range="[]" Units="" />
<Component Name="Axes">
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Override" BrowseName="Override" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Component Name="AxisX">
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Override" BrowseName="Override" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,1000000]" Units="Count" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,1000]" Units="Count" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,500000]" Units="Count" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,1000]" Units="Count" />
</Component>
<Component Name="AxisY">
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Override" BrowseName="Override" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,1000000]" Units="Count" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,1000]" Units="Count" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,500000]" Units="Count" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,1000]" Units="Count" />
</Component>
<Component Name="AxisZ">
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Override" BrowseName="Override" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,1000000]" Units="Count" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,1000]" Units="Count" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,500000]" Units="Count" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,1000]" Units="Count" />
</Component>
<Component Name="AxisB">
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Override" BrowseName="Override" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,1000000]" Units="Count" />
<Variable SymbolicName="CurrentAng" BrowseName="CurrentAng" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,360]" Units="Count" />
<Variable SymbolicName="Revolutions" BrowseName="Revolutions" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,500000]" Units="Count" />
<Variable SymbolicName="TargetAng" BrowseName="TargetAng" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,360]" Units="Count" />
</Component>
<Component Name="AxisU">
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Override" BrowseName="Override" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,1000000]" Units="Count" />
<Variable SymbolicName="CurrentAng" BrowseName="CurrentAng" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,360]" Units="Count" />
<Variable SymbolicName="Revolutions" BrowseName="Revolutions" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,500000]" Units="Count" />
<Variable SymbolicName="TargetAng" BrowseName="TargetAng" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,360]" Units="Count" />
</Component>
</Component>
<Component Name="OperatingGroups">
<Variable SymbolicName="Override" BrowseName="Override" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Percent" />
<Component Name="Heads">
<Component Name="Head_1">
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,130]" Units="Percent" />
<Variable SymbolicName="Speed" BrowseName="Speed" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="SpindleRevs" BrowseName="SpindleRevs" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="SpindleActiveDuration" BrowseName="SpindeActiveDuration" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,100]" Units="Count" />
<Variable SymbolicName="ToolChanges" BrowseName="ToolChanges" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,250]" Units="Count" />
<Variable SymbolicName="ToolId" BrowseName="ToolId" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
</Component>
<Component Name="Head_2">
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,130]" Units="Percent" />
<Variable SymbolicName="Speed" BrowseName="Speed" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="SpindleRevs" BrowseName="SpindleRevs" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,5000]" Units="Count" />
<Variable SymbolicName="SpindleActiveDuration" BrowseName="SpindeActiveDuration" DataType="ua:Float" ValueRank="Scalar" GenerationRate="" Range="[0,100]" Units="Count" />
</Component>
</Component>
</Component>
<Component Name="VacuumPumps">
<Component Name="VacuumPump_1">
<Variable SymbolicName="WorkingTime" BrowseName="WorkingTime" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,100]" Units="Count" />
</Component>
<Component Name="VacuumPump_2">
<Variable SymbolicName="WorkingTime" BrowseName="WorkingTime" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,100]" Units="Count" />
</Component>
<Component Name="VacuumPump_3">
<Variable SymbolicName="WorkingTime" BrowseName="WorkingTime" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,100]" Units="Count" />
</Component>
<Component Name="VacuumPump_4">
<Variable SymbolicName="WorkingTime" BrowseName="WorkingTime" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,100]" Units="Count" />
</Component>
</Component>
<Component Name="Lubro">
<Component Name="Lube_1">
<Variable SymbolicName="Activations" BrowseName="Activations" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,1000]" Units="Count" />
<Variable SymbolicName="Empty" BrowseName="Empty" DataType="ua:Boolean" ValueRank="Scalar" GenerationRate="" Range="[0,1]" Units="Enumeration" />
</Component>
<Component Name="Lube_2">
<Variable SymbolicName="Activations" BrowseName="Activations" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[0,1000]" Units="Count" />
<Variable SymbolicName="Empty" BrowseName="Empty" DataType="ua:Boolean" ValueRank="Scalar" GenerationRate="" Range="[0,1]" Units="Enumeration" />
</Component>
</Component>
<Component Name="WorkingArea">
<Component Name="Area_1">
<Property SymbolicName="AreaID" BrowseName="AreaID" DataType="ua:String" ValueRank="Scalar" Value="A"/>
<Component Name="Program_1">
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" GenerationRate="" Range="[Progr1,Prog2,Prog3]" Units="Enumeration" />
<Variable SymbolicName="RepsLeft" BrowseName="RepsLeft" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[1,10]" Units="Enumeration" />
<Variable SymbolicName="RepsProgrammed" BrowseName="RepsProgrammed" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[12,12]" Units="Enumeration" />
<Variable SymbolicName="ProgramState" BrowseName="ProgramState" DataType="ua:String" ValueRank="Scalar" GenerationRate="" Range="[Exe,Loading,Alarm,Ready,Reserved]" Units="Enumeration" />
</Component>
</Component>
<Component Name="Area_2">
<Property SymbolicName="AreaID" BrowseName="AreaID" DataType="ua:String" ValueRank="Scalar" Value="A"/>
<Component Name="Program_1">
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" GenerationRate="" Range="[Progr1,Prog2,Prog3]" Units="Enumeration" />
<Variable SymbolicName="RepsLeft" BrowseName="RepsLeft" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[1,10]" Units="Enumeration" />
<Variable SymbolicName="RepsProgrammed" BrowseName="RepsProgrammed" DataType="ua:UInt32" ValueRank="Scalar" GenerationRate="" Range="[12,12]" Units="Enumeration" />
<Variable SymbolicName="ProgramState" BrowseName="ProgramState" DataType="ua:String" ValueRank="Scalar" GenerationRate="" Range="[Exe,Loading,Alarm,Ready,Reserved]" Units="Enumeration" />
</Component>
</Component>
</Component>
</Machine>
</ModelDesign>
+98 -102
View File
@@ -8,7 +8,7 @@
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>OpcUaServer.Server</RootNamespace> <RootNamespace>OpcUaServer.Server</RootNamespace>
<AssemblyName>OpcUaServer.Server</AssemblyName> <AssemblyName>OpcUaServer.Server</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
@@ -35,16 +35,16 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL"> <Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.5.2\lib\net40\BouncyCastle.Crypto.dll</HintPath> <HintPath>..\packages\Portable.BouncyCastle.1.8.5\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.AspNetCore.Connections.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.AspNetCore.Connections.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.Connections.Abstractions.3.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Connections.Abstractions.dll</HintPath> <HintPath>..\packages\Microsoft.AspNetCore.Connections.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Connections.Abstractions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.AspNetCore.Hosting, Version=2.2.7.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.AspNetCore.Hosting, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.Hosting.2.2.7\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.dll</HintPath> <HintPath>..\packages\Microsoft.AspNetCore.Hosting.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.AspNetCore.Hosting.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.Hosting.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll</HintPath> <HintPath>..\packages\Microsoft.AspNetCore.Hosting.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll</HintPath>
@@ -61,8 +61,8 @@
<Reference Include="Microsoft.AspNetCore.Http.Extensions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.AspNetCore.Http.Extensions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.Http.Extensions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Extensions.dll</HintPath> <HintPath>..\packages\Microsoft.AspNetCore.Http.Extensions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.AspNetCore.Http.Features, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.AspNetCore.Http.Features, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.Http.Features.3.0.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Features.dll</HintPath> <HintPath>..\packages\Microsoft.AspNetCore.Http.Features.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Features.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.AspNetCore.Server.Kestrel, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.AspNetCore.Server.Kestrel, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.Server.Kestrel.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.dll</HintPath> <HintPath>..\packages\Microsoft.AspNetCore.Server.Kestrel.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.dll</HintPath>
@@ -83,59 +83,56 @@
<Reference Include="Microsoft.AspNetCore.WebUtilities, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.AspNetCore.WebUtilities, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.WebUtilities.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.WebUtilities.dll</HintPath> <HintPath>..\packages\Microsoft.AspNetCore.WebUtilities.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.WebUtilities.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Configuration, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Configuration.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Configuration.Binder, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Configuration.Binder.2.2.4\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Configuration.Binder, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Configuration.EnvironmentVariables, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.Binder.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Configuration.EnvironmentVariables.2.2.4\lib\netstandard2.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Configuration.EnvironmentVariables, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Configuration.FileExtensions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.EnvironmentVariables.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Configuration.FileExtensions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.FileExtensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Configuration.FileExtensions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.DependencyInjection, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.FileExtensions.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.FileExtensions.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.2.2.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.3.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.FileProviders.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.3.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.FileProviders.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Abstractions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.FileProviders.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.FileProviders.Physical, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.FileProviders.Abstractions.3.0.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Abstractions.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.FileProviders.Physical.2.2.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Physical.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.FileProviders.Physical, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.FileProviders.Physical.3.0.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Physical.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.FileSystemGlobbing.2.2.0\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Hosting.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.FileSystemGlobbing.3.0.0\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Hosting.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Hosting.Abstractions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Hosting.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Logging, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Hosting.Abstractions.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Hosting.Abstractions.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Logging.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.ObjectPool, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.ObjectPool.2.2.0\lib\netstandard2.0\Microsoft.Extensions.ObjectPool.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.ObjectPool, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.ObjectPool.3.0.0\lib\netstandard2.0\Microsoft.Extensions.ObjectPool.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Options.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Options, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Options.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.PlatformAbstractions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.PlatformAbstractions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.PlatformAbstractions.1.1.0\lib\net451\Microsoft.Extensions.PlatformAbstractions.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.PlatformAbstractions.1.1.0\lib\net451\Microsoft.Extensions.PlatformAbstractions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Primitives, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Primitives, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Primitives.3.0.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath> <HintPath>..\packages\Microsoft.Extensions.Primitives.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Net.Http.Headers, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Net.Http.Headers, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Net.Http.Headers.2.2.0\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll</HintPath> <HintPath>..\packages\Microsoft.Net.Http.Headers.2.2.0\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll</HintPath>
@@ -144,25 +141,25 @@
<HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath> <HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="Opc.Ua.Client, Version=1.4.354.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL"> <Reference Include="Opc.Ua.Client, Version=1.4.355.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL">
<HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.354.23\lib\net46\Opc.Ua.Client.dll</HintPath> <HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.355.26\lib\net46\Opc.Ua.Client.dll</HintPath>
</Reference> </Reference>
<Reference Include="Opc.Ua.Configuration, Version=1.4.354.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL"> <Reference Include="Opc.Ua.Configuration, Version=1.4.355.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL">
<HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.354.23\lib\net46\Opc.Ua.Configuration.dll</HintPath> <HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.355.26\lib\net46\Opc.Ua.Configuration.dll</HintPath>
</Reference> </Reference>
<Reference Include="Opc.Ua.Core, Version=1.4.354.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL"> <Reference Include="Opc.Ua.Core, Version=1.4.355.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL">
<HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.354.23\lib\net46\Opc.Ua.Core.dll</HintPath> <HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.355.26\lib\net46\Opc.Ua.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Opc.Ua.Gds.Client.Common, Version=1.4.354.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL"> <Reference Include="Opc.Ua.Gds.Client.Common, Version=1.4.355.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL">
<HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.354.23\lib\net46\Opc.Ua.Gds.Client.Common.dll</HintPath> <HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.355.26\lib\net46\Opc.Ua.Gds.Client.Common.dll</HintPath>
</Reference> </Reference>
<Reference Include="Opc.Ua.Gds.Server.Common, Version=1.4.354.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL"> <Reference Include="Opc.Ua.Gds.Server.Common, Version=1.4.355.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL">
<HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.354.23\lib\net46\Opc.Ua.Gds.Server.Common.dll</HintPath> <HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.355.26\lib\net46\Opc.Ua.Gds.Server.Common.dll</HintPath>
</Reference> </Reference>
<Reference Include="Opc.Ua.Server, Version=1.4.354.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL"> <Reference Include="Opc.Ua.Server, Version=1.4.355.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8, processorArchitecture=MSIL">
<HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.354.23\lib\net46\Opc.Ua.Server.dll</HintPath> <HintPath>..\packages\OPCFoundation.NetStandard.Opc.Ua.1.4.355.26\lib\net46\Opc.Ua.Server.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@@ -172,8 +169,8 @@
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath> <HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Collections.Immutable, Version=1.2.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.6.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath> <HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Collections.NonGeneric, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Collections.NonGeneric, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.NonGeneric.4.3.0\lib\net46\System.Collections.NonGeneric.dll</HintPath> <HintPath>..\packages\System.Collections.NonGeneric.4.3.0\lib\net46\System.Collections.NonGeneric.dll</HintPath>
@@ -182,11 +179,10 @@
<HintPath>..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll</HintPath> <HintPath>..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.ComponentModel.Annotations.4.6.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath> <HintPath>..\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.ComponentModel.Composition" /> <Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Console, Version=4.0.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Console, Version=4.0.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Console.4.3.1\lib\net46\System.Console.dll</HintPath> <HintPath>..\packages\System.Console.4.3.1\lib\net46\System.Console.dll</HintPath>
<Private>True</Private> <Private>True</Private>
@@ -196,9 +192,8 @@
<Reference Include="System.Data.Common, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Data.Common, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.Common.4.3.0\lib\net451\System.Data.Common.dll</HintPath> <HintPath>..\packages\System.Data.Common.4.3.0\lib\net451\System.Data.Common.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Data.OracleClient" /> <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.3.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.5.1\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@@ -219,13 +214,12 @@
<Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath> <HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.IO.Pipelines, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.IO.Pipelines, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.4.6.0\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath> <HintPath>..\packages\System.IO.Pipelines.4.5.3\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath> <HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Net" />
<Reference Include="System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll</HintPath> <HintPath>..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private> <Private>True</Private>
@@ -254,20 +248,17 @@
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Private.ServiceModel, Version=4.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Reflection.DispatchProxy, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Private.ServiceModel.4.6.0\lib\netstandard2.0\System.Private.ServiceModel.dll</HintPath> <HintPath>..\packages\System.Reflection.DispatchProxy.4.5.1\lib\net461\System.Reflection.DispatchProxy.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Reflection.DispatchProxy, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Reflection.Metadata, Version=1.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.DispatchProxy.4.6.0\lib\net461\System.Reflection.DispatchProxy.dll</HintPath> <HintPath>..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Reflection.Metadata, Version=1.4.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Reflection.TypeExtensions, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.Metadata.1.7.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath> <HintPath>..\packages\System.Reflection.TypeExtensions.4.5.1\lib\net461\System.Reflection.TypeExtensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Reflection.TypeExtensions, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.TypeExtensions.4.6.0\lib\net461\System.Reflection.TypeExtensions.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath> <HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
@@ -280,10 +271,6 @@
<Reference Include="System.Runtime.Serialization.Xml, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.Serialization.Xml, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.Serialization.Xml.4.3.0\lib\net46\System.Runtime.Serialization.Xml.dll</HintPath> <HintPath>..\packages\System.Runtime.Serialization.Xml.4.3.0\lib\net46\System.Runtime.Serialization.Xml.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Security" />
<Reference Include="System.Security.AccessControl, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.AccessControl.4.6.0\lib\net461\System.Security.AccessControl.dll</HintPath>
</Reference>
<Reference Include="System.Security.Claims, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Security.Claims, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Claims.4.3.0\lib\net46\System.Security.Claims.dll</HintPath> <HintPath>..\packages\System.Security.Claims.4.3.0\lib\net46\System.Security.Claims.dll</HintPath>
</Reference> </Reference>
@@ -292,8 +279,8 @@
<Private>True</Private> <Private>True</Private>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Security.Cryptography.Cng, Version=4.3.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Security.Cryptography.Cng, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Cng.4.6.0\lib\net461\System.Security.Cryptography.Cng.dll</HintPath> <HintPath>..\packages\System.Security.Cryptography.Cng.4.5.0\lib\net461\System.Security.Cryptography.Cng.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath> <HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
@@ -306,27 +293,19 @@
<Private>True</Private> <Private>True</Private>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Security.Cryptography.Xml, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Security.Principal.Windows, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Xml.4.6.0\lib\net461\System.Security.Cryptography.Xml.dll</HintPath> <HintPath>..\packages\System.Security.Principal.Windows.4.5.1\lib\net461\System.Security.Principal.Windows.dll</HintPath>
</Reference>
<Reference Include="System.Security.Permissions, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Permissions.4.6.0\lib\net461\System.Security.Permissions.dll</HintPath>
</Reference>
<Reference Include="System.Security.Principal.Windows, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Principal.Windows.4.6.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.ServiceModel" /> <Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Primitives, Version=4.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.ServiceModel.Primitives, Version=4.5.0.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.ServiceModel.Primitives.4.6.0\lib\net461\System.ServiceModel.Primitives.dll</HintPath> <HintPath>..\packages\System.ServiceModel.Primitives.4.5.3\lib\net461\System.ServiceModel.Primitives.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.ServiceProcess" /> <Reference Include="System.Text.Encodings.Web, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<Reference Include="System.Text.Encodings.Web, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <HintPath>..\packages\System.Text.Encodings.Web.4.5.0\lib\netstandard2.0\System.Text.Encodings.Web.dll</HintPath>
<HintPath>..\packages\System.Text.Encodings.Web.4.6.0\lib\netstandard2.0\System.Text.Encodings.Web.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Transactions" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
@@ -341,7 +320,6 @@
<Reference Include="System.Xml.XmlDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Xml.XmlDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll</HintPath> <HintPath>..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll</HintPath>
</Reference> </Reference>
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs"> <Compile Include="..\SharedAssemblyInfo.cs">
@@ -370,15 +348,34 @@
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\XmlNodeParser.cs" /> <Compile Include="Services\XmlNodeParser.cs" />
<Compile Include="Windows\ServerDiagnosticsCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Windows\ServerDiagnosticsCtrl.Designer.cs">
<DependentUpon>ServerDiagnosticsCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Services\WindowsFormServerStarter.cs" />
<Compile Include="Windows\ExceptionDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\ExceptionDlg.Designer.cs">
<DependentUpon>ExceptionDlg.cs</DependentUpon>
</Compile>
<Compile Include="Windows\ServerForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\ServerForm.Designer.cs">
<DependentUpon>ServerForm.cs</DependentUpon>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
<None Include="CONF\DATA\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="CONF\DATA\TracciatoXmlCnc.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Server.Config.xml"> <Content Include="Server.Config.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
@@ -389,7 +386,6 @@
<Name>OpcUaCommon</Name> <Name>OpcUaCommon</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" /> <Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+35 -127
View File
@@ -4,30 +4,21 @@ using OpcUaCommon.Services;
using OpcUaServer.Server.Services; using OpcUaServer.Server.Services;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IdentityModel;
namespace OpcUaServer.Server namespace OpcUaServer.Server
{ {
public class Server : StandardServer public class Server : StandardServer
{ {
#region Private Fields
private readonly string _pathXml;
private readonly IPrinter _printer;
private readonly ServerAuthenticationService _serverAuthenticationService;
private ServerNodeManager _serverNodeManager; private ServerNodeManager _serverNodeManager;
private readonly IPrinter _printer;
#endregion Private Fields private readonly string _pathXml;
private readonly ServerAuthenticationService _serverAuthenticationService;
#region Public Fields
/// <summary> /// <summary>
/// Elenco dei nodi vietati ("P") per user non autenticati /// Evento richiesta refresh invio dellos tato attuale delel conditions
/// </summary> /// </summary>
public static List<string> NodeVetoList = new List<string>(); public event EventHandler eh_reqRefreshCondition;
#endregion Public Fields
#region Public Constructors
public Server(IPrinter printer, string pathXml) public Server(IPrinter printer, string pathXml)
{ {
@@ -36,53 +27,15 @@ namespace OpcUaServer.Server
_serverAuthenticationService = new ServerAuthenticationService(this); _serverAuthenticationService = new ServerAuthenticationService(this);
} }
#endregion Public Constructors public void SetNodeValue(string nodeName, object value)
#region Public Events
/// <summary>
/// Evento richiesta refresh invio dellos tato attuale delel conditions
/// </summary>
public event EventHandler eh_reqRefreshCondition;
#endregion Public Events
#region Private Methods
private void SessionManager_ImpersonateUser(Session session, ImpersonateEventArgs args)
{ {
// check for a user name token. _serverNodeManager.SetNodeValue(nodeName, value);
_printer.Print(">>>>> Server: Authentication for session starting");
switch (args.NewIdentity)
{
case UserNameIdentityToken userNameToken:
args.Identity =
_serverAuthenticationService.VerifyPassword(userNameToken,
LoadServerProperties().ProductUri);
_printer.Print(">>>>> Server: Authentication for session userNameToken Accepted: " + args.Identity.DisplayName);
break;
case X509IdentityToken x509Token:
_serverAuthenticationService.VerifyUserTokenCertificate(x509Token.Certificate,
LoadServerProperties().ProductUri);
args.Identity = new UserIdentity(x509Token);
_printer.Print(">>>>> Server: Authentication for session X509 Token Accepted: " +
args.Identity.DisplayName);
break;
default:
_printer.Print(">>>>> Server: Authentication for session Anonymous: ");
break;
}
// 2019.04.08: aggiunta task x forzare il refresh/reinvio di TUTTE le conditions attive al momento in cui si è connesso il NUOVO client...
sendCurrCond();
} }
#endregion Private Methods public void ReportEvent(string nodeName, string eventMessage, string severity, string value, bool active)
{
#region Protected Methods _serverNodeManager.ReportEvent(nodeName, eventMessage, severity, value, active);
}
protected override MasterNodeManager CreateMasterNodeManager(IServerInternal server, ApplicationConfiguration configuration) protected override MasterNodeManager CreateMasterNodeManager(IServerInternal server, ApplicationConfiguration configuration)
{ {
@@ -119,71 +72,33 @@ namespace OpcUaServer.Server
server.SessionManager.ImpersonateUser += SessionManager_ImpersonateUser; server.SessionManager.ImpersonateUser += SessionManager_ImpersonateUser;
} }
#endregion Protected Methods private void SessionManager_ImpersonateUser(Session session, ImpersonateEventArgs args)
#region Public Methods
public override ResponseHeader Browse(RequestHeader requestHeader, ViewDescription view, uint requestedMaxReferencesPerNode, BrowseDescriptionCollection nodesToBrowse, out BrowseResultCollection results, out DiagnosticInfoCollection diagnosticInfos)
{ {
results = null; // check for a user name token.
diagnosticInfos = null; _printer.Print(">>>>> Server: Authentication for session starting");
OperationContext context = ValidateRequest(requestHeader, RequestType.Browse); switch (args.NewIdentity)
{
case UserNameIdentityToken userNameToken:
args.Identity =
_serverAuthenticationService.VerifyPassword(userNameToken,
LoadServerProperties().ProductUri);
_printer.Print(">>>>> Server: Authentication for session userNameToken Accepted: " + args.Identity.DisplayName);
break;
case X509IdentityToken x509Token:
_serverAuthenticationService.VerifyUserTokenCertificate(x509Token.Certificate,
LoadServerProperties().ProductUri);
args.Identity = new UserIdentity(x509Token);
try _printer.Print(">>>>> Server: Authentication for session X509 Token Accepted: " +
{ args.Identity.DisplayName);
if (nodesToBrowse == null || nodesToBrowse.Count == 0) break;
{ default:
throw new ServiceResultException(StatusCodes.BadNothingToDo); _printer.Print(">>>>> Server: Authentication for session Anonymous: ");
break;
} }
// 2019.04.08: aggiunta task x forzare il refresh/reinvio di TUTTE le conditions attive al momento in cui si è connesso il NUOVO client...
bool filter = false; sendCurrCond();
// return empty browse results for Anonymous users
// This logic should be further extended....
if (context.UserIdentity.TokenType == UserTokenType.Anonymous)
filter = true;
// legge gli oggetti contenuti nell'elemento richeisto
ServerInternal.NodeManager.Browse(context, view, requestedMaxReferencesPerNode, nodesToBrowse, out results, out diagnosticInfos);
// se attivato il filtro == utente anonimo
if (filter)
{
foreach (var res in results)
{
// rimuove tutto tranne status...
//res.References.RemoveAll(x => x.BrowseName.Name.StartsWith("Machine/") && x.BrowseName.Name != "Machine/Status");
//res.References.RemoveAll(x => x.NodeClass == NodeClass.Variable && (x.BrowseName.Name.StartsWith("Machine/") && x.BrowseName.Name != "Machine/Status"));
res.References.RemoveAll(x => x.BrowseName.Name.StartsWith("Machine/") && NodeVetoList.Contains(x.BrowseName.Name));
}
}
return CreateResponse(requestHeader, context.StringTable);
}
catch (ServiceResultException e)
{
lock (ServerInternal.DiagnosticsWriteLock)
{
ServerInternal.ServerDiagnostics.RejectedRequestsCount++;
if (IsSecurityError(e.StatusCode))
{
ServerInternal.ServerDiagnostics.SecurityRejectedRequestsCount++;
}
}
throw TranslateException(context, e);
}
finally
{
OnRequestComplete(context);
}
}
public void ReportEvent(string nodeName, string eventMessage, string severity, string value, bool active)
{
_serverNodeManager.ReportEvent(nodeName, eventMessage, severity, value, active);
} }
public void sendCurrCond() public void sendCurrCond()
@@ -193,12 +108,5 @@ namespace OpcUaServer.Server
eh_reqRefreshCondition(this, new EventArgs()); eh_reqRefreshCondition(this, new EventArgs());
} }
} }
public void SetNodeValue(string nodeName, object value)
{
_serverNodeManager.SetNodeValue(nodeName, value);
}
#endregion Public Methods
} }
} }
+1 -33
View File
@@ -1,4 +1,5 @@
using OpcUaCommon.Services; using OpcUaCommon.Services;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Configuration; using System.Configuration;
using System.Threading; using System.Threading;
@@ -22,15 +23,10 @@ namespace OpcUaServer.Server
/// Dictionary dell'elenco delle condizioni passate dal server con ULTIMO stato disponibile (attiva/disattiva) /// Dictionary dell'elenco delle condizioni passate dal server con ULTIMO stato disponibile (attiva/disattiva)
/// </summary> /// </summary>
protected Dictionary<string, CondHelper> currConditions; protected Dictionary<string, CondHelper> currConditions;
/// <summary>
/// Elenco dei valori dei nodi (Property + Value)
/// </summary>
protected Dictionary<string, object> currNodeValues;
public ServerDecorator(IPrinter printer, string pathXml) public ServerDecorator(IPrinter printer, string pathXml)
{ {
currConditions = new Dictionary<string, CondHelper>(); currConditions = new Dictionary<string, CondHelper>();
currNodeValues = new Dictionary<string, object>();
Server = new Server(printer, pathXml); Server = new Server(printer, pathXml);
Server.eh_reqRefreshCondition += Server_eh_reqRefreshConditionAsync; Server.eh_reqRefreshCondition += Server_eh_reqRefreshConditionAsync;
// conf x tempo std resend... // conf x tempo std resend...
@@ -45,10 +41,7 @@ namespace OpcUaServer.Server
/// <param name="e"></param> /// <param name="e"></param>
public async void Server_eh_reqRefreshConditionAsync(object sender, System.EventArgs e) public async void Server_eh_reqRefreshConditionAsync(object sender, System.EventArgs e)
{ {
// attenzione con MQTT reinvia solo ULTIME VARIAZIONI ALLARMI (altri stati li considera come già inviati...)
await sendCurrentConditions(); await sendCurrentConditions();
// commentato invio valori on refresh che NON serve...
//await sendAllPropVal();
} }
public async Task<string> sendCurrentConditions() public async Task<string> sendCurrentConditions()
@@ -67,34 +60,9 @@ namespace OpcUaServer.Server
}); });
return answ; return answ;
} }
/// <summary>
/// Effettua refresh di TUTTI i nodi NON conditions (proprietà, valori)
/// </summary>
/// <returns></returns>
public async Task<string> sendAllPropVal()
{
string answ = "";
await Task.Run(() =>
{
Thread.Sleep(waitResendCondition);
foreach (var item in currNodeValues)
{
// invio con ReportEvent!
Server.SetNodeValue(item.Key, item.Value);
}
});
return answ;
}
public void SetNodeValue(string nodeName, object value) public void SetNodeValue(string nodeName, object value)
{ {
// se c'è elimino
if (currNodeValues.ContainsKey(nodeName))
{
currNodeValues.Remove(nodeName);
}
currNodeValues.Add(nodeName, value);
// faccio report valore!
Server.SetNodeValue(nodeName, value); Server.SetNodeValue(nodeName, value);
} }
@@ -0,0 +1,152 @@
using System;
using System.Collections.Generic;
using Opc.Ua;
using OpcUaServer.Server.Model;
namespace OpcUaServer.Server.Services
{
public class FakeNodeParser
{
public FolderInstanceState Parse(ServerNodeManager serverNodeManager, IList<IReference> externalReferences)
{
var folderInstanceState = new FolderInstanceState();
CreateRootFolder(externalReferences, serverNodeManager, folderInstanceState);
CreateChildernNodes(folderInstanceState, serverNodeManager);
return folderInstanceState;
}
private void CreateRootFolder(IList<IReference> references, ServerNodeManager serverNodeManager, FolderInstanceState folderInstanceState)
{
var root = CreateFolder(null, "CNC", "CNC", serverNodeManager);
root.AddReference(ReferenceTypes.Organizes, true, ObjectIds.ObjectsFolder);
references.Add(new NodeStateReference(ReferenceTypes.Organizes, false, root.NodeId));
root.EventNotifier = EventNotifiers.SubscribeToEvents;
//AddRootNotifier(root);
folderInstanceState.Folder = root;
}
private BaseDataVariableState CreateVariable(NodeState parent, string path, string name, BuiltInType dataType, int valueRank, ServerNodeManager serverNodeManager)
{
return CreateVariable(parent, path, name, (uint)dataType, valueRank, serverNodeManager);
}
private void CreateChildernNodes(FolderInstanceState folderInstanceState, ServerNodeManager serverNodeManager)
{
string actuatorFolderName = "Actuator";
FolderState actuatoirFolder = CreateFolder(folderInstanceState.Folder, "/" + actuatorFolderName, actuatorFolderName, serverNodeManager);
string lubrificationFolderName = "Lubrification";
var lubrificationFolder = CreateFolder(actuatoirFolder, lubrificationFolderName, lubrificationFolderName, serverNodeManager);
Dictionary<string, Opc.Ua.BuiltInType> nodes = new Dictionary<string, BuiltInType>();
nodes.Add("Lubro_01", BuiltInType.Int32);
nodes.Add("Lubro_01_status", BuiltInType.String);
foreach (var node in nodes)
{
folderInstanceState.Variables.Add(node.Key, CreateVariable(lubrificationFolder, "/" + actuatorFolderName + "/" + node.Key, node.Key, node.Value, ValueRanks.Any, serverNodeManager));
switch (node.Value)
{
case BuiltInType.Int32:
folderInstanceState.Variables[node.Key].Value = 0;
//_variables[node.Key].OnReadValue = OnReadMyInt32Node;
break;
case BuiltInType.Float:
break;
case BuiltInType.Double:
break;
case BuiltInType.String:
folderInstanceState.Variables[node.Key].Value = "Good";
//_variables[node.Key].OnReadValue = OnReadMyStringNode;
break;
case BuiltInType.DateTime:
break;
case BuiltInType.Variant:
break;
case BuiltInType.Number:
break;
case BuiltInType.Integer:
break;
default:
break;
}
;
}
}
/// <summary>
/// Creates a new variable.
/// </summary>
private BaseDataVariableState CreateVariable(NodeState parent, string path, string name, NodeId dataType, int valueRank, ServerNodeManager serverNodeManager)
{
BaseDataVariableState variable = new BaseDataVariableState(parent)
{
SymbolicName = name,
ReferenceTypeId = Opc.Ua.ReferenceTypes.Organizes,
TypeDefinitionId = VariableTypeIds.BaseDataVariableType,
NodeId = new NodeId(path, serverNodeManager.NamespaceIndex),
BrowseName = new QualifiedName(path, serverNodeManager.NamespaceIndex),
DisplayName = new LocalizedText("en", name),
WriteMask = AttributeWriteMask.DisplayName | AttributeWriteMask.Description,
UserWriteMask = AttributeWriteMask.DisplayName | AttributeWriteMask.Description,
DataType = dataType,
ValueRank = valueRank,
AccessLevel = AccessLevels.CurrentReadOrWrite,
UserAccessLevel = AccessLevels.CurrentReadOrWrite,
Historizing = false,
StatusCode = StatusCodes.Good,
Timestamp = DateTime.UtcNow
};
if (valueRank == ValueRanks.OneDimension)
{
variable.ArrayDimensions = new ReadOnlyList<uint>(new List<uint> { 0 });
}
else if (valueRank == ValueRanks.TwoDimensions)
{
variable.ArrayDimensions = new ReadOnlyList<uint>(new List<uint> { 0, 0 });
}
if (parent != null)
{
parent.AddChild(variable);
}
return variable;
}
private FolderState CreateFolder(NodeState parent, string path, string name, ServerNodeManager serverNodeManager)
{
var folder = new FolderState(parent)
{
SymbolicName = name,
ReferenceTypeId = ReferenceTypes.Organizes,
TypeDefinitionId = ObjectTypeIds.FolderType,
NodeId = new NodeId(path, serverNodeManager.NamespaceIndex),
BrowseName = new QualifiedName(path, serverNodeManager.NamespaceIndex),
DisplayName = new LocalizedText("en", name),
WriteMask = AttributeWriteMask.None,
UserWriteMask = AttributeWriteMask.None,
EventNotifier = EventNotifiers.None
};
parent?.AddChild(folder);
return folder;
}
public Dictionary<string, BaseDataVariableState> Parse(ServerNodeManager serverNodeManager, IList<IReference> externalReferences, Dictionary<string, BaseDataVariableState> variables)
{
throw new NotImplementedException();
}
}
}
@@ -1,37 +1,18 @@
using System; using System;
using System.Linq;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using Opc.Ua; using Opc.Ua;
using OpcUaCommon.Services;
namespace OpcUaServer.Server.Services namespace OpcUaServer.Server.Services
{ {
public class ServerAuthenticationService public class ServerAuthenticationService
{ {
#region Private Fields
private readonly Server _server; private readonly Server _server;
#endregion Private Fields
#region Public Constructors
public ServerAuthenticationService(Server server) public ServerAuthenticationService(Server server)
{ {
_server = server; _server = server;
} }
#endregion Public Constructors
#region Public Methods
public static string ReverseString(string s)
{
char[] array = s.ToCharArray();
Array.Reverse(array);
return new string(array);
}
public IUserIdentity VerifyPassword(UserNameIdentityToken userNameToken, string productUri) public IUserIdentity VerifyPassword(UserNameIdentityToken userNameToken, string productUri)
{ {
var userName = userNameToken.UserName; var userName = userNameToken.UserName;
@@ -56,16 +37,9 @@ namespace OpcUaServer.Server.Services
// return new SystemConfigurationIdentity(new UserIdentity(userNameToken)); // return new SystemConfigurationIdentity(new UserIdentity(userNameToken));
//} //}
// user / passphrase / pwd
// 9206 / 9206_6029 / lH01JCwOzgPG5zjl26p1qA==
// standard users for CTT verification // standard users for CTT verification
string passphrase = $"{userName}_{ReverseString(userName)}"; if ((userName == "user1" && password == "password") ||
//bool hashUser = CryptoUtils.validateUserPwd(userName, password, passphrase); (userName == "user2" && password == "password1")) return new UserIdentity(userNameToken);
//if ((userName == "scmAdmin" && password == "passwordDifficile"))
if (CryptoUtils.validateUserPwd(userName, password, passphrase))
return new UserIdentity(userNameToken);
// construct translation object with default text. // construct translation object with default text.
var info = new TranslationInfo( var info = new TranslationInfo(
"InvalidPassword", "InvalidPassword",
@@ -79,6 +53,7 @@ namespace OpcUaServer.Server.Services
"InvalidPassword", "InvalidPassword",
productUri, productUri,
new LocalizedText(info))); new LocalizedText(info)));
} }
public void VerifyUserTokenCertificate(X509Certificate2 certificate, string productUri) public void VerifyUserTokenCertificate(X509Certificate2 certificate, string productUri)
@@ -129,6 +104,5 @@ namespace OpcUaServer.Server.Services
} }
} }
#endregion Public Methods
} }
} }
@@ -155,9 +155,7 @@ namespace OpcUaServer.Server.Services
node.ConditionName.Value = value; node.ConditionName.Value = value;
node.Time.Value = DateTime.UtcNow; node.Time.Value = DateTime.UtcNow;
node.ReceiveTime.Value = node.Time.Value; node.ReceiveTime.Value = node.Time.Value;
node.LocalTime.Value = Utils.GetTimeZoneInfo();
// 2019.08.07 commentato che si pianta
//node.LocalTime.Value = Utils.GetTimeZoneInfo();
// 2019.03.23 imposto forzatamente retain del valore // 2019.03.23 imposto forzatamente retain del valore
node.EventId.Value = Guid.NewGuid().ToByteArray(); node.EventId.Value = Guid.NewGuid().ToByteArray();
@@ -0,0 +1,36 @@
using System;
using System.Windows.Forms;
using Opc.Ua.Configuration;
using OpcUaServer.Server.OpcUa;
using OpcUaServer.Server.Windows;
namespace OpcUaServer.Server.Services
{
public class WindowsFormServerStarter : IServerStarter
{
private readonly ApplicationInstanceBuilder _applicationInstanceBuilder;
public WindowsFormServerStarter(ApplicationInstanceBuilder applicationInstanceBuilder)
{
_applicationInstanceBuilder = applicationInstanceBuilder;
}
public void Start()
{
var application = _applicationInstanceBuilder.Build(null);
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
ApplicationInstance.MessageDlg = new ApplicationMessageDlg();
Application.Run(new ServerForm(application));
}
catch (Exception e)
{
ExceptionDlg.Show(application.ApplicationName, e);
}
}
}
}
+216 -252
View File
@@ -10,49 +10,46 @@ namespace OpcUaServer.Server.Services
{ {
public class XmlNodeParser : INodeParser public class XmlNodeParser : INodeParser
{ {
#region Public Properties public FolderInstanceState Parse(SystemContext systemContext, IEnumerable<ushort> namespaceIndexes, IList<IReference> externalReferences, string pathXml)
public Server Server { get; }
#endregion Public Properties
#region Private Methods
private static int GetValueRankFromString(string valueRank)
{ {
var returnValue = 0; var treeInstance = new FolderInstanceState();
switch (valueRank) var xmlDocument = new XmlDocument();
{ xmlDocument.Load(pathXml);
case "Scalar":
returnValue = ValueRanks.Scalar;
break;
default: var itemRef = xmlDocument.GetElementsByTagName("Machine");
break;
var rootFolder = CreateRootFolder(itemRef, externalReferences, treeInstance, namespaceIndexes.ToArray().First());
treeInstance.Folder = rootFolder;
foreach (var baseDataVariableState in treeInstance.Variables)
{
Console.WriteLine("NODE PATH >>>> CHIAVE {0}", baseDataVariableState.Key);
}
return treeInstance;
} }
return returnValue; private FolderState CreateRootFolder(XmlNodeList itemRef, ICollection<IReference> externalReferences, FolderInstanceState treeInstance, ushort nameSpaceIndex)
{
var rootName = "Machine";
var root = CreateFolder(null, rootName, rootName, null, null, treeInstance, nameSpaceIndex);
root.AddReference(ReferenceTypes.Organizes, true, ObjectIds.ObjectsFolder);
externalReferences.Add(new NodeStateReference(ReferenceTypes.Organizes, false, root.NodeId));
root.EventNotifier = EventNotifiers.SubscribeToEvents;
var xmlNodeList = itemRef[0]?.ChildNodes;
if (xmlNodeList == null)
{
return root;
} }
private void AddCondition(FolderInstanceState treeInstance, ushort nameSpaceIndex, XmlNode component, foreach (XmlElement xmlElement in xmlNodeList)
string rootName, FolderState root)
{ {
if (component == null || component.Attributes == null) AddNode(treeInstance, nameSpaceIndex, rootName, root, xmlElement);
{
return;
} }
var varName = component.Attributes["BrowseName"].Value; return root;
var symbolicName = component.Attributes["SymbolicName"].Value;
var bName = rootName + "/" + symbolicName;
var baseObjectState = CreateCondition(root, bName, symbolicName, varName, component.Attributes["Type"].Value,
nameSpaceIndex);
treeInstance.Variables.Add(bName,
baseObjectState);
// verifico se l'elemento sia di quelli permessi --> metto in lista...
string VGroup = component.Attributes["VGroup"]?.Value ?? "A";
checkVisibGroup(VGroup, bName);
} }
private void AddEvent(FolderInstanceState treeInstance, ushort nameSpaceIndex, XmlNode component, string rootName, FolderState root) private void AddEvent(FolderInstanceState treeInstance, ushort nameSpaceIndex, XmlNode component, string rootName, FolderState root)
@@ -68,116 +65,31 @@ namespace OpcUaServer.Server.Services
CreateEvent(root, rootName + "/" + symbolicName, symbolicName, varName, nameSpaceIndex)); CreateEvent(root, rootName + "/" + symbolicName, symbolicName, varName, nameSpaceIndex));
} }
private void AddNode(FolderInstanceState folderInstanceState, ushort nameSpaceIndex, string stringFolderName, private BaseObjectState CreateEvent(NodeState parent, string path, string symbolicName, string name, ushort nameSpaceIndex)
FolderState folder, XmlElement xmlElement)
{ {
if (xmlElement.Name != "Component" && xmlElement.Name != "Conditions") var variable = new SystemEventState(parent)
{ {
switch (xmlElement.Name) SymbolicName = symbolicName,
{ Description = name,
case "Property": ReferenceTypeId = Opc.Ua.ReferenceTypes.HasEventSource,
AddProperty(folder, xmlElement, stringFolderName, nameSpaceIndex, folderInstanceState); TypeDefinitionId = ObjectTypeIds.SystemEventType,
break; NodeId = new NodeId(path, nameSpaceIndex),
BrowseName = new QualifiedName(path, nameSpaceIndex),
DisplayName = new LocalizedText("en", symbolicName),
WriteMask = AttributeWriteMask.None,
UserWriteMask = AttributeWriteMask.None,
EventNotifier = EventNotifiers.SubscribeToEvents
};
case "Condition": parent?.AddChild(variable);
AddCondition(folderInstanceState, nameSpaceIndex, xmlElement, stringFolderName, folder);
break;
default: return variable;
AddVariable(folderInstanceState, nameSpaceIndex, xmlElement, stringFolderName, folder);
break;
}
}
else
{
var varName = xmlElement.Attributes["Name"].Value;
if (xmlElement.Name == "Conditions")
{
//CreateConditions(folder, stringFolderName + "/" + varName, varName, xmlElement, stringFolderName, folderInstanceState, nameSpaceIndex);
}
else
{
CreateFolder(folder, stringFolderName + "/" + varName, varName, xmlElement, stringFolderName, folderInstanceState, nameSpaceIndex);
} }
// verifico se l'elemento sia di quelli permessi --> metto in lista...
string VGroup = xmlElement.Attributes["VGroup"]?.Value ?? "A";
string bName = stringFolderName + "/" + varName;
checkVisibGroup(VGroup, bName);
}
}
private void AddProperty(BaseObjectState parent, XmlNode component, string rootName, ushort nameSpaceIndex, private void AddCondition(FolderInstanceState treeInstance, ushort nameSpaceIndex, XmlNode component,
FolderInstanceState treeInstance)
{
if (component.Attributes == null)
{
return;
}
PropertyState propertyState;
switch (component.Attributes["DataType"].Value)
{
case "ua:UInt32":
propertyState = parent.AddProperty<int>(component.Attributes["SymbolicName"].Value,
DataTypeIds.Int32, ValueRanks.Scalar);
break;
case "ua:Double":
propertyState = parent.AddProperty<double>(component.Attributes["SymbolicName"].Value,
DataTypeIds.Double, ValueRanks.Scalar);
break;
case "ua:Float":
propertyState = parent.AddProperty<float>(component.Attributes["SymbolicName"].Value,
DataTypeIds.Float, ValueRanks.Scalar);
break;
case "ua:String":
propertyState = parent.AddProperty<string>(component.Attributes["SymbolicName"].Value,
DataTypeIds.String, ValueRanks.Scalar);
break;
case "ua:DateTime":
propertyState = parent.AddProperty<DateTime>(component.Attributes["SymbolicName"].Value,
DataTypeIds.DateTime, ValueRanks.Scalar);
break;
case "ua:Boolean":
propertyState = parent.AddProperty<bool>(component.Attributes["SymbolicName"].Value,
DataTypeIds.Boolean, ValueRanks.Scalar);
break;
default:
propertyState = parent.AddProperty<string>(component.Attributes["SymbolicName"].Value,
DataTypeIds.String, ValueRanks.Scalar);
break;
}
propertyState.Value = component.Attributes["Value"].Value;
propertyState.NodeId = new NodeId(rootName + "/" + component.Attributes["SymbolicName"].Value, nameSpaceIndex);
propertyState.BrowseName = rootName + "/" + component.Attributes["SymbolicName"].Value;
propertyState.TypeDefinitionId = VariableTypeIds.PropertyType;
var bName = propertyState.BrowseName.Name;
var type = propertyState.DataType;
var rank = propertyState.ValueRank;
treeInstance.Variables.Add(bName,
CreateVariable(parent, bName, bName, bName, type, rank,
nameSpaceIndex));
// verifico se l'elemento sia di quelli permessi --> metto in lista...
string VGroup = component.Attributes["VGroup"]?.Value ?? "A";
checkVisibGroup(VGroup, bName);
}
private void AddVariable(FolderInstanceState treeInstance, ushort nameSpaceIndex, XmlNode component,
string rootName, FolderState root) string rootName, FolderState root)
{ {
//Eventi e variabili
if (component == null || component.Attributes == null) if (component == null || component.Attributes == null)
{ {
return; return;
@@ -185,32 +97,18 @@ namespace OpcUaServer.Server.Services
var varName = component.Attributes["BrowseName"].Value; var varName = component.Attributes["BrowseName"].Value;
var symbolicName = component.Attributes["SymbolicName"].Value; var symbolicName = component.Attributes["SymbolicName"].Value;
var dataType = component.Attributes["DataType"].Value; var baseObjectState = CreateCondition(root, rootName + "/" + symbolicName, symbolicName, varName, component.Attributes["Type"].Value,
var valueRank = component.Attributes["ValueRank"].Value;
var builtInType = (uint)GetBuiltInTypeFromString(dataType);
var valueRankFromString = GetValueRankFromString(valueRank);
var bName = rootName + "/" + symbolicName;
var baseDataVariableState = CreateVariable(root, bName, symbolicName, varName, builtInType, valueRankFromString,
nameSpaceIndex); nameSpaceIndex);
treeInstance.Variables.Add(bName,
baseDataVariableState);
// verifico se l'elemento sia di quelli permessi --> metto in lista... treeInstance.Variables.Add(rootName + "/" + symbolicName,
string VGroup = component.Attributes["VGroup"]?.Value ?? "A"; baseObjectState);
checkVisibGroup(VGroup, bName);
} }
private void checkVisibGroup(string VGroup, string BrowseName)
{
if (VGroup != "A")
{
Server.NodeVetoList.Add(BrowseName);
}
}
private BaseObjectState CreateCondition(NodeState parent, string path, string symbolicName, string name, string conditiontype, ushort nameSpaceIndex) private BaseObjectState CreateCondition(NodeState parent, string path, string symbolicName, string name, string conditiontype, ushort nameSpaceIndex)
{ {
var node = new BaseObjectState(parent) var node = new BaseObjectState(parent)
{ {
SymbolicName = symbolicName, SymbolicName = symbolicName,
@@ -269,29 +167,34 @@ namespace OpcUaServer.Server.Services
//node.SourceName.Value = path; //node.SourceName.Value = path;
return node; return node;
} }
private BaseObjectState CreateEvent(NodeState parent, string path, string symbolicName, string name, ushort nameSpaceIndex)
{
var variable = new SystemEventState(parent)
{
SymbolicName = symbolicName,
Description = name,
ReferenceTypeId = Opc.Ua.ReferenceTypes.HasEventSource,
TypeDefinitionId = ObjectTypeIds.SystemEventType,
NodeId = new NodeId(path, nameSpaceIndex),
BrowseName = new QualifiedName(path, nameSpaceIndex),
DisplayName = new LocalizedText("en", symbolicName),
WriteMask = AttributeWriteMask.None,
UserWriteMask = AttributeWriteMask.None,
EventNotifier = EventNotifiers.SubscribeToEvents
};
parent?.AddChild(variable); private void AddVariable(FolderInstanceState treeInstance, ushort nameSpaceIndex, XmlNode component,
string rootName, FolderState root)
{
//Eventi e variabili
return variable; if (component == null || component.Attributes == null)
{
return;
} }
var varName = component.Attributes["BrowseName"].Value;
var symbolicName = component.Attributes["SymbolicName"].Value;
var dataType = component.Attributes["DataType"].Value;
var valueRank = component.Attributes["ValueRank"].Value;
var builtInType = (uint)GetBuiltInTypeFromString(dataType);
var valueRankFromString = GetValueRankFromString(valueRank);
var baseDataVariableState = CreateVariable(root, rootName + "/" + symbolicName, symbolicName, varName, builtInType, valueRankFromString,
nameSpaceIndex);
treeInstance.Variables.Add(rootName + "/" + symbolicName,
baseDataVariableState);
}
private FolderState CreateFolder(NodeState parent, string path, string name, IEnumerable component, private FolderState CreateFolder(NodeState parent, string path, string name, IEnumerable component,
string stringNome, FolderInstanceState folderInstanceState, ushort nameSpaceIndex) string stringNome, FolderInstanceState folderInstanceState, ushort nameSpaceIndex)
{ {
@@ -310,6 +213,8 @@ namespace OpcUaServer.Server.Services
//EventNotifier = EventNotifiers.SubscribeToEvents //EventNotifier = EventNotifiers.SubscribeToEvents
}; };
parent?.AddChild(folder); parent?.AddChild(folder);
if (component == null) if (component == null)
{ {
@@ -324,29 +229,156 @@ namespace OpcUaServer.Server.Services
return folder; return folder;
} }
private FolderState CreateRootFolder(XmlNodeList itemRef, ICollection<IReference> externalReferences, FolderInstanceState treeInstance, ushort nameSpaceIndex) //private FolderState CreateConditions(NodeState parent, string path, string name, IEnumerable component, string stringNome, FolderInstanceState folderInstanceState, ushort nameSpaceIndex)
{ //{
var rootName = "Machine"; // FolderState folder = CreateFolder(parent, path+ "/" + name, name, component, stringNome, folderInstanceState, nameSpaceIndex);
var root = CreateFolder(null, rootName, rootName, null, null, treeInstance, nameSpaceIndex); // folder.ReferenceTypeId = ReferenceTypeIds.HasNotifier;
// ((FolderState)parent).ReferenceTypeId = ReferenceTypeIds.HasNotifier;
// return folder;
//}
root.AddReference(ReferenceTypes.Organizes, true, ObjectIds.ObjectsFolder); private void AddNode(FolderInstanceState folderInstanceState, ushort nameSpaceIndex, string stringFolderName,
externalReferences.Add(new NodeStateReference(ReferenceTypes.Organizes, false, root.NodeId)); FolderState folder, XmlElement xmlElement)
root.EventNotifier = EventNotifiers.SubscribeToEvents;
var xmlNodeList = itemRef[0]?.ChildNodes;
if (xmlNodeList == null)
{ {
return root; if (xmlElement.Name != "Component" && xmlElement.Name != "Conditions")
{
switch (xmlElement.Name)
{
case "Property":
AddProperty(folder, xmlElement, stringFolderName, nameSpaceIndex, folderInstanceState);
break;
//case "Event":
// AddEvent(folderInstanceState, nameSpaceIndex, xmlElement, stringFolderName, folder);
// break;
case "Condition":
AddCondition(folderInstanceState, nameSpaceIndex, xmlElement, stringFolderName, folder);
break;
default:
AddVariable(folderInstanceState, nameSpaceIndex, xmlElement, stringFolderName, folder);
break;
}
}
else
{
var varName = xmlElement.Attributes["Name"].Value;
if (xmlElement.Name == "Conditions")
{
//CreateConditions(folder, stringFolderName + "/" + varName, varName, xmlElement, stringFolderName, folderInstanceState, nameSpaceIndex);
}
else
{
CreateFolder(folder, stringFolderName + "/" + varName, varName, xmlElement, stringFolderName, folderInstanceState, nameSpaceIndex);
}
}
} }
foreach (XmlElement xmlElement in xmlNodeList) public static BuiltInType GetBuiltInTypeFromString(string dataType)
{ {
AddNode(treeInstance, nameSpaceIndex, rootName, root, xmlElement); var returnValue = BuiltInType.Null;
switch (dataType)
{
case "ua:UInt32":
returnValue = BuiltInType.UInt32;
break;
case "ua:Double":
returnValue = BuiltInType.Double;
break;
case "ua:Float":
returnValue = BuiltInType.Float;
break;
case "ua:String":
returnValue = BuiltInType.String;
break;
case "ua:DateTime":
returnValue = BuiltInType.DateTime;
break;
case "ua:Boolean":
returnValue = BuiltInType.Boolean;
break;
default:
break;
} }
return root; return returnValue;
} }
private void AddProperty(BaseObjectState parent, XmlNode component, string rootName, ushort nameSpaceIndex,
FolderInstanceState treeInstance)
{
if (component.Attributes == null)
{
return;
}
PropertyState propertyState;
switch (component.Attributes["DataType"].Value)
{
case "ua:UInt32":
propertyState = parent.AddProperty<int>(component.Attributes["SymbolicName"].Value,
DataTypeIds.Int32, ValueRanks.Scalar);
break;
case "ua:Double":
propertyState = parent.AddProperty<double>(component.Attributes["SymbolicName"].Value,
DataTypeIds.Double, ValueRanks.Scalar);
break;
case "ua:Float":
propertyState = parent.AddProperty<float>(component.Attributes["SymbolicName"].Value,
DataTypeIds.Float, ValueRanks.Scalar);
break;
case "ua:String":
propertyState = parent.AddProperty<string>(component.Attributes["SymbolicName"].Value,
DataTypeIds.String, ValueRanks.Scalar);
break;
case "ua:DateTime":
propertyState = parent.AddProperty<DateTime>(component.Attributes["SymbolicName"].Value,
DataTypeIds.DateTime, ValueRanks.Scalar);
break;
case "ua:Boolean":
propertyState = parent.AddProperty<bool>(component.Attributes["SymbolicName"].Value,
DataTypeIds.Boolean, ValueRanks.Scalar);
break;
default:
propertyState = parent.AddProperty<string>(component.Attributes["SymbolicName"].Value,
DataTypeIds.String, ValueRanks.Scalar);
break;
}
propertyState.Value = component.Attributes["Value"].Value;
propertyState.NodeId = new NodeId(rootName + "/" + component.Attributes["SymbolicName"].Value, nameSpaceIndex);
propertyState.BrowseName = rootName + "/" + component.Attributes["SymbolicName"].Value;
propertyState.TypeDefinitionId = VariableTypeIds.PropertyType;
var bName = propertyState.BrowseName.Name;
var type = propertyState.DataType;
var rank = propertyState.ValueRank;
treeInstance.Variables.Add(bName,
CreateVariable(parent, bName, bName, bName, type, rank,
nameSpaceIndex));
}
private static int GetValueRankFromString(string valueRank)
{
var returnValue = 0;
switch (valueRank)
{
case "Scalar":
returnValue = ValueRanks.Scalar;
break;
default:
break;
}
return returnValue;
}
private BaseDataVariableState CreateVariable(NodeState parent, string path, string symbolicName, string name, NodeId dataType, int valueRank, ushort nameSpaceIndex) private BaseDataVariableState CreateVariable(NodeState parent, string path, string symbolicName, string name, NodeId dataType, int valueRank, ushort nameSpaceIndex)
{ {
var variable = new BaseDataVariableState(parent) var variable = new BaseDataVariableState(parent)
@@ -373,11 +405,9 @@ namespace OpcUaServer.Server.Services
case ValueRanks.OneDimension: case ValueRanks.OneDimension:
variable.ArrayDimensions = new ReadOnlyList<uint>(new List<uint> { 0 }); variable.ArrayDimensions = new ReadOnlyList<uint>(new List<uint> { 0 });
break; break;
case ValueRanks.TwoDimensions: case ValueRanks.TwoDimensions:
variable.ArrayDimensions = new ReadOnlyList<uint>(new List<uint> { 0, 0 }); variable.ArrayDimensions = new ReadOnlyList<uint>(new List<uint> { 0, 0 });
break; break;
default: default:
break; break;
} }
@@ -386,72 +416,6 @@ namespace OpcUaServer.Server.Services
return variable; return variable;
} }
#endregion Private Methods
#region Public Methods
//private FolderState CreateConditions(NodeState parent, string path, string name, IEnumerable component, string stringNome, FolderInstanceState folderInstanceState, ushort nameSpaceIndex)
//{
// FolderState folder = CreateFolder(parent, path+ "/" + name, name, component, stringNome, folderInstanceState, nameSpaceIndex);
// folder.ReferenceTypeId = ReferenceTypeIds.HasNotifier;
// ((FolderState)parent).ReferenceTypeId = ReferenceTypeIds.HasNotifier;
// return folder;
//}
public static BuiltInType GetBuiltInTypeFromString(string dataType)
{
var returnValue = BuiltInType.Null;
switch (dataType)
{
case "ua:UInt32":
returnValue = BuiltInType.UInt32;
break;
case "ua:Double":
returnValue = BuiltInType.Double;
break;
case "ua:Float":
returnValue = BuiltInType.Float;
break;
case "ua:String":
returnValue = BuiltInType.String;
break;
case "ua:DateTime":
returnValue = BuiltInType.DateTime;
break;
case "ua:Boolean":
returnValue = BuiltInType.Boolean;
break;
default:
break;
} }
return returnValue;
}
public FolderInstanceState Parse(SystemContext systemContext, IEnumerable<ushort> namespaceIndexes, IList<IReference> externalReferences, string pathXml)
{
var treeInstance = new FolderInstanceState();
var xmlDocument = new XmlDocument();
xmlDocument.Load(pathXml);
var itemRef = xmlDocument.GetElementsByTagName("Machine");
var rootFolder = CreateRootFolder(itemRef, externalReferences, treeInstance, namespaceIndexes.ToArray().First());
treeInstance.Folder = rootFolder;
foreach (var baseDataVariableState in treeInstance.Variables)
{
Console.WriteLine("NODE PATH >>>> CHIAVE {0}", baseDataVariableState.Key);
}
return treeInstance;
}
#endregion Public Methods
}
} }
+124
View File
@@ -0,0 +1,124 @@
using System.Windows.Forms;
namespace OpcUaServer.Server.Windows
{
partial class ExceptionDlg
{
/// <summary>
/// Variabile di progettazione necessaria.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Pulire le risorse in uso.
/// </summary>
/// <param name="disposing">ha valore true se le risorse gestite devono essere eliminate, false in caso contrario.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Codice generato da Progettazione componenti
/// <summary>
/// Metodo necessario per il supporto della finestra di progettazione. Non modificare
/// il contenuto del metodo con l'editor di codice.
/// </summary>
private void InitializeComponent()
{
this.BottomPN = new System.Windows.Forms.Panel();
this.ShowStackTracesCK = new System.Windows.Forms.CheckBox();
this.CloseBTN = new System.Windows.Forms.Button();
this.MainPN = new System.Windows.Forms.Panel();
this.ExceptionBrowser = new System.Windows.Forms.WebBrowser();
this.BottomPN.SuspendLayout();
this.MainPN.SuspendLayout();
this.SuspendLayout();
//
// BottomPN
//
this.BottomPN.Controls.Add(this.ShowStackTracesCK);
this.BottomPN.Controls.Add(this.CloseBTN);
this.BottomPN.Dock = System.Windows.Forms.DockStyle.Bottom;
this.BottomPN.Location = new System.Drawing.Point(0, 181);
this.BottomPN.Name = "BottomPN";
this.BottomPN.Size = new System.Drawing.Size(780, 29);
this.BottomPN.TabIndex = 1;
//
// ShowStackTracesCK
//
this.ShowStackTracesCK.AutoSize = true;
this.ShowStackTracesCK.Location = new System.Drawing.Point(3, 7);
this.ShowStackTracesCK.Name = "ShowStackTracesCK";
this.ShowStackTracesCK.Size = new System.Drawing.Size(138, 17);
this.ShowStackTracesCK.TabIndex = 1;
this.ShowStackTracesCK.Text = "Show Exception Details";
this.ShowStackTracesCK.UseVisualStyleBackColor = true;
this.ShowStackTracesCK.CheckedChanged += new System.EventHandler(this.ShowStackTracesCK_CheckedChanged);
//
// CloseBTN
//
this.CloseBTN.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.CloseBTN.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CloseBTN.Location = new System.Drawing.Point(353, 3);
this.CloseBTN.Name = "CloseBTN";
this.CloseBTN.Size = new System.Drawing.Size(75, 23);
this.CloseBTN.TabIndex = 0;
this.CloseBTN.Text = "Close";
this.CloseBTN.UseVisualStyleBackColor = true;
//
// MainPN
//
this.MainPN.AutoSize = true;
this.MainPN.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.MainPN.Controls.Add(this.ExceptionBrowser);
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.Location = new System.Drawing.Point(0, 0);
this.MainPN.Name = "MainPN";
this.MainPN.Size = new System.Drawing.Size(780, 181);
this.MainPN.TabIndex = 1;
//
// ExceptionBrowser
//
this.ExceptionBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
this.ExceptionBrowser.Location = new System.Drawing.Point(0, 0);
this.ExceptionBrowser.MinimumSize = new System.Drawing.Size(20, 20);
this.ExceptionBrowser.Name = "ExceptionBrowser";
this.ExceptionBrowser.ScriptErrorsSuppressed = true;
this.ExceptionBrowser.Size = new System.Drawing.Size(780, 181);
this.ExceptionBrowser.TabIndex = 1;
//
// ExceptionDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.ClientSize = new System.Drawing.Size(780, 210);
this.Controls.Add(this.MainPN);
this.Controls.Add(this.BottomPN);
this.MaximumSize = new System.Drawing.Size(4096, 4096);
this.Name = "ExceptionDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Exception";
this.BottomPN.ResumeLayout(false);
this.BottomPN.PerformLayout();
this.MainPN.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Panel BottomPN;
private System.Windows.Forms.Button CloseBTN;
private System.Windows.Forms.Panel MainPN;
private System.Windows.Forms.WebBrowser ExceptionBrowser;
private System.Windows.Forms.CheckBox ShowStackTracesCK;
public FormStartPosition StartPosition { get; private set; }
}
}
@@ -0,0 +1,185 @@
using System;
using System.Text;
using System.Windows.Forms;
using Opc.Ua;
namespace OpcUaServer.Server.Windows
{
public partial class ExceptionDlg : Form
{
public ExceptionDlg()
{
InitializeComponent();
}
private Exception m_exception;
/// <summary>
/// Replaces all special characters in the message.
/// </summary>
private string ReplaceSpecialCharacters(string message)
{
message = message.Replace("&", "&#38;");
message = message.Replace("<", "&lt;");
message = message.Replace(">", "&gt;");
message = message.Replace("\"", "&#34;");
message = message.Replace("'", "&#39;");
message = message.Replace("\r\n", "<br/>");
return message;
}
private void AddBlock(StringBuilder buffer, string text)
{
AddBlock(buffer, text, 0);
}
private void AddBlock(StringBuilder buffer, string text, int level)
{
if (!String.IsNullOrEmpty(text))
{
if (level > 0)
{
if (level == 1)
{
buffer.Append("<tr style='background-color:#990000;");
}
else if (level == 2)
{
buffer.Append("<tr style='background-color:#CC6600;");
}
else
{
buffer.Append("<tr style='background-color:#999999;");
}
buffer.Append("color:#FFFFFF;font-weight:bold;font-size:10pt;font-family:Verdana'><td>");
buffer.Append("<p>");
}
else
{
buffer.Append("<tr style='font-size:10pt;font-family:Verdana'><td>");
buffer.Append("<p>");
}
buffer.Append(ReplaceSpecialCharacters(text));
buffer.Append("</p>");
buffer.Append("</td></tr>");
}
}
private void Add(StringBuilder buffer, Exception e, bool showStackTrace)
{
AddBlock(buffer, "EXCEPTION (" + e.GetType().Name + ")", 1);
AddBlock(buffer, e.Message);
ServiceResultException sre = e as ServiceResultException;
if (sre != null)
{
ServiceResult sr = new ServiceResult(sre);
while (sr != null)
{
AddBlock(buffer, "SERVICE RESULT (" + new StatusCode(sr.Code).ToString() + ")", 2);
string text = (sr.LocalizedText != null) ? sr.LocalizedText.Text : null;
if (text != e.Message)
{
AddBlock(buffer, text);
}
AddBlock(buffer, sr.SymbolicId);
AddBlock(buffer, sr.NamespaceUri);
if (showStackTrace)
{
if (!String.IsNullOrEmpty(sre.AdditionalInfo))
{
AddBlock(buffer, "ADDITIONAL INFO (" + new StatusCode(sr.Code).ToString() + ")", 3);
AddBlock(buffer, sre.AdditionalInfo);
}
}
sr = sr.InnerResult;
}
}
if (showStackTrace)
{
AddBlock(buffer, "STACK TRACE", 3);
AddBlock(buffer, e.StackTrace);
}
}
private void Show(bool showStackTrace)
{
StringBuilder buffer = new StringBuilder();
buffer.Append("<html><body style='margin:0;width:100%'>");
//buffer.Append(ExceptionBrowser.Parent.Width);
//buffer.Append("px'>");
buffer.Append("<table border='1' style='width:100%'>");
Exception e = m_exception;
while (e != null)
{
Add(buffer, e, showStackTrace);
e = e.InnerException;
}
buffer.Append("</table>");
buffer.Append("</body></html>");
ExceptionBrowser.DocumentText = buffer.ToString();
}
/// <summary>
/// Displays the exception in a dialog.
/// </summary>
public static void Show(string caption, Exception e)
{
// check if running as a service.
if (!Environment.UserInteractive)
{
Utils.Trace(e, "Unexpected error in '{0}'.", caption);
return;
}
new ExceptionDlg().ShowDialog(caption, e);
}
/// <summary>
/// Display the exception in the dialog.
/// </summary>
public void ShowDialog(string caption, Exception e)
{
if (!String.IsNullOrEmpty(caption))
{
Text = caption;
}
m_exception = e;
ShowStackTracesCK.Checked = true;
//True in DEBUG
//ShowStackTracesCK.Checked = false;
Show(ShowStackTracesCK.Checked);
ShowDialog();
}
private void OkButton_Click(object sender, EventArgs e)
{
Close();
}
private void ShowStackTracesCK_CheckedChanged(object sender, EventArgs e)
{
Show(ShowStackTracesCK.Checked);
}
}
}
@@ -0,0 +1,359 @@
namespace OpcUaServer.Server
{
partial class ServerDiagnosticsCtrl
{
/// <summary>
/// Variabile di progettazione necessaria.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Pulire le risorse in uso.
/// </summary>
/// <param name="disposing">ha valore true se le risorse gestite devono essere eliminate, false in caso contrario.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Codice generato da Progettazione componenti
/// <summary>
/// Metodo necessario per il supporto della finestra di progettazione. Non modificare
/// il contenuto del metodo con l'editor di codice.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.MainPN = new System.Windows.Forms.SplitContainer();
this.SessionsGB = new System.Windows.Forms.GroupBox();
this.SessionsLV = new System.Windows.Forms.ListView();
this.SessionIdCH = new System.Windows.Forms.ColumnHeader();
this.SessionNameCH = new System.Windows.Forms.ColumnHeader();
this.UserNameCH = new System.Windows.Forms.ColumnHeader();
this.LastContactTimeCH = new System.Windows.Forms.ColumnHeader();
this.SubscriptionsGB = new System.Windows.Forms.GroupBox();
this.SubscriptionsLV = new System.Windows.Forms.ListView();
this.SubscriptionIdCH = new System.Windows.Forms.ColumnHeader();
this.PublishingIntervalCH = new System.Windows.Forms.ColumnHeader();
this.ItemCountCH = new System.Windows.Forms.ColumnHeader();
this.SequenceNumberCH = new System.Windows.Forms.ColumnHeader();
this.AddressPN = new System.Windows.Forms.Panel();
this.EndpointsLB = new System.Windows.Forms.Label();
this.UrlCB = new System.Windows.Forms.ComboBox();
this.StatusBAR = new System.Windows.Forms.StatusStrip();
this.ServerStatusLB = new System.Windows.Forms.ToolStripStatusLabel();
this.ServerStateLB = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.ServerTimeLB = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.sessionsLB = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel();
this.subscriptionsLB = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel4 = new System.Windows.Forms.ToolStripStatusLabel();
this.itemsLB = new System.Windows.Forms.ToolStripStatusLabel();
this.UpdateTimerCTRL = new System.Windows.Forms.Timer(this.components);
this.MainPN.Panel1.SuspendLayout();
this.MainPN.Panel2.SuspendLayout();
this.MainPN.SuspendLayout();
this.SessionsGB.SuspendLayout();
this.SubscriptionsGB.SuspendLayout();
this.AddressPN.SuspendLayout();
this.StatusBAR.SuspendLayout();
this.SuspendLayout();
//
// MainPN
//
this.MainPN.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainPN.Location = new System.Drawing.Point(0, 32);
this.MainPN.Name = "MainPN";
this.MainPN.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// MainPN.Panel1
//
this.MainPN.Panel1.Controls.Add(this.SessionsGB);
this.MainPN.Panel1.Padding = new System.Windows.Forms.Padding(2);
//
// MainPN.Panel2
//
this.MainPN.Panel2.Controls.Add(this.SubscriptionsGB);
this.MainPN.Panel2.Padding = new System.Windows.Forms.Padding(2);
this.MainPN.Size = new System.Drawing.Size(532, 291);
this.MainPN.SplitterDistance = 131;
this.MainPN.TabIndex = 3;
//
// SessionsGB
//
this.SessionsGB.Controls.Add(this.SessionsLV);
this.SessionsGB.Dock = System.Windows.Forms.DockStyle.Fill;
this.SessionsGB.Location = new System.Drawing.Point(2, 2);
this.SessionsGB.Name = "SessionsGB";
this.SessionsGB.Size = new System.Drawing.Size(528, 127);
this.SessionsGB.TabIndex = 0;
this.SessionsGB.TabStop = false;
this.SessionsGB.Text = "Sessions";
//
// SessionsLV
//
this.SessionsLV.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.SessionIdCH,
this.SessionNameCH,
this.UserNameCH,
this.LastContactTimeCH});
this.SessionsLV.Dock = System.Windows.Forms.DockStyle.Fill;
this.SessionsLV.FullRowSelect = true;
this.SessionsLV.Location = new System.Drawing.Point(3, 16);
this.SessionsLV.Name = "SessionsLV";
this.SessionsLV.Size = new System.Drawing.Size(522, 108);
this.SessionsLV.TabIndex = 0;
this.SessionsLV.UseCompatibleStateImageBehavior = false;
this.SessionsLV.View = System.Windows.Forms.View.Details;
//
// SessionIdCH
//
this.SessionIdCH.Text = "SessionId";
this.SessionIdCH.Width = 101;
//
// SessionNameCH
//
this.SessionNameCH.Text = "Name";
this.SessionNameCH.Width = 90;
//
// UserNameCH
//
this.UserNameCH.Text = "User";
this.UserNameCH.Width = 90;
//
// LastContactTimeCH
//
this.LastContactTimeCH.Text = "Last Contact";
this.LastContactTimeCH.Width = 126;
//
// SubscriptionsGB
//
this.SubscriptionsGB.Controls.Add(this.SubscriptionsLV);
this.SubscriptionsGB.Dock = System.Windows.Forms.DockStyle.Fill;
this.SubscriptionsGB.Location = new System.Drawing.Point(2, 2);
this.SubscriptionsGB.Name = "SubscriptionsGB";
this.SubscriptionsGB.Size = new System.Drawing.Size(528, 152);
this.SubscriptionsGB.TabIndex = 0;
this.SubscriptionsGB.TabStop = false;
this.SubscriptionsGB.Text = "Subscriptions";
//
// SubscriptionsLV
//
this.SubscriptionsLV.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.SubscriptionIdCH,
this.PublishingIntervalCH,
this.ItemCountCH,
this.SequenceNumberCH});
this.SubscriptionsLV.Dock = System.Windows.Forms.DockStyle.Fill;
this.SubscriptionsLV.FullRowSelect = true;
this.SubscriptionsLV.Location = new System.Drawing.Point(3, 16);
this.SubscriptionsLV.Name = "SubscriptionsLV";
this.SubscriptionsLV.Size = new System.Drawing.Size(522, 133);
this.SubscriptionsLV.TabIndex = 0;
this.SubscriptionsLV.UseCompatibleStateImageBehavior = false;
this.SubscriptionsLV.View = System.Windows.Forms.View.Details;
//
// SubscriptionIdCH
//
this.SubscriptionIdCH.Text = "SubscriptionId";
this.SubscriptionIdCH.Width = 90;
//
// PublishingIntervalCH
//
this.PublishingIntervalCH.Text = "Publishing Interval";
this.PublishingIntervalCH.Width = 101;
//
// ItemCountCH
//
this.ItemCountCH.Text = "Item Count";
this.ItemCountCH.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.ItemCountCH.Width = 126;
//
// SequenceNumberCH
//
this.SequenceNumberCH.Text = "Seq No";
this.SequenceNumberCH.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// AddressPN
//
this.AddressPN.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.AddressPN.Controls.Add(this.EndpointsLB);
this.AddressPN.Controls.Add(this.UrlCB);
this.AddressPN.Dock = System.Windows.Forms.DockStyle.Top;
this.AddressPN.Location = new System.Drawing.Point(0, 0);
this.AddressPN.Name = "AddressPN";
this.AddressPN.Padding = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.AddressPN.Size = new System.Drawing.Size(532, 32);
this.AddressPN.TabIndex = 0;
//
// EndpointsLB
//
this.EndpointsLB.AutoSize = true;
this.EndpointsLB.Location = new System.Drawing.Point(0, 7);
this.EndpointsLB.Name = "EndpointsLB";
this.EndpointsLB.Size = new System.Drawing.Size(113, 13);
this.EndpointsLB.TabIndex = 0;
this.EndpointsLB.Text = "Server Endpoint URLs";
this.EndpointsLB.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// UrlCB
//
this.UrlCB.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.UrlCB.FormattingEnabled = true;
this.UrlCB.Location = new System.Drawing.Point(119, 4);
this.UrlCB.Name = "UrlCB";
this.UrlCB.Size = new System.Drawing.Size(406, 21);
this.UrlCB.TabIndex = 1;
//
// StatusBAR
//
this.StatusBAR.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ServerStatusLB,
this.ServerStateLB,
this.toolStripStatusLabel1,
this.ServerTimeLB,
this.toolStripStatusLabel2,
this.sessionsLB,
this.toolStripStatusLabel3,
this.subscriptionsLB,
this.toolStripStatusLabel4,
this.itemsLB});
this.StatusBAR.Location = new System.Drawing.Point(0, 323);
this.StatusBAR.Name = "StatusBAR";
this.StatusBAR.Size = new System.Drawing.Size(532, 22);
this.StatusBAR.TabIndex = 1;
this.StatusBAR.Text = "statusStrip1";
//
// ServerStatusLB
//
this.ServerStatusLB.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.ServerStatusLB.Name = "ServerStatusLB";
this.ServerStatusLB.Size = new System.Drawing.Size(45, 17);
this.ServerStatusLB.Text = "Status:";
//
// ServerStateLB
//
this.ServerStateLB.Name = "ServerStateLB";
this.ServerStateLB.Size = new System.Drawing.Size(52, 17);
this.ServerStateLB.Text = "Running";
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(84, 17);
this.toolStripStatusLabel1.Text = "Current Time:";
//
// ServerTimeLB
//
this.ServerTimeLB.Name = "ServerTimeLB";
this.ServerTimeLB.Size = new System.Drawing.Size(49, 17);
this.ServerTimeLB.Text = "00:00:00";
//
// toolStripStatusLabel2
//
this.toolStripStatusLabel2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
this.toolStripStatusLabel2.Size = new System.Drawing.Size(56, 17);
this.toolStripStatusLabel2.Text = "Sessions:";
//
// sessionsLB
//
this.sessionsLB.Name = "sessionsLB";
this.sessionsLB.Size = new System.Drawing.Size(13, 17);
this.sessionsLB.Text = "0";
//
// toolStripStatusLabel3
//
this.toolStripStatusLabel3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.toolStripStatusLabel3.Name = "toolStripStatusLabel3";
this.toolStripStatusLabel3.Size = new System.Drawing.Size(84, 17);
this.toolStripStatusLabel3.Text = "Subscriptions:";
//
// subscriptionsLB
//
this.subscriptionsLB.Name = "subscriptionsLB";
this.subscriptionsLB.Size = new System.Drawing.Size(13, 17);
this.subscriptionsLB.Text = "0";
//
// toolStripStatusLabel4
//
this.toolStripStatusLabel4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.toolStripStatusLabel4.Name = "toolStripStatusLabel4";
this.toolStripStatusLabel4.Size = new System.Drawing.Size(42, 17);
this.toolStripStatusLabel4.Text = "Items:";
//
// itemsLB
//
this.itemsLB.Name = "itemsLB";
this.itemsLB.Size = new System.Drawing.Size(13, 17);
this.itemsLB.Text = "0";
//
// UpdateTimerCTRL
//
this.UpdateTimerCTRL.Interval = 1000;
this.UpdateTimerCTRL.Tick += new System.EventHandler(this.UpdateTimerCTRL_Tick);
//
// ServerDiagnosticsCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.MainPN);
this.Controls.Add(this.StatusBAR);
this.Controls.Add(this.AddressPN);
this.Name = "ServerDiagnosticsCtrl";
this.Size = new System.Drawing.Size(532, 345);
this.MainPN.Panel1.ResumeLayout(false);
this.MainPN.Panel2.ResumeLayout(false);
this.MainPN.ResumeLayout(false);
this.SessionsGB.ResumeLayout(false);
this.SubscriptionsGB.ResumeLayout(false);
this.AddressPN.ResumeLayout(false);
this.AddressPN.PerformLayout();
this.StatusBAR.ResumeLayout(false);
this.StatusBAR.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.SplitContainer MainPN;
private System.Windows.Forms.GroupBox SessionsGB;
private System.Windows.Forms.ListView SessionsLV;
private System.Windows.Forms.ColumnHeader SessionIdCH;
private System.Windows.Forms.ColumnHeader SessionNameCH;
private System.Windows.Forms.ColumnHeader UserNameCH;
private System.Windows.Forms.ColumnHeader LastContactTimeCH;
private System.Windows.Forms.GroupBox SubscriptionsGB;
private System.Windows.Forms.ListView SubscriptionsLV;
private System.Windows.Forms.ColumnHeader SubscriptionIdCH;
private System.Windows.Forms.ColumnHeader PublishingIntervalCH;
private System.Windows.Forms.ColumnHeader ItemCountCH;
private System.Windows.Forms.ColumnHeader SequenceNumberCH;
private System.Windows.Forms.Panel AddressPN;
private System.Windows.Forms.Label EndpointsLB;
private System.Windows.Forms.ComboBox UrlCB;
private System.Windows.Forms.StatusStrip StatusBAR;
private System.Windows.Forms.ToolStripStatusLabel ServerStatusLB;
private System.Windows.Forms.ToolStripStatusLabel ServerStateLB;
private System.Windows.Forms.ToolStripStatusLabel ServerTimeLB;
private System.Windows.Forms.Timer UpdateTimerCTRL;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;
private System.Windows.Forms.ToolStripStatusLabel sessionsLB;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel3;
private System.Windows.Forms.ToolStripStatusLabel subscriptionsLB;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel4;
private System.Windows.Forms.ToolStripStatusLabel itemsLB;
}
}
@@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Server;
namespace OpcUaServer.Server
{
public partial class ServerDiagnosticsCtrl : UserControl
{
private StandardServer m_server;
private ApplicationConfiguration m_configuration;
public ServerDiagnosticsCtrl()
{
InitializeComponent();
}
public void Initialize(StandardServer server, ApplicationConfiguration configuration)
{
m_server = server;
m_configuration = configuration;
UpdateTimerCTRL.Enabled = true;
// add the urls to the drop down.
UrlCB.Items.Clear();
foreach (EndpointDescription endpoint in m_server.GetEndpoints())
{
if (UrlCB.FindStringExact(endpoint.EndpointUrl) == -1)
{
UrlCB.Items.Add(endpoint.EndpointUrl);
}
}
if (UrlCB.Items.Count > 0)
{
UrlCB.SelectedIndex = 0;
}
}
private void UpdateTimerCTRL_Tick(object sender, EventArgs e)
{
try
{
ServerStateLB.Text = m_server.CurrentInstance.CurrentState.ToString();
ServerTimeLB.Text = String.Format("{0:HH:mm:ss}", DateTime.Now);
UpdateSessions();
sessionsLB.Text = Convert.ToString(SessionsLV.Items.Count);
UpdateSubscriptions();
subscriptionsLB.Text = Convert.ToString(SubscriptionsLV.Items.Count);
int itemTotal = 0;
for (int i = 0; i < SubscriptionsLV.Items.Count; i++)
{
itemTotal += Convert.ToInt32(SubscriptionsLV.Items[i].SubItems[2].Text);
}
itemsLB.Text = Convert.ToString(itemTotal);
}
catch (Exception)
{
// ClientUtils.HandleException(this.Text, exception);
}
}
private void UpdateSessions()
{
SessionsLV.Items.Clear();
IList<Session> sessions = m_server.CurrentInstance.SessionManager.GetSessions();
for (int ii = 0; ii < sessions.Count; ii++)
{
Session session = sessions[ii];
lock (session.DiagnosticsLock)
{
ListViewItem item = new ListViewItem(session.SessionDiagnostics.SessionName);
if (session.Identity != null)
{
item.SubItems.Add(session.Identity.DisplayName);
}
else
{
item.SubItems.Add(String.Empty);
}
item.SubItems.Add(String.Format("{0}", session.Id));
item.SubItems.Add(String.Format("{0:HH:mm:ss}", session.SessionDiagnostics.ClientLastContactTime.ToLocalTime()));
SessionsLV.Items.Add(item);
}
}
// adjust
for (int ii = 0; ii < SessionsLV.Columns.Count; ii++)
{
SessionsLV.Columns[ii].Width = -2;
}
}
private void UpdateSubscriptions()
{
SubscriptionsLV.Items.Clear();
IList<Subscription> subscriptions = m_server.CurrentInstance.SubscriptionManager.GetSubscriptions();
for (int ii = 0; ii < subscriptions.Count; ii++)
{
Subscription subscription = subscriptions[ii];
ListViewItem item = new ListViewItem(subscription.Id.ToString());
item.SubItems.Add(String.Format("{0}", (int)subscription.PublishingInterval));
item.SubItems.Add(String.Format("{0}", subscription.MonitoredItemCount));
lock (subscription.DiagnosticsLock)
{
item.SubItems.Add(String.Format("{0}", subscription.Diagnostics.NextSequenceNumber));
}
SubscriptionsLV.Items.Add(item);
}
for (int ii = 0; ii < SubscriptionsLV.Columns.Count; ii++)
{
SubscriptionsLV.Columns[ii].Width = -2;
}
}
}
}
+146
View File
@@ -0,0 +1,146 @@
namespace OpcUaServer.Server.Windows
{
partial class ServerForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.TrayIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.ServerDiagnosticsCTRL = new ServerDiagnosticsCtrl();
this.serverHeaderBranding1 = new HeaderBreading();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// TrayIcon
//
this.TrayIcon.Text = "TrayIcon";
this.TrayIcon.Visible = true;
this.TrayIcon.MouseMove += new System.Windows.Forms.MouseEventHandler(this.TrayIcon_MouseMove);
this.TrayIcon.DoubleClick += new System.EventHandler(this.TrayIcon_DoubleClick);
//
// ServerDiagnosticsCTRL
//
this.ServerDiagnosticsCTRL.Dock = System.Windows.Forms.DockStyle.Fill;
this.ServerDiagnosticsCTRL.Location = new System.Drawing.Point(0, 114);
this.ServerDiagnosticsCTRL.Name = "ServerDiagnosticsCTRL";
this.ServerDiagnosticsCTRL.Size = new System.Drawing.Size(739, 368);
this.ServerDiagnosticsCTRL.TabIndex = 0;
//
// serverHeaderBranding1
//
this.serverHeaderBranding1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.serverHeaderBranding1.BackColor = System.Drawing.Color.White;
this.serverHeaderBranding1.Dock = System.Windows.Forms.DockStyle.Top;
this.serverHeaderBranding1.Location = new System.Drawing.Point(0, 24);
this.serverHeaderBranding1.MaximumSize = new System.Drawing.Size(0, 100);
this.serverHeaderBranding1.MinimumSize = new System.Drawing.Size(500, 90);
this.serverHeaderBranding1.Name = "serverHeaderBranding1";
this.serverHeaderBranding1.Padding = new System.Windows.Forms.Padding(3);
this.serverHeaderBranding1.Size = new System.Drawing.Size(739, 90);
this.serverHeaderBranding1.TabIndex = 1;
this.serverHeaderBranding1.Visible = false;
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(739, 24);
this.menuStrip1.TabIndex = 2;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "&File";
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.contentsToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.helpToolStripMenuItem.Text = "&Help";
//
// contentsToolStripMenuItem
//
this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem";
this.contentsToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
this.contentsToolStripMenuItem.Text = "&Contents";
this.contentsToolStripMenuItem.Click += new System.EventHandler(this.ContentsToolStripMenuItem_Click);
//
// ServerForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(739, 482);
this.Controls.Add(this.ServerDiagnosticsCTRL);
this.Controls.Add(this.serverHeaderBranding1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "ServerForm";
this.Text = "Quickstart Empty Server";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ServerForm_FormClosed);
this.Resize += new System.EventHandler(this.ServerForm_Resize);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private ServerDiagnosticsCtrl ServerDiagnosticsCTRL;
private System.Windows.Forms.NotifyIcon TrayIcon;
private HeaderBreading serverHeaderBranding1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem;
}
}
@@ -0,0 +1,99 @@
using System;
using System.IO;
using System.Windows.Forms;
using Opc.Ua;
using Opc.Ua.Configuration;
using Opc.Ua.Server;
namespace OpcUaServer.Server.Windows
{
public partial class ServerForm : Form
{
private readonly StandardServer _mServer;
private readonly ApplicationConfiguration _mConfiguration;
public ServerForm()
{
InitializeComponent();
}
public ServerForm(ApplicationInstance application)
{
InitializeComponent();
_mServer = application.Server as StandardServer;
_mConfiguration = application.ApplicationConfiguration;
this.ServerDiagnosticsCTRL.Initialize(_mServer, _mConfiguration);
TrayIcon.Text = this.Text = _mConfiguration.ApplicationName;
//ComponentResourceManager resources = new ComponentResourceManager(typeof(ServerForm));
//TrayIcon.Icon = (Icon)(resources.GetObject("App.ico"));
}
private void ServerForm_Resize(object sender, EventArgs e)
{
if (FormWindowState.Minimized == WindowState)
{
Hide();
}
}
private void TrayIcon_DoubleClick(object sender, EventArgs e)
{
Show();
WindowState = FormWindowState.Normal;
}
private void ServerForm_FormClosed(object sender, FormClosedEventArgs e)
{
try
{
_mServer.Stop();
}
catch (Exception exception)
{
Utils.Trace(exception, "Error stopping server.");
}
}
private void TrayIcon_MouseMove(object sender, MouseEventArgs e)
{
try
{
TrayIcon.Text = String.Format(
"{0} [{1} {2:HH:mm:ss}]",
_mConfiguration.ApplicationName,
_mServer.CurrentInstance.CurrentState,
DateTime.Now);
}
catch (Exception exception)
{
Utils.Trace(exception, "Error getting server status.");
}
}
private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Quit the application", "OPC UA", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
{
Application.Exit();
}
}
private void ContentsToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
System.Diagnostics.Process.Start(Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + "WebHelp" + Path.DirectorySeparatorChar + "index.htm");
}
catch (Exception ex)
{
MessageBox.Show("Unable to launch help documentation. Error: " + ex.Message);
}
}
}
}
+36 -40
View File
@@ -2,60 +2,59 @@
<packages> <packages>
<package id="Libuv" version="1.10.0" targetFramework="net461" /> <package id="Libuv" version="1.10.0" targetFramework="net461" />
<package id="log4net" version="2.0.8" targetFramework="net461" /> <package id="log4net" version="2.0.8" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Connections.Abstractions" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Connections.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Hosting" version="2.2.7" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Hosting" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Hosting.Abstractions" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Hosting.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Hosting.Server.Abstractions" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Hosting.Server.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Http" version="2.2.2" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Http" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Http.Abstractions" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Http.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Http.Extensions" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Http.Extensions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Http.Features" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Http.Features" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Server.Kestrel" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Server.Kestrel" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Server.Kestrel.Core" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Server.Kestrel.Core" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Server.Kestrel.Https" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Server.Kestrel.Https" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" version="2.2.1" targetFramework="net461" /> <package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" version="2.2.1" targetFramework="net461" />
<package id="Microsoft.AspNetCore.WebUtilities" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.AspNetCore.WebUtilities" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Configuration" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Configuration" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Configuration.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Configuration.Binder" version="2.2.4" targetFramework="net461" />
<package id="Microsoft.Extensions.Configuration.Binder" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Configuration.EnvironmentVariables" version="2.2.4" targetFramework="net461" />
<package id="Microsoft.Extensions.Configuration.EnvironmentVariables" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Configuration.FileExtensions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Configuration.FileExtensions" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.DependencyInjection" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.DependencyInjection" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.FileProviders.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.FileProviders.Abstractions" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.FileProviders.Physical" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.FileProviders.Physical" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.FileSystemGlobbing" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.FileSystemGlobbing" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Hosting.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Hosting.Abstractions" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Logging" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Logging" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Logging.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.ObjectPool" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.ObjectPool" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Options" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Options" version="3.0.0" targetFramework="net461" />
<package id="Microsoft.Extensions.PlatformAbstractions" version="1.1.0" targetFramework="net461" /> <package id="Microsoft.Extensions.PlatformAbstractions" version="1.1.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Primitives" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.Extensions.Primitives" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Net.Http.Headers" version="2.2.0" targetFramework="net461" /> <package id="Microsoft.Net.Http.Headers" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.NETCore.Platforms" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.NETCore.Platforms" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net461" /> <package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net461" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="net461" /> <package id="NETStandard.Library" version="2.0.3" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
<package id="OPCFoundation.NetStandard.Opc.Ua" version="1.4.354.23" targetFramework="net461" /> <package id="OPCFoundation.NetStandard.Opc.Ua" version="1.4.355.26" targetFramework="net461" />
<package id="Portable.BouncyCastle" version="1.8.5.2" targetFramework="net461" /> <package id="Portable.BouncyCastle" version="1.8.5" targetFramework="net461" />
<package id="System.AppContext" version="4.3.0" targetFramework="net461" /> <package id="System.AppContext" version="4.3.0" targetFramework="net461" />
<package id="System.Buffers" version="4.5.0" targetFramework="net461" /> <package id="System.Buffers" version="4.5.0" targetFramework="net461" />
<package id="System.Collections" version="4.3.0" targetFramework="net461" /> <package id="System.Collections" version="4.3.0" targetFramework="net461" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" /> <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" />
<package id="System.Collections.Immutable" version="1.6.0" targetFramework="net461" /> <package id="System.Collections.Immutable" version="1.5.0" targetFramework="net461" />
<package id="System.Collections.NonGeneric" version="4.3.0" targetFramework="net461" /> <package id="System.Collections.NonGeneric" version="4.3.0" targetFramework="net461" />
<package id="System.Collections.Specialized" version="4.3.0" targetFramework="net461" /> <package id="System.Collections.Specialized" version="4.3.0" targetFramework="net461" />
<package id="System.ComponentModel" version="4.3.0" targetFramework="net461" /> <package id="System.ComponentModel" version="4.3.0" targetFramework="net461" />
<package id="System.ComponentModel.Annotations" version="4.6.0" targetFramework="net461" /> <package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="net461" />
<package id="System.ComponentModel.EventBasedAsync" version="4.3.0" targetFramework="net461" /> <package id="System.ComponentModel.EventBasedAsync" version="4.3.0" targetFramework="net461" />
<package id="System.Console" version="4.3.1" targetFramework="net461" /> <package id="System.Console" version="4.3.1" targetFramework="net461" />
<package id="System.Data.Common" version="4.3.0" targetFramework="net461" /> <package id="System.Data.Common" version="4.3.0" targetFramework="net461" />
<package id="System.Diagnostics.Contracts" version="4.3.0" targetFramework="net461" /> <package id="System.Diagnostics.Contracts" version="4.3.0" targetFramework="net461" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" /> <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" />
<package id="System.Diagnostics.DiagnosticSource" version="4.6.0" targetFramework="net461" /> <package id="System.Diagnostics.DiagnosticSource" version="4.5.1" targetFramework="net461" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" /> <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" />
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net461" /> <package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net461" />
<package id="System.Globalization" version="4.3.0" targetFramework="net461" /> <package id="System.Globalization" version="4.3.0" targetFramework="net461" />
@@ -65,7 +64,7 @@
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net461" /> <package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net461" />
<package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" /> <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" />
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" /> <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.IO.Pipelines" version="4.6.0" targetFramework="net461" /> <package id="System.IO.Pipelines" version="4.5.3" targetFramework="net461" />
<package id="System.Linq" version="4.3.0" targetFramework="net461" /> <package id="System.Linq" version="4.3.0" targetFramework="net461" />
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" /> <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" />
<package id="System.Linq.Queryable" version="4.3.0" targetFramework="net461" /> <package id="System.Linq.Queryable" version="4.3.0" targetFramework="net461" />
@@ -80,16 +79,16 @@
<package id="System.Net.WebSockets.Client" version="4.3.2" targetFramework="net461" /> <package id="System.Net.WebSockets.Client" version="4.3.2" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" /> <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
<package id="System.ObjectModel" version="4.3.0" targetFramework="net461" /> <package id="System.ObjectModel" version="4.3.0" targetFramework="net461" />
<package id="System.Private.ServiceModel" version="4.6.0" targetFramework="net461" /> <package id="System.Private.ServiceModel" version="4.5.3" targetFramework="net461" />
<package id="System.Reflection" version="4.3.0" targetFramework="net461" /> <package id="System.Reflection" version="4.3.0" targetFramework="net461" />
<package id="System.Reflection.DispatchProxy" version="4.6.0" targetFramework="net461" /> <package id="System.Reflection.DispatchProxy" version="4.5.1" targetFramework="net461" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net461" /> <package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net461" />
<package id="System.Reflection.Metadata" version="1.7.0" targetFramework="net461" /> <package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net461" />
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net461" /> <package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.Reflection.TypeExtensions" version="4.6.0" targetFramework="net461" /> <package id="System.Reflection.TypeExtensions" version="4.5.1" targetFramework="net461" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" /> <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" />
<package id="System.Runtime" version="4.3.1" targetFramework="net461" /> <package id="System.Runtime" version="4.3.1" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net461" /> <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net461" />
<package id="System.Runtime.Extensions" version="4.3.1" targetFramework="net461" /> <package id="System.Runtime.Extensions" version="4.3.1" targetFramework="net461" />
<package id="System.Runtime.Handles" version="4.3.0" targetFramework="net461" /> <package id="System.Runtime.Handles" version="4.3.0" targetFramework="net461" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" /> <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" />
@@ -97,21 +96,18 @@
<package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" /> <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" />
<package id="System.Runtime.Serialization.Primitives" version="4.3.0" targetFramework="net461" /> <package id="System.Runtime.Serialization.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.Runtime.Serialization.Xml" version="4.3.0" targetFramework="net461" /> <package id="System.Runtime.Serialization.Xml" version="4.3.0" targetFramework="net461" />
<package id="System.Security.AccessControl" version="4.6.0" targetFramework="net461" />
<package id="System.Security.Claims" version="4.3.0" targetFramework="net461" /> <package id="System.Security.Claims" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net461" /> <package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net461" />
<package id="System.Security.Cryptography.Cng" version="4.6.0" targetFramework="net461" /> <package id="System.Security.Cryptography.Cng" version="4.5.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" /> <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" /> <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net461" /> <package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net461" />
<package id="System.Security.Cryptography.Xml" version="4.6.0" targetFramework="net461" />
<package id="System.Security.Permissions" version="4.6.0" targetFramework="net461" />
<package id="System.Security.Principal" version="4.3.0" targetFramework="net461" /> <package id="System.Security.Principal" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Principal.Windows" version="4.6.0" targetFramework="net461" /> <package id="System.Security.Principal.Windows" version="4.5.1" targetFramework="net461" />
<package id="System.ServiceModel.Primitives" version="4.6.0" targetFramework="net461" /> <package id="System.ServiceModel.Primitives" version="4.5.3" targetFramework="net461" />
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" /> <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" />
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" /> <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" />
<package id="System.Text.Encodings.Web" version="4.6.0" targetFramework="net461" /> <package id="System.Text.Encodings.Web" version="4.5.0" targetFramework="net461" />
<package id="System.Text.RegularExpressions" version="4.3.1" targetFramework="net461" /> <package id="System.Text.RegularExpressions" version="4.3.1" targetFramework="net461" />
<package id="System.Threading" version="4.3.0" targetFramework="net461" /> <package id="System.Threading" version="4.3.0" targetFramework="net461" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" /> <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" />
+76 -127
View File
@@ -11,30 +11,19 @@ namespace SOUR.Core
{ {
public class ApplicationStarter public class ApplicationStarter
{ {
#region Private Fields
private readonly IPrinter _printer; private readonly IPrinter _printer;
private readonly DataRecorder _recorder; private readonly DataRecorder _recorder;
private readonly string _serverConfigurationFilePath;
private readonly XmlParser _xmlParser;
#endregion Private Fields
#region Protected Fields
protected MQTT_Client _mqttCli;
protected MQTT_Client.confData _mqttConf; protected MQTT_Client.confData _mqttConf;
protected MQTT_Client _mqttCli;
private readonly XmlParser _xmlParser;
private readonly string _serverConfigurationFilePath;
protected bool redisOk = false;
/// <summary> /// <summary>
/// FIle conf XML (da sostituire con quello scaricato da REDIS) !!!FARE!!! /// FIle conf XML (da sostituire con quello scaricato da REDIS) !!!FARE!!!
/// </summary> /// </summary>
protected string _xmlConfigurationPath; protected string _xmlConfigurationPath;
protected bool redisOk = false; public ServerManagerDecorator ServerManagerDecorator { get; private set; }
#endregion Protected Fields
#region Public Constructors
/// <summary> /// <summary>
/// Avvio applicazione principale /// Avvio applicazione principale
@@ -65,89 +54,21 @@ namespace SOUR.Core
redisPreStartup(_printer); redisPreStartup(_printer);
mqttCliPreStartup(_printer); mqttCliPreStartup(_printer);
} }
#endregion Public Constructors
#region Public Properties
public ServerManagerDecorator ServerManagerDecorator { get; private set; }
#endregion Public Properties
#region Private Methods
/// <summary> /// <summary>
/// Avvia in modalità async l'oggetto MQTT /// Test connesisone server redis
/// </summary>
/// <param name="mqttCli"></param>
/// <returns></returns>
private static async Task setupMqtt(MQTT_Client mqttCli)
{
await mqttCli.startAsync();
await mqttCli.sendValueAsync("data/SRG", "STARTED", null);
}
private static void StartServer(IPrinter printer, ServerDecorator server, string serverConfigurationFilePath)
{
new ConsoleServerStarter(new ApplicationInstanceBuilder(printer, server), printer).Start(serverConfigurationFilePath);
}
/// <summary>
/// Avvia il componente Sampler che effettua lettura periodica da area redis
/// </summary>
/// <param name="server"></param>
/// <returns></returns>
private IRedisSampler GetSampler(ServerDecorator server)
{
var nodesDictionary = _xmlParser.CreateDictionaryFromXmlToGenerateValues(_xmlConfigurationPath);
ServerManagerDecorator = new ServerManagerDecorator(server);
return new RedisSampler(ServerManagerDecorator, _xmlConfigurationPath, _printer,
nodesDictionary, new EventMessageMan(), _recorder, _mqttConf, _mqttCli);
}
/// <summary>
/// Effettua operazioni preliminari su MQTT client x startup (check configurazione + avvio + scrittura avviato...)
/// </summary> /// </summary>
/// <param name="printer"></param> /// <param name="printer"></param>
private void mqttCliPreStartup(IPrinter printer) private void testRedisServerConn(IPrinter printer)
{ {
// faccio i controlli per capire SE si possa avviare... // controllo se il server è connesso
if (redisOk) if (memLayer.man.connRedis.IsConnected)
{ {
// SOLO SE indica che è enabled... printer.Print("***** REDIS server connected... *****");
if (_mqttConf.isEnabled) redisOk = true;
{
_mqttCli = new MQTT_Client(_mqttConf, printer);
printer.Print("***** SRG MQTT publishing server created... *****");
} }
else else
{ {
printer.Print("***** SRG MQTT NOT ENABLED - server HAS NOT BEEN created... *****"); printer.Print("***** ERROR: REDIS NOT available... please check service status *****");
}
}
}
/// <summary>
/// Effettua operazioni preliminari su MQTT client x startup (check configurazione + avvio + scrittura avviato...)
/// </summary>
/// <param name="printer"></param>
private void mqttCliStartup(IPrinter printer)
{
// faccio i controlli per capire SE si possa avviare...
if (redisOk)
{
// SOLO SE indica che è enabled...
if (_mqttConf.isEnabled)
{
setupMqtt(_mqttCli);
printer.Print("***** SRG MQTT publishing server started... *****");
}
else
{
printer.Print("***** SRG MQTT NOT ENABLED - server IS NOT starting... *****");
}
} }
} }
@@ -199,7 +120,7 @@ namespace SOUR.Core
// se OK --> proseguo // se OK --> proseguo
if (redOk) if (redOk)
{ {
if (!string.IsNullOrEmpty(redVal)) if (redVal != null && redVal != "")
{ {
string dataModel = DataHelper.xmlSanitize(redVal); string dataModel = DataHelper.xmlSanitize(redVal);
File.WriteAllText(_xmlConfigurationPath, dataModel); File.WriteAllText(_xmlConfigurationPath, dataModel);
@@ -211,54 +132,42 @@ namespace SOUR.Core
} }
} }
} }
/// <summary> /// <summary>
/// Test connesisone server redis /// Effettua operazioni preliminari su MQTT client x startup (check configurazione + avvio + scrittura avviato...)
/// </summary> /// </summary>
/// <param name="printer"></param> /// <param name="printer"></param>
private void testRedisServerConn(IPrinter printer) private void mqttCliPreStartup(IPrinter printer)
{ {
// controllo se il server è connesso // faccio i controlli per capire SE si possa avviare...
if (memLayer.man.connRedis.IsConnected) if (redisOk)
{ {
printer.Print("***** REDIS server connected... *****"); _mqttCli = new MQTT_Client(_mqttConf);
redisOk = true; printer.Print("***** SRG MQTT publishing server created... *****");
}
else
{
printer.Print("***** ERROR: REDIS NOT available... please check service status *****");
} }
} }
#endregion Private Methods
#region Protected Methods
/// <summary> /// <summary>
/// Effettua verifica di value, se !="" effettua log con messageOk altrimenti con messageKo /// Effettua operazioni preliminari su MQTT client x startup (check configurazione + avvio + scrittura avviato...)
/// </summary> /// </summary>
/// <param name="value"></param> /// <param name="printer"></param>
/// <param name="messageOk">messaggio se OK</param> private void mqttCliStartup(IPrinter printer)
/// <param name="messageKo">messaggio se KO</param>
protected bool tryLog(string value, string messageOk, string messageKo)
{ {
bool answ = false; // faccio i controlli per capire SE si possa avviare...
if (value != "" && value != null) if (redisOk)
{ {
_printer.Print(messageOk); setupMqtt(_mqttCli);
answ = true; printer.Print("***** SRG MQTT publishing server started... *****");
} }
else }
/// <summary>
/// Avvia in modalità async l'oggetto MQTT
/// </summary>
/// <param name="mqttCli"></param>
/// <returns></returns>
private static async Task setupMqtt(MQTT_Client mqttCli)
{ {
_printer.Print(messageKo); await mqttCli.startAsync();
await mqttCli.sendValueAsync("data/SRG", "STARTED", null);
} }
return answ;
}
#endregion Protected Methods
#region Public Methods
/// <summary> /// <summary>
/// Classe avvio /// Classe avvio
/// </summary> /// </summary>
@@ -288,6 +197,46 @@ namespace SOUR.Core
} }
} }
#endregion Public Methods /// <summary>
/// Avvia il componente Sampler che effettua lettura periodica da area redis
/// </summary>
/// <param name="server"></param>
/// <returns></returns>
private IRedisSampler GetSampler(ServerDecorator server)
{
var nodesDictionary = _xmlParser.CreateDictionaryFromXmlToGenerateValues(_xmlConfigurationPath);
ServerManagerDecorator = new ServerManagerDecorator(server);
return new RedisSampler(ServerManagerDecorator, _xmlConfigurationPath, _printer,
nodesDictionary, new EventMessageMan(), _recorder, _mqttConf, _mqttCli);
}
/// <summary>
/// Effettua verifica di value, se !="" effettua log con messageOk altrimenti con messageKo
/// </summary>
/// <param name="value"></param>
/// <param name="messageOk">messaggio se OK</param>
/// <param name="messageKo">messaggio se KO</param>
protected bool tryLog(string value, string messageOk, string messageKo)
{
bool answ = false;
if (value != "" && value != null)
{
_printer.Print(messageOk);
answ = true;
}
else
{
_printer.Print(messageKo);
}
return answ;
}
private static void StartServer(IPrinter printer, ServerDecorator server, string serverConfigurationFilePath)
{
new ConsoleServerStarter(new ApplicationInstanceBuilder(printer, server), printer).Start(serverConfigurationFilePath);
}
} }
} }
+33 -60
View File
@@ -1,7 +1,6 @@
using SOUR.Core.Services; using SOUR.Core.Services;
using System; using System;
using System.IO; using System.IO;
using System.Text;
using System.Xml; using System.Xml;
namespace SOUR.Core namespace SOUR.Core
@@ -11,52 +10,13 @@ namespace SOUR.Core
/// </summary> /// </summary>
public class DataHelper public class DataHelper
{ {
#region Protected Fields
/// <summary> /// <summary>
/// Formato output timestamp /// Formato output timestamp
/// </summary> /// </summary>
protected static string dataFormat = "yyyy-MM-dd\\THH:mm:ss.fffK"; protected static string dataFormat = "yyyy-MM-dd\\THH:mm:ss.fffK";
#endregion Protected Fields
// !!!TDB!!! provare questo formato ma ha 7 decimali... // !!!TDB!!! provare questo formato ma ha 7 decimali...
//protected string dataFormat = "O"; //protected string dataFormat = "O";
#region Public Fields
/// <summary>
/// TTL eventi LUNGI (5 minuto)
/// </summary>
public static int longTTL = 300;
/// <summary>
/// oggetto singleton x accesso metodi Helper (redis, XML)
/// </summary>
public static DataHelper man = new DataHelper();
/// <summary>
/// TTL eventi BREVI (15 sec)
/// </summary>
public static int shortTTL = 15;
#endregion Public Fields
#region Protected Constructors
/// <summary>
/// classe gestione accessi a Session, cache, viewstate, configuration...
/// </summary>
protected DataHelper()
{
shortTTL = memLayer.man.confReadInt("shortTTL");
if (shortTTL <= 0) shortTTL = 15;
}
#endregion Protected Constructors
#region Protected Properties
/// <summary> /// <summary>
/// Timestamp formattato... /// Timestamp formattato...
/// </summary> /// </summary>
@@ -68,26 +28,27 @@ namespace SOUR.Core
} }
} }
#endregion Protected Properties /// <summary>
/// TTL eventi BREVI (15 sec)
#region Public Methods /// </summary>
public static int shortTTL = 15;
/// <summary>
/// TTL eventi LUNGI (5 minuto)
/// </summary>
public static int longTTL = 300;
/// <summary> /// <summary>
/// Invio eventi di tipo heartbeat/watchdog server redis /// classe gestione accessi a Session, cache, viewstate, configuration...
/// </summary> /// </summary>
public static void sendRedisHBeat() protected DataHelper()
{ {
string currKey = ""; shortTTL = memLayer.man.confReadInt("shortTTL");
// registro status + heartbeat if (shortTTL <= 0) shortTTL = 15;
currKey = memLayer.man.redHash("Srv:Status");
memLayer.man.setRSV(currKey, "running", shortTTL);
currKey = memLayer.man.redHash("Srv:Heartbeat");
memLayer.man.setRSV(currKey, timestamp, shortTTL);
// aggiunta bitmap di status: 00001111 --> 255
currKey = memLayer.man.redHash("Srv:StatBitmap");
memLayer.man.setRSV(currKey, "00001111", shortTTL);
} }
/// <summary>
/// oggetto singleton x accesso metodi Helper (redis, XML)
/// </summary>
public static DataHelper man = new DataHelper();
/// <summary> /// <summary>
/// Invio eventi di tipo start server redis /// Invio eventi di tipo start server redis
/// </summary> /// </summary>
@@ -109,7 +70,6 @@ namespace SOUR.Core
currKey = memLayer.man.redHash("Srv:StatBitmap"); currKey = memLayer.man.redHash("Srv:StatBitmap");
memLayer.man.setRSV(currKey, "00001111", shortTTL); memLayer.man.setRSV(currKey, "00001111", shortTTL);
} }
/// <summary> /// <summary>
/// Invio eventi di tipo stop server redis /// Invio eventi di tipo stop server redis
/// </summary> /// </summary>
@@ -125,7 +85,21 @@ namespace SOUR.Core
currKey = memLayer.man.redHash("Srv:StatBitmap"); currKey = memLayer.man.redHash("Srv:StatBitmap");
memLayer.man.setRSV(currKey, "00001111", shortTTL); memLayer.man.setRSV(currKey, "00001111", shortTTL);
} }
/// <summary>
/// Invio eventi di tipo heartbeat/watchdog server redis
/// </summary>
public static void sendRedisHBeat()
{
string currKey = "";
// registro status + heartbeat
currKey = memLayer.man.redHash("Srv:Status");
memLayer.man.setRSV(currKey, "running", shortTTL);
currKey = memLayer.man.redHash("Srv:Heartbeat");
memLayer.man.setRSV(currKey, timestamp, shortTTL);
// aggiunta bitmap di status: 00001111 --> 255
currKey = memLayer.man.redHash("Srv:StatBitmap");
memLayer.man.setRSV(currKey, "00001111", shortTTL);
}
/// <summary> /// <summary>
/// Metodo di sanitizzazione XML /// Metodo di sanitizzazione XML
/// - elimina commenti /// - elimina commenti
@@ -135,7 +109,8 @@ namespace SOUR.Core
/// <returns></returns> /// <returns></returns>
public static string xmlSanitize(string xmlOrig) public static string xmlSanitize(string xmlOrig)
{ {
string sXml = xmlOrig; // primo step: converto stringa in dox XML string sXml = xmlOrig;
// primo step: converto stringa in dox XML
XmlDocument xmlDoc = new XmlDocument(); XmlDocument xmlDoc = new XmlDocument();
xmlDoc.PreserveWhitespace = false; xmlDoc.PreserveWhitespace = false;
xmlDoc.LoadXml(sXml); xmlDoc.LoadXml(sXml);
@@ -154,7 +129,5 @@ namespace SOUR.Core
// restituisco // restituisco
return sXml; return sXml;
} }
#endregion Public Methods
} }
} }
+11 -11
View File
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SOUR.Core</RootNamespace> <RootNamespace>SOUR.Core</RootNamespace>
<AssemblyName>SOUR.Core</AssemblyName> <AssemblyName>SOUR.Core</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -34,10 +34,10 @@
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL"> <Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL">
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.1.0\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath> <HintPath>..\packages\Pipelines.Sockets.Unofficial.2.0.22\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
</Reference> </Reference>
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL"> <Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
<HintPath>..\packages\StackExchange.Redis.2.0.601\lib\net461\StackExchange.Redis.dll</HintPath> <HintPath>..\packages\StackExchange.Redis.2.0.601\lib\net461\StackExchange.Redis.dll</HintPath>
@@ -47,12 +47,12 @@
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath> <HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Diagnostics.PerformanceCounter, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Diagnostics.PerformanceCounter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Diagnostics.PerformanceCounter.4.6.0\lib\net461\System.Diagnostics.PerformanceCounter.dll</HintPath> <HintPath>..\packages\System.Diagnostics.PerformanceCounter.4.5.0\lib\net461\System.Diagnostics.PerformanceCounter.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Pipelines, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.IO.Pipelines, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.4.6.0\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath> <HintPath>..\packages\System.IO.Pipelines.4.5.3\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath> <HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
@@ -61,12 +61,12 @@
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Threading.Channels, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Channels, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Channels.4.6.0\lib\netstandard2.0\System.Threading.Channels.dll</HintPath> <HintPath>..\packages\System.Threading.Channels.4.5.0\lib\netstandard2.0\System.Threading.Channels.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
+1 -5
View File
@@ -45,7 +45,7 @@ namespace SOUR.Core.Services
{ {
string singleAlarm = memLayer.man.redGetHashField(currKey, AlarmKey); string singleAlarm = memLayer.man.redGetHashField(currKey, AlarmKey);
//int alrNum = 0; //int alrNum = 0;
if (!string.IsNullOrEmpty( singleAlarm )) if (singleAlarm != "")
{ {
var splitted = AlarmKey.Split('|'); var splitted = AlarmKey.Split('|');
if (splitted.Length > 1) if (splitted.Length > 1)
@@ -53,10 +53,6 @@ namespace SOUR.Core.Services
answ = new EventMessage(AlarmKey, singleAlarm, splitted[1]); answ = new EventMessage(AlarmKey, singleAlarm, splitted[1]);
} }
} }
else
{
answ = new EventMessage(AlarmKey, $"ALARM {AlarmKey} - key not found in currKey");
}
} }
catch catch
{ } { }
+4 -8
View File
@@ -2,17 +2,13 @@
{ {
public class MemDataItem public class MemDataItem
{ {
#region Public Fields
public string browseName; public string browseName;
public bool changed;
public string currVal;
public string dataType;
public float dBand = 0;
public string elType; public string elType;
public string dataType;
public string lastVal; public string lastVal;
public string currVal;
public int sGroup = 3; public int sGroup = 3;
public float dBand = 0;
#endregion Public Fields public bool changed;
} }
} }
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -4
View File
@@ -8,10 +8,7 @@ namespace SOUR.Core
private readonly List<TreeNodeInstance> _children; private readonly List<TreeNodeInstance> _children;
public string BrowseName { get; set; } public string BrowseName { get; set; }
public string DisplayName { get; set; } public string DisplayName { get; set; }
/// <summary>
/// Visibilità dell'oggetto nodo d'albero
/// </summary>
public string Visibility { get; set; } = "A";
public TreeNodeInstance[] Children public TreeNodeInstance[] Children
+38 -41
View File
@@ -8,29 +8,43 @@ namespace SOUR.Core
{ {
public class XmlParser public class XmlParser
{ {
#region Private Fields
private readonly IEventMessageRepository _eventMessageRepository; private readonly IEventMessageRepository _eventMessageRepository;
#endregion Private Fields
#region Public Constructors
public XmlParser(IEventMessageRepository eventMessageRepository) public XmlParser(IEventMessageRepository eventMessageRepository)
{ {
_eventMessageRepository = eventMessageRepository; _eventMessageRepository = eventMessageRepository;
} }
#endregion Public Constructors
#region Private Methods public IDictionary<string, NodeProperties> CreateDictionaryFromXmlToGenerateValues(string tracciatoXml)
{
IDictionary<string, NodeProperties> nodeNameAndBuiltInTypes = new Dictionary<string, NodeProperties>();
var xmlDocument = new XmlDocument();
// carico XML appena salvato
xmlDocument.Load(tracciatoXml);
ParseXml(xmlDocument, nodeNameAndBuiltInTypes, new TreeNodeInstance());
return nodeNameAndBuiltInTypes;
}
public TreeNodeInstance CreateTree(string tracciatoXml)
{
IDictionary<string, NodeProperties> nodeNameAndBuiltInTypes = new Dictionary<string, NodeProperties>();
var treeNodeInstance = new TreeNodeInstance();
var xmlDocument = new XmlDocument();
xmlDocument.Load(tracciatoXml);
ParseXml(xmlDocument, nodeNameAndBuiltInTypes, treeNodeInstance);
return treeNodeInstance;
}
private void CreateSubDictionary(string path, XmlNode component, IDictionary<string, NodeProperties> nodeNameAndBuiltInTypes, TreeNodeInstance treeNodeInstance) private void CreateSubDictionary(string path, XmlNode component, IDictionary<string, NodeProperties> nodeNameAndBuiltInTypes, TreeNodeInstance treeNodeInstance)
{ {
string redisPath = path.Replace("/", ":"); string redisPath = path.Replace("/", ":");
foreach (XmlElement xmlElement in component) foreach (XmlElement xmlElement in component)
{ {
var nodeVGroup = xmlElement.Attributes["VGroup"]?.Value ?? "A"; // default: ALL
if (xmlElement.Name != "Component" && xmlElement.Name != "Conditions" && xmlElement.Name != "Property") if (xmlElement.Name != "Component" && xmlElement.Name != "Conditions" && xmlElement.Name != "Property")
{ {
var nodeName = xmlElement.Attributes["BrowseName"].Value; var nodeName = xmlElement.Attributes["BrowseName"].Value;
@@ -46,6 +60,7 @@ namespace SOUR.Core
// 2019.01.29 aggiunta decodifica nuove conf XML, con valori default // 2019.01.29 aggiunta decodifica nuove conf XML, con valori default
var nodeSGroup = xmlElement.Attributes["SGroup"]?.Value ?? "3"; var nodeSGroup = xmlElement.Attributes["SGroup"]?.Value ?? "3";
var nodeDBand = xmlElement.Attributes["DBand"]?.Value ?? ""; var nodeDBand = xmlElement.Attributes["DBand"]?.Value ?? "";
var nodeVGroup = xmlElement.Attributes["VGroup"]?.Value ?? "A"; // default: ALL
//var parentName = component.Attributes["Name"].Value ?? ""; //var parentName = component.Attributes["Name"].Value ?? "";
@@ -77,8 +92,7 @@ namespace SOUR.Core
BrowseName = path + "/" + symbolicName, BrowseName = path + "/" + symbolicName,
DisplayName = symbolicName, DisplayName = symbolicName,
NodePropertyType = nodeProperties.NodePropertiesType, NodePropertyType = nodeProperties.NodePropertiesType,
NodeDataType = nodeProperties.NodeDataType, NodeDataType = nodeProperties.NodeDataType
Visibility = nodeVGroup
}); });
} }
else if (xmlElement.Name == "Property") else if (xmlElement.Name == "Property")
@@ -87,42 +101,46 @@ namespace SOUR.Core
var propSymbolicName = xmlElement.Attributes["SymbolicName"].Value; var propSymbolicName = xmlElement.Attributes["SymbolicName"].Value;
var propNodeDataType = xmlElement.Attributes["DataType"].Value ?? null; var propNodeDataType = xmlElement.Attributes["DataType"].Value ?? null;
string nodeSGroup = "5"; // fix a 5 string nodeSGroup = "5"; // fix a 5
var propNodeVGroup = xmlElement.Attributes["VGroup"]?.Value ?? "A"; // default: ALL
var nodeProperties = new NodeProperties(propName, propNodeDataType, "", null, null, nodeSGroup, null, nodeVGroup, NodePropertiesType.Property); var nodeProperties = new NodeProperties(propName, propNodeDataType, "", null, null, nodeSGroup, null, propNodeVGroup, NodePropertiesType.Property);
var key = path.EndsWith("/") ? path + propSymbolicName : path + "/" + propSymbolicName; var key = path.EndsWith("/") ? path + propSymbolicName : path + "/" + propSymbolicName;
nodeNameAndBuiltInTypes.Add(key, nodeProperties); nodeNameAndBuiltInTypes.Add(key, nodeProperties);
treeNodeInstance.AddChild(new TreeNodeInstance() treeNodeInstance.AddChild(new TreeNodeInstance()
{ {
BrowseName = key, BrowseName = key,
DisplayName = propSymbolicName, DisplayName = propSymbolicName,
NodePropertyType = nodeProperties.NodePropertiesType, NodePropertyType = nodeProperties.NodePropertiesType,
NodeDataType = nodeProperties.NodeDataType, NodeDataType = nodeProperties.NodeDataType
Visibility = nodeVGroup
}); });
} }
else else
{ {
if (xmlElement.Name != "Property") if (xmlElement.Name != "Property")
{ {
var name = xmlElement.Attributes["Name"].Value; var name = xmlElement.Attributes["Name"].Value;
var treeNodeChild = new TreeNodeInstance() var treeNodeChild = new TreeNodeInstance()
{ {
BrowseName = path + "/" + name, BrowseName = path + "/" + name,
DisplayName = name, DisplayName = name,
NodePropertyType = NodePropertiesType.Folder, NodePropertyType = NodePropertiesType.Folder,
NodeDataType = null, NodeDataType = null
Visibility = nodeVGroup
}; };
treeNodeInstance.AddChild(treeNodeChild); treeNodeInstance.AddChild(treeNodeChild);
CreateSubDictionary(path + "/" + name, xmlElement, nodeNameAndBuiltInTypes, treeNodeChild); CreateSubDictionary(path + "/" + name, xmlElement, nodeNameAndBuiltInTypes, treeNodeChild);
} }
} }
} }
} }
private void ParseXml(XmlDocument xmlDocument, IDictionary<string, NodeProperties> nodeNameAndBuiltInTypes, private void ParseXml(XmlDocument xmlDocument, IDictionary<string, NodeProperties> nodeNameAndBuiltInTypes,
TreeNodeInstance treeNodeInstance) TreeNodeInstance treeNodeInstance)
{ {
@@ -142,6 +160,7 @@ namespace SOUR.Core
} }
foreach (XmlNode component in xmlNodeList) foreach (XmlNode component in xmlNodeList)
{ {
var stringFolderName = rootName + "/"; var stringFolderName = rootName + "/";
if (component.Name != "Component" && component.Name != "Components" && component.Name != "Property") if (component.Name != "Component" && component.Name != "Components" && component.Name != "Property")
{ {
@@ -165,6 +184,7 @@ namespace SOUR.Core
NodeProperties nodeProperties; NodeProperties nodeProperties;
if (component.Name == "Condition") if (component.Name == "Condition")
{ {
// HARD CODED traduzione messaggi a lingua corrente... in area AdpConf... // HARD CODED traduzione messaggi a lingua corrente... in area AdpConf...
@@ -194,6 +214,7 @@ namespace SOUR.Core
nodeNameAndBuiltInTypes.Add(stringFolderName + propSymbolicName, nodeProperties); nodeNameAndBuiltInTypes.Add(stringFolderName + propSymbolicName, nodeProperties);
treeNodeInstance.AddChild(new TreeNodeInstance() { BrowseName = stringFolderName + propSymbolicName, DisplayName = propSymbolicName, NodePropertyType = nodeProperties.NodePropertiesType, NodeDataType = nodeProperties.NodeDataType }); treeNodeInstance.AddChild(new TreeNodeInstance() { BrowseName = stringFolderName + propSymbolicName, DisplayName = propSymbolicName, NodePropertyType = nodeProperties.NodePropertiesType, NodeDataType = nodeProperties.NodeDataType });
} }
if (component.Name != "Property" && component.Attributes != null) if (component.Name != "Property" && component.Attributes != null)
@@ -209,36 +230,12 @@ namespace SOUR.Core
CreateSubDictionary(stringFolderName + component.Attributes["Name"].Value, component, nodeNameAndBuiltInTypes, treeNodeChild); CreateSubDictionary(stringFolderName + component.Attributes["Name"].Value, component, nodeNameAndBuiltInTypes, treeNodeChild);
} }
} }
} }
} }
#endregion Private Methods
#region Public Methods
public IDictionary<string, NodeProperties> CreateDictionaryFromXmlToGenerateValues(string tracciatoXml)
{
IDictionary<string, NodeProperties> nodeNameAndBuiltInTypes = new Dictionary<string, NodeProperties>();
var xmlDocument = new XmlDocument();
// carico XML appena salvato
xmlDocument.Load(tracciatoXml);
ParseXml(xmlDocument, nodeNameAndBuiltInTypes, new TreeNodeInstance());
return nodeNameAndBuiltInTypes;
} }
public TreeNodeInstance CreateTree(string tracciatoXml)
{
IDictionary<string, NodeProperties> nodeNameAndBuiltInTypes = new Dictionary<string, NodeProperties>();
var treeNodeInstance = new TreeNodeInstance();
var xmlDocument = new XmlDocument();
xmlDocument.Load(tracciatoXml);
ParseXml(xmlDocument, nodeNameAndBuiltInTypes, treeNodeInstance);
return treeNodeInstance;
}
#endregion Public Methods
}
} }
+8 -92
View File
@@ -8,11 +8,11 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.4.0" newVersion="1.2.4.0" /> <bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
@@ -24,7 +24,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Hosting" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Hosting" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.7.0" newVersion="2.2.7.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Https" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Https" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -60,11 +60,11 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" /> <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
@@ -76,7 +76,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -84,7 +84,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Http.Features" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Http.Features" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Http" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -92,7 +92,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.2.0" newVersion="4.3.2.0" /> <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -102,90 +102,6 @@
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Connections.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.FileProviders.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.Binder" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Hosting.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.EnvironmentVariables" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.FileExtensions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.FileProviders.Physical" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.ObjectPool" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.4.4.0" newVersion="1.4.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Principal.Windows" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.DispatchProxy" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Xml" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
</configuration> </configuration>
+6 -6
View File
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="log4net" version="2.0.8" targetFramework="net461" /> <package id="log4net" version="2.0.8" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
<package id="Pipelines.Sockets.Unofficial" version="2.1.0" targetFramework="net461" /> <package id="Pipelines.Sockets.Unofficial" version="2.0.22" targetFramework="net461" />
<package id="StackExchange.Redis" version="2.0.601" targetFramework="net461" /> <package id="StackExchange.Redis" version="2.0.601" targetFramework="net461" />
<package id="System.Buffers" version="4.5.0" targetFramework="net461" /> <package id="System.Buffers" version="4.5.0" targetFramework="net461" />
<package id="System.Diagnostics.PerformanceCounter" version="4.6.0" targetFramework="net461" /> <package id="System.Diagnostics.PerformanceCounter" version="4.5.0" targetFramework="net461" />
<package id="System.IO.Pipelines" version="4.6.0" targetFramework="net461" /> <package id="System.IO.Pipelines" version="4.5.3" targetFramework="net461" />
<package id="System.Memory" version="4.5.3" targetFramework="net461" /> <package id="System.Memory" version="4.5.3" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" /> <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net461" /> <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net461" />
<package id="System.Threading.Channels" version="4.6.0" targetFramework="net461" /> <package id="System.Threading.Channels" version="4.5.0" targetFramework="net461" />
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net461" /> <package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net461" />
</packages> </packages>
-49
View File
@@ -1,49 +0,0 @@
{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\froman\fprq2\fcharset2 Symbol;}}
{\colortbl ;\red0\green0\blue0;\red0\green0\blue255;}
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\nowidctlpar\sb120\sa120\b\f0\fs20 MICROSOFT SOFTWARE LICENSE TERMS\f1\par
\pard\brdrb\brdrs\brdrw10\brsp20 \nowidctlpar\sb120\sa120\f0 MICROSOFT SPEECH PLATFORM - SERVER RUNTIME \cf1 10.\f1 0\cf0\par
\pard\nowidctlpar\sb120\sa120\b0\f0 These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft\f1\par
\pard\nowidctlpar\fi-360\li360\sb120\sa120\tx360\f2\'b7\tab\f0 updates,\f1\par
\pard\nowidctlpar\fi-360\li360\sb120\sa120\f2\'b7\tab\f0 supplements,\f1\par
\f2\'b7\tab\f0 Internet-based services, and \f1\par
\f2\'b7\tab\f0 support services\f1\par
\pard\nowidctlpar\sb120\sa120\f0 for this software, unless other terms accompany those items. If so, those terms apply.\f1\par
\b\f0 By using the software, you accept these terms. If you do not accept them, do not use the software.\f1\par
\pard\brdrt\brdrs\brdrw10\brsp20 \nowidctlpar\sb120\sa120\f0 If you comply with these license terms, you have the rights below.\f1\par
\pard\nowidctlpar\fi-357\li357\sb120\sa120\tx360\f0 1.\tab INSTALLATION AND USE RIGHTS. \b0 You may install and use any number of copies of the software on your devices running validly licensed copies of Windows Server 2003 or later version, as well as Microsoft Speech Platform SDK v10.1 and/or a non-Microsoft product which has been developed using the Microsoft Speech Platform SDK v10.0. If you are downloading this software in connection with such non-Microsoft product, then the terms associated with that product apply.\b\f1\par
\pard\nowidctlpar\fi-357\li357\sb120\sa120\caps\f0 2.\tab Scope of License\caps0\f1 .\b0\f0 The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not\b\f1\par
\pard\nowidctlpar\fi-363\li720\sb120\sa120\tx720\b0\f2\'b7\tab\f0 disclose the results of any benchmark tests of the software to any third party without Microsoft\rquote s prior written approval\fs19 ;\f1\fs20\par
\pard\nowidctlpar\fi-363\li720\sb120\sa120\f2\'b7\tab\f0 work around any technical limitations in the software\fs19 ;\f1\fs20\par
\f2\'b7\tab\f0 reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation\fs19 ;\f1\fs20\par
\f2\'b7\tab\f0 make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation\fs19 ;\f1\fs20\par
\f2\'b7\tab\f0 publish the software for others to copy\fs19 ;\f1\fs20\par
\f2\'b7\tab\f0 rent, lease or lend the software\fs19 ;\f1\fs20\par
\f2\'b7\tab\f0 transfer the software or this agreement to any third party\fs19 ; or\f1\fs20\par
\f2\'b7\tab\f0 use the software for commercial software hosting services\f1\fs19 .\fs20\par
\pard\nowidctlpar\fi-357\li357\sb120\sa120\tx360\b\f0 3.\tab BACKUP COPY.\b0 You may make one backup copy of the software. You may use it only to reinstall the software.\b\f1\par
\pard\nowidctlpar\fi-357\li357\sb120\sa120\f0 4.\tab DOCUMENTATION.\b0 Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.\b\f1\par
\caps\f0 5.\tab Export Restrictions\caps0\f1 .\b0\f0 The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see {\field{\*\fldinst{HYPERLINK "www.microsoft.com/exporting"}}{\fldrslt{\ul\cf2 www.microsoft.com/exporting}}}\f1\fs20 .\b\par
\caps\f0 6.\tab SUPPORT SERVICES.\caps0 \b0 Because this software is \ldblquote as is,\rdblquote we may not provide support services for it.\b\f1\par
\caps\f0 7.\tab Entire Agreement.\b0\caps0 This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.\f1\par
\pard\nowidctlpar\fi-360\li360\sb120\sa120\tx360\b\caps\f0 8.\tab Applicable Law\caps0\f1 .\par
\pard\nowidctlpar\fi-363\li720\sb120\sa120\tx720\f0 a.\tab United States.\b0 If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.\b\f1\par
\pard\nowidctlpar\fi-363\li720\sb120\sa120\f0 b.\tab Outside the United States.\b0 If you acquired the software in any other country, the laws of that country apply.\b\f1\par
\pard\nowidctlpar\fi-357\li357\sb120\sa120\tx360\caps\f0 9.\tab Legal Effect.\b0\caps0 This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.\b\caps\f1\par
\pard\nowidctlpar\fi-357\li357\sb120\sa120\f0 10.\tab Disclaimer of Warranty.\caps0 The software is licensed \ldblquote as-is.\rdblquote You bear the risk of using it. Microsoft gives no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this agreement cannot change. To the extent permitted under your local laws, Microsoft excludes the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\caps\f1\par
\pard\nowidctlpar\fi-360\li360\sb120\sa120\tx360\f0 11.\tab Limitation on and Exclusion of Remedies and Damages. \caps0 You can recover from Microsoft and its suppliers only direct damages up to U.S. $5.00. You cannot recover any other damages, including consequential, lost profits, special, indirect or incidental damages.\caps\f1\par
\pard\nowidctlpar\li357\sb120\sa120\b0\caps0\f0 This limitation applies to\f1\par
\pard\nowidctlpar\fi-363\li720\sb120\sa120\tx720\f2\'b7\tab\f0 anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and\f1\par
\pard\nowidctlpar\fi-363\li720\sb120\sa120\f2\'b7\tab\f0 claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.\f1\par
\pard\nowidctlpar\li360\sb120\sa120\f0 It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.\f1\par
\pard\nowidctlpar\sb120\sa120\b\f0 Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.\f1\par
\f0 Remarque : Ce logiciel \'e9tant distribu\'e9 au Qu\'e9bec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en fran\'e7ais.\f1\par
\f0 EXON\'c9RATION DE GARANTIE.\b0 Le logiciel vis\'e9 par une licence est offert \'ab tel quel \'bb. Toute utilisation de ce logiciel est \'e0 votre seule risque et p\'e9ril. Microsoft n\rquote accorde aucune autre garantie expresse. Vous pouvez b\'e9n\'e9ficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualit\'e9 marchande, d\rquote ad\'e9quation \'e0 un usage particulier et d\rquote absence de contrefa\'e7on sont exclues.\f1\par
\b\f0 LIMITATION DES DOMMAGES-INT\'c9R\'caTS ET EXCLUSION DE RESPONSABILIT\'c9 POUR LES DOMMAGES.\b0 Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement \'e0 hauteur de 5,00 $ US. Vous ne pouvez pr\'e9tendre \'e0 aucune indemnisation pour les autres dommages, y compris les dommages sp\'e9ciaux, indirects ou accessoires et pertes de b\'e9n\'e9fices.\f1\par
\f0 Cette limitation concerne :\f1\par
\pard\nowidctlpar\fi-360\li360\sb120\sa120\tx360\f2\'b7\tab\f0 tout ce qui est reli\'e9 au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et\f1\par
\pard\nowidctlpar\fi-360\li360\sb120\sa120\f2\'b7\tab\f0 les r\'e9clamations au titre de violation de contrat ou de garantie, ou au titre de responsabilit\'e9 stricte, de n\'e9gligence ou d\rquote une autre faute dans la limite autoris\'e9e par la loi en vigueur.\f1\par
\pard\nowidctlpar\sb120\sa120\f0 Elle s\rquote applique \'e9galement, m\'eame si Microsoft connaissait ou devrait conna\'eetre l\rquote\'e9ventualit\'e9 d\rquote un tel dommage. Si votre pays n\rquote autorise pas l\rquote exclusion ou la limitation de responsabilit\'e9 pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l\rquote exclusion ci-dessus ne s\rquote appliquera pas \'e0 votre \'e9gard.\f1\par
\b\f0 EFFET JURIDIQUE.\b0 Le pr\'e9sent contrat d\'e9crit certains droits juridiques. Vous pourriez avoir d\rquote autres droits pr\'e9vus par les lois de votre pays. \lang1036 Le pr\'e9sent contrat ne modifie pas les droits que vous conf\'e8rent les lois de votre pays si celles-ci ne le permettent pas.\par
\b\f1\par
}
-107
View File
@@ -1,107 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?define SOUR_TargetDir=$(var.SOUR.TargetDir)?>
<?define OpcUaCommon_TargetDir=$(var.OpcUaCommon.TargetDir)?>
<?define OpcUaServer.Server_TargetDir=$(var.OpcUaServer.Server.TargetDir)?>
<?define SOUR.Core_TargetDir=$(var.SOUR.Core.TargetDir)?>
<?define Manufacturer="Steamware"?>
<!--Calcolo il nome del prodotto...-->
<?define ProductName="SOUR" ?>
<?if $(var.SOUR.Configuration) = "Debug" ?>
<?define ProductName="$(var.ProductName)-unstable" ?>
<?endif?>
<Product Id="2cacd1b8-991b-48d6-a7ae-55464641bd74" Name="$(var.ProductName)" Language="1033" Version="!(bind.FileVersion.SOUR.exe)" Manufacturer="Steamware srl" UpgradeCode="7e0cd98d-b481-4776-86ce-93ce56575e64">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Description="$(var.ProductName)" />
<!--<Product Id="2cacd1b8-991b-48d6-a7ae-55464641bd74" Name="SOUR" Language="1033" Version="!(bind.FileVersion.SOUR.exe)" Manufacturer="Steamware srl" UpgradeCode="7e0cd98d-b481-4776-86ce-93ce56575e64">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />-->
<!--Aggiunto UI x finestra di dialogo x InstallDir-->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<UIRef Id="WixUI_InstallDir" />
<Icon Id="icon.ico" SourceFile="$(var.ProjectDir)icon.ico" />
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<!--
RemoveFolderEx requires that we "remember" the path for uninstall.
Read the path value and set the APPLICATIONFOLDER property with the value.
-->
<Property Id="APPLICATIONFOLDER">
<RegistrySearch Key="SOFTWARE\$(var.Manufacturer)\$(var.ProductName)" Root="HKLM" Type="raw" Id="APPLICATIONFOLDER_REGSEARCH" Name="Path" />
</Property>
<!--<DirectoryRef Id="APPLICATIONFOLDER">
<Component Id="CleanupMainApplicationFolder" Guid="*">
<RegistryValue Root="HKLM" Key="SOFTWARE\$(var.Manufacturer)\$(var.ProductName)" Name="Path" Type="string" Value="[APPLICATIONFOLDER]" KeyPath="yes" />
<util:RemoveFolderEx On="uninstall" Property="APPLICATIONFOLDER" />
</Component>
</DirectoryRef>-->
<!--Licenza d'uso (std microsoft)-->
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\License.rtf" />
<!--Messaggio upgrade-->
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<!--Unico file senza cab esterni-->
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="SOUR" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="lib_files" />
<ComponentGroupRef Id="logs_files" />
<ComponentGroupRef Id="Rec_files" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SOUR">
<Directory Id="lib" Name="lib" />
<Directory Id="Rec" Name="Rec" />
<Directory Id="logs" Name="logs" />
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="Server.Config.xml" Guid="73b30dbd-3440-4481-93b0-b42d9ed445d6">
<File Id="Server.Config.xml" Name="Server.Config.xml" Source="$(var.SOUR_TargetDir)Server.Config.xml" />
</Component>
<Component Id="SOUR.exe" Guid="96f41478-f3dc-45b0-8b1b-3f6ec5db9504">
<File Id="SOUR.exe" Name="SOUR.exe" Source="$(var.SOUR_TargetDir)SOUR.exe" />
</Component>
<Component Id="SOUR.exe.config" Guid="da7fd54d-f097-4137-b735-0a16ae3b7560">
<File Id="SOUR.exe.config" Name="SOUR.exe.config" Source="$(var.SOUR_TargetDir)SOUR.exe.config" />
</Component>
<Component Id="SOUR.Core.dll.config" Guid="f1cfec8e-7659-4648-a69a-e05353f10ef2">
<File Id="SOUR.Core.dll.config" Name="SOUR.Core.dll.config" Source="$(var.SOUR.Core_TargetDir)SOUR.Core.dll.config" />
</Component>
<Component Id="DataModel.xml" Guid="2148150e-2fe4-42b4-a8cc-c5003f99785d">
<File Id="DataModel.xml" Name="DataModel.xml" Source="$(var.SOUR_TargetDir)DataModel.xml" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="lib_files" Directory="lib">
<Component Id="lib_.placeholder" Guid="9c71c67e-f8b4-4877-bcea-695af0b9586e">
<File Id="lib_.placeholder" Name=".placeholder" Source="$(var.SOUR_TargetDir)lib\.placeholder" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="logs_files" Directory="logs">
<Component Id="logs_.placeholder" Guid="94e4b013-afda-4021-aade-9cbab56c35cb">
<File Id="logs_.placeholder" Name=".placeholder" Source="$(var.SOUR_TargetDir)logs\.placeholder" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="Rec_files" Directory="Rec">
<Component Id="Rec_.placeholder" Guid="350a29b7-7ae3-4c19-be04-6b4c69563883">
<File Id="Rec_.placeholder" Name=".placeholder" Source="$(var.SOUR_TargetDir)Rec\.placeholder" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
-13
View File
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-16"?>
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DeployedProjects>
<string>SOUR\SOUR.csproj</string>
</DeployedProjects>
<DirectoryMappings>
<Item Key="" Value="INSTALLFOLDER" />
</DirectoryMappings>
<FileMappings />
<DeploySymbols>false</DeploySymbols>
<DeployLocalizations>false</DeployLocalizations>
<DeployExternalLocalizations>false</DeployExternalLocalizations>
</Configuration>
-89
View File
@@ -1,89 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>c60609f8-e274-4ed3-a14e-06a8f978ff3b</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>SOUR</OutputName>
<OutputType>Package</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="Product.wxs" />
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
<Content Include="License.rtf" />
<Content Include="SOUR.Setup.wax" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpcUaCommon\OpcUaCommon.csproj">
<Name>OpcUaCommon</Name>
<Project>{4c09fe6b-20fe-4a16-8443-f8be8ae0849a}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\OpcUaServer.Server\OpcUaServer.Server.csproj">
<Name>OpcUaServer.Server</Name>
<Project>{1e81f982-2e67-4f37-9d0d-c1e1f2c3c415}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\SOUR.Core\SOUR.Core.csproj">
<Name>SOUR.Core</Name>
<Project>{c91082e5-3ec7-4ae7-b2f1-c7c194a02165}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\SOUR\SOUR.csproj">
<Name>SOUR</Name>
<Project>{a924c997-f587-429a-a492-867460320b81}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Folder Include="Images" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

+5 -29
View File
@@ -13,62 +13,38 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SOUR", "SOUR\SOUR.csproj",
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{C26EADFE-AEC9-45EC-BAF4-C699721496F6}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{C26EADFE-AEC9-45EC-BAF4-C699721496F6}"
EndProject EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SOUR.Setup", "SOUR.Setup\SOUR.Setup.wixproj", "{C60609F8-E274-4ED3-A14E-06A8F978FF3B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XUnitTestSOUR", "XUnitTestSOUR\XUnitTestSOUR.csproj", "{72E9A21C-6D52-471C-BA6F-EDDC8CDE8D74}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Debug|Any CPU.Build.0 = Debug|Any CPU {1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Debug|x86.ActiveCfg = Debug|Any CPU
{1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Debug|x86.Build.0 = Debug|Any CPU
{1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Release|Any CPU.ActiveCfg = Release|Any CPU {1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Release|Any CPU.Build.0 = Release|Any CPU {1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Release|Any CPU.Build.0 = Release|Any CPU
{1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Release|x86.ActiveCfg = Release|Any CPU
{1E81F982-2E67-4F37-9D0D-C1E1F2C3C415}.Release|x86.Build.0 = Release|Any CPU
{C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Debug|Any CPU.Build.0 = Debug|Any CPU {C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Debug|x86.ActiveCfg = Debug|Any CPU
{C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Debug|x86.Build.0 = Debug|Any CPU
{C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Release|Any CPU.ActiveCfg = Release|Any CPU {C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Release|Any CPU.Build.0 = Release|Any CPU {C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Release|Any CPU.Build.0 = Release|Any CPU
{C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Release|x86.ActiveCfg = Release|Any CPU
{C91082E5-3EC7-4AE7-B2F1-C7C194A02165}.Release|x86.Build.0 = Release|Any CPU
{4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Debug|Any CPU.Build.0 = Debug|Any CPU {4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Debug|x86.ActiveCfg = Debug|Any CPU
{4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Debug|x86.Build.0 = Debug|Any CPU
{4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Release|Any CPU.ActiveCfg = Release|Any CPU {4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Release|Any CPU.Build.0 = Release|Any CPU {4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Release|Any CPU.Build.0 = Release|Any CPU
{4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Release|x86.ActiveCfg = Release|Any CPU
{4C09FE6B-20FE-4A16-8443-F8BE8AE0849A}.Release|x86.Build.0 = Release|Any CPU
{A924C997-F587-429A-A492-867460320B81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A924C997-F587-429A-A492-867460320B81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A924C997-F587-429A-A492-867460320B81}.Debug|Any CPU.Build.0 = Debug|Any CPU {A924C997-F587-429A-A492-867460320B81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A924C997-F587-429A-A492-867460320B81}.Debug|x86.ActiveCfg = Debug|Any CPU
{A924C997-F587-429A-A492-867460320B81}.Debug|x86.Build.0 = Debug|Any CPU
{A924C997-F587-429A-A492-867460320B81}.Release|Any CPU.ActiveCfg = Release|Any CPU {A924C997-F587-429A-A492-867460320B81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A924C997-F587-429A-A492-867460320B81}.Release|Any CPU.Build.0 = Release|Any CPU {A924C997-F587-429A-A492-867460320B81}.Release|Any CPU.Build.0 = Release|Any CPU
{A924C997-F587-429A-A492-867460320B81}.Release|x86.ActiveCfg = Release|Any CPU
{A924C997-F587-429A-A492-867460320B81}.Release|x86.Build.0 = Release|Any CPU
{C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Debug|Any CPU.Build.0 = Debug|Any CPU {C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Debug|x86.ActiveCfg = Debug|Any CPU
{C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Debug|x86.Build.0 = Debug|Any CPU
{C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Release|Any CPU.ActiveCfg = Release|Any CPU {C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Release|Any CPU.Build.0 = Release|Any CPU {C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Release|Any CPU.Build.0 = Release|Any CPU
{C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Release|x86.ActiveCfg = Release|Any CPU {72E9A21C-6D52-471C-BA6F-EDDC8CDE8D74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C26EADFE-AEC9-45EC-BAF4-C699721496F6}.Release|x86.Build.0 = Release|Any CPU {72E9A21C-6D52-471C-BA6F-EDDC8CDE8D74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C60609F8-E274-4ED3-A14E-06A8F978FF3B}.Debug|Any CPU.ActiveCfg = Debug|x86 {72E9A21C-6D52-471C-BA6F-EDDC8CDE8D74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C60609F8-E274-4ED3-A14E-06A8F978FF3B}.Debug|x86.ActiveCfg = Debug|x86 {72E9A21C-6D52-471C-BA6F-EDDC8CDE8D74}.Release|Any CPU.Build.0 = Release|Any CPU
{C60609F8-E274-4ED3-A14E-06A8F978FF3B}.Debug|x86.Build.0 = Debug|x86
{C60609F8-E274-4ED3-A14E-06A8F978FF3B}.Release|Any CPU.ActiveCfg = Release|x86
{C60609F8-E274-4ED3-A14E-06A8F978FF3B}.Release|x86.ActiveCfg = Release|x86
{C60609F8-E274-4ED3-A14E-06A8F978FF3B}.Release|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
-3
View File
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--For more information on using transformations see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. --> <!--For more information on using transformations see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="simRequeue" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)" />
</appSettings>
</configuration> </configuration>
-3
View File
@@ -4,8 +4,5 @@
<appSettings> <appSettings>
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" xdt:Transform="Replace" xdt:Locator="Match(key)"/> <add key="RedisConn" value="localhost,abortConnect=false,ssl=false" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false,allowAdmin=true" xdt:Transform="Replace" xdt:Locator="Match(key)"/> <add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false,allowAdmin=true" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="doRecord" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)" />
<add key="doRecProp" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)" />
<add key="simRequeue" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)" />
</appSettings> </appSettings>
</configuration> </configuration>
+13 -99
View File
@@ -9,14 +9,12 @@
<add key="DataModelPath" value="DataModel.xml" /> <add key="DataModelPath" value="DataModel.xml" />
<add key="TestMode" value="true" /> <add key="TestMode" value="true" />
<add key="RSamplInt" value="20" /> <add key="RSamplInt" value="20" />
<add key="cntDwn_1" value="1" /> <add key="cntDwn_1" value="3" />
<add key="cntDwn_2" value="2" /> <add key="cntDwn_2" value="7" />
<add key="cntDwn_3" value="11" /> <add key="cntDwn_3" value="29" />
<add key="cntDwn_4" value="23" /> <add key="cntDwn_4" value="101" />
<add key="cntDwn_5" value="101" /> <add key="cntDwn_5" value="401" />
<add key="waitResendCondition" value="1500" /> <add key="waitResendCondition" value="1500" />
<add key="waitEventDequeue" value="1000" />
<add key="simRequeue" value="true" />
<!--Gestione allarmi: modo tra TEXT / LIST--> <!--Gestione allarmi: modo tra TEXT / LIST-->
<add key="AlarmListMode" value="LIST" /> <add key="AlarmListMode" value="LIST" />
<!--Indica se allarmi statici (=true) oppure da rileggere SEMPRE da REDIS (=false) --> <!--Indica se allarmi statici (=true) oppure da rileggere SEMPRE da REDIS (=false) -->
@@ -45,11 +43,11 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.4.0" newVersion="1.2.4.0" /> <bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
@@ -65,7 +63,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Hosting" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Hosting" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.7.0" newVersion="2.2.7.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Https" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Https" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -102,11 +100,11 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" /> <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
@@ -118,7 +116,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -126,7 +124,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Http.Features" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Http.Features" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Http" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -134,7 +132,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.2.0" newVersion="4.3.2.0" /> <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" publicKeyToken="adb9793829ddae60" culture="neutral" /> <assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -144,90 +142,6 @@
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Connections.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.FileProviders.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.Binder" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Hosting.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.EnvironmentVariables" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Configuration.FileExtensions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.FileProviders.Physical" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.ObjectPool" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.4.4.0" newVersion="1.4.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Principal.Windows" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.DispatchProxy" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Xml" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<log4net> <log4net>
-193
View File
@@ -1,193 +0,0 @@
<ModelDesign>
<Machine>
<Property SymbolicName="Model" BrowseName="Model" DataType="ua:String" ValueRank="Scalar" Value="ANTARES26/15-PX5" />
<Property SymbolicName="Manufacturer" BrowseName="Manufacturer" DataType="ua:String" ValueRank="Scalar" Value="CMS Industries" />
<Property SymbolicName="Serial" BrowseName="Serial" DataType="ua:String" ValueRank="Scalar" Value="9206" />
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="CNC_MACHINE" />
<Property SymbolicName="BuildYear" BrowseName="BuildYear" DataType="ua:String" ValueRank="Scalar" Value="2019" />
<Variable SymbolicName="Status" BrowseName="Status" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="Alarm" BrowseName="Alarm" DataType="ua:Boolean" ValueRank="Scalar" Units="Bool" />
<Variable SymbolicName="Emergency" BrowseName="Emergency" DataType="ua:Boolean" ValueRank="Scalar" Units="Bool" />
<Variable SymbolicName="Power" BrowseName="Power" DataType="ua:Boolean" ValueRank="Scalar" Units="Bool" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="001" CmsDataOpt="HOURS" />
<Variable SymbolicName="ActiveWorkingTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="002" CmsDataOpt="HOURS" />
<Component Name="Events">
<Variable SymbolicName="Production" BrowseName="Production" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="1" />
<Variable SymbolicName="Kpis" BrowseName="Kpis" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="1" VGroup="P" />
<Variable SymbolicName="Tools" BrowseName="Tools" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="1" VGroup="P" />
<Variable SymbolicName="Downtimes" BrowseName="Downtimes" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="1" VGroup="P" />
<Variable SymbolicName="Messages" BrowseName="MEssages" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="1" VGroup="P" />
</Component>
<Component Name="Cnc">
<Property SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Value="OSAI" />
<Property SymbolicName="Version" BrowseName="Version" DataType="ua:String" ValueRank="Scalar" Value="2019" />
<Condition SymbolicName="Condition" BrowseName="Condition" DataType="ua:String" ValueRank="Scalar" Type="OffNormalAlarmState" Units="" />
<Component Name="CncProcesses" VGroup="P">
<Component Name="01">
<Variable SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="CodG" BrowseName="CodG" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="2" VGroup="P" />
<Variable SymbolicName="CodM" BrowseName="CodM" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="2" VGroup="P" />
<Variable SymbolicName="CodS" BrowseName="CodS" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="2" VGroup="P" />
<Variable SymbolicName="CodT" BrowseName="CodT" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="2" VGroup="P" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:String" ValueRank="Scalar" Units="" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:String" ValueRank="Scalar" Units="" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:String" ValueRank="Scalar" Units="m/min" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:String" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:String" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="SpeedOverride" BrowseName="SpeedOverride" DataType="ua:String" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="Mode" BrowseName="Mode" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="SubMode" BrowseName="SubMode" DataType="ua:String" ValueRank="Scalar" Units="" />
<Variable SymbolicName="Status" BrowseName="Status" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
</Component>
</Component>
</Component>
<Component Name="Plc" VGroup="P">
<Property SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Value="SIEMENS" />
<Property SymbolicName="Version" BrowseName="Version" DataType="ua:String" ValueRank="Scalar" Value="2019" />
<Condition SymbolicName="Condition" BrowseName="Condition" DataType="ua:String" ValueRank="Scalar" Type="OffNormalAlarmState" Units="" />
</Component>
<Component Name="Hmi" VGroup="P">
<Property SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Value="CMS Active" />
<Property SymbolicName="Version" BrowseName="Version" DataType="ua:String" ValueRank="Scalar" Value="1.00.02" />
<Condition SymbolicName="Condition" BrowseName="Condition" DataType="ua:String" ValueRank="Scalar" Type="OffNormalAlarmState" Units="" />
<Variable SymbolicName="User" BrowseName="User" DataType="ua:String" ValueRank="Scalar" Units="" />
<Variable SymbolicName="Language" BrowseName="Language" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="ActiveSection" BrowseName="ActiveSection" DataType="ua:String" ValueRank="Scalar" Units="h" />
<Variable SymbolicName="ActiveTimeSession" BrowseName="ActiveTimeSession" DataType="ua:String" ValueRank="Scalar" Units="" />
</Component>
<Component Name="Axes" VGroup="P">
<Component Name="01">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LINEAR" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="026" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="001" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="005" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Km" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="004" CmsDataOpt="METER" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="m/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="02">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LINEAR" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="027" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="002" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="007" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Km" CmsDataType="CounterList" CmsDataIndex="006" CmsDataOpt="METER" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="m/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="03">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LINEAR" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="028" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="003" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="009" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Km" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="008" CmsDataOpt="METER" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="m/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="04">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="ROTATIONAL" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="029" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="004" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="deg" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="deg" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="011" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="KRev" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="010" CmsDataOpt="NUM" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="rpm/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="05">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="ROTATIONAL" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="030" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="005" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="deg" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="deg" SGroup="4" DBand="1" VGroup="P" />
<Variable CmsDataType="CounterList" SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataIndex="013" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="KRev" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="012" CmsDataOpt="NUM" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="rpm/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="06">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LINEAR" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="SLAVE" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="031" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="1" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="006" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="015" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Km" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="014" CmsDataOpt="METER" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="m/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
</Component>
<Component Name="OperatingGroups" VGroup="P">
<Component Name="01">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="SPINDLE" />
<Property SymbolicName="Model" BrowseName="Model" DataType="ua:String" ValueRank="Scalar" Value="CMS-SPINDLE-01" />
<Variable SymbolicName="Status" BrowseName="Status" DataType="ua:String" ValueRank="Scalar" Units="Enum" CmsDataType="StatusList" CmsDataIndex="006" CmsDataOpt="BIT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Krev" CmsDataType="CounterList" CmsDataIndex="016" CmsDataOpt="NUM" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="016" CmsDataOpt="HOURS" />
<Variable SymbolicName="SpeedRate" BrowseName="SpeedRate" DataType="ua:UInt32" ValueRank="Scalar" Units="rpm" />
<Variable SymbolicName="SpeedOverride" BrowseName="SpeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ToolChanges" BrowseName="ToolChanges" DataType="ua:Float" ValueRank="Scalar" Units="Count" CmsDataType="CounterList" CmsDataIndex="025" CmsDataOpt="NUM" />
<Variable SymbolicName="ToolId" BrowseName="ToolId" DataType="ua:Float" ValueRank="Scalar" Units="" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
</Component>
<Component Name="AuxiliaryGroups" VGroup="P">
<Component Name="01">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LUBRO" />
<Variable SymbolicName="Repetitions" BrowseName="Repetitions" DataType="ua:Float" ValueRank="Scalar" Units="Count" CmsDataType="CounterList" CmsDataIndex="021" CmsDataOpt="NUM" />
</Component>
<Component Name="02">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="VACUUM_PUMP" />
<Variable SymbolicName="Status" BrowseName="Status" DataType="ua:String" ValueRank="Scalar" Units="Enum" CmsDataType="StatusList" CmsDataIndex="002" CmsDataOpt="BIT" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="017" CmsDataOpt="HOURS" />
</Component>
<Component Name="03">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="VACUUM_ACT" />
<Variable SymbolicName="Repetitions" BrowseName="Repetitions" DataType="ua:Float" ValueRank="Scalar" Units="Count" CmsDataType="CounterList" CmsDataIndex="019" CmsDataOpt="NUM" />
</Component>
</Component>
</Machine>
</ModelDesign>
+185 -2
View File
@@ -1,6 +1,189 @@
<ModelDesign> <ModelDesign>
<Machine> <Machine>
<Property SymbolicName="Model" BrowseName="Model" DataType="ua:String" ValueRank="Scalar" Value="TEST-MACHINE" /> <Property SymbolicName="Model" BrowseName="Model" DataType="ua:String" ValueRank="Scalar" Value="ANTARES26/15-PX5" />
<Property SymbolicName="Manufacturer" BrowseName="Manufacturer" DataType="ua:String" ValueRank="Scalar" Value="ACME Industries" /> <Property SymbolicName="Manufacturer" BrowseName="Manufacturer" DataType="ua:String" ValueRank="Scalar" Value="CMS Industries" />
<Property SymbolicName="Serial" BrowseName="Serial" DataType="ua:String" ValueRank="Scalar" Value="9206" />
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="CNC_MACHINE" />
<Property SymbolicName="BuildYear" BrowseName="BuildYear" DataType="ua:String" ValueRank="Scalar" Value="2019" />
<Variable SymbolicName="Status" BrowseName="Status" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="Alarm" BrowseName="Alarm" DataType="ua:Boolean" ValueRank="Scalar" Units="Bool" />
<Variable SymbolicName="Emergency" BrowseName="Emergency" DataType="ua:Boolean" ValueRank="Scalar" Units="Bool" />
<Variable SymbolicName="Power" BrowseName="Power" DataType="ua:Boolean" ValueRank="Scalar" Units="Bool" />
<!--<Variable SymbolicName="Mode" BrowseName="Mode" DataType="ua:String" ValueRank="Scalar" Units="Enum" />-->
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="001" CmsDataOpt="HOURS" />
<Variable SymbolicName="ActiveWorkingTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="002" CmsDataOpt="HOURS" />
<Component Name="Cnc">
<Property SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Value="OSAI" />
<Property SymbolicName="Version" BrowseName="Version" DataType="ua:String" ValueRank="Scalar" Value="2019" />
<Condition SymbolicName="Condition" BrowseName="Condition" DataType="ua:String" ValueRank="Scalar" Type="OffNormalAlarmState" Units="" />
<Component Name="CncProcesses">
<Component Name="01">
<Variable SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<!--<Variable SymbolicName="ActiveAxes" BrowseName="ActiveAxes" DataType="ua:String" ValueRank="Scalar" Units="" />-->
<Variable SymbolicName="CodG" BrowseName="CodG" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="2" VGroup="P" />
<Variable SymbolicName="CodM" BrowseName="CodM" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="2" VGroup="P" />
<Variable SymbolicName="CodS" BrowseName="CodS" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="2" VGroup="P" />
<Variable SymbolicName="CodT" BrowseName="CodT" DataType="ua:String" ValueRank="Scalar" Units="" SGroup="2" VGroup="P" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:String" ValueRank="Scalar" Units="" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:String" ValueRank="Scalar" Units="" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:String" ValueRank="Scalar" Units="m/min" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:String" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:String" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="SpeedOverride" BrowseName="SpeedOverride" DataType="ua:String" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="Mode" BrowseName="Mode" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="SubMode" BrowseName="SubMode" DataType="ua:String" ValueRank="Scalar" Units="" />
<Variable SymbolicName="Status" BrowseName="Status" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
</Component>
</Component>
</Component>
<Component Name="Plc">
<Property SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Value="SIEMENS" />
<Property SymbolicName="Version" BrowseName="Version" DataType="ua:String" ValueRank="Scalar" Value="2019" />
<Condition SymbolicName="Condition" BrowseName="Condition" DataType="ua:String" ValueRank="Scalar" Type="OffNormalAlarmState" Units="" />
</Component>
<Component Name="Hmi">
<Property SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Value="CMS Active" />
<Property SymbolicName="Version" BrowseName="Version" DataType="ua:String" ValueRank="Scalar" Value="1.00.02" />
<Condition SymbolicName="Condition" BrowseName="Condition" DataType="ua:String" ValueRank="Scalar" Type="OffNormalAlarmState" Units="" />
<Variable SymbolicName="User" BrowseName="User" DataType="ua:String" ValueRank="Scalar" Units="" />
<Variable SymbolicName="Language" BrowseName="Language" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="ActiveSection" BrowseName="ActiveSection" DataType="ua:String" ValueRank="Scalar" Units="h" />
<Variable SymbolicName="ActiveTimeSession" BrowseName="ActiveTimeSession" DataType="ua:String" ValueRank="Scalar" Units="" />
</Component>
<Component Name="Axes">
<Component Name="01">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LINEAR" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="026" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="001" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="005" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Km" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="004" CmsDataOpt="METER"/>
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="m/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="02">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LINEAR" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="027" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="002" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="007" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Km" CmsDataType="CounterList" CmsDataIndex="006" CmsDataOpt="METER" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="m/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="03">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LINEAR" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="028" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="003" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="009" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Km" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="008" CmsDataOpt="METER" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="m/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="04">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="ROTATIONAL" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="029" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="004" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="deg" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="deg" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="011" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="KRev" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="010" CmsDataOpt="NUM" />
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="rpm/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="05">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="ROTATIONAL" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="MASTER" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="030" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="0" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="005" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="deg" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="deg" SGroup="4" DBand="1" VGroup="P" />
<Variable CmsDataType="CounterList" SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataIndex="013" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="KRev" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="012" CmsDataOpt="NUM"/>
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="rpm/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
<Component Name="06">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LINEAR" />
<Variable SymbolicName="Name" BrowseName="Name" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Property SymbolicName="Role" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="SLAVE" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="031" CmsDataOpt="HOURS" />
<Variable SymbolicName="Direction" BrowseName="Direction" DataType="ua:String" ValueRank="Scalar" Units="Enum" />
<Variable SymbolicName="MasterId" BrowseName="Type" DataType="ua:UInt32" ValueRank="Scalar" Value="1" Units="NUM" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" CmsDataType="AnalogData" CmsDataIndex="006" CmsDataOpt="NUM" />
<Variable SymbolicName="CurrentPos" BrowseName="CurrentPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="TargetPos" BrowseName="TargetPos" DataType="ua:Float" ValueRank="Scalar" Units="mm" SGroup="2" DBand="1" VGroup="P" />
<Variable SymbolicName="Inversions" BrowseName="Inversions" DataType="ua:UInt32" ValueRank="Scalar" Units="Count" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="015" CmsDataOpt="COUNT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Km" SGroup="4" DBand="1" VGroup="P" CmsDataType="CounterList" CmsDataIndex="014" CmsDataOpt="METER"/>
<Variable SymbolicName="FeedRate" BrowseName="FeedRate" DataType="ua:Float" ValueRank="Scalar" Units="m/min" SGroup="4" DBand="1" VGroup="P" />
<Variable SymbolicName="FeedOverride" BrowseName="FeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="RapidOverride" BrowseName="RapidOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
</Component>
<Component Name="OperatingGroups">
<Component Name="01">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="SPINDLE" />
<Property SymbolicName="Model" BrowseName="Model" DataType="ua:String" ValueRank="Scalar" Value="CMS-SPINDLE-01" />
<Variable SymbolicName="Status" BrowseName="Status" DataType="ua:String" ValueRank="Scalar" Units="Enum" CmsDataType="StatusList" CmsDataIndex="006" CmsDataOpt="BIT" />
<Variable SymbolicName="Distance" BrowseName="Distance" DataType="ua:Float" ValueRank="Scalar" Units="Krev" CmsDataType="CounterList" CmsDataIndex="016" CmsDataOpt="NUM" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="016" CmsDataOpt="HOURS" />
<Variable SymbolicName="SpeedRate" BrowseName="SpeedRate" DataType="ua:UInt32" ValueRank="Scalar" Units="rpm" />
<Variable SymbolicName="SpeedOverride" BrowseName="SpeedOverride" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="Load" BrowseName="Load" DataType="ua:Float" ValueRank="Scalar" Units="Perc" />
<Variable SymbolicName="ToolChanges" BrowseName="ToolChanges" DataType="ua:Float" ValueRank="Scalar" Units="Count" CmsDataType="CounterList" CmsDataIndex="025" CmsDataOpt="NUM" />
<Variable SymbolicName="ToolId" BrowseName="ToolId" DataType="ua:Float" ValueRank="Scalar" Units="" />
<Variable SymbolicName="ParentProc" BrowseName="ParentProc" DataType="ua:UInt32" ValueRank="Scalar" Units="" />
</Component>
</Component>
<Component Name="AuxiliaryGroups">
<Component Name="01">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="LUBRO" />
<Variable SymbolicName="Repetitions" BrowseName="Repetitions" DataType="ua:Float" ValueRank="Scalar" Units="Count" CmsDataType="CounterList" CmsDataIndex="021" CmsDataOpt="NUM" />
</Component>
<Component Name="02">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="VACUUM_PUMP" />
<Variable SymbolicName="Status" BrowseName="Status" DataType="ua:String" ValueRank="Scalar" Units="Enum" CmsDataType="StatusList" CmsDataIndex="002" CmsDataOpt="BIT" />
<Variable SymbolicName="ActiveTime" BrowseName="ActiveTime" DataType="ua:Float" ValueRank="Scalar" Units="h" CmsDataType="CounterList" CmsDataIndex="017" CmsDataOpt="HOURS" />
</Component>
<Component Name="03">
<Property SymbolicName="Type" BrowseName="Type" DataType="ua:String" ValueRank="Scalar" Value="VACUUM_ACT" />
<Variable SymbolicName="Repetitions" BrowseName="Repetitions" DataType="ua:Float" ValueRank="Scalar" Units="Count" CmsDataType="CounterList" CmsDataIndex="019" CmsDataOpt="NUM" />
</Component>
</Component>
</Machine> </Machine>
</ModelDesign> </ModelDesign>
-3
View File
@@ -1,3 +0,0 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura />
</Weavers>
-111
View File
@@ -1,111 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCompression" type="xs:boolean">
<xs:annotation>
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCleanup" type="xs:boolean">
<xs:annotation>
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
-6
View File
@@ -70,8 +70,6 @@ namespace SOUR.Core
{ {
currPubData.usrBroker = "dev-5c86dced371e9e980142167d"; currPubData.usrBroker = "dev-5c86dced371e9e980142167d";
currPubData.pwdBroker = "9c4173da75"; currPubData.pwdBroker = "9c4173da75";
// loggo che sto aprtendo in modalita testing by SAM
printer.Print("***** SOUR: DEVELOP & TESTING MODE (S.E.L. workstation found) *****");
} }
#endif #endif
@@ -87,10 +85,6 @@ namespace SOUR.Core
autoReconnectDelayMs = 1000 autoReconnectDelayMs = 1000
}; };
} }
else
{
printer.Print($"***** SOUR: MQTT broker not starting: publishigData (user/pwd) IS OK: {hasPublishingData} | vetosend (GwHw key) IS PRESENT: {hasVetoSend} *****");
}
try try
{ {
-44
View File
@@ -1,44 +0,0 @@
<body>
<i>Server gestione Scehde di Collaudo</i>
<h4>Versione: {{CURRENT-REL}}</h4>
<br />
Note di rilascio:
<ul>
<li>
<b>Ultime modifiche:</b>
<ul>{{LAST-CHANGES}}</ul>
</li>
<li>
<b>v.3.1.* &rarr;</b>
<ul>
<li>Revisione ruoli</li>
<li>Gestione fasi con revisione e congelamento fasi</li>
<li>Nuovi elementi schede di collaudo</li>
<li>Implementazione sistema traduzione in campi schede/misure/parametri</li>
<li>Sistemi supporto traduzione/visualizzazione in lingua</li>
<li>Nuovi reports</li>
</ul>
</li>
<li>
<b>v.2.* &rarr;</b>
<ul>
<li>Implementazione modifiche per gestione in CMS</li>
</ul>
</li>
<li>
<b>v.1.* &rarr;</b>
<ul>
<li>Implementazione iniziale con gestione standard Ms AX + ISO9000 e succ</li>
</ul>
</li>
</ul>
<div>
<div style="float: left;">
<img src="logoSteamware.png" />
</div>
<div style="float: right;">
<a href="https://www.steamware.net/IOT" target="_blank">&copy; Steamware 2006-2018</a>
</div>
</div>
</body>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

-7
View File
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.0.0</version>
<url>http://seriate.steamware.net:8083/SWS/CMS_SC/{{PACKNAME}}/{{BRANCHNAME}}/{{PACKNAME}}.zip</url>
<changelog>http://seriate.steamware.net:8083/SWS/CMS_SC/{{PACKNAME}}/{{BRANCHNAME}}/ChangeLog.html</changelog>
<mandatory>false</mandatory>
</item>
+33 -44
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -9,7 +8,7 @@
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>SOUR</RootNamespace> <RootNamespace>SOUR</RootNamespace>
<AssemblyName>SOUR</AssemblyName> <AssemblyName>SOUR</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
@@ -48,24 +47,16 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowedReferenceRelatedFileExtensions>
<!-- Prevent default XML and PDB files copied to output in RELEASE. Only *.allowedextension files will be included, which doesn't exist in my case. -->
*.pdb;
*.xml
</AllowedReferenceRelatedFileExtensions>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL"> <Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL">
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.1.0\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath> <HintPath>..\packages\Pipelines.Sockets.Unofficial.2.0.22\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
</Reference> </Reference>
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL"> <Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
<HintPath>..\packages\StackExchange.Redis.2.0.601\lib\net461\StackExchange.Redis.dll</HintPath> <HintPath>..\packages\StackExchange.Redis.2.0.601\lib\net461\StackExchange.Redis.dll</HintPath>
@@ -76,12 +67,12 @@
</Reference> </Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Diagnostics.PerformanceCounter, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Diagnostics.PerformanceCounter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Diagnostics.PerformanceCounter.4.6.0\lib\net461\System.Diagnostics.PerformanceCounter.dll</HintPath> <HintPath>..\packages\System.Diagnostics.PerformanceCounter.4.5.0\lib\net461\System.Diagnostics.PerformanceCounter.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Pipelines, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.IO.Pipelines, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.4.6.0\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath> <HintPath>..\packages\System.IO.Pipelines.4.5.3\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath> <HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
@@ -90,12 +81,12 @@
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Threading.Channels, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Channels, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Channels.4.6.0\lib\netstandard2.0\System.Threading.Channels.dll</HintPath> <HintPath>..\packages\System.Threading.Channels.4.5.0\lib\netstandard2.0\System.Threading.Channels.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
@@ -129,31 +120,34 @@
<DependentUpon>App.config</DependentUpon> <DependentUpon>App.config</DependentUpon>
<IsTransformFile>true</IsTransformFile> <IsTransformFile>true</IsTransformFile>
</None> </None>
<Content Include="DataModel.demo.xml"> <None Include="forceDb.ini" />
<None Include="logs\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="DataModel.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="FodyWeavers.xml" />
<Content Include="lib\.placeholder">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="logs\.placeholder">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="FodyWeavers.xsd">
<SubType>Designer</SubType>
</None> </None>
<None Include="packages.config" /> <None Include="packages.config" />
<Content Include="Rec\.placeholder"> <None Include="Rec\.placeholder">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Content Include="Resources\RedisEndpoint.txt">
<SubType>Designer</SubType>
</Content> </Content>
<None Include="Resources\App.Debug.config">
<DependentUpon>RedisEndpoint.txt</DependentUpon>
</None>
<None Include="Resources\App.Release.config">
<DependentUpon>RedisEndpoint.txt</DependentUpon>
</None>
<None Include="Resources\CNC.map" />
<None Include="Resources\CNC.msg" />
<None Include="Resources\convertScmAlarm.ps1" />
<None Include="Resources\PLC.map" />
<None Include="Resources\PLC.msg" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="CONF\" /> <Folder Include="CONF\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="DataModel.xml" />
<Content Include="Server.Config.xml"> <Content Include="Server.Config.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
@@ -191,20 +185,15 @@
</PropertyGroup> </PropertyGroup>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
<ItemGroup> <ItemGroup>
<MoveToLibFolder Include="$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml" Exclude="$(OutputPath)Server.Config.xml; $(OutputPath)DataModel.xml" /> <MoveToLibFolder Include="$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml" Exclude="$(OutputPath)DataModel.xml; $(OutputPath)Server.Config.xml" />
</ItemGroup> </ItemGroup>
<Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" /> <Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" />
</Target> </Target>
<Import Project="..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.20\build\Microsoft.VisualStudio.SlowCheetah.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.20\build\Microsoft.VisualStudio.SlowCheetah.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText> <ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets'))" /> <Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.20\build\Microsoft.VisualStudio.SlowCheetah.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.20\build\Microsoft.VisualStudio.SlowCheetah.targets'))" />
<Error Condition="!Exists('..\packages\Fody.6.0.5\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.0.5\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.26\build\Microsoft.VisualStudio.SlowCheetah.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.26\build\Microsoft.VisualStudio.SlowCheetah.targets'))" />
</Target> </Target>
<Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="..\packages\Fody.6.0.5\build\Fody.targets" Condition="Exists('..\packages\Fody.6.0.5\build\Fody.targets')" />
<Import Project="..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.26\build\Microsoft.VisualStudio.SlowCheetah.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SlowCheetah.3.2.26\build\Microsoft.VisualStudio.SlowCheetah.targets')" />
</Project> </Project>
-1
View File
@@ -1 +0,0 @@

+7 -11
View File
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Costura.Fody" version="4.1.0" targetFramework="net461" />
<package id="Fody" version="6.0.5" targetFramework="net461" developmentDependency="true" />
<package id="log4net" version="2.0.8" targetFramework="net461" /> <package id="log4net" version="2.0.8" targetFramework="net461" />
<package id="Microsoft.NETCore.Platforms" version="3.0.0" targetFramework="net461" /> <package id="Microsoft.VisualStudio.SlowCheetah" version="3.2.20" targetFramework="net461" developmentDependency="true" />
<package id="Microsoft.VisualStudio.SlowCheetah" version="3.2.26" targetFramework="net461" developmentDependency="true" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="net461" /> <package id="Pipelines.Sockets.Unofficial" version="2.0.22" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" />
<package id="Pipelines.Sockets.Unofficial" version="2.1.0" targetFramework="net461" />
<package id="PrettyBin" version="1.1.0" targetFramework="net461" /> <package id="PrettyBin" version="1.1.0" targetFramework="net461" />
<package id="StackExchange.Redis" version="2.0.601" targetFramework="net461" /> <package id="StackExchange.Redis" version="2.0.601" targetFramework="net461" />
<package id="System.Buffers" version="4.5.0" targetFramework="net461" /> <package id="System.Buffers" version="4.5.0" targetFramework="net461" />
<package id="System.Diagnostics.PerformanceCounter" version="4.6.0" targetFramework="net461" /> <package id="System.Diagnostics.PerformanceCounter" version="4.5.0" targetFramework="net461" />
<package id="System.IO.Pipelines" version="4.6.0" targetFramework="net461" /> <package id="System.IO.Pipelines" version="4.5.3" targetFramework="net461" />
<package id="System.Memory" version="4.5.3" targetFramework="net461" /> <package id="System.Memory" version="4.5.3" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" /> <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net461" /> <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net461" />
<package id="System.Threading.Channels" version="4.6.0" targetFramework="net461" /> <package id="System.Threading.Channels" version="4.5.0" targetFramework="net461" />
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net461" /> <package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net461" />
</packages> </packages>
+2 -4
View File
@@ -15,9 +15,7 @@
[assembly: System.Reflection.AssemblyCopyright("Copyright © Steamware 2018+")] [assembly: System.Reflection.AssemblyCopyright("Copyright © Steamware 2018+")]
[assembly: System.Reflection.AssemblyTrademark("_")] [assembly: System.Reflection.AssemblyTrademark("_")]
[assembly: System.Runtime.InteropServices.ComVisible(false)] [assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: System.Reflection.AssemblyVersion("1.0.0.0")] [assembly: System.Reflection.AssemblyVersion("2.2.1907.257")]
[assembly: System.Reflection.AssemblyFileVersion("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersion("2.2.1907.257")]
// [assembly: System.Reflection.AssemblyVersion("2.2.1907.257")]
// [assembly: System.Reflection.AssemblyFileVersion("2.2.1907.257")]
+1 -1
View File
@@ -31,7 +31,7 @@ namespace TestApp
pwd_broker = "9c4173da75", pwd_broker = "9c4173da75",
autoReconnectDelayMs = 1000 autoReconnectDelayMs = 1000
}; };
mqttCli = new MQTT_Client(currConfig, new NullPrinter()); mqttCli = new MQTT_Client(currConfig);
await mqttCli.startAsync(); await mqttCli.startAsync();
+2 -2
View File
@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>TestApp</RootNamespace> <RootNamespace>TestApp</RootNamespace>
<AssemblyName>TestApp</AssemblyName> <AssemblyName>TestApp</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
@@ -34,7 +34,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
</packages> </packages>
+219
View File
@@ -0,0 +1,219 @@
<?xml version="1.0" encoding="utf-8"?>
<ApplicationConfiguration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ua="http://opcfoundation.org/UA/2008/02/Types.xsd"
xmlns="http://opcfoundation.org/UA/SDK/Configuration.xsd"
>
<ApplicationName>Server</ApplicationName>
<ApplicationUri>urn:localhost:UA:Server</ApplicationUri>
<ProductUri>uri:opcfoundation.org:Server</ProductUri>
<ApplicationType>Server_0</ApplicationType>
<SecurityConfiguration>
<!-- Where the application instance certificate is stored (MachineDefault) -->
<ApplicationCertificate>
<StoreType>Directory</StoreType>
<StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\MachineDefault</StorePath>
<SubjectName>CN=SOUR SCM OPC UA Server, C=IT, S=Rimini, O=SCM Group, DC=localhost</SubjectName>
</ApplicationCertificate>
<!-- Where the issuer certificate are stored (certificate authorities) -->
<TrustedIssuerCertificates>
<StoreType>Directory</StoreType>
<StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\UA Certificate Authorities</StorePath>
</TrustedIssuerCertificates>
<!-- Where the trust list is stored (UA Applications) -->
<TrustedPeerCertificates>
<StoreType>Directory</StoreType>
<StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\UA Applications</StorePath>
</TrustedPeerCertificates>
<!-- The directory used to store invalid certficates for later review by the administrator. -->
<RejectedCertificateStore>
<StoreType>Directory</StoreType>
<StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\RejectedCertificates</StorePath>
</RejectedCertificateStore>
<!-- WARNING: The following setting (to automatically accept untrusted certificates) should be used
for easy debugging purposes ONLY and turned off for production deployments! -->
<AutoAcceptUntrustedCertificates>false</AutoAcceptUntrustedCertificates>
<!-- WARNING: SHA1 signed certficates are by default rejected and should be phased out.
The setting below to allow them is only required for UACTT (1.02.336.244) which uses SHA-1 signed certs. -->
<RejectSHA1SignedCertificates>false</RejectSHA1SignedCertificates>
<MinimumCertificateKeySize>2048</MinimumCertificateKeySize>
</SecurityConfiguration>
<TransportConfigurations></TransportConfigurations>
<TransportQuotas>
<OperationTimeout>600000</OperationTimeout>
<MaxStringLength>1048576</MaxStringLength>
<MaxByteStringLength>1048576</MaxByteStringLength>
<MaxArrayLength>65535</MaxArrayLength>
<MaxMessageSize>4194304</MaxMessageSize>
<MaxBufferSize>65535</MaxBufferSize>
<ChannelLifetime>300000</ChannelLifetime>
<SecurityTokenLifetime>3600000</SecurityTokenLifetime>
</TransportQuotas>
<ServerConfiguration>
<BaseAddresses>
<ua:String>opc.tcp://127.0.0.1:62541/Server</ua:String>
</BaseAddresses>
<SecurityPolicies>
<ServerSecurityPolicy>
<SecurityMode>SignAndEncrypt_3</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>Sign_2</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>None_1</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#None</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>Sign_2</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>SignAndEncrypt_3</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>Sign_2</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>SignAndEncrypt_3</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256</SecurityPolicyUri>
</ServerSecurityPolicy>
</SecurityPolicies>
<MinRequestThreadCount>5</MinRequestThreadCount>
<MaxRequestThreadCount>100</MaxRequestThreadCount>
<MaxQueuedRequestCount>2000</MaxQueuedRequestCount>
<!-- The SDK expects the server to support the same set of user tokens for every endpoint. -->
<UserTokenPolicies>
<!-- Allows anonymous users -->
<ua:UserTokenPolicy>
<ua:TokenType>Anonymous_0</ua:TokenType>
<ua:SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#None</ua:SecurityPolicyUri>
</ua:UserTokenPolicy>
<!-- Allows username/password -->
<ua:UserTokenPolicy>
<ua:TokenType>UserName_1</ua:TokenType>
<!-- passwords must be encrypted - this specifies what algorithm to use -->
<ua:SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256</ua:SecurityPolicyUri>
</ua:UserTokenPolicy>
<!-- Allows user certificates -->
<ua:UserTokenPolicy>
<ua:TokenType>Certificate_2</ua:TokenType>
<!-- certificate possession must be proven with a digital signature - this specifies what algorithm to use -->
<ua:SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256</ua:SecurityPolicyUri>
</ua:UserTokenPolicy>
</UserTokenPolicies>
<DiagnosticsEnabled>false</DiagnosticsEnabled>
<MaxSessionCount>100</MaxSessionCount>
<MinSessionTimeout>10000</MinSessionTimeout>
<MaxSessionTimeout>3600000</MaxSessionTimeout>
<MaxBrowseContinuationPoints>10</MaxBrowseContinuationPoints>
<MaxQueryContinuationPoints>10</MaxQueryContinuationPoints>
<MaxHistoryContinuationPoints>100</MaxHistoryContinuationPoints>
<MaxRequestAge>600000</MaxRequestAge>
<MinPublishingInterval>100</MinPublishingInterval>
<MaxPublishingInterval>3600000</MaxPublishingInterval>
<PublishingResolution>50</PublishingResolution>
<MaxSubscriptionLifetime>3600000</MaxSubscriptionLifetime>
<MaxMessageQueueSize>100</MaxMessageQueueSize>
<MaxNotificationQueueSize>100</MaxNotificationQueueSize>
<MaxNotificationsPerPublish>1000</MaxNotificationsPerPublish>
<MinMetadataSamplingInterval>1000</MinMetadataSamplingInterval>
<AvailableSamplingRates>
<SamplingRateGroup>
<Start>5</Start>
<Increment>5</Increment>
<Count>20</Count>
</SamplingRateGroup>
<SamplingRateGroup>
<Start>100</Start>
<Increment>100</Increment>
<Count>4</Count>
</SamplingRateGroup>
<SamplingRateGroup>
<Start>500</Start>
<Increment>250</Increment>
<Count>2</Count>
</SamplingRateGroup>
<SamplingRateGroup>
<Start>1000</Start>
<Increment>500</Increment>
<Count>20</Count>
</SamplingRateGroup>
</AvailableSamplingRates>
<RegistrationEndpoint>
<ua:EndpointUrl>opc.tcp://localhost:4840</ua:EndpointUrl>
<ua:Server>
<ua:ApplicationUri>opc.tcp://localhost:4840</ua:ApplicationUri>
<ua:ApplicationType>DiscoveryServer_3</ua:ApplicationType>
<ua:DiscoveryUrls>
<ua:String>opc.tcp://localhost:4840</ua:String>
</ua:DiscoveryUrls>
</ua:Server>
<ua:SecurityMode>SignAndEncrypt_3</ua:SecurityMode>
<ua:SecurityPolicyUri />
<ua:UserIdentityTokens />
</RegistrationEndpoint>
<MaxRegistrationInterval>0</MaxRegistrationInterval>
<NodeManagerSaveFile>Server.nodes.xml</NodeManagerSaveFile>
<MinSubscriptionLifetime>10000</MinSubscriptionLifetime>
<MaxPublishRequestCount>20</MaxPublishRequestCount>
<MaxSubscriptionCount>100</MaxSubscriptionCount>
<MaxEventQueueSize>10000</MaxEventQueueSize>
<!-- see https://opcfoundation-onlineapplications.org/profilereporting/ for list of available profiles -->
<ServerProfileArray>
<ua:String>Standard UA Server Profile</ua:String>
<ua:String>Data Access Server Facet</ua:String>
<ua:String>Method Server Facet</ua:String>
</ServerProfileArray>
<ShutdownDelay>5</ShutdownDelay>
<ServerCapabilities>
<ua:String>UA</ua:String>
</ServerCapabilities>
<SupportedPrivateKeyFormats>
<ua:String>PFX</ua:String>
<ua:String>PEM</ua:String>
</SupportedPrivateKeyFormats>
<MaxTrustListSize>0</MaxTrustListSize>
<MultiCastDnsEnabled>false</MultiCastDnsEnabled>
</ServerConfiguration>
<TraceConfiguration>
<OutputFilePath>Logs\Server.log.txt</OutputFilePath>
<DeleteOnLoad>true</DeleteOnLoad>
<!-- Show Only Errors -->
<!-- <TraceMasks>1</TraceMasks> -->
<!-- Show Only Security and Errors -->
<!-- <TraceMasks>513</TraceMasks> -->
<!-- Show Only Security, Errors and Trace -->
<!-- <TraceMasks>515</TraceMasks> -->
<!-- Show Only Security, COM Calls, Errors and Trace -->
<!-- <TraceMasks>771</TraceMasks> -->
<!-- Show Only Security, Service Calls, Errors and Trace -->
<!-- <TraceMasks>523</TraceMasks> -->
<!-- Show Only Security, ServiceResultExceptions, Errors and Trace -->
<!-- <TraceMasks>519</TraceMasks> -->
</TraceConfiguration>
</ApplicationConfiguration>
+10 -12
View File
@@ -114,23 +114,21 @@ namespace XUnitTestProject1
[Fact] [Fact]
public void sanitizeTest() public void sanitizeTest()
{ {
XmlDocument xmlOrig = new XmlDocument(); string xmlOrig = System.IO.File.ReadAllText(@"C:\Users\simone.terzi\Documents\Repo\OPC-UA-REDIS\src\XUnitTestSOUR\DataModel.xml");
xmlOrig.LoadXml("DataModel.xml");
//calcolo lunghezza stringa in ingresso //calcolo lunghezza stringa in ingresso...
int lenghtOrig;
//int lenghtOrig = xmlOrig.Length;
//ne scrivo uno di test int lenghtOrig = xmlOrig.Length;
//XmlDocument xmlRes = DataHelper.xmlSanitize(xmlOrig);
//calcolo lunghezza stringa in uscita //ne scrivo uno di test...
int lenghtRes; string xmlRes = DataHelper.xmlSanitize(xmlOrig);
//int lenghtRes= xmlRes.Lenght;
//bool b = lenghtRes <= lenghtOrig; //calcolo lunghezza stringa in uscita...
int lenghtRes= xmlRes.Length;
//Assert.True(b); //verifico che la stringa di output da sanitize sia di lunghezza <= a quella data in input...
bool b = lenghtRes <= lenghtOrig;
Assert.True(b);
} }
} }
@@ -1,8 +1,107 @@
using System; using System;
using Xunit; using Xunit;
using SOUR.Core; using SOUR.Core;
using OpcUaCommon.Services;
using SOUR.Core.Model;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Xml;
using SOUR.Core.Services;
using OpcUaServer.Server;
using OpcUaServer.Server.Services;
namespace XUnitTestProject1 namespace XUnitTestProject1
{ {
/*
public class RedisSampler
{
/// <summary>
/// Lista delle proprietà in XML (Eliminare... sono costanti)
/// </summary>
protected List<MemDataItem> Properties;
/// <summary>
/// Lista delle variabili da XML
/// </summary>
protected List<MemDataItem> Variables;
/// <summary>
/// Lista delle condizioni di allarme da XML
/// </summary>
protected List<MemDataItem> Conditions;
}
DObbiamo testare 2 cose
1) creazione oggetto
2) creazione + start oggetto
*/
public class UTS_SourCoreRedisSampler
{
public IPrinter _printer;
public XmlParser _xmlParser=new XmlParser(new EventMessageRepository("..\\archive"));
public ServerManagerDecorator ServerMD { get; private set; }
/// <summary>
/// FIle conf XML (da sostituire con quello scaricato da REDIS)
/// </summary>
public string _xmlConfigurationPath = (@"C:\Users\simone.terzi\Documents\Repo\OPC-UA-REDIS\src\XUnitTestSOUR\DataModel.xml");
public string _serverConfigurationFilePath = ("Server.Config.xml");
//public string _serverConfigurationFilePath = (@"C:\Users\simone.terzi\Documents\Repo\OPC-UA-REDIS\src\XUnitTestSOUR\Server.Config.xml");
private readonly DataRecorder _recorder;
protected MQTT_Client.confData _mqttConf;
protected MQTT_Client _mqttCli;
private static void StartServer(IPrinter printer, ServerDecorator server, string serverConfigurationFilePath)
{
new ConsoleServerStarter(new ApplicationInstanceBuilder(printer, server), printer).Start(serverConfigurationFilePath);
}
protected IRedisSampler GetSampler(ServerDecorator server)
{
var nodesDictionary = _xmlParser.CreateDictionaryFromXmlToGenerateValues(_xmlConfigurationPath);
ServerMD = new ServerManagerDecorator(server);
return new RedisSampler(ServerMD, _xmlConfigurationPath, this._printer,
nodesDictionary, new EventMessageMan(), _recorder, _mqttConf, _mqttCli);
}
[Fact]
public void CreateTest()
{
// metodi da start...
_printer = new ConsoleLogPrinter(new IPrinter[] { new NullPrinter() });
var server = new ServerDecorator(_printer, _xmlConfigurationPath);
// avvio server
StartServer(_printer, server, _serverConfigurationFilePath);
var redSampler = GetSampler(server);
//controllo che il redSampler non sia nullo
Assert.NotNull(redSampler);
}
[Fact]
public void StartTest()
{
// metodi da start...
_printer = new ConsoleLogPrinter(new IPrinter[] { new NullPrinter() });
var server = new ServerDecorator(_printer, _xmlConfigurationPath);
// avvio server
StartServer(_printer, server, _serverConfigurationFilePath);
var redSampler = GetSampler(server);
redSampler.Start();
//controllo che il redSampler non sia nullo
Assert.NotNull(redSampler);
}
} }
}
+6
View File
@@ -8,10 +8,14 @@
<ItemGroup> <ItemGroup>
<None Remove="DataModel.xml" /> <None Remove="DataModel.xml" />
<None Remove="Server.Config.xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="DataModel.xml" /> <Content Include="DataModel.xml" />
<Content Include="Server.Config.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -27,6 +31,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpcUaCommon\OpcUaCommon.csproj" />
<ProjectReference Include="..\OpcUaServer.Server\OpcUaServer.Server.csproj" />
<ProjectReference Include="..\SOUR.Core\SOUR.Core.csproj" /> <ProjectReference Include="..\SOUR.Core\SOUR.Core.csproj" />
<ProjectReference Include="..\SOUR\SOUR.csproj" /> <ProjectReference Include="..\SOUR\SOUR.csproj" />
</ItemGroup> </ItemGroup>
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("xUnitTestSOUR")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("xUnitTestSOUR")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
// COM, impostare su true l'attributo ComVisible per tale tipo.
[assembly: ComVisible(false)]
// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
[assembly: Guid("6a68226f-c5f2-4a04-ab31-4ad4b69a40d2")]
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
//
// Versione principale
// Versione secondaria
// Numero di build
// Revisione
//
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+219
View File
@@ -0,0 +1,219 @@
<?xml version="1.0" encoding="utf-8"?>
<ApplicationConfiguration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ua="http://opcfoundation.org/UA/2008/02/Types.xsd"
xmlns="http://opcfoundation.org/UA/SDK/Configuration.xsd"
>
<ApplicationName>Server</ApplicationName>
<ApplicationUri>urn:localhost:UA:Server</ApplicationUri>
<ProductUri>uri:opcfoundation.org:Server</ProductUri>
<ApplicationType>Server_0</ApplicationType>
<SecurityConfiguration>
<!-- Where the application instance certificate is stored (MachineDefault) -->
<ApplicationCertificate>
<StoreType>Directory</StoreType>
<StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\MachineDefault</StorePath>
<SubjectName>CN=SOUR SCM OPC UA Server, C=IT, S=Rimini, O=SCM Group, DC=localhost</SubjectName>
</ApplicationCertificate>
<!-- Where the issuer certificate are stored (certificate authorities) -->
<TrustedIssuerCertificates>
<StoreType>Directory</StoreType>
<StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\UA Certificate Authorities</StorePath>
</TrustedIssuerCertificates>
<!-- Where the trust list is stored (UA Applications) -->
<TrustedPeerCertificates>
<StoreType>Directory</StoreType>
<StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\UA Applications</StorePath>
</TrustedPeerCertificates>
<!-- The directory used to store invalid certficates for later review by the administrator. -->
<RejectedCertificateStore>
<StoreType>Directory</StoreType>
<StorePath>%CommonApplicationData%\OPC Foundation\CertificateStores\RejectedCertificates</StorePath>
</RejectedCertificateStore>
<!-- WARNING: The following setting (to automatically accept untrusted certificates) should be used
for easy debugging purposes ONLY and turned off for production deployments! -->
<AutoAcceptUntrustedCertificates>false</AutoAcceptUntrustedCertificates>
<!-- WARNING: SHA1 signed certficates are by default rejected and should be phased out.
The setting below to allow them is only required for UACTT (1.02.336.244) which uses SHA-1 signed certs. -->
<RejectSHA1SignedCertificates>false</RejectSHA1SignedCertificates>
<MinimumCertificateKeySize>2048</MinimumCertificateKeySize>
</SecurityConfiguration>
<TransportConfigurations></TransportConfigurations>
<TransportQuotas>
<OperationTimeout>600000</OperationTimeout>
<MaxStringLength>1048576</MaxStringLength>
<MaxByteStringLength>1048576</MaxByteStringLength>
<MaxArrayLength>65535</MaxArrayLength>
<MaxMessageSize>4194304</MaxMessageSize>
<MaxBufferSize>65535</MaxBufferSize>
<ChannelLifetime>300000</ChannelLifetime>
<SecurityTokenLifetime>3600000</SecurityTokenLifetime>
</TransportQuotas>
<ServerConfiguration>
<BaseAddresses>
<ua:String>opc.tcp://127.0.0.1:62541/Server</ua:String>
</BaseAddresses>
<SecurityPolicies>
<ServerSecurityPolicy>
<SecurityMode>SignAndEncrypt_3</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>Sign_2</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>None_1</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#None</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>Sign_2</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>SignAndEncrypt_3</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>Sign_2</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256</SecurityPolicyUri>
</ServerSecurityPolicy>
<ServerSecurityPolicy>
<SecurityMode>SignAndEncrypt_3</SecurityMode>
<SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256</SecurityPolicyUri>
</ServerSecurityPolicy>
</SecurityPolicies>
<MinRequestThreadCount>5</MinRequestThreadCount>
<MaxRequestThreadCount>100</MaxRequestThreadCount>
<MaxQueuedRequestCount>2000</MaxQueuedRequestCount>
<!-- The SDK expects the server to support the same set of user tokens for every endpoint. -->
<UserTokenPolicies>
<!-- Allows anonymous users -->
<ua:UserTokenPolicy>
<ua:TokenType>Anonymous_0</ua:TokenType>
<ua:SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#None</ua:SecurityPolicyUri>
</ua:UserTokenPolicy>
<!-- Allows username/password -->
<ua:UserTokenPolicy>
<ua:TokenType>UserName_1</ua:TokenType>
<!-- passwords must be encrypted - this specifies what algorithm to use -->
<ua:SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256</ua:SecurityPolicyUri>
</ua:UserTokenPolicy>
<!-- Allows user certificates -->
<ua:UserTokenPolicy>
<ua:TokenType>Certificate_2</ua:TokenType>
<!-- certificate possession must be proven with a digital signature - this specifies what algorithm to use -->
<ua:SecurityPolicyUri>http://opcfoundation.org/UA/SecurityPolicy#Basic256</ua:SecurityPolicyUri>
</ua:UserTokenPolicy>
</UserTokenPolicies>
<DiagnosticsEnabled>false</DiagnosticsEnabled>
<MaxSessionCount>100</MaxSessionCount>
<MinSessionTimeout>10000</MinSessionTimeout>
<MaxSessionTimeout>3600000</MaxSessionTimeout>
<MaxBrowseContinuationPoints>10</MaxBrowseContinuationPoints>
<MaxQueryContinuationPoints>10</MaxQueryContinuationPoints>
<MaxHistoryContinuationPoints>100</MaxHistoryContinuationPoints>
<MaxRequestAge>600000</MaxRequestAge>
<MinPublishingInterval>100</MinPublishingInterval>
<MaxPublishingInterval>3600000</MaxPublishingInterval>
<PublishingResolution>50</PublishingResolution>
<MaxSubscriptionLifetime>3600000</MaxSubscriptionLifetime>
<MaxMessageQueueSize>100</MaxMessageQueueSize>
<MaxNotificationQueueSize>100</MaxNotificationQueueSize>
<MaxNotificationsPerPublish>1000</MaxNotificationsPerPublish>
<MinMetadataSamplingInterval>1000</MinMetadataSamplingInterval>
<AvailableSamplingRates>
<SamplingRateGroup>
<Start>5</Start>
<Increment>5</Increment>
<Count>20</Count>
</SamplingRateGroup>
<SamplingRateGroup>
<Start>100</Start>
<Increment>100</Increment>
<Count>4</Count>
</SamplingRateGroup>
<SamplingRateGroup>
<Start>500</Start>
<Increment>250</Increment>
<Count>2</Count>
</SamplingRateGroup>
<SamplingRateGroup>
<Start>1000</Start>
<Increment>500</Increment>
<Count>20</Count>
</SamplingRateGroup>
</AvailableSamplingRates>
<RegistrationEndpoint>
<ua:EndpointUrl>opc.tcp://localhost:4840</ua:EndpointUrl>
<ua:Server>
<ua:ApplicationUri>opc.tcp://localhost:4840</ua:ApplicationUri>
<ua:ApplicationType>DiscoveryServer_3</ua:ApplicationType>
<ua:DiscoveryUrls>
<ua:String>opc.tcp://localhost:4840</ua:String>
</ua:DiscoveryUrls>
</ua:Server>
<ua:SecurityMode>SignAndEncrypt_3</ua:SecurityMode>
<ua:SecurityPolicyUri />
<ua:UserIdentityTokens />
</RegistrationEndpoint>
<MaxRegistrationInterval>0</MaxRegistrationInterval>
<NodeManagerSaveFile>Server.nodes.xml</NodeManagerSaveFile>
<MinSubscriptionLifetime>10000</MinSubscriptionLifetime>
<MaxPublishRequestCount>20</MaxPublishRequestCount>
<MaxSubscriptionCount>100</MaxSubscriptionCount>
<MaxEventQueueSize>10000</MaxEventQueueSize>
<!-- see https://opcfoundation-onlineapplications.org/profilereporting/ for list of available profiles -->
<ServerProfileArray>
<ua:String>Standard UA Server Profile</ua:String>
<ua:String>Data Access Server Facet</ua:String>
<ua:String>Method Server Facet</ua:String>
</ServerProfileArray>
<ShutdownDelay>5</ShutdownDelay>
<ServerCapabilities>
<ua:String>UA</ua:String>
</ServerCapabilities>
<SupportedPrivateKeyFormats>
<ua:String>PFX</ua:String>
<ua:String>PEM</ua:String>
</SupportedPrivateKeyFormats>
<MaxTrustListSize>0</MaxTrustListSize>
<MultiCastDnsEnabled>false</MultiCastDnsEnabled>
</ServerConfiguration>
<TraceConfiguration>
<OutputFilePath>Logs\Server.log.txt</OutputFilePath>
<DeleteOnLoad>true</DeleteOnLoad>
<!-- Show Only Errors -->
<!-- <TraceMasks>1</TraceMasks> -->
<!-- Show Only Security and Errors -->
<!-- <TraceMasks>513</TraceMasks> -->
<!-- Show Only Security, Errors and Trace -->
<!-- <TraceMasks>515</TraceMasks> -->
<!-- Show Only Security, COM Calls, Errors and Trace -->
<!-- <TraceMasks>771</TraceMasks> -->
<!-- Show Only Security, Service Calls, Errors and Trace -->
<!-- <TraceMasks>523</TraceMasks> -->
<!-- Show Only Security, ServiceResultExceptions, Errors and Trace -->
<!-- <TraceMasks>519</TraceMasks> -->
</TraceConfiguration>
</ApplicationConfiguration>
@@ -0,0 +1,205 @@
using System;
using Xunit;
using SOUR.Core;
using OpcUaCommon.Services;
using System.Text;
using System.Globalization;
using SOUR.Core.Services;
using System.Reflection;
using System.Threading;
using System.IO;
namespace xUnitTestSOUR
{
public class UTS_SourCoreApplicationStarter
{
/****************************************************************************
* Questa classe deve fare i test dei metodi pubblici di ApplicationStarter.cs
*
* In particolare vanno testati 3 metodi pubblici:
* - ApplicationStarter
* - Start
* - GetSampler
*
* Andiamo a definire i test di
* - creazione oggetti in modo corretto (passando parametri) --> assert success
* - creazione oggetti in modo NON corretto (es non passando parametri) --> assert fail
* - avvio metodo SENZA ERRORI (assert success)
* - avvio ultimo metodo con oggetto restituito valido
*
* mod: 2019.07.23 S.Terzi
* mod: 2019.07.24 S.E. Locatelli
* mod: 2019.07.24 S.Terzi
* mod: 2019.07.25 S.Terzi
* mod: 2019.07.26 S.Terzi
*
****************************************************************************/
#region helpers e utility
/// <summary>
/// Effettua se abilitata registrazione apertura file con dt stop
/// </summary>
/// <param name="recorder"></param>
private static void recorderStart(DataRecorder recorder)
{
if (true)
{
// provo a scrivere nel dataRecorder...
StringBuilder sb = new StringBuilder();
sb.AppendLine("#-----------------------------------------#");
sb.AppendLine(string.Format("# Versione : v_{0}", Assembly.GetExecutingAssembly().GetName().Version));
sb.AppendLine(string.Format("# Rec Start: {0:yyyy.MM.dd HH:mm:ss}", DateTime.Now));
sb.AppendLine("#-----------------------------------------#");
recorder.Print(sb.ToString());
}
}
/// <summary>
/// Effettua se abilitata registrazione chiusura file con dt stop
/// </summary>
/// <param name="recorder"></param>
private static void recorderClose(DataRecorder recorder)
{
if (true)
{
// salvo chiusura recorder
StringBuilder sb = new StringBuilder();
sb.AppendLine("#-----------------------------------------#");
sb.AppendLine(string.Format("# Rec Stop: {0:yyyy.MM.dd HH:mm:ss}", DateTime.Now));
sb.AppendLine("#-----------------------------------------#");
recorder.Print(sb.ToString());
}
}
/// <summary>
/// Init console stsandard
/// </summary>
private static void initConsole()
{
// 2019.02.10 imposto culture EN + UTF8...
Console.OutputEncoding = Encoding.UTF8;
CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
}
#endregion
[Fact]
public void ApplicationStarterInitRecorder()
{
initConsole();
// avvio logprinter...
var printer = new ConsoleLogPrinter(new IPrinter[] { new ConsolePrinter() });
string recFile = string.Format(@"{0}Rec\SOUR_{1:yyyyMMdd_HHmmss}.log", AppDomain.CurrentDomain.BaseDirectory, DateTime.Now);
// oggetto recorder
var recorder = new DataRecorder(recFile);
recorderStart(recorder);
// verifico che il file esista e abbia almeno 1 riga contenuta...
Assert.NotNull(recorder);
// pulizia...
File.Delete(recFile);
}
[Fact]
public void ApplicationStarterInitFile()
{
initConsole();
// avvio logprinter...
var printer = new ConsoleLogPrinter(new IPrinter[] { new ConsolePrinter() });
string recFile = string.Format(@"{0}Rec\SOUR_{1:yyyyMMdd_HHmmss}.log", AppDomain.CurrentDomain.BaseDirectory, DateTime.Now);
// oggetto recorder
var recorder = new DataRecorder(recFile);
recorderStart(recorder);
// verifico che il file esista e abbia almeno 1 riga contenuta...
Assert.True(File.Exists(recFile));
// pulizia...
File.Delete(recFile);
}
[Fact]
public void ApplicationStarterInitFail()
{
initConsole();
// avvio logprinter... ma NULLA
var printer = new ConsoleLogPrinter(new IPrinter[] { new NullPrinter() });
string recFile = string.Format(@"{0}Rec\SOUR_{1:yyyyMMdd_HHmmss}.log",
AppDomain.CurrentDomain.BaseDirectory, DateTime.Now);
// singolo file giornaliero in DEBUG locale...
recFile = string.Format(@"{0}Rec\SOUR_{1:yyyyMMdd}.log", AppDomain.CurrentDomain.BaseDirectory, DateTime.Now);
// oggetto recorder
var recorder = new DataRecorder(recFile);
recorderStart(recorder);
// init MQTT
MQTT_Client.confData currConfig = new MQTT_Client.confData();
currConfig = new MQTT_Client.confData();
try
{
printer.Print("***** SOUR.S (SCM OpcUa Redis SERVER) started... *****");
string xmlConfigurationPath = memLayer.man.confReadString("DataModelPath");
// init application starter
var appStart = new ApplicationStarter(printer, xmlConfigurationPath, new XmlParser(new EventMessageRepository("..\\archive")), null, recorder, currConfig);
// avvio
appStart.Start();
// chiusura
printer.Print("***** SOUR.S closed... *****");
// chiudo rec SE abilitata
recorderClose(recorder);
// salvo chiusura...
DataHelper.sendRedisStop();
var expected = typeof(SOUR.Core.ApplicationStarter);
Assert.IsType(expected, appStart);
// pulizia...
File.Delete(recFile);
}
catch (Exception ex)
{
printer.Print("**** Error *****");
printer.Print(ex.ToString());
Console.ReadLine();
}
}
}
}
@@ -0,0 +1,135 @@
using System;
using Xunit;
using SOUR.Core;
using SOUR.Core.Services;
using System.Xml;
namespace xUnitTestSOUR
{
public class UTS_SourCoreDataHelper
{
/// <summary>
/// Formato output timestamp
/// </summary>
protected static string dataFormat = "yyyy-MM-dd\\THH:mm:ss.fffK";
// !!!TDB!!! provare questo formato ma ha 7 decimali...
//protected string dataFormat = "O";
/// <summary>
/// Timestamp formattato...
/// </summary>
protected static string timestamp
{
get
{
return DateTime.UtcNow.ToString(dataFormat);
}
}
/// <summary>
/// TTL eventi BREVI (15 sec)
/// </summary>
public static int shortTTL = 15;
/// <summary>
/// TTL eventi LUNGI (5 minuto)
/// </summary>
public static int longTTL = 300;
/// <summary>
/// classe gestione accessi a Session, cache, viewstate, configuration...
/// </summary>
[Fact]
public void redisSendTest()
{
// setup valori
string currKey = "";
string expected = "1.2.3.4";
currKey = memLayer.man.redHash("Srv:Vers");
// leggo il valore de versione da redis
string currVers = memLayer.man.getRSV(currKey);
// ne scrivo uno di test
DataHelper.sendRedisStart(expected);
// rileggo
string newVal = memLayer.man.getRSV(currKey);
// controllo sia corretto
Assert.Equal(newVal, expected);
// riscrivo valore iniziale
memLayer.man.setRSV(currKey, currVers);
}
[Fact]
public void redisStopTest()
{
//setup valori
string currKey= "";
string expected = "stopped";
currKey = memLayer.man.redHash("Srv:Status");
// ne scrivo uno di test
DataHelper.sendRedisStop();
//rileggo
string newVal = memLayer.man.getRSV(currKey);
//controllo
Assert.Equal(expected, newVal);
}
[Fact]
public void redisHBeatTest()
{
// test dell'hearbeat: priam di tutto lo invoco e verifico abbia scritto una delel chiavi di controllo, poia ttendo 15 sec e ricontrollo se sia scomparsa...
//setup valori
string currKey = memLayer.man.redHash("Srv:Status");
//ne scrivo uno di test
DataHelper.sendRedisHBeat();
// leggo valore scritto
string newVal = memLayer.man.getRSV(currKey);
//test con valore "running"
Assert.Equal("running", newVal);
//attesa 15 sec
System.Threading.Thread.Sleep(15000);
// rileggo --> mi aspetto null...
newVal = memLayer.man.getRSV(currKey);
//test 2
Assert.Null(newVal);
}
// qui fai il iltest che la funzione sanitize restituisca una stringa di lunghezza <= di quella in ingresso, che DOVREBBE essere un XML letto da file...
[Fact]
public void sanitizeTest()
{
string xmlOrig = System.IO.File.ReadAllText(@"C:\Users\simone.terzi\Documents\Repo\OPC-UA-REDIS\src\XUnitTestSOUR\DataModel.xml");
//calcolo lunghezza stringa in ingresso...
int lenghtOrig = xmlOrig.Length;
//ne scrivo uno di test...
string xmlRes = DataHelper.xmlSanitize(xmlOrig);
//calcolo lunghezza stringa in uscita...
int lenghtRes= xmlRes.Length;
//verifico che la stringa di output da sanitize sia di lunghezza <= a quella data in input...
bool b = lenghtRes <= lenghtOrig;
Assert.True(b);
}
}
}
@@ -0,0 +1,105 @@
using System;
using Xunit;
using SOUR.Core;
using OpcUaCommon.Services;
using SOUR.Core.Model;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Xml;
using SOUR.Core.Services;
using OpcUaServer.Server;
using OpcUaServer.Server.Services;
namespace xUnitTestSOUR
{
/*
public class RedisSampler
{
/// <summary>
/// Lista delle proprietà in XML (Eliminare... sono costanti)
/// </summary>
protected List<MemDataItem> Properties;
/// <summary>
/// Lista delle variabili da XML
/// </summary>
protected List<MemDataItem> Variables;
/// <summary>
/// Lista delle condizioni di allarme da XML
/// </summary>
protected List<MemDataItem> Conditions;
}
Dobbiamo testare 2 cose
1) creazione oggetto
2) creazione + start oggetto
*/
public class UTS_SourCoreRedisSampler
{
public IPrinter _printer;
public XmlParser _xmlParser=new XmlParser(new EventMessageRepository("..\\archive"));
public ServerManagerDecorator ServerMD { get; private set; }
/// <summary>
/// FIle conf XML (da sostituire con quello scaricato da REDIS)
/// </summary>
public string _xmlConfigurationPath = (@"C:\Users\simone.terzi\Documents\Repo\OPC-UA-REDIS\src\XUnitTestSOUR\DataModel.xml");
public string _serverConfigurationFilePath = ("Server.Config.xml");
//public string _serverConfigurationFilePath = (@"C:\Users\simone.terzi\Documents\Repo\OPC-UA-REDIS\src\XUnitTestSOUR\Server.Config.xml");
private readonly DataRecorder _recorder;
protected MQTT_Client.confData _mqttConf;
protected MQTT_Client _mqttCli;
private static void StartServer(IPrinter printer, ServerDecorator server, string serverConfigurationFilePath)
{
new ConsoleServerStarter(new ApplicationInstanceBuilder(printer, server), printer).Start(serverConfigurationFilePath);
}
protected IRedisSampler GetSampler(ServerDecorator server)
{
var nodesDictionary = _xmlParser.CreateDictionaryFromXmlToGenerateValues(_xmlConfigurationPath);
ServerMD = new ServerManagerDecorator(server);
return new RedisSampler(ServerMD, _xmlConfigurationPath, this._printer,
nodesDictionary, new EventMessageMan(), _recorder, _mqttConf, _mqttCli);
}
[Fact]
public void CreateTest()
{
// metodi da start...
_printer = new ConsoleLogPrinter(new IPrinter[] { new NullPrinter() });
var server = new ServerDecorator(_printer, _xmlConfigurationPath);
// avvio server
StartServer(_printer, server, _serverConfigurationFilePath);
var redSampler = GetSampler(server);
//controllo che il redSampler non sia nullo
Assert.NotNull(redSampler);
}
[Fact]
public void StartTest()
{
// metodi da start...
_printer = new ConsoleLogPrinter(new IPrinter[] { new NullPrinter() });
var server = new ServerDecorator(_printer, _xmlConfigurationPath);
// avvio server
StartServer(_printer, server, _serverConfigurationFilePath);
var redSampler = GetSampler(server);
redSampler.Start();
//controllo che il redSampler non sia nullo
Assert.NotNull(redSampler);
}
}
}
+91
View File
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Http" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.2.0" newVersion="2.2.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.1.0" newVersion="2.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Http.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Hosting.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Https" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Hosting" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AspNetCore.Http.Features" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="xunit" version="2.4.1" targetFramework="net461" />
<package id="xunit.abstractions" version="2.0.3" targetFramework="net461" />
<package id="xunit.analyzers" version="0.10.0" targetFramework="net461" />
<package id="xunit.assert" version="2.4.1" targetFramework="net461" />
<package id="xunit.core" version="2.4.1" targetFramework="net461" />
<package id="xunit.extensibility.core" version="2.4.1" targetFramework="net461" />
<package id="xunit.extensibility.execution" version="2.4.1" targetFramework="net461" />
</packages>
+108
View File
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6A68226F-C5F2-4A04-AB31-4AD4B69A40D2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>xUnitTestSOUR</RootNamespace>
<AssemblyName>xUnitTestSOUR</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.assert, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UTS_SourCoreApplicationStarter.cs" />
<Compile Include="UTS_SourCoreDataHelper.cs" />
<Compile Include="UTS_SourCoreRedisSampler.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="DataModel.xml" />
<Content Include="Server.Config.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Rec\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpcUaCommon\OpcUaCommon.csproj">
<Project>{4c09fe6b-20fe-4a16-8443-f8be8ae0849a}</Project>
<Name>OpcUaCommon</Name>
</ProjectReference>
<ProjectReference Include="..\OpcUaServer.Server\OpcUaServer.Server.csproj">
<Project>{1e81f982-2e67-4f37-9d0d-c1e1f2c3c415}</Project>
<Name>OpcUaServer.Server</Name>
</ProjectReference>
<ProjectReference Include="..\SOUR.Core\SOUR.Core.csproj">
<Project>{c91082e5-3ec7-4ae7-b2f1-c7c194a02165}</Project>
<Name>SOUR.Core</Name>
</ProjectReference>
<ProjectReference Include="..\SOUR\SOUR.csproj">
<Project>{a924c997-f587-429a-a492-867460320b81}</Project>
<Name>SOUR</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\xunit.analyzers.0.10.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.props'))" />
<Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.targets'))" />
</Target>
<Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" />
</Project>