net6.0 Ready to test

This commit is contained in:
Mike Phares 2022-05-09 16:48:57 -07:00
parent 053c873d6b
commit 6c8ad46064
171 changed files with 6547 additions and 48515 deletions

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]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
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_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
csharp_new_line_before_catch = true
csharp_new_line_before_else = 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_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# Space preferences
csharp_prefer_braces = false
csharp_prefer_simple_default_expression = true:warning
csharp_prefer_simple_using_statement = true:warning
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
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
@ -171,166 +41,202 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = warning
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.severity = warning
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.symbols = private_or_internal_field
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.style = private_of_internal_field
dotnet_naming_rule.enum_should_be_pascal_case.severity = warning
dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum
dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case
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.symbols = public_or_protected_field
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.style = private_of_internal_field
dotnet_naming_rule.class_should_be_pascal_case.severity = warning
dotnet_naming_rule.class_should_be_pascal_case.symbols = class
dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.method_should_be_pascal_case.severity = warning
dotnet_naming_rule.method_should_be_pascal_case.symbols = method
dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.severity = warning
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.symbols = private_or_internal_static_field
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field
dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning
dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field
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
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
csharp_style_conditional_delegate_call = true
csharp_style_deconstructed_variable_declaration = false
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
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
csharp_style_inlined_variable_declaration = false
csharp_style_namespace_declarations = file_scoped:warning
csharp_style_pattern_local_over_anonymous_function = true:warning
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_index_operator = true:warning
csharp_style_prefer_not_pattern = true:warning
csharp_style_prefer_null_check_over_type_check = true
csharp_style_prefer_pattern_matching = true:warning
csharp_style_prefer_range_operator = true:warning
csharp_style_prefer_switch_expression = true: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
csharp_style_var_elsewhere = false:warning
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = false:warning
csharp_using_directive_placement = outside_namespace
dotnet_code_quality_unused_parameters = all
dotnet_code_quality_unused_parameters = non_public # IDE0060: Remove unused parameter
dotnet_code_quality.CAXXXX.api_surface = private, internal
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_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
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 using System.Text;
dotnet_diagnostic.IDE0060.severity = warning # IDE0060: Remove unused parameter
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.private_method_should_be_pascal_case.severity = warning
dotnet_naming_rule.private_method_should_be_pascal_case.symbols = private_method
dotnet_naming_rule.private_method_should_be_pascal_case.style = pascal_case
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.abstract_method_should_be_pascal_case.symbols = abstract_method
dotnet_naming_rule.class_should_be_pascal_case.severity = warning
dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.class_should_be_pascal_case.symbols = class
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.struct_should_be_pascal_case.severity = warning
dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct
dotnet_naming_rule.struct_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.delegate_should_be_pascal_case.symbols = delegate
dotnet_naming_rule.enum_should_be_pascal_case.severity = warning
dotnet_naming_rule.enum_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.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# Symbol specifications
dotnet_naming_symbols.class.applicable_kinds = class
dotnet_naming_symbols.class.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.class.required_modifiers =
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.struct.applicable_kinds = struct
dotnet_naming_symbols.struct.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.struct.required_modifiers =
dotnet_naming_symbols.enum.applicable_kinds = enum
dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.enum.required_modifiers =
dotnet_naming_symbols.delegate.applicable_kinds = delegate
dotnet_naming_symbols.delegate.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.delegate.required_modifiers =
dotnet_naming_symbols.event.applicable_kinds = event
dotnet_naming_symbols.event.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.event.required_modifiers =
dotnet_naming_symbols.method.applicable_kinds = method
dotnet_naming_symbols.method.applicable_accessibilities = public
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_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
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_rule.private_method_should_be_pascal_case.symbols = private_method
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.severity = warning
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_rule.private_or_internal_static_field_should_be_private_of_internal_field.severity = warning
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field
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_rule.property_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.property_should_be_pascal_case.symbols = property
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_rule.public_or_protected_field_should_be_private_of_internal_field.symbols = public_or_protected_field
dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning
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_rule.static_method_should_be_pascal_case.severity = warning
dotnet_naming_rule.static_method_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.static_method_should_be_pascal_case.symbols = static_method
dotnet_naming_rule.struct_should_be_pascal_case.severity = warning
dotnet_naming_rule.struct_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct
dotnet_naming_rule.types_should_be_pascal_case.severity = warning
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
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_suffix =
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

267
.groovy Normal file
View File

@ -0,0 +1,267 @@
#!/usr/bin/env groovy
/* groovylint-disable CompileStatic, ConsecutiveStringConcatenation, DuplicateNumberLiteral, DuplicateStringLiteral, LineLength, NestedBlockDepth, NoDef, VariableTypeRequired */
import groovy.transform.Field
@Field String _DDrive = 'D:/'
@Field String _ExePath = '...'
@Field String _NGINXFile = '...'
@Field String _PortNumber = '...'
@Field String _AssemblyName = '...'
@Field String _NetVersion = 'net6.0'
@Field String _TargetLocation = '...'
@Field String _GitCommitSeven = '...'
@Field String _GitName = 'EDA-Viewer'
@Field String _FirstBeforePlus = '5000'
@Field String _MonARessource = 'EDA_Viewer'
@Field String _ProjectDirectory = 'EDA Viewer'
@Field String _WorkingDirectoryName = 'IFXApps'
@Field String _AgentStaging = 'mestsa07ec-ecmeseaf'
@Field String _AgentProduction = 'messa08ec-ecmeseaf'
@Field String _DDriveNet = "${_DDrive}${_NetVersion}"
@Field String _CredentialsId = 'EDA-Username-Password'
@Field String _AgentDevelopment = 'mestsa003-mesedasvc'
@Field String _Company = 'Infineon Technologies Americas Corp.'
@Field String _ProgramFilesDotnet = 'C:/program files/dotnet/dotnet.exe'
pipeline {
agent {
label env.JENKINS_ENVIRONMENT == 'Development' ? _AgentDevelopment : env.JENKINS_ENVIRONMENT == 'Staging' ? _AgentStaging : env.JENKINS_ENVIRONMENT == 'Production' ? _AgentProduction : 'Else'
}
parameters {
string(name: 'MONA_SUFFIX', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? '_IFX' : '_EC', description: 'MonA Suffix')
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)
dir(_ProjectDirectory) {
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}"
withCredentials([usernamePassword(credentialsId: _CredentialsId, passwordVariable: 'password', usernameVariable: 'username')]) {
dir("C:/Users/${username}/AppData/Local/IFXApps/nginx-1.20.1/conf/includes") {
_NGINXFile = "C:/Users/${username}/AppData/Local/IFXApps/nginx-1.20.1/conf/includes/${_AssemblyName}.conf"
def files = findFiles(glob: "${_AssemblyName}.conf")
if (files.length != 1) {
writeFile(file: _NGINXFile, text: "location / { proxy_pass http://localhost:${_FirstBeforePlus}; }")
}
}
}
}
}
}
stage('Read NGINX') {
steps {
script {
String text = readFile(file: _NGINXFile)
String check = text == null ? _FirstBeforePlus : text.split(';')[0]
String[] segments = check.split(':')
if (segments.length != 3) {
_PortNumber = check
}
else {
_PortNumber = (segments[2].toInteger() + 2).toString()
}
_ExePath = "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${_PortNumber}-${env.JOB_NAME}/${_AssemblyName}.exe"
}
}
}
stage('Info') {
steps {
// echo "GIT_URL_N - ${env.GIT_URL_N}"
// echo "BRANCH_NAME ${env.BRANCH_NAME}"
// echo "DEPLOY_VERSION ${env.DEPLOY_VERSION}"
// echo "GIT_AUTHOR_NAME ${env.GIT_AUTHOR_NAME}"
// echo "GIT_LOCAL_BRANCH ${env.GIT_LOCAL_BRANCH}"
// echo "GIT_COMMITTER_EMAIL ${env.GIT_COMMITTER_EMAIL}"
// echo "GIT_PREVIOUS_COMMIT ${env.GIT_PREVIOUS_COMMIT}"
// echo "GIT_PREVIOUS_SUCCESSFUL_COMMIT ${env.GIT_PREVIOUS_SUCCESSFUL_COMMIT}"
echo "_AssemblyName ${_AssemblyName}" // ...
echo "_ExePath ${_ExePath}" // ...
echo "_PortNumber ${_PortNumber}" // ...
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 {
withCredentials([usernamePassword(credentialsId: _CredentialsId, passwordVariable: 'password', usernameVariable: 'username')]) {
dir(_ProjectDirectory) {
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets init')
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets set "Company" "' + _Company + '"')
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets set "ServiceUser" "' + username + '"')
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 + '"')
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets set "URLs" "' + 'http://localhost:' + _PortNumber)
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets set "WorkingDirectoryName" "' + _WorkingDirectoryName + '"')
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'user-secrets set "MonARessource" "' + _MonARessource + env.MONA_SUFFIX + '"')
}
}
}
}
// stage('Core Build (packagemanagement.eu.infineon.com)') {
// steps {
// echo "Build number is ${currentBuild.number}"
// dir(_ProjectDirectory) {
// bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
// 'build --runtime win-x64 --self-contained --verbosity quiet --source ' +
// 'https://packagemanagement.eu.infineon.com:4430/api/v2/')
// }
// }
// }
stage('Core Build') {
steps {
echo "Build number is ${currentBuild.number}"
dir(_ProjectDirectory) {
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'build --runtime win-x64 --self-contained --verbosity quiet')
}
}
}
stage('Commit Id') {
steps {
dir(_ProjectDirectory) {
writeFile(file: 'bin/Debug/' + _NetVersion + "/win-x64/${env.GIT_COMMIT}-${env.BUILD_NUMBER}.txt", text: "${env.GIT_URL}")
}
}
}
// stage('Test') {
// options {
// timeout(time: 10, unit: 'MINUTES')
// }
// steps {
// dir(_ProjectDirectory) {
// bat('dotnet --info')
// }
// }
// }
// stage('Version') {
// steps {
// bat('dotnet --info')
// }
// }
stage('Package') {
steps {
dir(_ProjectDirectory) {
fileOperations([fileZipOperation(folderPath: 'bin/Debug/' + _NetVersion + '/win-x64', outputFolderPath: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${_PortNumber}-${env.JOB_NAME}-Debug")])
fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*", renameFiles: false, sourceCaptureExpression: '', targetLocation: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${_PortNumber}-${env.JOB_NAME}-Debug", targetNameExpression: '')])
}
}
}
stage('Publish') {
steps {
dir(_ProjectDirectory) {
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'remove reference "../Client/' + env.JOB_NAME + '.Client.csproj"')
bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
'publish --configuration Release --runtime win-x64 --verbosity quiet ' +
"--self-contained true --p:Version=6.0.202-${_GitCommitSeven}-${env.BUILD_NUMBER} -o " +
'"' + "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${_PortNumber}-${env.JOB_NAME}" + '"')
}
}
}
stage('Service') {
steps {
withCredentials([usernamePassword(credentialsId: _CredentialsId, passwordVariable: 'password', usernameVariable: 'username')]) {
bat(returnStatus: true, script: 'sc create "' + "${env.JOB_NAME}-${_PortNumber}" + '" ' +
'start= delayed-auto DisplayName="' + "${env.JOB_NAME}-${_PortNumber}" + '" ' +
'binPath= "' + _ExePath + '" ' +
'obj= "' + "${env.USERDOMAIN}\\${username}" + '" password= "' + password + '"')
bat(returnStatus: true, script: 'sc start "' + "${env.JOB_NAME}-${_PortNumber}" + '"')
}
}
}
stage('Upadate NGINX') {
steps {
writeFile(file: _NGINXFile, text: "location / { proxy_pass http://localhost:${_PortNumber}; }")
}
}
stage('NGINX Test and Reload') {
steps {
withCredentials([usernamePassword(credentialsId: _CredentialsId, passwordVariable: 'password', usernameVariable: 'username')]) {
dir("C:/Users/${username}/AppData/Local/IFXApps/nginx-1.20.1") {
script {
int returnStatus = bat(returnStatus: true, script: 'nginx.exe -t')
println("returnStatus ################ ${returnStatus} ####################")
if (returnStatus == 0) {
bat(returnStatus: true, script: 'nginx.exe -s reload')
}
}
}
}
}
}
// stage('Force Fail') {
// steps {
// error("Build failed because of this and that..")
// }
// }
// stage('Copy Files to: file-share') {
// steps {
// dir(_ProjectDirectory + '/bin/Debug/' + _NetVersion + '/win-x64') {
// 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(_ProjectDirectory + '/bin') {
deleteDir()
}
dir(_ProjectDirectory + '/obj') {
deleteDir()
}
// cleanWs()
}
}
}

20
EDA Viewer/.vscode/format-report.json vendored Normal file
View File

@ -0,0 +1,20 @@
[
{
"DocumentId": {
"ProjectId": {
"Id": "1c39e10e-5359-42ab-be77-db59c291586c"
},
"Id": "81852d1e-25b8-4230-9e00-0399608db1e6"
},
"FileName": "Background.cshtml.cs",
"FilePath": "G:\\Mesa_FI\\EDA-Viewer\\EDA Viewer\\Pages\\Background.cshtml.cs",
"FileChanges": [
{
"LineNumber": 1,
"CharNumber": 1,
"DiagnosticId": "IMPORTS",
"FormatDescription": "Fix imports ordering."
}
]
}
]

33
EDA Viewer/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,33 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net6.0/win-x64/EDA Viewer.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

41
EDA Viewer/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/EDA Viewer.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/EDA Viewer.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/EDA Viewer.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

View File

@ -1,16 +0,0 @@
<h3>Counter</h3>
<p>
Current Count: @i
</p>
<button @onclick="IncrementCounter" class="btn btn-primary">Click Me</button>
@code {
int i = 0;
private void IncrementCounter()
{
i += 1;
}
}

View File

