EC - v2.43.0 - Jenkinsfile

This commit is contained in:
Mike Phares 2022-06-07 14:39:13 -07:00
parent 9de7b67ed6
commit 7f6dce34a4
110 changed files with 11393 additions and 4474 deletions

1
.gitignore vendored
View File

@ -22,7 +22,6 @@ x86/
bld/ bld/
[Bb]in/ [Bb]in/
[Oo]bj/ [Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory # Visual Studio 2015/2017 cache/options directory
.vs/ .vs/

172
.groovy Normal file
View File

@ -0,0 +1,172 @@
#!/usr/bin/env groovy
/* groovylint-disable CompileStatic, ConsecutiveStringConcatenation, DuplicateNumberLiteral, DuplicateStringLiteral, LineLength, NestedBlockDepth, NoDef, VariableTypeRequired */
import groovy.transform.Field
@Field String _DDrive = 'D:/'
@Field String _GitName = 'EC'
@Field String _AssemblyName = '...'
@Field String _TargetLocation = '...'
@Field String _GitCommitSeven = '...'
@Field String _TestProjectDirectory = 'Adaptation'
@Field String _AgentStaging = 'mestsa07ec-ecmeseaf'
@Field String _DDriveNet = "${_DDrive}Framework4.8"
@Field String _AgentProduction = 'messa08ec-ecmeseaf'
@Field String _AgentDevelopment = 'mestsa003-mesedasvc'
@Field String _ProgramFilesDotnet = 'C:/Program Files/dotnet/dotnet.exe'
@Field String _ProgramFilesMSBuild = 'C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe'
pipeline {
agent {
label env.JENKINS_ENVIRONMENT == 'Development' ? _AgentDevelopment : env.JENKINS_ENVIRONMENT == 'Staging' ? _AgentStaging : env.JENKINS_ENVIRONMENT == 'Production' ? _AgentProduction : 'Else'
}
parameters {
string(name: 'GIT_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'mestsa003.infineon.com' : 'mestsa07ec.ec.local', description: 'git server')
string(name: 'DEFAULT_FILE_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'messv02ecc1_ec_local' : 'messv02ecc1.ec.local', description: 'Default file server...')
}
stages {
stage('Git') {
steps {
bat(returnStatus: true, script: 'git init')
bat(returnStatus: true, script: 'git remote add origin \\\\' + params.GIT_SERVER + '\\Git\\' + _GitName + '.git')
bat(returnStatus: true, script: 'git pull origin master')
}
}
stage('Setup') {
steps {
script {
_AssemblyName = "${env.JOB_NAME}"
_GitCommitSeven = '1234567'
// _GitCommitSeven = env.GIT_COMMIT.substring(0, 7)
def files = findFiles(glob: '*.csproj')
if (files.length != 1) {
error("Build failed because couldn't find a *.csproj file")
}
echo """
${files[0].name}
${files[0].path}
${files[0].directory}
${files[0].length}
${files[0].lastModified}
"""
_AssemblyName = files[0].name.split('[.]csproj')[0]
_TargetLocation = "\\\\${params.DEFAULT_FILE_SERVER}\\EC_EAFRepository\\${env.JENKINS_ENVIRONMENT}\\DeploymentStorage\\Adaptation_${_AssemblyName}"
}
}
}
stage('Info') {
steps {
echo "_AssemblyName ${_AssemblyName}" // ...
echo "BUILD_NUMBER ${env.BUILD_NUMBER}" // 11
echo "DEFAULT_FILE_SERVER ${params.DEFAULT_FILE_SERVER}" // 11
echo "GIT_BRANCH ${env.GIT_BRANCH}" // origin/master
echo "GIT_COMMIT ${env.GIT_COMMIT}" // 73b814069f2cf0173a62a8228815a9bc9ba93c41
echo "GIT_SERVER ${params.GIT_SERVER}" // ...
echo "GIT_URL ${env.GIT_URL}" // D:\ProgramData\Git\....git
echo "JENKINS_ENVIRONMENT ${env.JENKINS_ENVIRONMENT}" // 11
echo "JENKINS_URL ${env.JENKINS_URL}" // http://localhost:8080/
echo "JOB_NAME ${env.JOB_NAME}" // ...
echo "WORKSPACE ${env.WORKSPACE}" // D:\.jenkins\_\...
}
}
// stage('Restore') {
// steps {
// bat(returnStatus: true, script: 'dotnet --info')
// }
// }
stage('Safe storage of app secrets') {
steps {
dir(_TestProjectDirectory) {
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets init')
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets set "BuildNumber" "' + env.BUILD_NUMBER + '"')
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets set "GitCommitSeven" "' + _GitCommitSeven + '"')
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets set "Server" "' + params.DEFAULT_FILE_SERVER + '"')
}
}
}
stage('Core Build') {
steps {
echo "Build number is ${currentBuild.number}"
dir(_TestProjectDirectory) {
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'build --runtime win-x64 --self-contained --verbosity quiet')
}
}
}
// stage('Test') {
// options {
// timeout(time: 10, unit: 'MINUTES')
// }
// steps {
// dir(_TestProjectDirectory) {
// bat('dotnet --info')
// }
// }
// }
stage('Framework Build') {
steps {
echo "Build number is ${currentBuild.number}"
bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' +
'/target:Restore ' +
'/detailedsummary ' +
'/consoleloggerparameters:PerformanceSummary;ErrorsOnly; ' +
'/property:Configuration=Debug;TargetFrameworkVersion=v4.8 ' +
_AssemblyName + '.csproj')
bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' +
'/target:Build ' +
'/detailedsummary ' +
'/consoleloggerparameters:PerformanceSummary;ErrorsOnly; ' +
'/property:Configuration=Debug;TargetFrameworkVersion=v4.8 ' +
_AssemblyName + '.csproj')
}
}
stage('Commit Id') {
steps {
dir('bin/Debug') {
writeFile file: "${_AssemblyName}.txt", text: "${env.GIT_COMMIT}-${env.BUILD_NUMBER}-${env.GIT_URL}"
}
}
}
stage('Package') {
steps {
fileOperations([fileZipOperation(folderPath: 'bin/Debug', outputFolderPath: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug")])
fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*", renameFiles: false, sourceCaptureExpression: '', targetLocation: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug", targetNameExpression: '')])
}
}
// stage('Force Fail') {
// steps {
// error("Build failed because of this and that..")
// }
// }
stage('Copy Files to: file-share') {
steps {
dir('bin/Debug') {
fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.txt", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.dll", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.exe", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.pdb", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
}
}
}
}
post {
always {
dir('bin') {
deleteDir()
}
dir('obj') {
deleteDir()
}
dir(_TestProjectDirectory + '/bin') {
deleteDir()
}
dir(_TestProjectDirectory + '/obj') {
deleteDir()
}
// cleanWs()
}
}
}

View File

@ -1,137 +1,10 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs] [*.cs]
csharp_indent_block_contents = true
#### Core EditorConfig Options #### csharp_indent_braces = false
csharp_indent_case_contents = true
# Indentation and spacing csharp_indent_case_contents_when_block = true
indent_size = 4 csharp_indent_labels = one_less_than_current
indent_style = space csharp_indent_switch_labels = true
tab_width = 4
# New line preferences
end_of_line = crlf
insert_final_newline = false
#### .NET Coding Conventions ####
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
# this. and Me. preferences
dotnet_style_qualification_for_event = false:error
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_property = false:error
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members
# Expression-level preferences
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true:warning
dotnet_style_explicit_tuple_names = true:warning
dotnet_style_namespace_match_folder = true
dotnet_style_null_propagation = true:warning
dotnet_style_object_initializer = true:warning
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_prefer_compound_assignment = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = false
dotnet_style_prefer_conditional_expression_over_return = false
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
dotnet_style_prefer_inferred_tuple_names = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
dotnet_style_prefer_simplified_boolean_expressions = true:warning
dotnet_style_prefer_simplified_interpolation = true
# Field preferences
dotnet_style_readonly_field = true:warning
# Parameter preferences
dotnet_code_quality_unused_parameters = all
# Suppression preferences
dotnet_remove_unnecessary_suppression_exclusions = 0
# New line preferences
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
dotnet_style_allow_statement_immediately_after_block_experimental = true
#### C# Coding Conventions ####
# var preferences
csharp_style_var_elsewhere = false:warning
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = false:warning
# Expression-bodied members
csharp_style_expression_bodied_accessors = when_on_single_line:warning
csharp_style_expression_bodied_constructors = when_on_single_line:warning
csharp_style_expression_bodied_indexers = when_on_single_line:warning
csharp_style_expression_bodied_lambdas = when_on_single_line:warning
csharp_style_expression_bodied_local_functions = when_on_single_line:warning
csharp_style_expression_bodied_methods = when_on_single_line:warning
csharp_style_expression_bodied_operators = when_on_single_line:warning
csharp_style_expression_bodied_properties = when_on_single_line:warning
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true:warning
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_prefer_not_pattern = true:warning
csharp_style_prefer_pattern_matching = true:warning
csharp_style_prefer_switch_expression = true:warning
# Null-checking preferences
csharp_style_conditional_delegate_call = true
# Modifier preferences
csharp_prefer_static_local_function = true:warning
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
# Code-block preferences
csharp_prefer_braces = false
csharp_prefer_simple_using_statement = true:warning
csharp_style_namespace_declarations = file_scoped:warning
# Expression-level preferences
csharp_prefer_simple_default_expression = true:warning
csharp_style_deconstructed_variable_declaration = false
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
csharp_style_inlined_variable_declaration = false
csharp_style_pattern_local_over_anonymous_function = true:warning
csharp_style_prefer_index_operator = false:warning
csharp_style_prefer_null_check_over_type_check = true
csharp_style_prefer_range_operator = false:warning
csharp_style_throw_expression = true
csharp_style_unused_value_assignment_preference = discard_variable:warning
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
# 'using' directive preferences
csharp_using_directive_placement = outside_namespace
# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
csharp_style_allow_embedded_statements_on_same_line_experimental = true
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = true csharp_new_line_before_catch = true
csharp_new_line_before_else = true csharp_new_line_before_else = true
csharp_new_line_before_finally = true csharp_new_line_before_finally = true
@ -139,16 +12,13 @@ csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true csharp_new_line_between_query_expression_clauses = true
csharp_prefer_braces = false
# Indentation preferences csharp_prefer_simple_default_expression = true:warning
csharp_indent_block_contents = true csharp_prefer_simple_using_statement = true:warning
csharp_indent_braces = false csharp_prefer_static_local_function = true:warning
csharp_indent_case_contents = true csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
csharp_indent_case_contents_when_block = true csharp_preserve_single_line_blocks = true
csharp_indent_labels = one_less_than_current csharp_preserve_single_line_statements = false
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_cast = false csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true csharp_space_after_comma = true
@ -171,166 +41,203 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false csharp_space_between_square_brackets = false
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
# Wrapping preferences csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
csharp_preserve_single_line_blocks = true csharp_style_allow_embedded_statements_on_same_line_experimental = true
csharp_preserve_single_line_statements = false csharp_style_conditional_delegate_call = true
csharp_style_deconstructed_variable_declaration = false
#### Naming styles #### csharp_style_expression_bodied_accessors = when_on_single_line:warning
csharp_style_expression_bodied_constructors = when_on_single_line:warning
# Naming rules csharp_style_expression_bodied_indexers = when_on_single_line:warning
csharp_style_expression_bodied_lambdas = when_on_single_line:warning
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning csharp_style_expression_bodied_local_functions = when_on_single_line:warning
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface csharp_style_expression_bodied_methods = when_on_single_line:warning
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i csharp_style_expression_bodied_operators = when_on_single_line:warning
csharp_style_expression_bodied_properties = when_on_single_line:warning
dotnet_naming_rule.types_should_be_pascal_case.severity = warning csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
dotnet_naming_rule.types_should_be_pascal_case.symbols = types csharp_style_inlined_variable_declaration = false
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case csharp_style_namespace_declarations = file_scoped:warning
csharp_style_pattern_local_over_anonymous_function = true:warning
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.severity = warning csharp_style_pattern_matching_over_as_with_null_check = true:warning
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.symbols = private_or_internal_field csharp_style_pattern_matching_over_is_with_cast_check = true:warning
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.style = private_of_internal_field csharp_style_prefer_index_operator = false:warning
csharp_style_prefer_not_pattern = true:warning
dotnet_naming_rule.enum_should_be_pascal_case.severity = warning csharp_style_prefer_null_check_over_type_check = true
dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum csharp_style_prefer_pattern_matching = true:warning
dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case csharp_style_prefer_range_operator = false:warning
csharp_style_prefer_switch_expression = true:warning
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.severity = warning csharp_style_throw_expression = true
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.symbols = public_or_protected_field csharp_style_unused_value_assignment_preference = discard_variable:warning
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.style = private_of_internal_field csharp_style_unused_value_expression_statement_preference = discard_variable:warning
csharp_style_var_elsewhere = false:warning
dotnet_naming_rule.class_should_be_pascal_case.severity = warning csharp_style_var_for_built_in_types = false:warning
dotnet_naming_rule.class_should_be_pascal_case.symbols = class csharp_style_var_when_type_is_apparent = false:warning
dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case csharp_using_directive_placement = outside_namespace
dotnet_code_quality_unused_parameters = all
dotnet_naming_rule.method_should_be_pascal_case.severity = warning dotnet_code_quality_unused_parameters = non_public # IDE0060: Remove unused parameter
dotnet_naming_rule.method_should_be_pascal_case.symbols = method dotnet_code_quality.CAXXXX.api_surface = private, internal
dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case dotnet_diagnostic.CA1825.severity = warning # CA1823: Avoid zero-length array allocations
dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.severity = warning dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.symbols = private_or_internal_static_field dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary
dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed
dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field dotnet_diagnostic.IDE0060.severity = warning # IDE0060: Remove unused parameter
dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.property_should_be_pascal_case.severity = warning
dotnet_naming_rule.property_should_be_pascal_case.symbols = property
dotnet_naming_rule.property_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.static_method_should_be_pascal_case.severity = warning
dotnet_naming_rule.static_method_should_be_pascal_case.symbols = static_method
dotnet_naming_rule.static_method_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
dotnet_naming_rule.private_method_should_be_pascal_case.severity = warning dotnet_naming_rule.class_should_be_pascal_case.severity = warning
dotnet_naming_rule.private_method_should_be_pascal_case.symbols = private_method dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.private_method_should_be_pascal_case.style = pascal_case dotnet_naming_rule.class_should_be_pascal_case.symbols = class
dotnet_naming_rule.event_should_be_pascal_case.severity = warning
dotnet_naming_rule.event_should_be_pascal_case.symbols = event
dotnet_naming_rule.event_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.delegate_should_be_pascal_case.severity = warning dotnet_naming_rule.delegate_should_be_pascal_case.severity = warning
dotnet_naming_rule.delegate_should_be_pascal_case.symbols = delegate
dotnet_naming_rule.delegate_should_be_pascal_case.style = pascal_case dotnet_naming_rule.delegate_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.delegate_should_be_pascal_case.symbols = delegate
dotnet_naming_rule.struct_should_be_pascal_case.severity = warning dotnet_naming_rule.enum_should_be_pascal_case.severity = warning
dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.struct_should_be_pascal_case.style = pascal_case dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum
dotnet_naming_rule.event_should_be_pascal_case.severity = warning
dotnet_naming_rule.event_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.event_should_be_pascal_case.symbols = event
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.method_should_be_pascal_case.severity = warning
dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.method_should_be_pascal_case.symbols = method
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
# Symbol specifications dotnet_naming_rule.private_method_should_be_pascal_case.severity = warning
dotnet_naming_rule.private_method_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.class.applicable_kinds = class dotnet_naming_rule.private_method_should_be_pascal_case.symbols = private_method
dotnet_naming_symbols.class.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.severity = warning
dotnet_naming_symbols.class.required_modifiers = dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.style = private_of_internal_field
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.symbols = private_or_internal_field
dotnet_naming_symbols.interface.applicable_kinds = interface dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.severity = warning
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field
dotnet_naming_symbols.interface.required_modifiers = dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.symbols = private_or_internal_static_field
dotnet_naming_rule.property_should_be_pascal_case.severity = warning
dotnet_naming_symbols.struct.applicable_kinds = struct dotnet_naming_rule.property_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.struct.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_rule.property_should_be_pascal_case.symbols = property
dotnet_naming_symbols.struct.required_modifiers = dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.severity = warning
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.style = private_of_internal_field
dotnet_naming_symbols.enum.applicable_kinds = enum dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.symbols = public_or_protected_field
dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning
dotnet_naming_symbols.enum.required_modifiers = dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field
dotnet_naming_symbols.delegate.applicable_kinds = delegate dotnet_naming_rule.static_method_should_be_pascal_case.severity = warning
dotnet_naming_symbols.delegate.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_rule.static_method_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.delegate.required_modifiers = dotnet_naming_rule.static_method_should_be_pascal_case.symbols = static_method
dotnet_naming_rule.struct_should_be_pascal_case.severity = warning
dotnet_naming_symbols.event.applicable_kinds = event dotnet_naming_rule.struct_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.event.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct
dotnet_naming_symbols.event.required_modifiers = dotnet_naming_rule.types_should_be_pascal_case.severity = warning
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.method.applicable_kinds = method dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_symbols.method.applicable_accessibilities = public dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_naming_symbols.method.required_modifiers =
dotnet_naming_symbols.private_method.applicable_kinds = method
dotnet_naming_symbols.private_method.applicable_accessibilities = private
dotnet_naming_symbols.private_method.required_modifiers =
dotnet_naming_symbols.abstract_method.applicable_kinds = method
dotnet_naming_symbols.abstract_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.abstract_method.required_modifiers = abstract
dotnet_naming_symbols.static_method.applicable_kinds = method
dotnet_naming_symbols.static_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.static_method.required_modifiers = static
dotnet_naming_symbols.property.applicable_kinds = property
dotnet_naming_symbols.property.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.property.required_modifiers =
dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field
dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected
dotnet_naming_symbols.public_or_protected_field.required_modifiers =
dotnet_naming_symbols.static_field.applicable_kinds = field
dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.static_field.required_modifiers = static
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix = dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator = dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.private_of_internal_field.capitalization = pascal_case
dotnet_naming_style.private_of_internal_field.required_prefix = _ dotnet_naming_style.private_of_internal_field.required_prefix = _
dotnet_naming_style.private_of_internal_field.required_suffix = dotnet_naming_style.private_of_internal_field.required_suffix =
dotnet_naming_style.private_of_internal_field.word_separator = dotnet_naming_style.private_of_internal_field.word_separator =
dotnet_naming_style.private_of_internal_field.capitalization = pascal_case dotnet_naming_symbols.abstract_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.abstract_method.applicable_kinds = method
dotnet_naming_symbols.abstract_method.required_modifiers = abstract
dotnet_naming_symbols.class.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.class.applicable_kinds = class
dotnet_naming_symbols.class.required_modifiers =
dotnet_naming_symbols.delegate.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.delegate.applicable_kinds = delegate
dotnet_naming_symbols.delegate.required_modifiers =
dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.enum.applicable_kinds = enum
dotnet_naming_symbols.enum.required_modifiers =
dotnet_naming_symbols.event.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.event.applicable_kinds = event
dotnet_naming_symbols.event.required_modifiers =
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.method.applicable_accessibilities = public
dotnet_naming_symbols.method.applicable_kinds = method
dotnet_naming_symbols.method.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.required_modifiers =
dotnet_naming_symbols.private_method.applicable_accessibilities = private
dotnet_naming_symbols.private_method.applicable_kinds = method
dotnet_naming_symbols.private_method.required_modifiers =
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
dotnet_naming_symbols.property.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.property.applicable_kinds = property
dotnet_naming_symbols.property.required_modifiers =
dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected
dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field
dotnet_naming_symbols.public_or_protected_field.required_modifiers =
dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.static_field.applicable_kinds = field
dotnet_naming_symbols.static_field.required_modifiers = static
dotnet_naming_symbols.static_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.static_method.applicable_kinds = method
dotnet_naming_symbols.static_method.required_modifiers = static
dotnet_naming_symbols.struct.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.struct.applicable_kinds = struct
dotnet_naming_symbols.struct.required_modifiers =
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.required_modifiers =
dotnet_remove_unnecessary_suppression_exclusions = 0
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
dotnet_style_allow_statement_immediately_after_block_experimental = true
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true:warning
dotnet_style_explicit_tuple_names = true:warning
dotnet_style_namespace_match_folder = true
dotnet_style_null_propagation = true:warning
dotnet_style_object_initializer = true:warning
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_prefer_compound_assignment = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = false
dotnet_style_prefer_conditional_expression_over_return = false
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
dotnet_style_prefer_inferred_tuple_names = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
dotnet_style_prefer_simplified_boolean_expressions = true:warning
dotnet_style_prefer_simplified_interpolation = true
dotnet_style_qualification_for_event = false:error
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_readonly_field = true:warning
dotnet_style_require_accessibility_modifiers = for_non_interface_members
end_of_line = crlf
file_header_template = unset
indent_size = 4
indent_style = space
insert_final_newline = false
root = true
tab_width = 4
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
# https://github.com/dotnet/project-system/blob/main/.editorconfig

View File