@ -1,167 +0,0 @@
using EDAViewer.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.Extensions.Logging;
using Shared;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Web;
namespace EDAViewer.Controllers
{
public class HomeController : Controller, IHomeController
{
private readonly Log _Log;
private readonly AppSettings _AppSettings;
private readonly IsEnvironment _IsEnvironment;
private readonly Singleton.IBackground _Background;
public HomeController(ILogger<HomeController> logger, IsEnvironment isEnvironment, Singleton.IBackground background, AppSettings appSettings)
{
_Log = new Log(logger);
_Background = background;
_AppSettings = appSettings;
_IsEnvironment = isEnvironment;
}
public IActionResult Index()
{
return View();
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
public IActionResult Encode(string value = null)
{
string result = string.Empty;
if (!string.IsNullOrEmpty(value))
result = HttpUtility.UrlEncode(value);
return Content(result, "text/plain");
}
public IActionResult Background(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null, int? invoke_eda_dcp = null)
{
_Background.SendStatusOk();
if (message_clear.HasValue && message_clear.Value)
_Background.ClearMessage();
if (exceptions_clear.HasValue && exceptions_clear.Value)
_Background.Exceptions.Clear();
if (set_is_primary_instance.HasValue)
{
if (set_is_primary_instance.Value)
_Background.SetIsPrimaryInstance();
else
_Background.ClearIsPrimaryInstance();
}
string message;
if (string.IsNullOrWhiteSpace(_Background.Message))
message = "N/A";
else
message = _Background.Message;
//Response.AppendToLog(_Background.Message);
List<Exception> exceptions = new();
foreach (Exception exception in _Background.Exceptions)
exceptions.Add(exception);
ViewBag.Message = message;
ViewBag.Exceptions = exceptions;
ViewBag.URLs = _AppSettings.URLs;
ViewBag.Profile = _IsEnvironment.Profile;
ViewBag.WorkingDirectory = _Background.WorkingDirectory;
ViewBag.IsPrimaryInstance = _Background.IsPrimaryInstance();
ViewBag.ExceptionsCount = string.Concat("Exception(s) - ", exceptions.Count);
return View();
}
public ActionResult<IEnumerable<SelectListItem>> GetDirectoriesOrFiles(string path = null, bool? upDirectory = null, string filter = null)
{
List<SelectListItem> results = new();
//System.Threading.Thread.Sleep(1500);
//path = @"D:\Tmp";
if (string.IsNullOrEmpty(path))
path = string.Concat(@"\\", _AppSettings.Server, @"\EC_EDA");
if (string.IsNullOrEmpty(filter))
filter = "*";
if (upDirectory.HasValue && upDirectory.Value && path.Contains('|'))
{
string[] segments = path.Split('|');
path = segments[^1];
}
//System.IO.File.AppendAllText(string.Concat(@"\\", _AppSettings.Server, @"\EC_EDA\a.txt"), path);
string gold = "Gold";
if (System.IO.File.Exists(path))
{
string[] files = Directory.GetFiles(Path.GetDirectoryName(path), filter, SearchOption.TopDirectoryOnly);
foreach (string item in files)
results.Add(new SelectListItem() { Value = item, Text = Path.GetFileName(item), Group = new SelectListGroup() { Name = "File(s)" } });
if (results.Count > 1)
results.Insert(0, new SelectListItem() { Value = string.Empty, Text = string.Concat("Select - ", 0, " - ", files.Length) });
}
else if (Directory.Exists(path))
{
string[] files = Directory.GetFiles(path, filter, SearchOption.TopDirectoryOnly);
string[] directories = Directory.GetDirectories(path, filter, SearchOption.TopDirectoryOnly).Where(l => Path.GetFileName(l) != gold).ToArray();
for (short i = 0; i < short.MaxValue; i++)
{
if (directories.Length != 1 || files.Length != 0)
break;
else
{
path = directories[0];
files = Directory.GetFiles(path, filter, SearchOption.TopDirectoryOnly);
directories = Directory.GetDirectories(path, filter, SearchOption.TopDirectoryOnly).Where(l => Path.GetFileName(l) != gold).ToArray();
if (directories.Length == 0 && files.Length == 0)
{
directories = new string[] { path };
break;
}
}
}
foreach (string item in directories)
results.Add(new SelectListItem() { Value = item, Text = Path.GetFileName(item), Group = new SelectListGroup() { Name = "Directorie(s)" } });
foreach (string item in files)
results.Add(new SelectListItem() { Value = item, Text = Path.GetFileName(item), Group = new SelectListGroup() { Name = "File(s)" } });
if (results.Count > 1)
results.Insert(0, new SelectListItem() { Value = string.Empty, Text = string.Concat("Select - ", directories.Length, " - ", files.Length) });
}
//System.IO.File.AppendAllText(string.Concat(@"\\", _AppSettings.Server, @"\EC_EDA\b.txt"), results.Count.ToString());
if (!results.Any())
results.Add(new SelectListItem() { Value = path, Text = string.Concat("Nothing Found *{", path, "}") });
return results;
}
public IActionResult ViewEdaHtmlDiff(WithEnvironment withEnvironment = null)
{
if (withEnvironment is null)
withEnvironment = new WithEnvironment();
string path = string.Concat(@"\\", _AppSettings.Server, @"\EC_EDA");
if (!Directory.Exists(path))
path = @"C:\";
EdaHtmlDiff model = new(withEnvironment, path);
ViewBag.message = model.message;
return View(model);
}
}
}
// dotnet publish --configuration Release --runtime win-x64 --verbosity normal --self-contained true -o "L:\net5.0\EDAViewer"
// dotnet publish --configuration Release --runtime win-x64 --verbosity normal --self-contained true -o "D:\net5.0\EDAViewer"
// dotnet publish --configuration Release --runtime win-x64 --verbosity normal --self-contained true -o "D:\.jenkins\publish\manual-Mesa-0\EDAViewer"
//http://eaf-dev.mes.infineon.com:8080/job/Mesa/buildWithParameters?token=DotnetRules&projectName=EDA%20Viewer
//http://eaf-prod.mes.infineon.com:8080/job/Mesa/buildWithParameters?token=DotnetRules&projectName=EDA%20Viewer
//sc create EDAViewer_5003 binPath="D:\.jenkins\publish\manual-Mesa-0\EDAViewer\EDA Viewer.exe"

View File

@ -6,11 +6,16 @@
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<LangVersion>9.0</LangVersion>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>EDAViewer</RootNamespace>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
<UserSecretsId>d71a673c-be39-45b5-ae5f-4c22639be045</UserSecretsId>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
<RootNamespace>EDAViewer</RootNamespace>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
@ -26,24 +31,18 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Infineon.Monitoring.MonA" Version="2.0.0" />
<PackageReference Include="Log4net" Version="2.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.5" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.1.4" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\images\" />
<Folder Include="wwwroot\js\html5shiv\3.7.2\" />
<Folder Include="wwwroot\js\respond\1.4.2\" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.1" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.AspNetCore.Ingestion" Version="1.0.0-dev-00021" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<None Include="appsettings.json">

View File

@ -1,10 +0,0 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~P:EDAViewer.Models.WithEnvironment.message")]
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~P:EDAViewer.Models.WithEnvironment.now_ticks")]
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~P:EDAViewer.Models.WithEnvironment.user_name")]
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~P:EDAViewer.Models.WithEnvironment.machine_name")]

View File

@ -1,174 +1,171 @@
using EDAViewer.Models.Methods;
using EDAViewer.Models.Stateless;
using EDAViewer.Models.Stateless.Methods;
using EDAViewer.Singleton;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Shared;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using IFX.Shared;
using Serilog.Context;
namespace EDAViewer.HostedService
namespace EDAViewer.HostedService;
public class TimedHostedService : IHostedService, IDisposable
{
public class TimedHostedService : IHostedService, IDisposable
private readonly Timer _EDAOutputArchiveTimer;
private readonly Timer _LogPathCleanUpByWeekTimer;
private readonly Timer _EdaDataCollectionPlansTimer;
private readonly int _ExecutionCount;
private readonly Serilog.ILogger _Log;
private readonly IsEnvironment _IsEnvironment;
private readonly IBackground _BackgroundMethods;
private readonly Models.Properties.IBackground _Background;
public TimedHostedService(IsEnvironment isEnvironment, Background background)
{
_ExecutionCount = 0;
_Background = background;
_IsEnvironment = isEnvironment;
_BackgroundMethods = background;
_Log = Serilog.Log.ForContext<TimedHostedService>();
_EDAOutputArchiveTimer = new Timer(EDAOutputArchiveCallback, null, Timeout.Infinite, Timeout.Infinite);
_LogPathCleanUpByWeekTimer = new Timer(LogPathCleanUpByWeekCallback, null, Timeout.Infinite, Timeout.Infinite);
_EdaDataCollectionPlansTimer = new Timer(EdaDataCollectionPlansCallback, null, Timeout.Infinite, Timeout.Infinite);
}
private readonly int _ExecutionCount;
private readonly Background _Background;
private readonly IsEnvironment _IsEnvironment;
private readonly ILogger<TimedHostedService> _Log;
private Timer _EDAOutputArchiveTimer;
private Timer _LogPathCleanUpByWeekTimer;
private Timer _EdaDataCollectionPlansTimer;
public TimedHostedService(IsEnvironment isEnvironment, Background background, IServiceProvider serviceProvider)
public Task StartAsync(CancellationToken stoppingToken)
{
string? methodName = IMethodName.GetActualAsyncMethodName();
using (LogContext.PushProperty("MethodName", methodName))
{
_ExecutionCount = 0;
_Background = background;
_IsEnvironment = isEnvironment;
_Log = serviceProvider.GetRequiredService<ILogger<TimedHostedService>>();
_EDAOutputArchiveTimer = new Timer(EDAOutputArchiveCallback, null, Timeout.Infinite, Timeout.Infinite);
_LogPathCleanUpByWeekTimer = new Timer(LogPathCleanUpByWeekCallback, null, Timeout.Infinite, Timeout.Infinite);
_EdaDataCollectionPlansTimer = new Timer(EdaDataCollectionPlansCallback, null, Timeout.Infinite, Timeout.Infinite);
}
public Task StartAsync(CancellationToken stoppingToken)
{
_Log.LogInformation(string.Concat("Timed Hosted Service: ", nameof(Background), ":", _IsEnvironment.Profile, ":", Environment.ProcessId, " running."));
_Background.Update(_Log);
_Log.Info(string.Concat("Timed Hosted Service: ", _IsEnvironment.Profile, ":", Environment.ProcessId, " running."));
int milliSeconds = 3000;
if (_IsEnvironment.Development)
{
int milliSeconds = 3000;
_EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
;
_BackgroundMethods.Update(milliSeconds);
_ = _EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EdaDataCollectionPlansTimer);
milliSeconds += 2000;
}
else if (_IsEnvironment.Staging)
{
int milliSeconds = 3000;
_LogPathCleanUpByWeekTimer.Change(milliSeconds, Timeout.Infinite);
;
_Background.Timers.Add(_LogPathCleanUpByWeekTimer);
milliSeconds += 2000;
_EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
;
_BackgroundMethods.Update(milliSeconds);
_ = _EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EdaDataCollectionPlansTimer);
milliSeconds += 2000;
_EDAOutputArchiveTimer.Change(milliSeconds, Timeout.Infinite);
;
_ = _EDAOutputArchiveTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EDAOutputArchiveTimer);
milliSeconds += 2000;
_ = _LogPathCleanUpByWeekTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_LogPathCleanUpByWeekTimer);
milliSeconds += 2000;
}
else if (_IsEnvironment.Production)
{
int milliSeconds = 3000;
_LogPathCleanUpByWeekTimer.Change(milliSeconds, Timeout.Infinite);
;
_Background.Timers.Add(_LogPathCleanUpByWeekTimer);
milliSeconds += 2000;
_EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
;
_BackgroundMethods.Update(milliSeconds);
_ = _EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EdaDataCollectionPlansTimer);
milliSeconds += 2000;
_EDAOutputArchiveTimer.Change(milliSeconds, Timeout.Infinite);
;
_ = _EDAOutputArchiveTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EDAOutputArchiveTimer);
milliSeconds += 2000;
_ = _LogPathCleanUpByWeekTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_LogPathCleanUpByWeekTimer);
milliSeconds += 2000;
}
else
throw new Exception();
if (_IsEnvironment.Staging || _IsEnvironment.Production)
{
string countDirectory = _Background.GetCountDirectory("Start");
string checkDirectory = Path.GetPathRoot(countDirectory);
string countDirectory = _BackgroundMethods.GetCountDirectory("Start");
string? checkDirectory = Path.GetPathRoot(countDirectory);
if (Directory.Exists(checkDirectory))
Directory.CreateDirectory(countDirectory);
_ = Directory.CreateDirectory(countDirectory);
}
return Task.CompletedTask;
}
return Task.CompletedTask;
}
public Task StopAsync(CancellationToken stoppingToken)
public Task StopAsync(CancellationToken stoppingToken)
{
string? methodName = IMethodName.GetActualAsyncMethodName();
using (LogContext.PushProperty("MethodName", methodName))
{
_Log.LogInformation(string.Concat("Timed Hosted Service: ", nameof(Background), ":", _IsEnvironment.Profile, ":", Environment.ProcessId, " is stopping."));
_Background.Stop(immediate: true);
_Log.Info(string.Concat("Timed Hosted Service: ", _IsEnvironment.Profile, ":", Environment.ProcessId, " is stopping."));
_BackgroundMethods.Stop(immediate: true);
for (short i = 0; i < short.MaxValue; i++)
{
Thread.Sleep(500);
if (_ExecutionCount == 0)
break;
}
return Task.CompletedTask;
}
return Task.CompletedTask;
}
public void Dispose()
public void Dispose()
{
_BackgroundMethods.Dispose();
GC.SuppressFinalize(this);
}
private void LogPathCleanUpByWeekCallback(object? state)
{
try
{
_Background.Dispose();
if (!_BackgroundMethods.IsPrimaryInstance())
_BackgroundMethods.LogPathCleanUpByWeekCallback();
}
private void LogPathCleanUpByWeekCallback(object state)
catch (Exception e) { _Log.Error(e, "Error: "); }
try
{
try
{
if (_Background.IsPrimaryInstance())
_Background.LogPathCleanUpByWeekCallback();
}
catch (Exception e) { _Background.Catch(e); }
try
{
TimeSpan timeSpan;
if (!_Background.IsPrimaryInstance())
timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
else
timeSpan = new TimeSpan(DateTime.Now.AddHours(6).Ticks - DateTime.Now.Ticks);
_LogPathCleanUpByWeekTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
}
catch (Exception e) { _Background.Catch(e); }
TimeSpan timeSpan;
if (!_BackgroundMethods.IsPrimaryInstance())
timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
else
timeSpan = new TimeSpan(DateTime.Now.AddHours(6).Ticks - DateTime.Now.Ticks);
_ = _LogPathCleanUpByWeekTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
}
catch (Exception e) { _Log.Error(e, "Error: "); }
}
private void EDAOutputArchiveCallback(object state)
private void EDAOutputArchiveCallback(object? state)
{
try
{
try
{
if (_Background.IsPrimaryInstance())
_Background.EDAOutputArchiveCallback();
}
catch (Exception e) { _Background.Catch(e); }
try
{
TimeSpan timeSpan;
if (!_Background.IsPrimaryInstance())
timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
else
timeSpan = new TimeSpan(DateTime.Now.AddHours(6).Ticks - DateTime.Now.Ticks);
_EDAOutputArchiveTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
}
catch (Exception e) { _Background.Catch(e); }
if (!_BackgroundMethods.IsPrimaryInstance())
_BackgroundMethods.EDAOutputArchiveCallback();
}
private void EdaDataCollectionPlansCallback(object state)
catch (Exception e) { _Log.Error(e, "Error: "); }
try
{
try
{
if (_Background.IsPrimaryInstance())
_Background.EdaDataCollectionPlansCallback();
}
catch (Exception e) { _Background.Catch(e); }
try
{
TimeSpan timeSpan;
if (!_Background.IsPrimaryInstance())
timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
else
timeSpan = new TimeSpan(DateTime.Now.AddHours(2).Ticks - DateTime.Now.Ticks);
_EdaDataCollectionPlansTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
}
catch (Exception e) { _Background.Catch(e); }
TimeSpan timeSpan;
if (!_BackgroundMethods.IsPrimaryInstance())
timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
else
timeSpan = new TimeSpan(DateTime.Now.AddHours(6).Ticks - DateTime.Now.Ticks);
_ = _EDAOutputArchiveTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
}
catch (Exception e) { _Log.Error(e, "Error: "); }
}
private void EdaDataCollectionPlansCallback(object? state)
{
try
{
if (!_BackgroundMethods.IsPrimaryInstance())
_BackgroundMethods.EdaDataCollectionPlansCallback();
}
catch (Exception e) { _Log.Error(e, "Error: "); }
try
{
TimeSpan timeSpan;
if (!_BackgroundMethods.IsPrimaryInstance())
timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
else
timeSpan = new TimeSpan(DateTime.Now.AddHours(2).Ticks - DateTime.Now.Ticks);
_ = _EdaDataCollectionPlansTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
}
catch (Exception e) { _Log.Error(e, "Error: "); }
}
}

View File

@ -0,0 +1,167 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace IFX.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,93 @@
#pragma warning disable SYSLIB0022
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
namespace IFX.Shared;
public static class RijndaelEncryption
{
/// <summary>
/// Change the Inputkey GUID when you use this code in your own program.
/// Keep this inputkey very safe and prevent someone from decoding it some way!!
/// Generated 2021-08-10
/// </summary>
internal const string _Inputkey = "970CCEF6-4307-4F6A-9AC8-377DADB889BD";
/// <summary>
/// Encrypt the given text and give the byte array back as a BASE64 string
/// </summary>
/// <param name="text">The text to encrypt</param>
/// <param name="salt">The pasword salt</param>
/// <returns>The encrypted text</returns>
public static string Encrypt(string text, string salt)
{
string result;
if (string.IsNullOrEmpty(text))
throw new ArgumentNullException(nameof(text));
RijndaelManaged aesAlg = NewRijndaelManaged(salt);
ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
MemoryStream msEncrypt = new();
using (CryptoStream csEncrypt = new(msEncrypt, encryptor, CryptoStreamMode.Write))
using (StreamWriter swEncrypt = new(csEncrypt))
swEncrypt.Write(text);
result = Convert.ToBase64String(msEncrypt.ToArray());
return result;
}
/// <summary>
/// Checks if a string is base64 encoded
/// </summary>
/// <param name="base64String">The base64 encoded string</param>
/// <returns></returns>
public static bool IsBase64String(string base64String)
{
bool result;
base64String = base64String.Trim();
result = (base64String.Length % 4 == 0) && Regex.IsMatch(base64String, @"^[a-zA-Z0-9\+/]*={0,3}$", RegexOptions.None);
return result;
}
/// <summary>
/// Decrypts the given text
/// </summary>
/// <param name="cipherText">The encrypted BASE64 text</param>
/// <param name="salt">The pasword salt</param>
/// <returns>De gedecrypte text</returns>
public static string Decrypt(string cipherText, string salt)
{
if (string.IsNullOrEmpty(cipherText))
throw new ArgumentNullException(nameof(cipherText));
if (!IsBase64String(cipherText))
throw new Exception("The cipherText input parameter is not base64 encoded");
string text;
RijndaelManaged aesAlg = NewRijndaelManaged(salt);
ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
byte[] cipher = Convert.FromBase64String(cipherText);
using (MemoryStream msDecrypt = new(cipher))
{
using CryptoStream csDecrypt = new(msDecrypt, decryptor, CryptoStreamMode.Read);
using StreamReader srDecrypt = new(csDecrypt);
text = srDecrypt.ReadToEnd();
}
return text;
}
/// <summary>
/// Create a new RijndaelManaged class and initialize it
/// </summary>
/// <param name="salt">The pasword salt</param>
/// <returns></returns>
private static RijndaelManaged NewRijndaelManaged(string salt)
{
if (salt == null)
throw new ArgumentNullException(nameof(salt));
byte[] saltBytes = Encoding.ASCII.GetBytes(salt);
Rfc2898DeriveBytes key = new(_Inputkey, saltBytes);
RijndaelManaged aesAlg = new();
aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
aesAlg.IV = key.GetBytes(aesAlg.BlockSize / 8);
return aesAlg;
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.Core
{
public class BackboneComponent
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.Core
{
public class BackboneStatusCache
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.Core
{
public interface ILoggingSetupManager
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.Core
{
public class StatusItem
{
}
}

View File

@ -1,48 +0,0 @@
using Library.PeerGroup.GCL.Annotations;
using System;
using System.Collections.Generic;
namespace Library.Eaf.Core
{
public class Backbone
{
public const string STATE_ERROR = "Error";
public const string STATE_OFFLINE = "Offline";
public const string STATE_RUNNING = "Running";
public const string STATE_SHUTDOWN = "Shutting Down";
public const string STATE_STARTING = "Starting";
protected Backbone() { }
[NotNull]
public static Backbone Instance { get; }
[NotNull]
public ILoggingSetupManager LoggingConfigurationManager { get; set; }
public BackboneStatusCache Status { get; }
public bool IsAutomatedRestartActive { get; }
public bool IsReadyForRestart { get; }
public string StartTime { get; }
public string State { get; }
public string Name { get; }
public string ConfigurationServiceAddress { get; }
public string CellName { get; }
protected bool IsInitialized { get; set; }
protected Dictionary<string, BackboneComponent> BackboneComponents { get; }
public void AddBackboneComponent(BackboneComponent backboneComponent) { }
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.")]
public List<StatusItem> GetAllStatuses() { throw new NotImplementedException(); }
public BackboneComponent GetBackboneComponentById(string id) { throw new NotImplementedException(); }
public List<T> GetBackboneComponentsOfType<T>() { throw new NotImplementedException(); }
public List<BackboneComponent> GetBackboneComponentsOfType(Type type) { throw new NotImplementedException(); }
public void RegisterSubprocess(int pid) { }
[Obsolete("Use the capabilities exposed via the Status property -> SetValue. Will be removed with next major release.")]
public void SetStatus(string statusName, string statusValue) { }
[Obsolete("Use the capabilities exposed via the Status property -> SetValue. Will be removed with next major release.")]
public void SetStatus(BackboneComponent source, string statusName, string statusValue) { }
protected void CloseConnectionOfComponents(List<BackboneComponent> components) { }
protected virtual void StopAllComponents() { }
protected void StopComponents(List<BackboneComponent> components) { }
}
}

View File

@ -1,24 +0,0 @@
using System;
namespace Library.Eaf.Core.Smtp
{
public class EmailMessage
{
public EmailMessage() { }
public EmailMessage(string subject, string body, MailPriority priority = MailPriority.Normal) { }
public string Body { get; }
public MailPriority Priority { get; }
public string Subject { get; }
public EmailMessage PriorityHigh() { throw new NotImplementedException(); }
public EmailMessage PriorityLow() { throw new NotImplementedException(); }
public EmailMessage PriorityNormal() { throw new NotImplementedException(); }
public EmailMessage SetBody(string body) { throw new NotImplementedException(); }
public EmailMessage SetPriority(MailPriority priority) { throw new NotImplementedException(); }
public EmailMessage SetSubject(string subject) { throw new NotImplementedException(); }
}
}

View File

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

View File

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

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public class ChangeDataCollectionHandler
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public class DataCollectionRequest
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public class EquipmentEvent
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public class EquipmentException
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public class EquipmentSelfDescription
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public class GetParameterValuesHandler
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public interface IConnectionControl
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public interface IDataTracingHandler
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public interface IEquipmentCommandService
{
}
}

View File

@ -1,16 +0,0 @@
using Library.PeerGroup.GCL.Annotations;
namespace Library.Eaf.EquipmentCore.Control
{
public interface IEquipmentControl : IPackageSource
{
[NotNull]
IEquipmentSelfDescriptionBuilder SelfDescriptionBuilder { get; }
[NotNull]
IEquipmentDataCollection DataCollection { get; }
[NotNull]
IEquipmentCommandService Commands { get; }
[NotNull]
IConnectionControl Connection { get; }
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public interface IEquipmentSelfDescriptionBuilder
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public interface IPackage
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public interface ISelfDescriptionLookup
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public interface IVirtualParameterValuesHandler
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public class SetParameterValuesHandler
{
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public class TraceRequest
{
}
}

View File

@ -1,39 +0,0 @@
using Library.Eaf.EquipmentCore.DataCollection.Reporting;
using Library.Eaf.EquipmentCore.SelfDescription.ElementDescription;
using System;
using System.Collections.Generic;
namespace Library.Eaf.EquipmentCore.Control
{
public interface IEquipmentDataCollection
{
IVirtualParameterValuesHandler VirtualParameterValuesHandler { get; }
ISelfDescriptionLookup SelfDescriptionLookup { get; }
EquipmentSelfDescription SelfDescription { get; }
IEnumerable<DataCollectionRequest> ActiveRequests { get; }
IDataTracingHandler DataTracingHandler { get; }
ParameterValue CreateParameterValue(EquipmentParameter parameter, object value);
void NotifyDataTracingAvailable(bool isAvailable);
void RegisterChangeDataCollectionHandler(ChangeDataCollectionHandler handler);
void RegisterDataTracingHandler(IDataTracingHandler handler);
void RegisterGetParameterValuesHandler(GetParameterValuesHandler handler);
void RegisterSetParameterValuesHandler(SetParameterValuesHandler handler);
void TriggerDeactivate(DataCollectionRequest deactivateRequest);
void TriggerEvent(EquipmentEvent equipmentEvent, IEnumerable<ParameterValue> parameters);
void TriggerEvent(EquipmentEvent equipmentEvent, IEnumerable<ParameterValue> parameters, IPackage sourcePackage);
void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable<ParameterValue> parameters);
void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable<ParameterValue> parameters, IPackage sourcePackage);
void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable<ParameterValue> parameters, string severityOverride, string descriptionOverride);
void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable<ParameterValue> parameters, string severityOverride, string descriptionOverride, IPackage sourcePackage);
void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable<ParameterValue> parameters, string severityOverride, string descriptionOverride, IPackage sourcePackage);
void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable<ParameterValue> parameters, string severityOverride, string descriptionOverride);
void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable<ParameterValue> parameters, IPackage sourcePackage);
void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable<ParameterValue> parameters);
void TriggerPerformanceRestored();
void TriggerPerformanceWarning();
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, DateTime equipmentTimeStamp);
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.EquipmentCore.Control
{
public interface IPackageSource
{
}
}