@ -2,954 +2,18 @@
{ {
"DocumentId": { "DocumentId": {
"ProjectId": { "ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f" "Id": "42d7f187-9268-4dad-a1cf-c225ec4ce98c"
}, },
"Id": "d9f60266-24bb-47b9-b90b-505448626929" "Id": "5fcb5135-ab8a-43c8-a4c7-a4453478f816"
},
"FileName": "FileRead.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\FileHandlers\\MapEafDrives\\FileRead.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "WHITESPACE",
"FormatDescription": "Fix whitespace formatting."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "de53d871-2af5-4e72-a249-4706287d2495"
},
"FileName": "Description.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Duplicator\\Description.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "WHITESPACE",
"FormatDescription": "Fix whitespace formatting."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "de538843-3afc-4f93-8d4b-a7336d8c0663"
},
"FileName": "FileRead.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\FileRead.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "WHITESPACE",
"FormatDescription": "Fix whitespace formatting."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "3117d767-6c30-478c-bf1d-cbb545918be9"
},
"FileName": "Logistics.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Logistics.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "WHITESPACE",
"FormatDescription": "Fix whitespace formatting."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "9901695b-af4f-43cf-aa10-ce95320d6ee4"
},
"FileName": "Logistics2.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Logistics2.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "WHITESPACE",
"FormatDescription": "Fix whitespace formatting."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "95b11142-f663-40fa-847c-33edfd59bd3e"
},
"FileName": "IDrive.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\IDrive.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "WHITESPACE",
"FormatDescription": "Fix whitespace formatting."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "d2139ba2-0b1c-4874-872c-c3a577261b71"
},
"FileName": "IProcessData.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\IProcessData.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "WHITESPACE",
"FormatDescription": "Fix whitespace formatting."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "2301c874-bc87-4c16-92b1-77fac0472818"
},
"FileName": "IFileRead.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\IFileRead.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "WHITESPACE",
"FormatDescription": "Fix whitespace formatting."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "e52d0c25-4154-4afe-8bba-22def5765f09"
},
"FileName": "IProcessData.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\IProcessData.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "WHITESPACE",
"FormatDescription": "Fix whitespace formatting."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "60578405-c12c-40bb-9155-35fb6b6bb7e9"
}, },
"FileName": "RijndaelEncryption.cs", "FileName": "RijndaelEncryption.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\RijndaelEncryption.cs", "FilePath": "T:\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\RijndaelEncryption.cs",
"FileChanges": [ "FileChanges": [
{ {
"LineNumber": 1, "LineNumber": 16,
"CharNumber": 1, "CharNumber": 27,
"DiagnosticId": "WHITESPACE", "DiagnosticId": "IDE1006",
"FormatDescription": "Fix whitespace formatting." "FormatDescription": "warning IDE1006: Naming rule violation: Missing prefix: \u0027_\u0027"
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "09a03f4f-43c5-4e44-ab07-7e36f92295bf"
},
"FileName": "Backbone.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Eaf\\Core\\Backbone.cs",
"FileChanges": [
{
"LineNumber": 48,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "7d964d7e-b115-4ca4-b114-12bee52e0643"
},
"FileName": "EmailMessage.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Eaf\\Core\\Smtp\\EmailMessage.cs",
"FileChanges": [
{
"LineNumber": 24,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "3a200b51-0c41-4a2d-bccb-2fa8796bb3c5"
},
"FileName": "ISmtp.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Eaf\\Core\\Smtp\\ISmtp.cs",
"FileChanges": [
{
"LineNumber": 9,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "66de3251-be58-4b16-90c1-33c03dd09031"
},
"FileName": "MailPriority.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Eaf\\Core\\Smtp\\MailPriority.cs",
"FileChanges": [
{
"LineNumber": 11,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "10443daf-832a-4106-be1e-3fa7c6a04276"
},
"FileName": "ParameterValue.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Eaf\\EquipmentCore\\DataCollection\\Reporting\\ParameterValue.cs",
"FileChanges": [
{
"LineNumber": 20,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "c3508e46-1b52-4c6a-872e-f28d031db8e2"
},
"FileName": "EquipmentParameter.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Eaf\\EquipmentCore\\SelfDescription\\ElementDescription\\EquipmentParameter.cs",
"FileChanges": [
{
"LineNumber": 24,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "92146d96-c33e-47e6-8638-caf4eca88475"
},
"FileName": "Field.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Eaf\\EquipmentCore\\SelfDescription\\ParameterTypes\\Field.cs",
"FileChanges": [
{
"LineNumber": 12,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "50cb7671-7ac7-49c7-87ea-2a426e0b78ca"
},
"FileName": "ParameterTypeDefinition.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Eaf\\EquipmentCore\\SelfDescription\\ParameterTypes\\ParameterTypeDefinition.cs",
"FileChanges": [
{
"LineNumber": 12,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "56927a86-2a2e-45a7-abff-e90398fe70ff"
},
"FileName": "StructuredType.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Eaf\\EquipmentCore\\SelfDescription\\ParameterTypes\\StructuredType.cs",
"FileChanges": [
{
"LineNumber": 12,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "e21e86a2-fc06-4ead-8a75-5bb18fa58d5f"
},
"FileName": "CellInstanceConnectionName.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\FileHandlers\\CellInstanceConnectionName.cs",
"FileChanges": [
{
"LineNumber": 29,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "d9f60266-24bb-47b9-b90b-505448626929"
},
"FileName": "FileRead.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\FileHandlers\\MapEafDrives\\FileRead.cs",
"FileChanges": [
{
"LineNumber": 144,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "6ee264c9-fd4e-404d-a587-044a5a2a6dc0"
},
"FileName": "FileRead.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\FileHandlers\\RijndaelEncryption\\FileRead.cs",
"FileChanges": [
{
"LineNumber": 149,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "1cc13acb-fed0-4082-a6d4-78a70ad10de8"
},
"FileName": "FileConnectorParameterTypeDefinitionProvider.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Ifx\\Eaf\\EquipmentConnector\\File\\SelfDescription\\FileConnectorParameterTypeDefinitionProvider.cs",
"FileChanges": [
{
"LineNumber": 14,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "00770792-9f9b-427f-b0f5-f169e00f734e"
},
"FileName": "AppSettings.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\AppSettings.cs",
"FileChanges": [
{
"LineNumber": 8,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "3e5b157e-bdf5-4478-9380-5b8bbde33474"
},
"FileName": "Drive.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Drive.cs",
"FileChanges": [
{
"LineNumber": 79,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "de53d871-2af5-4e72-a249-4706287d2495"
},
"FileName": "Description.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Duplicator\\Description.cs",
"FileChanges": [
{
"LineNumber": 148,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "de538843-3afc-4f93-8d4b-a7336d8c0663"
},
"FileName": "FileRead.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\FileRead.cs",
"FileChanges": [
{
"LineNumber": 832,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "11c599c1-e39a-4d7e-bf69-6602107aa43f"
},
"FileName": "IsEnvironment.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\IsEnvironment.cs",
"FileChanges": [
{
"LineNumber": 153,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "3117d767-6c30-478c-bf1d-cbb545918be9"
},
"FileName": "Logistics.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Logistics.cs",
"FileChanges": [
{
"LineNumber": 223,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "9901695b-af4f-43cf-aa10-ce95320d6ee4"
},
"FileName": "Logistics2.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Logistics2.cs",
"FileChanges": [
{
"LineNumber": 81,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "aa929740-8282-4f53-a017-9f4fd0bc52de"
},
"FileName": "IAppSettings.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\IAppSettings.cs",
"FileChanges": [
{
"LineNumber": 7,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "daa0c510-3814-4d60-a2f7-ddcbdac284f7"
},
"FileName": "IDescription.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\IDescription.cs",
"FileChanges": [
{
"LineNumber": 25,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "95b11142-f663-40fa-847c-33edfd59bd3e"
},
"FileName": "IDrive.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\IDrive.cs",
"FileChanges": [
{
"LineNumber": 13,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "082bf78f-326d-4598-9624-de7b8c41589e"
},
"FileName": "IFileRead.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\IFileRead.cs",
"FileChanges": [
{
"LineNumber": 26,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "c31d006f-a0ea-4d2b-9e35-c6c3a87d8707"
},
"FileName": "ILogistics.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\ILogistics.cs",
"FileChanges": [
{
"LineNumber": 8,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "a04628a6-fd18-47e5-9eb7-9b05bdd61fad"
},
"FileName": "ILogistics2.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\ILogistics2.cs",
"FileChanges": [
{
"LineNumber": 8,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "d2139ba2-0b1c-4874-872c-c3a577261b71"
},
"FileName": "IProcessData.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\IProcessData.cs",
"FileChanges": [
{
"LineNumber": 17,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "aa4a15be-be39-4035-94c5-b6ed92316c24"
},
"FileName": "ISMTP.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Methods\\ISMTP.cs",
"FileChanges": [
{
"LineNumber": 9,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "f995a138-de8c-4110-be73-e415454cb9b8"
},
"FileName": "ParameterType.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\ParameterType.cs",
"FileChanges": [
{
"LineNumber": 13,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "1e670147-df4e-4f24-98f4-576d4a408290"
},
"FileName": "ProcessDataStandardFormat.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\ProcessDataStandardFormat.cs",
"FileChanges": [
{
"LineNumber": 426,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "b970c7f4-17ff-403e-908f-316e5ee1bb98"
},
"FileName": "IAppSettings.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\IAppSettings.cs",
"FileChanges": [
{
"LineNumber": 9,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "c84aae6c-a6ea-43d2-948e-5b5bf93286fb"
},
"FileName": "IDescription.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\IDescription.cs",
"FileChanges": [
{
"LineNumber": 13,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "bf19c0ca-5466-4f95-accc-256e2aaad068"
},
"FileName": "IDrive.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\IDrive.cs",
"FileChanges": [
{
"LineNumber": 12,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "2301c874-bc87-4c16-92b1-77fac0472818"
},
"FileName": "IFileRead.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\IFileRead.cs",
"FileChanges": [
{
"LineNumber": 20,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "252dfa2d-fcdc-4d7f-96f2-57bd3e8f1756"
},
"FileName": "ILogistics.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\ILogistics.cs",
"FileChanges": [
{
"LineNumber": 25,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "1a39af2c-fdf3-44e3-b174-0eaa16ca826d"
},
"FileName": "ILogistics2.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\ILogistics2.cs",
"FileChanges": [
{
"LineNumber": 17,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "e52d0c25-4154-4afe-8bba-22def5765f09"
},
"FileName": "IProcessData.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\IProcessData.cs",
"FileChanges": [
{
"LineNumber": 13,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "60da3853-999e-4ebf-a4f5-ed0ea26551a6"
},
"FileName": "IScopeInfo.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Properties\\IScopeInfo.cs",
"FileChanges": [
{
"LineNumber": 20,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "60578405-c12c-40bb-9155-35fb6b6bb7e9"
},
"FileName": "RijndaelEncryption.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\RijndaelEncryption.cs",
"FileChanges": [
{
"LineNumber": 96,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "0d60a51d-8dcc-4653-bc2f-f69e8809e824"
},
"FileName": "Test.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Test.cs",
"FileChanges": [
{
"LineNumber": 57,
"CharNumber": 2,
"DiagnosticId": "FINALNEWLINE",
"FormatDescription": "Fix final newline. Delete 2 characters."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "3e5b157e-bdf5-4478-9380-5b8bbde33474"
},
"FileName": "Drive.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Drive.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "IMPORTS",
"FormatDescription": "Fix imports ordering."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "3117d767-6c30-478c-bf1d-cbb545918be9"
},
"FileName": "Logistics.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Logistics.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "IMPORTS",
"FormatDescription": "Fix imports ordering."
}
]
},
{
"DocumentId": {
"ProjectId": {
"Id": "e377a3ee-8088-4e2c-9e03-2f86769f945f"
},
"Id": "3117d767-6c30-478c-bf1d-cbb545918be9"
},
"FileName": "Logistics.cs",
"FilePath": "L:\\Workspaces\\33_CS29_79_72\\MIT_EAF_Adaptations\\Trunk\\MET08AFMD3100\\06_SourceCode\\EC\\Adaptation\\Shared\\Logistics.cs",
"FileChanges": [
{
"LineNumber": 186,
"CharNumber": 31,
"DiagnosticId": "IDE0003",
"FormatDescription": "error IDE0003: Name can be simplified."
} }
] ]
} }

23
Adaptation/.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,23 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#d791c9",
"activityBar.activeBorder": "#e8eed0",
"activityBar.background": "#d791c9",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#e8eed0",
"activityBarBadge.foreground": "#15202b",
"sash.hoverBorder": "#d791c9",
"statusBar.background": "#ca6bb7",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#bd45a5",
"statusBarItem.remoteBackground": "#ca6bb7",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#ca6bb7",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#ca6bb799",
"titleBar.inactiveForeground": "#15202b99"
},
"peacock.color": "#ca6bb7",
"cSpell.enabled": false
}

View File

@ -6,12 +6,16 @@
<SccLocalPath>SAK</SccLocalPath> <SccLocalPath>SAK</SccLocalPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <ImplicitUsings>disable</ImplicitUsings>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<LangVersion>10.0</LangVersion>
<Nullable>disable</Nullable>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<VSTestLogger>trx</VSTestLogger> <VSTestLogger>trx</VSTestLogger>
<VSTestResultsDirectory>../../../Trunk/EC/05_TestResults/TestResults</VSTestResultsDirectory> <VSTestResultsDirectory>../../../../EC/05_TestResults/TestResults</VSTestResultsDirectory>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows> <IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
@ -28,70 +32,58 @@
<DefineConstants>Linux</DefineConstants> <DefineConstants>Linux</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.1.0"/> <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0"/> <PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="6.0.0"/> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0"/> <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0"/> <PackageReference Include="Microsoft.Extensions.Configuration.json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.json" Version="6.0.0"/> <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0"/> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0"/> <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0"/> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0"/> <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0"/> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/> <PackageReference Include="Microsoft.Win32.SystemEvents" Version="6.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8"/>
<PackageReference Include="MSTest.TestFramework" Version="2.2.8"/>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0"/>
<PackageReference Include="System.Data.OleDb" Version="6.0.0"/>
<PackageReference Include="System.Data.SqlClient" Version="4.8.3"/>
<PackageReference Include="System.Text.Json" Version="6.0.1"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="External.Common.Logging.Core" Version="3.3.1"> <PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<NoWarn>NU1701</NoWarn> <PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
</PackageReference>
<PackageReference Include="External.Common.Logging" Version="3.3.1">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="External.Infineon.Monitoring.MonA" Version="1.2.0.1">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="External.Infineon.Yoda" Version="5.2.1">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="External.log4net" Version="2.0.8">
<NoWarn>NU1701</NoWarn>
</PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="IKVM.AWT.WinForms" Version="7.2.4630.5"> <PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
<NoWarn>NU1701</NoWarn> <PackageReference Include="System.Data.OleDb" Version="6.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="System.Text.Json" Version="6.0.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="IKVM.OpenJDK.Core" Version="7.2.4630.5"> <PackageReference Include="FFMpegCore" Version="4.8.0" />
<NoWarn>NU1701</NoWarn> <PackageReference Include="Infineon.Monitoring.MonA" Version="2.0.0" />
</PackageReference> <PackageReference Include="Infineon.Yoda" Version="5.4.1" />
<PackageReference Include="IKVM.OpenJDK.Media" Version="7.2.4630.5"> <PackageReference Include="Instances" Version="2.0.0" />
<NoWarn>NU1701</NoWarn> <PackageReference Include="RoboSharp" Version="1.2.7" />
</PackageReference> <PackageReference Include="Tesseract" Version="4.1.1" />
<PackageReference Include="IKVM.OpenJDK.Text" Version="7.2.4630.5">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="IKVM.OpenJDK.Util" Version="7.2.4630.5">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="IKVM.OpenJDK.XML.API" Version="7.2.4630.5">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="IKVM.Runtime" Version="7.2.4630.5">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="Pdfbox" Version="1.1.1">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="RoboSharp" Version="1.2.4" />
<PackageReference Include="Tibco.Rendezvous" Version="8.5.0" /> <PackageReference Include="Tibco.Rendezvous" Version="8.5.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="External.Common.Logging.Core" Version="3.3.1"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="External.Common.Logging" Version="3.3.1"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="External.log4net" Version="2.0.8"><NoWarn>NU1701</NoWarn></PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Pdfbox" Version="1.1.1"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.AWT.WinForms" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.OpenJDK.Core" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.OpenJDK.Media" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.OpenJDK.Text" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.OpenJDK.Util" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.OpenJDK.XML.API" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="IKVM.Runtime" Version="7.2.4630.5"><NoWarn>NU1701</NoWarn></PackageReference>
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="appsettings.json"> <None Include="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.Core namespace Adaptation.Eaf.Core;
public class BackboneComponent
{ {
public class BackboneComponent
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.Core namespace Adaptation.Eaf.Core;
public class BackboneStatusCache
{ {
public class BackboneStatusCache
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.Core namespace Adaptation.Eaf.Core;
public interface ILoggingSetupManager
{ {
public interface ILoggingSetupManager
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.Core namespace Adaptation.Eaf.Core;
public class StatusItem
{ {
public class StatusItem
{
}
} }

View File

@ -2,10 +2,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.Eaf.Core namespace Adaptation.Eaf.Core;
public class Backbone
{ {
public class Backbone
{ #pragma warning disable CA1822
#pragma warning disable CA2254
#pragma warning disable IDE0060
public const string STATE_ERROR = "Error"; public const string STATE_ERROR = "Error";
public const string STATE_OFFLINE = "Offline"; public const string STATE_OFFLINE = "Offline";
public const string STATE_RUNNING = "Running"; public const string STATE_RUNNING = "Running";
@ -30,12 +35,12 @@ namespace Adaptation.Eaf.Core
protected Dictionary<string, BackboneComponent> BackboneComponents { get; } protected Dictionary<string, BackboneComponent> BackboneComponents { get; }
public void AddBackboneComponent(BackboneComponent backboneComponent) { } public void AddBackboneComponent(BackboneComponent backboneComponent) { }
public bool ContainsBackboneComponent(string id) { throw new NotImplementedException(); } public bool ContainsBackboneComponent(string id) => throw new NotImplementedException();
[Obsolete("Use the capabilities exposed via the Status property -> GetAll. Will be removed with next major release.")] [Obsolete("Use the capabilities exposed via the Status property -> GetAll. Will be removed with next major release.")]
public List<StatusItem> GetAllStatuses() { throw new NotImplementedException(); } public List<StatusItem> GetAllStatuses() => throw new NotImplementedException();
public BackboneComponent GetBackboneComponentById(string id) { throw new NotImplementedException(); } public BackboneComponent GetBackboneComponentById(string id) => throw new NotImplementedException();
public List<T> GetBackboneComponentsOfType<T>() { throw new NotImplementedException(); } public List<T> GetBackboneComponentsOfType<T>() => throw new NotImplementedException();
public List<BackboneComponent> GetBackboneComponentsOfType(Type type) { throw new NotImplementedException(); } public List<BackboneComponent> GetBackboneComponentsOfType(Type type) => throw new NotImplementedException();
public void RegisterSubprocess(int pid) { } public void RegisterSubprocess(int pid) { }
[Obsolete("Use the capabilities exposed via the Status property -> SetValue. Will be removed with next major release.")] [Obsolete("Use the capabilities exposed via the Status property -> SetValue. Will be removed with next major release.")]
public void SetStatus(string statusName, string statusValue) { } public void SetStatus(string statusName, string statusValue) { }
@ -44,5 +49,5 @@ namespace Adaptation.Eaf.Core
protected void CloseConnectionOfComponents(List<BackboneComponent> components) { } protected void CloseConnectionOfComponents(List<BackboneComponent> components) { }
protected virtual void StopAllComponents() { } protected virtual void StopAllComponents() { }
protected void StopComponents(List<BackboneComponent> components) { } protected void StopComponents(List<BackboneComponent> components) { }
}
} }

View File

@ -1,10 +1,13 @@
using System; using System;
namespace Adaptation.Eaf.Core.Smtp namespace Adaptation.Eaf.Core.Smtp;
public class EmailMessage
{ {
public class EmailMessage #pragma warning disable CA2254
{ #pragma warning disable IDE0060
public EmailMessage() { } public EmailMessage() { }
public EmailMessage(string subject, string body, MailPriority priority = MailPriority.Normal) { } public EmailMessage(string subject, string body, MailPriority priority = MailPriority.Normal) { }
@ -12,13 +15,11 @@ namespace Adaptation.Eaf.Core.Smtp
public MailPriority Priority { get; } public MailPriority Priority { get; }
public string Subject { get; } public string Subject { get; }
public EmailMessage PriorityHigh() { throw new NotImplementedException(); } public EmailMessage PriorityHigh() => throw new NotImplementedException();
public EmailMessage PriorityLow() { throw new NotImplementedException(); } public EmailMessage PriorityLow() => throw new NotImplementedException();
public EmailMessage PriorityNormal() { throw new NotImplementedException(); } public EmailMessage PriorityNormal() => throw new NotImplementedException();
public EmailMessage SetBody(string body) { throw new NotImplementedException(); } public EmailMessage SetBody(string body) => throw new NotImplementedException();
public EmailMessage SetPriority(MailPriority priority) { throw new NotImplementedException(); } public EmailMessage SetPriority(MailPriority priority) => throw new NotImplementedException();
public EmailMessage SetSubject(string subject) { throw new NotImplementedException(); } public EmailMessage SetSubject(string subject) => throw new NotImplementedException();
}
} }

View File

@ -1,9 +1,6 @@
namespace Adaptation.Eaf.Core.Smtp namespace Adaptation.Eaf.Core.Smtp;
public interface ISmtp
{ {
public interface ISmtp
{
void Send(EmailMessage message); void Send(EmailMessage message);
}
} }

View File

@ -1,11 +1,8 @@
namespace Adaptation.Eaf.Core.Smtp namespace Adaptation.Eaf.Core.Smtp;
{
public enum MailPriority public enum MailPriority
{ {
Low = 0, Low = 0,
Normal = 1, Normal = 1,
High = 2 High = 2
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public class ChangeDataCollectionHandler
{ {
public class ChangeDataCollectionHandler
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public class DataCollectionRequest
{ {
public class DataCollectionRequest
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public class EquipmentEvent
{ {
public class EquipmentEvent
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public class EquipmentException
{ {
public class EquipmentException
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public class EquipmentSelfDescription
{ {
public class EquipmentSelfDescription
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public class GetParameterValuesHandler
{ {
public class GetParameterValuesHandler
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface IConnectionControl
{ {
public interface IConnectionControl
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface IDataTracingHandler
{ {
public interface IDataTracingHandler
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface IEquipmentCommandService
{ {
public interface IEquipmentCommandService
{
}
} }

View File

@ -1,9 +1,9 @@
using Adaptation.PeerGroup.GCL.Annotations; using Adaptation.PeerGroup.GCL.Annotations;
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface IEquipmentControl : IPackageSource
{ {
public interface IEquipmentControl : IPackageSource
{
[NotNull] [NotNull]
IEquipmentSelfDescriptionBuilder SelfDescriptionBuilder { get; } IEquipmentSelfDescriptionBuilder SelfDescriptionBuilder { get; }
[NotNull] [NotNull]
@ -12,5 +12,4 @@ namespace Adaptation.Eaf.EquipmentCore.Control
IEquipmentCommandService Commands { get; } IEquipmentCommandService Commands { get; }
[NotNull] [NotNull]
IConnectionControl Connection { get; } IConnectionControl Connection { get; }
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface IEquipmentSelfDescriptionBuilder
{ {
public interface IEquipmentSelfDescriptionBuilder
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface IPackage
{ {
public interface IPackage
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface ISelfDescriptionLookup
{ {
public interface ISelfDescriptionLookup
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface IVirtualParameterValuesHandler
{ {
public interface IVirtualParameterValuesHandler
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public class SetParameterValuesHandler
{ {
public class SetParameterValuesHandler
{
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public class TraceRequest
{ {
public class TraceRequest
{
}
} }

View File

@ -3,10 +3,10 @@ using Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface IEquipmentDataCollection
{ {
public interface IEquipmentDataCollection
{
IVirtualParameterValuesHandler VirtualParameterValuesHandler { get; } IVirtualParameterValuesHandler VirtualParameterValuesHandler { get; }
ISelfDescriptionLookup SelfDescriptionLookup { get; } ISelfDescriptionLookup SelfDescriptionLookup { get; }
EquipmentSelfDescription SelfDescription { get; } EquipmentSelfDescription SelfDescription { get; }
@ -35,5 +35,4 @@ namespace Adaptation.Eaf.EquipmentCore.Control
void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters); void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters);
void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters, IPackage sourcePackage); void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters, IPackage sourcePackage);
void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters, DateTime equipmentTimeStamp); void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable<ParameterValue> parameters, DateTime equipmentTimeStamp);
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.EquipmentCore.Control namespace Adaptation.Eaf.EquipmentCore.Control;
public interface IPackageSource
{ {
public interface IPackageSource
{
}
} }

View File

@ -1,11 +1,16 @@
using Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription; using Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription;
using Adaptation.PeerGroup.GCL.Annotations; using Adaptation.PeerGroup.GCL.Annotations;
using System; using System;
namespace Adaptation.Eaf.EquipmentCore.DataCollection.Reporting namespace Adaptation.Eaf.EquipmentCore.DataCollection.Reporting;
public class ParameterValue
{ {
public class ParameterValue
{ #pragma warning disable CA1822
#pragma warning disable CA2254
#pragma warning disable IDE0060
public ParameterValue(EquipmentParameter definition, object value) { } public ParameterValue(EquipmentParameter definition, object value) { }
public ParameterValue(EquipmentParameter definition, object value, DateTime timestamp) { } public ParameterValue(EquipmentParameter definition, object value, DateTime timestamp) { }
@ -14,7 +19,7 @@ namespace Adaptation.Eaf.EquipmentCore.DataCollection.Reporting
public EquipmentParameter Definition { get; } public EquipmentParameter Definition { get; }
public DateTime Timestamp { get; protected set; } public DateTime Timestamp { get; protected set; }
public virtual ParameterValue Clone(EquipmentParameter newDefinition) { throw new NotImplementedException(); } public virtual ParameterValue Clone(EquipmentParameter newDefinition) => throw new NotImplementedException();
public override string ToString() { return base.ToString(); } public override string ToString() => base.ToString();
}
} }

View File

@ -1,9 +1,13 @@
using Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes; using Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription;
public class EquipmentParameter
{ {
public class EquipmentParameter
{ #pragma warning disable CA2254
#pragma warning disable IDE0060
public EquipmentParameter(EquipmentParameter source, ParameterTypeDefinition typeDefinition) { } public EquipmentParameter(EquipmentParameter source, ParameterTypeDefinition typeDefinition) { }
public EquipmentParameter(string name, ParameterTypeDefinition typeDefinition, string description, bool isTransient = false, bool isReadOnly = true) { } public EquipmentParameter(string name, ParameterTypeDefinition typeDefinition, string description, bool isTransient = false, bool isReadOnly = true) { }
public EquipmentParameter(string id, string name, ParameterTypeDefinition typeDefinition, string description, bool isTransient = false, bool isReadOnly = true) { } public EquipmentParameter(string id, string name, ParameterTypeDefinition typeDefinition, string description, bool isTransient = false, bool isReadOnly = true) { }
@ -17,8 +21,7 @@ namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ElementDescription
public bool IsTransient { get; } public bool IsTransient { get; }
public bool IsReadOnly { get; } public bool IsReadOnly { get; }
public override string ToString() { return base.ToString(); } public override string ToString() => base.ToString();
public string ToStringWithDetails() { return base.ToString(); } public string ToStringWithDetails() => base.ToString();
}
} }

View File

@ -1,12 +1,16 @@
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
public class Field
{ {
public class Field
{ #pragma warning disable CA2254
#pragma warning disable IDE0060
public Field(string name, string description, bool canBeNull, ParameterTypeDefinition typeDefinition) { } public Field(string name, string description, bool canBeNull, ParameterTypeDefinition typeDefinition) { }
public string Name { get; } public string Name { get; }
public string Description { get; } public string Description { get; }
public ParameterTypeDefinition TypeDefinition { get; } public ParameterTypeDefinition TypeDefinition { get; }
public bool CanBeNull { get; } public bool CanBeNull { get; }
}
} }

View File

@ -1,12 +1,16 @@
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
public abstract class ParameterTypeDefinition
{ {
public abstract class ParameterTypeDefinition
{ #pragma warning disable CA2254
#pragma warning disable IDE0060
public ParameterTypeDefinition(string name, string description) { } public ParameterTypeDefinition(string name, string description) { }
public string Name { get; } public string Name { get; }
public string Description { get; } public string Description { get; }
public override string ToString() { return base.ToString(); } public override string ToString() => base.ToString();
}
} }

View File

@ -1,12 +1,16 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes namespace Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
public class StructuredType : ParameterTypeDefinition
{ {
public class StructuredType : ParameterTypeDefinition
{ #pragma warning disable CA1822
#pragma warning disable CA2254
#pragma warning disable IDE0060
public StructuredType(string name, string description, IList<Field> fields) : base(name, description) { } public StructuredType(string name, string description, IList<Field> fields) : base(name, description) { }
public IList<Field> Fields { get; } public IList<Field> Fields { get; }
}
} }

View File

@ -1,6 +1,5 @@
namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
public interface IConfigurationObject
{ {
public interface IConfigurationObject
{
}
} }

View File

@ -1,26 +1,30 @@
using System; using System;
namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
[System.Runtime.Serialization.DataContract(IsReference = true)]
public class ModelObjectParameterDefinition : IConfigurationObject
{ {
[System.Runtime.Serialization.DataContractAttribute(IsReference = true)]
public class ModelObjectParameterDefinition : IConfigurationObject #pragma warning disable CA2254
{ #pragma warning disable IDE0060
public ModelObjectParameterDefinition() { } public ModelObjectParameterDefinition() { }
public ModelObjectParameterDefinition(string name, ModelObjectParameterType valueType, object defaultValue) { } public ModelObjectParameterDefinition(string name, ModelObjectParameterType valueType, object defaultValue) { }
public ModelObjectParameterDefinition(string name, Type enumType, object defaultValue) { } public ModelObjectParameterDefinition(string name, Type enumType, object defaultValue) { }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual long Id { get; set; } public virtual long Id { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual string Name { get; set; } public virtual string Name { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual string Value { get; set; } public virtual string Value { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual ModelObjectParameterType ValueType { get; set; } public virtual ModelObjectParameterType ValueType { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual string EnumType { get; set; } public virtual string EnumType { get; set; }
public virtual ModelObjectParameterDefinition Clone() { return null; } public virtual ModelObjectParameterDefinition Clone() => null;
public virtual bool IsValidValue(string value) { return false; } public virtual bool IsValidValue(string value) => false;
}
} }

View File

@ -1,7 +1,7 @@
namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation namespace Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
public enum ModelObjectParameterType
{ {
public enum ModelObjectParameterType
{
String = 0, String = 0,
Bool = 1, Bool = 1,
Byte = 2, Byte = 2,
@ -13,5 +13,4 @@
Double = 8, Double = 8,
Float = 9, Float = 9,
Enum = 10 Enum = 10
}
} }

View File

@ -1,44 +1,43 @@
using Adaptation.PeerGroup.GCL.SecsDriver; using Adaptation.PeerGroup.GCL.SecsDriver;
using System; using System;
namespace Adaptation.Eaf.Management.ConfigurationData.Semiconductor.CellInstances namespace Adaptation.Eaf.Management.ConfigurationData.Semiconductor.CellInstances;
[System.Runtime.Serialization.DataContract]
public class SecsConnectionConfiguration
{ {
[System.Runtime.Serialization.DataContractAttribute]
public class SecsConnectionConfiguration
{
public SecsConnectionConfiguration() { } public SecsConnectionConfiguration() { }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual TimeSpan T6HsmsControlMessage { get; set; } public virtual TimeSpan T6HsmsControlMessage { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual TimeSpan T5ConnectionSeperation { get; set; } public virtual TimeSpan T5ConnectionSeperation { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual TimeSpan T4InterBlock { get; set; } public virtual TimeSpan T4InterBlock { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual TimeSpan T3MessageReply { get; set; } public virtual TimeSpan T3MessageReply { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual TimeSpan T2Protocol { get; set; } public virtual TimeSpan T2Protocol { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual TimeSpan T1InterCharacter { get; set; } public virtual TimeSpan T1InterCharacter { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual SerialBaudRate? BaudRate { get; set; } public virtual SerialBaudRate? BaudRate { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual SecsTransportType? PortType { get; set; } public virtual SecsTransportType? PortType { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual long? Port { get; set; } public virtual long? Port { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual TimeSpan LinkTestTimer { get; set; } public virtual TimeSpan LinkTestTimer { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual string Host { get; set; } public virtual string Host { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual long? DeviceId { get; set; } public virtual long? DeviceId { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual HsmsSessionMode? SessionMode { get; set; } public virtual HsmsSessionMode? SessionMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual HsmsConnectionMode? ConnectionMode { get; set; } public virtual HsmsConnectionMode? ConnectionMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual TimeSpan T7ConnectionIdle { get; set; } public virtual TimeSpan T7ConnectionIdle { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual TimeSpan T8NetworkIntercharacter { get; set; } public virtual TimeSpan T8NetworkIntercharacter { get; set; }
}
} }

View File

@ -4,26 +4,20 @@ using Adaptation.Shared.Methods;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.FileHandlers namespace Adaptation.FileHandlers;
public class CellInstanceConnectionName
{ {
public class CellInstanceConnectionName internal static IFileRead Get(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted)
{ {
internal static IFileRead Get(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted)
{
int levelIsArchive = 6;
int levelIsXToArchive = 5;
bool isDuplicator = cellInstanceConnectionName.StartsWith(cellInstanceName);
IFileRead result = cellInstanceConnectionName switch IFileRead result = cellInstanceConnectionName switch
{ {
nameof(MapEafDrives) => new MapEafDrives.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, dummyRuns, useCyclicalForDescription, isEAFHosted, levelIsXToArchive, levelIsArchive), nameof(MapEafDrives) => new MapEafDrives.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted),
nameof(RijndaelEncryption) => new RijndaelEncryption.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, dummyRuns, useCyclicalForDescription, isEAFHosted, levelIsXToArchive, levelIsArchive), nameof(RijndaelEncryption) => new RijndaelEncryption.FileRead(smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted),
_ => throw new Exception(), _ => throw new Exception(),
}; };
return result; return result;
} }
}
} }

View File

@ -11,20 +11,19 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.Text.Json; using System.Text.Json;
namespace Adaptation.FileHandlers.MapEafDrives namespace Adaptation.FileHandlers.MapEafDrives;
{
public class FileRead : Shared.FileRead, IFileRead public class FileRead : Shared.FileRead, IFileRead
{ {
private readonly AppSettings _AppSettings; private readonly AppSettings _AppSettings;
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted, int hyphenXToArchive, int hyphenIsArchive) : public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) :
base(new Description(), true, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted, hyphenXToArchive, hyphenIsArchive) base(new Description(), true, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted)
{ {
_MinFileLength = 10; _MinFileLength = 10;
_NullData = string.Empty; _NullData = string.Empty;
_Logistics = new Logistics(this); _Logistics = new(this);
if (_FileParameter is null) if (_FileParameter is null)
throw new Exception(cellInstanceConnectionName); throw new Exception(cellInstanceConnectionName);
if (_ModelObjectParameterDefinitions is null) if (_ModelObjectParameterDefinitions is null)
@ -43,15 +42,9 @@ namespace Adaptation.FileHandlers.MapEafDrives
} }
} }
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults);
{
Move(this, extractResults, exception);
}
void IFileRead.WaitForThread() void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
{
WaitForThread(thread: null, threadExceptions: null);
}
string IFileRead.GetEventDescription() string IFileRead.GetEventDescription()
{ {
@ -98,7 +91,7 @@ namespace Adaptation.FileHandlers.MapEafDrives
DateTime dateTime = DateTime.Now; DateTime dateTime = DateTime.Now;
results = GetExtractResult(reportFullPath, dateTime); results = GetExtractResult(reportFullPath, dateTime);
if (results.Item3 is null) if (results.Item3 is null)
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, new Test[] { }, JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4); results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted) if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3); WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks); UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
@ -114,22 +107,7 @@ namespace Adaptation.FileHandlers.MapEafDrives
return results; return results;
} }
void IFileRead.CheckTests(Test[] tests, bool extra) private static Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
{
throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
}
void IFileRead.MoveArchive()
{
throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
}
void IFileRead.Callback(object state)
{
throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
}
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
{ {
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>()); Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
if (reportFullPath is null) if (reportFullPath is null)
@ -139,6 +117,4 @@ namespace Adaptation.FileHandlers.MapEafDrives
return results; return results;
} }
}
} }

View File

@ -0,0 +1,167 @@
using System;
using System.Diagnostics;
namespace Adaptation.FileHandlers.MapEafDrives;
public class IsEnvironment
{
public enum Name
{
LinuxDevelopment,
LinuxProduction,
LinuxStaging,
OSXDevelopment,
OSXProduction,
OSXStaging,
WindowsDevelopment,
WindowsProduction,
WindowsStaging
}
public bool DebuggerWasAttachedDuringConstructor { get; private set; }
public bool Development { get; private set; }
public bool Linux { get; private set; }
public bool OSX { get; private set; }
public bool Production { get; private set; }
public bool Staging { get; private set; }
public bool Windows { get; private set; }
public string Profile { get; private set; }
public string AppSettingsFileName { get; private set; }
public string ASPNetCoreEnvironment { get; private set; }
public IsEnvironment(string testCategory)
{
if (testCategory.EndsWith(".json"))
{
Production = testCategory == "appsettings.json";
Staging = testCategory.EndsWith(nameof(Staging));
OSX = false;
Development = testCategory.EndsWith(nameof(Development));
Linux = false;
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
Windows = true;
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
}
else
{
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
OSX = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(OSX));
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
Linux = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Linux));
Staging = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Staging));
Windows = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Windows));
Production = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Production));
Development = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Development));
}
Profile = GetProfile();
AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
}
public IsEnvironment(bool isDevelopment, bool isStaging, bool isProduction)
{
Staging = isStaging;
Production = isProduction;
Development = isDevelopment;
OSX = false;
Linux = false;
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
Windows = true;
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
Profile = GetProfile();
AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
}
public IsEnvironment(int? processesCount, bool nullASPNetCoreEnvironmentIsDevelopment, bool nullASPNetCoreEnvironmentIsProduction)
{
OSX = false;
Linux = false;
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
Windows = true;
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
if (nullASPNetCoreEnvironmentIsDevelopment && nullASPNetCoreEnvironmentIsProduction)
throw new Exception();
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsProduction)
Production = true;
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsDevelopment)
Development = true;
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && !nullASPNetCoreEnvironmentIsDevelopment && !nullASPNetCoreEnvironmentIsProduction)
throw new Exception();
else
{
Staging = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Staging));
Production = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Production));
Development = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Development));
}
Profile = GetProfile();
AppSettingsFileName = GetAppSettingsFileName(processesCount);
}
private string GetProfile()
{
string result;
if (Windows && Production)
result = nameof(Production);
else if (Windows && Staging)
result = nameof(Staging);
else if (Windows && Development)
result = nameof(Development);
else if (Linux && Production)
result = nameof(Name.LinuxProduction);
else if (Linux && Staging)
result = nameof(Name.LinuxStaging);
else if (Linux && Development)
result = nameof(Name.LinuxDevelopment);
else if (OSX && Production)
result = nameof(Name.OSXProduction);
else if (OSX && Staging)
result = nameof(Name.OSXStaging);
else if (OSX && Development)
result = nameof(Name.OSXDevelopment);
else
throw new Exception();
return result;
}
private string GetAppSettingsFileName(int? processesCount)
{
string result;
if (Production)
{
if (processesCount is null)
result = "appsettings.json";
else
result = $"appsettings.{processesCount}.json";
}
else
{
string environment;
if (Staging)
environment = nameof(Staging);
else if (Development)
environment = nameof(Development);
else
throw new Exception();
if (processesCount is null)
result = $"appsettings.{environment}.json";
else
result = $"appsettings.{environment}.{processesCount}.json";
}
return result;
}
public static string GetEnvironmentName(IsEnvironment isEnvironment)
{
string result;
if (isEnvironment.Windows)
result = nameof(Windows);
else if (isEnvironment.Linux)
result = nameof(Linux);
else if (isEnvironment.OSX)
result = nameof(OSX);
else
throw new Exception();
return result;
}
}

View File

@ -1,4 +1,5 @@
using Adaptation.Eaf.Management.ConfigurationData.CellAutomation; using Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
using Adaptation.FileHandlers.MapEafDrives;
using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration; using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
using Adaptation.Shared; using Adaptation.Shared;
using Adaptation.Shared.Duplicator; using Adaptation.Shared.Duplicator;
@ -8,23 +9,21 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq;
using System.Text.Json; using System.Text.Json;
namespace Adaptation.FileHandlers.RijndaelEncryption namespace Adaptation.FileHandlers.RijndaelEncryption;
{
public class FileRead : Shared.FileRead, IFileRead public class FileRead : Shared.FileRead, IFileRead
{ {
private readonly AppSettings _AppSettings; private readonly AppSettings _AppSettings;
public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted, int hyphenXToArchive, int hyphenIsArchive) : public FileRead(ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted) :
base(new Description(), true, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, useCyclicalForDescription, isEAFHosted, hyphenXToArchive, hyphenIsArchive) base(new Description(), true, smtp, fileParameter, cellInstanceName, cellInstanceConnectionName, fileConnectorConfiguration, equipmentTypeName, parameterizedModelObjectDefinitionType, modelObjectParameters, equipmentDictionaryName, dummyRuns, staticRuns, useCyclicalForDescription, isEAFHosted)
{ {
_MinFileLength = 10; _MinFileLength = 10;
_NullData = string.Empty; _NullData = string.Empty;
_Logistics = new Logistics(this); _Logistics = new(this);
if (_FileParameter is null) if (_FileParameter is null)
throw new Exception(cellInstanceConnectionName); throw new Exception(cellInstanceConnectionName);
if (_ModelObjectParameterDefinitions is null) if (_ModelObjectParameterDefinitions is null)
@ -41,15 +40,9 @@ namespace Adaptation.FileHandlers.RijndaelEncryption
} }
} }
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults);
{
Move(this, extractResults, exception);
}
void IFileRead.WaitForThread() void IFileRead.WaitForThread() => WaitForThread(thread: null, threadExceptions: null);
{
WaitForThread(thread: null, threadExceptions: null);
}
string IFileRead.GetEventDescription() string IFileRead.GetEventDescription()
{ {
@ -96,7 +89,7 @@ namespace Adaptation.FileHandlers.RijndaelEncryption
DateTime dateTime = DateTime.Now; DateTime dateTime = DateTime.Now;
results = GetExtractResult(reportFullPath, dateTime); results = GetExtractResult(reportFullPath, dateTime);
if (results.Item3 is null) if (results.Item3 is null)
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, new Test[] { }, JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4); results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted) if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3); WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks); UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
@ -112,28 +105,13 @@ namespace Adaptation.FileHandlers.RijndaelEncryption
return results; return results;
} }
void IFileRead.CheckTests(Test[] tests, bool extra)
{
throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
}
void IFileRead.MoveArchive()
{
throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
}
void IFileRead.Callback(object state)
{
throw new Exception(string.Concat("Not ", nameof(_IsDuplicator)));
}
private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime) private Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, DateTime dateTime)
{ {
Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>()); Tuple<string, Test[], JsonElement[], List<FileInfo>> results = new(string.Empty, null, null, new List<FileInfo>());
string[] lines = File.ReadAllLines(reportFullPath); string[] lines = File.ReadAllLines(reportFullPath);
for (int i = 0; i < lines.Length; i++) for (int i = 0; i < lines.Length; i++)
{ {
if (string.IsNullOrEmpty(lines[i]) || lines[i].Contains('\t')) if (string.IsNullOrEmpty(lines[i]) || lines[i].Contains("\t"))
continue; continue;
if (Shared.RijndaelEncryption.IsBase64String(lines[i])) if (Shared.RijndaelEncryption.IsBase64String(lines[i]))
lines[i] = string.Concat(lines[i], '\t', dateTime.Ticks, '\t', Shared.RijndaelEncryption.Decrypt(lines[i], _AppSettings.Company)); lines[i] = string.Concat(lines[i], '\t', dateTime.Ticks, '\t', Shared.RijndaelEncryption.Decrypt(lines[i], _AppSettings.Company));
@ -144,6 +122,4 @@ namespace Adaptation.FileHandlers.RijndaelEncryption
return results; return results;
} }
}
} }

View File

@ -1,13 +1,17 @@
namespace Adaptation.Ifx.Eaf.Common.Configuration namespace Adaptation.Ifx.Eaf.Common.Configuration;
[System.Runtime.Serialization.DataContract]
public class ConnectionSetting
{ {
[System.Runtime.Serialization.DataContractAttribute]
public class ConnectionSetting #pragma warning disable CA2254
{ #pragma warning disable IDE0060
public ConnectionSetting(string name, string value) { } public ConnectionSetting(string name, string value) { }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string Name { get; set; } public string Name { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string Value { get; set; } public string Value { get; set; }
}
} }

View File

@ -1,19 +1,23 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component;
public class File
{ {
public class File
{ #pragma warning disable CA2254
public File(string filePath) { throw new NotImplementedException(); } #pragma warning disable IDE0060
public File(string filePath, DateTime timeFileFound) { throw new NotImplementedException(); }
public File(string filePath) => throw new NotImplementedException();
public File(string filePath, DateTime timeFileFound) => throw new NotImplementedException();
public string Path { get; } public string Path { get; }
public DateTime TimeFound { get; } public DateTime TimeFound { get; }
public bool IsErrorFile { get; } public bool IsErrorFile { get; }
public Dictionary<string, string> ContentParameters { get; } public Dictionary<string, string> ContentParameters { get; }
public File UpdateContentParameters(Dictionary<string, string> contentParameters) { throw new NotImplementedException(); } public File UpdateContentParameters(Dictionary<string, string> contentParameters) => throw new NotImplementedException();
public File UpdateParsingStatus(bool isErrorFile) { throw new NotImplementedException(); } public File UpdateParsingStatus(bool isErrorFile) => throw new NotImplementedException();
}
} }

View File

@ -2,10 +2,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component;
public class FilePathGenerator
{ {
public class FilePathGenerator
{ #pragma warning disable CA1822
#pragma warning disable CA2254
#pragma warning disable IDE0060
public const char PLACEHOLDER_IDENTIFIER = '%'; public const char PLACEHOLDER_IDENTIFIER = '%';
public const char PLACEHOLDER_SEPARATOR = ':'; public const char PLACEHOLDER_SEPARATOR = ':';
public const string PLACEHOLDER_NOT_AVAILABLE = "NA"; public const string PLACEHOLDER_NOT_AVAILABLE = "NA";
@ -15,9 +20,9 @@ namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component
public const string PLACEHOLDER_SUB_FOLDER = "SubFolder"; public const string PLACEHOLDER_SUB_FOLDER = "SubFolder";
public const string PLACEHOLDER_CELL_NAME = "CellName"; public const string PLACEHOLDER_CELL_NAME = "CellName";
public FilePathGenerator(FileConnectorConfiguration config, Dictionary<string, string> customPattern = null) { throw new NotImplementedException(); } public FilePathGenerator(FileConnectorConfiguration config, Dictionary<string, string> customPattern = null) => throw new NotImplementedException();
public FilePathGenerator(FileConnectorConfiguration config, File file, bool isErrorFile = false, Dictionary<string, string> customPattern = null) { throw new NotImplementedException(); } public FilePathGenerator(FileConnectorConfiguration config, File file, bool isErrorFile = false, Dictionary<string, string> customPattern = null) => throw new NotImplementedException();
public FilePathGenerator(FileConnectorConfiguration config, string sourceFilePath, bool isErrorFile = false, Dictionary<string, string> customPattern = null) { throw new NotImplementedException(); } public FilePathGenerator(FileConnectorConfiguration config, string sourceFilePath, bool isErrorFile = false, Dictionary<string, string> customPattern = null) => throw new NotImplementedException();
protected string SubFolderPath { get; } protected string SubFolderPath { get; }
protected FileConnectorConfiguration Configuration { get; } protected FileConnectorConfiguration Configuration { get; }
@ -25,11 +30,11 @@ namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Component
protected bool IsErrorFile { get; } protected bool IsErrorFile { get; }
protected string DefaultPlaceHolderValue { get; } protected string DefaultPlaceHolderValue { get; }
public string GetFullTargetPath() { throw new NotImplementedException(); } public string GetFullTargetPath() => throw new NotImplementedException();
public virtual string GetTargetFileName() { throw new NotImplementedException(); } public virtual string GetTargetFileName() => throw new NotImplementedException();
public string GetTargetFolder(bool throwExceptionIfNotExist = true) { throw new NotImplementedException(); } public string GetTargetFolder(bool throwExceptionIfNotExist = true) => throw new NotImplementedException();
protected virtual string GetSubFolder(string folderPattern, string subFolderPath) { throw new NotImplementedException(); } protected virtual string GetSubFolder(string folderPattern, string subFolderPath) => throw new NotImplementedException();
protected virtual string PrepareFolderPath(string targetFolderPath, string subFolderPath) { throw new NotImplementedException(); } protected virtual string PrepareFolderPath(string targetFolderPath, string subFolderPath) => throw new NotImplementedException();
protected string ReplacePlaceholder(string inputPath) { throw new NotImplementedException(); } protected string ReplacePlaceholder(string inputPath) => throw new NotImplementedException();
}
} }

View File

@ -2,90 +2,90 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
[System.Runtime.Serialization.DataContract]
public class FileConnectorConfiguration
{ {
[System.Runtime.Serialization.DataContractAttribute]
public class FileConnectorConfiguration
{
public const ulong IDLE_EVENT_WAIT_TIME_DEFAULT = 360; public const ulong IDLE_EVENT_WAIT_TIME_DEFAULT = 360;
public const ulong FILE_HANDLE_TIMEOUT_DEFAULT = 15; public const ulong FILE_HANDLE_TIMEOUT_DEFAULT = 15;
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual bool? TriggerOnChanged { get; set; } public virtual bool? TriggerOnChanged { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual long? PostProcessingRetries { get; set; } public virtual long? PostProcessingRetries { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual bool? CopySourceFolderStructure { get; set; } public virtual bool? CopySourceFolderStructure { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public IfPostProcessingFailsEnum? IfPostProcessingFailsAction { get; set; } public IfPostProcessingFailsEnum? IfPostProcessingFailsAction { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string AlternateTargetFolder { get; set; } public string AlternateTargetFolder { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public long? FileHandleTimeout { get; set; } public long? FileHandleTimeout { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public bool? DeleteEmptySourceSubFolders { get; set; } public bool? DeleteEmptySourceSubFolders { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public long? IdleEventWaitTimeInSeconds { get; set; } public long? IdleEventWaitTimeInSeconds { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string FileAgeThreshold { get; set; } public string FileAgeThreshold { get; set; }
public bool? FolderAgeCheckIndividualSubFolders { get; set; } public bool? FolderAgeCheckIndividualSubFolders { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual ZipModeEnum? ZipMode { get; set; } public virtual ZipModeEnum? ZipMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public FileAgeFilterEnum? FileAgeFilterMode { get; set; } public FileAgeFilterEnum? FileAgeFilterMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string ZipTargetFileName { get; set; } public string ZipTargetFileName { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string ZipErrorTargetFileName { get; set; } public string ZipErrorTargetFileName { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public long? ZipFileSubFolderLevel { get; set; } public long? ZipFileSubFolderLevel { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string DefaultPlaceHolderValue { get; set; } public string DefaultPlaceHolderValue { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public bool? UseZip64Mode { get; set; } public bool? UseZip64Mode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public List<ConnectionSetting> ConnectionSettings { get; set; } public List<ConnectionSetting> ConnectionSettings { get; set; }
public string SourceDirectoryCloaking { get; set; } public string SourceDirectoryCloaking { get; set; }
public string FolderAgeThreshold { get; set; } public string FolderAgeThreshold { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual long? FileScanningIntervalInSeconds { get; set; } public virtual long? FileScanningIntervalInSeconds { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual bool? TriggerOnCreated { get; set; } public virtual bool? TriggerOnCreated { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual long? ZipFileTime { get; set; } public virtual long? ZipFileTime { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string SourceFileLocation { get; set; } public string SourceFileLocation { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string SourceFileFilter { get; set; } public string SourceFileFilter { get; set; }
public List<string> SourceFileFilters { get; set; } public List<string> SourceFileFilters { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual bool? IncludeSubDirectories { get; set; } public virtual bool? IncludeSubDirectories { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual FileScanningOptionEnum? FileScanningOption { get; set; } public virtual FileScanningOptionEnum? FileScanningOption { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string TargetFileLocation { get; set; } public string TargetFileLocation { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string ErrorTargetFileLocation { get; set; } public string ErrorTargetFileLocation { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string TargetFileName { get; set; } public string TargetFileName { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual long? FileHandleWaitTime { get; set; } public virtual long? FileHandleWaitTime { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public IfFileExistEnum? IfFileExistAction { get; set; } public IfFileExistEnum? IfFileExistAction { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public long? ConnectionRetryInterval { get; set; } public long? ConnectionRetryInterval { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public PreProcessingModeEnum? PreProcessingMode { get; set; } public PreProcessingModeEnum? PreProcessingMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public PostProcessingModeEnum? PostProcessingMode { get; set; } public PostProcessingModeEnum? PostProcessingMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public PostProcessingModeEnum? ErrorPostProcessingMode { get; set; } public PostProcessingModeEnum? ErrorPostProcessingMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public virtual long? ZipFileAmount { get; set; } public virtual long? ZipFileAmount { get; set; }
[System.Runtime.Serialization.DataMemberAttribute] [System.Runtime.Serialization.DataMember]
public string ErrorTargetFileName { get; set; } public string ErrorTargetFileName { get; set; }
public void Initialize() { throw new NotImplementedException(); } public void Initialize() => throw new NotImplementedException();
public enum PostProcessingModeEnum public enum PostProcessingModeEnum
{ {
@ -131,5 +131,4 @@ namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration
IgnoreNewer = 0, IgnoreNewer = 0,
IgnoreOlder = 1 IgnoreOlder = 1
} }
}
} }

View File

@ -1,14 +1,18 @@
using Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes; using Adaptation.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.SelfDescription namespace Adaptation.Ifx.Eaf.EquipmentConnector.File.SelfDescription;
public class FileConnectorParameterTypeDefinitionProvider
{ {
public class FileConnectorParameterTypeDefinitionProvider
{ #pragma warning disable CA1822
#pragma warning disable CA2254
#pragma warning disable IDE0060
public FileConnectorParameterTypeDefinitionProvider() { } public FileConnectorParameterTypeDefinitionProvider() { }
public IEnumerable<ParameterTypeDefinition> GetAllParameterTypeDefinition() { return null; } public IEnumerable<ParameterTypeDefinition> GetAllParameterTypeDefinition() => null;
public ParameterTypeDefinition GetParameterTypeDefinition(string name) { return null; } public ParameterTypeDefinition GetParameterTypeDefinition(string name) => null;
}
} }

View File

@ -1,10 +1,9 @@
using System; using System;
namespace Adaptation.PeerGroup.GCL.Annotations namespace Adaptation.PeerGroup.GCL.Annotations;
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.Delegate, AllowMultiple = false, Inherited = true)]
public sealed class NotNullAttribute : Attribute
{ {
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.Delegate, AllowMultiple = false, Inherited = true)]
public sealed class NotNullAttribute : Attribute
{
public NotNullAttribute() { } public NotNullAttribute() { }
}
} }

View File

@ -1,8 +1,7 @@
namespace Adaptation.PeerGroup.GCL.SecsDriver namespace Adaptation.PeerGroup.GCL.SecsDriver;
public enum HsmsConnectionMode
{ {
public enum HsmsConnectionMode
{
Active = 0, Active = 0,
Passive = 1 Passive = 1
}
} }

View File

@ -1,8 +1,7 @@
namespace Adaptation.PeerGroup.GCL.SecsDriver namespace Adaptation.PeerGroup.GCL.SecsDriver;
public enum HsmsSessionMode
{ {
public enum HsmsSessionMode
{
MultiSession = 0, MultiSession = 0,
SingleSession = 1 SingleSession = 1
}
} }

View File

@ -1,8 +1,7 @@
namespace Adaptation.PeerGroup.GCL.SecsDriver namespace Adaptation.PeerGroup.GCL.SecsDriver;
public enum SecsTransportType
{ {
public enum SecsTransportType
{
HSMS = 0, HSMS = 0,
Serial = 1 Serial = 1
}
} }

View File

@ -1,7 +1,7 @@
namespace Adaptation.PeerGroup.GCL.SecsDriver namespace Adaptation.PeerGroup.GCL.SecsDriver;
public enum SerialBaudRate
{ {
public enum SerialBaudRate
{
Baud9600 = 0, Baud9600 = 0,
Baud19200 = 1, Baud19200 = 1,
Baud4800 = 2, Baud4800 = 2,
@ -12,5 +12,4 @@
Baud38400 = 7, Baud38400 = 7,
Baud57600 = 8, Baud57600 = 8,
Baud115200 = 9 Baud115200 = 9
}
} }

View File

@ -1,8 +1,7 @@
namespace Adaptation.Shared namespace Adaptation.Shared;
public class AppSettings : Properties.IAppSettings
{ {
public class AppSettings : Methods.IAppSettings
{
public string Company { get; set; } public string Company { get; set; }
public Drive[] Drives { get; set; } public Drive[] Drives { get; set; }
}
} }

View File

@ -3,21 +3,17 @@ using System;
using System.Diagnostics; using System.Diagnostics;
using System.Text; using System.Text;
namespace Adaptation.Shared namespace Adaptation.Shared;
{
public class Drive : Methods.IDrive public class Drive : Methods.IDrive
{ {
public bool Use { get; set; } public bool Use { get; set; }
public string Letter { get; set; } public string Letter { get; set; }
public string Share { get; set; } public string Share { get; set; }
public string User { get; set; } public string User { get; set; }
public string Password { get; set; } public string Password { get; set; }
void Methods.IDrive.MapEafDrives(ILog log, Properties.IAppSettings appSettings) void Methods.IDrive.MapEafDrives(ILog log, Properties.IAppSettings appSettings) => MapEafDrives(log, appSettings);
{
MapEafDrives(log, appSettings);
}
public static void MapEafDrives(ILog log, Properties.IAppSettings appSettings) public static void MapEafDrives(ILog log, Properties.IAppSettings appSettings)
{ {
@ -38,10 +34,10 @@ namespace Adaptation.Shared
else else
decrypted = RijndaelEncryption.Decrypt(drive.Password, appSettings.Company); decrypted = RijndaelEncryption.Decrypt(drive.Password, appSettings.Company);
arguments = $"use {drive.Letter}: \"{drive.Share}\" /p:yes /user:{drive.User} {decrypted}"; arguments = $"use {drive.Letter}: \"{drive.Share}\" /p:yes /user:{drive.User} {decrypted}";
stringBuilder.Clear(); _ = stringBuilder.Clear();
segments = arguments.Split(' '); segments = arguments.Split(' ');
for (int j = 0; j < segments.Length - 1; j++) for (int j = 0; j < segments.Length - 1; j++)
stringBuilder.Append(segments[j]).Append(' '); _ = stringBuilder.Append(segments[j]).Append(' ');
log.Info($"// {stringBuilder}"); log.Info($"// {stringBuilder}");
ProcessStartInfo processStartInfo = new(fileName, arguments) ProcessStartInfo processStartInfo = new(fileName, arguments)
{ {
@ -54,7 +50,7 @@ namespace Adaptation.Shared
process = Process.Start(processStartInfo); process = Process.Start(processStartInfo);
for (int j = 1; j < 45; j++) for (int j = 1; j < 45; j++)
{ {
process.WaitForExit(1000); _ = process.WaitForExit(1000);
if (process.HasExited) if (process.HasExited)
break; break;
} }
@ -74,6 +70,4 @@ namespace Adaptation.Shared
} }
} }
}
} }

View File

@ -4,11 +4,10 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.Json; using System.Text.Json;
namespace Adaptation.Shared.Duplicator namespace Adaptation.Shared.Duplicator;
{
public class Description : IDescription, Properties.IDescription public class Description : IDescription, Properties.IDescription
{ {
public int Test { get; set; } public int Test { get; set; }
public int Count { get; set; } public int Count { get; set; }
@ -24,10 +23,7 @@ namespace Adaptation.Shared.Duplicator
public string MID { get; set; } public string MID { get; set; }
public string Date { get; set; } //2021-10-23 public string Date { get; set; } //2021-10-23
string IDescription.GetEventDescription() string IDescription.GetEventDescription() => "File Has been read and parsed";
{
return "File Has been read and parsed";
}
List<string> IDescription.GetNames(IFileRead fileRead, Logistics logistics) List<string> IDescription.GetNames(IFileRead fileRead, Logistics logistics)
{ {
@ -82,7 +78,7 @@ namespace Adaptation.Shared.Duplicator
return results; return results;
} }
List<string> IDescription.GetIgnoreParameterNames() List<string> IDescription.GetIgnoreParameterNames(Test test)
{ {
List<string> results = new(); List<string> results = new();
return results; return results;
@ -116,13 +112,13 @@ namespace Adaptation.Shared.Duplicator
return results; return results;
} }
private Description GetDisplayNames() private static Description GetDisplayNames()
{ {
Description result = new(); Description result = new();
return result; return result;
} }
private Description GetDefault(IFileRead fileRead, Logistics logistics) private static Description GetDefault(IFileRead fileRead, Logistics logistics)
{ {
Description result = new() Description result = new()
{ {
@ -143,6 +139,4 @@ namespace Adaptation.Shared.Duplicator
return result; return result;
} }
}
} }

View File

@ -1,4 +1,4 @@
using Adaptation.Eaf.Management.ConfigurationData.CellAutomation; using Adaptation.Eaf.Management.ConfigurationData.CellAutomation;
using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration; using Adaptation.Ifx.Eaf.EquipmentConnector.File.Configuration;
using Adaptation.Shared.Methods; using Adaptation.Shared.Methods;
using log4net; using log4net;
@ -12,11 +12,10 @@ using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using System.Threading; using System.Threading;
namespace Adaptation.Shared namespace Adaptation.Shared;
{
public class FileRead : Properties.IFileRead public class FileRead : Properties.IFileRead
{ {
protected string _NullData; protected string _NullData;
protected readonly ILog _Log; protected readonly ILog _Log;
@ -34,11 +33,7 @@ namespace Adaptation.Shared
protected readonly bool _IsDuplicator; protected readonly bool _IsDuplicator;
protected readonly Calendar _Calendar; protected readonly Calendar _Calendar;
protected readonly bool _IsSourceTimer; protected readonly bool _IsSourceTimer;
protected readonly string _VillachPath;
protected readonly int _HyphenIsArchive;
protected readonly string _ProgressPath;
protected readonly string _EquipmentType; protected readonly string _EquipmentType;
protected readonly int _HyphenIsXToArchive;
protected readonly long _BreakAfterSeconds; protected readonly long _BreakAfterSeconds;
protected readonly string _ExceptionSubject; protected readonly string _ExceptionSubject;
protected readonly string _CellInstanceName; protected readonly string _CellInstanceName;
@ -49,6 +44,7 @@ namespace Adaptation.Shared
protected readonly string _CellInstanceConnectionNameBase; protected readonly string _CellInstanceConnectionNameBase;
protected readonly Dictionary<string, List<long>> _DummyRuns; protected readonly Dictionary<string, List<long>> _DummyRuns;
protected readonly Dictionary<string, string> _FileParameter; protected readonly Dictionary<string, string> _FileParameter;
protected readonly Dictionary<long, List<string>> _StaticRuns;
protected readonly string _ParameterizedModelObjectDefinitionType; protected readonly string _ParameterizedModelObjectDefinitionType;
protected readonly FileConnectorConfiguration _FileConnectorConfiguration; protected readonly FileConnectorConfiguration _FileConnectorConfiguration;
protected readonly IList<ModelObjectParameterDefinition> _ModelObjectParameterDefinitions; protected readonly IList<ModelObjectParameterDefinition> _ModelObjectParameterDefinitions;
@ -66,19 +62,18 @@ namespace Adaptation.Shared
string Properties.IFileRead.CellInstanceConnectionName => _CellInstanceConnectionName; string Properties.IFileRead.CellInstanceConnectionName => _CellInstanceConnectionName;
string Properties.IFileRead.ParameterizedModelObjectDefinitionType => _ParameterizedModelObjectDefinitionType; string Properties.IFileRead.ParameterizedModelObjectDefinitionType => _ParameterizedModelObjectDefinitionType;
public FileRead(IDescription description, bool isEvent, ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, bool useCyclicalForDescription, bool isEAFHosted, int hyphenXToArchive, int hyphenIsArchive) public FileRead(IDescription description, bool isEvent, ISMTP smtp, Dictionary<string, string> fileParameter, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, Dictionary<string, List<long>> dummyRuns, Dictionary<long, List<string>> staticRuns, bool useCyclicalForDescription, bool isEAFHosted)
{ {
_SMTP = smtp; _SMTP = smtp;
_IsEvent = isEvent; _IsEvent = isEvent;
_DummyRuns = dummyRuns; _DummyRuns = dummyRuns;
_LastTicksDuration = 0; _LastTicksDuration = 0;
_StaticRuns = staticRuns;
_IsEAFHosted = isEAFHosted; _IsEAFHosted = isEAFHosted;
_Description = description; _Description = description;
_FileParameter = fileParameter; _FileParameter = fileParameter;
_ReportFullPath = string.Empty; _ReportFullPath = string.Empty;
_HyphenIsArchive = hyphenIsArchive;
_CellInstanceName = cellInstanceName; _CellInstanceName = cellInstanceName;
_HyphenIsXToArchive = hyphenXToArchive;
_Calendar = new CultureInfo("en-US").Calendar; _Calendar = new CultureInfo("en-US").Calendar;
_Log = LogManager.GetLogger(typeof(FileRead)); _Log = LogManager.GetLogger(typeof(FileRead));
_UseCyclicalForDescription = useCyclicalForDescription; _UseCyclicalForDescription = useCyclicalForDescription;
@ -86,9 +81,10 @@ namespace Adaptation.Shared
_ModelObjectParameterDefinitions = modelObjectParameters; _ModelObjectParameterDefinitions = modelObjectParameters;
_FileConnectorConfiguration = fileConnectorConfiguration; _FileConnectorConfiguration = fileConnectorConfiguration;
_ParameterizedModelObjectDefinitionType = parameterizedModelObjectDefinitionType; _ParameterizedModelObjectDefinitionType = parameterizedModelObjectDefinitionType;
_IsSourceTimer = (fileConnectorConfiguration.SourceFileFilter.StartsWith("*Timer.txt")); _IsSourceTimer = fileConnectorConfiguration.SourceFileFilter.StartsWith("*Timer.txt");
string cellInstanceConnectionNameBase = cellInstanceConnectionName.Replace("-", string.Empty); string cellInstanceConnectionNameBase = cellInstanceConnectionName.Replace("-", string.Empty);
_Hyphens = (cellInstanceConnectionName.Length - cellInstanceConnectionNameBase.Length); _Hyphens = cellInstanceConnectionName.Length - cellInstanceConnectionNameBase.Length;
_TracePath = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, "Path.Trace");
_ExceptionSubject = string.Concat("Exception:", _CellInstanceConnectionName, _FileConnectorConfiguration?.SourceDirectoryCloaking); _ExceptionSubject = string.Concat("Exception:", _CellInstanceConnectionName, _FileConnectorConfiguration?.SourceDirectoryCloaking);
string suffix; string suffix;
string[] segments = _ParameterizedModelObjectDefinitionType.Split('.'); string[] segments = _ParameterizedModelObjectDefinitionType.Split('.');
@ -116,16 +112,10 @@ namespace Adaptation.Shared
// if (!string.IsNullOrEmpty(equipmentDictionaryName) && isEvent) // if (!string.IsNullOrEmpty(equipmentDictionaryName) && isEvent)
// throw new Exception(cellInstanceConnectionName); // throw new Exception(cellInstanceConnectionName);
} }
ModelObjectParameterDefinition[] paths = GetProperties(cellInstanceConnectionName, modelObjectParameters, "Path.");
if (paths.Length < 4)
throw new Exception(cellInstanceConnectionName);
if (isDuplicator) if (isDuplicator)
_MesEntity = string.Empty; _MesEntity = string.Empty;
else else
_MesEntity = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, string.Concat("CellInstance.", cellInstanceName, ".Alias")); _MesEntity = GetPropertyValue(cellInstanceConnectionName, modelObjectParameters, string.Concat("CellInstance.", cellInstanceName, ".Alias"));
_TracePath = (from l in paths where l.Name.EndsWith("Trace") select l.Value).FirstOrDefault();
_VillachPath = (from l in paths where l.Name.EndsWith("Villach") select l.Value).FirstOrDefault();
_ProgressPath = (from l in paths where l.Name.EndsWith("Progress") select l.Value).FirstOrDefault();
_EventName = eventName; _EventName = eventName;
_EventNameFileRead = eventNameFileRead; _EventNameFileRead = eventNameFileRead;
_EquipmentType = parameterizedModelObjectDefinitionTypeAppended; _EquipmentType = parameterizedModelObjectDefinitionTypeAppended;
@ -135,9 +125,11 @@ namespace Adaptation.Shared
else else
{ {
if (_FileConnectorConfiguration.FileScanningOption == FileConnectorConfiguration.FileScanningOptionEnum.TimeBased) if (_FileConnectorConfiguration.FileScanningOption == FileConnectorConfiguration.FileScanningOptionEnum.TimeBased)
breakAfterSeconds = 360; breakAfterSeconds = Math.Abs(_FileConnectorConfiguration.FileHandleTimeout.Value);
else else if (_FileConnectorConfiguration.FileScanningOption == FileConnectorConfiguration.FileScanningOptionEnum.FileWatcher)
breakAfterSeconds = Math.Abs(_FileConnectorConfiguration.FileScanningIntervalInSeconds.Value); breakAfterSeconds = Math.Abs(_FileConnectorConfiguration.FileScanningIntervalInSeconds.Value);
else
throw new Exception();
} }
_BreakAfterSeconds = breakAfterSeconds; _BreakAfterSeconds = breakAfterSeconds;
UpdateLastTicksDuration(breakAfterSeconds * 10000000); UpdateLastTicksDuration(breakAfterSeconds * 10000000);
@ -147,17 +139,17 @@ namespace Adaptation.Shared
throw new Exception("_Configuration is empty?"); throw new Exception("_Configuration is empty?");
if (_FileConnectorConfiguration.TargetFileLocation.Contains('%') || _FileConnectorConfiguration.ErrorTargetFileLocation.Contains('%')) if (_FileConnectorConfiguration.TargetFileLocation.Contains('%') || _FileConnectorConfiguration.ErrorTargetFileLocation.Contains('%'))
throw new Exception("_Configuration is incorrect for a duplicator!"); throw new Exception("_Configuration is incorrect for a duplicator!");
if (!(_FileConnectorConfiguration is null)) // if (_FileConnectorConfiguration is not null)
{ // {
if (string.IsNullOrEmpty(_FileConnectorConfiguration.SourceDirectoryCloaking)) // if (string.IsNullOrEmpty(_FileConnectorConfiguration.SourceDirectoryCloaking))
throw new Exception("SourceDirectoryCloaking is empty?"); // throw new Exception("SourceDirectoryCloaking is empty?");
if (!_FileConnectorConfiguration.SourceDirectoryCloaking.StartsWith("~")) // if (!_FileConnectorConfiguration.SourceDirectoryCloaking.StartsWith("~"))
throw new Exception("SourceDirectoryCloaking is incorrect for a duplicator!"); // throw new Exception("SourceDirectoryCloaking is incorrect for a duplicator!");
} // }
} }
} }
protected string GetPropertyValue(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyName) protected static string GetPropertyValue(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyName)
{ {
string result; string result;
List<string> results = (from l in modelObjectParameters where l.Name == propertyName select l.Value).ToList(); List<string> results = (from l in modelObjectParameters where l.Name == propertyName select l.Value).ToList();
@ -167,7 +159,7 @@ namespace Adaptation.Shared
return result; return result;
} }
protected ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix) protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix)
{ {
ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) select l).ToArray(); ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) select l).ToArray();
if (!results.Any()) if (!results.Any())
@ -175,7 +167,7 @@ namespace Adaptation.Shared
return results; return results;
} }
protected ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix, string propertyNameSuffix) protected static ModelObjectParameterDefinition[] GetProperties(string cellInstanceConnectionName, IList<ModelObjectParameterDefinition> modelObjectParameters, string propertyNamePrefix, string propertyNameSuffix)
{ {
ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) && l.Name.EndsWith(propertyNameSuffix) select l).ToArray(); ModelObjectParameterDefinition[] results = (from l in modelObjectParameters where l.Name.StartsWith(propertyNamePrefix) && l.Name.EndsWith(propertyNameSuffix) select l).ToArray();
if (!results.Any()) if (!results.Any())
@ -188,11 +180,12 @@ namespace Adaptation.Shared
if (ticksDuration < 50000000) if (ticksDuration < 50000000)
ticksDuration = 50000000; ticksDuration = 50000000;
_LastTicksDuration = (long)Math.Ceiling(ticksDuration * .667); _LastTicksDuration = (long)Math.Ceiling(ticksDuration * .667);
_Log.Info($"{new TimeSpan(ticksDuration).TotalMilliseconds} TotalMillisecond(s) to process{Environment.NewLine}{_CellInstanceConnectionName}{Environment.NewLine}<{_ReportFullPath}>");
} }
protected void WaitForThread(Thread thread, List<Exception> threadExceptions) protected void WaitForThread(Thread thread, List<Exception> threadExceptions)
{ {
if (!(thread is null)) if (thread is not null)
{ {
ThreadState threadState; ThreadState threadState;
for (short i = 0; i < short.MaxValue; i++) for (short i = 0; i < short.MaxValue; i++)
@ -202,7 +195,7 @@ namespace Adaptation.Shared
else else
{ {
threadState = thread.ThreadState; threadState = thread.ThreadState;
if (threadState != ThreadState.Running && threadState != ThreadState.WaitSleepJoin) if (threadState is not ThreadState.Running and not ThreadState.WaitSleepJoin)
break; break;
} }
Thread.Sleep(500); Thread.Sleep(500);
@ -221,51 +214,33 @@ namespace Adaptation.Shared
} }
} }
protected void CreateProgressDirectory(string progressPath, Logistics logistics, int? duplicator, string[] exceptionLines) private void WriteAllLines(string to, string[] exceptionLines)
{ {
string progressDirectory; string fileName = string.Concat(to, @"\readme.txt");
StringBuilder stringBuilder = new();
if (duplicator is null || duplicator.Value == 0)
progressDirectory = string.Concat(progressPath, @"\EquipmentIntegration");
else
{
stringBuilder.Clear();
for (int i = 0; i < duplicator.Value; i++)
{
if (i > 0 && (i % 2) == 0)
stringBuilder.Append(' ');
stringBuilder.Append('-');
}
progressDirectory = string.Concat(progressPath, @"\", (duplicator.Value + 1).ToString().PadLeft(2, '0'), " ", stringBuilder).Trim();
}
DateTime dateTime = DateTime.Now;
string weekOfYear = _Calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
progressDirectory = string.Concat(progressDirectory, @"\", dateTime.ToString("yyyy"), "_Week_", weekOfYear, @"\", logistics.MID, "_", logistics.Sequence, "_", DateTime.Now.Ticks - logistics.Sequence);
if (!Directory.Exists(progressDirectory))
Directory.CreateDirectory(progressDirectory);
if (!(exceptionLines is null))
{
string fileName = string.Concat(progressDirectory, @"\readme.txt");
try try
{ File.WriteAllLines(fileName, exceptionLines); } {
catch (Exception) { } if (!Directory.Exists(to))
_ = Directory.CreateDirectory(to);
File.WriteAllLines(fileName, exceptionLines);
} }
catch (Exception ex) { _Log.Error(ex.Message); }
} }
protected string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception) protected string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception)
{ {
string[] results; string[] results;
bool isErrorFile = !(exception is null); bool isErrorFile = exception is not null;
if (!to.EndsWith(@"\")) if (!to.EndsWith(@"\"))
string.Concat(to, @"\"); _ = string.Concat(to, @"\");
if (!isErrorFile) if (!isErrorFile)
results = new string[] { }; results = Array.Empty<string>();
else else
{ {
results = new string[] { _Logistics.Sequence.ToString(), _Logistics.ReportFullPath, from, resolvedFileLocation, to, string.Empty, string.Empty, exception.Message, string.Empty, string.Empty, exception.StackTrace }; results = new string[] { _Logistics.Sequence.ToString(), _Logistics.ReportFullPath, from, resolvedFileLocation, to, string.Empty, string.Empty, exception.Message, string.Empty, string.Empty, exception.StackTrace };
Shared0449(to, results); if (!_IsDuplicator)
WriteAllLines(to, results);
} }
if (!(extractResults is null) && !(extractResults.Item4 is null) && extractResults.Item4.Any()) if (extractResults is not null && extractResults.Item4 is not null && extractResults.Item4.Any())
{ {
string itemFile; string itemFile;
List<string> directories = new(); List<string> directories = new();
@ -276,7 +251,7 @@ namespace Adaptation.Shared
itemFile = sourceFile.FullName.Replace(from, to); itemFile = sourceFile.FullName.Replace(from, to);
Shared1880(itemFile, directories, sourceFile, isErrorFile); Shared1880(itemFile, directories, sourceFile, isErrorFile);
} }
else if (!isErrorFile && !(_Logistics is null)) else if (!isErrorFile && _Logistics is not null)
Shared1811(to, sourceFile); Shared1811(to, sourceFile);
} }
Shared0231(directories); Shared0231(directories);
@ -284,65 +259,7 @@ namespace Adaptation.Shared
return results; return results;
} }
protected IEnumerable<string> GetDirectoriesRecursively(string path, string directoryNameSegment = null) protected static string GetTupleFile(Logistics logistics, Properties.IScopeInfo scopeInfo, string duplicateDirectory)
{
Queue<string> queue = new();
queue.Enqueue(path);
while (queue.Count > 0)
{
path = queue.Dequeue();
foreach (string subDirectory in Directory.GetDirectories(path))
{
queue.Enqueue(subDirectory);
if (string.IsNullOrEmpty(directoryNameSegment) || Path.GetFileName(subDirectory).Contains(directoryNameSegment))
yield return subDirectory;
}
}
}
protected string GetProcessedDirectory(string progressPath, Logistics logistics, DateTime dateTime, string duplicateDirectory)
{
string result = duplicateDirectory;
string logisticsSequence = logistics.Sequence.ToString();
string[] matchDirectories;
if (!_IsEAFHosted)
matchDirectories = new string[] { Path.GetDirectoryName(Path.GetDirectoryName(logistics.ReportFullPath)) };
else
matchDirectories = new string[] { GetDirectoriesRecursively(Path.GetDirectoryName(progressPath), logisticsSequence).FirstOrDefault() };
if (matchDirectories.Length == 0 || string.IsNullOrEmpty(matchDirectories[0]))
matchDirectories = Directory.GetDirectories(duplicateDirectory, string.Concat('*', logisticsSequence, '*'), SearchOption.AllDirectories);
if ((matchDirectories is null) || matchDirectories.Length != 1)
throw new Exception("Didn't find directory by logistics sequence");
if (!matchDirectories[0].Contains("_processed"))
{
result = string.Concat(matchDirectories[0].Split(new string[] { logisticsSequence }, StringSplitOptions.None)[0], logistics.DateTimeFromSequence.ToString("yyyy-MM-dd_hh;mm_tt_"), dateTime.Ticks - logistics.Sequence, "_processed");
Directory.Move(matchDirectories[0], result);
result = string.Concat(result, @"\", logistics.Sequence);
if (!Directory.Exists(result))
Directory.CreateDirectory(result);
}
return result;
}
protected string WriteScopeInfo(string progressPath, Logistics logistics, DateTime dateTime, string duplicateDirectory, List<Tuple<Properties.IScopeInfo, string>> tuples)
{
string result = GetProcessedDirectory(progressPath, logistics, dateTime, duplicateDirectory);
string tupleFile;
string fileName = Path.GetFileNameWithoutExtension(logistics.ReportFullPath);
string duplicateFile = string.Concat(result, @"\", fileName, ".pdsf");
foreach (Tuple<Properties.IScopeInfo, string> tuple in tuples)
{
if (tuple.Item1.FileName.StartsWith(@"\"))
tupleFile = tuple.Item1.FileName;
else
tupleFile = string.Concat(result, @"\", fileName, "_", tuple.Item1.FileNameWithoutExtension, ".pdsfc");
File.WriteAllText(tupleFile, tuple.Item2);
}
File.Copy(logistics.ReportFullPath, duplicateFile, overwrite: true);
return result;
}
protected string GetTupleFile(Logistics logistics, Properties.IScopeInfo scopeInfo, string duplicateDirectory)
{ {
string result; string result;
string rds; string rds;
@ -374,34 +291,34 @@ namespace Adaptation.Shared
return result; return result;
} }
protected void WaitForFileConsumption(string sourceDirectoryCloaking, Logistics logistics, DateTime dateTime, string successDirectory, string duplicateDirectory, string duplicateFile, List<Tuple<Properties.IScopeInfo, string>> tuples) protected void WaitForFileConsumption(string sourceDirectoryCloaking, Logistics logistics, DateTime dateTime, string successDirectory, string duplicateDirectory, string duplicateFile, List<(Properties.IScopeInfo, string)> tuples)
{ {
bool check; bool check;
long preWait; long preWait;
string tupleFile; string tupleFile;
List<int> consumedFileIndices = new();
List<string> duplicateFiles = new(); List<string> duplicateFiles = new();
bool moreThanAnHour = (_BreakAfterSeconds > 3600);
StringBuilder stringBuilder = new(); StringBuilder stringBuilder = new();
List<int> consumedFileIndices = new();
bool moreThanAnHour = _BreakAfterSeconds > 3600;
long breakAfter = dateTime.AddSeconds(_BreakAfterSeconds).Ticks; long breakAfter = dateTime.AddSeconds(_BreakAfterSeconds).Ticks;
if (moreThanAnHour) if (_FileConnectorConfiguration?.FileHandleWaitTime is null)
preWait = dateTime.AddSeconds(30).Ticks; preWait = dateTime.AddMilliseconds(1234).Ticks;
else else
preWait = dateTime.AddTicks(_LastTicksDuration).Ticks; preWait = dateTime.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
if (!tuples.Any()) if (!tuples.Any())
duplicateFiles.Add(duplicateFile); duplicateFiles.Add(duplicateFile);
string fileName = Path.GetFileNameWithoutExtension(logistics.ReportFullPath); string fileName = Path.GetFileNameWithoutExtension(logistics.ReportFullPath);
string successFile = string.Concat(successDirectory, @"\", Path.GetFileName(logistics.ReportFullPath)); string successFile = string.Concat(successDirectory, @"\", Path.GetFileName(logistics.ReportFullPath));
foreach (Tuple<Properties.IScopeInfo, string> tuple in tuples) foreach ((Properties.IScopeInfo scopeInfo, string text) in tuples)
{ {
if (tuple.Item1.FileName.StartsWith(@"\")) if (scopeInfo.FileName.StartsWith(@"\"))
tupleFile = tuple.Item1.FileName; tupleFile = scopeInfo.FileName;
else if (!tuple.Item1.FileName.Contains('%')) else if (!scopeInfo.FileName.Contains('%'))
tupleFile = string.Concat(duplicateDirectory, @"\", fileName, "_", tuple.Item1.FileNameWithoutExtension, ".pdsfc"); tupleFile = string.Concat(duplicateDirectory, @"\", fileName, "_", scopeInfo.FileNameWithoutExtension, ".pdsfc");
else else
tupleFile = GetTupleFile(logistics, tuple.Item1, duplicateDirectory); tupleFile = GetTupleFile(logistics, scopeInfo, duplicateDirectory);
duplicateFiles.Add(tupleFile); duplicateFiles.Add(tupleFile);
File.WriteAllText(tupleFile, tuple.Item2); File.WriteAllText(tupleFile, text);
} }
for (short i = 0; i < short.MaxValue; i++) for (short i = 0; i < short.MaxValue; i++)
{ {
@ -415,7 +332,7 @@ namespace Adaptation.Shared
{ {
try try
{ {
check = (string.IsNullOrEmpty(successDirectory) || File.Exists(successFile)); check = string.IsNullOrEmpty(successDirectory) || File.Exists(successFile);
if (check) if (check)
{ {
consumedFileIndices.Clear(); consumedFileIndices.Clear();
@ -438,7 +355,7 @@ namespace Adaptation.Shared
try try
{ File.Delete(duplicateFiles[i]); } { File.Delete(duplicateFiles[i]); }
catch (Exception) { } catch (Exception) { }
stringBuilder.Append("<").Append(duplicateFiles[i]).Append("> "); _ = stringBuilder.Append('<').Append(duplicateFiles[i]).Append("> ");
} }
} }
throw new Exception(string.Concat("After {", _BreakAfterSeconds, "} seconds, right side of {", sourceDirectoryCloaking, "} didn't consume file(s) ", stringBuilder)); throw new Exception(string.Concat("After {", _BreakAfterSeconds, "} seconds, right side of {", sourceDirectoryCloaking, "} didn't consume file(s) ", stringBuilder));
@ -487,11 +404,11 @@ namespace Adaptation.Shared
{ {
string directory; string directory;
if (!_CellInstanceConnectionName.StartsWith(_CellInstanceName) && _CellInstanceConnectionNameBase == _EquipmentType) if (!_CellInstanceConnectionName.StartsWith(_CellInstanceName) && _CellInstanceConnectionNameBase == _EquipmentType)
directory = Path.Combine(_VillachPath, _EquipmentType, "Target"); directory = Path.Combine(_TracePath, _EquipmentType, "Target", _CellInstanceName, _CellInstanceConnectionName);
else else
directory = Path.Combine(_TracePath, _EquipmentType, "Source", _CellInstanceName, _CellInstanceConnectionName); directory = Path.Combine(_TracePath, _EquipmentType, "Source", _CellInstanceName, _CellInstanceConnectionName);
if (!Directory.Exists(directory)) if (!Directory.Exists(directory))
Directory.CreateDirectory(directory); _ = Directory.CreateDirectory(directory);
string file = Path.Combine(directory, string.Concat(_Logistics.MesEntity, "_", _Logistics.Sequence, ".ipdsf")); string file = Path.Combine(directory, string.Concat(_Logistics.MesEntity, "_", _Logistics.Sequence, ".ipdsf"));
string lines = ProcessDataStandardFormat.GetPDSFText(fileRead, _Logistics, jsonElements, logisticsText: string.Empty); string lines = ProcessDataStandardFormat.GetPDSFText(fileRead, _Logistics, jsonElements, logisticsText: string.Empty);
File.WriteAllText(file, lines); File.WriteAllText(file, lines);
@ -503,18 +420,8 @@ namespace Adaptation.Shared
} }
} }
protected void Move(IFileRead fileRead, Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) protected void Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults)
{ {
bool isErrorFile = !(exception is null);
if (!isErrorFile && _IsDuplicator)
{
if (_Hyphens == _HyphenIsXToArchive)
Shared0192();
else if (_IsEAFHosted && _Hyphens == _HyphenIsArchive)
fileRead.MoveArchive();
if (_IsEAFHosted && !string.IsNullOrEmpty(_ProgressPath))
CreateProgressDirectory(_ProgressPath, _Logistics, _Hyphens, exceptionLines: null);
}
if (!_IsEAFHosted) if (!_IsEAFHosted)
{ {
string to; string to;
@ -524,10 +431,10 @@ namespace Adaptation.Shared
to = Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation); to = Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation);
foreach (KeyValuePair<string, string> keyValuePair in _FileParameter) foreach (KeyValuePair<string, string> keyValuePair in _FileParameter)
to = to.Replace(string.Concat('%', keyValuePair.Key, '%'), keyValuePair.Value); to = to.Replace(string.Concat('%', keyValuePair.Key, '%'), keyValuePair.Value);
if (to.Contains("%")) if (to.Contains('%'))
_Log.Debug("Can't debug without EAF Hosting"); _Log.Debug("Can't debug without EAF Hosting");
else else
Move(extractResults, to, _FileConnectorConfiguration.SourceFileLocation, resolvedFileLocation: string.Empty, exception: null); _ = Move(extractResults, to, _FileConnectorConfiguration.SourceFileLocation, resolvedFileLocation: string.Empty, exception: null);
} }
} }
@ -592,21 +499,7 @@ namespace Adaptation.Shared
return results; return results;
} }
protected Dictionary<Test, List<Properties.IDescription>> GetKeyValuePairs(List<Properties.IDescription> descriptions) protected static List<Properties.IDescription> GetDuplicatorDescriptions(JsonElement[] jsonElements)
{
Dictionary<Test, List<Properties.IDescription>> results = new();
Test testKey;
for (int i = 0; i < descriptions.Count; i++)
{
testKey = (Test)descriptions[i].Test;
if (!results.ContainsKey(testKey))
results.Add(testKey, new List<Properties.IDescription>());
results[testKey].Add(descriptions[i]);
}
return results;
}
protected List<Properties.IDescription> GetDuplicatorDescriptions(JsonElement[] jsonElements)
{ {
List<Properties.IDescription> results = new(); List<Properties.IDescription> results = new();
Duplicator.Description description; Duplicator.Description description;
@ -621,34 +514,7 @@ namespace Adaptation.Shared
return results; return results;
} }
protected Tuple<Test[], Dictionary<Test, List<Properties.IDescription>>> GetTuple(IFileRead fileRead, IEnumerable<Properties.IDescription> descriptions, bool extra = false) private void Shared1880(string itemFile, List<string> directories, FileInfo sourceFile, bool isErrorFile)
{
Tuple<Test[], Dictionary<Test, List<Properties.IDescription>>> result;
Dictionary<Test, List<Properties.IDescription>> keyValuePairs = GetKeyValuePairs(descriptions.ToList());
Test[] tests = (from l in keyValuePairs select l.Key).ToArray();
fileRead.CheckTests(tests, extra);
result = new Tuple<Test[], Dictionary<Test, List<Properties.IDescription>>>(tests, keyValuePairs);
return result;
}
protected void Shared0449(string to, string[] exceptionLines)
{
if (_IsDuplicator)
CreateProgressDirectory(_ProgressPath, _Logistics, _Hyphens, exceptionLines);
else
{
string fileName = string.Concat(to, @"\readme.txt");
try
{
if (!Directory.Exists(to))
Directory.CreateDirectory(to);
File.WriteAllLines(fileName, exceptionLines);
}
catch (Exception ex) { _Log.Error(ex.Message); }
}
}
protected void Shared1880(string itemFile, List<string> directories, FileInfo sourceFile, bool isErrorFile)
{ {
string itemDirectory; string itemDirectory;
directories.Add(Path.GetDirectoryName(sourceFile.FullName)); directories.Add(Path.GetDirectoryName(sourceFile.FullName));
@ -660,7 +526,7 @@ namespace Adaptation.Shared
processingModeEnum = _FileConnectorConfiguration.ErrorPostProcessingMode.Value; processingModeEnum = _FileConnectorConfiguration.ErrorPostProcessingMode.Value;
if (processingModeEnum != FileConnectorConfiguration.PostProcessingModeEnum.Delete && !Directory.Exists(itemDirectory)) if (processingModeEnum != FileConnectorConfiguration.PostProcessingModeEnum.Delete && !Directory.Exists(itemDirectory))
{ {
Directory.CreateDirectory(itemDirectory); _ = Directory.CreateDirectory(itemDirectory);
FileInfo fileInfo = new(_Logistics.ReportFullPath); FileInfo fileInfo = new(_Logistics.ReportFullPath);
Directory.SetCreationTime(itemDirectory, fileInfo.LastWriteTime); Directory.SetCreationTime(itemDirectory, fileInfo.LastWriteTime);
} }
@ -683,7 +549,7 @@ namespace Adaptation.Shared
} }
} }
protected void Shared1811(string to, FileInfo sourceFile) private void Shared1811(string to, FileInfo sourceFile)
{ {
if (!_IsDuplicator && _FileConnectorConfiguration.SourceFileFilter != "*" && sourceFile.Exists && sourceFile.Length < _MinFileLength) if (!_IsDuplicator && _FileConnectorConfiguration.SourceFileFilter != "*" && sourceFile.Exists && sourceFile.Length < _MinFileLength)
{ {
@ -691,17 +557,17 @@ namespace Adaptation.Shared
string jobIdDirectory = Path.GetDirectoryName(to); string jobIdDirectory = Path.GetDirectoryName(to);
DateTime dateTime = DateTime.Now.AddMinutes(-15); DateTime dateTime = DateTime.Now.AddMinutes(-15);
string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00"); string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
string weekDirectory = string.Concat(_Logistics.DateTimeFromSequence.ToString("yyyy"), "_Week_", weekOfYear, @"\", _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd")); string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}{@"\"}{_Logistics.DateTimeFromSequence:yyyy-MM-dd}";
string destinationDirectory = string.Concat(jobIdDirectory, @"\_ Ignore 100 bytes\", weekDirectory, @"\", directoryName); string destinationDirectory = string.Concat(jobIdDirectory, @"\_ Ignore 100 bytes\", weekDirectory, @"\", directoryName);
if (!Directory.Exists(destinationDirectory)) if (!Directory.Exists(destinationDirectory))
Directory.CreateDirectory(destinationDirectory); _ = Directory.CreateDirectory(destinationDirectory);
File.Move(sourceFile.FullName, string.Concat(destinationDirectory, @"\", sourceFile.Name)); File.Move(sourceFile.FullName, string.Concat(destinationDirectory, @"\", sourceFile.Name));
try try
{ {
string[] checkDirectories = Directory.GetDirectories(jobIdDirectory, "*", SearchOption.TopDirectoryOnly); string[] checkDirectories = Directory.GetDirectories(jobIdDirectory, "*", SearchOption.TopDirectoryOnly);
foreach (string checkDirectory in checkDirectories) foreach (string checkDirectory in checkDirectories)
{ {
if (!checkDirectory.Contains("_")) if (!checkDirectory.Contains('_'))
continue; continue;
if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any()) if (Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly).Any())
continue; continue;
@ -720,7 +586,7 @@ namespace Adaptation.Shared
} }
} }
protected void Shared0231(List<string> directories) private void Shared0231(List<string> directories)
{ {
if (_FileConnectorConfiguration.PostProcessingMode != FileConnectorConfiguration.PostProcessingModeEnum.Copy) if (_FileConnectorConfiguration.PostProcessingMode != FileConnectorConfiguration.PostProcessingModeEnum.Copy)
{ {
@ -732,13 +598,13 @@ namespace Adaptation.Shared
} }
} }
protected void Shared0413(DateTime dateTime, bool isDummyRun, string successDirectory, string duplicateDirectory, List<Tuple<Properties.IScopeInfo, string>> tuples, string duplicateFile) protected void WaitForFileConsumption(DateTime dateTime, bool isDummyRun, string successDirectory, string duplicateDirectory, List<(Properties.IScopeInfo, string)> tuples, string duplicateFile)
{ {
if (!isDummyRun && _IsEAFHosted) if (!isDummyRun && _IsEAFHosted)
WaitForFileConsumption(_FileConnectorConfiguration.SourceDirectoryCloaking, _Logistics, dateTime, successDirectory, duplicateDirectory, duplicateFile, tuples); WaitForFileConsumption(_FileConnectorConfiguration.SourceDirectoryCloaking, _Logistics, dateTime, successDirectory, duplicateDirectory, duplicateFile, tuples);
else else
{ {
long breakAfter = DateTime.Now.AddSeconds(_FileConnectorConfiguration.ConnectionRetryInterval.Value).Ticks; long breakAfter = DateTime.Now.AddSeconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks;
for (short i = 0; i < short.MaxValue; i++) for (short i = 0; i < short.MaxValue; i++)
{ {
if (!_IsEAFHosted || DateTime.Now.Ticks > breakAfter) if (!_IsEAFHosted || DateTime.Now.Ticks > breakAfter)
@ -748,85 +614,33 @@ namespace Adaptation.Shared
} }
} }
protected void Shared0607(string reportFullPath, string duplicateDirectory, string logisticsSequence, string destinationDirectory) internal static string GetJobIdParentDirectory(string directory)
{ {
if (destinationDirectory == duplicateDirectory) string result;
throw new Exception("Check Target File Folder for %LotIDWithLogisticsSequence%_in process on CI (not Duplicator)"); if (!string.IsNullOrEmpty(Path.GetFileName(directory)))
if (destinationDirectory.EndsWith(logisticsSequence)) result = Path.GetFullPath(Path.GetDirectoryName(Path.GetDirectoryName(directory)));
destinationDirectory = Path.GetDirectoryName(destinationDirectory); else
string[] deleteFiles = Directory.GetFiles(destinationDirectory, "*", SearchOption.AllDirectories); result = Path.GetFullPath(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(directory))));
if (deleteFiles.Length > 250) if (!Directory.Exists(result))
throw new Exception("Safety net!"); _ = Directory.CreateDirectory(result);
foreach (string file in deleteFiles) return result;
File.Delete(file);
Directory.Delete(destinationDirectory, recursive: true);
File.Delete(reportFullPath);
} }
protected void Shared0192() internal string[] GetInProcessDirectory(string jobIdDirectory)
{
if (!string.IsNullOrEmpty(_Logistics.ReportFullPath))
{
FileInfo fileInfo = new(_Logistics.ReportFullPath);
if (fileInfo.Exists && fileInfo.LastWriteTime < fileInfo.CreationTime)
File.SetLastWriteTime(_Logistics.ReportFullPath, fileInfo.CreationTime);
}
}
protected string[] Shared1567(string reportFullPath, List<Tuple<Properties.IScopeInfo, string>> tuples)
{ {
string[] results; string[] results;
string historicalText;
string logisticsSequence = _Logistics.Sequence.ToString();
string jobIdDirectory = string.Concat(Path.GetDirectoryName(Path.GetDirectoryName(_FileConnectorConfiguration.TargetFileLocation)), @"\", _Logistics.JobID);
if (!Directory.Exists(jobIdDirectory))
Directory.CreateDirectory(jobIdDirectory);
string[] matchDirectories;
if (!_IsEAFHosted) if (!_IsEAFHosted)
matchDirectories = new string[] { Path.GetDirectoryName(Path.GetDirectoryName(reportFullPath)) }; results = new string[] { jobIdDirectory };
else else
matchDirectories = Directory.GetDirectories(jobIdDirectory, string.Concat(_Logistics.MID, '*', logisticsSequence, '*'), SearchOption.TopDirectoryOnly); {
if ((matchDirectories is null) || matchDirectories.Length != 1) string logisticsSequence = _Logistics.Sequence.ToString();
results = Directory.GetDirectories(jobIdDirectory, string.Concat(_Logistics.MID, '*', logisticsSequence, '*'), SearchOption.TopDirectoryOnly);
}
if ((results is null) || results.Length != 1)
throw new Exception("Didn't find directory by logistics sequence"); throw new Exception("Didn't find directory by logistics sequence");
string fileName = Path.GetFileNameWithoutExtension(reportFullPath);
string sequenceDirectory = string.Concat(matchDirectories[0], @"\", logisticsSequence);
if (!Directory.Exists(sequenceDirectory))
Directory.CreateDirectory(sequenceDirectory);
foreach (Tuple<Properties.IScopeInfo, string> tuple in tuples)
{
fileName = string.Concat(sequenceDirectory, @"\", fileName, "_", tuple.Item1.FileNameWithoutExtension, ".pdsfc");
if (_IsEAFHosted)
File.WriteAllText(fileName, tuple.Item2);
else
{
if (File.Exists(fileName))
{
historicalText = File.ReadAllText(fileName);
if (tuple.Item2 != historicalText)
throw new Exception("File doesn't match historical!");
}
}
}
results = matchDirectories;
return results; return results;
} }
protected void Shared1277(string reportFullPath, string destinationDirectory, string logisticsSequence, string jobIdDirectory, string json)
{
string ecCharacterizationSi = Path.GetDirectoryName(Path.GetDirectoryName(jobIdDirectory));
string destinationJobIdDirectory = string.Concat(ecCharacterizationSi, @"\Processed\", _Logistics.JobID);
if (!Directory.Exists(destinationJobIdDirectory))
Directory.CreateDirectory(destinationJobIdDirectory);
destinationJobIdDirectory = string.Concat(destinationJobIdDirectory, @"\", Path.GetFileName(destinationDirectory).Split(new string[] { logisticsSequence }, StringSplitOptions.None)[0], _Logistics.DateTimeFromSequence.ToString("yyyy-MM-dd_hh;mm_tt_"), DateTime.Now.Ticks - _Logistics.Sequence);
string sequenceDirectory = string.Concat(destinationJobIdDirectory, @"\", logisticsSequence);
string jsonFileName = string.Concat(sequenceDirectory, @"\", Path.GetFileNameWithoutExtension(reportFullPath), ".json");
Directory.Move(destinationDirectory, destinationJobIdDirectory);
if (!Directory.Exists(sequenceDirectory))
Directory.CreateDirectory(sequenceDirectory);
File.Copy(reportFullPath, string.Concat(sequenceDirectory, @"\", Path.GetFileName(reportFullPath)), overwrite: true);
File.WriteAllText(jsonFileName, json);
}
}
} }
// 2022-05-13 -> Shared - FileRead

View File

@ -1,153 +0,0 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Adaptation.Shared
{
public class IsEnvironment
{
public enum Name
{
LinuxDevelopment,
LinuxProduction,
LinuxStaging,
OSXDevelopment,
OSXProduction,
OSXStaging,
WindowsDevelopment,
WindowsProduction,
WindowsStaging
}
public bool DebuggerWasAttachedDuringConstructor { get; private set; }
public bool Development { get; private set; }
public bool Linux { get; private set; }
public bool OSX { get; private set; }
public bool Production { get; private set; }
public bool Staging { get; private set; }
public bool Windows { get; private set; }
public string Profile { get; private set; }
public string AppSettingsFileName { get; private set; }
public string ASPNetCoreEnvironment { get; private set; }
public IsEnvironment(string testCategory)
{
if (testCategory.EndsWith(".json"))
{
Production = testCategory == "appsettings.json";
Staging = testCategory.Contains(nameof(Staging));
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
Development = testCategory.Contains(nameof(Development));
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
}
else
{
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
OSX = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(OSX));
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
Linux = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Linux));
Staging = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Staging));
Windows = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Windows));
Production = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Production));
Development = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Development));
}
SetProfile();
SetAppSettingsFileName(processesCount: null);
}
public IsEnvironment(bool isDevelopment, bool isStaging, bool isProduction)
{
Staging = isStaging;
Production = isProduction;
Development = isDevelopment;
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
SetProfile();
SetAppSettingsFileName(processesCount: null);
}
public IsEnvironment(int? processesCount, bool nullASPNetCoreEnvironmentIsDevelopment, bool nullASPNetCoreEnvironmentIsProduction)
{
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
if (nullASPNetCoreEnvironmentIsDevelopment && nullASPNetCoreEnvironmentIsProduction)
throw new Exception();
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsProduction)
Production = true;
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsDevelopment)
Development = true;
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && !nullASPNetCoreEnvironmentIsDevelopment && !nullASPNetCoreEnvironmentIsProduction)
throw new Exception();
else
{
Staging = ASPNetCoreEnvironment.EndsWith(nameof(Staging));
Production = ASPNetCoreEnvironment.EndsWith(nameof(Production));
Development = ASPNetCoreEnvironment.EndsWith(nameof(Development));
}
SetProfile();
SetAppSettingsFileName(processesCount);
}
private void SetProfile()
{
if (Windows && Production)
Profile = nameof(Production);
else if (Windows && Staging)
Profile = nameof(Staging);
else if (Windows && Development)
Profile = nameof(Development);
else if (Linux && Production)
Profile = nameof(Name.LinuxProduction);
else if (Linux && Staging)
Profile = nameof(Name.LinuxStaging);
else if (Linux && Development)
Profile = nameof(Name.LinuxDevelopment);
else if (OSX && Production)
Profile = nameof(Name.OSXProduction);
else if (OSX && Staging)
Profile = nameof(Name.OSXStaging);
else if (OSX && Development)
Profile = nameof(Name.OSXDevelopment);
else
throw new Exception();
}
private void SetAppSettingsFileName(int? processesCount)
{
if (Production)
{
if (processesCount is null)
AppSettingsFileName = "appsettings.json";
else
AppSettingsFileName = $"appsettings.{processesCount}.json";
}
else
{
string environment;
if (Staging)
environment = nameof(Staging);
else if (Development)
environment = nameof(Development);
else
throw new Exception();
if (processesCount is null)
AppSettingsFileName = $"appsettings.{environment}.json";
else
AppSettingsFileName = $"appsettings.{environment}.{processesCount}.json";
}
}
}
}

View File

@ -1,14 +1,13 @@
using Adaptation.Shared.Methods; using Adaptation.Shared.Methods;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
namespace Adaptation.Shared namespace Adaptation.Shared;
{
public class Logistics : ILogistics public class Logistics : ILogistics
{ {
public object NullData { get; private set; } public object NullData { get; private set; }
public string JobID { get; private set; } //CellName public string JobID { get; private set; } //CellName
@ -166,7 +165,7 @@ namespace Adaptation.Shared
Logistics2 logistics2; Logistics2 logistics2;
Tags = new List<string>(); Tags = new List<string>();
Logistics2 = new List<Logistics2>(); Logistics2 = new List<Logistics2>();
for (int i = 1; i < Logistics1.Count(); i++) for (int i = 1; i < Logistics1.Count; i++)
{ {
if (Logistics1[i].StartsWith("LOGISTICS_2")) if (Logistics1[i].StartsWith("LOGISTICS_2"))
{ {
@ -174,32 +173,20 @@ namespace Adaptation.Shared
Logistics2.Add(logistics2); Logistics2.Add(logistics2);
} }
} }
for (int i = Logistics1.Count() - 1; i > -1; i--) for (int i = Logistics1.Count - 1; i > -1; i--)
{ {
if (Logistics1[i].StartsWith("LOGISTICS_2")) if (Logistics1[i].StartsWith("LOGISTICS_2"))
Logistics1.RemoveAt(i); Logistics1.RemoveAt(i);
} }
} }
public Logistics ShallowCopy() public Logistics ShallowCopy() => (Logistics)MemberwiseClone();
{
return (Logistics)MemberwiseClone();
}
private string DefaultMesEntity(DateTime dateTime) private static string DefaultMesEntity(DateTime dateTime) => string.Concat(dateTime.Ticks, "_MES_ENTITY");
{
return string.Concat(dateTime.Ticks, "_MES_ENTITY");
}
internal string GetLotViaMostCommonMethod() internal string GetLotViaMostCommonMethod() => MID.Substring(0, MID.Length - 2);
{
return MID.Substring(0, MID.Length - 2);
}
internal string GetPocketNumberViaMostCommonMethod() internal string GetPocketNumberViaMostCommonMethod() => MID.Substring(MID.Length - 2);
{
return MID.Substring(MID.Length - 2);
}
internal void Update(string dateTime, string processJobID, string mid) internal void Update(string dateTime, string processJobID, string mid)
{ {
@ -218,6 +205,4 @@ namespace Adaptation.Shared
Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList(); Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList();
Logistics2 = new List<Logistics2>(); Logistics2 = new List<Logistics2>();
} }
}
} }

View File

@ -1,11 +1,10 @@
using System; using System;
namespace Adaptation.Shared namespace Adaptation.Shared;
public class Logistics2 : Methods.ILogistics2
{ {
public class Logistics2 : Methods.ILogistics2
{
public string MID { get; private set; } public string MID { get; private set; }
public string RunNumber { get; private set; } public string RunNumber { get; private set; }
public string SatelliteGroup { get; private set; } public string SatelliteGroup { get; private set; }
@ -76,6 +75,4 @@ namespace Adaptation.Shared
} }
} }
}
} }

View File

@ -1,7 +1,5 @@
namespace Adaptation.Shared.Methods namespace Adaptation.Shared.Methods;
{
public interface IAppSettings : Properties.IAppSettings public interface IAppSettings : Properties.IAppSettings
{ {
}
} }

View File

@ -1,25 +1,22 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.Json; using System.Text.Json;
namespace Adaptation.Shared.Methods namespace Adaptation.Shared.Methods;
{
public interface IDescription public interface IDescription
{ {
string GetEventDescription(); string GetEventDescription();
List<string> GetDetailNames(); List<string> GetDetailNames();
List<string> GetHeaderNames(); List<string> GetHeaderNames();
IDescription GetDisplayNames(); IDescription GetDisplayNames();
List<string> GetParameterNames(); List<string> GetParameterNames();
List<string> GetIgnoreParameterNames();
List<string> GetPairedParameterNames(); List<string> GetPairedParameterNames();
List<string> GetIgnoreParameterNames(Test test);
List<string> GetNames(IFileRead fileRead, Logistics logistics); List<string> GetNames(IFileRead fileRead, Logistics logistics);
JsonProperty[] GetDefault(IFileRead fileRead, Logistics logistics); JsonProperty[] GetDefault(IFileRead fileRead, Logistics logistics);
Dictionary<string, string> GetDisplayNamesJsonElement(IFileRead fileRead); Dictionary<string, string> GetDisplayNamesJsonElement(IFileRead fileRead);
IDescription GetDefaultDescription(IFileRead fileRead, Logistics logistics); IDescription GetDefaultDescription(IFileRead fileRead, Logistics logistics);
List<IDescription> GetDescriptions(IFileRead fileRead, Logistics logistics, List<Test> tests, IProcessData iProcessData); List<IDescription> GetDescriptions(IFileRead fileRead, Logistics logistics, List<Test> tests, IProcessData iProcessData);
}
} }

View File

@ -1,13 +1,10 @@
using log4net; using log4net;
namespace Adaptation.Shared.Methods namespace Adaptation.Shared.Methods;
{
public interface IDrive : Properties.IDrive public interface IDrive : Properties.IDrive
{ {
void MapEafDrives(ILog log, Properties.IAppSettings appSettings); void MapEafDrives(ILog log, Properties.IAppSettings appSettings);
}
} }

View File

@ -3,24 +3,20 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text.Json; using System.Text.Json;
namespace Adaptation.Shared.Methods namespace Adaptation.Shared.Methods;
public interface IFileRead : Properties.IFileRead
{ {
public interface IFileRead : Properties.IFileRead
{
void MoveArchive();
void WaitForThread(); void WaitForThread();
JsonProperty[] GetDefault(); JsonProperty[] GetDefault();
void Callback(object state);
string GetEventDescription(); string GetEventDescription();
List<string> GetHeaderNames(); List<string> GetHeaderNames();
void CheckTests(Test[] tests, bool extra);
Dictionary<string, string> GetDisplayNamesJsonElement(); Dictionary<string, string> GetDisplayNamesJsonElement();
Tuple<string, Test[], JsonElement[], List<FileInfo>> ReExtract(); Tuple<string, Test[], JsonElement[], List<FileInfo>> ReExtract();
List<IDescription> GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData); List<IDescription> GetDescriptions(IFileRead fileRead, List<Test> tests, IProcessData processData);
void Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception = null); void Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception = null);
Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, string eventName); Tuple<string, Test[], JsonElement[], List<FileInfo>> GetExtractResult(string reportFullPath, string eventName);
string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception); string[] Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, string to, string from, string resolvedFileLocation, Exception exception);
}
} }

View File

@ -1,8 +1,5 @@
namespace Adaptation.Shared.Methods namespace Adaptation.Shared.Methods;
public interface ILogistics : Properties.ILogistics
{ {
public interface ILogistics : Properties.ILogistics
{
}
} }

View File

@ -1,8 +1,5 @@
namespace Adaptation.Shared.Methods namespace Adaptation.Shared.Methods;
public interface ILogistics2 : Properties.ILogistics2
{ {
public interface ILogistics2 : Properties.ILogistics2
{
}
} }

View File

@ -3,15 +3,12 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text.Json; using System.Text.Json;
namespace Adaptation.Shared.Methods namespace Adaptation.Shared.Methods;
{
public interface IProcessData : Properties.IProcessData public interface IProcessData : Properties.IProcessData
{ {
string GetCurrentReactor(IFileRead fileRead, Logistics logistics, Dictionary<string, string> reactors); string GetCurrentReactor(IFileRead fileRead, Logistics logistics, Dictionary<string, string> reactors);
Tuple<string, Test[], JsonElement[], List<FileInfo>> GetResults(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection); Tuple<string, Test[], JsonElement[], List<FileInfo>> GetResults(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection);
}
} }

View File

@ -1,9 +1,8 @@
namespace Adaptation.Shared.Methods namespace Adaptation.Shared.Methods;
public interface ISMTP
{ {
public interface ISMTP
{
void SendLowPriorityEmailMessage(string subject, string body); void SendLowPriorityEmailMessage(string subject, string body);
void SendHighPriorityEmailMessage(string subject, string body); void SendHighPriorityEmailMessage(string subject, string body);
void SendNormalPriorityEmailMessage(string subject, string body); void SendNormalPriorityEmailMessage(string subject, string body);
}
} }

View File

@ -0,0 +1,300 @@
using System;
using System.IO;
namespace Adaptation.Shared.Metrology;
public class ScopeInfo : Properties.IScopeInfo
{
public Test Test { get; private set; }
public Enum Enum { get; private set; }
public string HTML { get; private set; }
public string Title { get; private set; }
public string FileName { get; private set; }
public int TestValue { get; private set; }
public string Header { get; private set; }
public string QueryFilter { get; private set; }
public string FileNameWithoutExtension { get; private set; }
public ScopeInfo(Test test, string fileName, string queryFilter = "", string title = "", string html = "")
{
Enum = test;
Test = test;
HTML = html;
Title = title;
FileName = fileName;
TestValue = (int)test;
Header = string.Empty;
QueryFilter = queryFilter;
FileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName);
}
public ScopeInfo(Test test)
{
Enum = test;
Test = test;
TestValue = (int)test;
switch (Test)
{
case Test.AFMRoughness:
FileNameWithoutExtension = "afm_iqs_01";
Header = string.Empty;
QueryFilter = "AFM Roughness";
Title = "AFM";
HTML = @"GaN Epi Data\10 - afm.html";
break;
case Test.BreakdownVoltageCenter:
FileNameWithoutExtension = "bv_iqs_01";
Header = "Reactor;fDate;fRecipeName;Lot;fPocketNumber;g4Scribe;BV Position;BV Value;Tool";
QueryFilter = "Breakdown Voltage";
Title = "Breakdown Voltage-Center";
HTML = @"GaN Epi Data\03 - bv-production.html";
break;
case Test.BreakdownVoltageEdge:
FileNameWithoutExtension = "bv_iqs_01_Edge";
Header = "Reactor;fDate;fRecipeName;Lot;fPocketNumber;g4Scribe;BV Position;BV Value;Tool";
QueryFilter = "Breakdown Voltage - Edge";
Title = "Breakdown Voltage-Edge";
HTML = @"GaN Epi Data\03 - bv-production.html";
break;
case Test.BreakdownVoltageMiddle8in:
FileNameWithoutExtension = "bv_iqs_01_Middle";
Header = "Reactor;fDate;fRecipeName;Lot;fPocketNumber;g4Scribe;BV Position;BV Value;Tool";
QueryFilter = "Breakdown Voltage - Middle";
Title = "Breakdown Voltage-Middle (8 in)";
HTML = @"GaN Epi Data\03 - bv-production.html";
break;
case Test.CV:
FileNameWithoutExtension = "cv_iqs_01";
Header = "Reactor;fDate;fPart;Lot;pocketNumber;g4Scribe;Position;Vp;NdMin;Tool ID;CV Ns;CV Cap";
QueryFilter = "CV_Ns";
Title = "CV";
HTML = @"GaN Epi Data\05 - cv.html";
break;
case Test.MonthlyCV:
FileNameWithoutExtension = "cv_iqs_01";
Header = "Reactor;fDate;fPart;Lot;pocketNumber;g4Scribe;Position;Vp;NdMin;Tool ID;CV Ns;CV Cap";
QueryFilter = "CV_Ns";
Title = "CV Monthly Verification";
HTML = @"Metrology\07 - cv_verif_monthly.html";
break;
case Test.WeeklyCV:
FileNameWithoutExtension = "cv_iqs_01";
Header = "Reactor;fDate;fPart;Lot;pocketNumber;g4Scribe;Position;Vp;NdMin;Tool ID;CV Ns;CV Cap";
QueryFilter = "CV_Ns";
Title = "CV Weekly Verification";
HTML = @"Metrology\16 - cv_verif_weekly.html";
break;
case Test.CandelaKlarfDC:
FileNameWithoutExtension = "candela_iqs_01";
Header = "LotID;OperatorID;RecipeName;CandelaRecipe;WaferID;PocketNumber;RunDate;Epi;SlipLines;Cracks;EpiDef;HazeSpot;SmallLpd;MediumLpd;LargeLpd;Cracks_A;Spirals;Craters;8620 Small;Pits;Tool ID;Defect Count";
QueryFilter = "Candela Cracking";
Title = "Candela";
HTML = @"GaN Epi Data\12 - candela.html";
break;
case Test.CandelaLaser:
FileNameWithoutExtension = "candela_iqs_01";
Header = "LotID;OperatorID;RecipeName;CandelaRecipe;WaferID;PocketNumber;RunDate;Epi;SlipLines;Cracks;EpiDef;HazeSpot;SmallLpd;MediumLpd;LargeLpd;Cracks_A;Spirals;Craters;Pits;Tool ID;Defect Count";
QueryFilter = "Candela Cracking";
Title = "Candela";
HTML = @"GaN Epi Data\12 - candela.html";
break;
case Test.CandelaVerify:
FileNameWithoutExtension = "candela_iqs_01";
Header = string.Concat("LotID;OperatorID;RecipeName;CandelaRecipe;WaferID;PocketNumber;RunDate;RunID;Reactor;", "Slip Lines;Cracks;Epi Def;Haze Spot;Small LPD;Medium LPD;Large LPD;Cracks_A;Spirals;Craters;8620 Small;Pits;Tool ID;Defect Count");
QueryFilter = "Candela Cracking";
Title = "Candela";
HTML = @"GaN Epi Data\12 - candela.html";
break;
case Test.CandelaPSL:
FileNameWithoutExtension = "candela_iqs_01";
Header = string.Empty;
QueryFilter = "102-83nm";
Title = "Candela";
HTML = @"GaN Epi Data\12 - candela.html";
break;
case Test.CandelaProdU:
FileNameWithoutExtension = "candela_iqs_01";
Header = string.Empty;
QueryFilter = "SPE verification";
Title = "Candela";
HTML = @"GaN Epi Data\12 - candela.html";
break;
case Test.Denton:
FileNameWithoutExtension = "denton_iqs_01";
Header = "Tool;fDate;Run;Recipe;Operator;Name;Value";
QueryFilter = "Denton_Voltage_AVG";
Title = "Denton Data";
HTML = @"Support Process\03 - ebeam02_denton_v1.html";
break;
case Test.Hall:
FileNameWithoutExtension = "hall_iqs_01";
Header = "Lot;Tool;TimeDate;RunDate;RunID;Part;Reactor;Scribe;PocketNumber;Tool ID;Name;Value";
QueryFilter = "Hall Rs";
Title = "Hall Data";
HTML = @"GaN Epi Data\04 - hall.html";
break;
case Test.MonthlyHall:
FileNameWithoutExtension = "hall_iqs_01";
Header = "Lot;Tool;TimeDate;RunDate;RunID;Part;Reactor;Scribe;PocketNumber;Tool ID;Name;Value";
QueryFilter = "Hall Rs";
Title = "Hall Monthly Verification";
HTML = @"Metrology\06 - hall_verif_monthly.html";
break;
case Test.WeeklyHall:
FileNameWithoutExtension = "hall_iqs_01";
Header = "Lot;Tool;TimeDate;RunDate;RunID;Part;Reactor;Scribe;PocketNumber;Tool ID;Name;Value";
QueryFilter = "Hall Rs";
Title = "Hall Weekly Verification";
HTML = @"Metrology\15 - hall_verif_weekly.html";
break;
case Test.Lehighton:
FileNameWithoutExtension = "lei_iqs_01";
Header = "Reactor;Date;Recipe;Lot;Pocket;Scribe;Tool;Name;Value";
QueryFilter = "LEI RS Average value";
Title = "Lehighton";
HTML = @"GaN Epi Data\13 - lehighton.html";
break;
case Test.VerificationLehighton:
FileNameWithoutExtension = "___";
Header = "Reactor;Date;Recipe;Lot;Pocket;Scribe;Tool;Name;Value";
QueryFilter = "___";
Title = "LEI Weekly Verification 2 Ohm cm";
HTML = @"Metrology\14 - lei_verif_weekly.html.html";
break;
case Test.Microscope:
FileNameWithoutExtension = string.Empty;
Header = string.Empty;
QueryFilter = "Microscope Center 5x";
Title = "Total Microscope Defects";
HTML = string.Empty;
break;
case Test.RPMXY:
FileNameWithoutExtension = "RPM_Data";
Header = "Lot;Date;Recipe;Reactor;Scribe;Pocket;Tool;Name;Value";
QueryFilter = "Barrier_Composition_RPM_XY";
Title = "RPM XY Data ***&*** View Data";
HTML = @"GaN Epi Data\09 - rpm --- 08 - photoluminescence.html";
break;
case Test.RPMAverage:
FileNameWithoutExtension = "RPMdata-short";
Header = "fProductId;fDate;average;stdDev;fRecipeName;Reactor;g4Scribe;Pocket Number;Tool ID;Recipe From Rpm File";
QueryFilter = "Epi Thickness Mean";
Title = "RPM Average Data";
HTML = @"GaN Epi Data\09 - rpm.html";
break;
case Test.RPMPLRatio:
FileNameWithoutExtension = "PHOTOLUMINESCENCE_data-short";
Header = "fProductId;fDate;g4Scribe;fRecipeName;bandEdge_nm;bandEdge_V;yellowBand_Pmw;yellowBand_nm;yellowBand_V;Reactor;Pocket Number;Tool ID";
QueryFilter = "PL Ratio";
Title = "Photoluminescence: PL Ratio";
HTML = @"GaN Epi Data\08 - photoluminescence.html";
break;
case Test.DailyRPMXY:
FileNameWithoutExtension = "RPM_Data";
Header = "Lot;Date;Recipe;Reactor;Scribe;Pocket;Tool;Name;Value";
QueryFilter = "Barrier_Composition_RPM_XY";
Title = "";
HTML = @"Metrology\?";
break;
case Test.DailyRPMAverage:
FileNameWithoutExtension = "RPMdata-short";
Header = "fProductId;fDate;average;stdDev;fRecipeName;Reactor;g4Scribe;Pocket Number;Tool ID;Recipe From Rpm File";
QueryFilter = "Epi Thickness Mean";
Title = "";
HTML = @"Metrology\?";
break;
case Test.DailyRPMPLRatio:
FileNameWithoutExtension = "PHOTOLUMINESCENCE_data-short";
Header = "fProductId;fDate;g4Scribe;fRecipeName;bandEdge_nm;bandEdge_V;yellowBand_Pmw;yellowBand_nm;yellowBand_V;Reactor;Pocket Number;Tool ID";
QueryFilter = "PL Ratio";
Title = "RPM Daily Verification";
HTML = @"Metrology\17 - rpm_verif_daily.html";
break;
case Test.VerificationRPM:
FileNameWithoutExtension = "PhotoLuminescence_Ver";
Header = "Part;Process;Date;Test;Value";
QueryFilter = "PL Edge Wavelength";
Title = "PL Daily Verification - [PL Edge Wavelength]";
HTML = @"Metrology\18 - photoluminescence_verif_daily.html";
break;
case Test.Photoreflectance:
FileNameWithoutExtension = "photoreflect_iqs_01";
Header = "Lot;Date;Part;Reactor;Scribe;Pocket;Tool;Point;WaferPosition_PR;PR_Peak";
QueryFilter = "PR Barrier Composition";
Title = "Photoreflectance 6 in, Photoreflectance 8 in";
HTML = @"GaN Epi Data\07 - photoreflectance.html";
break;
case Test.UV:
FileNameWithoutExtension = "uv_iqs_01";
Header = string.Empty;
QueryFilter = "UV Broken";
Title = "UV";
HTML = @"GaN Epi Data\15 - uv 2.1.html";
break;
case Test.VpdIcpmsAnalyte:
FileNameWithoutExtension = "VPD_iqs_01";
Header = "Reactor;RunID;RunDate;PartNumber;PocketNumber;WaferScribe;Analyte;Value";
QueryFilter = "Mg";
Title = "VpdIcpmsAnalyteData";
HTML = @"";
break;
case Test.WarpAndBow:
FileNameWithoutExtension = "warp_iqs_01";
Header = "fDate;fRecipeName;fProductId;g4Scribe;warp;bow;tool;Reactor;Pocket ID;bow_range;BowX;BowY;CenterBow";
QueryFilter = "BowCenter";
Title = "Warp and Bow";
HTML = @"GaN Epi Data\14 - warp.html";
break;
case Test.VerificationWarpAndBow:
FileNameWithoutExtension = "warp_ver_iqs_01";
Header = "Part;Process;Date;WaferScribe;totWarp;bow";
QueryFilter = "Bow Calibration";
Title = "6 Inch Warp/Bow Daily Verification, 8 Inch Warp/Bow Daily Verification";
HTML = @"Metrology\19 - warp_cal_daily.html";
break;
case Test.XRDXY:
FileNameWithoutExtension = "xrd_iqs_NEW_01";
Header = "Reactor;fDate;fRecipeName;Lot;pocketNumber;g4Scribe;ToolID;Name;Value;Group";
QueryFilter = "SL Period";
Title = "XRD XY Raw Data Viewer";
HTML = @"GaN Epi Data\11 - xrd.html";
break;
case Test.XRDWeightedAverage:
FileNameWithoutExtension = "xrd_iqs_NEW_01_WtAVG";
Header = "Reactor;fDate;fRecipeName;Lot;pocketNumber;g4Scribe;Name;Value;Group";
//QueryFilter = "Al% Barrier WTAVG";
QueryFilter = "SL Period WTAVG";
Title = "XRD Weighted Average Data";
HTML = @"GaN Epi Data\11 - xrd.html";
break;
case Test.MonthlyXRD:
FileNameWithoutExtension = "xrd_monthly_ver_iqs_01";
Header = "Part;Process;Date;TestName;Value";
QueryFilter = "XRD 2-Theta Position";
Title = "XRD Monthly Verification";
HTML = @"Metrology\03 - xrd_verif_monthly.html";
break;
case Test.WeeklyXRD:
FileNameWithoutExtension = "xrd_weekly_ver_iqs_01";
Header = "Part;Process;Lot;Date;TestName;Value";
QueryFilter = "XRD Weekly AL% Center";
Title = "XRD Weekly Verification";
HTML = @"Metrology\12 - xrd_verif_weekly.html";
break;
case Test.JVXRD:
FileNameWithoutExtension = "xrd_iqs_NEW_01";
Header = "Reactor;fDate;fRecipeName;Lot;pocketNumber;g4Scribe;ToolID;Name;Value;Group";
QueryFilter = "SL Period";
Title = "XRD XY Raw Data Viewer";
HTML = @"GaN Epi Data\11 - xrd.html";
break;
default:
throw new Exception();
}
FileName = string.Concat(FileNameWithoutExtension, ".txt");
}
public ScopeInfo ShallowCopy() => (ScopeInfo)MemberwiseClone();
}

View File

@ -0,0 +1,21 @@
namespace Adaptation.Shared.Metrology;
public partial class WS
{
public class Attachment
{
public string UniqueId { get; set; }
public string DestinationFileName { get; set; }
public string SourceFileName { get; set; }
public Attachment(string uniqueId, string destinationFileName, string sourceFileName)
{
UniqueId = uniqueId;
DestinationFileName = destinationFileName;
SourceFileName = sourceFileName;
}
}
}

View File

@ -0,0 +1,27 @@
using System.Collections.Generic;
using System.Text.Json;
namespace Adaptation.Shared.Metrology;
public partial class WS
{
// this class represents the response from the Inbound API endpoint
public class Results
{
// true or false if data was written to the database
public bool Success { get; set; }
// if true, contains ID of the Header record in the database
public long HeaderID { get; set; }
// if false, this collection will contain a list of errors
public List<string> Errors { get; set; }
// this collection will contain a list of warnings, they will not prevent data from being saved
public List<string> Warnings { get; set; }
// this is just a helper function to make displaying the results easier
public override string ToString() => JsonSerializer.Serialize(this, GetType());
}
}

View File

@ -0,0 +1,123 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Text;
using System.Text.Json;
namespace Adaptation.Shared.Metrology;
public partial class WS
{
public static (string, Results) SendData(string url, object payload, int timeoutSeconds = 120)
{
Results results = new();
string resultsJson = string.Empty;
try
{
string json = JsonSerializer.Serialize(payload, payload.GetType());
if (string.IsNullOrEmpty(url) || !url.Contains(":") || !url.Contains("."))
throw new Exception("Invalid URL");
using (HttpClient httpClient = new())
{
httpClient.Timeout = new TimeSpan(0, 0, 0, timeoutSeconds, 0);
HttpRequestMessage httpRequestMessage = new()
{
RequestUri = new Uri(url),
Method = HttpMethod.Post,
Content = new StringContent(json, Encoding.UTF8, "application/json")
};
HttpResponseMessage httpResponseMessage = httpClient.SendAsync(httpRequestMessage, HttpCompletionOption.ResponseContentRead).Result;
resultsJson = httpResponseMessage.Content.ReadAsStringAsync().Result;
results = JsonSerializer.Deserialize<Results>(resultsJson);
}
if (!results.Success)
results.Errors.Add(results.ToString());
}
catch (Exception e)
{
Exception exception = e;
StringBuilder stringBuilder = new();
while (exception is not null)
{
_ = stringBuilder.AppendLine(exception.Message);
exception = exception.InnerException;
}
if (results.Errors is null)
results.Errors = new List<string>();
results.Errors.Add(stringBuilder.ToString());
}
return new(resultsJson, results);
}
// this method is a wrapper for attaching a file to either a header or data record
// URL is the same URL used for SendData, ex: http://localhost/api/inbound/CDE
// attachToHeaderId is the ID returned by SendData
// attachToDataUniqueId is the string unique ID for the data record, aka the Title of the Sharepoint list entry
// fileContents is a byte array with the contents of the file
// fileName is which attachment this is, image.pdf, data.pdf, data.txt, header.pdf, etc
// timeoutSeconds is configured as the request timeout
// this method will either succeed or throw an exception
// also, this has been made synchronous
public static void AttachFile(string url, long attachToHeaderId, string attachToDataUniqueId, byte[] fileContents, string fileName, int timeoutSeconds = 60)
{
using HttpClient httpClient = new();
string requestUrl = url + "/attachment?headerid=" + attachToHeaderId.ToString();
if (!string.IsNullOrWhiteSpace(attachToDataUniqueId))
{
requestUrl += "&datauniqueid=";
requestUrl += System.Net.WebUtility.UrlEncode(attachToDataUniqueId);
}
requestUrl += "&filename="; // this is just so the web server log shows the filename
requestUrl += System.Net.WebUtility.UrlEncode(fileName);
httpClient.Timeout = new TimeSpan(0, 0, 0, timeoutSeconds, 0);
MultipartFormDataContent multipartFormDataContent = new();
ByteArrayContent byteArrayContent = new(fileContents);
byteArrayContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
multipartFormDataContent.Add(byteArrayContent, "attachment", fileName);
HttpResponseMessage httpResponseMessage = httpClient.PostAsync(requestUrl, multipartFormDataContent).Result;
if (httpResponseMessage.IsSuccessStatusCode)
return;
string resultBody = httpResponseMessage.Content.ReadAsStringAsync().Result;
throw new Exception("Attachment failed: " + resultBody);
}
public static void AttachFiles(string url, long headerID, List<Attachment> headerAttachments = null, List<Attachment> dataAttachments = null)
{
try
{
if (headerAttachments is not null)
{
foreach (Attachment attachment in headerAttachments)
AttachFile(url, headerID, "", File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName);
}
if (dataAttachments is not null)
{
foreach (Attachment attachment in dataAttachments)
AttachFile(url, headerID, attachment.UniqueId, File.ReadAllBytes(attachment.SourceFileName), attachment.DestinationFileName);
}
//MessageBox.Show(r.ToString());
}
catch (Exception e)
{
Exception exception = e;
StringBuilder stringBuilder = new();
while (exception is not null)
{
_ = stringBuilder.AppendLine(exception.Message);
exception = exception.InnerException;
}
//MessageBox.Show(msgs.ToString(), "Exception", //MessageBoxButtons.OK, //MessageBoxIcon.Error);
throw new Exception(stringBuilder.ToString());
}
}
}

View File

@ -1,13 +1,10 @@
namespace Adaptation.Shared namespace Adaptation.Shared;
{
public enum ParameterType public enum ParameterType
{ {
String = 0, String = 0,
Integer = 2, Integer = 2,
Double = 3, Double = 3,
Boolean = 4, Boolean = 4,
StructuredType = 5 StructuredType = 5
}
} }

View File

@ -7,11 +7,10 @@ using System.Linq;
using System.Text; using System.Text;
using System.Text.Json; using System.Text.Json;
namespace Adaptation.Shared namespace Adaptation.Shared;
{
public class ProcessDataStandardFormat public class ProcessDataStandardFormat
{ {
public const string RecordStart = "RECORD_START"; public const string RecordStart = "RECORD_START";
@ -38,29 +37,29 @@ namespace Adaptation.Shared
string format = "MM/dd/yyyy HH:mm:ss"; string format = "MM/dd/yyyy HH:mm:ss";
StringBuilder stringBuilder = new(); StringBuilder stringBuilder = new();
lines = new string[] { "HEADER_TAG\tHEADER_VALUE", "FORMAT\t2.00", "NUMBER_PASSES\t0001", string.Concat("HEADER_OFFSET\t", headerOffset), string.Concat("DATA_OFFSET\t", dataOffset), string.Concat("END_OFFSET\t", endOffset) }.ToList(); lines = new string[] { "HEADER_TAG\tHEADER_VALUE", "FORMAT\t2.00", "NUMBER_PASSES\t0001", string.Concat("HEADER_OFFSET\t", headerOffset), string.Concat("DATA_OFFSET\t", dataOffset), string.Concat("END_OFFSET\t", endOffset) }.ToList();
stringBuilder.Append("\"Time\"").Append('\t'); _ = stringBuilder.Append("\"Time\"").Append('\t');
stringBuilder.Append("\"A_LOGISTICS\"").Append('\t'); _ = stringBuilder.Append("\"A_LOGISTICS\"").Append('\t');
stringBuilder.Append("\"B_LOGISTICS\"").Append('\t'); _ = stringBuilder.Append("\"B_LOGISTICS\"").Append('\t');
for (int i = 0; i < jsonElements.Length;) for (int i = 0; i < jsonElements.Length;)
{ {
foreach (JsonProperty jsonProperty in jsonElements[0].EnumerateObject()) foreach (JsonProperty jsonProperty in jsonElements[0].EnumerateObject())
{ {
columns += 1; columns += 1;
stringBuilder.Append("\"").Append(jsonProperty.Name).Append("\"").Append('\t'); _ = stringBuilder.Append('"').Append(jsonProperty.Name).Append('"').Append('\t');
} }
break; break;
} }
stringBuilder.Remove(stringBuilder.Length - 1, 1); _ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
lines.Add(stringBuilder.ToString()); lines.Add(stringBuilder.ToString());
for (int i = 0; i < jsonElements.Length; i++) for (int i = 0; i < jsonElements.Length; i++)
{ {
stringBuilder.Clear(); _ = stringBuilder.Clear();
stringBuilder.Append("0.1").Append('\t'); _ = stringBuilder.Append("0.1").Append('\t');
stringBuilder.Append("1").Append('\t'); _ = stringBuilder.Append('1').Append('\t');
stringBuilder.Append("2").Append('\t'); _ = stringBuilder.Append('2').Append('\t');
foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject()) foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject())
stringBuilder.Append(jsonProperty.Value).Append('\t'); _ = stringBuilder.Append(jsonProperty.Value).Append('\t');
stringBuilder.Remove(stringBuilder.Length - 1, 1); _ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
lines.Add(stringBuilder.ToString()); lines.Add(stringBuilder.ToString());
} }
lines.Add(string.Concat("NUM_DATA_ROWS ", jsonElements.Length.ToString().PadLeft(9, '0'))); lines.Add(string.Concat("NUM_DATA_ROWS ", jsonElements.Length.ToString().PadLeft(9, '0')));
@ -78,9 +77,9 @@ namespace Adaptation.Shared
lines.Add(string.Concat("LOGISTICS_2", '\t', "B_CHAMBER=;B_INFO=", fileRead.EventName, ";B_INFO2=", fileRead.EquipmentType, ";B_JOBID=", fileRead.CellInstanceName, ";B_MES_ENTITY=", fileRead.MesEntity, ";B_MID=", logistics.MID, ";B_NULL_DATA=", fileRead.NullData, ";B_PPID=NO_PPID;B_PROCESS_JOBID=", logistics.ProcessJobID, ";B_PRODUCT=;B_SEQUENCE=", logistics.Sequence, ";B_WAFER_ID=;")); lines.Add(string.Concat("LOGISTICS_2", '\t', "B_CHAMBER=;B_INFO=", fileRead.EventName, ";B_INFO2=", fileRead.EquipmentType, ";B_JOBID=", fileRead.CellInstanceName, ";B_MES_ENTITY=", fileRead.MesEntity, ";B_MID=", logistics.MID, ";B_NULL_DATA=", fileRead.NullData, ";B_PPID=NO_PPID;B_PROCESS_JOBID=", logistics.ProcessJobID, ";B_PRODUCT=;B_SEQUENCE=", logistics.Sequence, ";B_WAFER_ID=;"));
lines.Add("END_HEADER"); lines.Add("END_HEADER");
} }
stringBuilder.Clear(); _ = stringBuilder.Clear();
foreach (string line in lines) foreach (string line in lines)
stringBuilder.AppendLine(line); _ = stringBuilder.AppendLine(line);
result = stringBuilder.ToString(); result = stringBuilder.ToString();
result = result.Replace(headerOffset, result.IndexOf("NUM_DATA_ROWS").ToString().PadLeft(9, '0')). result = result.Replace(headerOffset, result.IndexOf("NUM_DATA_ROWS").ToString().PadLeft(9, '0')).
Replace(dataOffset, result.IndexOf('"').ToString().PadLeft(9, '0')). Replace(dataOffset, result.IndexOf('"').ToString().PadLeft(9, '0')).
@ -98,7 +97,7 @@ namespace Adaptation.Shared
lines = File.ReadAllLines(reportFullPath); lines = File.ReadAllLines(reportFullPath);
string[] segments; string[] segments;
if (lines.Length < 7) if (lines.Length < 7)
segments = new string[] { }; segments = Array.Empty<string>();
else else
segments = lines[6].Trim().Split('\t'); segments = lines[6].Trim().Split('\t');
List<string> columns = new(); List<string> columns = new();
@ -121,7 +120,7 @@ namespace Adaptation.Shared
} }
} }
bool lookForLogistics = false; bool lookForLogistics = false;
for (int r = 7; r < lines.Count(); r++) for (int r = 7; r < lines.Length; r++)
{ {
if (lines[r].StartsWith("NUM_DATA_ROWS")) if (lines[r].StartsWith("NUM_DATA_ROWS"))
lookForLogistics = true; lookForLogistics = true;
@ -132,11 +131,11 @@ namespace Adaptation.Shared
} }
if (lines[r].StartsWith("LOGISTICS_1")) if (lines[r].StartsWith("LOGISTICS_1"))
{ {
for (int i = r; i < lines.Count(); i++) for (int i = r; i < lines.Length; i++)
{ {
if (lines[r].StartsWith("END_HEADER")) if (lines[r].StartsWith("END_HEADER"))
break; break;
logistics.AppendLine(lines[i]); _ = logistics.AppendLine(lines[i]);
} }
break; break;
} }
@ -159,14 +158,14 @@ namespace Adaptation.Shared
StringBuilder stringBuilder = new(); StringBuilder stringBuilder = new();
foreach (string bodyLine in bodyLines) foreach (string bodyLine in bodyLines)
{ {
stringBuilder.Append('{'); _ = stringBuilder.Append('{');
segments = bodyLine.Trim().Split('\t'); segments = bodyLine.Trim().Split('\t');
if (!lookForNumbers) if (!lookForNumbers)
{ {
for (int c = 1; c < segments.Length; c++) for (int c = 1; c < segments.Length; c++)
{ {
value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\"); value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\");
stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\","); _ = stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\",");
} }
} }
else else
@ -175,17 +174,17 @@ namespace Adaptation.Shared
{ {
value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\"); value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\");
if (string.IsNullOrEmpty(value)) if (string.IsNullOrEmpty(value))
stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append("null,"); _ = stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append("null,");
else if (value.All(char.IsDigit)) else if (value.All(char.IsDigit))
stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append(","); _ = stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append(',');
else else
stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\","); _ = stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\",");
} }
} }
stringBuilder.Remove(stringBuilder.Length - 1, 1); _ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
stringBuilder.AppendLine("},"); _ = stringBuilder.AppendLine("},");
} }
stringBuilder.Remove(stringBuilder.Length - 3, 3); _ = stringBuilder.Remove(stringBuilder.Length - 3, 3);
results = JsonSerializer.Deserialize<JsonElement[]>(string.Concat("[", stringBuilder, "]")); results = JsonSerializer.Deserialize<JsonElement[]>(string.Concat("[", stringBuilder, "]"));
} }
return results; return results;
@ -268,25 +267,13 @@ namespace Adaptation.Shared
return string.Concat(((int)searchFor).ToString().PadLeft(2, '0'), separator, searchFor.ToString().Replace("In", string.Concat(separator, "In")).Replace("Ex", string.Concat(separator, "Ex"))); return string.Concat(((int)searchFor).ToString().PadLeft(2, '0'), separator, searchFor.ToString().Replace("In", string.Concat(separator, "In")).Replace("Ex", string.Concat(separator, "Ex")));
} }
public static string EquipmentIntegration(bool addSpaces = true, char separator = ' ') public static string EquipmentIntegration(bool addSpaces = true, char separator = ' ') => GetString(SearchFor.EquipmentIntegration, addSpaces, separator);
{
return GetString(SearchFor.EquipmentIntegration, addSpaces, separator);
}
public static string BusinessIntegration(bool addSpaces = true, char separator = ' ') public static string BusinessIntegration(bool addSpaces = true, char separator = ' ') => GetString(SearchFor.BusinessIntegration, addSpaces, separator);
{
return GetString(SearchFor.BusinessIntegration, addSpaces, separator);
}
public static string SystemExport(bool addSpaces = true, char separator = ' ') public static string SystemExport(bool addSpaces = true, char separator = ' ') => GetString(SearchFor.SystemExport, addSpaces, separator);
{
return GetString(SearchFor.SystemExport, addSpaces, separator);
}
public static string Archive(bool addSpaces = true, char separator = ' ') public static string Archive(bool addSpaces = true, char separator = ' ') => GetString(SearchFor.Archive, addSpaces, separator);
{
return GetString(SearchFor.Archive, addSpaces, separator);
}
public static string GetLines(Logistics logistics, Properties.IScopeInfo scopeInfo, List<string> names, Dictionary<string, List<string>> keyValuePairs, string dateFormat, string timeFormat, List<string> pairedParameterNames, bool useDateTimeFromSequence = true, string format = "", List<string> ignoreParameterNames = null) public static string GetLines(Logistics logistics, Properties.IScopeInfo scopeInfo, List<string> names, Dictionary<string, List<string>> keyValuePairs, string dateFormat, string timeFormat, List<string> pairedParameterNames, bool useDateTimeFromSequence = true, string format = "", List<string> ignoreParameterNames = null)
{ {
@ -301,7 +288,7 @@ namespace Adaptation.Shared
const string columnDate = "Date"; const string columnDate = "Date";
const string columnTime = "Time"; const string columnTime = "Time";
const string firstDuplicate = "_1"; const string firstDuplicate = "_1";
result.AppendLine(scopeInfo.Header); _ = result.AppendLine(scopeInfo.Header);
StringBuilder line = new(); StringBuilder line = new();
if (logistics.NullData is null) if (logistics.NullData is null)
nullData = string.Empty; nullData = string.Empty;
@ -310,8 +297,8 @@ namespace Adaptation.Shared
int count = (from l in keyValuePairs select l.Value.Count).Min(); int count = (from l in keyValuePairs select l.Value.Count).Min();
for (int r = 0; r < count; r++) for (int r = 0; r < count; r++)
{ {
line.Clear(); _ = line.Clear();
line.Append("!"); _ = line.Append('!');
foreach (KeyValuePair<string, List<string>> keyValuePair in keyValuePairs) foreach (KeyValuePair<string, List<string>> keyValuePair in keyValuePairs)
{ {
if (!names.Contains(keyValuePair.Key)) if (!names.Contains(keyValuePair.Key))
@ -323,29 +310,29 @@ namespace Adaptation.Shared
if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData) if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData)
continue; continue;
else else
result.Append(line).Append(keyValuePair.Key).Append(';').AppendLine(keyValuePair.Value[r]); _ = result.Append(line).Append(keyValuePair.Key).Append(';').AppendLine(keyValuePair.Value[r]);
} }
else else
{ {
if (useDateTimeFromSequence && keyValuePair.Key == columnDate) if (useDateTimeFromSequence && keyValuePair.Key == columnDate)
line.Append(logistics.DateTimeFromSequence.ToString(dateFormat)); _ = line.Append(logistics.DateTimeFromSequence.ToString(dateFormat));
else if (useDateTimeFromSequence && keyValuePair.Key == columnTime) else if (useDateTimeFromSequence && keyValuePair.Key == columnTime)
line.Append(logistics.DateTimeFromSequence.ToString(timeFormat)); _ = line.Append(logistics.DateTimeFromSequence.ToString(timeFormat));
else if (!useDateTimeFromSequence && keyValuePair.Key == columnDate && keyValuePair.Value[r].Length == format.Length) else if (!useDateTimeFromSequence && keyValuePair.Key == columnDate && keyValuePair.Value[r].Length == format.Length)
line.Append(DateTime.ParseExact(keyValuePair.Value[r], format, CultureInfo.InvariantCulture).ToString(dateFormat)); _ = line.Append(DateTime.ParseExact(keyValuePair.Value[r], format, CultureInfo.InvariantCulture).ToString(dateFormat));
else if (!useDateTimeFromSequence && keyValuePair.Key == columnTime && keyValuePairs.ContainsKey(string.Concat(keyValuePair.Key, firstDuplicate)) && keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r].Length == format.Length) else if (!useDateTimeFromSequence && keyValuePair.Key == columnTime && keyValuePairs.ContainsKey(string.Concat(keyValuePair.Key, firstDuplicate)) && keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r].Length == format.Length)
line.Append(DateTime.ParseExact(keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r], format, CultureInfo.InvariantCulture).ToString(timeFormat)); _ = line.Append(DateTime.ParseExact(keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r], format, CultureInfo.InvariantCulture).ToString(timeFormat));
else if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData) else if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData)
line.Append(nullData); _ = line.Append(nullData);
else else
line.Append(keyValuePair.Value[r]); _ = line.Append(keyValuePair.Value[r]);
line.Append(';'); _ = line.Append(';');
} }
} }
if (!pairedParameterNames.Any()) if (!pairedParameterNames.Any())
{ {
line.Remove(line.Length - 1, 1); _ = line.Remove(line.Length - 1, 1);
result.AppendLine(line.ToString()); _ = result.AppendLine(line.ToString());
} }
} }
return result.ToString(); return result.ToString();
@ -361,8 +348,8 @@ namespace Adaptation.Shared
int startsAt = 0; int startsAt = 0;
string[] segments; string[] segments;
int? currentGroup = null; int? currentGroup = null;
char inputSeperator = '\t'; char inputSeparator = '\t';
char outputSeperator = '\t'; char outputSeparator = '\t';
List<int> vs = new(); List<int> vs = new();
List<int[]> groups = new(); List<int[]> groups = new();
string[] lines = File.ReadAllLines(reportFullPath); string[] lines = File.ReadAllLines(reportFullPath);
@ -371,7 +358,7 @@ namespace Adaptation.Shared
{ {
if (string.IsNullOrEmpty(lines[i])) if (string.IsNullOrEmpty(lines[i]))
continue; continue;
segments = lines[i].Split(inputSeperator); segments = lines[i].Split(inputSeparator);
if (currentGroup is null) if (currentGroup is null)
currentGroup = segments.Length; currentGroup = segments.Length;
if (segments.Length != currentGroup) if (segments.Length != currentGroup)
@ -381,39 +368,39 @@ namespace Adaptation.Shared
startsAt = i; startsAt = i;
} }
} }
if (startsAt == lines.Length - 1 && lines[0].Split(inputSeperator).Length != currentGroup) if (startsAt == lines.Length - 1 && lines[0].Split(inputSeparator).Length != currentGroup)
groups.Add(new int[] { lines.Length - 1, lines.Length - 1 }); groups.Add(new int[] { lines.Length - 1, lines.Length - 1 });
for (int g = 0; g < groups.Count; g++) for (int g = 0; g < groups.Count; g++)
{ {
vs.Clear(); vs.Clear();
group = groups[g]; group = groups[g];
line = lines[group[0]]; line = lines[group[0]];
segments = line.Split(inputSeperator); segments = line.Split(inputSeparator);
for (int s = 0; s < segments.Length; s++) for (int s = 0; s < segments.Length; s++)
vs.Add(segments[s].Length); vs.Add(segments[s].Length);
for (int i = group[0]; i <= group[1]; i++) for (int i = group[0]; i <= group[1]; i++)
{ {
line = lines[i]; line = lines[i];
segments = line.Split(inputSeperator); segments = line.Split(inputSeparator);
for (int s = 0; s < segments.Length; s++) for (int s = 0; s < segments.Length; s++)
{ {
if (vs[s] < segments[s].Length) if (vs[s] < segments[s].Length)
vs[s] = segments[s].Length; vs[s] = segments[s].Length;
} }
} }
stringBuilder.Clear(); _ = stringBuilder.Clear();
for (int s = 0; s < segments.Length; s++) for (int s = 0; s < segments.Length; s++)
stringBuilder.Append((s + 1).ToString().PadLeft(vs[s], ' ')).Append(outputSeperator); _ = stringBuilder.Append((s + 1).ToString().PadLeft(vs[s], ' ')).Append(outputSeparator);
stringBuilder.Remove(stringBuilder.Length - 1, 1); _ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
results.Add(stringBuilder.ToString()); results.Add(stringBuilder.ToString());
for (int i = group[0]; i <= group[1]; i++) for (int i = group[0]; i <= group[1]; i++)
{ {
line = lines[i]; line = lines[i];
stringBuilder.Clear(); _ = stringBuilder.Clear();
segments = line.Split(inputSeperator); segments = line.Split(inputSeparator);
for (int s = 0; s < segments.Length; s++) for (int s = 0; s < segments.Length; s++)
stringBuilder.Append(segments[s].PadLeft(vs[s], ' ')).Append(outputSeperator); _ = stringBuilder.Append(segments[s].PadLeft(vs[s], ' ')).Append(outputSeparator);
stringBuilder.Remove(stringBuilder.Length - 1, 1); _ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
results.Add(stringBuilder.ToString()); results.Add(stringBuilder.ToString());
} }
results.Add(string.Empty); results.Add(string.Empty);
@ -421,6 +408,4 @@ namespace Adaptation.Shared
return results; return results;
} }
}
} }

View File

@ -1,9 +1,7 @@
namespace Adaptation.Shared.Properties namespace Adaptation.Shared.Properties;
{
public interface IAppSettings public interface IAppSettings
{ {
public string Company { get; set; } public string Company { get; set; }
public Drive[] Drives { get; set; } public Drive[] Drives { get; set; }
}
} }

View File

@ -1,13 +1,10 @@
namespace Adaptation.Shared.Properties namespace Adaptation.Shared.Properties;
{
public interface IDescription public interface IDescription
{ {
int Test { get; } int Test { get; }
int Count { get; } int Count { get; }
int Index { get; } int Index { get; }
}
} }

View File

@ -1,12 +1,10 @@
namespace Adaptation.Shared.Properties namespace Adaptation.Shared.Properties;
{
public interface IDrive public interface IDrive
{ {
public bool Use { get; set; } public bool Use { get; set; }
public string Letter { get; set; } public string Letter { get; set; }
public string Share { get; set; } public string Share { get; set; }
public string User { get; set; } public string User { get; set; }
public string Password { get; set; } public string Password { get; set; }
}
} }

View File

@ -1,8 +1,7 @@
namespace Adaptation.Shared.Properties namespace Adaptation.Shared.Properties;
{
public interface IFileRead public interface IFileRead
{ {
bool IsEvent { get; } bool IsEvent { get; }
string NullData { get; } string NullData { get; }
string MesEntity { get; } string MesEntity { get; }
@ -15,6 +14,4 @@ namespace Adaptation.Shared.Properties
bool UseCyclicalForDescription { get; } bool UseCyclicalForDescription { get; }
string CellInstanceConnectionName { get; } string CellInstanceConnectionName { get; }
string ParameterizedModelObjectDefinitionType { get; } string ParameterizedModelObjectDefinitionType { get; }
}
} }

View File

@ -1,11 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.Shared.Properties namespace Adaptation.Shared.Properties;
{
public interface ILogistics public interface ILogistics
{ {
public object NullData { get; } public object NullData { get; }
public string JobID { get; } //CellName public string JobID { get; } //CellName
@ -20,6 +19,4 @@ namespace Adaptation.Shared.Properties
public List<string> Logistics1 { get; set; } public List<string> Logistics1 { get; set; }
public List<Logistics2> Logistics2 { get; set; } public List<Logistics2> Logistics2 { get; set; }
}
} }

View File

@ -1,8 +1,7 @@
namespace Adaptation.Shared.Properties namespace Adaptation.Shared.Properties;
{
public interface ILogistics2 public interface ILogistics2
{ {
public string MID { get; } public string MID { get; }
public string RunNumber { get; } public string RunNumber { get; }
@ -12,6 +11,4 @@ namespace Adaptation.Shared.Properties
public string WaferLot { get; } public string WaferLot { get; }
public string Recipe { get; } public string Recipe { get; }
}
} }

View File

@ -1,13 +1,10 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace Adaptation.Shared.Properties namespace Adaptation.Shared.Properties;
{
public interface IProcessData public interface IProcessData
{ {
List<object> Details { get; } List<object> Details { get; }
}
} }

View File

@ -1,10 +1,9 @@
using System; using System;
namespace Adaptation.Shared.Properties namespace Adaptation.Shared.Properties;
{
public interface IScopeInfo public interface IScopeInfo
{ {
Enum Enum { get; } Enum Enum { get; }
string HTML { get; } string HTML { get; }
@ -15,6 +14,4 @@ namespace Adaptation.Shared.Properties
string QueryFilter { get; } string QueryFilter { get; }
string FileNameWithoutExtension { get; } string FileNameWithoutExtension { get; }
}
} }

View File

@ -1,32 +1,33 @@
#pragma warning disable SYSLIB0022
using System; using System;
using System.IO; using System.IO;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace Adaptation.Shared namespace Adaptation.Shared;
{
public static class RijndaelEncryption public static class RijndaelEncryption
{ {
/// <summary> /// <summary>
/// Change the Inputkey GUID when you use this code in your own program. /// Change the input key GUID when you use this code in your own program.
/// Keep this inputkey very safe and prevent someone from decoding it some way!! /// Keep this input key very safe and prevent someone from decoding it some way!!
/// Generated 2021-08-10 /// Generated 2021-08-10
/// </summary> /// </summary>
internal const string Inputkey = "970CCEF6-4307-4F6A-9AC8-377DADB889BD"; internal const string _InputKey = "970CCEF6-4307-4F6A-9AC8-377DADB889BD";
/// <summary> /// <summary>
/// Encrypt the given text and give the byte array back as a BASE64 string /// Encrypt the given text and give the byte array back as a BASE64 string
/// </summary> /// </summary>
/// <param name="text">The text to encrypt</param> /// <param name="text">The text to encrypt</param>
/// <param name="salt">The pasword salt</param> /// <param name="salt">The password salt</param>
/// <returns>The encrypted text</returns> /// <returns>The encrypted text</returns>
public static string Encrypt(string text, string salt) public static string Encrypt(string text, string salt)
{ {
string result; string result;
if (string.IsNullOrEmpty(text)) if (string.IsNullOrEmpty(text))
throw new ArgumentNullException("text"); throw new ArgumentNullException(nameof(text));
RijndaelManaged aesAlg = NewRijndaelManaged(salt); RijndaelManaged aesAlg = NewRijndaelManaged(salt);
ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV); ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
MemoryStream msEncrypt = new(); MemoryStream msEncrypt = new();
@ -54,12 +55,12 @@ namespace Adaptation.Shared
/// Decrypts the given text /// Decrypts the given text
/// </summary> /// </summary>
/// <param name="cipherText">The encrypted BASE64 text</param> /// <param name="cipherText">The encrypted BASE64 text</param>
/// <param name="salt">The pasword salt</param> /// <param name="salt">The password salt</param>
/// <returns>De gedecrypte text</returns> /// <returns>De gedecrypte text</returns>
public static string Decrypt(string cipherText, string salt) public static string Decrypt(string cipherText, string salt)
{ {
if (string.IsNullOrEmpty(cipherText)) if (string.IsNullOrEmpty(cipherText))
throw new ArgumentNullException("cipherText"); throw new ArgumentNullException(nameof(cipherText));
if (!IsBase64String(cipherText)) if (!IsBase64String(cipherText))
throw new Exception("The cipherText input parameter is not base64 encoded"); throw new Exception("The cipherText input parameter is not base64 encoded");
string text; string text;
@ -78,19 +79,17 @@ namespace Adaptation.Shared
/// <summary> /// <summary>
/// Create a new RijndaelManaged class and initialize it /// Create a new RijndaelManaged class and initialize it
/// </summary> /// </summary>
/// <param name="salt">The pasword salt</param> /// <param name="salt">The password salt</param>
/// <returns></returns> /// <returns></returns>
private static RijndaelManaged NewRijndaelManaged(string salt) private static RijndaelManaged NewRijndaelManaged(string salt)
{ {
if (salt == null) if (salt == null)
throw new ArgumentNullException("salt"); throw new ArgumentNullException(nameof(salt));
byte[] saltBytes = Encoding.ASCII.GetBytes(salt); byte[] saltBytes = Encoding.ASCII.GetBytes(salt);
Rfc2898DeriveBytes key = new(Inputkey, saltBytes); Rfc2898DeriveBytes key = new(_InputKey, saltBytes);
RijndaelManaged aesAlg = new(); RijndaelManaged aesAlg = new();
aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8); aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
aesAlg.IV = key.GetBytes(aesAlg.BlockSize / 8); aesAlg.IV = key.GetBytes(aesAlg.BlockSize / 8);
return aesAlg; return aesAlg;
} }
}
} }

View File

@ -1,8 +1,7 @@
namespace Adaptation.Shared namespace Adaptation.Shared;
{
public enum Test public enum Test
{ {
AFMRoughness = 34, AFMRoughness = 34,
BioRadQS408M = 25, BioRadQS408M = 25,
BioRadStratus = 26, BioRadStratus = 26,
@ -21,15 +20,20 @@ namespace Adaptation.Shared
DailyRPMXY = 18, DailyRPMXY = 18,
Denton = 9, Denton = 9,
DiffusionLength = 45, DiffusionLength = 45,
GRATXTCenter = 51,
GRATXTEdge = 52, //Largest
GrowthRateXML = 50,
Hall = 10, Hall = 10,
HgCV = 23, HgCV = 23,
JVXRD = 47,
Lehighton = 13, Lehighton = 13,
LogbookCAC = 49,
Microscope = 46, Microscope = 46,
MonthlyCV = 4, MonthlyCV = 4,
MonthlyHall = 11, MonthlyHall = 11,
MonthlyXRD = 32, MonthlyXRD = 32,
Photoreflectance = 22, Photoreflectance = 22,
PlatoA = 48, //Largest PlatoA = 48,
RPMAverage = 16, RPMAverage = 16,
RPMPLRatio = 17, RPMPLRatio = 17,
RPMXY = 15, RPMXY = 15,
@ -50,8 +54,5 @@ namespace Adaptation.Shared
WeeklyXRDSLStks = 43, WeeklyXRDSLStks = 43,
WeeklyXRDXRR = 44, WeeklyXRDXRR = 44,
XRDWeightedAverage = 31, XRDWeightedAverage = 31,
JVXRD = 47, XRDXY = 30,
XRDXY = 30
}
} }

View File

@ -0,0 +1,49 @@
using Adaptation._Tests.Shared;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;
using System.IO;
namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_43_0;
[TestClass]
public class EC : EAFLoggingUnitTesting
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
internal static EC EAFLoggingUnitTesting { get; private set; }
public EC() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
{
if (EAFLoggingUnitTesting is null)
throw new Exception();
}
public EC(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
{
}
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
if (EAFLoggingUnitTesting is null)
EAFLoggingUnitTesting = new EC(testContext);
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
}
[ClassCleanup()]
public static void ClassCleanup()
{
if (EAFLoggingUnitTesting.Logger is not null)
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
if (EAFLoggingUnitTesting is not null)
EAFLoggingUnitTesting.Dispose();
}
}

View File

@ -0,0 +1,21 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Adaptation._Tests.Extract.Staging.v2_43_0;
[TestClass]
public class EC
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
private static CreateSelfDescription.Staging.v2_43_0.EC _EC;
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
CreateSelfDescription.Staging.v2_43_0.EC.ClassInitialize(testContext);
_EC = CreateSelfDescription.Staging.v2_43_0.EC.EAFLoggingUnitTesting;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace Adaptation._Tests.Shared;
public class EAFLoggingUnitTesting : LoggingUnitTesting, IDisposable
{
protected readonly AdaptationTesting _AdaptationTesting;
public AdaptationTesting AdaptationTesting => _AdaptationTesting;
public EAFLoggingUnitTesting(TestContext testContext, Type declaringType, bool skipEquipmentDictionary) :
base(testContext, declaringType)
{
if (testContext is null || declaringType is null)
_AdaptationTesting = null;
else
_AdaptationTesting = new AdaptationTesting(testContext, skipEquipmentDictionary);
}
public new void Dispose()
{
base.Dispose();
GC.SuppressFinalize(this);
}
}

View File

@ -0,0 +1,168 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Adaptation._Tests.Shared;
public class IsEnvironment
{
public enum Name
{
LinuxDevelopment,
LinuxProduction,
LinuxStaging,
OSXDevelopment,
OSXProduction,
OSXStaging,
WindowsDevelopment,
WindowsProduction,
WindowsStaging
}
public bool DebuggerWasAttachedDuringConstructor { get; private set; }
public bool Development { get; private set; }
public bool Linux { get; private set; }
public bool OSX { get; private set; }
public bool Production { get; private set; }
public bool Staging { get; private set; }
public bool Windows { get; private set; }
public string Profile { get; private set; }
public string AppSettingsFileName { get; private set; }
public string ASPNetCoreEnvironment { get; private set; }
public IsEnvironment(string testCategory)
{
if (testCategory.EndsWith(".json"))
{
Production = testCategory == "appsettings.json";
Staging = testCategory.EndsWith(nameof(Staging));
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
Development = testCategory.EndsWith(nameof(Development));
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
}
else
{
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
OSX = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(OSX));
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
Linux = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Linux));
Staging = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Staging));
Windows = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Windows));
Production = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Production));
Development = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Development));
}
Profile = GetProfile();
AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
}
public IsEnvironment(bool isDevelopment, bool isStaging, bool isProduction)
{
Staging = isStaging;
Production = isProduction;
Development = isDevelopment;
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
Profile = GetProfile();
AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
}
public IsEnvironment(int? processesCount, bool nullASPNetCoreEnvironmentIsDevelopment, bool nullASPNetCoreEnvironmentIsProduction)
{
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
if (nullASPNetCoreEnvironmentIsDevelopment && nullASPNetCoreEnvironmentIsProduction)
throw new Exception();
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsProduction)
Production = true;
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsDevelopment)
Development = true;
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && !nullASPNetCoreEnvironmentIsDevelopment && !nullASPNetCoreEnvironmentIsProduction)
throw new Exception();
else
{
Staging = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Staging));
Production = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Production));
Development = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Development));
}
Profile = GetProfile();
AppSettingsFileName = GetAppSettingsFileName(processesCount);
}
private string GetProfile()
{
string result;
if (Windows && Production)
result = nameof(Production);
else if (Windows && Staging)
result = nameof(Staging);
else if (Windows && Development)
result = nameof(Development);
else if (Linux && Production)
result = nameof(Name.LinuxProduction);
else if (Linux && Staging)
result = nameof(Name.LinuxStaging);
else if (Linux && Development)
result = nameof(Name.LinuxDevelopment);
else if (OSX && Production)
result = nameof(Name.OSXProduction);
else if (OSX && Staging)
result = nameof(Name.OSXStaging);
else if (OSX && Development)
result = nameof(Name.OSXDevelopment);
else
throw new Exception();
return result;
}
private string GetAppSettingsFileName(int? processesCount)
{
string result;
if (Production)
{
if (processesCount is null)
result = "appsettings.json";
else
result = $"appsettings.{processesCount}.json";
}
else
{
string environment;
if (Staging)
environment = nameof(Staging);
else if (Development)
environment = nameof(Development);
else
throw new Exception();
if (processesCount is null)
result = $"appsettings.{environment}.json";
else
result = $"appsettings.{environment}.{processesCount}.json";
}
return result;
}
public static string GetEnvironmentName(IsEnvironment isEnvironment)
{
string result;
if (isEnvironment.Windows)
result = nameof(Windows);
else if (isEnvironment.Linux)
result = nameof(Linux);
else if (isEnvironment.OSX)
result = nameof(OSX);
else
throw new Exception();
return result;
}
}

View File

@ -0,0 +1,36 @@
using Microsoft.Extensions.Logging;
using System;
namespace Adaptation._Tests.Shared.Log;
public class ConsoleLogger : ILogger
{
public int EventId { get; set; }
private readonly string _Name;
private readonly LogLevel _LogLevel;
public ConsoleLogger(LogLevel logLevel, string name)
{
_Name = name;
EventId = 0;
_LogLevel = logLevel;
if (string.IsNullOrEmpty(_Name))
{ }
}
public IDisposable BeginScope<TState>(TState state) => null;
public bool IsEnabled(LogLevel logLevel) => logLevel >= _LogLevel;
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
{
if (IsEnabled(logLevel) && (EventId == 0 || EventId == eventId.Id))
{
string message = formatter(state, null);
Console.WriteLine(message);
}
}
}

View File

@ -0,0 +1,27 @@
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Concurrent;
namespace Adaptation._Tests.Shared.Log;
public class ConsoleProvider : ILoggerProvider
{
private readonly LogLevel _LogLevel;
private readonly ConcurrentDictionary<string, ConsoleLogger> _Loggers;
public ConsoleProvider(LogLevel logLevel)
{
_LogLevel = logLevel;
_Loggers = new ConcurrentDictionary<string, ConsoleLogger>();
}
public ILogger CreateLogger(string categoryName) => _Loggers.GetOrAdd(categoryName, name => new ConsoleLogger(_LogLevel, name));
public void Dispose()
{
_Loggers.Clear();
GC.SuppressFinalize(this);
}
}

View File

@ -0,0 +1,36 @@
using Microsoft.Extensions.Logging;
using System;
namespace Adaptation._Tests.Shared.Log;
public class DebugLogger : ILogger
{
public int EventId { get; set; }
private readonly string _Name;
private readonly LogLevel _LogLevel;
public DebugLogger(LogLevel logLevel, string name)
{
_Name = name;
EventId = 0;
_LogLevel = logLevel;
if (string.IsNullOrEmpty(_Name))
{ }
}
public IDisposable BeginScope<TState>(TState state) => null;
public bool IsEnabled(LogLevel logLevel) => logLevel >= _LogLevel;
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
{
if (IsEnabled(logLevel) && (EventId == 0 || EventId == eventId.Id))
{
string message = formatter(state, null);
System.Diagnostics.Debug.Print(message);
}
}
}

View File

@ -0,0 +1,27 @@
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Concurrent;
namespace Adaptation._Tests.Shared.Log;
public class DebugProvider : ILoggerProvider
{
private readonly LogLevel _LogLevel;
private readonly ConcurrentDictionary<string, DebugLogger> _Loggers;
public DebugProvider(LogLevel logLevel)
{
_LogLevel = logLevel;
_Loggers = new ConcurrentDictionary<string, DebugLogger>();
}
public ILogger CreateLogger(string categoryName) => _Loggers.GetOrAdd(categoryName, name => new DebugLogger(_LogLevel, name));
public void Dispose()
{
_Loggers.Clear();
GC.SuppressFinalize(this);
}
}

View File

@ -0,0 +1,49 @@
using Microsoft.Extensions.Logging;
using System;
namespace Adaptation._Tests.Shared.Log;
public class FeedbackLogger : ILogger
{
public int EventId { get; set; }
private readonly string _Name;
private readonly LogLevel _LogLevel;
private readonly IFeedback _Feedback;
public FeedbackLogger(LogLevel logLevel, IFeedback feedback, string name)
{
_Feedback = feedback;
_Name = name;
EventId = 0;
_LogLevel = logLevel;
if (string.IsNullOrEmpty(_Name))
{ }
}
public IDisposable BeginScope<TState>(TState state) => null;
public bool IsEnabled(LogLevel logLevel) => logLevel >= _LogLevel;
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
{
if (IsEnabled(logLevel) && (EventId == 0 || EventId == eventId.Id))
{
string message = formatter(state, null);
int color = logLevel switch
{
LogLevel.Trace => -1,
LogLevel.Debug => -1,
LogLevel.Information => -16776961,
LogLevel.Warning => -65281,
LogLevel.Error => -65536,
LogLevel.Critical => -65536,
LogLevel.None => -1,
_ => throw new Exception(),
};
_Feedback.Print(message, color);
}
}
}

View File

@ -0,0 +1,29 @@
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Concurrent;
namespace Adaptation._Tests.Shared.Log;
public class FeedbackProvider : ILoggerProvider
{
private readonly LogLevel _LogLevel;
private readonly IFeedback _Feedback;
private readonly ConcurrentDictionary<string, FeedbackLogger> _Loggers;
public FeedbackProvider(LogLevel logLevel, IFeedback feedback)
{
_LogLevel = logLevel;
_Feedback = feedback;
_Loggers = new ConcurrentDictionary<string, FeedbackLogger>();
}
public ILogger CreateLogger(string categoryName) => _Loggers.GetOrAdd(categoryName, name => new FeedbackLogger(_LogLevel, _Feedback, name));
public void Dispose()
{
_Loggers.Clear();
GC.SuppressFinalize(this);
}
}

View File

@ -0,0 +1,11 @@
using System.Collections.Generic;
namespace Adaptation._Tests.Shared.Log;
public interface IFeedback
{
List<string> Messages { get; }
void Print(string message, int color);
}

View File

@ -0,0 +1,139 @@
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.IO;
namespace Adaptation._Tests.Shared.Log;
public class Log
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
private readonly ILogger _Logger;
public Log(ILogger logger) => _Logger = logger;
public void Black(object message) => _Logger.LogInformation(message.ToString());
public void Blue(object message) => _Logger.LogInformation(message.ToString());
public void Gray(object message) => _Logger.LogInformation(message.ToString());
public void Green(object message) => _Logger.LogInformation(message.ToString());
public void Magenta(string message, Exception exception) => _Logger.LogWarning(message, exception);
public void Red(string message, Exception exception) => _Logger.LogError(message, exception);
public void White(object message) => _Logger.LogInformation(message.ToString());
public void Yellow(string message, Exception exception) => _Logger.LogWarning(message, exception);
//
public void DoLog(LogLevel logLevel, EventId eventId, Exception exception, string message, params object[] args) => _Logger.Log(logLevel, eventId, exception, message, args);
public void DoLog(LogLevel logLevel, EventId eventId, string message, params object[] args) => _Logger.Log(logLevel, eventId, message, args);
public void DoLog(LogLevel logLevel, Exception exception, string message, params object[] args) => _Logger.Log(logLevel, exception, message, args);
public void DoLog(LogLevel logLevel, string message, params object[] args) => _Logger.Log(logLevel, message, args);
public void LogCritical(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogCritical(eventId, exception, message, args);
public void LogCritical(EventId eventId, string message, params object[] args) => _Logger.LogCritical(eventId, message, args);
public void LogCritical(Exception exception, string message, params object[] args) => _Logger.LogCritical(exception, message, args);
public void LogCritical(string message, params object[] args) => _Logger.LogCritical(message, args);
public void LogDebug(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogDebug(eventId, exception, message, args);
public void LogDebug(EventId eventId, string message, params object[] args) => _Logger.LogDebug(eventId, message, args);
public void LogDebug(Exception exception, string message, params object[] args) => _Logger.LogDebug(exception, message, args);
public void LogDebug(string message, params object[] args) => _Logger.LogDebug(message, args);
public void LogError(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogError(eventId, exception, message, args);
public void LogError(EventId eventId, string message, params object[] args) => _Logger.LogError(eventId, message, args);
public void LogError(Exception exception, string message, params object[] args) => _Logger.LogError(message, args);
public void LogError(string message, params object[] args) => _Logger.LogError(message, args);
public void LogInformation(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogInformation(eventId, exception, message, args);
public void LogInformation(EventId eventId, string message, params object[] args) => _Logger.LogInformation(eventId, message, args);
public void LogInformation(Exception exception, string message, params object[] args) => _Logger.LogInformation(exception, message, args);
public void LogInformation(string message, params object[] args) => _Logger.LogInformation(message, args);
public void LogTrace(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogTrace(eventId, exception, message, args);
public void LogTrace(EventId eventId, string message, params object[] args) => _Logger.LogTrace(eventId, message, args);
public void LogTrace(Exception exception, string message, params object[] args) => _Logger.LogTrace(exception, message, args);
public void LogTrace(string message, params object[] args) => _Logger.LogTrace(message, args);
public void LogWarning(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogWarning(eventId, exception, message, args);
public void LogWarning(EventId eventId, string message, params object[] args) => _Logger.LogWarning(eventId, message, args);
public void LogWarning(Exception exception, string message, params object[] args) => _Logger.LogWarning(exception, message, args);
public void LogWarning(string message, params object[] args) => _Logger.LogWarning(message, args);
//
public void Debug() => _Logger.LogDebug(string.Empty);
public void Debug(object message) => _Logger.LogDebug(message.ToString());
public void Debug(string message, Exception exception) => _Logger.LogDebug(exception, message);
public void DebugFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogDebug(string.Format(provider, format, args));
public void DebugFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogDebug(string.Format(format, arg0, arg1, arg2));
public void DebugFormat(string format, object arg0, object arg1) => _Logger.LogDebug(string.Format(format, arg0, arg1));
public void DebugFormat(string format, object arg0) => _Logger.LogDebug(string.Format(format, arg0));
public void DebugFormat(string format, params object[] args) => _Logger.LogDebug(string.Format(format, args));
public void Error(object message) => _Logger.LogError(message.ToString());
public void Error(string message, Exception exception) => _Logger.LogError(exception, message.ToString());
public void ErrorFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogError(string.Format(provider, format, args));
public void ErrorFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogError(string.Format(format, arg0, arg1, arg2));
public void ErrorFormat(string format, object arg0, object arg1) => _Logger.LogError(string.Format(format, arg0, arg1));
public void ErrorFormat(string format, object arg0) => _Logger.LogError(string.Format(format, arg0));
public void ErrorFormat(string format, params object[] args) => _Logger.LogError(string.Format(format, args));
public void Fatal(object message) => _Logger.LogCritical(message.ToString());
public void Fatal(string message, Exception exception) => _Logger.LogCritical(exception, message.ToString());
public void FatalFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogCritical(string.Format(provider, format, args));
public void FatalFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogCritical(string.Format(format, arg0, arg1, arg2));
public void FatalFormat(string format, object arg0, object arg1) => _Logger.LogCritical(string.Format(format, arg0, arg1));
public void FatalFormat(string format, object arg0) => _Logger.LogCritical(string.Format(format, arg0));
public void FatalFormat(string format, params object[] args) => _Logger.LogCritical(string.Format(format, args));
public void Info(object message) => _Logger.LogInformation(message.ToString());
public void Info(string message, Exception exception) => _Logger.LogInformation(exception, message.ToString());
public void InfoFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogInformation(string.Format(provider, format, args));
public void InfoFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogInformation(string.Format(format, arg0, arg1, arg2));
public void InfoFormat(string format, object arg0, object arg1) => _Logger.LogInformation(string.Format(format, arg0, arg1));
public void InfoFormat(string format, object arg0) => _Logger.LogInformation(string.Format(format, arg0));
public void InfoFormat(string format, params object[] args) => _Logger.LogInformation(string.Format(format, args));
public void Warn(object message) => _Logger.LogWarning(message.ToString());
public void Warn(string message, Exception exception) => _Logger.LogWarning(exception, message.ToString());
public void WarnFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogWarning(string.Format(provider, format, args));
public void WarnFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogWarning(string.Format(format, arg0, arg1, arg2));
public void WarnFormat(string format, object arg0, object arg1) => _Logger.LogWarning(string.Format(format, arg0, arg1));
public void WarnFormat(string format, object arg0) => _Logger.LogWarning(string.Format(format, arg0));
public void WarnFormat(string format, params object[] args) => _Logger.LogWarning(string.Format(format, args));
public static string GetWorkingDirectory(string executingAssemblyName, string subDirectoryName)
{
string result = string.Empty;
string traceFile;
List<string> directories = new();
Environment.SpecialFolder[] specialFolders = new Environment.SpecialFolder[]
{
Environment.SpecialFolder.LocalApplicationData,
Environment.SpecialFolder.ApplicationData,
Environment.SpecialFolder.History,
Environment.SpecialFolder.CommonApplicationData,
Environment.SpecialFolder.InternetCache
};
foreach (Environment.SpecialFolder specialFolder in specialFolders)
directories.Add(Path.Combine(Environment.GetFolderPath(specialFolder), subDirectoryName, executingAssemblyName));
foreach (string directory in directories)
{
for (int i = 1; i < 3; i++)
{
if (i == 1)
result = directory;
else
result = string.Concat("D", directory[1..]);
try
{
if (!Directory.Exists(result))
_ = Directory.CreateDirectory(result);
traceFile = string.Concat(result, @"\", DateTime.Now.Ticks, ".txt");
File.WriteAllText(traceFile, traceFile);
File.Delete(traceFile);
break;
}
catch (Exception) { result = string.Empty; }
}
if (!string.IsNullOrEmpty(result))
break;
}
if (string.IsNullOrEmpty(result))
throw new Exception("Unable to set working directory!");
return result;
}
}

View File

@ -0,0 +1,112 @@
using Adaptation._Tests.Shared.Log;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.IO;
namespace Adaptation._Tests.Shared;
public class LoggingUnitTesting : UnitTesting, IDisposable
{
protected ILogger<object> _Logger;
protected ILoggerFactory _LoggerFactory;
protected readonly LogLevel? _DefaultLogLevel;
protected readonly LogLevel? _Log4netProviderLogLevel;
protected readonly IConfigurationRoot _ConfigurationRoot;
public ILogger<object> Logger => _Logger;
public LogLevel? DefaultLogLevel => _DefaultLogLevel;
public ILoggerFactory LoggerFactory => _LoggerFactory;
public IConfigurationRoot ConfigurationRoot => _ConfigurationRoot;
public LogLevel? Log4netProviderLogLevel => _Log4netProviderLogLevel;
public LoggingUnitTesting(TestContext testContext, Type declaringType) :
base(testContext, declaringType)
{
_LoggerFactory = new LoggerFactory();
if (testContext is null || declaringType is null)
{
_ConfigurationRoot = null;
_DefaultLogLevel = null;
_Log4netProviderLogLevel = null;
}
else
{
LogLevel logLevel;
IConfigurationSection configurationSection;
List<LogLevel> logLevels = new();
string defaultLogLevelSection = "Logging:LogLevel:Default";
string log4netProviderLogLevelSection = "Logging:LogLevel:Log4netProvider";
string[] sections = new string[] { defaultLogLevelSection, log4netProviderLogLevelSection };
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
.AddEnvironmentVariables()
.AddJsonFile(_IsEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true);
_ConfigurationRoot = configurationBuilder.Build();
foreach (string section in sections)
{
configurationSection = _ConfigurationRoot.GetSection(section);
if (configurationSection is null)
logLevel = LogLevel.Debug;
else if (!Enum.TryParse(configurationSection.Value, out logLevel))
logLevel = LogLevel.Debug;
logLevels.Add(logLevel);
}
_DefaultLogLevel = logLevels[0];
_Log4netProviderLogLevel = logLevels[1];
}
if (DefaultLogLevel.HasValue)
_LoggerFactory.AddProvider(new DebugProvider(DefaultLogLevel.Value));
if (DefaultLogLevel.HasValue)
_LoggerFactory.AddProvider(new ConsoleProvider(DefaultLogLevel.Value));
_Logger = _LoggerFactory.CreateLogger<object>();
}
public static string GetEnvironmentSpecialDirectory()
{
string result = string.Empty;
string traceFile;
List<string> directories = new();
Environment.SpecialFolder[] specialFolders = new Environment.SpecialFolder[]
{
Environment.SpecialFolder.LocalApplicationData,
Environment.SpecialFolder.ApplicationData,
Environment.SpecialFolder.History,
Environment.SpecialFolder.CommonApplicationData,
Environment.SpecialFolder.InternetCache
};
foreach (Environment.SpecialFolder specialFolder in specialFolders)
directories.Add(Environment.GetFolderPath(specialFolder));
foreach (string directory in directories)
{
for (int i = 1; i < 3; i++)
{
if (i == 1)
result = directory;
else
result = string.Concat("D", directory.Substring(1));
try
{
if (!Directory.Exists(result))
_ = Directory.CreateDirectory(result);
traceFile = string.Concat(result, @"\", DateTime.Now.Ticks, ".txt");
File.WriteAllText(traceFile, traceFile);
File.Delete(traceFile);
break;
}
catch (Exception) { result = string.Empty; }
}
if (!string.IsNullOrEmpty(result))
break;
}
return result;
}
public void Dispose()
{
_LoggerFactory.Dispose();
GC.SuppressFinalize(this);
}
}

Some files were not shown because too many files have changed in this diff Show More