View File

@ -1,20 +0,0 @@
using Library.Eaf.EquipmentCore.SelfDescription.ElementDescription;
using Library.PeerGroup.GCL.Annotations;
using System;
namespace Library.Eaf.EquipmentCore.DataCollection.Reporting
{
public class ParameterValue
{
public ParameterValue(EquipmentParameter definition, object value) { }
public ParameterValue(EquipmentParameter definition, object value, DateTime timestamp) { }
public virtual object Value { get; protected internal set; }
[NotNull]
public EquipmentParameter Definition { get; }
public DateTime Timestamp { get; protected set; }
public virtual ParameterValue Clone(EquipmentParameter newDefinition) { throw new NotImplementedException(); }
public override string ToString() { return base.ToString(); }
}
}

View File

@ -1,24 +0,0 @@
using Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
namespace Library.Eaf.EquipmentCore.SelfDescription.ElementDescription
{
public class EquipmentParameter
{
public EquipmentParameter(EquipmentParameter source, ParameterTypeDefinition typeDefinition) { }
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 string Name { get; }
public string Id { get; }
public string Description { get; }
public string SourcePath { get; }
public string SourceEquipment { get; }
public ParameterTypeDefinition TypeDefinition { get; }
public bool IsTransient { get; }
public bool IsReadOnly { get; }
public override string ToString() { return base.ToString(); }
public string ToStringWithDetails() { return base.ToString(); }
}
}

View File

@ -1,12 +0,0 @@
namespace Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes
{
public class Field
{
public Field(string name, string description, bool canBeNull, ParameterTypeDefinition typeDefinition) { }
public string Name { get; }
public string Description { get; }
public ParameterTypeDefinition TypeDefinition { get; }
public bool CanBeNull { get; }
}
}

View File

@ -1,12 +0,0 @@
namespace Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes
{
public abstract class ParameterTypeDefinition
{
public ParameterTypeDefinition(string name, string description) { }
public string Name { get; }
public string Description { get; }
public override string ToString() { return base.ToString(); }
}
}

View File

@ -1,12 +0,0 @@
using System.Collections.Generic;
namespace Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes
{
public class StructuredType : ParameterTypeDefinition
{
public StructuredType(string name, string description, IList<Field> fields) : base(name, description) { }
public IList<Field> Fields { get; }
}
}

View File

@ -1,6 +0,0 @@
namespace Library.Eaf.Management.ConfigurationData.CellAutomation
{
public interface IConfigurationObject
{
}
}

View File

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

View File

@ -1,17 +0,0 @@
namespace Library.Eaf.Management.ConfigurationData.CellAutomation
{
public enum ModelObjectParameterType
{
String = 0,
Bool = 1,
Byte = 2,
SignedByte = 3,
Integer = 4,
UnsignedInteger = 5,
LongInteger = 6,
UnsignedLongInteger = 7,
Double = 8,
Float = 9,
Enum = 10
}
}

View File

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

View File

@ -1,13 +0,0 @@
namespace Library.Ifx.Eaf.Common.Configuration
{
[System.Runtime.Serialization.DataContractAttribute]
public class ConnectionSetting
{
public ConnectionSetting(string name, string value) { }
[System.Runtime.Serialization.DataMemberAttribute]
public string Name { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string Value { get; set; }
}
}

View File

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

View File

@ -1,35 +0,0 @@
using Library.Ifx.Eaf.EquipmentConnector.File.Configuration;
using System;
using System.Collections.Generic;
namespace Library.Ifx.Eaf.EquipmentConnector.File.Component
{
public class FilePathGenerator
{
public const char PLACEHOLDER_IDENTIFIER = '%';
public const char PLACEHOLDER_SEPARATOR = ':';
public const string PLACEHOLDER_NOT_AVAILABLE = "NA";
public const string PLACEHOLDER_ORIGINAL_FILE_NAME = "OriginalFileName";
public const string PLACEHOLDER_ORIGINAL_FILE_EXTENSION = "OriginalFileExtension";
public const string PLACEHOLDER_DATE_TIME = "DateTime";
public const string PLACEHOLDER_SUB_FOLDER = "SubFolder";
public const string PLACEHOLDER_CELL_NAME = "CellName";
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, string sourceFilePath, bool isErrorFile = false, Dictionary<string, string> customPattern = null) { throw new NotImplementedException(); }
protected string SubFolderPath { get; }
protected FileConnectorConfiguration Configuration { get; }
protected File File { get; }
protected bool IsErrorFile { get; }
protected string DefaultPlaceHolderValue { get; }
public string GetFullTargetPath() { throw new NotImplementedException(); }
public virtual string GetTargetFileName() { 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 PrepareFolderPath(string targetFolderPath, string subFolderPath) { throw new NotImplementedException(); }
protected string ReplacePlaceholder(string inputPath) { throw new NotImplementedException(); }
}
}

View File

@ -1,135 +0,0 @@
using Library.Ifx.Eaf.Common.Configuration;
using System;
using System.Collections.Generic;
namespace Library.Ifx.Eaf.EquipmentConnector.File.Configuration
{
[System.Runtime.Serialization.DataContractAttribute]
public class FileConnectorConfiguration
{
public const ulong IDLE_EVENT_WAIT_TIME_DEFAULT = 360;
public const ulong FILE_HANDLE_TIMEOUT_DEFAULT = 15;
[System.Runtime.Serialization.DataMemberAttribute]
public virtual bool? TriggerOnChanged { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual long? PostProcessingRetries { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual bool? CopySourceFolderStructure { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public IfPostProcessingFailsEnum? IfPostProcessingFailsAction { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string AlternateTargetFolder { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public long? FileHandleTimeout { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public bool? DeleteEmptySourceSubFolders { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public long? IdleEventWaitTimeInSeconds { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string FileAgeThreshold { get; set; }
public bool? FolderAgeCheckIndividualSubFolders { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual ZipModeEnum? ZipMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public FileAgeFilterEnum? FileAgeFilterMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string ZipTargetFileName { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string ZipErrorTargetFileName { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public long? ZipFileSubFolderLevel { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string DefaultPlaceHolderValue { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public bool? UseZip64Mode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public List<ConnectionSetting> ConnectionSettings { get; set; }
public string SourceDirectoryCloaking { get; set; }
public string FolderAgeThreshold { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual long? FileScanningIntervalInSeconds { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual bool? TriggerOnCreated { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual long? ZipFileTime { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string SourceFileLocation { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string SourceFileFilter { get; set; }
public List<string> SourceFileFilters { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual bool? IncludeSubDirectories { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual FileScanningOptionEnum? FileScanningOption { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string TargetFileLocation { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string ErrorTargetFileLocation { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string TargetFileName { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual long? FileHandleWaitTime { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public IfFileExistEnum? IfFileExistAction { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public long? ConnectionRetryInterval { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public PreProcessingModeEnum? PreProcessingMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public PostProcessingModeEnum? PostProcessingMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public PostProcessingModeEnum? ErrorPostProcessingMode { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public virtual long? ZipFileAmount { get; set; }
[System.Runtime.Serialization.DataMemberAttribute]
public string ErrorTargetFileName { get; set; }
public void Initialize() { throw new NotImplementedException(); }
public enum PostProcessingModeEnum
{
None = 0,
Move = 1,
Copy = 2,
Rename = 3,
Zip = 4,
Delete = 5,
MoveFolder = 6,
CopyFolder = 7,
DeleteFolder = 8
}
public enum PreProcessingModeEnum
{
None = 0,
Process = 1
}
public enum IfFileExistEnum
{
Overwrite = 0,
LeaveFiles = 1,
Delete = 2
}
public enum IfPostProcessingFailsEnum
{
LeaveFiles = 0,
Delete = 1
}
public enum FileScanningOptionEnum
{
FileWatcher = 0,
TimeBased = 1
}
public enum ZipModeEnum
{
ZipByAmountOrTime = 0,
ZipByFileName = 1,
ZipBySubFolderName = 2
}
public enum FileAgeFilterEnum
{
IgnoreNewer = 0,
IgnoreOlder = 1
}
}
}

View File

@ -1,14 +0,0 @@
using Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
using System;
using System.Collections.Generic;
namespace Library.Ifx.Eaf.EquipmentConnector.File.SelfDescription
{
public class FileConnectorParameterTypeDefinitionProvider
{
public FileConnectorParameterTypeDefinitionProvider() { }
public IEnumerable<ParameterTypeDefinition> GetAllParameterTypeDefinition() { return null; }
public ParameterTypeDefinition GetParameterTypeDefinition(string name) { return null; }
}
}

View File

@ -1,10 +0,0 @@
using System;
namespace Library.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
{
public NotNullAttribute() { }
}
}

View File

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

View File

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

View File

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

View File

@ -1,16 +0,0 @@
namespace Library.PeerGroup.GCL.SecsDriver
{
public enum SerialBaudRate
{
Baud9600 = 0,
Baud19200 = 1,
Baud4800 = 2,
Baud2400 = 3,
Baud1200 = 4,
Baud300 = 5,
Baud150 = 6,
Baud38400 = 7,
Baud57600 = 8,
Baud115200 = 9
}
}

View File

@ -1,15 +1,52 @@
namespace EDAViewer.Models
using System.Text.Json;
using System.Text.Json.Serialization;
namespace EDAViewer.Models;
public class AppSettings
{
public class AppSettings
protected string _BuildNumber;
protected string _Company;
protected string _ECEDADatabasePassword;
protected string _GitCommitSeven;
protected string _IFXEDADatabasePassword;
protected string _MonARessource;
protected string _Server;
protected string _URLs;
protected string _WorkingDirectoryName;
public string BuildNumber => _BuildNumber;
public string Company => _Company;
public string ECEDADatabasePassword => _ECEDADatabasePassword;
public string GitCommitSeven => _GitCommitSeven;
public string IFXEDADatabasePassword => _IFXEDADatabasePassword;
public string MonARessource => _MonARessource;
public string Server => _Server;
public string URLs => _URLs;
public string WorkingDirectoryName => _WorkingDirectoryName;
// public AppSettings()
// {
// }
[JsonConstructor]
public AppSettings(string buildNumber, string company, string ecEDADatabasePassword, string gitCommitSeven, string ifxEDADatabasePassword, string monARessource, string server, string urls, string workingDirectoryName)
{
public string Company { get; set; }
public string ECEDADatabasePassword { get; set; }
public string EncryptedPassword { get; set; }
public string IFXEDADatabasePassword { get; set; }
public string MonARessource { get; set; }
public string Server { get; set; }
public string ServiceUser { get; set; }
public string URLs { get; set; }
public string WorkingDirectoryName { get; set; }
_BuildNumber = buildNumber;
_Company = company;
_ECEDADatabasePassword = ecEDADatabasePassword;
_GitCommitSeven = gitCommitSeven;
_IFXEDADatabasePassword = ifxEDADatabasePassword;
_MonARessource = monARessource;
_Server = server;
_URLs = urls;
_WorkingDirectoryName = workingDirectoryName;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
}

View File

@ -0,0 +1,38 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json;
namespace EDAViewer.Models.Binder;
public class AppSettings
{
[Display(Name = "Build Number"), Required] public string BuildNumber { get; set; }
[Display(Name = "Company"), Required] public string Company { get; set; }
[Display(Name = "EC EDA Database Password"), Required] public string ECEDADatabasePassword { get; set; }
[Display(Name = "Git Commit Seven"), Required] public string GitCommitSeven { get; set; }
[Display(Name = "IFX EDA Database Password"), Required] public string IFXEDADatabasePassword { get; set; }
[Display(Name = "MonA Ressource"), Required] public string MonARessource { get; set; }
[Display(Name = "Server"), Required] public string Server { get; set; }
[Display(Name = "URLs"), Required] public string URLs { get; set; }
[Display(Name = "Working Directory Name"), Required] public string WorkingDirectoryName { get; set; }
public AppSettings()
{
BuildNumber = string.Empty;
Company = string.Empty;
ECEDADatabasePassword = string.Empty;
GitCommitSeven = string.Empty;
IFXEDADatabasePassword = string.Empty;
MonARessource = string.Empty;
Server = string.Empty;
URLs = string.Empty;
WorkingDirectoryName = string.Empty;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
}

View File

@ -1,52 +0,0 @@
using EDAViewer.Models;
using System;
using System.ComponentModel.DataAnnotations;
namespace EDAViewer.Models
{
public class EdaHtmlDiff : WithEnvironment
{
public string Paths { get; set; }
public string CurrentPath { get; set; }
public string PathAndFileName { get; set; }
[Display(Name = "FileName")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
[Required(ErrorMessage = "Please select an file name", AllowEmptyStrings = false)]
public string FileName { get; set; }
public EdaHtmlDiff()
{
Common(path: string.Empty);
}
public EdaHtmlDiff(WithEnvironment withEnvironment, string path)
{
Common(path);
if (string.IsNullOrEmpty(withEnvironment.user_name))
user_name = "AUTO";
else
user_name = withEnvironment.user_name;
if (string.IsNullOrEmpty(withEnvironment.machine_name))
machine_name = "IFX";
else
machine_name = withEnvironment.machine_name;
if (withEnvironment.now_ticks == 0)
now_ticks = DateTime.Now.Ticks;
else
now_ticks = withEnvironment.now_ticks;
message = withEnvironment.message;
}
private void Common(string path)
{
Paths = string.Empty;
CurrentPath = path;
FileName = string.Empty;
}
}
}

View File

@ -1,9 +1,8 @@
namespace EDAViewer.Models
{
public class ErrorViewModel
{
public string RequestId { get; set; }
namespace EDAViewer.Models;
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
public class ErrorViewModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}

View File

@ -1,46 +0,0 @@
namespace EDAViewer.Models
{
public interface IBackground
{
void EdaDataCollectionPlansCallback();
// public void EdaDataCollectionPlans()
// {
// long ticks = DateTime.Now.Ticks;
// Logic2021Q1 logic2021Q1 = new Logic2021Q1(_Log);
// string server = GetServer(debugIsNotEC: false);
// string cSharpFormat = "yyyy-MM-dd_hh:mm:ss tt";
// string oracleFormat = "yyyy-MM-dd_hh:mi:ss AM";
// string edaDataCollectionPlansLastRun = "2020-07-02_10:45:01 AM";
// logic2021Q1.EdaDataCollectionPlans(server, server.Contains("_ec_"), edaDataCollectionPlansLastRun, cSharpFormat, oracleFormat);
// _Log.Debug(string.Concat("Took ", new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds, " second(s)"));
// }
void EDAOutputArchiveCallback();
// public void EDAOutputArchive()
// {
// long ticks = DateTime.Now.Ticks;
// string server = GetServer(debugIsNotEC: true);
// string sourceDirectory = string.Concat(@"\\", server, @"\ec_eda\Staging\Traces");
// if (!Directory.Exists(sourceDirectory))
// _Log.Debug(string.Concat("// Source directory <", sourceDirectory, "> doesn't exist."));
// else
// {
// Logic2019Q4 logic2019Q4 = new Logic2019Q4(_Log);
// logic2019Q4.EDAOutputArchive(sourceDirectory);
// }
// _Log.Debug(string.Concat("Took ", new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds, " second(s)"));
// }
void LogPathCleanUpByWeekCallback();
// public void LogPathCleanUpByWeek()
// {
// long ticks = DateTime.Now.Ticks;
// string server = GetServer(debugIsNotEC: true);
// Logic2019Q3 logic2019Q3 = new Logic2019Q3(_Log);
// logic2019Q3.LogPathCleanUpByWeek(server, isEDA: true);
// logic2019Q3.LogPathCleanUpByWeek(server, isEAFLog: true);
// _Log.Debug(string.Concat("Took ", new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds, " second(s)"));
// }
}
}

View File

@ -1,17 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Collections.Generic;
namespace EDAViewer.Models
{
public interface IHomeController
{
IActionResult Background(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null, int? invoke_eda_dcp = null);
IActionResult Encode(string value = null);
IActionResult Error();
IActionResult Index();
IActionResult Privacy();
IActionResult ViewEdaHtmlDiff(WithEnvironment withEnvironment = null);
ActionResult<IEnumerable<SelectListItem>> GetDirectoriesOrFiles(string path = null, bool? upDirectory = null, string filter = null);
}
}

View File

@ -0,0 +1,20 @@
namespace EDAViewer.Models.Methods;
public interface IBackground
{
void Catch(Exception exception);
void ClearIsPrimaryInstance();
void ClearMessage();
void Dispose();
bool IsPrimaryInstance();
void SetIsPrimaryInstance();
void Stop(bool immediate);
void Update(int milliSeconds);
string GetCountDirectory(string verb);
void EDAOutputArchiveCallback();
void EdaDataCollectionPlansCallback();
void LogPathCleanUpByWeekCallback();
}

View File

@ -0,0 +1,8 @@
namespace EDAViewer.Models.Properties;
public interface IBackground
{
public List<Timer> Timers { get; }
}

View File

@ -0,0 +1,10 @@
namespace EDAViewer.Models.Properties;
public interface IBackgroundPage
{
public List<Exception> Exceptions { get; }
public string Message { get; }
public string WorkingDirectory { get; }
}

View File

@ -0,0 +1,39 @@
using System.Text.Json;
namespace EDAViewer.Models.Stateless;
public abstract class AppSettings
{
public static Models.AppSettings Get(IConfigurationRoot configurationRoot)
{
Models.AppSettings? result;
Binder.AppSettings appSettings = configurationRoot.Get<Binder.AppSettings>();
string json = JsonSerializer.Serialize(appSettings, new JsonSerializerOptions() { WriteIndented = true });
result = JsonSerializer.Deserialize<Models.AppSettings>(json);
if (result is null)
throw new Exception(json);
if (string.IsNullOrEmpty(result.Company))
throw new Exception(json);
string jsonThis = result.ToString();
if (jsonThis != json)
{
int? check = null;
int min = new int[] { json.Length, jsonThis.Length }.Min();
for (int i = 0; i < min; i++)
{
if (json[i] == jsonThis[i])
continue;
check = i;
break;
}
if (check is null)
throw new Exception();
string a = json[..check.Value].Split(',')[^1];
string b = json[check.Value..].Split(',')[0];
throw new Exception($"{a}{b}");
}
return result;
}
}

View File

@ -0,0 +1,10 @@
namespace EDAViewer.Models.Stateless.Methods;
public interface IBackgroundPage
{
void OnGet(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null);
static string GetRouteName() => nameof(IBackgroundPage).Replace("Page", string.Empty)[1..];
}

View File

@ -0,0 +1,10 @@
using System.Runtime.CompilerServices;
namespace EDAViewer.Models.Stateless.Methods;
public interface IMethodName
{
static string? GetActualAsyncMethodName([CallerMemberName] string? name = null) => name;
}

View File

@ -0,0 +1,8 @@
namespace EDAViewer.Models.Stateless.Methods;
public interface IWorkingDirectory
{
static string GetWorkingDirectory(string? executingAssemblyName, string subDirectoryName) => WorkingDirectory.GetWorkingDirectory(executingAssemblyName, subDirectoryName);
}

View File

@ -0,0 +1,50 @@
namespace EDAViewer.Models.Stateless.Methods;
internal abstract class WorkingDirectory
{
internal static string GetWorkingDirectory(string? executingAssemblyName, string subDirectoryName)
{
string result = string.Empty;
if (executingAssemblyName is null)
throw new Exception();
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,10 @@
namespace EDAViewer.Models.Stateless;
public static class SerilogExtensionMethods
{
internal static void Warn(this Serilog.ILogger log, string messageTemplate) => log.Warning(messageTemplate);
internal static void Info(this Serilog.ILogger log, string messageTemplate) => log.Information(messageTemplate);
}

View File

@ -1,14 +0,0 @@
namespace EDAViewer.Models
{
public class WithEnvironment
{
public string message { get; set; }
public string user_name { get; set; }
public string machine_name { get; set; }
public long now_ticks { get; set; }
}
}

View File

@ -0,0 +1,68 @@
@page
@model EDAViewer.Pages.BackgroundPage
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Background</title>
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="~/css/app.css" rel="stylesheet" />
</head>
<body>
<div class="main">
<div class="content px-4">
<div class="jumbotron">
<h1>@(nameof(EDAViewer)) -
@(Model.IsPrimaryInstance) -
@(Model.IsEnvironmentProfile) -
@(Model.AppSettingsBuildNumber) -
@(Model.AppSettingsGitCommitSeven) -
@(Model.AppSettingsURLs)</h1>
<p class="lead">@(Model.WorkingDirectory)</p>
<p class="lead">@(Model.Message)</p>
<h1>@(string.Concat("Exception(s) - ", Model.Exceptions.Count))</h1>
</div>
<div>
<ul>
<li><a href="/Index.txt">Index.txt</a></li>
<li><a href="/Background">Background Message</a></li>
<li><a href="/Background/?message_clear=true">Background Message Clear</a></li>
<li><a href="/Background/?exceptions_clear=true">Background Exceptions Clear</a></li>
<li><a href="/Background/?set_is_primary_instance=true">Background Set Is Primary Instance</a></li>
<li><a href="/Background/?set_is_primary_instance=false">Background Clear Primary Instance</a></li>
</ul>
</div>
<p>&nbsp;</p>
<hr />
<div>
<form action="">
@if (Model.Exceptions.Any())
{
int i = 0;
@foreach (Exception exception in Model.Exceptions)
{
<p>
@Html.Raw(string.Concat("<textarea name=\"message_", i, "\" rows='1' cols='400'>",
exception.Message, "</textarea>"));
</p>
<p>
@Html.Raw(string.Concat("<textarea name=\"stackTrace_", i, "\" rows='4' cols='400'>",
exception.StackTrace, "</textarea>"));
</p>
<hr />
@(i += 1)
;
}
}
</form>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,74 @@
using EDAViewer.Models.Stateless.Methods;
using IFX.Shared;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Serilog.Context;
using System.Text.Json;
namespace EDAViewer.Pages;
public class BackgroundPage : PageModel, Models.Properties.IBackgroundPage, IBackgroundPage
{
protected readonly string _AppSettingsBuildNumber;
protected readonly string _AppSettingsGitCommitSeven;
protected readonly string _AppSettingsURLs;
protected readonly List<Exception> _Exceptions;
protected readonly string _IsEnvironmentProfile;
protected string _IsPrimaryInstance;
protected readonly string _Message;
protected readonly string _WorkingDirectory;
public string AppSettingsBuildNumber => _AppSettingsBuildNumber;
public string AppSettingsGitCommitSeven => _AppSettingsGitCommitSeven;
public string AppSettingsURLs => _AppSettingsURLs;
public List<Exception> Exceptions => _Exceptions;
public string IsEnvironmentProfile => _IsEnvironmentProfile;
public string IsPrimaryInstance => _IsPrimaryInstance;
public string Message => _Message;
public string WorkingDirectory => _WorkingDirectory;
private readonly Serilog.ILogger _Log;
private readonly Models.Methods.IBackground _BackgroundMethods;
public BackgroundPage(IsEnvironment isEnvironment, Models.AppSettings appSettings, Singleton.Background background)
{
_Message = background.Message;
_BackgroundMethods = background;
_AppSettingsURLs = appSettings.URLs;
_Exceptions = background.Exceptions;
_IsEnvironmentProfile = isEnvironment.Profile;
_Log = Serilog.Log.ForContext<BackgroundPage>();
_WorkingDirectory = background.WorkingDirectory;
_AppSettingsBuildNumber = appSettings.BuildNumber;
_AppSettingsGitCommitSeven = appSettings.GitCommitSeven;
Models.Methods.IBackground backgroundMethods = background;
_IsPrimaryInstance = backgroundMethods.IsPrimaryInstance().ToString();
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
public void OnGet(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null)
{
string? methodName = IMethodName.GetActualAsyncMethodName();
using (LogContext.PushProperty("MethodName", methodName))
{
_Log.Debug("() => ...");
if (message_clear.HasValue && message_clear.Value)
_BackgroundMethods.ClearMessage();
if (exceptions_clear.HasValue && exceptions_clear.Value)
_Exceptions.Clear();
if (set_is_primary_instance.HasValue)
{
if (set_is_primary_instance.Value)
_BackgroundMethods.SetIsPrimaryInstance();
else
_BackgroundMethods.ClearIsPrimaryInstance();
_IsPrimaryInstance = _BackgroundMethods.IsPrimaryInstance().ToString();
}
}
}
}

View File

@ -0,0 +1,42 @@
@page
@model EDAViewer.Pages.ErrorModel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Error</title>
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="~/css/app.css" rel="stylesheet" asp-append-version="true" />
</head>
<body>
<div class="main">
<div class="content px-4">
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;
namespace EDAViewer.Pages;
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _Logger;
public ErrorModel(ILogger<ErrorModel> logger) => _Logger = logger;
public void OnGet() => RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}

View File

@ -1,33 +1,88 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Shared;
using System.Diagnostics;
using EDAViewer.HostedService;
using EDAViewer.Models;
using EDAViewer.Models.Stateless.Methods;
using IFX.Shared;
using Microsoft.Extensions.Hosting.WindowsServices;
using Serilog;
using System.Reflection;
namespace EDAViewer
namespace EDAViewer;
public class Program
{
public class Program
public static int Main(string[] args)
{
public static void Main(string[] args)
LoggerConfiguration loggerConfiguration = new();
Assembly assembly = Assembly.GetExecutingAssembly();
string? assemblyName = assembly.GetName()?.Name;
if (string.IsNullOrEmpty(assemblyName))
throw new Exception();
WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(new WebApplicationOptions()
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args)
Args = args,
ContentRootPath = Path.GetDirectoryName(assembly.Location)
});
_ = webApplicationBuilder.Host.UseWindowsService();
_ = webApplicationBuilder.Configuration.AddUserSecrets<Program>();
AppSettings appSettings = Models.Stateless.AppSettings.Get(webApplicationBuilder.Configuration);
if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName))
throw new Exception("Working directory name must have a value!");
string workingDirectory = IWorkingDirectory.GetWorkingDirectory(assemblyName, appSettings.WorkingDirectoryName);
Environment.SetEnvironmentVariable(nameof(workingDirectory), workingDirectory);
_ = ConsoleLoggerConfigurationExtensions.Console(loggerConfiguration.WriteTo);
_ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, webApplicationBuilder.Configuration);
_ = SerilogHostBuilderExtensions.UseSerilog(webApplicationBuilder.Host);
Log.Logger = loggerConfiguration.CreateLogger();
Serilog.ILogger log = Log.ForContext<Program>();
try
{
IHostBuilder result;
IsEnvironment isEnvironment = new IsEnvironment(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: Debugger.IsAttached, nullASPNetCoreEnvironmentIsProduction: !Debugger.IsAttached);
result = Host.CreateDefaultBuilder(args)
.UseWindowsService()
.ConfigureWebHostDefaults(webBuilder =>
IsEnvironment isEnvironment = new(webApplicationBuilder.Environment.IsDevelopment(), webApplicationBuilder.Environment.IsStaging(), webApplicationBuilder.Environment.IsProduction());
Singleton.Background background = new(isEnvironment, appSettings, workingDirectory);
if (isEnvironment.Development && string.IsNullOrEmpty(appSettings.URLs))
throw new Exception();
_ = webApplicationBuilder.Services.AddRazorPages();
_ = webApplicationBuilder.Services.AddSingleton<AppSettings, AppSettings>(_ => appSettings);
_ = webApplicationBuilder.Services.AddSingleton<IsEnvironment, IsEnvironment>(_ => isEnvironment);
_ = webApplicationBuilder.Services.AddSingleton<Singleton.Background, Singleton.Background>(_ => background);
_ = webApplicationBuilder.Services.AddHostedService(t => new TimedHostedService(isEnvironment, background));
if (WindowsServiceHelpers.IsWindowsService())
{
_ = webApplicationBuilder.Services.AddSingleton<IHostLifetime, WindowsServiceLifetime>();
_ = webApplicationBuilder.Logging.AddEventLog(settings =>
{
webBuilder.UseStartup<Startup>();
if (string.IsNullOrEmpty(settings.SourceName))
settings.SourceName = webApplicationBuilder.Environment.ApplicationName;
});
return result;
}
}
WebApplication webApplication = webApplicationBuilder.Build();
if (appSettings.Company == nameof(webApplication.Lifetime.StopApplication))
{
Environment.ExitCode = -1;
webApplication.Lifetime.StopApplication();
}
_ = webApplication.UseExceptionHandler("/Error");
_ = webApplication.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
_ = ApplicationBuilderSerilogClientExtensions.UseSerilogIngestion(webApplication);
_ = SerilogApplicationBuilderExtensions.UseSerilogRequestLogging(webApplication);
_ = webApplication.UseDeveloperExceptionPage();
_ = webApplication.UseStaticFiles();
_ = webApplication.UseRouting();
_ = webApplication.MapRazorPages();
log.Information("Starting Web Application");
webApplication.Run();
return 0;
}
catch (Exception ex)
{
log.Fatal(ex, "Host terminated unexpectedly");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
}

View File

@ -1,53 +0,0 @@
namespace Shared
{
public enum EquipmentType
{
FileEquipment,
SemiEquipment,
//
DEP08EGANAIXG5,
//
MET08ANLYSDIFAAST230_Semi,
MET08DDUPSFS6420,
MET08DDUPSP1TBI,
MET08RESIHGCV,
MET08RESIMAPCDE,
MET08THFTIRQS408M,
MET08THFTIRSTRATUS,
//
MET08AFMD3100,
MET08BVHGPROBE,
MET08CVHGPROBE802B150,
MET08CVHGPROBE802B150_Monthly,
MET08CVHGPROBE802B150_Weekly,
MET08DDINCAN8620,
MET08DDINCAN8620_Daily,
MET08EBEAMINTEGRITY26,
MET08HALLHL5580,
MET08HALLHL5580_Monthly,
MET08HALLHL5580_Weekly,
MET08MESMICROSCOPE,
MET08NDFRESIMAP151C,
MET08NDFRESIMAP151C_Verification,
MET08PLMAPRPM,
MET08PLMAPRPM_Daily,
MET08PLMAPRPM_Verification,
MET08PLMPPLATO,
MET08PRFUSB4000,
MET08PRFUSB4000_Daily,
MET08PRFUSB4000_Monthly,
MET08PRFUSB4000_Weekly,
MET08PRFUSB4000_Verification,
MET08PRFUSB4000_Villach,
MET08UVH44GS100M,
MET08VPDSUBCON,
MET08WGEOMX203641Q,
MET08WGEOMX203641Q_Verification,
MET08XRDXPERTPROMRDXL,
MET08XRDXPERTPROMRDXL_Monthly,
MET08XRDXPERTPROMRDXL_Weekly,
METBRXRAYJV7300L
}
}

View File

@ -1,171 +0,0 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace 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(IsEnvironment.Windows);
else if (isEnvironment.Linux)
result = nameof(IsEnvironment.Linux);
else if (isEnvironment.OSX)
result = nameof(IsEnvironment.OSX);
else
throw new Exception();
return result;
}
}
}

View File

@ -1,96 +0,0 @@
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
namespace Shared
{
public static class RijndaelEncryption
{
/// <summary>
/// Change the Inputkey GUID when you use this code in your own program.
/// Keep this inputkey very safe and prevent someone from decoding it some way!!
/// Generated 2021-08-10
/// </summary>
internal const string Inputkey = "970CCEF6-4307-4F6A-9AC8-377DADB889BD";
/// <summary>
/// Encrypt the given text and give the byte array back as a BASE64 string
/// </summary>
/// <param name="text">The text to encrypt</param>
/// <param name="salt">The pasword salt</param>
/// <returns>The encrypted text</returns>
public static string Encrypt(string text, string salt)
{
string result;
if (string.IsNullOrEmpty(text))
throw new ArgumentNullException("text");
RijndaelManaged aesAlg = NewRijndaelManaged(salt);
ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
MemoryStream msEncrypt = new MemoryStream();
using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))
swEncrypt.Write(text);
result = Convert.ToBase64String(msEncrypt.ToArray());
return result;
}
/// <summary>
/// Checks if a string is base64 encoded
/// </summary>
/// <param name="base64String">The base64 encoded string</param>
/// <returns></returns>
public static bool IsBase64String(string base64String)
{
bool result;
base64String = base64String.Trim();
result = (base64String.Length % 4 == 0) && Regex.IsMatch(base64String, @"^[a-zA-Z0-9\+/]*={0,3}$", RegexOptions.None);
return result;
}
/// <summary>
/// Decrypts the given text
/// </summary>
/// <param name="cipherText">The encrypted BASE64 text</param>
/// <param name="salt">The pasword salt</param>
/// <returns>De gedecrypte text</returns>
public static string Decrypt(string cipherText, string salt)
{
if (string.IsNullOrEmpty(cipherText))
throw new ArgumentNullException("cipherText");
if (!IsBase64String(cipherText))
throw new Exception("The cipherText input parameter is not base64 encoded");
string text;
RijndaelManaged aesAlg = NewRijndaelManaged(salt);
ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
byte[] cipher = Convert.FromBase64String(cipherText);
using (MemoryStream msDecrypt = new MemoryStream(cipher))
{
using CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read);
using StreamReader srDecrypt = new StreamReader(csDecrypt);
text = srDecrypt.ReadToEnd();
}
return text;
}
/// <summary>
/// Create a new RijndaelManaged class and initialize it
/// </summary>
/// <param name="salt">The pasword salt</param>
/// <returns></returns>
private static RijndaelManaged NewRijndaelManaged(string salt)
{
if (salt == null)
throw new ArgumentNullException("salt");
byte[] saltBytes = Encoding.ASCII.GetBytes(salt);
Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(Inputkey, saltBytes);
RijndaelManaged aesAlg = new RijndaelManaged();
aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
aesAlg.IV = key.GetBytes(aesAlg.BlockSize / 8);
return aesAlg;
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,16 @@
namespace EDAViewer.Singleton.Helper
namespace EDAViewer.Singleton.Helper;
public partial class Background
{
public partial class Background
public partial class EDADatabase
{
public partial class EDADatabase
{
public static string GetEdaDevelopment() => "Data Source=(description=(address_list=(address=(protocol=tcp)(host=fimest-db.mes.infineon.com)(port=7001)))(connect_data=(sid=fimest))); User Id=edatest; Password=";
public static string GetEdaDevelopment()
{
return "Data Source=(description=(address_list=(address=(protocol=tcp)(host=fimest-db.mes.infineon.com)(port=7001)))(connect_data=(sid=fimest))); User Id=edatest; Password=";
}
public static string GetEdaStaging() => "Data Source=(description=(address_list=(address=(protocol=tcp)(host=fimess-db.ec.local)(port=7001)))(connect_data=(sid=fimess))); User Id=edastag; Password=";
public static string GetEdaStaging()
{
return "Data Source=(description=(address_list=(address=(protocol=tcp)(host=fimess-db.ec.local)(port=7001)))(connect_data=(sid=fimess))); User Id=edastag; Password=";
}
public static string GetEdaProduction()
{
return "Data Source=(description=(address_list=(address=(protocol=tcp)(host=fimesp-db.ec.local)(port=7002)))(connect_data=(sid=fimesp))); User Id=edaprod; Password=";
}
}
public static string GetEdaProduction() => "Data Source=(description=(address_list=(address=(protocol=tcp)(host=fimesp-db.ec.local)(port=7002)))(connect_data=(sid=fimesp))); User Id=edaprod; Password=";
}

View File

@ -1,427 +1,430 @@
using System.Collections.Generic;
using System.Dynamic;
using System.IO;
using System.Text;
using System.Text.Json;
namespace EDAViewer.Singleton.Helper
namespace EDAViewer.Singleton.Helper;
public partial class Background
{
public partial class Background
public class EdaDCP
{
public class EdaDCP
internal static string GetEdaObjectToHtml(string edaObjectFile, Common common)
{
internal static string GetEdaObjectToHtml(string edaObjectFile, Common common)
StringBuilder result = new();
string title = string.Concat(Path.GetFileName(edaObjectFile), " - ", common.Source);
_ = result.AppendLine("<!DOCTYPE html>");
_ = result.AppendLine("<html lang=\"en\">");
_ = result.AppendLine("<head>");
_ = result.AppendLine("<style>table, th, td{border:1px solid black;} td{padding:2px}</style>");
_ = result.Append("<title>").Append(title).AppendLine("</title>");
_ = result.AppendLine("</head>");
_ = result.AppendLine("<body>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("Unit Name").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Container Name").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Configuration State").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Configuration Productive State").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("LogisticsEquipmentAlias").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Source").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("StoragePath").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("StartTimeFormat").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Filename").AppendLine("</th>");
_ = result.AppendLine("</tr>");
_ = result.AppendLine("<tr>");
_ = result.Append("<td nowrap>").Append(common.UnitName).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.ContainerName).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.ConfigurationState).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.ConfigurationProductiveState).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.LogisticsEquipmentAlias).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.Source).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.StoragePath).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.StartTimeFormat).AppendLine("</td>");
_ = result.Append("<td nowrap>").Append(common.Filename).AppendLine("</td>");
_ = result.AppendLine("</tr>");
_ = result.AppendLine("</table>");
_ = result.AppendLine("<hr>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("Use").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Order").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Key").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Placeholder").AppendLine("</th>");
_ = result.AppendLine("</tr>");
foreach (string[] item in common.LogisticsAttributes)
{
StringBuilder result = new StringBuilder();
string title = string.Concat(Path.GetFileName(edaObjectFile), " - ", common.Source);
result.AppendLine("<!DOCTYPE html>");
result.AppendLine("<html lang=\"en\">");
result.AppendLine("<head>");
result.AppendLine("<style>table, th, td{border:1px solid black;} td{padding:2px}</style>");
result.Append("<title>").Append(title).AppendLine("</title>");
result.AppendLine("</head>");
result.AppendLine("<body>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("Unit Name").AppendLine("</th>");
result.Append("<th nowrap>").Append("Container Name").AppendLine("</th>");
result.Append("<th nowrap>").Append("Configuration State").AppendLine("</th>");
result.Append("<th nowrap>").Append("Configuration Productive State").AppendLine("</th>");
result.Append("<th nowrap>").Append("LogisticsEquipmentAlias").AppendLine("</th>");
result.Append("<th nowrap>").Append("Source").AppendLine("</th>");
result.Append("<th nowrap>").Append("StoragePath").AppendLine("</th>");
result.Append("<th nowrap>").Append("StartTimeFormat").AppendLine("</th>");
result.Append("<th nowrap>").Append("Filename").AppendLine("</th>");
result.AppendLine("</tr>");
result.AppendLine("<tr>");
result.Append("<td nowrap>").Append(common.UnitName).AppendLine("</td>");
result.Append("<td nowrap>").Append(common.ContainerName).AppendLine("</td>");
result.Append("<td nowrap>").Append(common.ConfigurationState).AppendLine("</td>");
result.Append("<td nowrap>").Append(common.ConfigurationProductiveState).AppendLine("</td>");
result.Append("<td nowrap>").Append(common.LogisticsEquipmentAlias).AppendLine("</td>");
result.Append("<td nowrap>").Append(common.Source).AppendLine("</td>");
result.Append("<td nowrap>").Append(common.StoragePath).AppendLine("</td>");
result.Append("<td nowrap>").Append(common.StartTimeFormat).AppendLine("</td>");
result.Append("<td nowrap>").Append(common.Filename).AppendLine("</td>");
result.AppendLine("</tr>");
result.AppendLine("</table>");
result.AppendLine("<hr>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("Use").AppendLine("</th>");
result.Append("<th nowrap>").Append("Order").AppendLine("</th>");
result.Append("<th nowrap>").Append("Key").AppendLine("</th>");
result.Append("<th nowrap>").Append("Placeholder").AppendLine("</th>");
result.AppendLine("</tr>");
foreach (string[] item in common.LogisticsAttributes)
if (item.Length > 2 && !item[2].StartsWith("Z_"))
{
if (item.Length > 2 && !item[2].StartsWith("Z_"))
_ = result.AppendLine("<tr>");
foreach (string value in item)
_ = result.Append("<td nowrap>").Append(value).AppendLine("</td>");
_ = result.AppendLine("</tr>");
}
}
_ = result.AppendLine("</table>");
_ = result.AppendLine("<hr>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("ID").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Prefix").AppendLine("</th>");
_ = result.AppendLine("</tr>");
foreach (string[] item in common.LogisticsColumns)
{
_ = result.AppendLine("<tr>");
foreach (string value in item)
_ = result.Append("<td nowrap>").Append(value).AppendLine("</td>");
_ = result.AppendLine("</tr>");
}
_ = result.AppendLine("</table>");
_ = result.AppendLine("<hr>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("Use").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Order").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("FullName").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Alias").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("HardWareId").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Description").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Formula").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Virtual").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Column#").AppendLine("</th>");
_ = result.AppendLine("</tr>");
foreach (string[] item in common.Parameters)
{
_ = result.AppendLine("<tr>");
foreach (string value in item)
_ = result.Append("<td nowrap>").Append(value).AppendLine("</td>");
_ = result.AppendLine("</tr>");
}
_ = result.AppendLine("</table>");
_ = result.AppendLine("<hr>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("Parent Name").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Name").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("ParameterName").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Formula").AppendLine("</th>");
_ = result.AppendLine("</tr>");
foreach (string[] item in common.GeneralTriggers)
{
_ = result.AppendLine("<tr>");
foreach (string value in item)
_ = result.Append("<td nowrap>").Append(value).AppendLine("</td>");
_ = result.AppendLine("</tr>");
}
_ = result.AppendLine("</table>");
_ = result.AppendLine("<hr>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("Name").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Rule").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("ResolveGlobalVariableBeforeTrigger").AppendLine("</th>");
_ = result.AppendLine("</tr>");
foreach (string[] item in common.StartTriggersDCP)
{
_ = result.AppendLine("<tr>");
foreach (string value in item)
_ = result.Append("<td nowrap>").Append(value).AppendLine("</td>");
_ = result.AppendLine("</tr>");
}
_ = result.AppendLine("</table>");
_ = result.AppendLine("<hr>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("Name").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Fixed").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Rule").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Scenario").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("DefaultJobIndex").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("DefaultCarrierIndex").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("DefaultSlotIndex").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("DataPool").AppendLine("</th>");
_ = result.AppendLine("</tr>");
foreach (string?[] item in common.LogisticsTriggers)
{
if (item is null)
continue;
_ = result.AppendLine("<tr>");
foreach (string? value in item)
_ = result.Append("<td nowrap>").Append(value).AppendLine("</td>");
_ = result.AppendLine("<td>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("KeyName").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("ParameterName").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Formula").AppendLine("</th>");
_ = result.AppendLine("</tr>");
foreach (KeyValuePair<int, string[]> keyValuePair in common.LogisticsTriggersKeysKeyMapping)
{
_ = result.AppendLine("<tr>");
foreach (string value in keyValuePair.Value)
_ = result.Append("<td nowrap>").Append(value).AppendLine("</td>");
_ = result.AppendLine("</tr>");
}
_ = result.AppendLine("</table>");
_ = result.AppendLine("</td>");
_ = result.AppendLine("<td>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("LogisticsKey").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Source").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("MappedParameterName").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Formula").AppendLine("</th>");
_ = result.AppendLine("</tr>");
foreach (KeyValuePair<int, List<string[]>> keyValuePair in common.LogisticsTriggersCallDefinitionAttributes)
{
foreach (string[] values in keyValuePair.Value)
{
result.AppendLine("<tr>");
foreach (string value in item)
result.Append("<td nowrap>").Append(value).AppendLine("</td>");
result.AppendLine("</tr>");
}
}
result.AppendLine("</table>");
result.AppendLine("<hr>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("ID").AppendLine("</th>");
result.Append("<th nowrap>").Append("Prefix").AppendLine("</th>");
result.AppendLine("</tr>");
foreach (string[] item in common.LogisticsColumns)
{
result.AppendLine("<tr>");
foreach (string value in item)
result.Append("<td nowrap>").Append(value).AppendLine("</td>");
result.AppendLine("</tr>");
}
result.AppendLine("</table>");
result.AppendLine("<hr>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("Use").AppendLine("</th>");
result.Append("<th nowrap>").Append("Order").AppendLine("</th>");
result.Append("<th nowrap>").Append("FullName").AppendLine("</th>");
result.Append("<th nowrap>").Append("Alias").AppendLine("</th>");
result.Append("<th nowrap>").Append("HardWareId").AppendLine("</th>");
result.Append("<th nowrap>").Append("Description").AppendLine("</th>");
result.Append("<th nowrap>").Append("Formula").AppendLine("</th>");
result.Append("<th nowrap>").Append("Virtual").AppendLine("</th>");
result.Append("<th nowrap>").Append("Column#").AppendLine("</th>");
result.AppendLine("</tr>");
foreach (string[] item in common.Parameters)
{
result.AppendLine("<tr>");
foreach (string value in item)
result.Append("<td nowrap>").Append(value).AppendLine("</td>");
result.AppendLine("</tr>");
}
result.AppendLine("</table>");
result.AppendLine("<hr>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("Parent Name").AppendLine("</th>");
result.Append("<th nowrap>").Append("Name").AppendLine("</th>");
result.Append("<th nowrap>").Append("ParameterName").AppendLine("</th>");
result.Append("<th nowrap>").Append("Formula").AppendLine("</th>");
result.AppendLine("</tr>");
foreach (string[] item in common.GeneralTriggers)
{
result.AppendLine("<tr>");
foreach (string value in item)
result.Append("<td nowrap>").Append(value).AppendLine("</td>");
result.AppendLine("</tr>");
}
result.AppendLine("</table>");
result.AppendLine("<hr>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("Name").AppendLine("</th>");
result.Append("<th nowrap>").Append("Rule").AppendLine("</th>");
result.Append("<th nowrap>").Append("ResolveGlobalVariableBeforeTrigger").AppendLine("</th>");
result.AppendLine("</tr>");
foreach (string[] item in common.StartTriggersDCP)
{
result.AppendLine("<tr>");
foreach (string value in item)
result.Append("<td nowrap>").Append(value).AppendLine("</td>");
result.AppendLine("</tr>");
}
result.AppendLine("</table>");
result.AppendLine("<hr>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("Name").AppendLine("</th>");
result.Append("<th nowrap>").Append("Fixed").AppendLine("</th>");
result.Append("<th nowrap>").Append("Rule").AppendLine("</th>");
result.Append("<th nowrap>").Append("Scenario").AppendLine("</th>");
result.Append("<th nowrap>").Append("DefaultJobIndex").AppendLine("</th>");
result.Append("<th nowrap>").Append("DefaultCarrierIndex").AppendLine("</th>");
result.Append("<th nowrap>").Append("DefaultSlotIndex").AppendLine("</th>");
result.Append("<th nowrap>").Append("DataPool").AppendLine("</th>");
result.AppendLine("</tr>");
foreach (string[] item in common.LogisticsTriggers)
{
result.AppendLine("<tr>");
foreach (string value in item)
result.Append("<td nowrap>").Append(value).AppendLine("</td>");
result.AppendLine("<td>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("KeyName").AppendLine("</th>");
result.Append("<th nowrap>").Append("ParameterName").AppendLine("</th>");
result.Append("<th nowrap>").Append("Formula").AppendLine("</th>");
result.AppendLine("</tr>");
foreach (KeyValuePair<int, string[]> keyValuePair in common.LogisticsTriggersKeysKeyMapping)
{
result.AppendLine("<tr>");
foreach (string value in keyValuePair.Value)
result.Append("<td nowrap>").Append(value).AppendLine("</td>");
result.AppendLine("</tr>");
}
result.AppendLine("</table>");
result.AppendLine("</td>");
result.AppendLine("<td>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("LogisticsKey").AppendLine("</th>");
result.Append("<th nowrap>").Append("Source").AppendLine("</th>");
result.Append("<th nowrap>").Append("MappedParameterName").AppendLine("</th>");
result.Append("<th nowrap>").Append("Formula").AppendLine("</th>");
result.AppendLine("</tr>");
foreach (KeyValuePair<int, List<string[]>> keyValuePair in common.LogisticsTriggersCallDefinitionAttributes)
{
foreach (string[] values in keyValuePair.Value)
if (values.Length > 0 && !values[0].StartsWith("Z_"))
{
if (values.Length > 0 && !values[0].StartsWith("Z_"))
{
result.AppendLine("<tr>");
foreach (string value in values)
result.Append("<td nowrap>").Append(value).AppendLine("</td>");
result.AppendLine("</tr>");
}
_ = result.AppendLine("<tr>");
foreach (string value in values)
_ = result.Append("<td nowrap>").Append(value).AppendLine("</td>");
_ = result.AppendLine("</tr>");
}
}
result.AppendLine("</table>");
result.AppendLine("</td>");
result.AppendLine("</tr>");
}
result.AppendLine("</table>");
result.AppendLine("<hr>");
result.AppendLine("<table>");
result.AppendLine("<tr>");
result.Append("<th nowrap>").Append("Name").AppendLine("</th>");
result.Append("<th nowrap>").Append("Rule").AppendLine("</th>");
result.Append("<th nowrap>").Append("ResolveGlobalVariableBeforeTrigger").AppendLine("</th>");
result.Append("<th nowrap>").Append("ResetGlobalVariablesAfterTrigger").AppendLine("</th>");
result.AppendLine("</tr>");
foreach (string[] item in common.StopTriggersDCP)
{
result.AppendLine("<tr>");
foreach (string value in item)
result.Append("<td nowrap>").Append(value).AppendLine("</td>");
result.AppendLine("</tr>");
}
result.AppendLine("</table>");
result.AppendLine("<hr>");
result.AppendLine("</body>");
result.AppendLine("</html>");
return result.ToString();
_ = result.AppendLine("</table>");
_ = result.AppendLine("</td>");
_ = result.AppendLine("</tr>");
}
private static string ReplaceNull(object @object)
_ = result.AppendLine("</table>");
_ = result.AppendLine("<hr>");
_ = result.AppendLine("<table>");
_ = result.AppendLine("<tr>");
_ = result.Append("<th nowrap>").Append("Name").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("Rule").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("ResolveGlobalVariableBeforeTrigger").AppendLine("</th>");
_ = result.Append("<th nowrap>").Append("ResetGlobalVariablesAfterTrigger").AppendLine("</th>");
_ = result.AppendLine("</tr>");
foreach (string[] item in common.StopTriggersDCP)
{
if (@object is null)
return string.Empty;
_ = result.AppendLine("<tr>");
foreach (string value in item)
_ = result.Append("<td nowrap>").Append(value).AppendLine("</td>");
_ = result.AppendLine("</tr>");
}
_ = result.AppendLine("</table>");
_ = result.AppendLine("<hr>");
_ = result.AppendLine("</body>");
_ = result.AppendLine("</html>");
return result.ToString();
}
private static string? ReplaceNull(object @object)
{
if (@object is null)
return string.Empty;
else
return @object.ToString();
}
private static void TextResolveEntry(StringBuilder result, dynamic expandoObject, int level, string super, int? i, bool group)
{
level += 1;
foreach (dynamic entry in expandoObject)
{
if (entry.Value is ExpandoObject)
TextResolveEntry(result, entry.Value, level, string.Concat(super, " : ", entry.Key), i, group);
else
return @object.ToString();
}
private static void TextResolveEntry(StringBuilder result, dynamic expandoObject, int level, string super, int? i, bool group)
{
level += 1;
foreach (dynamic entry in expandoObject)
{
if (entry.Value is ExpandoObject)
TextResolveEntry(result, entry.Value, level, string.Concat(super, " : ", entry.Key), i, group);
if (entry.Value is not ICollection<object>)
{
if (i is null)
result.Append(level).Append(") ").Append(super).Append(" : ").Append(entry.Key).Append("--->").AppendLine(ReplaceNull(entry.Value));
else
result.Append(level).Append(") ").Append(super).Append(" : ").Append(entry.Key).Append("[").Append(i.Value).Append("]--->").AppendLine(ReplaceNull(entry.Value));
}
else
{
if (!(entry.Value is ICollection<object>))
if (!group)
{
if (i is null)
result.Append(level).Append(") ").Append(super).Append(" : ").Append(entry.Key).Append("--->").AppendLine(ReplaceNull(entry.Value));
else
result.Append(level).Append(") ").Append(super).Append(" : ").Append(entry.Key).Append("[").Append(i.Value).Append("]--->").AppendLine(ReplaceNull(entry.Value));
}
else
{
if (!group)
for (i = 0; i.Value < entry.Value.Count; i++)
{
for (i = 0; i.Value < entry.Value.Count; i++)
{
if (entry.Value[i.Value] is ExpandoObject)
TextResolveEntry(result, entry.Value[i.Value], level, string.Concat(super, " : ", entry.Key), i.Value, group);
else
result.Append(level).Append(") ").Append(super).Append(" : ").Append(entry.Key).Append("[").Append(i.Value).Append("]--->").AppendLine(ReplaceNull(entry.Value[i.Value]));
}
if (entry.Value[i.Value] is ExpandoObject)
TextResolveEntry(result, entry.Value[i.Value], level, string.Concat(super, " : ", entry.Key), i.Value, group);
else
result.Append(level).Append(") ").Append(super).Append(" : ").Append(entry.Key).Append("[").Append(i.Value).Append("]--->").AppendLine(ReplaceNull(entry.Value[i.Value]));
}
else
{
for (i = 0; i.Value < entry.Value.Count; i++)
{
if (!(entry.Value[i.Value] is ExpandoObject))
result.Append(level).Append(") ").Append(super).Append(" : ").Append(entry.Key).Append("[").Append(i.Value).Append("]--->").AppendLine(ReplaceNull(entry.Value[i.Value]));
}
for (i = 0; i.Value < entry.Value.Count; i++)
{
if (entry.Value[i.Value] is ExpandoObject)
TextResolveEntry(result, entry.Value[i.Value], level, string.Concat(super, " : ", entry.Key), i.Value, group);
}
}
i = null;
}
}
}
level -= 1;
}
internal static string GetText(string edaObjectFile, Common common, string json)
{
StringBuilder result = new StringBuilder();
if (result.Length > 0) //Skipping because System.Text.Json changed the way Expando works
{
string title = string.Concat(Path.GetFileName(edaObjectFile), " - ", common.Source);
dynamic expandoObject = JsonSerializer.Deserialize<ExpandoObject>(json);
result.AppendLine(title);
result.AppendLine("Loop -> \"Normal\"");
result.AppendLine(edaObjectFile);
result.AppendLine();
TextResolveEntry(result, expandoObject, 0, string.Empty, null, group: false);
result.AppendLine();
result.AppendLine();
result.AppendLine();
result.AppendLine(title);
result.AppendLine("Loop -> \"Grouped\"");
result.AppendLine(edaObjectFile);
result.AppendLine();
TextResolveEntry(result, expandoObject, 0, string.Empty, null, group: true);
}
return result.ToString();
}
internal static string GetEdaObjectToDMSGridFormat(string edaObjectFile, Common common, bool useAlias)
{
StringBuilder result = new StringBuilder();
string[] segments;
int? recordStart = null;
string name = string.Concat(common.LogisticsEquipmentAlias, "_", common.ContainerName);
result.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
result.Append("<Format Name=\"").Append(name).Append("\">").AppendLine();
result.AppendLine(" <General RecordStart=\"\" RecordLength=\"0\" ReadCommand=\"\" DecimalSeparator=\".\">");
result.AppendLine(" <RecordTerminator>&lt;13&gt;&lt;10&gt;</RecordTerminator>");
result.AppendLine(" <ColumnSeparator>&lt;9&gt;</ColumnSeparator>");
result.AppendLine(" </General>");
result.AppendLine(" <Fields>");
for (int i = 0; i < common.Parameters.Count; i++)
{
if (recordStart is null && common.Parameters[i][3] == "RECORD_START")
recordStart = i;
if (recordStart.HasValue && common.Parameters[i][0] == "True")
{
if (useAlias && !string.IsNullOrEmpty(common.Parameters[i][3]))
name = common.Parameters[i][3].Replace("'", string.Empty);
else
{
segments = common.Parameters[i][2].Split('/');
name = segments[segments.Length - 1];
for (i = 0; i.Value < entry.Value.Count; i++)
{
if (entry.Value[i.Value] is not ExpandoObject)
result.Append(level).Append(") ").Append(super).Append(" : ").Append(entry.Key).Append("[").Append(i.Value).Append("]--->").AppendLine(ReplaceNull(entry.Value[i.Value]));
}
for (i = 0; i.Value < entry.Value.Count; i++)
{
if (entry.Value[i.Value] is ExpandoObject)
TextResolveEntry(result, entry.Value[i.Value], level, string.Concat(super, " : ", entry.Key), i.Value, group);
}
}
result.Append(" <Field Name=\"").Append(name).Append("\" ColumnNumber=\"").Append(i + common.LogisticsColumns.Count + 2).Append("\" StartPosition=\"\" Length=\"\" DataType=\"Text\" NullReplacement=\"\" />").AppendLine();
i = null;
}
}
result.AppendLine(" </Fields>");
result.AppendLine(" <Conditions>");
result.AppendLine(" <Column />");
result.AppendLine(" <Row>");
result.AppendLine(" <Condition>");
result.AppendLine(" <SkipHeaderCount>7</SkipHeaderCount>");
result.AppendLine(" <SkipRowFilter>0</SkipRowFilter>");
result.AppendLine(" <SkipRowValue>");
result.AppendLine(" </SkipRowValue>");
result.AppendLine(" </Condition>");
result.AppendLine(" </Row>");
result.AppendLine(" </Conditions>");
result.AppendLine("</Format>");
return result.ToString();
}
level -= 1;
if (level == 0)
{ }
}
internal static string GetEdaObjectToAPCParameter(string edaObjectFile, Common common)
internal static string GetText(string edaObjectFile, Common common, string json)
{
StringBuilder result = new();
if (result.Length > 0) //Skipping because System.Text.Json changed the way Expando works
{
StringBuilder result = new StringBuilder();
string parameter;
string[] segments;
string parameterSub35;
string name = string.Concat(common.LogisticsEquipmentAlias, "_", common.ContainerName);
result.AppendLine("ExportFileVersion=1.0.6");
result.AppendLine("ExportFromTabsheet=Para");
result.AppendLine("FieldName\tLongName\tMatchMode\tEquipment\tName\tPdsfNameConvCol\tPdsfNameDataType\tType\tChamberInfo\tUnifiedPara\tDateFormat\tUsername\tId\tWorkcenterId\tSite\tArea\tWorkcenter\tValidFrom\tValidTo");
result.AppendLine("TIME_PREV_DIFF\tTIME_PREV_DIFF\tEXACT\t*\tTIME_PREV_DIFF\t\tNUMERIC\tRUN\t\tTIME_PREV_DIFF\t\tPHARES\t95069\t4571\tMesa\t\t\t4/15/2020 6:10 PM");
result.AppendLine("TIME\tTIME\tEXACT\t*\tTIME\t\tNUMERIC\tRUN\t\tTIME\t\tPHARES\t95070\t4571\tMesa\t\t\t4/15/2020 6:10 PM");
for (int i = 0; i < common.Parameters.Count; i++)
{
if (common.Parameters[i][0] == "True")
{
segments = common.Parameters[i][2].Split('/');
parameter = segments[segments.Length - 1];
if (parameter.Length < 35)
parameterSub35 = parameter;
else
parameterSub35 = parameter.Substring(0, 35);
result.Append(parameterSub35).Append("\tDIVERSE\tEXACT\t*\t").Append(parameterSub35).AppendLine("\t\tNUMERIC\tRUN\t\t\t\tPHARES\t9000000012\t4571\tMesa\t\t\t4/15/2020 6:10 PM");
}
}
result.AppendLine();
result.AppendLine();
result.AppendLine();
for (int i = 0; i < common.Parameters.Count; i++)
{
if (common.Parameters[i][0] == "True")
{
segments = common.Parameters[i][2].Split('/');
parameter = segments[segments.Length - 1];
result.Append(parameter).Append("\tDIVERSE\tEXACT\t*\t").Append(parameter).AppendLine("\t\tNUMERIC\tRUN\t\t\t\tPHARES\t9000000012\t4571\tMesa\t\t\t4/15/2020 6:10 PM");
}
}
return result.ToString();
string title = string.Concat(Path.GetFileName(edaObjectFile), " - ", common.Source);
dynamic? expandoObject = JsonSerializer.Deserialize<ExpandoObject>(json);
_ = result.AppendLine(title);
_ = result.AppendLine("Loop -> \"Normal\"");
_ = result.AppendLine(edaObjectFile);
_ = result.AppendLine();
TextResolveEntry(result, expandoObject, 0, string.Empty, null, group: false);
_ = result.AppendLine();
_ = result.AppendLine();
_ = result.AppendLine();
_ = result.AppendLine(title);
_ = result.AppendLine("Loop -> \"Grouped\"");
_ = result.AppendLine(edaObjectFile);
_ = result.AppendLine();
TextResolveEntry(result, expandoObject, 0, string.Empty, null, group: true);
}
return result.ToString();
}
internal static string GetEdaObjectToAPCRunKeyNumber(string edaObjectFile, Common common)
internal static string GetEdaObjectToDMSGridFormat(string edaObjectFile, Common common, bool useAlias)
{
StringBuilder result = new();
if (string.IsNullOrEmpty(edaObjectFile))
{ }
string[] segments;
int? recordStart = null;
string name = string.Concat(common.LogisticsEquipmentAlias, "_", common.ContainerName);
_ = result.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
_ = result.Append("<Format Name=\"").Append(name).Append("\">").AppendLine();
_ = result.AppendLine(" <General RecordStart=\"\" RecordLength=\"0\" ReadCommand=\"\" DecimalSeparator=\".\">");
_ = result.AppendLine(" <RecordTerminator>&lt;13&gt;&lt;10&gt;</RecordTerminator>");
_ = result.AppendLine(" <ColumnSeparator>&lt;9&gt;</ColumnSeparator>");
_ = result.AppendLine(" </General>");
_ = result.AppendLine(" <Fields>");
for (int i = 0; i < common.Parameters.Count; i++)
{
StringBuilder result = new StringBuilder();
string parameter;
string[] segments;
string parameterSub21;
string parameterSub35;
string name = string.Concat(common.LogisticsEquipmentAlias, "_", common.ContainerName);
result.AppendLine("ExportFileVersion=1.0.6");
result.AppendLine("ExportFromTabsheet=Run-Keynumbers");
result.AppendLine("FeatureName\tShortName\tChamber\tComments\tVarMode\tPara\tExclude0\tTrigOn1\tTrigOn2\tTrigOn3\tTrigOff1\tTrigOff2\tTrigOff3\tTrigDelay\tTrigNorm\tTrigNvl\tTrigTrg\tAddCondOn\tActive\tFilter1\tFilter2\tFilter3\tFilter4\tUnit\tId\tWorkcenterId\tSite\tArea\tWorkcenter\tUsername\tValidFrom\tValidTo");
for (int i = 0; i < common.Parameters.Count; i++)
if (recordStart is null && common.Parameters[i][3] == "RECORD_START")
recordStart = i;
if (recordStart.HasValue && common.Parameters[i][0] == "True")
{
if (common.Parameters[i][0] == "True")
if (useAlias && !string.IsNullOrEmpty(common.Parameters[i][3]))
name = common.Parameters[i][3].Replace("'", string.Empty);
else
{
segments = common.Parameters[i][2].Split('/');
parameter = segments[segments.Length - 1];
if (parameter.Length < 35)
parameterSub35 = parameter;
else
parameterSub35 = parameter.Substring(0, 35);
if (parameter.Length < 21)
parameterSub21 = parameter;
else
parameterSub21 = parameter.Substring(0, 21);
result.Append(parameterSub21).Append("_MIN\t").Append(parameterSub21).Append("_MIN\t\t\tMIN\t").Append(parameterSub35).AppendLine("\t0\tTIME\t=\tRUNSTART\tTIME\t=\tRUNEND\t\t\t\t\t\t1\t\t\t\t\t\t-1\t-1\t\t\t\tECPHARES\t5/2/2017 2:44 PM");
name = segments[^1];
}
_ = result.Append(" <Field Name=\"").Append(name).Append("\" ColumnNumber=\"").Append(i + common.LogisticsColumns.Count + 2).Append("\" StartPosition=\"\" Length=\"\" DataType=\"Text\" NullReplacement=\"\" />").AppendLine();
}
result.AppendLine();
result.AppendLine();
result.AppendLine();
for (int i = 0; i < common.Parameters.Count; i++)
{
if (common.Parameters[i][0] == "True")
{
segments = common.Parameters[i][2].Split('/');
parameter = segments[segments.Length - 1];
result.Append(parameter).Append("_MIN\t").Append(parameter).Append("_MIN\t\t\tMIN\t").Append(parameter).AppendLine("\t0\tTIME\t=\tRUNSTART\tTIME\t=\tRUNEND\t\t\t\t\t\t1\t\t\t\t\t\t-1\t-1\t\t\t\tECPHARES\t5/2/2017 2:44 PM");
}
}
return result.ToString();
}
_ = result.AppendLine(" </Fields>");
_ = result.AppendLine(" <Conditions>");
_ = result.AppendLine(" <Column />");
_ = result.AppendLine(" <Row>");
_ = result.AppendLine(" <Condition>");
_ = result.AppendLine(" <SkipHeaderCount>7</SkipHeaderCount>");
_ = result.AppendLine(" <SkipRowFilter>0</SkipRowFilter>");
_ = result.AppendLine(" <SkipRowValue>");
_ = result.AppendLine(" </SkipRowValue>");
_ = result.AppendLine(" </Condition>");
_ = result.AppendLine(" </Row>");
_ = result.AppendLine(" </Conditions>");
_ = result.AppendLine("</Format>");
return result.ToString();
}
internal static string GetEdaObjectToAPCParameter(string edaObjectFile, Common common)
{
StringBuilder result = new();
if (string.IsNullOrEmpty(edaObjectFile))
{ }
string parameter;
string[] segments;
string parameterSub35;
_ = result.AppendLine("ExportFileVersion=1.0.6");
_ = result.AppendLine("ExportFromTabsheet=Para");
_ = result.AppendLine("FieldName\tLongName\tMatchMode\tEquipment\tName\tPdsfNameConvCol\tPdsfNameDataType\tType\tChamberInfo\tUnifiedPara\tDateFormat\tUsername\tId\tWorkcenterId\tSite\tArea\tWorkcenter\tValidFrom\tValidTo");
_ = result.AppendLine("TIME_PREV_DIFF\tTIME_PREV_DIFF\tEXACT\t*\tTIME_PREV_DIFF\t\tNUMERIC\tRUN\t\tTIME_PREV_DIFF\t\tPHARES\t95069\t4571\tMesa\t\t\t4/15/2020 6:10 PM");
_ = result.AppendLine("TIME\tTIME\tEXACT\t*\tTIME\t\tNUMERIC\tRUN\t\tTIME\t\tPHARES\t95070\t4571\tMesa\t\t\t4/15/2020 6:10 PM");
for (int i = 0; i < common.Parameters.Count; i++)
{
if (common.Parameters[i][0] == "True")
{
segments = common.Parameters[i][2].Split('/');
parameter = segments[^1];
if (parameter.Length < 35)
parameterSub35 = parameter;
else
parameterSub35 = parameter[..35];
_ = result.Append(parameterSub35).Append("\tDIVERSE\tEXACT\t*\t").Append(parameterSub35).AppendLine("\t\tNUMERIC\tRUN\t\t\t\tPHARES\t9000000012\t4571\tMesa\t\t\t4/15/2020 6:10 PM");
}
}
_ = result.AppendLine();
_ = result.AppendLine();
_ = result.AppendLine();
for (int i = 0; i < common.Parameters.Count; i++)
{
if (common.Parameters[i][0] == "True")
{
segments = common.Parameters[i][2].Split('/');
parameter = segments[^1];
_ = result.Append(parameter).Append("\tDIVERSE\tEXACT\t*\t").Append(parameter).AppendLine("\t\tNUMERIC\tRUN\t\t\t\tPHARES\t9000000012\t4571\tMesa\t\t\t4/15/2020 6:10 PM");
}
}
return result.ToString();
}
internal static string GetEdaObjectToAPCRunKeyNumber(string edaObjectFile, Common common)
{
StringBuilder result = new();
if (string.IsNullOrEmpty(edaObjectFile))
{ }
string parameter;
string[] segments;
string parameterSub21;
string parameterSub35;
_ = result.AppendLine("ExportFileVersion=1.0.6");
_ = result.AppendLine("ExportFromTabsheet=Run-Keynumbers");
_ = result.AppendLine("FeatureName\tShortName\tChamber\tComments\tVarMode\tPara\tExclude0\tTrigOn1\tTrigOn2\tTrigOn3\tTrigOff1\tTrigOff2\tTrigOff3\tTrigDelay\tTrigNorm\tTrigNvl\tTrigTrg\tAddCondOn\tActive\tFilter1\tFilter2\tFilter3\tFilter4\tUnit\tId\tWorkcenterId\tSite\tArea\tWorkcenter\tUsername\tValidFrom\tValidTo");
for (int i = 0; i < common.Parameters.Count; i++)
{
if (common.Parameters[i][0] == "True")
{
segments = common.Parameters[i][2].Split('/');
parameter = segments[^1];
if (parameter.Length < 35)
parameterSub35 = parameter;
else
parameterSub35 = parameter[..35];
if (parameter.Length < 21)
parameterSub21 = parameter;
else
parameterSub21 = parameter[..21];
_ = result.Append(parameterSub21).Append("_MIN\t").Append(parameterSub21).Append("_MIN\t\t\tMIN\t").Append(parameterSub35).AppendLine("\t0\tTIME\t=\tRUNSTART\tTIME\t=\tRUNEND\t\t\t\t\t\t1\t\t\t\t\t\t-1\t-1\t\t\t\tECPHARES\t5/2/2017 2:44 PM");
}
}
_ = result.AppendLine();
_ = result.AppendLine();
_ = result.AppendLine();
for (int i = 0; i < common.Parameters.Count; i++)
{
if (common.Parameters[i][0] == "True")
{
segments = common.Parameters[i][2].Split('/');
parameter = segments[^1];
_ = result.Append(parameter).Append("_MIN\t").Append(parameter).Append("_MIN\t\t\tMIN\t").Append(parameter).AppendLine("\t0\tTIME\t=\tRUNSTART\tTIME\t=\tRUNEND\t\t\t\t\t\t1\t\t\t\t\t\t-1\t-1\t\t\t\tECPHARES\t5/2/2017 2:44 PM");
}
}
return result.ToString();
}
}

View File

@ -1,164 +1,173 @@
using EDAViewer.Singleton.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EDAViewer.Singleton.Helper
namespace EDAViewer.Singleton.Helper;
[Serializable]
public class Common
{
[Serializable]
public class Common
public string? ConfigurationProductiveState { get; set; }
public string? ConfigurationState { get; set; }
public string? ContainerName { get; set; }
public ModuleInstanceTypeName? ObjectType { get; set; }
public string? UnitName { get; set; }
//
public string Filename { get; set; }
public string StartTimeFormat { get; set; }
public string StoragePath { get; set; }
//
public List<string[]> GeneralTriggers { get; set; }
public List<string[]> LogisticsAttributes { get; set; }
public List<string[]> LogisticsColumns { get; set; }
public string LogisticsEquipmentAlias { get; set; }
public List<string?[]> LogisticsTriggers { get; set; }
public Dictionary<int, List<string[]>> LogisticsTriggersCallDefinitionAttributes { get; set; }
public Dictionary<int, string[]> LogisticsTriggersKeysKeyMapping { get; set; }
public List<string[]> Parameters { get; set; }
public string ParametersAsCsv { get; set; }
public string Source { get; set; }
public List<string[]> StartTriggersDCP { get; set; }
public List<string[]> StopTriggersDCP { get; set; }
[Obsolete("Only for DeserializeObject")]
public Common()
{
ObjectType = null;
Parameters = new();
Source = string.Empty;
Filename = string.Empty;
GeneralTriggers = new();
StopTriggersDCP = new();
UnitName = string.Empty;
LogisticsColumns = new();
StartTriggersDCP = new();
LogisticsTriggers = new();
StoragePath = string.Empty;
LogisticsAttributes = new();
ContainerName = string.Empty;
ParametersAsCsv = string.Empty;
StartTimeFormat = string.Empty;
ConfigurationState = string.Empty;
LogisticsEquipmentAlias = string.Empty;
ConfigurationProductiveState = string.Empty;
LogisticsTriggersKeysKeyMapping = new Dictionary<int, string[]>();
LogisticsTriggersCallDefinitionAttributes = new Dictionary<int, List<string[]>>();
}
public ModuleInstanceTypeName? ObjectType { get; set; }
public string ConfigurationState { get; set; }
public string ConfigurationProductiveState { get; set; }
public string UnitName { get; set; }
public string ContainerName { get; set; }
public Common(ModuleInstanceTypeName objectType, object unitName, object containerName, object configurationState, object configurationProductiveState)
{
Parameters = new();
Source = string.Empty;
Filename = string.Empty;
GeneralTriggers = new();
ObjectType = objectType;
StopTriggersDCP = new();
LogisticsColumns = new();
StartTriggersDCP = new();
LogisticsTriggers = new();
StoragePath = string.Empty;
LogisticsAttributes = new();
ParametersAsCsv = string.Empty;
StartTimeFormat = string.Empty;
UnitName = unitName.ToString();
LogisticsEquipmentAlias = string.Empty;
ContainerName = containerName.ToString();
ConfigurationState = configurationState.ToString();
LogisticsTriggersKeysKeyMapping = new Dictionary<int, string[]>();
ConfigurationProductiveState = configurationProductiveState.ToString();
LogisticsTriggersCallDefinitionAttributes = new Dictionary<int, List<string[]>>();
}
public void Update(PDSFConfiguration configuration)
{
StoragePath = configuration.Settings.StoragePath;
StartTimeFormat = configuration.Settings.StartTimeFormat;
Filename = configuration.Settings.Filename;
//
public string StoragePath { get; set; }
public string StartTimeFormat { get; set; }
public string Filename { get; set; }
//
public string Source { get; set; }
public string LogisticsEquipmentAlias { get; set; }
public List<string[]> LogisticsAttributes { get; set; }
public List<string[]> LogisticsColumns { get; set; }
public List<string[]> Parameters { get; set; }
public string ParametersAsCsv { get; set; }
public List<string[]> GeneralTriggers { get; set; }
public List<string[]> StartTriggersDCP { get; set; }
public List<string[]> LogisticsTriggers { get; set; }
public Dictionary<int, string[]> LogisticsTriggersKeysKeyMapping { get; set; }
public Dictionary<int, List<string[]>> LogisticsTriggersCallDefinitionAttributes { get; set; }
public List<string[]> StopTriggersDCP { get; set; }
[Obsolete("Only for DeserializeObject")]
public Common()
Source = configuration.DataCollection.Source;
LogisticsEquipmentAlias = configuration.DataCollection.Logistics.EquipmentAlias;
//if (LogisticsEquipmentAlias == "R47-PLC")
//{ }
foreach (PDSFConfigurationDataCollectionLogisticsAttribute item in (from l in configuration.DataCollection.Logistics.Attributes orderby l.Use descending, l.Order select l))
LogisticsAttributes.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.Key, item.Placeholder });
foreach (PDSFConfigurationDataCollectionLogisticsColumn item in configuration.DataCollection.Logistics.Columns)
LogisticsColumns.Add(new string[] { item.ID.ToString(), item.Prefix });
foreach (PDSFConfigurationDataCollectionParameter1 item in (from l in configuration.DataCollection.VirtualParameters orderby l.Use descending, l.Order select l))
{
ObjectType = null;
ConfigurationState = string.Empty;
ConfigurationProductiveState = string.Empty;
UnitName = string.Empty;
ContainerName = string.Empty;
CommonLogic();
}
public Common(ModuleInstanceTypeName objectType, object unitName, object containerName, object configurationState, object configurationProductiveState)
{
ObjectType = objectType;
ConfigurationState = configurationState.ToString();
ConfigurationProductiveState = configurationProductiveState.ToString();
UnitName = unitName.ToString();
ContainerName = containerName.ToString();
CommonLogic(configurationState.ToString(), configurationProductiveState.ToString(), unitName.ToString(), containerName.ToString());
}
private void CommonLogic(string configurationState = "", string configurationProductiveState = "", string unitName = "", string containerame = "")
{
LogisticsAttributes = new List<string[]>();
LogisticsColumns = new List<string[]>();
Parameters = new List<string[]>();
ParametersAsCsv = string.Empty;
GeneralTriggers = new List<string[]>();
StartTriggersDCP = new List<string[]>();
LogisticsTriggers = new List<string[]>();
LogisticsTriggersKeysKeyMapping = new Dictionary<int, string[]>();
LogisticsTriggersCallDefinitionAttributes = new Dictionary<int, List<string[]>>();
StopTriggersDCP = new List<string[]>();
}
public void Update(PDSFConfiguration configuration)
{
StoragePath = configuration.Settings.StoragePath;
StartTimeFormat = configuration.Settings.StartTimeFormat;
Filename = configuration.Settings.Filename;
//
Source = configuration.DataCollection.Source;
LogisticsEquipmentAlias = configuration.DataCollection.Logistics.EquipmentAlias;
//if (LogisticsEquipmentAlias == "R47-PLC")
//{ }
foreach (PDSFConfigurationDataCollectionLogisticsAttribute item in (from l in configuration.DataCollection.Logistics.Attributes orderby l.Use descending, l.Order select l))
LogisticsAttributes.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.Key, item.Placeholder });
foreach (PDSFConfigurationDataCollectionLogisticsColumn item in configuration.DataCollection.Logistics.Columns)
LogisticsColumns.Add(new string[] { item.ID.ToString(), item.Prefix });
foreach (PDSFConfigurationDataCollectionParameter1 item in (from l in configuration.DataCollection.VirtualParameters orderby l.Use descending, l.Order select l))
if (string.IsNullOrEmpty(item.Alias) && !string.IsNullOrEmpty(item.Conditions.ConditionModel.Name))
{
if (string.IsNullOrEmpty(item.Alias) && !string.IsNullOrEmpty(item.Conditions.ConditionModel.Name))
{
if (item.Use)
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Conditions.ConditionModel.Name, item.HardWareId, item.Description, item.Conditions.ConditionModel.Formula, true.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
else
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Conditions.ConditionModel.Name, item.HardWareId, item.Description, string.Empty, true.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
}
if (item.Use)
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Conditions.ConditionModel.Name, item.HardWareId, item.Description, item.Conditions.ConditionModel.Formula, true.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
else
{
if (item.Use)
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Alias, item.HardWareId, item.Description, item.Conditions.ConditionModel.Formula, true.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
else
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Alias, item.HardWareId, item.Description, string.Empty, true.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
}
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Conditions.ConditionModel.Name, item.HardWareId, item.Description, string.Empty, true.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
}
foreach (PDSFConfigurationDataCollectionParameter item in (from l in configuration.DataCollection.Parameters orderby l.Use descending, l.Order select l))
else
{
if (string.IsNullOrEmpty(item?.Alias) && !string.IsNullOrEmpty(item?.Conditions?.ConditionModel?.Name))
{
if (item.Use)
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Conditions.ConditionModel.Name, item.HardWareId, item.Description, item.Conditions.ConditionModel.Formula, false.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
else
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Conditions.ConditionModel.Name, item.HardWareId, item.Description, string.Empty, false.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
}
if (item.Use)
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Alias, item.HardWareId, item.Description, item.Conditions.ConditionModel.Formula, true.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
else
{
if (item.Use)
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Alias, item.HardWareId, item.Description, item.Conditions.ConditionModel.Formula, false.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
else
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Alias, item.HardWareId, item.Description, string.Empty, false.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
}
}
Parameters = (from l in Parameters orderby l[0] descending, l[1] select l).ToList();
StringBuilder text = new StringBuilder();
//text.AppendLine("\"AliasName\";\"Condition\";\"EventId\";\"ExceptionId\";\"Formula\";\"HardwareId\";\"OrderId\";\"ParameterName\";\"Remark\";\"ReportName\";\"SourceId\";\"Use\"");
//"Test";"";"";"";"";"";"1";"MICROSCOPE01/MET08MESMICROSCOPE/Test";"";"MICROSCOPE01/MET08MESMICROSCOPE/FileRead";"";"True""
text.AppendLine("\"Use\";\"OrderId\";\"ReportName\";\"ParameterName\";\"AliasName\";\"HardwareId\";\"Remark\";\"Formula\"");
foreach (string[] item in Parameters)
{
for (int i = 0; i < 7; i++)
text.Append("\"").Append(item[i]).Append("\";");
text.Remove(text.Length - 1, 1);
text.AppendLine();
}
ParametersAsCsv = text.ToString();
foreach (PDSFConfigurationDataCollectionGeneralTriggers item in configuration.DataCollection.GeneralTriggers)
{
foreach (PDSFConfigurationDataCollectionGeneralTriggersVariableModel gv in item.GlobalVariables)
GeneralTriggers.Add(new string[] { item.Name, gv.Name, gv.ParameterName, gv.Formula });
}
{
PDSFConfigurationDataCollectionStartTriggersDCP item = configuration.DataCollection.StartTriggers.DCP;
if (!(item is null))
StartTriggersDCP.Add(new string[] { item.Name, item.Rule, item.ResolveGlobalVariableBeforeTrigger.ToString() });
}
if (!(configuration.DataCollection.Logistics.Triggers.UpdateTrigger is null))
{
foreach (PDSFConfigurationDataCollectionLogisticsTriggersUpdateTriggerLogisticRequest item in configuration.DataCollection.Logistics.Triggers.UpdateTrigger.LogisticRequest)
{
LogisticsTriggers.Add(new string[] { item.Name.ToString(), item.LogisticsColumn.Fixed.ToString(), item.Rule, item.Keys.Scenario, item.Keys.DefaultJobIndex.ToString(), item.Keys.DefaultCarrierIndex.ToString(), item.Keys.DefaultSlotIndex.ToString(), item.DataPool.ToString() });
if (!(item.Keys.KeyMapping is null))
LogisticsTriggersKeysKeyMapping.Add(item.Name, new string[] { item.Keys.KeyMapping.KeyName, item.Keys.KeyMapping.ParameterName, item.Keys.KeyMapping.Formula });
LogisticsTriggersCallDefinitionAttributes.Add(item.Name, new List<string[]>());
foreach (PDSFConfigurationDataCollectionLogisticsTriggersUpdateTriggerLogisticRequestCallDefinitionLogisticCallDefinitionAttribute att in item.CallDefinition.Attributes)
LogisticsTriggersCallDefinitionAttributes[item.Name].Add(new string[] { att.LogisticsKey, att.Source, att.MappedParameterName, att.Formula });
}
}
{
PDSFConfigurationDataCollectionStopTriggersDCP item = configuration.DataCollection.StopTriggers.DCP;
if (!(item is null))
StopTriggersDCP.Add(new string[] { item.Name, item.Rule, item.ResolveGlobalVariableBeforeTrigger.ToString(), item.ResetGlobalVariablesAfterTrigger.ToString() });
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Alias, item.HardWareId, item.Description, string.Empty, true.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
}
}
foreach (PDSFConfigurationDataCollectionParameter item in (from l in configuration.DataCollection.Parameters orderby l.Use descending, l.Order select l))
{
if (string.IsNullOrEmpty(item?.Alias) && !string.IsNullOrEmpty(item?.Conditions?.ConditionModel?.Name))
{
if (item.Use)
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Conditions.ConditionModel.Name, item.HardWareId, item.Description, item.Conditions.ConditionModel.Formula, false.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
else
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Conditions.ConditionModel.Name, item.HardWareId, item.Description, string.Empty, false.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
}
else
{
if (item is null)
continue;
if (item.Use)
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Alias, item.HardWareId, item.Description, item.Conditions.ConditionModel.Formula, false.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
else
Parameters.Add(new string[] { item.Use.ToString(), item.Order.ToString("000"), item.FullName, item.Alias, item.HardWareId, item.Description, string.Empty, false.ToString(), (configuration.DataCollection.Logistics.Columns.Length + 1 + item.Order).ToString("000") });
}
}
Parameters = (from l in Parameters orderby l[0] descending, l[1] select l).ToList();
StringBuilder text = new();
//text.AppendLine("\"AliasName\";\"Condition\";\"EventId\";\"ExceptionId\";\"Formula\";\"HardwareId\";\"OrderId\";\"ParameterName\";\"Remark\";\"ReportName\";\"SourceId\";\"Use\"");
//"Test";"";"";"";"";"";"1";"MICROSCOPE01/MET08MESMICROSCOPE/Test";"";"MICROSCOPE01/MET08MESMICROSCOPE/FileRead";"";"True""
_ = text.AppendLine("\"Use\";\"OrderId\";\"ReportName\";\"ParameterName\";\"AliasName\";\"HardwareId\";\"Remark\";\"Formula\"");
foreach (string[] item in Parameters)
{
for (int i = 0; i < 7; i++)
_ = text.Append('"').Append(item[i]).Append("\";");
_ = text.Remove(text.Length - 1, 1);
_ = text.AppendLine();
}
ParametersAsCsv = text.ToString();
foreach (PDSFConfigurationDataCollectionGeneralTriggers item in configuration.DataCollection.GeneralTriggers)
{
foreach (PDSFConfigurationDataCollectionGeneralTriggersVariableModel gv in item.GlobalVariables)
GeneralTriggers.Add(new string[] { item.Name, gv.Name, gv.ParameterName, gv.Formula });
}
{
PDSFConfigurationDataCollectionStartTriggersDCP item = configuration.DataCollection.StartTriggers.DCP;
if (item is not null)
StartTriggersDCP.Add(new string[] { item.Name, item.Rule, item.ResolveGlobalVariableBeforeTrigger.ToString() });
}
if (configuration.DataCollection.Logistics.Triggers.UpdateTrigger is not null)
{
foreach (PDSFConfigurationDataCollectionLogisticsTriggersUpdateTriggerLogisticRequest item in configuration.DataCollection.Logistics.Triggers.UpdateTrigger.LogisticRequest)
{
LogisticsTriggers.Add(new string?[] { item.Name.ToString(), item.LogisticsColumn.Fixed.ToString(), item.Rule, item.Keys.Scenario, item.Keys.DefaultJobIndex.ToString(), item.Keys.DefaultCarrierIndex.ToString(), item.Keys.DefaultSlotIndex.ToString(), item.DataPool.ToString() });
if (item.Keys.KeyMapping is not null)
LogisticsTriggersKeysKeyMapping.Add(item.Name, new string[] { item.Keys.KeyMapping.KeyName, item.Keys.KeyMapping.ParameterName, item.Keys.KeyMapping.Formula });
LogisticsTriggersCallDefinitionAttributes.Add(item.Name, new());
foreach (PDSFConfigurationDataCollectionLogisticsTriggersUpdateTriggerLogisticRequestCallDefinitionLogisticCallDefinitionAttribute att in item.CallDefinition.Attributes)
LogisticsTriggersCallDefinitionAttributes[item.Name].Add(new string[] { att.LogisticsKey, att.Source, att.MappedParameterName, att.Formula });
}
}
{
PDSFConfigurationDataCollectionStopTriggersDCP item = configuration.DataCollection.StopTriggers.DCP;
if (item is not null)
StopTriggersDCP.Add(new string[] { item.Name, item.Rule, item.ResolveGlobalVariableBeforeTrigger.ToString(), item.ResetGlobalVariablesAfterTrigger.ToString() });
}
}
}

View File

@ -1,8 +1,6 @@
namespace EDAViewer.Singleton.Helper
{
public enum ModuleInstanceTypeName
{
Pdsf
}
namespace EDAViewer.Singleton.Helper;
public enum ModuleInstanceTypeName
{
Pdsf
}

View File

@ -1,28 +0,0 @@
using EDAViewer.Models;
using Microsoft.Extensions.Logging;
using Shared;
using System;
using System.Collections.Generic;
using System.Net;
namespace EDAViewer.Singleton
{
public interface IBackground : Models.IBackground, IDisposable
{
void ClearMessage();
void SendStatusOk();
string Message { get; }
bool IsPrimaryInstance();
void SetIsPrimaryInstance();
void ClearIsPrimaryInstance();
string WorkingDirectory { get; }
List<Exception> Exceptions { get; }
void Update(ILogger<object> logger);
string GetCountDirectory(string verb);
void LogPathCleanUpByWeek(string server, bool isEDA = false, bool isNA = false);
}
}

View File

@ -1,156 +0,0 @@
using EDAViewer.HostedService;
using EDAViewer.Models;
using EDAViewer.Singleton;
using Helper.Log;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
using Shared;
using System;
using System.IO;
using System.Net;
using System.Reflection;
namespace EDAViewer
{
public class Startup
{
private Background _Background;
private AppSettings _AppSettings;
private readonly IsEnvironment _IsEnvironment;
private readonly IConfiguration _Configuration;
private readonly IWebHostEnvironment _WebHostEnvironment;
public Startup(IConfiguration configuration, IWebHostEnvironment webHostEnvironment)
{
_Configuration = configuration;
_WebHostEnvironment = webHostEnvironment;
_IsEnvironment = new IsEnvironment(webHostEnvironment.IsDevelopment(), webHostEnvironment.IsStaging(), webHostEnvironment.IsProduction());
}
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
LogLevel defaultLogLevel;
LogLevel log4netLogLevel;
IConfigurationSection configurationSection;
configurationSection = _Configuration.GetSection("Logging:LogLevel:Default");
if (configurationSection is null || configurationSection.Value is null)
defaultLogLevel = LogLevel.Debug;
else if (!Enum.TryParse<LogLevel>(configurationSection.Value, out defaultLogLevel))
defaultLogLevel = LogLevel.Debug;
configurationSection = _Configuration.GetSection("Logging:LogLevel:Log4netProvider");
if (configurationSection is null || configurationSection.Value is null)
log4netLogLevel = defaultLogLevel;
else if (!Enum.TryParse<LogLevel>(configurationSection.Value, out log4netLogLevel))
log4netLogLevel = defaultLogLevel;
_AppSettings = _Configuration.Get<AppSettings>();
if (!_IsEnvironment.Production)
_AppSettings.Server = _AppSettings.Server.Replace('.', '_');
if (string.IsNullOrEmpty(_AppSettings.WorkingDirectoryName))
throw new Exception("Working directory name must have a value!");
Assembly assembly = Assembly.GetExecutingAssembly();
string workingDirectory = Log.GetWorkingDirectory(assembly.GetName().Name, _AppSettings.WorkingDirectoryName);
services.AddLogging(logging =>
{
logging.AddProvider(new DebugProvider(defaultLogLevel));
logging.AddProvider(new ConsoleProvider(defaultLogLevel));
logging.AddProvider(new Log4netProvider(typeof(Startup), log4netLogLevel, workingDirectory));
});
services.AddDirectoryBrowser();
services.AddControllersWithViews().AddRazorRuntimeCompilation();
services.AddServerSideBlazor();
// services.AddSingleton<WebClient, WebClient>();
// services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
_Background = new Background(_IsEnvironment, _AppSettings, workingDirectory);
services.AddSingleton<Singleton.IBackground, Background>(b => _Background);
services.AddSingleton<AppSettings, AppSettings>(appSettings => _AppSettings);
services.AddSingleton<IsEnvironment, IsEnvironment>(isEnvironment => _IsEnvironment);
services.AddHostedService(t => new TimedHostedService(_IsEnvironment, _Background, t.GetRequiredService<IServiceProvider>()));
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "EDAViewer", Version = "v1" });
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime)
{
if (env.IsDevelopment())
{
if (string.IsNullOrEmpty(_AppSettings.URLs))
{
Environment.ExitCode = -1;
lifetime.StopApplication();
}
app.UseDeveloperExceptionPage();
app.UseSwagger(c =>
{
c.SerializeAsV2 = true;
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "EDA Viewer API V1");
c.RoutePrefix = string.Empty;
});
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days.
// You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
app.UseSwagger(c =>
{
c.SerializeAsV2 = true;
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/EDAViewer/swagger/v1/swagger.json", "EDA Viewer API V1");
c.RoutePrefix = string.Empty;
});
}
app.UseDirectoryBrowser(new DirectoryBrowserOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(env.WebRootPath, "images")),
RequestPath = "/MyImages"
});
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
//endpoints.MapBlazorHub();
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}

View File

@ -1,47 +0,0 @@
@using EDAViewer.Controllers
@{
ViewBag.Title = "Background";
int i = 0;
string homeController = nameof(HomeController).Replace("Controller", string.Empty);
}
<div class="jumbotron">
<h1>EDA - @(ViewBag.IsPrimaryInstance) - @(ViewBag.Profile) - @(ViewBag.URLs) - 013</h1>
<p class="lead">@(ViewBag.WorkingDirectory)</p>
<p class="lead">@(ViewBag.Message)</p>
<h1>@(ViewBag.ExceptionsCount)</h1>
</div>
<div>
<ul>
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))">Background Message</a></li>
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-message_clear="true">Background Message Clear</a></li>
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-exceptions_clear="true">Background Exceptions Clear</a></li>
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-set_is_primary_instance="true">Background Set Is Primary Instance</a></li>
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-set_is_primary_instance="false">Background Clear Primary Instance</a></li>
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-invoke_eda_dcp="100">Background Invoke EDA DCP Plans Timer Change</a></li>
</ul>
</div>
<p>&nbsp;</p>
<hr />
<div>
<form action="">
@foreach (Exception exception in ViewBag.Exceptions)
{
<p>
@Html.Raw(string.Concat("<textarea name=\"message_", i, "\" rows='1' cols='400'>", exception.Message, "</textarea>"));
</p>
<p>
@Html.Raw(string.Concat("<textarea name=\"stackTrace_", i, "\" rows='4' cols='400'>", exception.StackTrace, "</textarea>"));
</p>
<hr />
@(i += 1);
}
</form>
</div>
@section scripts {
<script>
$(function () {
console.log("ready!");
});
</script>
}

View File

@ -1,12 +0,0 @@
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
<div>
<component render-mode="ServerPrerendered" type="typeof(EDAViewer.Blazor.Counter)" />
</div>

View File

@ -1,6 +0,0 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>

View File

@ -1,182 +0,0 @@
@model EDAViewer.Models.EdaHtmlDiff
@{
ViewBag.Title = "EDA HTML Diff";
string idForm = "Form";
string idSubmit = "Submit";
string idUp = "Up";
string idRoot = "Root";
string idRefresh = "Refresh";
string background = "Background"; //Background
string viewEdaHtmlDiff = "ViewEdaHtmlDiff"; //ViewEdaHtmlDiff
string actionNameForForm = nameof(EDAViewer.Controllers.HomeController.ViewEdaHtmlDiff);
string actionNameForList = nameof(EDAViewer.Controllers.HomeController.GetDirectoriesOrFiles);
string homeController = nameof(EDAViewer.Controllers.HomeController).Replace("Controller", string.Empty);
}
<div class="jumbotron">
<h1>@(ViewBag.Message)</h1>
</div>
<div>
@Html.Raw(ViewBag.Diff)
<hr />
@Html.Raw(ViewBag.OldText)
<hr />
@Html.Raw(ViewBag.NewText)
<hr />
<div style="min-height:44px;">
<button id="@(idRoot)" style="margin-left: 50px; margin-bottom:10px" class="btn btn-info">Root Directory</button>
<button id="@(idUp)" style="margin-left: 50px; margin-bottom:10px" class="btn btn-info">Up Directory</button>
<button id="@(idRefresh)" style="margin-left: 50px; margin-bottom:10px" class="btn btn-info">Refresh List</button>
</div>
@using (Html.BeginForm(actionNameForForm, homeController, FormMethod.Post, new { id = idForm }))
{
@Html.AntiForgeryToken();
@Html.ValidationSummary(true);
@Html.HiddenFor(m => m.user_name)
@Html.HiddenFor(m => m.machine_name)
@Html.HiddenFor(m => m.now_ticks)
@Html.HiddenFor(m => m.PathAndFileName)
@Html.HiddenFor(m => m.Paths)
<p>
@Html.LabelFor(m => m.CurrentPath)
@Html.DropDownListFor(m => m.CurrentPath, new SelectList(Enumerable.Empty<SelectListItem>()), htmlAttributes: new { style = "min-width:600px" })
@Html.ValidationMessageFor(m => m.CurrentPath)
</p>
<p>
@Html.LabelFor(m => m.FileName)
@Html.TextBoxFor(m => m.FileName, htmlAttributes: new { style = "min-width:600px" })
@Html.ValidationMessageFor(m => m.FileName)
</p>
<br />
<input type="submit" value="Save" id="@(idSubmit)" class="btn btn-default" />
}
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.RouteLink("View EDA HTML Diff", new { action = viewEdaHtmlDiff, controller = homeController })</li>
<li>@Html.RouteLink("Background Invoke EDA DCP Plans Timer Change", new { action = background, controller = homeController, invoke_eda_dcp = 100 })</li>
</ul>
</div>
@section scripts {
<script>
//
function getEncodedLastPath() {
var encodedPath;
var control = "@(nameof(Model.Paths))";
encodedPath = $("#" + control).val().substr(0, $("#" + control).val().lastIndexOf("|"));
$("#" + control).val(encodedPath)
encodedPath = encodeURIComponent($("#" + control).val());
return encodedPath;
}
//
function getEncodedCurrentPath() {
var encodedPath;
var control = "@(nameof(Model.CurrentPath))";
var pathSelected = $("#" + control).val();
if (pathSelected == null) {
encodedPath = "";
}
else {
$("#@(nameof(Model.FileName))").val($("#" + control + " option:selected").text());
$("#@(nameof(Model.PathAndFileName))").val(pathSelected);
encodedPath = encodeURIComponent(pathSelected);
}
return encodedPath;
}
//
function setList(prefix, encodedPath, upDirectory) {
var actionName = prefix + "@(actionNameForList)?path=" + encodedPath + "&upDirectory=" + upDirectory + "&filter=";
$('select').empty();
$("#@(idUp)").hide();
$("#@(idRoot)").hide();
$("#@(idRefresh)").hide();
$("#@(nameof(Model.CurrentPath))").hide();
//
$.ajax({
url: actionName,
type: "GET",
contentType: "application/json; charset=utf-8",
datatype: JSON,
success: function (result) {
if (result.length > 7000) {
setList("../", encodedPath, upDirectory);
}
else {
var control = "@(nameof(Model.CurrentPath))";
$(result).each(function (index, value) {
$("#" + control).append($("<option></option>").val(value.value).html(value.text));
});
console.log("results lenght {" + result.length + "}");
if (result.length == 1) {
console.log("selecting first option");
$("select#elem").attr('selectedIndex', 0);
console.log("selected first option");
}
$("#@(nameof(Model.CurrentPath))").show();
$("#@(idRefresh)").show();
$("#@(idRoot)").show();
$("#@(idUp)").show();
}
},
error: function (data) {
console.log(data);
},
always: function (data) {
$("#@(nameof(Model.CurrentPath))").show();
$("#@(idRefresh)").show();
$("#@(idRoot)").show();
$("#@(idUp)").show();
}
});
}
$(document).ready(function () {
//
console.log("ready!");
//
$("#@(idRefresh)").click(function (e) {
$('#message').html('');
var encodedPath = getEncodedCurrentPath();
setList("", encodedPath, false);
});
//
$("#@(idUp)").click(function (e) {
$('#message').html('');
var encodedPath = getEncodedLastPath();
setList("", encodedPath, true);
});
//
$("#@(idRoot)").click(function (e) {
$('#message').html('');
var encodedPath = "";
setList("", encodedPath, false);
});
//
$("#@(idSubmit)").click(function (e) {
//$("#@(idSubmit)").hide();
//e.preventDefault();
});
//
$("select").change(function () {
var str = "";
$("select option:selected").each(function () {
str += $(this).text() + " ";
});
console.debug(str);
if (str.length > 0) {
var control = "@(nameof(Model.CurrentPath))";
var encodedPath = getEncodedCurrentPath();
if (encodedPath.length > 0) {
var pathsValue =$("#@(nameof(Model.Paths))").val();
$("#@(nameof(Model.Paths))").val(pathsValue + "|" + $("#" + control).val());
}
setList("", encodedPath, false);
}
}).change();
//
$("#@(idForm)").removeAttr("novalidate");
//
setList("", encodeURIComponent("@(Model.CurrentPath.Replace(@"\",@"\\"))"), false);
//
});
</script>
}

View File

@ -1,25 +0,0 @@
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>

View File

@ -1,71 +0,0 @@
@using EDAViewer.Controllers
@{
string index = nameof(HomeController.Index);
string privacy = nameof(HomeController.Privacy);
string background = nameof(HomeController.Background);
string homeController = nameof(HomeController).Replace("Controller", string.Empty);
string schemeHostURL = string.Concat(Context.Request.Scheme, "://", Context.Request.Host);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@await RenderSectionAsync("Meta", required: false)
<title>@ViewData["Title"] - EDAViewer</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<environment exclude="Staging,Development">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="@(schemeHostURL)/Common%20Shared%20Repository/HTML5Shiv/3.7.2/html5shiv.js"></script>
<script src="@(schemeHostURL)/Common%20Shared%20Repository/Respond/1.4.2/respond.js"></script>
<![endif]-->
</environment>
<link href="~/css/bundles/css.css" rel="stylesheet" />
<base href="~/" />
@await RenderSectionAsync("Style", required: false)
<script src="~/js/bundles/modernizr.js"></script>
</head>
<body>
<header>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" asp-area="" asp-controller="@(homeController)" asp-action="@(index)">EDA Viewer</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="@(homeController)" asp-action="@(background)">Background</a>
</li>
</ul>
</div>
</div>
</div>
</header>
<div class="container body-content">
@RenderBody()
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2021 - EDAViewer - <a asp-area="" asp-controller="@(homeController)" asp-action="@(privacy)">Privacy</a>
</div>
</footer>
<script src="~/js/bundles/jquery.js"></script>
<script src="~/js/bundles/bootstrap.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
<!--script src="_framework/blazor.server.js" asp-append-version="true"></script-->
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>

View File

@ -1,2 +0,0 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

View File

@ -1,3 +0,0 @@
@using EDAViewer
@using EDAViewer.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@ -1,3 +0,0 @@
@{
Layout = "_Layout";
}

View File

@ -1,7 +1,136 @@
{
"BuildNumber": "1",
"Company": "Infineon Technologies Americas Corp.",
"Drives": [
{
"Use": false,
"Letter": "a",
"Share": "Floppy Disk",
"User": "",
"Password": ""
},
{
"Use": false,
"Letter": "c",
"Share": "SYSTEM",
"User": "",
"Password": ""
},
{
"Use": false,
"Letter": "d",
"Share": "DATA",
"User": "",
"Password": ""
},
{
"Use": true,
"Letter": "g",
"Share": "\\\\10.95.154.12\\testdata",
"User": "10.95.154.12\\Manager",
"Password": "D6QDJ5g6vjqnNyyRbfbj+g=="
},
{
"Use": false,
"Letter": "h",
"Share": "\\\\10.95.154.13\\COM 5",
"User": "10.95.154.13\\user",
"Password": "tVyC7uPHtScZR8NLInSaxQ=="
},
{
"Use": true,
"Letter": "i",
"Share": "\\\\messdv002.na.infineon.com\\Candela",
"User": "INFINEON\\MESGaNEAF",
"Password": "tLIPgqM6R9hVQOteRnTHwPqIg3Zxv8CohTjFkjkFz8k="
},
{
"Use": false,
"Letter": "j",
"Share": "\\\\messdv002.na.infineon.com\\Characterization",
"User": "INFINEON\\MESGaNEAF",
"Password": "tLIPgqM6R9hVQOteRnTHwPqIg3Zxv8CohTjFkjkFz8k="
},
{
"Use": true,
"Letter": "k",
"Share": "\\\\messdv002.na.infineon.com\\GaN_NEC\\Characterization",
"User": "INFINEON\\MESGaNEAF",
"Password": "tLIPgqM6R9hVQOteRnTHwPqIg3Zxv8CohTjFkjkFz8k="
},
{
"Use": false,
"Letter": "l",
"Share": "TFS",
"User": "",
"Password": ""
},
{
"Use": false,
"Letter": "m",
"Share": "\\\\messdv002.na.infineon.com\\MOCVD",
"User": "EC\\ECMESEAF",
"Password": "CUGygiPwahy4U3j+6KqqoMZ08STyVDR1rKm6MwPpt00="
},
{
"Use": true,
"Letter": "n",
"Share": "\\\\10.95.154.22\\C",
"User": "10.95.154.22\\Aixtron",
"Password": "DYVBOr2HJdB7KOhd/IFhLA=="
},
{
"Use": true,
"Letter": "o",
"Share": "\\\\10.95.154.16\\Aixtron",
"User": "10.95.154.16\\Aixtron",
"Password": "DYVBOr2HJdB7KOhd/IFhLA=="
},
{
"Use": true,
"Letter": "p",
"Share": "\\\\10.95.154.15\\Aixtron",
"User": "10.95.154.15\\Aixtron",
"Password": "DYVBOr2HJdB7KOhd/IFhLA=="
},
{
"Use": true,
"Letter": "q",
"Share": "\\\\10.95.154.21\\Data",
"User": "10.95.154.21\\XRD04Admin",
"Password": "v1NOsEOCvbnhzKabspPcCQ=="
},
{
"Use": true,
"Letter": "r",
"Share": "\\\\10.95.154.23\\Data",
"User": "\"10.95.154.23\\infineon us\"",
"Password": "rzXkXdHKetDfsukhZKW0yA=="
},
{
"Use": true,
"Letter": "s",
"Share": "\\\\messv02ecc1.ec.local\\EC_EAFRepository",
"User": "EC\\ECMESEAF",
"Password": "CUGygiPwahy4U3j+6KqqoMZ08STyVDR1rKm6MwPpt00="
},
{
"Use": true,
"Letter": "t",
"Share": "\\\\messv02ecc1.ec.local\\EC_EDA",
"User": "EC\\ECEDASvc",
"Password": "IKsJmRVUH3xlv+RRELRbwoXYKwLvF4Re7k1Rigzpwf4="
},
{
"Use": false,
"Letter": "z",
"Share": "DVD Drive",
"User": "",
"Password": ""
}
],
"ECEDADatabasePassword": "8vIs2nEZPkcdBUfXX0hHlA==",
"EncryptedPassword": "K1RyLhaIRyJTDbWutsuWWEiO2hTD3h7fW0BV/Cp+Ftw=",
"GitCommitSeven": "1234567",
"Logging": {
"LogLevel": {
"Default": "Debug",
@ -12,8 +141,44 @@
},
"IFXEDADatabasePassword": "8vIs2nEZPkcdBUfXX0hHlA==",
"MonARessource": "EDA_Viewer_IFX",
"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.File"
],
"MinimumLevel": "Debug",
"WriteTo": [
{
"Name": "Debug",
"Args": {
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
}
},
{
"Name": "Console",
"Args": {
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "%workingDirectory% - Log/log-.txt",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
"rollingInterval": "Hour"
}
}
],
"Enrich": [
"FromLogContext",
"WithMachineName",
"WithThreadId"
],
"Properties": {
"Application": "Sample"
}
},
"Server": "messv02ecc1_ec_local",
"ServiceUser": "mesedasvc",
"URLs": "http://localhost:5000;",
"URLs": "http://localhost:5001;",
"WorkingDirectoryName": "IFXApps"
}

View File

@ -1,7 +1,136 @@
{
"BuildNumber": "1",
"Company": "Infineon Technologies Americas Corp.",
"Drives": [
{
"Use": false,
"Letter": "a",
"Share": "Floppy Disk",
"User": "",
"Password": ""
},
{
"Use": false,
"Letter": "c",
"Share": "SYSTEM",
"User": "",
"Password": ""
},
{
"Use": false,
"Letter": "d",
"Share": "DATA",
"User": "",
"Password": ""
},
{
"Use": true,
"Letter": "g",
"Share": "\\\\10.95.154.12\\testdata",
"User": "10.95.154.12\\Manager",
"Password": "D6QDJ5g6vjqnNyyRbfbj+g=="
},
{
"Use": false,
"Letter": "h",
"Share": "\\\\10.95.154.13\\COM 5",
"User": "10.95.154.13\\user",
"Password": "tVyC7uPHtScZR8NLInSaxQ=="
},
{
"Use": true,
"Letter": "i",
"Share": "\\\\messdv002.na.infineon.com\\Candela",
"User": "INFINEON\\MESGaNEAF",
"Password": "tLIPgqM6R9hVQOteRnTHwPqIg3Zxv8CohTjFkjkFz8k="
},
{
"Use": false,
"Letter": "j",
"Share": "\\\\messdv002.na.infineon.com\\Characterization",
"User": "INFINEON\\MESGaNEAF",
"Password": "tLIPgqM6R9hVQOteRnTHwPqIg3Zxv8CohTjFkjkFz8k="
},
{
"Use": true,
"Letter": "k",
"Share": "\\\\messdv002.na.infineon.com\\GaN_NEC\\Characterization",
"User": "INFINEON\\MESGaNEAF",
"Password": "tLIPgqM6R9hVQOteRnTHwPqIg3Zxv8CohTjFkjkFz8k="
},
{
"Use": false,
"Letter": "l",
"Share": "TFS",
"User": "",
"Password": ""
},
{
"Use": false,
"Letter": "m",
"Share": "\\\\messdv002.na.infineon.com\\MOCVD",
"User": "EC\\ECMESEAF",
"Password": "CUGygiPwahy4U3j+6KqqoMZ08STyVDR1rKm6MwPpt00="
},
{
"Use": true,
"Letter": "n",
"Share": "\\\\10.95.154.22\\C",
"User": "10.95.154.22\\Aixtron",
"Password": "DYVBOr2HJdB7KOhd/IFhLA=="
},
{
"Use": true,
"Letter": "o",
"Share": "\\\\10.95.154.16\\Aixtron",
"User": "10.95.154.16\\Aixtron",
"Password": "DYVBOr2HJdB7KOhd/IFhLA=="
},
{
"Use": true,
"Letter": "p",
"Share": "\\\\10.95.154.15\\Aixtron",
"User": "10.95.154.15\\Aixtron",
"Password": "DYVBOr2HJdB7KOhd/IFhLA=="
},
{
"Use": true,
"Letter": "q",
"Share": "\\\\10.95.154.21\\Data",
"User": "10.95.154.21\\XRD04Admin",
"Password": "v1NOsEOCvbnhzKabspPcCQ=="
},
{
"Use": true,
"Letter": "r",
"Share": "\\\\10.95.154.23\\Data",
"User": "\"10.95.154.23\\infineon us\"",
"Password": "rzXkXdHKetDfsukhZKW0yA=="
},
{
"Use": true,
"Letter": "s",
"Share": "\\\\messv02ecc1.ec.local\\EC_EAFRepository",
"User": "EC\\ECMESEAF",
"Password": "CUGygiPwahy4U3j+6KqqoMZ08STyVDR1rKm6MwPpt00="
},
{
"Use": true,
"Letter": "t",
"Share": "\\\\messv02ecc1.ec.local\\EC_EDA",
"User": "EC\\ECEDASvc",
"Password": "IKsJmRVUH3xlv+RRELRbwoXYKwLvF4Re7k1Rigzpwf4="
},
{
"Use": false,
"Letter": "z",
"Share": "DVD Drive",
"User": "",
"Password": ""
}
],
"ECEDADatabasePassword": "8vIs2nEZPkcdBUfXX0hHlA==",
"EncryptedPassword": "CUGygiPwahy4U3j+6KqqoMZ08STyVDR1rKm6MwPpt00=",
"GitCommitSeven": "1234567",
"Logging": {
"LogLevel": {
"Default": "Information",
@ -12,8 +141,44 @@
},
"IFXEDADatabasePassword": "8vIs2nEZPkcdBUfXX0hHlA==",
"MonARessource": "EDA_Viewer_EC",
"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.File"
],
"MinimumLevel": "Information",
"WriteTo": [
{
"Name": "Debug",
"Args": {
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
}
},
{
"Name": "Console",
"Args": {
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "%workingDirectory% - Log/log-.txt",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] ({SourceContext}.{MethodName}) ({InstanceId}) ({RemoteIpAddress}) {Message}{NewLine}{Exception}",
"rollingInterval": "Hour"
}
}
],
"Enrich": [
"FromLogContext",
"WithMachineName",
"WithThreadId"
],
"Properties": {
"Application": "Sample"
}
},
"Server": "messv02ecc1.ec.local",
"ServiceUser": "ECMESEAF",
"URLs": "http://localhost:5002;",
"URLs": "http://localhost:5001;",
"WorkingDirectoryName": "IFXApps"
}

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