From a6abe8fdbd3922ec7fd4f7f5ae654abfcd5b3185 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Tue, 1 Feb 2022 19:49:09 -0700 Subject: [PATCH] Match TFS Changeset 303361 --- .editorconfig | 336 ++++ .gitignore | 9 + APC Viewer.Tests/APC Viewer.Tests.csproj | 40 + APC Viewer.Tests/BackgroundTests.cs | 173 ++ APC Viewer.Tests/HomeControllerTests.cs | 282 +++ APC Viewer.Tests/Shared/LoggingUnitTesting.cs | 71 + APC Viewer.Tests/Shared/UnitTesting.cs | 93 + APC Viewer/APC Viewer.csproj | 49 + APC Viewer/Controllers/HomeController.cs | 352 ++++ APC Viewer/GlobalSuppressions.cs | 9 + .../HostedService/TimedHostedService.cs | 168 ++ .../Core/AutoGenerated/BackboneComponent.cs | 6 + .../Core/AutoGenerated/BackboneStatusCache.cs | 6 + .../AutoGenerated/ILoggingSetupManager.cs | 6 + .../Eaf/Core/AutoGenerated/StatusItem.cs | 6 + APC Viewer/Library/Eaf/Core/Backbone.cs | 48 + .../Library/Eaf/Core/Smtp/EmailMessage.cs | 24 + APC Viewer/Library/Eaf/Core/Smtp/ISmtp.cs | 9 + .../Library/Eaf/Core/Smtp/MailPriority.cs | 11 + .../ChangeDataCollectionHandler.cs | 6 + .../AutoGenerated/DataCollectionRequest.cs | 6 + .../Control/AutoGenerated/EquipmentEvent.cs | 6 + .../AutoGenerated/EquipmentException.cs | 6 + .../AutoGenerated/EquipmentSelfDescription.cs | 6 + .../GetParameterValuesHandler.cs | 6 + .../AutoGenerated/IConnectionControl.cs | 6 + .../AutoGenerated/IDataTracingHandler.cs | 6 + .../AutoGenerated/IEquipmentCommandService.cs | 6 + .../AutoGenerated/IEquipmentControl.cs | 16 + .../IEquipmentSelfDescriptionBuilder.cs | 6 + .../Control/AutoGenerated/IPackage.cs | 6 + .../AutoGenerated/ISelfDescriptionLookup.cs | 6 + .../IVirtualParameterValuesHandler.cs | 6 + .../SetParameterValuesHandler.cs | 6 + .../Control/AutoGenerated/TraceRequest.cs | 6 + .../Control/IEquipmentDataCollection.cs | 39 + .../EquipmentCore/Control/IPackageSource.cs | 6 + .../Reporting/ParameterValue.cs | 20 + .../ElementDescription/EquipmentParameter.cs | 24 + .../SelfDescription/ParameterTypes/Field.cs | 12 + .../ParameterTypes/ParameterTypeDefinition.cs | 12 + .../ParameterTypes/StructuredType.cs | 12 + .../CellAutomation/IConfigurationObject.cs | 6 + .../ModelObjectParameterDefinition.cs | 26 + .../ModelObjectParameterType.cs | 17 + .../SecsConnectionConfiguration.cs | 44 + .../Common/Configuration/ConnectionSetting.cs | 13 + .../EquipmentConnector/File/Component/File.cs | 19 + .../File/Component/FilePathGenerator.cs | 35 + .../FileConnectorConfiguration.cs | 135 ++ ...onnectorParameterTypeDefinitionProvider.cs | 14 + .../GCL/Annotations/NotNullAttribute.cs | 10 + .../GCL/SecsDriver/HsmsConnectionMode.cs | 8 + .../GCL/SecsDriver/HsmsSessionMode.cs | 8 + .../GCL/SecsDriver/SecsTransportType.cs | 8 + .../GCL/SecsDriver/SerialBaudRate.cs | 16 + APC Viewer/Models/AppSettings.cs | 12 + APC Viewer/Models/ErrorViewModel.cs | 9 + APC Viewer/Models/IBackground.cs | 91 + APC Viewer/Models/IHomeController.cs | 25 + APC Viewer/Program.cs | 40 + APC Viewer/Properties/AssemblyInfo.cs | 3 + APC Viewer/Shared/Description.cs | 192 ++ APC Viewer/Shared/EquipmentType.cs | 53 + APC Viewer/Shared/IProcessData.cs | 16 + APC Viewer/Shared/IProcessDataDescription.cs | 26 + APC Viewer/Shared/IScopeInfo.cs | 21 + APC Viewer/Shared/IsEnvironment.cs | 171 ++ APC Viewer/Shared/Logistics.cs | 245 +++ APC Viewer/Shared/Logistics2.cs | 80 + APC Viewer/Shared/Metrology/Column.cs | 1605 +++++++++++++++++ APC Viewer/Shared/Metrology/ConfigDataBase.cs | 410 +++++ APC Viewer/Shared/Metrology/EventName.cs | 13 + APC Viewer/Shared/Metrology/ILogic.cs | 48 + APC Viewer/Shared/Metrology/MET08AFMD3100.cs | 14 + APC Viewer/Shared/Metrology/MET08BVHGPROBE.cs | 16 + .../Shared/Metrology/MET08CVHGPROBE802B150.cs | 16 + .../Shared/Metrology/MET08DDINCAN8620.cs | 18 + .../Shared/Metrology/MET08DDUPSFS6420.cs | 14 + .../Shared/Metrology/MET08DDUPSP1TBI.cs | 14 + .../Shared/Metrology/MET08EBEAMINTEGRITY26.cs | 14 + .../Shared/Metrology/MET08HALLHL5580.cs | 16 + .../Shared/Metrology/MET08MESMICROSCOPE.cs | 14 + .../Shared/Metrology/MET08NDFRESIMAP151C.cs | 15 + APC Viewer/Shared/Metrology/MET08PLMAPRPM.cs | 20 + .../Shared/Metrology/MET08PRFUSB4000.cs | 14 + APC Viewer/Shared/Metrology/MET08RESIHGCV.cs | 14 + .../Shared/Metrology/MET08RESIMAPCDE.cs | 14 + .../Shared/Metrology/MET08THFTIRQS408M.cs | 14 + .../Shared/Metrology/MET08THFTIRSTRATUS.cs | 14 + .../Shared/Metrology/MET08UVH44GS100M.cs | 14 + APC Viewer/Shared/Metrology/MET08VPDSUBCON.cs | 14 + .../Shared/Metrology/MET08WGEOMX203641Q.cs | 15 + .../Shared/Metrology/MET08XRDXPERTPROMRDXL.cs | 23 + .../Metrology/ProcessData.Duplicator.cs | 110 ++ .../Metrology/ProcessDataStandardFormat.cs | 527 ++++++ APC Viewer/Shared/Metrology/Test.cs | 57 + APC Viewer/Singleton/Background.cs | 1020 +++++++++++ APC Viewer/Singleton/IBackground.cs | 35 + APC Viewer/Startup.cs | 166 ++ APC Viewer/Views/Home/Background.cshtml | 47 + APC Viewer/Views/Home/Directory.cshtml | 69 + APC Viewer/Views/Home/IPDSF.cshtml | 91 + APC Viewer/Views/Home/Index.cshtml | 12 + APC Viewer/Views/Home/PDSF.cshtml | 91 + APC Viewer/Views/Home/Privacy.cshtml | 6 + APC Viewer/Views/Home/TimePivot.cshtml | 37 + APC Viewer/Views/Shared/Error.cshtml | 25 + APC Viewer/Views/Shared/_Layout.cshtml | 92 + .../Shared/_ValidationScriptsPartial.cshtml | 2 + APC Viewer/Views/_ViewImports.cshtml | 3 + APC Viewer/Views/_ViewStart.cshtml | 3 + APC-Viewer.sln | 28 + README.md | 26 +- package.json | 8 + 115 files changed, 8097 insertions(+), 13 deletions(-) create mode 100644 .editorconfig create mode 100644 APC Viewer.Tests/APC Viewer.Tests.csproj create mode 100644 APC Viewer.Tests/BackgroundTests.cs create mode 100644 APC Viewer.Tests/HomeControllerTests.cs create mode 100644 APC Viewer.Tests/Shared/LoggingUnitTesting.cs create mode 100644 APC Viewer.Tests/Shared/UnitTesting.cs create mode 100644 APC Viewer/APC Viewer.csproj create mode 100644 APC Viewer/Controllers/HomeController.cs create mode 100644 APC Viewer/GlobalSuppressions.cs create mode 100644 APC Viewer/HostedService/TimedHostedService.cs create mode 100644 APC Viewer/Library/Eaf/Core/AutoGenerated/BackboneComponent.cs create mode 100644 APC Viewer/Library/Eaf/Core/AutoGenerated/BackboneStatusCache.cs create mode 100644 APC Viewer/Library/Eaf/Core/AutoGenerated/ILoggingSetupManager.cs create mode 100644 APC Viewer/Library/Eaf/Core/AutoGenerated/StatusItem.cs create mode 100644 APC Viewer/Library/Eaf/Core/Backbone.cs create mode 100644 APC Viewer/Library/Eaf/Core/Smtp/EmailMessage.cs create mode 100644 APC Viewer/Library/Eaf/Core/Smtp/ISmtp.cs create mode 100644 APC Viewer/Library/Eaf/Core/Smtp/MailPriority.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ChangeDataCollectionHandler.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/DataCollectionRequest.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentEvent.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentException.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentSelfDescription.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/GetParameterValuesHandler.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IConnectionControl.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IDataTracingHandler.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentCommandService.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentControl.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentSelfDescriptionBuilder.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IPackage.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ISelfDescriptionLookup.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IVirtualParameterValuesHandler.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/SetParameterValuesHandler.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/TraceRequest.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/IEquipmentDataCollection.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/Control/IPackageSource.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/DataCollection/Reporting/ParameterValue.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ElementDescription/EquipmentParameter.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/Field.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/ParameterTypeDefinition.cs create mode 100644 APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/StructuredType.cs create mode 100644 APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/IConfigurationObject.cs create mode 100644 APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterDefinition.cs create mode 100644 APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterType.cs create mode 100644 APC Viewer/Library/Eaf/Management/ConfigurationData/Semiconductor/CellInstances/SecsConnectionConfiguration.cs create mode 100644 APC Viewer/Library/Ifx/Eaf/Common/Configuration/ConnectionSetting.cs create mode 100644 APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/File.cs create mode 100644 APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/FilePathGenerator.cs create mode 100644 APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Configuration/FileConnectorConfiguration.cs create mode 100644 APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/SelfDescription/FileConnectorParameterTypeDefinitionProvider.cs create mode 100644 APC Viewer/Library/PeerGroup/GCL/Annotations/NotNullAttribute.cs create mode 100644 APC Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsConnectionMode.cs create mode 100644 APC Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsSessionMode.cs create mode 100644 APC Viewer/Library/PeerGroup/GCL/SecsDriver/SecsTransportType.cs create mode 100644 APC Viewer/Library/PeerGroup/GCL/SecsDriver/SerialBaudRate.cs create mode 100644 APC Viewer/Models/AppSettings.cs create mode 100644 APC Viewer/Models/ErrorViewModel.cs create mode 100644 APC Viewer/Models/IBackground.cs create mode 100644 APC Viewer/Models/IHomeController.cs create mode 100644 APC Viewer/Program.cs create mode 100644 APC Viewer/Properties/AssemblyInfo.cs create mode 100644 APC Viewer/Shared/Description.cs create mode 100644 APC Viewer/Shared/EquipmentType.cs create mode 100644 APC Viewer/Shared/IProcessData.cs create mode 100644 APC Viewer/Shared/IProcessDataDescription.cs create mode 100644 APC Viewer/Shared/IScopeInfo.cs create mode 100644 APC Viewer/Shared/IsEnvironment.cs create mode 100644 APC Viewer/Shared/Logistics.cs create mode 100644 APC Viewer/Shared/Logistics2.cs create mode 100644 APC Viewer/Shared/Metrology/Column.cs create mode 100644 APC Viewer/Shared/Metrology/ConfigDataBase.cs create mode 100644 APC Viewer/Shared/Metrology/EventName.cs create mode 100644 APC Viewer/Shared/Metrology/ILogic.cs create mode 100644 APC Viewer/Shared/Metrology/MET08AFMD3100.cs create mode 100644 APC Viewer/Shared/Metrology/MET08BVHGPROBE.cs create mode 100644 APC Viewer/Shared/Metrology/MET08CVHGPROBE802B150.cs create mode 100644 APC Viewer/Shared/Metrology/MET08DDINCAN8620.cs create mode 100644 APC Viewer/Shared/Metrology/MET08DDUPSFS6420.cs create mode 100644 APC Viewer/Shared/Metrology/MET08DDUPSP1TBI.cs create mode 100644 APC Viewer/Shared/Metrology/MET08EBEAMINTEGRITY26.cs create mode 100644 APC Viewer/Shared/Metrology/MET08HALLHL5580.cs create mode 100644 APC Viewer/Shared/Metrology/MET08MESMICROSCOPE.cs create mode 100644 APC Viewer/Shared/Metrology/MET08NDFRESIMAP151C.cs create mode 100644 APC Viewer/Shared/Metrology/MET08PLMAPRPM.cs create mode 100644 APC Viewer/Shared/Metrology/MET08PRFUSB4000.cs create mode 100644 APC Viewer/Shared/Metrology/MET08RESIHGCV.cs create mode 100644 APC Viewer/Shared/Metrology/MET08RESIMAPCDE.cs create mode 100644 APC Viewer/Shared/Metrology/MET08THFTIRQS408M.cs create mode 100644 APC Viewer/Shared/Metrology/MET08THFTIRSTRATUS.cs create mode 100644 APC Viewer/Shared/Metrology/MET08UVH44GS100M.cs create mode 100644 APC Viewer/Shared/Metrology/MET08VPDSUBCON.cs create mode 100644 APC Viewer/Shared/Metrology/MET08WGEOMX203641Q.cs create mode 100644 APC Viewer/Shared/Metrology/MET08XRDXPERTPROMRDXL.cs create mode 100644 APC Viewer/Shared/Metrology/ProcessData.Duplicator.cs create mode 100644 APC Viewer/Shared/Metrology/ProcessDataStandardFormat.cs create mode 100644 APC Viewer/Shared/Metrology/Test.cs create mode 100644 APC Viewer/Singleton/Background.cs create mode 100644 APC Viewer/Singleton/IBackground.cs create mode 100644 APC Viewer/Startup.cs create mode 100644 APC Viewer/Views/Home/Background.cshtml create mode 100644 APC Viewer/Views/Home/Directory.cshtml create mode 100644 APC Viewer/Views/Home/IPDSF.cshtml create mode 100644 APC Viewer/Views/Home/Index.cshtml create mode 100644 APC Viewer/Views/Home/PDSF.cshtml create mode 100644 APC Viewer/Views/Home/Privacy.cshtml create mode 100644 APC Viewer/Views/Home/TimePivot.cshtml create mode 100644 APC Viewer/Views/Shared/Error.cshtml create mode 100644 APC Viewer/Views/Shared/_Layout.cshtml create mode 100644 APC Viewer/Views/Shared/_ValidationScriptsPartial.cshtml create mode 100644 APC Viewer/Views/_ViewImports.cshtml create mode 100644 APC Viewer/Views/_ViewStart.cshtml create mode 100644 APC-Viewer.sln create mode 100644 package.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a3ebdb2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,336 @@ +# 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_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +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_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +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 + +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.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.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_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.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 diff --git a/.gitignore b/.gitignore index 3e759b7..7c7ee90 100644 --- a/.gitignore +++ b/.gitignore @@ -328,3 +328,12 @@ ASALocalRun/ # MFractors (Xamarin productivity tool) working folder .mfractor/ + +## +## Visual Studio Code +## +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json diff --git a/APC Viewer.Tests/APC Viewer.Tests.csproj b/APC Viewer.Tests/APC Viewer.Tests.csproj new file mode 100644 index 0000000..e6f72bb --- /dev/null +++ b/APC Viewer.Tests/APC Viewer.Tests.csproj @@ -0,0 +1,40 @@ + + + SAK + SAK + SAK + SAK + + + net6.0 + APCViewer.Tests + false + + + trx + ../../../Trunk/APC Viewer/05_TestResults/TestResults + + + true + true + true + + + Windows + + + OSX + + + Linux + + + + + + + + + + + \ No newline at end of file diff --git a/APC Viewer.Tests/BackgroundTests.cs b/APC Viewer.Tests/BackgroundTests.cs new file mode 100644 index 0000000..7221499 --- /dev/null +++ b/APC Viewer.Tests/BackgroundTests.cs @@ -0,0 +1,173 @@ +using APCViewer.Models; +using Helper.Log; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Shared; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text.Json; +using System.Threading; + +namespace APCViewer.Tests +{ + + [TestClass] + public class BackgroundTests : LoggingUnitTesting, IBackground + { + + private static WebClient _WebClient; + private static string _WorkingDirectory; + private static Singleton.IBackground _Background; + private static BackgroundTests _LoggingUnitTesting; + internal static BackgroundTests LoggingUnitTesting => _LoggingUnitTesting; + + public BackgroundTests() : base(testContext: null, declaringType: null) + { + if (_LoggingUnitTesting is null) + throw new Exception(); + } + + public BackgroundTests(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + if (_LoggingUnitTesting is null) + _LoggingUnitTesting = new BackgroundTests(testContext); + _LoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); + _WebClient = new WebClient(); + Assembly assembly = Assembly.GetExecutingAssembly(); + _WorkingDirectory = Log.GetWorkingDirectory(assembly.GetName().Name, "IFXApps"); + Type type = new StackFrame().GetMethod().DeclaringType; + _Background = new Singleton.Background(_LoggingUnitTesting.IsEnvironment, _LoggingUnitTesting.ConfigurationRoot, _WorkingDirectory); + _Background.Update(_LoggingUnitTesting.Logger, _WebClient); + Assert.IsNotNull(_Background); + Assert.IsFalse(string.IsNullOrEmpty(_Background.AppSettings.URLs)); + Assert.IsFalse(string.IsNullOrEmpty(_Background.AppSettings.Server)); + Assert.IsFalse(string.IsNullOrEmpty(_Background.AppSettings.MonARessource)); + } + + [ClassCleanup()] + public static void ClassCleanup() + { + if (!(_LoggingUnitTesting.Logger is null)) + _LoggingUnitTesting.Logger.LogInformation("Cleanup"); + if (!(_LoggingUnitTesting is null)) + _LoggingUnitTesting.Dispose(); + } + + [TestMethod] + [TestCategory(nameof(IsEnvironment.Name.WindowsDevelopment))] + public void APCDataCallback_WindowsDevelopment() + { + MethodBase methodBase = new StackFrame().GetMethod(); + _Logger.LogInformation($"Skipped - {methodBase.Name}"); + Assert.IsTrue(true); + } + + [TestMethod] + [TestCategory(nameof(IsEnvironment.Name.WindowsStaging))] + public void APCDataCallback_WindowsStaging() + { + MethodBase methodBase = new StackFrame().GetMethod(); + _Logger.LogInformation($"Skipped - {methodBase.Name}"); + Assert.IsTrue(true); + } + + [TestMethod] + [TestCategory(nameof(IsEnvironment.Name.WindowsProduction))] + public void APCDataCallback_WindowsProduction() + { + _Background.APCDataCallback(); + Assert.IsTrue(true); + } + + void IBackground.APCDataCallback() + { + APCDataCallback_WindowsDevelopment(); + APCDataCallback_WindowsStaging(); + APCDataCallback_WindowsProduction(); + } + + [TestMethod] + [TestCategory(nameof(IsEnvironment.Name.WindowsDevelopment))] + public void EAFLogDataCallback_WindowsDevelopment() + { + MethodBase methodBase = new StackFrame().GetMethod(); + _Logger.LogInformation($"Skipped - {methodBase.Name}"); + Assert.IsTrue(true); + } + + [TestMethod] + [TestCategory(nameof(IsEnvironment.Name.WindowsStaging))] + public void EAFLogDataCallback_WindowsStaging() + { + MethodBase methodBase = new StackFrame().GetMethod(); + _Logger.LogInformation($"Skipped - {methodBase.Name}"); + Assert.IsTrue(true); + } + + [TestMethod] + [TestCategory(nameof(IsEnvironment.Name.WindowsProduction))] + public void EAFLogDataCallback_WindowsProduction() + { + _Background.EAFLogDataCallback(); + Assert.IsTrue(true); + } + + void IBackground.EAFLogDataCallback() + { + EAFLogDataCallback_WindowsDevelopment(); + EAFLogDataCallback_WindowsStaging(); + EAFLogDataCallback_WindowsProduction(); + } + + [TestMethod] + [TestCategory(nameof(IsEnvironment.Name.WindowsDevelopment))] + public void EDADataCallback_WindowsDevelopment() + { + MethodBase methodBase = new StackFrame().GetMethod(); + _Logger.LogInformation($"Skipped - {methodBase.Name}"); + Assert.IsTrue(true); + } + + [TestMethod] + [TestCategory(nameof(IsEnvironment.Name.WindowsStaging))] + public void EDADataCallback_WindowsStaging() + { + MethodBase methodBase = new StackFrame().GetMethod(); + _Logger.LogInformation($"Skipped - {methodBase.Name}"); + Assert.IsTrue(true); + } + + [TestMethod] + [TestCategory(nameof(IsEnvironment.Name.WindowsProduction))] + public void EDADataCallback_WindowsProduction() + { + _Background.EDADataCallback(); + Assert.IsTrue(true); + } + + void IBackground.EDADataCallback() + { + EDADataCallback_WindowsDevelopment(); + EDADataCallback_WindowsStaging(); + EDADataCallback_WindowsProduction(); + } + + } + +} + +// dotnet build --runtime win-x64 +// dotnet test --runtime win-x64 --no-build --filter EDADataCallback_WindowsProduction --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\") +// dotnet test --runtime win-x64 --no-build --filter "ClassName=APCViewer.Tests.BackgroundTests & TestCategory=WindowsDevelopment" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\") +// dotnet test --runtime win-x64 --no-build --filter "ClassName=APCViewer.Tests.BackgroundTests & TestCategory=WindowsStaging" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\") +// dotnet test --runtime win-x64 --no-build --filter "ClassName=APCViewer.Tests.BackgroundTests & TestCategory=WindowsProduction" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\") \ No newline at end of file diff --git a/APC Viewer.Tests/HomeControllerTests.cs b/APC Viewer.Tests/HomeControllerTests.cs new file mode 100644 index 0000000..ffd8466 --- /dev/null +++ b/APC Viewer.Tests/HomeControllerTests.cs @@ -0,0 +1,282 @@ +using APCViewer.Models; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Shared; +using System; +using System.Diagnostics; +using System.Net; +using System.Reflection; + +namespace APCViewer.Tests +{ + + [TestClass] + public class HomeControllerTests : LoggingUnitTesting, IHomeController + { + + private static long _Sequence; + private static WebClient _WebClient; + private static string _WorkingDirectory; + private static Singleton.IBackground _Background; + private static Controllers.HomeController _HomeController; + private static HomeControllerTests _LoggingUnitTesting; + internal static HomeControllerTests LoggingUnitTesting => _LoggingUnitTesting; + + public HomeControllerTests() : base(testContext: null, declaringType: null) + { + if (_LoggingUnitTesting is null) + throw new Exception(); + } + + public HomeControllerTests(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + if (_LoggingUnitTesting is null) + _LoggingUnitTesting = new HomeControllerTests(testContext); + _LoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); + _WebClient = new WebClient(); + _Sequence = 637642624355251927; + Assembly assembly = Assembly.GetExecutingAssembly(); + _WorkingDirectory = Log.GetWorkingDirectory(assembly.GetName().Name, "IFXApps"); + Type type = new StackFrame().GetMethod().DeclaringType; + _Background = new Singleton.Background(_LoggingUnitTesting.IsEnvironment, _LoggingUnitTesting.ConfigurationRoot, _WorkingDirectory); + _HomeController = new Controllers.HomeController(new NullLogger(), _Background, httpContextAccessor: null); + _Background.Update(_LoggingUnitTesting.Logger, _WebClient); + Assert.IsNotNull(_Background); + Assert.IsFalse(string.IsNullOrEmpty(_Background.AppSettings.URLs)); + Assert.IsFalse(string.IsNullOrEmpty(_Background.AppSettings.Server)); + Assert.IsFalse(string.IsNullOrEmpty(_Background.AppSettings.MonARessource)); + } + + [ClassCleanup()] + public static void ClassCleanup() + { + if (!(_LoggingUnitTesting.Logger is null)) + _LoggingUnitTesting.Logger.LogInformation("Cleanup"); + if (!(_LoggingUnitTesting is null)) + _LoggingUnitTesting.Dispose(); + } + + [TestMethod] + public void Background() + { + IActionResult IActionResult = _HomeController.Background(); + Assert.IsTrue(true); + } + + IActionResult IHomeController.Background(bool? message_clear, bool? exceptions_clear, bool? set_is_primary_instance, bool? logistics_clear) + { + Background(); + return null; + } + + [Ignore] + [TestMethod] + public void DownloadCustomIPDSF() + { + IActionResult IActionResult = _HomeController.DownloadCustomIPDSF(ipdsf_file: ""); + Assert.IsTrue(true); + } + + IActionResult IHomeController.DownloadCustomIPDSF(string ipdsf_file) + { + DownloadCustomIPDSF(); + return null; + } + + [Ignore] + [TestMethod] + public void DownloadCustomPDSF() + { + IActionResult IActionResult = _HomeController.DownloadCustomPDSF(pdsf_file: ""); + Assert.IsTrue(true); + } + + IActionResult IHomeController.DownloadCustomPDSF(string pdsf_file) + { + DownloadCustomPDSF(); + return null; + } + + [Ignore] + [TestMethod] + public void DownloadIPDSF() + { + IActionResult IActionResult = _HomeController.DownloadIPDSF(_Sequence.ToString()); + Assert.IsTrue(true); + } + + IActionResult IHomeController.DownloadIPDSF(string id) + { + DownloadIPDSF(); + return null; + } + + [Ignore] + [TestMethod] + public void DownloadPDSF() + { + IActionResult IActionResult = _HomeController.DownloadPDSF(_Sequence.ToString()); + Assert.IsTrue(true); + } + + IActionResult IHomeController.DownloadPDSF(string id) + { + DownloadPDSF(); + return null; + } + + [TestMethod] + public void Encode() + { + IActionResult IActionResult = _HomeController.Encode(); + Assert.IsTrue(true); + } + + IActionResult IHomeController.Encode(string value) + { + Encode(); + return null; + } + + IActionResult IHomeController.Error() + { + throw new System.NotImplementedException(); + } + + [TestMethod] + public void Index() + { + IActionResult IActionResult = _HomeController.Index(); + Assert.IsTrue(true); + } + + IActionResult IHomeController.Index() + { + Index(); + return null; + } + + [Ignore] + [TestMethod] + public void IPDSF() + { + IActionResult IActionResult = _HomeController.IPDSF(); + Assert.IsTrue(true); + } + + IActionResult IHomeController.IPDSF(string directory, string filter, bool is_gaN, bool is_Si) + { + IPDSF(); + return null; + } + + [Ignore] + [TestMethod] + public void PDSF() + { + IActionResult IActionResult = _HomeController.PDSF(); + Assert.IsTrue(true); + } + + IActionResult IHomeController.PDSF(string directory, string filter, bool is_gaN, bool is_Si) + { + PDSF(); + return null; + } + + [TestMethod] + public void Privacy() + { + IActionResult IActionResult = _HomeController.Privacy(); + Assert.IsTrue(true); + } + + IActionResult IHomeController.Privacy() + { + Privacy(); + return null; + } + + [TestMethod] + public void TimePivot() + { + IActionResult IActionResult = _HomeController.TimePivot(); + Assert.IsTrue(true); + } + + IActionResult IHomeController.TimePivot(bool is_gaN, bool is_Si) + { + TimePivot(); + return null; + } + + [Ignore] + [TestMethod] + public void ViewCustomIPDSF() + { + IActionResult IActionResult = _HomeController.ViewCustomIPDSF(ipdsf_file: ""); + Assert.IsTrue(true); + } + + ContentResult IHomeController.ViewCustomIPDSF(string ipdsf_file) + { + ViewCustomIPDSF(); + return null; + } + + [Ignore] + [TestMethod] + public void ViewCustomPDSF() + { + IActionResult IActionResult = _HomeController.ViewCustomPDSF(pdsf_file: ""); + Assert.IsTrue(true); + } + + ContentResult IHomeController.ViewCustomPDSF(string pdsf_file) + { + ViewCustomPDSF(); + return null; + } + + [TestMethod] + public void ViewIPDSF() + { + IActionResult IActionResult = _HomeController.ViewIPDSF(_Sequence.ToString()); + Assert.IsTrue(true); + } + + ContentResult IHomeController.ViewIPDSF(string id) + { + ViewIPDSF(); + return null; + } + + [TestMethod] + public void ViewPDSF() + { + IActionResult IActionResult = _HomeController.ViewPDSF(_Sequence.ToString()); + Assert.IsTrue(true); + } + + ContentResult IHomeController.ViewPDSF(string id) + { + ViewPDSF(); + return null; + } + } + +} + +// dotnet build --runtime win-x64 +// dotnet test --no-build --filter ViewPDSF +// dotnet test --runtime win-x64 --no-build --filter "ClassName=APCViewer.Tests.HomeTests & TestCategory=WindowsDevelopment" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\") +// dotnet test --runtime win-x64 --no-build --filter "ClassName=APCViewer.Tests.HomeTests & TestCategory=WindowsStaging" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\") +// dotnet test --runtime win-x64 --no-build --filter "ClassName=APCViewer.Tests.HomeTests & TestCategory=WindowsProduction" --% -- TestRunParameters.Parameter(name=\"Debug\", value=\"Debugger.IsAttached\") \ No newline at end of file diff --git a/APC Viewer.Tests/Shared/LoggingUnitTesting.cs b/APC Viewer.Tests/Shared/LoggingUnitTesting.cs new file mode 100644 index 0000000..add9d6c --- /dev/null +++ b/APC Viewer.Tests/Shared/LoggingUnitTesting.cs @@ -0,0 +1,71 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; + +namespace Shared +{ + + public class LoggingUnitTesting : UnitTesting, IDisposable + { + + protected ILogger _Logger; + protected ILoggerFactory _LoggerFactory; + protected readonly LogLevel? _DefaultLogLevel; + protected readonly LogLevel? _Log4netProviderLogLevel; + protected readonly IConfigurationRoot _ConfigurationRoot; + public ILogger Logger => _Logger; + public LogLevel? DefaultLogLevel => _DefaultLogLevel; + public ILoggerFactory LoggerFactory => _LoggerFactory; + public IConfigurationRoot ConfigurationRoot => _ConfigurationRoot; + public LogLevel? Log4netProviderLogLevel => _Log4netProviderLogLevel; + + public LoggingUnitTesting(TestContext testContext, Type declaringType) : base(testContext, declaringType) + { + _LoggerFactory = new LoggerFactory(); + if (testContext is null || declaringType is null) + { + _ConfigurationRoot = null; + _DefaultLogLevel = null; + _Log4netProviderLogLevel = null; + } + else + { + LogLevel logLevel; + IConfigurationSection configurationSection; + List logLevels = new List(); + string defaultLogLevelSection = "Logging:LogLevel:Default"; + string log4netProviderLogLevelSection = "Logging:LogLevel:Log4netProvider"; + string[] sections = new string[] { defaultLogLevelSection, log4netProviderLogLevelSection }; + IConfigurationBuilder configurationBuilder = new ConfigurationBuilder() + .AddEnvironmentVariables() + .AddJsonFile(_IsEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true); + _ConfigurationRoot = configurationBuilder.Build(); + foreach (string section in sections) + { + configurationSection = _ConfigurationRoot.GetSection(section); + if (configurationSection is null) + logLevel = LogLevel.Debug; + else if (!Enum.TryParse(configurationSection.Value, out logLevel)) + logLevel = LogLevel.Debug; + logLevels.Add(logLevel); + } + _DefaultLogLevel = logLevels[0]; + _Log4netProviderLogLevel = logLevels[1]; + } + if (DefaultLogLevel.HasValue) + _LoggerFactory.AddProvider(new DebugProvider(DefaultLogLevel.Value)); + if (DefaultLogLevel.HasValue) + _LoggerFactory.AddProvider(new ConsoleProvider(DefaultLogLevel.Value)); + _Logger = _LoggerFactory.CreateLogger(); + } + + public void Dispose() + { + _LoggerFactory.Dispose(); + } + + } + +} \ No newline at end of file diff --git a/APC Viewer.Tests/Shared/UnitTesting.cs b/APC Viewer.Tests/Shared/UnitTesting.cs new file mode 100644 index 0000000..b2dacf8 --- /dev/null +++ b/APC Viewer.Tests/Shared/UnitTesting.cs @@ -0,0 +1,93 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Text.Json; +using System.Threading; + +namespace Shared +{ + + public class UnitTesting + { + + protected readonly IsEnvironment _IsEnvironment; + + public IsEnvironment IsEnvironment => _IsEnvironment; + + public UnitTesting(TestContext testContext, Type declaringType) + { + if (testContext is null || declaringType is null) + _IsEnvironment = null; + else + { + string projectDirectory = GetProjectDirectory(testContext); + string json = JsonSerializer.Serialize(testContext.Properties); + string vsCodeDirectory = Path.Combine(projectDirectory, ".vscode"); + if (!Directory.Exists(vsCodeDirectory)) + Directory.CreateDirectory(vsCodeDirectory); + string launchText = GetLaunchText(); + File.WriteAllText(Path.Combine(vsCodeDirectory, "launch.json"), launchText); + for (int i = 0; i < int.MaxValue; i++) + { + if (!json.Contains("Debugger.IsAttached") || Debugger.IsAttached) + break; + Thread.Sleep(500); + } + MethodBase methodBase = declaringType.GetMethod(testContext.TestName); + if (!(methodBase is null)) + { + TestCategoryAttribute testCategoryAttribute = methodBase.GetCustomAttribute(); + if (!(testCategoryAttribute is null)) + { + foreach (string testCategory in testCategoryAttribute.TestCategories) + _IsEnvironment = new IsEnvironment(testCategory); + } + } + if (_IsEnvironment is null) + _IsEnvironment = new IsEnvironment(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: Debugger.IsAttached, nullASPNetCoreEnvironmentIsProduction: !Debugger.IsAttached); + } + } + + internal static string GetProjectDirectory(TestContext testContext) + { + string result; + string[] checkFiles = null; + result = Path.GetDirectoryName(testContext.DeploymentDirectory); + for (int i = 0; i < int.MaxValue; i++) + { + if (string.IsNullOrEmpty(result)) + break; + checkFiles = Directory.GetFiles(result, "*.Tests.*proj", SearchOption.TopDirectoryOnly); + if (checkFiles.Any()) + break; + result = Path.GetDirectoryName(result); + } + if (string.IsNullOrEmpty(result) || checkFiles is null || !checkFiles.Any()) + throw new Exception(result); + return result; + } + + internal static string GetLaunchText() + { + StringBuilder result = new StringBuilder(); + result. + AppendLine("{"). + AppendLine(" \"configurations\": ["). + AppendLine(" {"). + AppendLine(" \"name\": \".NET Core Attach\","). + AppendLine(" \"type\": \"coreclr\","). + AppendLine(" \"request\": \"attach\","). + AppendLine($" \"processId\": {System.Diagnostics.Process.GetCurrentProcess().Id}"). + AppendLine(" }"). + AppendLine(" ]"). + AppendLine("}"); + return result.ToString(); + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/APC Viewer.csproj b/APC Viewer/APC Viewer.csproj new file mode 100644 index 0000000..66a2de1 --- /dev/null +++ b/APC Viewer/APC Viewer.csproj @@ -0,0 +1,49 @@ + + + SAK + SAK + SAK + SAK + + + 9.0 + net6.0 + APCViewer + 5.0.2 + OutOfProcess + d71a673c-be39-45b5-ae5f-4c22639be045 + true + true + true + + + Windows + + + OSX + + + Linux + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/APC Viewer/Controllers/HomeController.cs b/APC Viewer/Controllers/HomeController.cs new file mode 100644 index 0000000..f6691b7 --- /dev/null +++ b/APC Viewer/Controllers/HomeController.cs @@ -0,0 +1,352 @@ +using APCViewer.Models; +using APCViewer.Singleton; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using Shared; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Text; +using System.Web; + +namespace APCViewer.Controllers +{ + + public class HomeController : Controller, IHomeController + { + + private readonly Log _Log; + private readonly Singleton.IBackground _Background; + private readonly IHttpContextAccessor _HttpContextAccessor; + + public HomeController(ILogger logger, Singleton.IBackground background, IHttpContextAccessor httpContextAccessor) + { + _Log = new Log(logger); + _Background = background; + _HttpContextAccessor = httpContextAccessor; + } + + public ActionResult Index() + { + return View(); + } + + public ActionResult Privacy() + { + return View(); + } + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public ActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + + public ActionResult Encode(string value = null) + { + string result = string.Empty; + if (!string.IsNullOrEmpty(value)) + result = HttpUtility.UrlEncode(value); + return Content(result, "text/plain"); + } + + public ActionResult Background(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null, bool? logistics_clear = 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(); + } + if (logistics_clear.HasValue && logistics_clear.Value) + _Background.LogisticsClear(); + string message; + if (string.IsNullOrWhiteSpace(_Background.Message)) + message = "N/A"; + else + message = _Background.Message; + //Response.AppendToLog(_Background.Message); + List exceptions = new(); + foreach (Exception exception in _Background.Exceptions) + exceptions.Add(exception); + ViewBag.Message = message; + ViewBag.Exceptions = exceptions; + ViewBag.URLs = _Background.AppSettings.URLs; + ViewBag.Profile = _Background.IsEnvironment.Profile; + ViewBag.WorkingDirectory = _Background.WorkingDirectory; + ViewBag.IsPrimaryInstance = _Background.IsPrimaryInstance(); + ViewBag.ExceptionsCount = string.Concat("Exception(s) - ", exceptions.Count); + return View(); + } + + public ActionResult PDSF(string directory = null, string filter = null, bool is_gaN = false, bool is_Si = false) + { + Tuple tuple = _Background.SetViewBag(directory, filter, isGaN: is_gaN, isSi: is_Si, forPDSF: true); + ViewBag.Files = tuple.Item1; + ViewBag.Grouped = tuple.Item2; + ViewBag.Sorted = tuple.Item3; + ViewBag.Directory = tuple.Item4; + return View(); + } + + private StringBuilder GetPDSFHtml(string pdsfFile) + { + StringBuilder result = new(); + result.AppendLine(""); + if (string.IsNullOrEmpty(pdsfFile)) + throw new Exception(""); + else if (!System.IO.File.Exists(pdsfFile)) + result.AppendLine(""); + else + { + bool header = true; + bool body = false; + bool footer = false; + string logisticsSegment; + List logistics = new(); + string[] pdsfLines = System.IO.File.ReadAllLines(pdsfFile); + foreach (string pdsfLine in pdsfLines) + { + if (pdsfLine.StartsWith("LOGISTICS_")) + { + logisticsSegment = pdsfLine.Split('\t')[0]; + if (!logistics.Contains(logisticsSegment)) + { + logistics.Add(logisticsSegment); + result.AppendLine("
Invalid input
File doesn't exist!

"); + } + } + if (pdsfLine.StartsWith("NUM_DATA_ROWS") || pdsfLine.StartsWith("END_HEADER")) + { + body = false; + footer = true; + result.AppendLine("

"); + } + if (header) + result.Append(""); + else if (body) + result.Append(""); + else if (footer) + { + if (pdsfLine.StartsWith("DELIMITER")) + result.Append(""); + else + result.Append(""); + } + else + throw new Exception(); + if (pdsfLine.StartsWith("END_OFFSET")) + { + header = false; + body = true; + result.AppendLine("
").Append(pdsfLine.Replace("\t", "")).AppendLine(" 
").Append(pdsfLine.Replace("\t", "")).AppendLine(" 
").Append(pdsfLine.Replace(";", "")).AppendLine(" 
").Append(pdsfLine.Replace("\t", "").Replace("=", "").Replace(";", "")).AppendLine(" 

"); + } + } + } + result.AppendLine("
"); + return result; + } + + public ContentResult ViewPDSF(string id = null) + { + string pdsfFile; + StringBuilder result = new(); + if (!id.Contains('_')) + result.AppendLine("
A) Error: Invalid input
"); + else + { + if (!long.TryParse(id.Split('_')[1], out long sequence)) + result.AppendLine("
B) Error: Invalid input
"); + else + { + pdsfFile = _Background.GetPDSF(sequence); + result = GetPDSFHtml(pdsfFile); + } + } + return Content(result.ToString(), "text/html"); + } + + public ActionResult DownloadPDSF(string id = null) + { + string pdsfFile; + if (!id.Contains('_')) + throw new Exception("A) Error: Invalid input"); + else + { + if (!long.TryParse(id.Split('_')[1], out long sequence)) + throw new Exception("B) Error: Invalid input"); + else + pdsfFile = _Background.GetPDSF(sequence); + } + return File(pdsfFile, "text/plain", Path.GetFileName(pdsfFile)); + } + + public ContentResult ViewCustomPDSF(string pdsf_file = null) + { + StringBuilder result = GetPDSFHtml(pdsf_file); + return Content(result.ToString(), "text/html"); + } + + public ActionResult DownloadCustomPDSF(string pdsf_file = null) + { + if (string.IsNullOrEmpty(pdsf_file)) + throw new Exception("Error: Invalid input"); + else if (!System.IO.File.Exists(pdsf_file)) + throw new Exception("Error: file does not exist"); + return File(pdsf_file, "text/plain", Path.GetFileName(pdsf_file)); + } + + public ActionResult IPDSF(string directory = null, string filter = null, bool is_gaN = false, bool is_Si = false) + { + Tuple tuple = _Background.SetViewBag(directory, filter, isGaN: is_gaN, isSi: is_Si, forIPDSF: true); + ViewBag.Files = tuple.Item1; + ViewBag.Grouped = tuple.Item2; + ViewBag.Sorted = tuple.Item3; + ViewBag.Directory = tuple.Item4; + return View(); + } + + private StringBuilder GetIPDSFHtml(string ipdsfFile) + { + StringBuilder result = new(); + result.AppendLine(""); + if (string.IsNullOrEmpty(ipdsfFile)) + throw new Exception(""); + else if (!System.IO.File.Exists(ipdsfFile)) + result.AppendLine(""); + else + { + bool header = true; + bool body = false; + bool footer = false; + string logisticsSegment; + List logistics = new(); + string[] ipdsfLines = System.IO.File.ReadAllLines(ipdsfFile); + foreach (string ipdsfLine in ipdsfLines) + { + if (ipdsfLine.StartsWith("LOGISTICS_")) + { + logisticsSegment = ipdsfLine.Split('\t')[0]; + if (!logistics.Contains(logisticsSegment)) + { + logistics.Add(logisticsSegment); + result.AppendLine("
Invalid input
File doesn't exist!

"); + } + } + if (ipdsfLine.StartsWith("NUM_DATA_ROWS") || ipdsfLine.StartsWith("END_HEADER")) + { + body = false; + footer = true; + result.AppendLine("

"); + } + if (header) + result.Append(""); + else if (body) + result.Append(""); + else if (footer) + { + if (ipdsfLine.StartsWith("DELIMITER")) + result.Append(""); + else + result.Append(""); + } + else + throw new Exception(); + if (ipdsfLine.StartsWith("END_OFFSET")) + { + header = false; + body = true; + result.AppendLine("
").Append(ipdsfLine.Replace("\t", "")).AppendLine(" 
").Append(ipdsfLine.Replace("\t", "")).AppendLine(" 
").Append(ipdsfLine.Replace(";", "")).AppendLine(" 
").Append(ipdsfLine.Replace("\t", "").Replace("=", "").Replace(";", "")).AppendLine(" 

"); + } + } + } + result.AppendLine("
"); + return result; + } + + public ContentResult ViewIPDSF(string id = null) + { + string ipdsfFile; + StringBuilder result = new(); + if (!id.Contains('_')) + result.AppendLine("
A) Error: Invalid input
"); + else + { + if (!long.TryParse(id.Split('_')[1], out long sequence)) + result.AppendLine("
B) Error: Invalid input
"); + else + { + ipdsfFile = _Background.GetIPDSF(sequence); + result = GetIPDSFHtml(ipdsfFile); + } + } + return Content(result.ToString(), "text/html"); + } + + public ActionResult DownloadIPDSF(string id = null) + { + string ipdsfFile; + if (!id.Contains('_')) + throw new Exception("A) Error: Invalid input"); + else + { + if (!long.TryParse(id.Split('_')[1], out long sequence)) + throw new Exception("B) Error: Invalid input"); + else + ipdsfFile = _Background.GetIPDSF(sequence); + } + return File(ipdsfFile, "text/plain", Path.GetFileName(ipdsfFile)); + } + + public ContentResult ViewCustomIPDSF(string ipdsf_file = null) + { + StringBuilder result = GetIPDSFHtml(ipdsf_file); + return Content(result.ToString(), "text/html"); + } + + public ActionResult DownloadCustomIPDSF(string ipdsf_file = null) + { + if (string.IsNullOrEmpty(ipdsf_file)) + throw new Exception("Error: Invalid input"); + else if (!System.IO.File.Exists(ipdsf_file)) + throw new Exception("Error: file does not exist"); + return File(ipdsf_file, "text/plain", Path.GetFileName(ipdsf_file)); + } + + public ActionResult TimePivot(bool is_gaN = false, bool is_Si = false) + { + Tuple, List> tuple = _Background.GetTimePivot(isGaN: is_gaN, isSi: is_Si); + ViewBag.forIPDSF = tuple.Item1; + ViewBag.forPDSF = tuple.Item2; + return View(); + } + + IActionResult IHomeController.Background(bool? message_clear, bool? exceptions_clear, bool? set_is_primary_instance, bool? logistics_clear) => throw new NotImplementedException(); + IActionResult IHomeController.DownloadCustomIPDSF(string ipdsf_file) => throw new NotImplementedException(); + IActionResult IHomeController.DownloadCustomPDSF(string pdsf_file) => throw new NotImplementedException(); + IActionResult IHomeController.DownloadIPDSF(string id) => throw new NotImplementedException(); + IActionResult IHomeController.DownloadPDSF(string id) => throw new NotImplementedException(); + IActionResult IHomeController.Encode(string value) => throw new NotImplementedException(); + IActionResult IHomeController.Error() => throw new NotImplementedException(); + IActionResult IHomeController.Index() => throw new NotImplementedException(); + IActionResult IHomeController.IPDSF(string directory, string filter, bool is_gaN, bool is_Si) => throw new NotImplementedException(); + IActionResult IHomeController.PDSF(string directory, string filter, bool is_gaN, bool is_Si) => throw new NotImplementedException(); + IActionResult IHomeController.Privacy() => throw new NotImplementedException(); + IActionResult IHomeController.TimePivot(bool is_gaN, bool is_Si) => throw new NotImplementedException(); + } + +} +// dotnet publish --configuration Release --runtime win-x64 --verbosity normal --self-contained true -o "L:\net5.0\APCViewer" +// dotnet publish --configuration Release --runtime win-x64 --verbosity normal --self-contained true -o "D:\net5.0\APCViewer" +// dotnet publish --configuration Release --runtime win-x64 --verbosity normal --self-contained true -o "D:\.jenkins\publish\manual-Mesa-0\APCViewer" +//http://mestsa005.infineon.com:8080/job/Mesa/buildWithParameters?token=DotnetRules&projectName=APC%20Viewer +// http://mestsa02ec.ec.local:8080/job/Mesa/buildWithParameters?token=DotnetRules&projectName=APC%20Viewer +//sc create APCViewer_5003 binPath="D:\.jenkins\publish\manual-Mesa-0\APCViewer\APC Viewer.exe" \ No newline at end of file diff --git a/APC Viewer/GlobalSuppressions.cs b/APC Viewer/GlobalSuppressions.cs new file mode 100644 index 0000000..74f319c --- /dev/null +++ b/APC Viewer/GlobalSuppressions.cs @@ -0,0 +1,9 @@ +// 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("Performance", "CA1822:Mark members as static", Justification = "", Scope = "member", Target = "~M:APCViewer.Controllers.HomeController.GetPDSFHtml(System.String)~System.Text.StringBuilder")] +[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "", Scope = "member", Target = "~M:APCViewer.Controllers.HomeController.GetIPDSFHtml(System.String)~System.Text.StringBuilder")] \ No newline at end of file diff --git a/APC Viewer/HostedService/TimedHostedService.cs b/APC Viewer/HostedService/TimedHostedService.cs new file mode 100644 index 0000000..49f0f19 --- /dev/null +++ b/APC Viewer/HostedService/TimedHostedService.cs @@ -0,0 +1,168 @@ +using APCViewer.Singleton; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using System; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Threading; +using System.Threading.Tasks; + +namespace APCViewer.HostedService +{ + + public class TimedHostedService : IHostedService, IDisposable + { + + private readonly int _ExecutionCount; + private readonly WebClient _WebClient; + private readonly Background _Background; + private readonly IConfiguration _Configuration; + private readonly ILogger _Log; + + private Timer _APCDataTimer; + private Timer _EDADataTimer; + private Timer _EAFLogDataTimer; + + public TimedHostedService(Background background, IConfiguration configuration, IServiceProvider serviceProvider) + { + _ExecutionCount = 0; + _Background = background; + _Configuration = configuration; + _WebClient = serviceProvider.GetRequiredService(); + _Log = serviceProvider.GetRequiredService>(); + //_HttpContextAccessor = serviceProvider.GetRequiredService(); + _WebClient = serviceProvider.GetRequiredService(); + } + + public Task StartAsync(CancellationToken stoppingToken) + { + _Log.LogInformation(string.Concat("Timed Hosted Service: ", nameof(Background), ":", _Background.IsEnvironment.Profile, ":", Environment.ProcessId, " running.")); + _Background.Update(_Log, _WebClient); + if (_Background.IsEnvironment.Development) + { + int milliSeconds = 3000; + if (milliSeconds == 0) + { } + } + else if (_Background.IsEnvironment.Staging) + { + int milliSeconds = 3000; + _APCDataTimer = new Timer(APCDataCallback, null, milliSeconds, Timeout.Infinite); + _Background.Timers.Add(_APCDataTimer); + milliSeconds += 2000; + _EAFLogDataTimer = new Timer(EAFLogDataCallback, null, milliSeconds, Timeout.Infinite); + _Background.Timers.Add(_EAFLogDataTimer); + milliSeconds += 2000; + _EDADataTimer = new Timer(EDADataCallback, null, milliSeconds, Timeout.Infinite); + _Background.Timers.Add(_EDADataTimer); + milliSeconds += 2000; + } + else if (_Background.IsEnvironment.Production) + { + int milliSeconds = 3000; + _APCDataTimer = new Timer(APCDataCallback, null, milliSeconds, Timeout.Infinite); + _Background.Timers.Add(_APCDataTimer); + milliSeconds += 2000; + _EAFLogDataTimer = new Timer(EAFLogDataCallback, null, milliSeconds, Timeout.Infinite); + _Background.Timers.Add(_EAFLogDataTimer); + milliSeconds += 2000; + _EDADataTimer = new Timer(EDADataCallback, null, milliSeconds, Timeout.Infinite); + _Background.Timers.Add(_EDADataTimer); + milliSeconds += 2000; + } + else + throw new Exception(); + if (_Background.IsEnvironment.Staging || _Background.IsEnvironment.Production) + { + string countDirectory = _Background.GetCountDirectory("Start"); + string checkDirectory = Path.GetPathRoot(countDirectory); + if (Directory.Exists(checkDirectory)) + Directory.CreateDirectory(countDirectory); + } + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken stoppingToken) + { + _Log.LogInformation(string.Concat("Timed Hosted Service: ", nameof(Background), ":", _Background.IsEnvironment.Profile, ":", Environment.ProcessId, " is stopping.")); + _Background.Stop(immediate: true); + for (short i = 0; i < short.MaxValue; i++) + { + Thread.Sleep(500); + if (_ExecutionCount == 0) + break; + } + return Task.CompletedTask; + } + + public void Dispose() + { + _Background.Dispose(); + } + + private void APCDataCallback(object state) + { + try + { + if (_Background.IsPrimaryInstance()) + _Background.APCDataCallback(); + } + 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.AddMinutes(1).Ticks - DateTime.Now.Ticks); + _APCDataTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite); + } + catch (Exception e) { _Background.Catch(e); } + } + + private void EDADataCallback(object state) + { + try + { + if (_Background.IsPrimaryInstance()) + _Background.EDADataCallback(); + } + 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.AddMinutes(1).Ticks - DateTime.Now.Ticks); + _EDADataTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite); + } + catch (Exception e) { _Background.Catch(e); } + } + + private void EAFLogDataCallback(object state) + { + try + { + if (_Background.IsPrimaryInstance()) + _Background.EAFLogDataCallback(); + } + 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.AddMinutes(1).Ticks - DateTime.Now.Ticks); + _EAFLogDataTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite); + } + catch (Exception e) { _Background.Catch(e); } + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Core/AutoGenerated/BackboneComponent.cs b/APC Viewer/Library/Eaf/Core/AutoGenerated/BackboneComponent.cs new file mode 100644 index 0000000..02f026c --- /dev/null +++ b/APC Viewer/Library/Eaf/Core/AutoGenerated/BackboneComponent.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.Core +{ + public class BackboneComponent + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Core/AutoGenerated/BackboneStatusCache.cs b/APC Viewer/Library/Eaf/Core/AutoGenerated/BackboneStatusCache.cs new file mode 100644 index 0000000..3f03747 --- /dev/null +++ b/APC Viewer/Library/Eaf/Core/AutoGenerated/BackboneStatusCache.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.Core +{ + public class BackboneStatusCache + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Core/AutoGenerated/ILoggingSetupManager.cs b/APC Viewer/Library/Eaf/Core/AutoGenerated/ILoggingSetupManager.cs new file mode 100644 index 0000000..d8de627 --- /dev/null +++ b/APC Viewer/Library/Eaf/Core/AutoGenerated/ILoggingSetupManager.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.Core +{ + public interface ILoggingSetupManager + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Core/AutoGenerated/StatusItem.cs b/APC Viewer/Library/Eaf/Core/AutoGenerated/StatusItem.cs new file mode 100644 index 0000000..c895fc2 --- /dev/null +++ b/APC Viewer/Library/Eaf/Core/AutoGenerated/StatusItem.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.Core +{ + public class StatusItem + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Core/Backbone.cs b/APC Viewer/Library/Eaf/Core/Backbone.cs new file mode 100644 index 0000000..845b46b --- /dev/null +++ b/APC Viewer/Library/Eaf/Core/Backbone.cs @@ -0,0 +1,48 @@ +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 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 GetAllStatuses() { throw new NotImplementedException(); } + public BackboneComponent GetBackboneComponentById(string id) { throw new NotImplementedException(); } + public List GetBackboneComponentsOfType() { throw new NotImplementedException(); } + public List 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 components) { } + protected virtual void StopAllComponents() { } + protected void StopComponents(List components) { } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Core/Smtp/EmailMessage.cs b/APC Viewer/Library/Eaf/Core/Smtp/EmailMessage.cs new file mode 100644 index 0000000..c727cd5 --- /dev/null +++ b/APC Viewer/Library/Eaf/Core/Smtp/EmailMessage.cs @@ -0,0 +1,24 @@ +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(); } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Core/Smtp/ISmtp.cs b/APC Viewer/Library/Eaf/Core/Smtp/ISmtp.cs new file mode 100644 index 0000000..d7604c3 --- /dev/null +++ b/APC Viewer/Library/Eaf/Core/Smtp/ISmtp.cs @@ -0,0 +1,9 @@ +namespace Library.Eaf.Core.Smtp +{ + + public interface ISmtp + { + void Send(EmailMessage message); + } + +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Core/Smtp/MailPriority.cs b/APC Viewer/Library/Eaf/Core/Smtp/MailPriority.cs new file mode 100644 index 0000000..e6d37a0 --- /dev/null +++ b/APC Viewer/Library/Eaf/Core/Smtp/MailPriority.cs @@ -0,0 +1,11 @@ +namespace Library.Eaf.Core.Smtp +{ + + public enum MailPriority + { + Low = 0, + Normal = 1, + High = 2 + } + +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ChangeDataCollectionHandler.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ChangeDataCollectionHandler.cs new file mode 100644 index 0000000..869066d --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ChangeDataCollectionHandler.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public class ChangeDataCollectionHandler + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/DataCollectionRequest.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/DataCollectionRequest.cs new file mode 100644 index 0000000..e901799 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/DataCollectionRequest.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public class DataCollectionRequest + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentEvent.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentEvent.cs new file mode 100644 index 0000000..9a2dea9 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentEvent.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public class EquipmentEvent + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentException.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentException.cs new file mode 100644 index 0000000..6542474 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentException.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public class EquipmentException + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentSelfDescription.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentSelfDescription.cs new file mode 100644 index 0000000..c325af1 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentSelfDescription.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public class EquipmentSelfDescription + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/GetParameterValuesHandler.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/GetParameterValuesHandler.cs new file mode 100644 index 0000000..385ef82 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/GetParameterValuesHandler.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public class GetParameterValuesHandler + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IConnectionControl.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IConnectionControl.cs new file mode 100644 index 0000000..b346524 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IConnectionControl.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public interface IConnectionControl + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IDataTracingHandler.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IDataTracingHandler.cs new file mode 100644 index 0000000..3e73a9d --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IDataTracingHandler.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public interface IDataTracingHandler + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentCommandService.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentCommandService.cs new file mode 100644 index 0000000..d00a9ce --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentCommandService.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public interface IEquipmentCommandService + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentControl.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentControl.cs new file mode 100644 index 0000000..647d1ec --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentControl.cs @@ -0,0 +1,16 @@ +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; } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentSelfDescriptionBuilder.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentSelfDescriptionBuilder.cs new file mode 100644 index 0000000..15ca25f --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentSelfDescriptionBuilder.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public interface IEquipmentSelfDescriptionBuilder + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IPackage.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IPackage.cs new file mode 100644 index 0000000..0df5871 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IPackage.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public interface IPackage + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ISelfDescriptionLookup.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ISelfDescriptionLookup.cs new file mode 100644 index 0000000..6c04747 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ISelfDescriptionLookup.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public interface ISelfDescriptionLookup + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IVirtualParameterValuesHandler.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IVirtualParameterValuesHandler.cs new file mode 100644 index 0000000..7d8b40e --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IVirtualParameterValuesHandler.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public interface IVirtualParameterValuesHandler + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/SetParameterValuesHandler.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/SetParameterValuesHandler.cs new file mode 100644 index 0000000..6371ae8 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/SetParameterValuesHandler.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public class SetParameterValuesHandler + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/TraceRequest.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/TraceRequest.cs new file mode 100644 index 0000000..cee5da9 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/TraceRequest.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public class TraceRequest + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/IEquipmentDataCollection.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/IEquipmentDataCollection.cs new file mode 100644 index 0000000..e0f09e8 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/IEquipmentDataCollection.cs @@ -0,0 +1,39 @@ +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 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 parameters); + void TriggerEvent(EquipmentEvent equipmentEvent, IEnumerable parameters, IPackage sourcePackage); + void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable parameters); + void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable parameters, IPackage sourcePackage); + void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable parameters, string severityOverride, string descriptionOverride); + void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable parameters, string severityOverride, string descriptionOverride, IPackage sourcePackage); + void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable parameters, string severityOverride, string descriptionOverride, IPackage sourcePackage); + void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable parameters, string severityOverride, string descriptionOverride); + void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable parameters, IPackage sourcePackage); + void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable parameters); + void TriggerPerformanceRestored(); + void TriggerPerformanceWarning(); + void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable parameters); + void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable parameters, IPackage sourcePackage); + void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable parameters, DateTime equipmentTimeStamp); + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/Control/IPackageSource.cs b/APC Viewer/Library/Eaf/EquipmentCore/Control/IPackageSource.cs new file mode 100644 index 0000000..4771a37 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/Control/IPackageSource.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.EquipmentCore.Control +{ + public interface IPackageSource + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/DataCollection/Reporting/ParameterValue.cs b/APC Viewer/Library/Eaf/EquipmentCore/DataCollection/Reporting/ParameterValue.cs new file mode 100644 index 0000000..ae30878 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/DataCollection/Reporting/ParameterValue.cs @@ -0,0 +1,20 @@ +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(); } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ElementDescription/EquipmentParameter.cs b/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ElementDescription/EquipmentParameter.cs new file mode 100644 index 0000000..bcd9b96 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ElementDescription/EquipmentParameter.cs @@ -0,0 +1,24 @@ +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(); } + } + +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/Field.cs b/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/Field.cs new file mode 100644 index 0000000..a31b67a --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/Field.cs @@ -0,0 +1,12 @@ +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; } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/ParameterTypeDefinition.cs b/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/ParameterTypeDefinition.cs new file mode 100644 index 0000000..4d32eae --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/ParameterTypeDefinition.cs @@ -0,0 +1,12 @@ +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(); } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/StructuredType.cs b/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/StructuredType.cs new file mode 100644 index 0000000..5913805 --- /dev/null +++ b/APC Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/StructuredType.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes +{ + public class StructuredType : ParameterTypeDefinition + { + + public StructuredType(string name, string description, IList fields) : base(name, description) { } + + public IList Fields { get; } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/IConfigurationObject.cs b/APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/IConfigurationObject.cs new file mode 100644 index 0000000..e7dc564 --- /dev/null +++ b/APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/IConfigurationObject.cs @@ -0,0 +1,6 @@ +namespace Library.Eaf.Management.ConfigurationData.CellAutomation +{ + public interface IConfigurationObject + { + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterDefinition.cs b/APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterDefinition.cs new file mode 100644 index 0000000..537bbcf --- /dev/null +++ b/APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterDefinition.cs @@ -0,0 +1,26 @@ +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; } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterType.cs b/APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterType.cs new file mode 100644 index 0000000..9d25435 --- /dev/null +++ b/APC Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterType.cs @@ -0,0 +1,17 @@ +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 + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Eaf/Management/ConfigurationData/Semiconductor/CellInstances/SecsConnectionConfiguration.cs b/APC Viewer/Library/Eaf/Management/ConfigurationData/Semiconductor/CellInstances/SecsConnectionConfiguration.cs new file mode 100644 index 0000000..91ef359 --- /dev/null +++ b/APC Viewer/Library/Eaf/Management/ConfigurationData/Semiconductor/CellInstances/SecsConnectionConfiguration.cs @@ -0,0 +1,44 @@ +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; } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Ifx/Eaf/Common/Configuration/ConnectionSetting.cs b/APC Viewer/Library/Ifx/Eaf/Common/Configuration/ConnectionSetting.cs new file mode 100644 index 0000000..eaea75b --- /dev/null +++ b/APC Viewer/Library/Ifx/Eaf/Common/Configuration/ConnectionSetting.cs @@ -0,0 +1,13 @@ +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; } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/File.cs b/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/File.cs new file mode 100644 index 0000000..79f855c --- /dev/null +++ b/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/File.cs @@ -0,0 +1,19 @@ +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 ContentParameters { get; } + + public File UpdateContentParameters(Dictionary contentParameters) { throw new NotImplementedException(); } + public File UpdateParsingStatus(bool isErrorFile) { throw new NotImplementedException(); } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/FilePathGenerator.cs b/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/FilePathGenerator.cs new file mode 100644 index 0000000..8dafbc1 --- /dev/null +++ b/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/FilePathGenerator.cs @@ -0,0 +1,35 @@ +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 customPattern = null) { throw new NotImplementedException(); } + public FilePathGenerator(FileConnectorConfiguration config, File file, bool isErrorFile = false, Dictionary customPattern = null) { throw new NotImplementedException(); } + public FilePathGenerator(FileConnectorConfiguration config, string sourceFilePath, bool isErrorFile = false, Dictionary 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(); } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Configuration/FileConnectorConfiguration.cs b/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Configuration/FileConnectorConfiguration.cs new file mode 100644 index 0000000..5dc949d --- /dev/null +++ b/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Configuration/FileConnectorConfiguration.cs @@ -0,0 +1,135 @@ +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 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 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 + } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/SelfDescription/FileConnectorParameterTypeDefinitionProvider.cs b/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/SelfDescription/FileConnectorParameterTypeDefinitionProvider.cs new file mode 100644 index 0000000..23353cb --- /dev/null +++ b/APC Viewer/Library/Ifx/Eaf/EquipmentConnector/File/SelfDescription/FileConnectorParameterTypeDefinitionProvider.cs @@ -0,0 +1,14 @@ +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 GetAllParameterTypeDefinition() { return null; } + public ParameterTypeDefinition GetParameterTypeDefinition(string name) { return null; } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/PeerGroup/GCL/Annotations/NotNullAttribute.cs b/APC Viewer/Library/PeerGroup/GCL/Annotations/NotNullAttribute.cs new file mode 100644 index 0000000..fa311f4 --- /dev/null +++ b/APC Viewer/Library/PeerGroup/GCL/Annotations/NotNullAttribute.cs @@ -0,0 +1,10 @@ +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() { } + } +} \ No newline at end of file diff --git a/APC Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsConnectionMode.cs b/APC Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsConnectionMode.cs new file mode 100644 index 0000000..21ecf38 --- /dev/null +++ b/APC Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsConnectionMode.cs @@ -0,0 +1,8 @@ +namespace Library.PeerGroup.GCL.SecsDriver +{ + public enum HsmsConnectionMode + { + Active = 0, + Passive = 1 + } +} \ No newline at end of file diff --git a/APC Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsSessionMode.cs b/APC Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsSessionMode.cs new file mode 100644 index 0000000..6ea9d07 --- /dev/null +++ b/APC Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsSessionMode.cs @@ -0,0 +1,8 @@ +namespace Library.PeerGroup.GCL.SecsDriver +{ + public enum HsmsSessionMode + { + MultiSession = 0, + SingleSession = 1 + } +} \ No newline at end of file diff --git a/APC Viewer/Library/PeerGroup/GCL/SecsDriver/SecsTransportType.cs b/APC Viewer/Library/PeerGroup/GCL/SecsDriver/SecsTransportType.cs new file mode 100644 index 0000000..f5afda3 --- /dev/null +++ b/APC Viewer/Library/PeerGroup/GCL/SecsDriver/SecsTransportType.cs @@ -0,0 +1,8 @@ +namespace Library.PeerGroup.GCL.SecsDriver +{ + public enum SecsTransportType + { + HSMS = 0, + Serial = 1 + } +} \ No newline at end of file diff --git a/APC Viewer/Library/PeerGroup/GCL/SecsDriver/SerialBaudRate.cs b/APC Viewer/Library/PeerGroup/GCL/SecsDriver/SerialBaudRate.cs new file mode 100644 index 0000000..c3ffd63 --- /dev/null +++ b/APC Viewer/Library/PeerGroup/GCL/SecsDriver/SerialBaudRate.cs @@ -0,0 +1,16 @@ +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 + } +} \ No newline at end of file diff --git a/APC Viewer/Models/AppSettings.cs b/APC Viewer/Models/AppSettings.cs new file mode 100644 index 0000000..10470a0 --- /dev/null +++ b/APC Viewer/Models/AppSettings.cs @@ -0,0 +1,12 @@ +namespace APCViewer.Models +{ + public class AppSettings + { + public string Company { get; set; } + public string EncryptedPassword { get; set; } + public string MonARessource { get; set; } + public string Server { get; set; } + public string ServiceUser { get; set; } + public string URLs { get; set; } + } +} \ No newline at end of file diff --git a/APC Viewer/Models/ErrorViewModel.cs b/APC Viewer/Models/ErrorViewModel.cs new file mode 100644 index 0000000..8ed9f75 --- /dev/null +++ b/APC Viewer/Models/ErrorViewModel.cs @@ -0,0 +1,9 @@ +namespace APCViewer.Models +{ + public class ErrorViewModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + } +} \ No newline at end of file diff --git a/APC Viewer/Models/IBackground.cs b/APC Viewer/Models/IBackground.cs new file mode 100644 index 0000000..ee0a5aa --- /dev/null +++ b/APC Viewer/Models/IBackground.cs @@ -0,0 +1,91 @@ +namespace APCViewer.Models +{ + public interface IBackground + { + void APCDataCallback(); + // public void DataForApc(string workingDirectory, bool isGaN = false, bool isSi = false) + // { + // long ticks = DateTime.Now.Ticks; + // string server = GetServer(debugIsNotEC: false); + // Logic2019Q2 logic2019Q2 = new Logic2019Q2(_Log); + // Logic2020Q3 logic2020Q3 = new Logic2020Q3(_Log); + // string[] equipmentTypes = GetEquipmentTypes(isGaN, isSi); + // Dictionary pdsfFiles = new Dictionary(); + // Dictionary apcLogistics = new Dictionary(); + // Dictionary edaLogistics = new Dictionary(); + // Dictionary eafLogLogistics = new Dictionary(); + // logic2019Q2.Data(server, equipmentTypes, apcLogistics, pdsfFiles, isAPC: true); + // Tuple tuple = logic2020Q3.SetViewBag(apcLogistics, edaLogistics, eafLogLogistics, directory: null, filter: null, forPDSF: true, forIPDSF: false); + // if (tuple is null) { } + // List timePivot = logic2020Q3.GetTimePivot(equipmentTypes, apcLogistics, edaLogistics, eafLogLogistics, forPDSF: true, forIPDSF: false); + // _Log.Debug(string.Concat("Took ", new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds, " second(s)")); + // List list = new List(); + // StringBuilder stringBuilder = new StringBuilder(); + // foreach (string[] segments in timePivot) + // { + // foreach (string segment in segments) + // stringBuilder.Append(segment).Append('\t'); + // list.Add(stringBuilder.ToString()); + // stringBuilder.Clear(); + // } + // ShowWindow(workingDirectory, ShowWindowCommand.ShowMaximized, list); + // } + void EAFLogDataCallback(); + // public void DataForEafLog(string workingDirectory, bool isGaN = false, bool isSi = false) + // { + // long ticks = DateTime.Now.Ticks; + // string server = GetServer(debugIsNotEC: false); + // Logic2019Q2 logic2019Q2 = new Logic2019Q2(_Log); + // Logic2020Q3 logic2020Q3 = new Logic2020Q3(_Log); + // string[] equipmentTypes = GetEquipmentTypes(isGaN, isSi); + // Dictionary pdsfFiles = new Dictionary(); + // Dictionary apcLogistics = new Dictionary(); + // Dictionary edaLogistics = new Dictionary(); + // Dictionary eafLogLogistics = new Dictionary(); + // logic2019Q2.Data(server, equipmentTypes, eafLogLogistics, pdsfFiles, isEAFLog: true); + // Tuple tuple = logic2020Q3.SetViewBag(apcLogistics, edaLogistics, eafLogLogistics, directory: null, filter: null, forPDSF: false, forIPDSF: true); + // if (tuple is null) { } + // List timePivot = logic2020Q3.GetTimePivot(equipmentTypes, apcLogistics, edaLogistics, eafLogLogistics, forPDSF: false, forIPDSF: true); + // _Log.Debug(string.Concat("Took ", new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds, " second(s)")); + // List list = new List(); + // StringBuilder stringBuilder = new StringBuilder(); + // foreach (string[] segments in timePivot) + // { + // foreach (string segment in segments) + // stringBuilder.Append(segment).Append('\t'); + // list.Add(stringBuilder.ToString()); + // stringBuilder.Clear(); + // } + // ShowWindow(workingDirectory, ShowWindowCommand.ShowMaximized, list); + // } + void EDADataCallback(); + // public void DataForEda(string workingDirectory, bool isGaN = false, bool isSi = false) + // { + // long ticks = DateTime.Now.Ticks; + // string server = GetServer(debugIsNotEC: true); + // Logic2019Q2 logic2019Q2 = new Logic2019Q2(_Log); + // Logic2020Q3 logic2020Q3 = new Logic2020Q3(_Log); + // string[] equipmentTypes = GetEquipmentTypes(isGaN, isSi); + // Dictionary pdsfFiles = new Dictionary(); + // Dictionary apcLogistics = new Dictionary(); + // Dictionary edaLogistics = new Dictionary(); + // Dictionary eafLogLogistics = new Dictionary(); + // logic2019Q2.Data(server, equipmentTypes, edaLogistics, pdsfFiles, isEDA: true); + // Tuple tuple = logic2020Q3.SetViewBag(apcLogistics, edaLogistics, eafLogLogistics, directory: null, filter: null, forPDSF: true, forIPDSF: false); + // if (tuple is null) { } + // List timePivot = logic2020Q3.GetTimePivot(equipmentTypes, apcLogistics, edaLogistics, eafLogLogistics, forPDSF: true, forIPDSF: false); + // _Log.Debug(string.Concat("Took ", new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds, " second(s)")); + // List list = new List(); + // StringBuilder stringBuilder = new StringBuilder(); + // foreach (string[] segments in timePivot) + // { + // foreach (string segment in segments) + // stringBuilder.Append(segment).Append('\t'); + // list.Add(stringBuilder.ToString()); + // stringBuilder.Clear(); + // } + // ShowWindow(workingDirectory, ShowWindowCommand.ShowMaximized, list); + // } + } + +} \ No newline at end of file diff --git a/APC Viewer/Models/IHomeController.cs b/APC Viewer/Models/IHomeController.cs new file mode 100644 index 0000000..0ad79eb --- /dev/null +++ b/APC Viewer/Models/IHomeController.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Mvc; + +namespace APCViewer.Models +{ + public interface IHomeController + { + IActionResult Background(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null, bool? logistics_clear = null); + IActionResult DownloadCustomIPDSF(string ipdsf_file = null); + IActionResult DownloadCustomPDSF(string pdsf_file = null); + IActionResult DownloadIPDSF(string id = null); + IActionResult DownloadPDSF(string id = null); + IActionResult Encode(string value = null); + IActionResult Error(); + IActionResult Index(); + IActionResult IPDSF(string directory = null, string filter = null, bool is_gaN = false, bool is_Si = false); + IActionResult PDSF(string directory = null, string filter = null, bool is_gaN = false, bool is_Si = false); + IActionResult Privacy(); + IActionResult TimePivot(bool is_gaN = false, bool is_Si = false); + ContentResult ViewCustomIPDSF(string ipdsf_file = null); + ContentResult ViewCustomPDSF(string pdsf_file = null); + ContentResult ViewIPDSF(string id = null); + ContentResult ViewPDSF(string id = null); + } + +} \ No newline at end of file diff --git a/APC Viewer/Program.cs b/APC Viewer/Program.cs new file mode 100644 index 0000000..c7b6ba5 --- /dev/null +++ b/APC Viewer/Program.cs @@ -0,0 +1,40 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Shared; +using System.Diagnostics; + +namespace APCViewer +{ + + public class Program + { + + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + IHostBuilder result; + IsEnvironment isEnvironment = new IsEnvironment(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: Debugger.IsAttached, nullASPNetCoreEnvironmentIsProduction: !Debugger.IsAttached); + result = Host.CreateDefaultBuilder(args) + .UseWindowsService() + .ConfigureAppConfiguration((context, configuration) => + { + configuration + .AddEnvironmentVariables() + .AddCommandLine(args) + .AddJsonFile(isEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true); + }) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + return result; + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Properties/AssemblyInfo.cs b/APC Viewer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a8d6a07 --- /dev/null +++ b/APC Viewer/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("APC Viewer.Tests")] \ No newline at end of file diff --git a/APC Viewer/Shared/Description.cs b/APC Viewer/Shared/Description.cs new file mode 100644 index 0000000..fd3db42 --- /dev/null +++ b/APC Viewer/Shared/Description.cs @@ -0,0 +1,192 @@ +using Library.Eaf.Core; +using Library.Eaf.EquipmentCore.Control; +using Library.Eaf.EquipmentCore.DataCollection.Reporting; +using Library.Eaf.EquipmentCore.SelfDescription.ElementDescription; +using Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes; +using Library.Ifx.Eaf.EquipmentConnector.File.SelfDescription; +using Shared.Metrology; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; + +namespace Shared +{ + + public class Description + { + + public enum RowColumn + { + Test = 1000, + Count, + Index + } + + public enum LogisticsColumn + { + EventName = 2000, + NullData, + JobID, + Sequence, + MesEntity, + ReportFullPath, + ProcessJobID, + MID + } + + public enum Param + { + String = 0, + Integer = 2, + Double = 3, + Boolean = 4, + StructuredType = 5 + } + + internal const string FileFound = "FileFound"; + + + public List EquipmentParameters { get; private set; } + public List ParameterTypeDefinitions { get; private set; } + + private readonly bool _UseCyclical; + private readonly List _HeaderNames; + private readonly Dictionary _KeyIndexPairs; + private readonly ParameterTypeDefinition _StructuredType; + private readonly FileConnectorParameterTypeDefinitionProvider _FileConnectorParameterTypeDefinitionProvider; + + public Description(ILogic logic, ConfigDataBase configDataBase, IEquipmentControl equipmentControl) + { + _KeyIndexPairs = new Dictionary(); + _HeaderNames = configDataBase.GetHeaderNames(logic); + _UseCyclical = configDataBase.UseCyclicalForDescription; + _StructuredType = new StructuredType(nameof(StructuredType), string.Empty, new List()); + _FileConnectorParameterTypeDefinitionProvider = new FileConnectorParameterTypeDefinitionProvider(); + EquipmentParameters = new List(); + ParameterTypeDefinitions = new List { _StructuredType }; + Dictionary>> keyValuePairsCollection = configDataBase.GetParameterInfo(logic, allowNull: false); + List results = GetParameterValues(equipmentControl, keyValuePairsCollection); + } + + private List GetParameterValues(IEquipmentControl equipmentControl, Dictionary>> keyValuePairsCollection) + { + List results = new List(); + Enum param; + object value; + Enum[] @params; + string description; + List list; + EquipmentParameter equipmentParameter; + ParameterTypeDefinition parameterTypeDefinition; + bool addToEquipmentParameters = !EquipmentParameters.Any(); + foreach (KeyValuePair>> keyValuePair in keyValuePairsCollection) + { + if (!addToEquipmentParameters && !_KeyIndexPairs.ContainsKey(keyValuePair.Key)) + continue; + @params = (from l in keyValuePair.Value select l.Item1).Distinct().ToArray(); + if (@params.Length != 1) + throw new Exception(); + if (keyValuePair.Value[0].Item2 != keyValuePair.Key) + throw new Exception(); + param = @params[0]; + if (!addToEquipmentParameters) + equipmentParameter = EquipmentParameters[_KeyIndexPairs[keyValuePair.Key]]; + else + { + description = keyValuePair.Value[0].Item3; + _KeyIndexPairs.Add(keyValuePair.Key, EquipmentParameters.Count()); + if (param is Param.StructuredType || (_UseCyclical && !_HeaderNames.Contains(keyValuePair.Key))) + parameterTypeDefinition = _StructuredType; + else + parameterTypeDefinition = _FileConnectorParameterTypeDefinitionProvider.GetParameterTypeDefinition(param.ToString()); + equipmentParameter = new EquipmentParameter(keyValuePair.Key, parameterTypeDefinition, description); + EquipmentParameters.Add(equipmentParameter); + } + if (!_UseCyclical || _HeaderNames.Contains(keyValuePair.Key)) + value = keyValuePair.Value[0].Item4; + else + { + list = new List(); + for (int i = 0; i < keyValuePair.Value.Count; i++) + list.Add(new object[] { i, keyValuePair.Value[i].Item4 }); + value = list; + } + if (equipmentControl is null || !(param is Param.StructuredType)) + results.Add(new ParameterValue(equipmentParameter, value, DateTime.Now)); + else + results.Add(equipmentControl.DataCollection.CreateParameterValue(equipmentParameter, value)); + } + return results; + } + + public List GetParameterValues(ILogic logic, IEquipmentControl equipmentControl, JsonElement jsonElement, int? i = null, Dictionary keyValuePairs = null) + { + List results = new List(); + if (_UseCyclical && (i is null || i.Value > 0)) + throw new Exception(); + if (jsonElement.ValueKind != JsonValueKind.Array) + throw new Exception(); + Enum param; + Tuple tuple; + JsonElement[] jsonElements = jsonElement.EnumerateArray().ToArray(); + Dictionary>> keyValuePairsCollection = new Dictionary>>(); + for (int r = i.Value; r < jsonElements.Length; r++) + { + foreach (JsonProperty jsonProperty in jsonElement[r].EnumerateObject()) + { + if (jsonProperty.Value.ValueKind == JsonValueKind.Object || jsonProperty.Value.ValueKind == JsonValueKind.Array) + { + param = Param.StructuredType; + //jValue = jObject.Value("Item1"); + throw new NotImplementedException("Item1"); + } + else + { + switch (jsonProperty.Value.ValueKind) + { + case JsonValueKind.String: + param = Param.String; + break; + case JsonValueKind.Number: + param = Param.Double; + break; + case JsonValueKind.True: + case JsonValueKind.False: + param = Param.Boolean; + break; + case JsonValueKind.Null: + param = Param.String; + break; + default: + param = Param.StructuredType; + break; + } + } + tuple = new Tuple(param, jsonProperty.Name, string.Empty, jsonProperty.Value.ToString()); + if (!keyValuePairsCollection.ContainsKey(jsonProperty.Name)) + keyValuePairsCollection.Add(jsonProperty.Name, new List>()); + keyValuePairsCollection[jsonProperty.Name].Add(tuple); + } + if (!_UseCyclical) + break; + } + results = GetParameterValues(equipmentControl, keyValuePairsCollection); + return results; + } + + public static string GetCellName() + { + string result; + if (Backbone.Instance?.CellName is null) + result = string.Empty; + else + result = Backbone.Instance.CellName; + if (result.Contains("-IO")) + result = result.Replace("-IO", string.Empty); + return result; + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/EquipmentType.cs b/APC Viewer/Shared/EquipmentType.cs new file mode 100644 index 0000000..dd1413a --- /dev/null +++ b/APC Viewer/Shared/EquipmentType.cs @@ -0,0 +1,53 @@ +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 + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/IProcessData.cs b/APC Viewer/Shared/IProcessData.cs new file mode 100644 index 0000000..16017fe --- /dev/null +++ b/APC Viewer/Shared/IProcessData.cs @@ -0,0 +1,16 @@ +using Shared.Metrology; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +namespace Shared +{ + public interface IProcessData + { + + Tuple> GetResults(ILogic logic, ConfigDataBase configData, List fileInfoCollection); + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/IProcessDataDescription.cs b/APC Viewer/Shared/IProcessDataDescription.cs new file mode 100644 index 0000000..b949bef --- /dev/null +++ b/APC Viewer/Shared/IProcessDataDescription.cs @@ -0,0 +1,26 @@ +using Shared.Metrology; +using System.Collections.Generic; + +namespace Shared +{ + + public interface IProcessDataDescription + { + + int Test { get; set; } + int Count { get; set; } + int Index { get; set; } + IProcessDataDescription GetDefault(ILogic logic, ConfigDataBase configDataBase); + IProcessDataDescription GetDisplayNames(ILogic logic, ConfigDataBase configDataBase); + List GetDescription(ILogic logic, ConfigDataBase configDataBase, List tests, IProcessData iProcessData); + List GetDetailNames(ILogic logic, ConfigDataBase configDataBase); + List GetHeaderNames(ILogic logic, ConfigDataBase configDataBase); + List GetIgnoreParameterNames(ILogic logic, ConfigDataBase configDataBase, Test test); + List GetNames(ILogic logic, ConfigDataBase configDataBase); + List GetPairedParameterNames(ILogic logic, ConfigDataBase configDataBase); + List GetParameterNames(ILogic logic, ConfigDataBase configDataBase); + string GetEventDescription(); + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/IScopeInfo.cs b/APC Viewer/Shared/IScopeInfo.cs new file mode 100644 index 0000000..b0dfd33 --- /dev/null +++ b/APC Viewer/Shared/IScopeInfo.cs @@ -0,0 +1,21 @@ +using System; + +namespace Shared +{ + + public interface IScopeInfo + { + + Enum Enum { get; } + string HTML { get; } + string Title { get; } + string FileName { get; } + int TestValue { get; } + string Header { get; } + string QueryFilter { get; } + string FileNameWithoutExtension { get; } + EquipmentType EquipmentType { get; } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/IsEnvironment.cs b/APC Viewer/Shared/IsEnvironment.cs new file mode 100644 index 0000000..c24b236 --- /dev/null +++ b/APC Viewer/Shared/IsEnvironment.cs @@ -0,0 +1,171 @@ +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; + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Logistics.cs b/APC Viewer/Shared/Logistics.cs new file mode 100644 index 0000000..8953f04 --- /dev/null +++ b/APC Viewer/Shared/Logistics.cs @@ -0,0 +1,245 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace Shared +{ + + public class Logistics + { + + public object NullData { get; private set; } + public string JobID { get; private set; } //CellName + public long Sequence { get; private set; } //Ticks + public DateTime DateTimeFromSequence { get; private set; } + public double TotalSecondsSinceLastWriteTimeFromSequence { get; private set; } + public string MesEntity { get; private set; } //SPC + public string ReportFullPath { get; private set; } //Extract file + public string ProcessJobID { get; internal set; } //Reactor (duplicate but I want it in the logistics) + public string MID { get; internal set; } //Lot & Pocket || Lot + public List Tags { get; internal set; } + public List Logistics1 { get; internal set; } + public List Logistics2 { get; internal set; } + + public Logistics() + { + DateTime dateTime = DateTime.Now; + NullData = null; + JobID = Description.GetCellName(); + Sequence = dateTime.Ticks; + DateTimeFromSequence = dateTime; + TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds; + MesEntity = DefaultMesEntity(dateTime); + ReportFullPath = string.Empty; + ProcessJobID = nameof(ProcessJobID); + MID = nameof(MID); + Tags = new List(); + Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList(); + Logistics2 = new List(); + } + + public Logistics(object nullData, Dictionary cellNames, Dictionary mesEntities, FileInfo fileInfo, bool useSplitForMID, int? fileInfoLength = null) + { + NullData = nullData; + string mesEntity = string.Empty; + string jobID = Description.GetCellName(); + DateTime dateTime = fileInfo.LastWriteTime; + if (fileInfoLength.HasValue && fileInfo.Length < fileInfoLength.Value) + dateTime = dateTime.AddTicks(-1); + if (string.IsNullOrEmpty(jobID)) + { + if (cellNames.Count == 1) + jobID = cellNames.ElementAt(0).Key; + else + { + string reportFullPathLower = fileInfo.FullName.ToLower(); + foreach (var element in cellNames) + { + if (reportFullPathLower.Contains(element.Key) || reportFullPathLower.Contains(element.Value)) + { + jobID = element.Key; + break; + } + } + } + } + if (string.IsNullOrEmpty(jobID)) + throw new Exception(); + if (mesEntities.ContainsKey(jobID)) + mesEntity = mesEntities[jobID]; + else if (mesEntities.Count == 1) + mesEntity = mesEntities.ElementAt(0).Value; + // + if (string.IsNullOrEmpty(mesEntity)) + throw new Exception(); + JobID = jobID; + Sequence = dateTime.Ticks; + DateTimeFromSequence = dateTime; + TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds; + MesEntity = mesEntity; + ReportFullPath = fileInfo.FullName; + ProcessJobID = nameof(ProcessJobID); + string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileInfo.FullName); + if (useSplitForMID) + { + if (fileNameWithoutExtension.IndexOf(".") > -1) + fileNameWithoutExtension = fileNameWithoutExtension.Split('.')[0].Trim(); + if (fileNameWithoutExtension.IndexOf("_") > -1) + fileNameWithoutExtension = fileNameWithoutExtension.Split('_')[0].Trim(); + if (fileNameWithoutExtension.IndexOf("-") > -1) + fileNameWithoutExtension = fileNameWithoutExtension.Split('-')[0].Trim(); + } + MID = string.Concat(fileNameWithoutExtension.Substring(0, 1).ToUpper(), fileNameWithoutExtension.Substring(1).ToLower()); + Tags = new List(); + Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList(); + Logistics2 = new List(); + } + + public Logistics(string reportFullPath, string logistics) + { + string key; + DateTime dateTime; + string[] segments; + Logistics1 = logistics.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList(); + if (!Logistics1.Any() || !Logistics1[0].StartsWith("LOGISTICS_1")) + { + NullData = null; + JobID = "null"; + dateTime = new FileInfo(reportFullPath).LastWriteTime; + Sequence = dateTime.Ticks; + DateTimeFromSequence = dateTime; + TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds; + MesEntity = DefaultMesEntity(dateTime); + ReportFullPath = reportFullPath; + ProcessJobID = "R##"; + MID = "null"; + Tags = new List(); + Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList(); + Logistics2 = new List(); + } + else + { + string logistics1Line1 = Logistics1[0]; + key = "NULL_DATA="; + if (!logistics1Line1.Contains(key)) + NullData = null; + else + { + segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + NullData = segments[1].Split(';')[0]; + } + key = "JOBID="; + if (!logistics1Line1.Contains(key)) + JobID = "null"; + else + { + segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + JobID = segments[1].Split(';')[0]; + } + key = "SEQUENCE="; + if (!logistics1Line1.Contains(key)) + dateTime = new FileInfo(reportFullPath).LastWriteTime; + else + { + segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + if (!long.TryParse(segments[1].Split(';')[0].Split('.')[0], out long sequence) || sequence < new DateTime(1999, 1, 1).Ticks) + dateTime = new FileInfo(reportFullPath).LastWriteTime; + else + dateTime = new DateTime(sequence); + } + Sequence = dateTime.Ticks; + DateTimeFromSequence = dateTime; + TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTime).TotalSeconds; + DateTime lastWriteTime = new FileInfo(reportFullPath).LastWriteTime; + if (TotalSecondsSinceLastWriteTimeFromSequence > 600) + { + if (lastWriteTime != dateTime) + try + { File.SetLastWriteTime(reportFullPath, dateTime); } + catch (Exception) { } + } + key = "MES_ENTITY="; + if (!logistics1Line1.Contains(key)) + MesEntity = DefaultMesEntity(dateTime); + else + { + segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + MesEntity = segments[1].Split(';')[0]; + } + ReportFullPath = reportFullPath; + key = "PROCESS_JOBID="; + if (!logistics1Line1.Contains(key)) + ProcessJobID = "R##"; + else + { + segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + ProcessJobID = segments[1].Split(';')[0]; + } + key = "MID="; + if (!logistics1Line1.Contains(key)) + MID = "null"; + else + { + segments = logistics1Line1.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + MID = segments[1].Split(';')[0]; + } + } + Logistics2 logistics2; + Tags = new List(); + Logistics2 = new List(); + for (int i = 1; i < Logistics1.Count(); i++) + { + if (Logistics1[i].StartsWith("LOGISTICS_2")) + { + logistics2 = new Logistics2(Logistics1[i]); + Logistics2.Add(logistics2); + } + } + for (int i = Logistics1.Count() - 1; i > -1; i--) + { + if (Logistics1[i].StartsWith("LOGISTICS_2")) + Logistics1.RemoveAt(i); + } + } + + public Logistics ShallowCopy() + { + return (Logistics)MemberwiseClone(); + } + + private string DefaultMesEntity(DateTime dateTime) + { + return string.Concat(dateTime.Ticks, "_MES_ENTITY"); + } + + internal string GetLotViaMostCommonMethod() + { + return MID.Substring(0, MID.Length - 2); + } + + internal string GetPocketNumberViaMostCommonMethod() + { + return MID.Substring(MID.Length - 2); + } + + internal void Update(string dateTime, string processJobID, string mid) + { + if (!DateTime.TryParse(dateTime, out DateTime dateTimeCasted)) + dateTimeCasted = DateTime.Now; + NullData = null; + //JobID = Description.GetCellName(); + Sequence = dateTimeCasted.Ticks; + DateTimeFromSequence = dateTimeCasted; + TotalSecondsSinceLastWriteTimeFromSequence = (DateTime.Now - dateTimeCasted).TotalSeconds; + //MesEntity = DefaultMesEntity(dateTime); + //ReportFullPath = string.Empty; + ProcessJobID = processJobID; + MID = mid; + Tags = new List(); + Logistics1 = new string[] { string.Concat("LOGISTICS_1", '\t', "A_JOBID=", JobID, ";A_MES_ENTITY=", MesEntity, ";") }.ToList(); + Logistics2 = new List(); + } + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Logistics2.cs b/APC Viewer/Shared/Logistics2.cs new file mode 100644 index 0000000..f41d4c5 --- /dev/null +++ b/APC Viewer/Shared/Logistics2.cs @@ -0,0 +1,80 @@ +using System; + +namespace Shared +{ + public class Logistics2 + { + + public string MID { get; private set; } + public string RunNumber { get; private set; } + public string SatelliteGroup { get; private set; } + public string PartNumber { get; private set; } + public string PocketNumber { get; private set; } + public string WaferLot { get; private set; } + public string Recipe { get; private set; } + + public Logistics2(string logistics2) + { + string key; + string[] segments; + key = "JOBID="; + if (!logistics2.Contains(key)) + MID = "null"; + else + { + segments = logistics2.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + MID = segments[1].Split(';')[0]; + } + key = "MID="; + if (!logistics2.Contains(key)) + RunNumber = "null"; + else + { + segments = logistics2.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + RunNumber = segments[1].Split(';')[0]; + } + key = "INFO="; + if (!logistics2.Contains(key)) + SatelliteGroup = "null"; + else + { + segments = logistics2.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + SatelliteGroup = segments[1].Split(';')[0]; + } + key = "PRODUCT="; + if (!logistics2.Contains(key)) + PartNumber = "null"; + else + { + segments = logistics2.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + PartNumber = segments[1].Split(';')[0]; + } + key = "CHAMBER="; + if (!logistics2.Contains(key)) + PocketNumber = "null"; + else + { + segments = logistics2.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + PocketNumber = segments[1].Split(';')[0]; + } + key = "WAFER_ID="; + if (!logistics2.Contains(key)) + WaferLot = "null"; + else + { + segments = logistics2.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + WaferLot = segments[1].Split(';')[0]; + } + key = "PPID="; + if (!logistics2.Contains(key)) + Recipe = "null"; + else + { + segments = logistics2.Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries); + Recipe = segments[1].Split(';')[0]; + } + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/Column.cs b/APC Viewer/Shared/Metrology/Column.cs new file mode 100644 index 0000000..60957aa --- /dev/null +++ b/APC Viewer/Shared/Metrology/Column.cs @@ -0,0 +1,1605 @@ +using System; + +namespace Shared.Metrology +{ + + public static class ColumnGet + { + + public static string GetDiplayName(this Column column) + { + string results; + switch (column) + { + //case Column._8in_Total_Warp_Verification: results = "8in Total Warp Verification"; break; + //case Column.AFM_Monthly_Y: results = "AFM-Monthly Y"; break; + //case Column.AFM_Monthly: results = "AFM_Monthly"; break; + case Column.AFM_Pit_Count: + results = "AFM Pit Count"; + break; + case Column.AFM_Roughness: + results = "AFM Roughness"; + break; + //case Column.Adder_Bin_1: results = "Adder Bin 1"; break; + //case Column.Adder_Bin_2: results = "Adder Bin 2"; break; + //case Column.Adder_Bin_3: results = "Adder Bin 3"; break; + //case Column.Adder_Bin_4: results = "Adder Bin 4"; break; + //case Column.Adder_Bin_5: results = "Adder Bin 5"; break; + //case Column.Adder_Bin_6: results = "Adder Bin 6"; break; + //case Column.Adder_Bin_9: results = "Adder Bin 9"; break; + case Column.Al_B_B_WTAVG: + results = "Al% B.B. WTAVG"; + break; + case Column.Al_B_B_: + results = "Al% B.B."; + break; + case Column.Al_Barrier_WTAVG: + results = "Al% Barrier WTAVG"; + break; + case Column.Al_Barrier: + results = "Al% Barrier"; + break; + case Column.Al_SLS_WTAVG: + results = "Al% SLS WTAVG"; + break; + case Column.Al_SLS: + results = "Al% SLS"; + break; + case Column.Al_TL1_WTAVG: + results = "Al% TL1 WTAVG"; + break; + case Column.Al_TL1: + results = "Al% TL1"; + break; + case Column.Al_TL2_WTAVG: + results = "Al% TL2 WTAVG"; + break; + //case Column.BV_Resistance: results = "BV Resistance"; break; //BV Monthly Verification + case Column.BandEdge_V: + results = "BandEdge_V"; + break; + case Column.BandEdge_V_XY: + results = "BandEdge_V_XY"; + break; + case Column.BandEdge_nm: + results = "BandEdge_nm"; + break; + case Column.Barrier_Composition_RPM_XY: + results = "Barrier_Composition_RPM_XY"; + break; + case Column.Bow_Calibration: + results = "Bow Calibration"; + break; + case Column.Bow_Range: + results = "Bow Range"; + break; + case Column.Bow: + results = "Bow"; + break; + case Column.BowCenter: + results = "BowCenter"; + break; + case Column.BowX: + results = "BowX"; + break; + case Column.BowY: + results = "BowY"; + break; + case Column.Breakdown_Voltage_Edge: + results = "Breakdown Voltage - Edge"; + break; + case Column.Breakdown_VoltageMiddle: + results = "Breakdown Voltage - Middle"; + break; + case Column.Breakdown_Voltage: + results = "Breakdown Voltage"; + break; + case Column.CV_C_at_10V: + results = "CV C at -10V"; + break; + case Column.CV_Nd_Min: + results = "CV Nd Min"; + break; + //case Column.Candela_Large_LPD_Quarterly: results = "Candela Large LPD Quarterly"; break; + //case Column.Candela_Medium_LPD_Quarterly: results = "Candela Medium LPD Quarterly"; break; + //case Column.Candela_Small_LPD_Quarterly: results = "Candela Small LPD Quarterly"; break; + //case Column.Candela_Total_Quarterly: results = "Candela Total Quarterly"; break; + case Column.Candela_102_83nm: + results = "102-83nm"; + break; + case Column.Candela_1_1um: + results = "1.1um"; + break; + case Column.Candela_496nm: + results = "496nm"; + break; + case Column.Candela_600nm: + results = "600nm"; + break; + case Column.Candela_8620_Small: + results = "Candela 8620 Small"; + break; + case Column.Candela_Crack_Verification: + results = "Crack Verification"; + break; + case Column.Candela_Cracking: + results = "Candela Cracking"; + break; + case Column.Candela_Cracking_Acceptable: + results = "Candela Cracking Acceptable"; + break; + case Column.Candela_Crater: + results = "Candela Crater"; + break; + case Column.Candela_Crater_Verification: + results = "Crater verification"; + break; + case Column.Candela_Haze: + results = "Candela Haze"; + break; + case Column.Candela_LPD_Large: + results = "Candela LPD Large"; + break; + case Column.Candela_LPD_Medium: + results = "Candela LPD Medium"; + break; + case Column.Candela_LPD_Small: + results = "Candela LPD Small"; + break; + case Column.Candela_Large_Verification: + results = "Large Verification"; + break; + case Column.Candela_Medium_Verification: + results = "Medium Verification"; + break; + case Column.Candela_Pits: + results = "Candela Pits"; + break; + case Column.Candela_Pits_Verification: + results = "Pits verification"; + break; + case Column.Candela_SPE: + results = "Candela SPE"; + break; + case Column.Candela_SPE_Verification: + results = "SPE verification"; + break; + case Column.Candela_Slip: + results = "Candela Slip"; + break; + case Column.Candela_Small_Verification: + results = "Small Verification"; + break; + case Column.Candela_Spirals: + results = "Candela Spirals"; + break; + case Column.Candela_Spirals_Verification: + results = "Candela Spirals Verification"; + break; + case Column.Candela_Total_Defects: + results = "Candela Total Defects"; + break; + case Column.Candela_Total_PSL: + results = "Candela Total PSL"; + break; + case Column.Candela__1_1um: + results = ">1.1um"; + break; + //case Column.Comment: results = "Comment"; break; + //case Column.Conductivity: results = "Conductivity"; break; + case Column.Contact_Symmetry: + results = "Contact Symmetry"; + break; + //case Column.Cracking_verification: results = "Cracking verification"; break; + //case Column.Crater_verification: results = "Crater verification"; break; + case Column.Date: + results = "Date"; + break; + case Column.Denton_Crystal_Life: + results = "Denton_Crystal_Life"; + break; + case Column.Denton_Current_AVG: + results = "Denton_Current_AVG"; + break; + case Column.Denton_Current_STDEV: + results = "Denton_Current_STDEV"; + break; + case Column.Denton_Deposition_Power_AVG: + results = "Denton_Deposition_Power_AVG"; + break; + case Column.Denton_Deposition_Power_STDEV: + results = "Denton_Deposition_Power_STDEV"; + break; + case Column.Denton_Deposition_Rate_AVG: + results = "Denton_Deposition_Rate_AVG"; + break; + case Column.Denton_Deposition_Rate_STDEV: + results = "Denton_Deposition_Rate_STDEV"; + break; + case Column.Denton_Gun_Pocket: + results = "Denton_Gun_Pocket"; + break; + case Column.Denton_Pumpdown_Time: + results = "Denton_Pumpdown_Time"; + break; + case Column.Denton_Voltage_AVG: + results = "Denton_Voltage_AVG"; + break; + case Column.Denton_Voltage_STDEV: + results = "Denton_Voltage_STDEV"; + break; + case Column.Employee: + results = "Employee"; + break; + case Column.Epi_Thickness_Mean: + results = "Epi Thickness Mean"; + break; + case Column.Epi_Thickness_Mean_XY: + results = "Epi Thickness Mean_XY"; + break; + case Column.Epi_Thickness_Std_Dev_: + results = "Epi Thickness Std Dev %"; + break; + case Column.FWHM_006_WTAVG: + results = "FWHM 006 WTAVG"; + break; + case Column.FWHM_006: + results = "FWHM 006"; + break; + case Column.FWHM_105_WTAVG: + results = "FWHM 105 WTAVG"; + break; + case Column.FWHM_105: + results = "FWHM 105"; + break; + case Column.Hall_Rs: + results = "Hall Rs"; + break; + case Column.Hall_Mobility_verif_sample: + results = "Hall_Mobility_verif_sample"; + break; + case Column.Hall_Ns_verif_sample: + results = "Hall_Ns_verif_sample"; + break; + case Column.Hall_Rs_verif_sample: + results = "Hall_Rs_verif_sample"; + break; + case Column.Job: + results = "Job"; + break; + case Column.LEI_RS_Average_value: + results = "LEI RS Average value"; + break; + case Column.LEI_RS_Maximum_value: + results = "LEI RS Maximum value"; + break; + case Column.LEI_RS_Minimum_value: + results = "LEI RS Minimum value"; + break; + case Column.LEI_RS_STDEV: + results = "LEI RS STDEV"; + break; + case Column.LEI_RS_STDEV_: + results = "LEI RS STDEV%"; + break; + //case Column.Large_Adder_Sum: results = "Large Adder Sum"; break; + case Column.Lot: + results = "Lot"; + break; + //case Column.Medium_Adder_Sum: results = "Medium Adder Sum"; break; + case Column.Microscope_Center_5x: + results = "Microscope Center 5x"; + break; + case Column.Microscope_Center_50x: + results = "Microscope Center 50x"; + break; + case Column.Microscope_Middle_5x: + results = "Microscope Middle 5x"; + break; + case Column.Microscope_Middle_50x: + results = "Microscope Middle 50x"; + break; + case Column.Microscope_Edge_5x: + results = "Microscope Edge 5x"; + break; + case Column.Microscope_Edge_50x: + results = "Microscope Edge 50x"; + break; + case Column.Mobility_Verification: + results = "Mobility Verification"; + break; + case Column.Mobility: + results = "Mobility"; + break; + case Column.Ns_Verification: + results = "Ns Verification"; + break; + case Column.PL_Edge_Wavelength: + results = "PL Edge Wavelength"; + break; + case Column.PL_Ratio: + results = "PL Ratio"; + break; + case Column.PR_Barrier_Composition: + results = "PR Barrier Composition"; + break; + case Column.PR_Peak: + results = "PR Peak"; + break; + case Column.Part: + results = "Part"; + break; + //case Column.Particles_verification: results = "Particles verification"; break; + //case Column.Pits_verification: results = "Pits verification"; break; + //case Column.Pocket: results = "Pocket"; break; + //case Column.Post_Bin_1: results = "Post Bin 1"; break; + //case Column.Post_Bin_2: results = "Post Bin 2"; break; + //case Column.Post_Bin_3: results = "Post Bin 3"; break; + //case Column.Post_Bin_4: results = "Post Bin 4"; break; + //case Column.Post_Bin_5: results = "Post Bin 5"; break; + //case Column.Post_Bin_6: results = "Post Bin 6"; break; + //case Column.Post_Bin_9: results = "Post Bin 9"; break; + //case Column.Pre_Bin_1: results = "Pre Bin 1"; break; + //case Column.Pre_Bin_2: results = "Pre Bin 2"; break; + //case Column.Pre_Bin_3: results = "Pre Bin 3"; break; + //case Column.Pre_Bin_4: results = "Pre Bin 4"; break; + //case Column.Pre_Bin_5: results = "Pre Bin 5"; break; + //case Column.Pre_Bin_6: results = "Pre Bin 6"; break; + //case Column.Pre_Bin_9: results = "Pre Bin 9"; break; + case Column.Process: + results = "Process"; + break; + //case Column.RPM_verif_Thickness_1: results = "RPM_verif_Thickness_1"; break; + //case Column.RPM_verif_Thickness_2: results = "RPM_verif_Thickness_2"; break; + //case Column.RPM_verif_Thickness_3: results = "RPM_verif_Thickness_3"; break; + //case Column.RPM_verif_Thickness_Average: results = "RPM_verif_Thickness_Average"; break; + //case Column.RTA_oxide_Thk_Change: results = "RTA oxide Thk Change"; break; + //case Column.RTA_oxide_post_anneal_Thk: results = "RTA oxide post-anneal Thk"; break; + //case Column.RTA_oxide_pre_anneal_Thk: results = "RTA oxide pre-anneal Thk"; break; + case Column.Recipe: + results = "Recipe"; + break; + //case Column.Resistivity_2_ohm_cm: results = "Resistivity 2 ohm cm"; break; //LEI Weekly Verification + //case Column.Resistivity_600_ohm_cm: results = "Resistivity 600 ohm cm"; break; //LEI Weekly Verification + case Column.Rs_verification: + results = "Rs verification"; + break; + case Column.Rs_verif_100kohm: + results = "Rs_verif_100kohm"; + break; + case Column.Rs_verif_10ohm: + results = "Rs_verif_10ohm"; + break; + case Column.Rs_verif_1kohm: + results = "Rs_verif_1kohm"; + break; + case Column.SID: + results = "SID"; + break; + case Column.SL_Period_WTAVG: + results = "SL Period WTAVG"; + break; + case Column.SL_Period: + results = "SL Period"; + break; + //case Column.SPE_verification: results = "SPE verification"; break; + //case Column.Sample_ID: results = "Sample ID"; break; + case Column.Sheet_Concentration: + results = "Sheet Concentration"; + break; + //case Column.Size: results = "Size"; break; + //case Column.Small_Adder_Sum: results = "Small Adder Sum"; break; + //case Column.Spirals_verification: results = "Spirals verification"; break; + case Column.Time: + results = "Time"; + break; + case Column.Tool_ID: + results = "Tool ID"; + break; + //case Column.Total_LPD_Adder: results = "Total LPD Adder"; break; + //case Column.Total_Verification: results = "Total Verification"; break; + case Column.Total_Warp_Calibration: + results = "Total Warp Calibration"; + break; + case Column.UV_Broken: + results = "UV Broken"; + break; + case Column.UV_Chipping: + results = "UV Chipping"; + break; + case Column.UV_Cracking_0_3mm_: + results = "UV Cracking (0-3mm)"; + break; + case Column.UV_Cracking_3_7mm_: + results = "UV Cracking (3-7mm)"; + break; + case Column.UV_Cracking_7mm_: + results = "UV Cracking (>7mm)"; + break; + case Column.UV_Crazing: + results = "UV Crazing"; + break; + case Column.UV_Crazing_Acceptable: + results = "UV Crazing Acceptable"; + break; + case Column.UV_FULL_Characterization_Wafer: + results = "UV FULL Characterization Wafer"; + break; + case Column.UV_Haze_count_: + results = "UV Haze (count)"; + break; + case Column.UV_LIGHT_Characterization_Wafer: + results = "UV LIGHT Characterization Wafer"; + break; + case Column.UV_Non_rotation: + results = "UV Non-rotation"; + break; + case Column.UV_Other: + results = "UV Other"; + break; + case Column.UV_Scratch_count_: + results = "UV Scratch (count)"; + break; + case Column.UV_Slip_count_: + results = "UV Slip (count)"; + break; + case Column.UV_True_Haze: + results = "UV True Haze"; + break; + case Column.UV_True_Haze_Acceptable: + results = "UV True Haze Acceptable"; + break; + case Column.UV_SPE_1mm_count: + results = "UV-SPE (>1mm) count"; + break; + case Column.UV_SPE_count_: + results = "UV-SPE (count)"; + break; + case Column.Verification_Contact_Symmetry: + results = "Verification Contact Symmetry"; + break; + case Column.Vp_Pinch_Off_Voltage: + results = "Vp Pinch Off Voltage"; + break; + case Column.Wafer_ID: + results = "Wafer ID"; + break; + //case Column.Wafer_Pocket: results = "Wafer Pocket"; break; + case Column.Wafer_Region: + results = "Wafer Region"; + break; + case Column.Wafer_Scribe: + results = "Wafer Scribe"; + break; + case Column.WaferPocket_Candela: + results = "WaferPocket_Candela"; + break; + case Column.WaferPocket_Warp: + results = "WaferPocket_Warp"; + break; + case Column.WaferPosition_CV: + results = "WaferPosition_CV"; + break; + case Column.WaferPosition_BV: + results = "WaferPosition_BV"; + break; + case Column.WaferPosition_Hall: + results = "WaferPosition_Hall"; + break; + case Column.WaferPosition_PR: + results = "WaferPosition_PR"; + break; + case Column.Warp: + results = "Warp"; + break; + case Column.X_Coord: + results = "X-Coord"; + break; + case Column.XRD_2_Theta_Peak_002: + results = "XRD 2 Theta Peak 002"; + break; + case Column.XRD_2_Theta_Peak_101: + results = "XRD 2 Theta Peak 101"; + break; + case Column.XRD_2_Theta_Position: + results = "XRD 2-Theta Position"; + break; + case Column.XRD_2_Theta_Position_Si_1: + results = "XRD 2-Theta Position Si 1"; + break; + case Column.XRD_2_Theta_Position_Si_2: + results = "XRD 2-Theta Position Si 2"; + break; + case Column.XRD_2_Theta_Position_Si_3: + results = "XRD 2-Theta Position Si 3"; + break; + case Column.XRD_Peak_002_Intensity: + results = "XRD Peak 002 Intensity"; + break; + case Column.XRD_Peak_101_Intensity: + results = "XRD Peak 101 Intensity"; + break; + case Column.XRD_Weekly_AL_Center: + results = "XRD Weekly AL% Center"; + break; + case Column.XRD_Weekly_Back_Barrier_Al_: + results = "Back Barrier Al%"; + break; + case Column.XRD_Weekly_Barrier_Al_: + results = "Barrier Al%"; + break; + case Column.XRD_Weekly_FWHM_002: + results = "XRD Weekly FWHM 002"; + break; + case Column.XRD_Weekly_FWHM_101: + results = "XRD Weekly FWHM 101"; + break; + case Column.XRD_Weekly_FWHM_105: + results = "XRD Weekly FWHM 105"; + break; + case Column.XRD_Weekly_Fringe_thick_0_0_: + results = "XRD Weekly Fringe thick (0,0)"; + break; + case Column.XRD_Weekly_Fringe_thick_48_48_: + results = "XRD Weekly Fringe thick (48,48)"; + break; + case Column.XRD_Weekly_Intensity: + results = "XRD Weekly Intensity"; + break; + case Column.XRD_Weekly_Super_Lattice_Al_: + results = "Super Lattice Al%"; + break; + case Column.XRD_Weekly_Super_Lattice_period: + results = "Super Lattice period"; + break; + case Column.XRD_Weekly_Super_Lattice_tks: + results = "Super Lattice tks"; + break; + case Column.XRR_Thickness_nm_WTAVG: + results = "XRR Thickness (nm) WTAVG"; + break; + case Column.XRR_Thickness_nm_: + results = "XRR Thickness (nm)"; + break; + case Column.Y_Coord: + results = "Y-Coord"; + break; + case Column.YellowBand_Power_mW_: + results = "YellowBand_Power (mW)"; + break; + case Column.YellowBand_V: + results = "YellowBand_V"; + break; + case Column.YellowBand_V_XY: + results = "YellowBand_V_XY"; + break; + case Column.YellowBand_nm: + results = "YellowBand_nm"; + break; + //case Column.pH: results = "pH"; break; + case Column.Ag: + results = "Ag"; + break; + case Column.Al: + results = "Al"; + break; + case Column.As: + results = "As"; + break; + case Column.Au: + results = "Au"; + break; + case Column.B: + results = "B"; + break; + case Column.Ba: + results = "Ba"; + break; + case Column.Ca: + results = "Ca"; + break; + case Column.Ce: + results = "Ce"; + break; + case Column.Co: + results = "Co"; + break; + case Column.Cr: + results = "Cr"; + break; + case Column.Cu: + results = "Cu"; + break; + case Column.Fe: + results = "Fe"; + break; + case Column.Ga: + results = "Ga"; + break; + case Column.Ge: + results = "Ge"; + break; + case Column.Hf: + results = "Hf"; + break; + case Column.K: + results = "K"; + break; + case Column.Li: + results = "Li"; + break; + case Column.Mg: + results = "Mg"; + break; + case Column.Mn: + results = "Mn"; + break; + case Column.Mo: + results = "Mo"; + break; + case Column.Na: + results = "Na"; + break; + case Column.Ni: + results = "Ni"; + break; + case Column.P: + results = "P"; + break; + case Column.Pb: + results = "Pb"; + break; + case Column.Sn: + results = "Sn"; + break; + case Column.Ta: + results = "Ta"; + break; + case Column.Ti: + results = "Ti"; + break; + case Column.W: + results = "W"; + break; + case Column.Y: + results = "Y"; + break; + case Column.Zn: + results = "Zn"; + break; + default: + throw new Exception(); + } + return results; + } + + public static Description.Param GetParam(this Column column) + { + Description.Param results; + switch (column) + { + //case Column._8in_Total_Warp_Verification: results = Description.Param.String; break; + //case Column.AFM_Monthly_Y: results = Description.Param.String; break; + //case Column.AFM_Monthly: results = Description.Param.String; break; + case Column.AFM_Pit_Count: + results = Description.Param.String; + break; + case Column.AFM_Roughness: + results = Description.Param.String; + break; + //case Column.Adder_Bin_1: results = Description.Param.String; break; + //case Column.Adder_Bin_2: results = Description.Param.String; break; + //case Column.Adder_Bin_3: results = Description.Param.String; break; + //case Column.Adder_Bin_4: results = Description.Param.String; break; + //case Column.Adder_Bin_5: results = Description.Param.String; break; + //case Column.Adder_Bin_6: results = Description.Param.String; break; + //case Column.Adder_Bin_9: results = Description.Param.String; break; + case Column.Al_B_B_WTAVG: + results = Description.Param.String; + break; + case Column.Al_B_B_: + results = Description.Param.String; + break; + case Column.Al_Barrier_WTAVG: + results = Description.Param.String; + break; + case Column.Al_Barrier: + results = Description.Param.String; + break; + case Column.Al_SLS_WTAVG: + results = Description.Param.String; + break; + case Column.Al_SLS: + results = Description.Param.String; + break; + case Column.Al_TL1_WTAVG: + results = Description.Param.String; + break; + case Column.Al_TL1: + results = Description.Param.String; + break; + case Column.Al_TL2_WTAVG: + results = Description.Param.String; + break; + //case Column.BV_Resistance: results = Description.Param.String; break; + case Column.BandEdge_V: + results = Description.Param.String; + break; + case Column.BandEdge_V_XY: + results = Description.Param.String; + break; + case Column.BandEdge_nm: + results = Description.Param.String; + break; + case Column.Barrier_Composition_RPM_XY: + results = Description.Param.String; + break; + case Column.Bow_Calibration: + results = Description.Param.String; + break; + case Column.Bow_Range: + results = Description.Param.String; + break; + case Column.Bow: + results = Description.Param.String; + break; + case Column.BowCenter: + results = Description.Param.String; + break; + case Column.BowX: + results = Description.Param.String; + break; + case Column.BowY: + results = Description.Param.String; + break; + case Column.Breakdown_Voltage_Edge: + results = Description.Param.String; + break; + case Column.Breakdown_VoltageMiddle: + results = Description.Param.String; + break; + case Column.Breakdown_Voltage: + results = Description.Param.String; + break; + case Column.CV_C_at_10V: + results = Description.Param.String; + break; + case Column.CV_Nd_Min: + results = Description.Param.String; + break; + //case Column.Candela_Large_LPD_Quarterly: results = Description.Param.String; break; + //case Column.Candela_Medium_LPD_Quarterly: results = Description.Param.String; break; + //case Column.Candela_Small_LPD_Quarterly: results = Description.Param.String; break; + //case Column.Candela_Total_Quarterly: results = Description.Param.String; break; + case Column.Candela_102_83nm: + results = Description.Param.String; + break; + case Column.Candela_1_1um: + results = Description.Param.String; + break; + case Column.Candela_496nm: + results = Description.Param.String; + break; + case Column.Candela_600nm: + results = Description.Param.String; + break; + case Column.Candela_8620_Small: + results = Description.Param.String; + break; + case Column.Candela_Crack_Verification: + results = Description.Param.String; + break; + case Column.Candela_Cracking: + results = Description.Param.String; + break; + case Column.Candela_Cracking_Acceptable: + results = Description.Param.String; + break; + case Column.Candela_Crater: + results = Description.Param.String; + break; + case Column.Candela_Crater_Verification: + results = Description.Param.String; + break; + case Column.Candela_Haze: + results = Description.Param.String; + break; + case Column.Candela_LPD_Large: + results = Description.Param.String; + break; + case Column.Candela_LPD_Medium: + results = Description.Param.String; + break; + case Column.Candela_LPD_Small: + results = Description.Param.String; + break; + case Column.Candela_Large_Verification: + results = Description.Param.String; + break; + case Column.Candela_Medium_Verification: + results = Description.Param.String; + break; + case Column.Candela_Pits: + results = Description.Param.String; + break; + case Column.Candela_Pits_Verification: + results = Description.Param.String; + break; + case Column.Candela_SPE: + results = Description.Param.String; + break; + case Column.Candela_SPE_Verification: + results = Description.Param.String; + break; + case Column.Candela_Slip: + results = Description.Param.String; + break; + case Column.Candela_Small_Verification: + results = Description.Param.String; + break; + case Column.Candela_Spirals: + results = Description.Param.String; + break; + case Column.Candela_Spirals_Verification: + results = Description.Param.String; + break; + case Column.Candela_Total_Defects: + results = Description.Param.String; + break; + case Column.Candela_Total_PSL: + results = Description.Param.String; + break; + case Column.Candela__1_1um: + results = Description.Param.String; + break; + //case Column.Comment: results = Description.Param.String; break; + //case Column.Conductivity: results = Description.Param.String; break; + case Column.Contact_Symmetry: + results = Description.Param.String; + break; + //case Column.Cracking_verification: results = Description.Param.String; break; + //case Column.Crater_verification: results = Description.Param.String; break; + case Column.Date: + results = Description.Param.String; + break; + case Column.Denton_Crystal_Life: + results = Description.Param.String; + break; + case Column.Denton_Current_AVG: + results = Description.Param.String; + break; + case Column.Denton_Current_STDEV: + results = Description.Param.String; + break; + case Column.Denton_Deposition_Power_AVG: + results = Description.Param.String; + break; + case Column.Denton_Deposition_Power_STDEV: + results = Description.Param.String; + break; + case Column.Denton_Deposition_Rate_AVG: + results = Description.Param.String; + break; + case Column.Denton_Deposition_Rate_STDEV: + results = Description.Param.String; + break; + case Column.Denton_Gun_Pocket: + results = Description.Param.String; + break; + case Column.Denton_Pumpdown_Time: + results = Description.Param.String; + break; + case Column.Denton_Voltage_AVG: + results = Description.Param.String; + break; + case Column.Denton_Voltage_STDEV: + results = Description.Param.String; + break; + case Column.Employee: + results = Description.Param.String; + break; + case Column.Epi_Thickness_Mean: + results = Description.Param.String; + break; + case Column.Epi_Thickness_Mean_XY: + results = Description.Param.String; + break; + case Column.Epi_Thickness_Std_Dev_: + results = Description.Param.String; + break; + case Column.FWHM_006_WTAVG: + results = Description.Param.String; + break; + case Column.FWHM_006: + results = Description.Param.String; + break; + case Column.FWHM_105_WTAVG: + results = Description.Param.String; + break; + case Column.FWHM_105: + results = Description.Param.String; + break; + case Column.Hall_Rs: + results = Description.Param.String; + break; + case Column.Hall_Mobility_verif_sample: + results = Description.Param.String; + break; + case Column.Hall_Ns_verif_sample: + results = Description.Param.String; + break; + case Column.Hall_Rs_verif_sample: + results = Description.Param.String; + break; + case Column.Job: + results = Description.Param.String; + break; + case Column.LEI_RS_Average_value: + results = Description.Param.String; + break; + case Column.LEI_RS_Maximum_value: + results = Description.Param.String; + break; + case Column.LEI_RS_Minimum_value: + results = Description.Param.String; + break; + case Column.LEI_RS_STDEV: + results = Description.Param.String; + break; + case Column.LEI_RS_STDEV_: + results = Description.Param.String; + break; + //case Column.Large_Adder_Sum: results = Description.Param.String; break; + case Column.Lot: + results = Description.Param.String; + break; + //case Column.Medium_Adder_Sum: results = Description.Param.String; break; + case Column.Microscope_Center_5x: + results = Description.Param.String; + break; + case Column.Microscope_Center_50x: + results = Description.Param.String; + break; + case Column.Microscope_Middle_5x: + results = Description.Param.String; + break; + case Column.Microscope_Middle_50x: + results = Description.Param.String; + break; + case Column.Microscope_Edge_5x: + results = Description.Param.String; + break; + case Column.Microscope_Edge_50x: + results = Description.Param.String; + break; + case Column.Mobility_Verification: + results = Description.Param.String; + break; + case Column.Mobility: + results = Description.Param.String; + break; + case Column.Ns_Verification: + results = Description.Param.String; + break; + case Column.PL_Edge_Wavelength: + results = Description.Param.String; + break; + case Column.PL_Ratio: + results = Description.Param.String; + break; + case Column.PR_Barrier_Composition: + results = Description.Param.String; + break; + case Column.PR_Peak: + results = Description.Param.String; + break; + case Column.Part: + results = Description.Param.String; + break; + //case Column.Particles_verification: results = Description.Param.String; break; + //case Column.Pits_verification: results = Description.Param.String; break; + //case Column.Pocket: results = Description.Param.String; break; + //case Column.Post_Bin_1: results = Description.Param.String; break; + //case Column.Post_Bin_2: results = Description.Param.String; break; + //case Column.Post_Bin_3: results = Description.Param.String; break; + //case Column.Post_Bin_4: results = Description.Param.String; break; + //case Column.Post_Bin_5: results = Description.Param.String; break; + //case Column.Post_Bin_6: results = Description.Param.String; break; + //case Column.Post_Bin_9: results = Description.Param.String; break; + //case Column.Pre_Bin_1: results = Description.Param.String; break; + //case Column.Pre_Bin_2: results = Description.Param.String; break; + //case Column.Pre_Bin_3: results = Description.Param.String; break; + //case Column.Pre_Bin_4: results = Description.Param.String; break; + //case Column.Pre_Bin_5: results = Description.Param.String; break; + //case Column.Pre_Bin_6: results = Description.Param.String; break; + //case Column.Pre_Bin_9: results = Description.Param.String; break; + case Column.Process: + results = Description.Param.String; + break; + //case Column.RPM_verif_Thickness_1: results = Description.Param.String; break; + //case Column.RPM_verif_Thickness_2: results = Description.Param.String; break; + //case Column.RPM_verif_Thickness_3: results = Description.Param.String; break; + //case Column.RPM_verif_Thickness_Average: results = Description.Param.String; break; + //case Column.RTA_oxide_Thk_Change: results = Description.Param.String; break; + //case Column.RTA_oxide_post_anneal_Thk: results = Description.Param.String; break; + //case Column.RTA_oxide_pre_anneal_Thk: results = Description.Param.String; break; + case Column.Recipe: + results = Description.Param.String; + break; + //case Column.Resistivity_2_ohm_cm: results = Description.Param.String; break; + //case Column.Resistivity_600_ohm_cm: results = Description.Param.String; break; + case Column.Rs_verification: + results = Description.Param.String; + break; + case Column.Rs_verif_100kohm: + results = Description.Param.String; + break; + case Column.Rs_verif_10ohm: + results = Description.Param.String; + break; + case Column.Rs_verif_1kohm: + results = Description.Param.String; + break; + case Column.SID: + results = Description.Param.String; + break; + case Column.SL_Period_WTAVG: + results = Description.Param.String; + break; + case Column.SL_Period: + results = Description.Param.String; + break; + //case Column.SPE_verification: results = Description.Param.String; break; + //case Column.Sample_ID: results = Description.Param.String; break; + case Column.Sheet_Concentration: + results = Description.Param.String; + break; + //case Column.Size: results = Description.Param.String; break; + //case Column.Small_Adder_Sum: results = Description.Param.String; break; + //case Column.Spirals_verification: results = Description.Param.String; break; + case Column.Time: + results = Description.Param.String; + break; + case Column.Tool_ID: + results = Description.Param.String; + break; + //case Column.Total_LPD_Adder: results = Description.Param.String; break; + //case Column.Total_Verification: results = Description.Param.String; break; + case Column.Total_Warp_Calibration: + results = Description.Param.String; + break; + case Column.UV_Broken: + results = Description.Param.String; + break; + case Column.UV_Chipping: + results = Description.Param.String; + break; + case Column.UV_Cracking_0_3mm_: + results = Description.Param.String; + break; + case Column.UV_Cracking_3_7mm_: + results = Description.Param.String; + break; + case Column.UV_Cracking_7mm_: + results = Description.Param.String; + break; + case Column.UV_Crazing: + results = Description.Param.String; + break; + case Column.UV_Crazing_Acceptable: + results = Description.Param.String; + break; + case Column.UV_FULL_Characterization_Wafer: + results = Description.Param.String; + break; + case Column.UV_Haze_count_: + results = Description.Param.String; + break; + case Column.UV_LIGHT_Characterization_Wafer: + results = Description.Param.String; + break; + case Column.UV_Non_rotation: + results = Description.Param.String; + break; + case Column.UV_Other: + results = Description.Param.String; + break; + case Column.UV_Scratch_count_: + results = Description.Param.String; + break; + case Column.UV_Slip_count_: + results = Description.Param.String; + break; + case Column.UV_True_Haze: + results = Description.Param.String; + break; + case Column.UV_True_Haze_Acceptable: + results = Description.Param.String; + break; + case Column.UV_SPE_1mm_count: + results = Description.Param.String; + break; + case Column.UV_SPE_count_: + results = Description.Param.String; + break; + case Column.Verification_Contact_Symmetry: + results = Description.Param.String; + break; + case Column.Vp_Pinch_Off_Voltage: + results = Description.Param.String; + break; + case Column.Wafer_ID: + results = Description.Param.String; + break; + //case Column.Wafer_Pocket: results = Description.Param.String; break; + case Column.Wafer_Region: + results = Description.Param.String; + break; + case Column.Wafer_Scribe: + results = Description.Param.String; + break; + case Column.WaferPocket_Candela: + results = Description.Param.String; + break; + case Column.WaferPocket_Warp: + results = Description.Param.String; + break; + case Column.WaferPosition_CV: + results = Description.Param.String; + break; + case Column.WaferPosition_BV: + results = Description.Param.String; + break; + case Column.WaferPosition_Hall: + results = Description.Param.String; + break; + case Column.WaferPosition_PR: + results = Description.Param.String; + break; + case Column.Warp: + results = Description.Param.String; + break; + case Column.X_Coord: + results = Description.Param.String; + break; + case Column.XRD_2_Theta_Peak_002: + results = Description.Param.String; + break; + case Column.XRD_2_Theta_Peak_101: + results = Description.Param.String; + break; + case Column.XRD_2_Theta_Position: + results = Description.Param.String; + break; + case Column.XRD_2_Theta_Position_Si_1: + results = Description.Param.String; + break; + case Column.XRD_2_Theta_Position_Si_2: + results = Description.Param.String; + break; + case Column.XRD_2_Theta_Position_Si_3: + results = Description.Param.String; + break; + case Column.XRD_Peak_002_Intensity: + results = Description.Param.String; + break; + case Column.XRD_Peak_101_Intensity: + results = Description.Param.String; + break; + case Column.XRD_Weekly_AL_Center: + results = Description.Param.String; + break; + case Column.XRD_Weekly_Back_Barrier_Al_: + results = Description.Param.String; + break; + case Column.XRD_Weekly_Barrier_Al_: + results = Description.Param.String; + break; + case Column.XRD_Weekly_FWHM_002: + results = Description.Param.String; + break; + case Column.XRD_Weekly_FWHM_101: + results = Description.Param.String; + break; + case Column.XRD_Weekly_FWHM_105: + results = Description.Param.String; + break; + case Column.XRD_Weekly_Fringe_thick_0_0_: + results = Description.Param.String; + break; + case Column.XRD_Weekly_Fringe_thick_48_48_: + results = Description.Param.String; + break; + case Column.XRD_Weekly_Intensity: + results = Description.Param.String; + break; + case Column.XRD_Weekly_Super_Lattice_Al_: + results = Description.Param.String; + break; + case Column.XRD_Weekly_Super_Lattice_period: + results = Description.Param.String; + break; + case Column.XRD_Weekly_Super_Lattice_tks: + results = Description.Param.String; + break; + case Column.XRR_Thickness_nm_WTAVG: + results = Description.Param.String; + break; + case Column.XRR_Thickness_nm_: + results = Description.Param.String; + break; + case Column.Y_Coord: + results = Description.Param.String; + break; + case Column.YellowBand_Power_mW_: + results = Description.Param.String; + break; + case Column.YellowBand_V: + results = Description.Param.String; + break; + case Column.YellowBand_V_XY: + results = Description.Param.String; + break; + case Column.YellowBand_nm: + results = Description.Param.String; + break; + //case Column.pH: results = Description.Param.String; break; + case Column.Ag: + results = Description.Param.String; + break; + case Column.Al: + results = Description.Param.String; + break; + case Column.As: + results = Description.Param.String; + break; + case Column.Au: + results = Description.Param.String; + break; + case Column.B: + results = Description.Param.String; + break; + case Column.Ba: + results = Description.Param.String; + break; + case Column.Ca: + results = Description.Param.String; + break; + case Column.Ce: + results = Description.Param.String; + break; + case Column.Co: + results = Description.Param.String; + break; + case Column.Cr: + results = Description.Param.String; + break; + case Column.Cu: + results = Description.Param.String; + break; + case Column.Fe: + results = Description.Param.String; + break; + case Column.Ga: + results = Description.Param.String; + break; + case Column.Ge: + results = Description.Param.String; + break; + case Column.Hf: + results = Description.Param.String; + break; + case Column.K: + results = Description.Param.String; + break; + case Column.Li: + results = Description.Param.String; + break; + case Column.Mg: + results = Description.Param.String; + break; + case Column.Mn: + results = Description.Param.String; + break; + case Column.Mo: + results = Description.Param.String; + break; + case Column.Na: + results = Description.Param.String; + break; + case Column.Ni: + results = Description.Param.String; + break; + case Column.P: + results = Description.Param.String; + break; + case Column.Pb: + results = Description.Param.String; + break; + case Column.Sn: + results = Description.Param.String; + break; + case Column.Ta: + results = Description.Param.String; + break; + case Column.Ti: + results = Description.Param.String; + break; + case Column.W: + results = Description.Param.String; + break; + case Column.Y: + results = Description.Param.String; + break; + case Column.Zn: + results = Description.Param.String; + break; + default: + throw new Exception(); + } + return results; + } + + } + + public enum Column + { + //_8in_Total_Warp_Verification, + //AFM_Monthly_Y, + //AFM_Monthly, + AFM_Pit_Count, + AFM_Roughness, + //Adder_Bin_1, + //Adder_Bin_2, + //Adder_Bin_3, + //Adder_Bin_4, + //Adder_Bin_5, + //Adder_Bin_6, + //Adder_Bin_9, + Al_B_B_WTAVG, + Al_B_B_, + Al_Barrier_WTAVG, + Al_Barrier, + Al_SLS_WTAVG, + Al_SLS, + Al_TL1_WTAVG, + Al_TL1, + Al_TL2_WTAVG, + //BV_Resistance, + BandEdge_V, + BandEdge_V_XY, + BandEdge_nm, + Barrier_Composition_RPM_XY, + Bow_Calibration, + Bow_Range, + Bow, + BowCenter, + BowX, + BowY, + Breakdown_Voltage_Edge, + Breakdown_VoltageMiddle, + Breakdown_Voltage, + CV_C_at_10V, + CV_Nd_Min, + //Candela_Large_LPD_Quarterly, + //Candela_Medium_LPD_Quarterly, + //Candela_Small_LPD_Quarterly, + //Candela_Total_Quarterly, + Candela_102_83nm, + Candela_1_1um, + Candela_496nm, + Candela_600nm, + Candela_8620_Small, + Candela_Crack_Verification, + Candela_Cracking, + Candela_Cracking_Acceptable, + Candela_Crater, + Candela_Crater_Verification, + Candela_Haze, + Candela_LPD_Large, + Candela_LPD_Medium, + Candela_LPD_Small, + Candela_Large_Verification, + Candela_Medium_Verification, + Candela_Pits, + Candela_Pits_Verification, + Candela_SPE, + Candela_SPE_Verification, + Candela_Slip, + Candela_Small_Verification, + Candela_Spirals, + Candela_Spirals_Verification, + Candela_Total_Defects, + Candela_Total_PSL, + Candela__1_1um, + //Comment, + //Conductivity, + Contact_Symmetry, + //Cracking_verification, + //Crater_verification, + Date, + Denton_Crystal_Life, + Denton_Current_AVG, + Denton_Current_STDEV, + Denton_Deposition_Power_AVG, + Denton_Deposition_Power_STDEV, + Denton_Deposition_Rate_AVG, + Denton_Deposition_Rate_STDEV, + Denton_Gun_Pocket, + Denton_Pumpdown_Time, + Denton_Voltage_AVG, + Denton_Voltage_STDEV, + Employee, + Epi_Thickness_Mean, + Epi_Thickness_Mean_XY, + Epi_Thickness_Std_Dev_, + FWHM_006_WTAVG, + FWHM_006, + FWHM_105_WTAVG, + FWHM_105, + Hall_Rs, + Hall_Mobility_verif_sample, + Hall_Ns_verif_sample, + Hall_Rs_verif_sample, + Job, + LEI_RS_Average_value, + LEI_RS_Maximum_value, + LEI_RS_Minimum_value, + LEI_RS_STDEV, + LEI_RS_STDEV_, + //Large_Adder_Sum, + Lot, + //Medium_Adder_Sum, + Microscope_Center_50x, + Microscope_Center_5x, + Microscope_Edge_50x, + Microscope_Edge_5x, + Microscope_Middle_50x, + Microscope_Middle_5x, + Mobility_Verification, + Mobility, + Ns_Verification, + PL_Edge_Wavelength, + PL_Ratio, + PR_Barrier_Composition, + PR_Peak, + Part, + //Particles_verification, + //Pits_verification, + //Pocket, + //Post_Bin_1, + //Post_Bin_2, + //Post_Bin_3, + //Post_Bin_4, + //Post_Bin_5, + //Post_Bin_6, + //Post_Bin_9, + //Pre_Bin_1, + //Pre_Bin_2, + //Pre_Bin_3, + //Pre_Bin_4, + //Pre_Bin_5, + //Pre_Bin_6, + //Pre_Bin_9, + Process, + //RPM_verif_Thickness_1, + //RPM_verif_Thickness_2, + //RPM_verif_Thickness_3, + //RPM_verif_Thickness_Average, + //RTA_oxide_Thk_Change, + //RTA_oxide_post_anneal_Thk, + //RTA_oxide_pre_anneal_Thk, + Recipe, + //Resistivity_2_ohm_cm, + //Resistivity_600_ohm_cm, + Rs_verification, + Rs_verif_100kohm, + Rs_verif_10ohm, + Rs_verif_1kohm, + SID, + SL_Period_WTAVG, + SL_Period, + //SPE_verification, + //Sample_ID, + Sheet_Concentration, + //Size, + //Small_Adder_Sum, + //Spirals_verification, + Time, + Tool_ID, + //Total_LPD_Adder, + //Total_Verification, + Total_Warp_Calibration, + UV_Broken, + UV_Chipping, + UV_Cracking_0_3mm_, + UV_Cracking_3_7mm_, + UV_Cracking_7mm_, + UV_Crazing, + UV_Crazing_Acceptable, + UV_FULL_Characterization_Wafer, + UV_Haze_count_, + UV_LIGHT_Characterization_Wafer, + UV_Non_rotation, + UV_Other, + UV_Scratch_count_, + UV_Slip_count_, + UV_True_Haze, + UV_True_Haze_Acceptable, + UV_SPE_1mm_count, + UV_SPE_count_, + Verification_Contact_Symmetry, + Vp_Pinch_Off_Voltage, + Wafer_ID, + //Wafer_Pocket, + Wafer_Region, + Wafer_Scribe, + WaferPocket_Candela, + WaferPocket_Warp, + WaferPosition_CV, + WaferPosition_BV, + WaferPosition_Hall, + WaferPosition_PR, + Warp, + X_Coord, + XRD_2_Theta_Peak_002, + XRD_2_Theta_Peak_101, + XRD_2_Theta_Position, + XRD_2_Theta_Position_Si_1, + XRD_2_Theta_Position_Si_2, + XRD_2_Theta_Position_Si_3, + XRD_Peak_002_Intensity, + XRD_Peak_101_Intensity, + XRD_Weekly_AL_Center, + XRD_Weekly_Back_Barrier_Al_, + XRD_Weekly_Barrier_Al_, + XRD_Weekly_FWHM_002, + XRD_Weekly_FWHM_101, + XRD_Weekly_FWHM_105, + XRD_Weekly_Fringe_thick_0_0_, + XRD_Weekly_Fringe_thick_48_48_, + XRD_Weekly_Intensity, + XRD_Weekly_Super_Lattice_Al_, + XRD_Weekly_Super_Lattice_period, + XRD_Weekly_Super_Lattice_tks, + XRR_Thickness_nm_, + XRR_Thickness_nm_WTAVG, + Y_Coord, + YellowBand_Power_mW_, + YellowBand_V, + YellowBand_V_XY, + YellowBand_nm, + //pH, + Ag, + Al, + As, + Au, + B, + Ba, + Ca, + Ce, + Co, + Cr, + Cu, + Fe, + Ga, + Ge, + Hf, + K, + Li, + Mg, + Mn, + Mo, + Na, + Ni, + P, + Pb, + Sn, + Ta, + Ti, + W, + Y, + Zn + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/ConfigDataBase.cs b/APC Viewer/Shared/Metrology/ConfigDataBase.cs new file mode 100644 index 0000000..69c2401 --- /dev/null +++ b/APC Viewer/Shared/Metrology/ConfigDataBase.cs @@ -0,0 +1,410 @@ +using Library.Ifx.Eaf.EquipmentConnector.File.Configuration; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Shared.Metrology +{ + + public class ConfigDataBase + { + + public bool UseCyclicalForDescription { get; protected set; } + public Dictionary CellNames { get; protected set; } + public Dictionary MesEntities { get; protected set; } + public IProcessDataDescription ProcessDataDescription { get; protected set; } + + public bool IsEvent { get; private set; } + public EventName EventName => _EventName; + public bool EafHosted { get; private set; } + public string CellName { get; private set; } + public bool IsSourceTimer { get; private set; } + public EquipmentType EquipmentType => _EquipmentType; + public string EquipmentElementName { get; private set; } + public bool IsDatabaseExportToIPDSF { get; private set; } + public EquipmentType? EquipmentConnection => _EquipmentConnection; + public FileConnectorConfiguration FileConnectorConfiguration { get; private set; } + + protected readonly EventName _EventName; + protected readonly EquipmentType _EquipmentType; + protected readonly EquipmentType? _EquipmentConnection; + protected readonly Dictionary _Reactors; + + public ConfigDataBase(string cellName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, bool isEAFHosted) + { + CellName = cellName; + EafHosted = isEAFHosted; + EquipmentType equipmentTypeValue; + _Reactors = new Dictionary(); + CellNames = new Dictionary(); + MesEntities = new Dictionary(); + EquipmentElementName = cellInstanceConnectionName; + FileConnectorConfiguration = fileConnectorConfiguration; + string[] segments = parameterizedModelObjectDefinitionType.Split('.'); + IsSourceTimer = (fileConnectorConfiguration.SourceFileFilter.StartsWith("*Timer.txt")); + string cellInstanceConnectionNameBase = cellInstanceConnectionName.Replace("-", string.Empty); + IsDatabaseExportToIPDSF = (fileConnectorConfiguration.SourceFileLocation.Contains("DatabaseExport")); + if (!Enum.TryParse(segments[segments.Length - 1], out EventName eventNameValue)) + throw new Exception(cellInstanceConnectionName); + if (!Enum.TryParse(cellInstanceConnectionNameBase, out equipmentTypeValue)) + _EquipmentConnection = null; + else + _EquipmentConnection = equipmentTypeValue; + string suffix; + switch (eventNameValue) + { + case EventName.FileRead: + suffix = string.Empty; + break; + case EventName.FileReadDaily: + suffix = "_Daily"; + break; + case EventName.FileReadWeekly: + suffix = "_Weekly"; + break; + case EventName.FileReadMonthly: + suffix = "_Monthly"; + break; + case EventName.FileReadVerification: + suffix = "_Verification"; + break; + default: + throw new Exception(cellInstanceConnectionName); + } + string parameterizedModelObjectDefinitionTypeAppended = string.Concat(segments[0], suffix); + IsEvent = cellInstanceConnectionNameBase != parameterizedModelObjectDefinitionTypeAppended; + _EventName = eventNameValue; + if (!Enum.TryParse(parameterizedModelObjectDefinitionTypeAppended, out equipmentTypeValue)) + throw new Exception(cellInstanceConnectionName); + _EquipmentType = equipmentTypeValue; + if (!isEAFHosted && equipmentTypeName != parameterizedModelObjectDefinitionTypeAppended) + throw new Exception(cellInstanceConnectionName); + } + + public string GetEventName() + { + string result = EventName.ToString(); + return result; + } + + public string GetEquipmentType() + { + string result = EquipmentConnection.ToString(); + return result; + } + + public string GetEventDescription() + { + string result = ProcessDataDescription.GetEventDescription(); + return result; + } + + public IProcessDataDescription GetDefault(ILogic logic) + { + IProcessDataDescription result = ProcessDataDescription.GetDefault(logic, this); + return result; + } + + public IProcessDataDescription GetDisplayNames(ILogic logic) + { + IProcessDataDescription result = ProcessDataDescription.GetDisplayNames(logic, this); + return result; + } + + public List GetDetailNames(ILogic logic) + { + List results = ProcessDataDescription.GetDetailNames(logic, this); + return results; + } + + public List GetHeaderNames(ILogic logic) + { + List results = ProcessDataDescription.GetHeaderNames(logic, this); + return results; + } + + public List GetNames(ILogic logic) + { + List results = ProcessDataDescription.GetNames(logic, this); + return results; + } + + public List GetPairedParameterNames(ILogic logic) + { + List results = ProcessDataDescription.GetPairedParameterNames(logic, this); + return results; + } + + public List GetParameterNames(ILogic logic) + { + List results = ProcessDataDescription.GetParameterNames(logic, this); + return results; + } + + public List GetDescription(ILogic logic, List tests, IProcessData iProcessData) + { + List results = ProcessDataDescription.GetDescription(logic, this, tests, iProcessData); + return results; + } + + public string GetCurrentReactor(ILogic logic) + { + string result = string.Empty; + foreach (KeyValuePair keyValuePair in _Reactors) + { + foreach (string filePrefix in keyValuePair.Value.Split('|')) + { + if (logic.Logistics.MID.StartsWith(filePrefix) || (EventName != EventName.FileRead && MesEntities.ContainsKey(logic.Logistics.JobID) && keyValuePair.Value == MesEntities[logic.Logistics.JobID])) + { + result = keyValuePair.Key; + break; + } + } + } + if (string.IsNullOrEmpty(result) && _Reactors.Count == 1) + result = _Reactors.ElementAt(0).Key; + return result; + } + + protected JsonElement GetDefaultJsonElement(ILogic logic) + { + JsonElement result; + IProcessDataDescription processDataDescription = ProcessDataDescription.GetDefault(logic, this); + string json = JsonSerializer.Serialize(processDataDescription, processDataDescription.GetType()); + object @object = JsonSerializer.Deserialize(json); + result = (JsonElement)@object; + return result; + } + + public Dictionary>> GetParameterInfo(ILogic logic, bool allowNull) + { + Dictionary>> results = new Dictionary>>(); + string description; + Enum param; + Tuple tuple; + JsonElement defaultJsonElement = GetDefaultJsonElement(logic); + Dictionary keyValuePairs = GetDisplayNamesJsonElement(logic); + foreach (JsonProperty jsonProperty in defaultJsonElement.EnumerateObject()) + { + if (jsonProperty.Value.ValueKind == JsonValueKind.Null && !allowNull) + throw new Exception(); + if (jsonProperty.Value.ValueKind == JsonValueKind.Object || jsonProperty.Value.ValueKind == JsonValueKind.Array) + { + description = string.Empty; + param = Description.Param.StructuredType; + //jValue = jObject.Value("Item1"); + throw new NotImplementedException("Item1"); + } + else + { + switch (jsonProperty.Value.ValueKind) + { + case JsonValueKind.String: + param = Description.Param.String; + break; + case JsonValueKind.Number: + param = Description.Param.Double; + break; + case JsonValueKind.True: + case JsonValueKind.False: + param = Description.Param.Boolean; + break; + case JsonValueKind.Null: + param = Description.Param.String; + break; + default: + param = Description.Param.StructuredType; + break; + } + } + if (!keyValuePairs.ContainsKey(jsonProperty.Name)) + description = string.Empty; + else + description = keyValuePairs[jsonProperty.Name]; + tuple = new Tuple(param, jsonProperty.Name, description, jsonProperty.Value.ToString()); + if (!results.ContainsKey(jsonProperty.Name)) + results.Add(jsonProperty.Name, new List>()); + results[jsonProperty.Name].Add(tuple); + } + return results; + } + + protected void WriteExportAliases(ILogic logic, string cellName, string equipmentElementName) + { + int i = 0; + Enum param; + object value; + Enum[] @params; + string description; + StringBuilder stringBuilder = new StringBuilder(); + string shareRoot = @"\\messv02ecc1.ec.local\EC_EDA"; + string shareDirectory = string.Concat(shareRoot, @"\Staging\Pdsf\", cellName, @"\ExportAliases\", equipmentElementName); + Dictionary>> keyValuePairs; + if (!(logic is null)) + keyValuePairs = GetParameterInfo(logic, allowNull: false); + else + keyValuePairs = new Dictionary>>(); + stringBuilder.AppendLine("\"AliasName\";\"Condition\";\"EventId\";\"ExceptionId\";\"Formula\";\"HardwareId\";\"OrderId\";\"ParameterName\";\"Remark\";\"ReportName\";\"SourceId\";\"Use\""); + if (!Directory.Exists(shareRoot)) + return; + if (!Directory.Exists(shareDirectory)) + Directory.CreateDirectory(shareDirectory); + string shareFile = string.Concat(shareDirectory, @"\", DateTime.Now.Ticks, ".csv"); + foreach (KeyValuePair>> keyValuePair in keyValuePairs) + { + i += 1; + @params = (from l in keyValuePair.Value select l.Item1).Distinct().ToArray(); + if (@params.Length != 1) + throw new Exception(); + if (keyValuePair.Value[0].Item2 != keyValuePair.Key) + throw new Exception(); + param = @params[0]; + if (!(param is Description.Param.String)) + stringBuilder.AppendLine($"\"{keyValuePair.Key}\";\"\";\"\";\"\";\"\";\"\";\"{i}\";\"{cellName}/{EquipmentElementName}/{keyValuePair.Key}\";\"\";\"{cellName}/{EquipmentElementName}/{EventName}\";\"\";\"True\""); + else + { + description = keyValuePair.Value[0].Item3.Split('|')[0]; + if (string.IsNullOrEmpty(description)) + continue; + value = keyValuePair.Value[0].Item4; + stringBuilder.AppendLine($"\"'{description}'\";\"\";\"\";\"\";\"\";\"\";\"{i}\";\"{cellName}/{EquipmentElementName}/{value}\";\"\";\"{cellName}/{EquipmentElementName}/{EventName}\";\"\";\"True\""); + } + } + if (keyValuePairs.Any()) + File.WriteAllText(shareFile, stringBuilder.ToString()); + } + + public Dictionary GetDisplayNamesJsonElement(ILogic logic) + { + Dictionary results = new Dictionary(); + IProcessDataDescription processDataDescription = ProcessDataDescription.GetDisplayNames(logic, this); + string json = JsonSerializer.Serialize(processDataDescription, processDataDescription.GetType()); + JsonElement jsonElement = JsonSerializer.Deserialize(json); + foreach (JsonProperty jsonProperty in jsonElement.EnumerateObject()) + { + if (!results.ContainsKey(jsonProperty.Name)) + results.Add(jsonProperty.Name, string.Empty); + if (jsonProperty.Value is JsonElement jsonPropertyValue) + results[jsonProperty.Name] = jsonPropertyValue.ToString(); + } + return results; + } + + public List GetIgnoreParameterNames(ILogic logic, Test test, bool includePairedParameterNames) + { + List results = ProcessDataDescription.GetIgnoreParameterNames(logic, this, test); + if (includePairedParameterNames) + { + string value; + List pairedParameterNames = ProcessDataDescription.GetPairedParameterNames(logic, this); + IProcessDataDescription processDataDescription = ProcessDataDescription.GetDisplayNames(logic, this); + string json = JsonSerializer.Serialize(processDataDescription, processDataDescription.GetType()); + object @object = JsonSerializer.Deserialize(json); + if (!(@object is JsonElement jsonElement)) + throw new Exception(); + foreach (JsonProperty jsonProperty in jsonElement.EnumerateObject()) + { + if (jsonProperty.Value.ValueKind == JsonValueKind.Object || jsonProperty.Value.ValueKind == JsonValueKind.Array) + throw new Exception(); + value = jsonProperty.Value.ToString(); + if (!results.Contains(jsonProperty.Name) && pairedParameterNames.Contains(jsonProperty.Name) && (string.IsNullOrEmpty(value) || value[0] == '|')) + results.Add(jsonProperty.Name); + } + } + return results; + } + + public List GetProcessDataDescriptions(JsonElement jsonElement) + { + List results; + if (jsonElement.ValueKind != JsonValueKind.Array) + throw new Exception(); + JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions { NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString }; + results = JsonSerializer.Deserialize>(jsonElement.ToString(), jsonSerializerOptions); + return results; + } + + public Dictionary> GetKeyValuePairs(List processDataDescriptions) + { + Dictionary> results = new Dictionary>(); + Test testKey; + for (int i = 0; i < processDataDescriptions.Count; i++) + { + testKey = (Test)processDataDescriptions[i].Test; + if (!results.ContainsKey(testKey)) + results.Add(testKey, new List()); + results[testKey].Add(processDataDescriptions[i]); + } + return results; + } + + public Dictionary> GetKeyValuePairs(JsonElement jsonElement, List processDataDescriptions, Test test) + { + Dictionary> results = new Dictionary>(); + Test testKey; + if (jsonElement.ValueKind != JsonValueKind.Array) + throw new Exception(); + JsonElement[] jsonElements = jsonElement.EnumerateArray().ToArray(); + if (processDataDescriptions.Count != jsonElements.Length) + throw new Exception(); + for (int i = 0; i < processDataDescriptions.Count; i++) + { + testKey = (Test)processDataDescriptions[i].Test; + if (testKey != test) + continue; + foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject()) + { + if (jsonProperty.Value.ValueKind == JsonValueKind.Object || jsonProperty.Value.ValueKind == JsonValueKind.Array) + throw new Exception(); + if (!results.ContainsKey(jsonProperty.Name)) + results.Add(jsonProperty.Name, new List()); + results[jsonProperty.Name].Add(jsonProperty.Value.ToString()); + } + } + return results; + } + + protected void VerifyProcessDataDescription(ILogic logic) + { + string description; + bool allowNull = false; + JsonElement defaultJsonElement = GetDefaultJsonElement(logic); + Dictionary keyValuePairs = GetDisplayNamesJsonElement(logic); + JsonProperty[] jsonProperties = defaultJsonElement.EnumerateObject().ToArray(); + foreach (JsonProperty jsonProperty in jsonProperties) + { + if (jsonProperty.Value.ValueKind == JsonValueKind.Null && !allowNull) + throw new Exception(); + if (!(jsonProperty.Value.ValueKind is JsonValueKind.String) || !keyValuePairs.ContainsKey(jsonProperty.Name)) + description = string.Empty; + else + description = keyValuePairs[jsonProperty.Name].Split('|')[0]; + } + } + + public List GetIProcessDataDescriptions(JsonElement jsonElement) + { + List results = new List(); + if (jsonElement.ValueKind != JsonValueKind.Array) + throw new Exception(); + object @object; + Type type = ProcessDataDescription.GetType(); + JsonElement[] jsonElements = jsonElement.EnumerateArray().ToArray(); + JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions { NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString }; + for (int i = 0; i < jsonElements.Length; i++) + { + @object = JsonSerializer.Deserialize(jsonElements[i].ToString(), type, jsonSerializerOptions); + if (!(@object is IProcessDataDescription processDataDescription)) + continue; + results.Add(processDataDescription); + } + return results; + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/EventName.cs b/APC Viewer/Shared/Metrology/EventName.cs new file mode 100644 index 0000000..8c35605 --- /dev/null +++ b/APC Viewer/Shared/Metrology/EventName.cs @@ -0,0 +1,13 @@ +namespace Shared.Metrology +{ + + public enum EventName + { + FileRead, + FileReadDaily, + FileReadMonthly, + FileReadVerification, + FileReadWeekly + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/ILogic.cs b/APC Viewer/Shared/Metrology/ILogic.cs new file mode 100644 index 0000000..445a92c --- /dev/null +++ b/APC Viewer/Shared/Metrology/ILogic.cs @@ -0,0 +1,48 @@ +using Library.Eaf.EquipmentCore.Control; +using Library.Eaf.Management.ConfigurationData.CellAutomation; +using Library.Ifx.Eaf.EquipmentConnector.File.Configuration; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; + +namespace Shared.Metrology +{ + + public interface ILogic + { + + ILogic ShallowCopy(); + Logistics Logistics { get; } + + void ConfigurationRestore(); + void CreateSelfDescription(); + void CreateSelfDescription(IEquipmentControl equipment, string cellInstanceName, string cellInstanceConnectionName, FileConnectorConfiguration configuration, IList modelObjectParameterDefinitions, EquipmentType? equipmentType, EventName? eventName); + bool Extract(string reportFullPath, string eventName); + string GetConfigurationErrorTargetFileLocation(); + string GetConfigurationSourceFileLocation(); + string GetConfigurationTarget2FileLocation(); + string GetConfigurationTargetFileLocation(); + string GetConfigurationTargetFileName(); + Tuple> GetExtractResult(string reportFullPath, string eventName); + object GetFilePathGeneratorInfo(string reportFullPath, bool isErrorFile); + string GetReportFullPath(Dictionary keyValuePairs); + string GetTarget2FileLocation(); + void Move(string reportFullPath, Tuple> extractResults, Exception exception = null); + string ReExtract(string searchDirectory, string sourceFileFilter); + void ReflectionCreateSelfDescription(string equipmentElementName, int? input, string cellName, string debugConfig, string[] strings, bool[] booleans, long[] numbers, string[] enums); + ConfigDataBase ReflectionCreateSelfDescriptionV2(string json); + string ResolveErrorTargetPlaceHolders(string reportFullPath, bool createDirectory = true, string fileFoundPath = ""); + string ResolveSourcePlaceHolders(string reportFullPath, bool createDirectory = true); + string ResolveTarget2PlaceHolders(string reportFullPath, bool createDirectory = true, string fileFoundPath = ""); + string ResolveTargetPlaceHolders(string reportFullPath, bool createDirectory = true, string fileFoundPath = ""); + void SetFileParameter(string key, string value); + void SetFileParameterLotID(string value, bool includeLogisticsSequence = false); + void SetFileParameterLotIDToLogisticsMID(bool includeLogisticsSequence = true); + void SetFileParameterSystemDateTimeToLogisticsSequence(); + void SetPlaceHolder(string reportFullPath, string key, string value); + void SetTarget2FileLocation(string value); + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08AFMD3100.cs b/APC Viewer/Shared/Metrology/MET08AFMD3100.cs new file mode 100644 index 0000000..894f4dc --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08AFMD3100.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08AFMD3100 + { + + public enum Test + { + AFMRoughness = Metrology.Test.AFMRoughness + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08BVHGPROBE.cs b/APC Viewer/Shared/Metrology/MET08BVHGPROBE.cs new file mode 100644 index 0000000..c2c58d6 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08BVHGPROBE.cs @@ -0,0 +1,16 @@ +namespace Shared.Metrology +{ + + public class MET08BVHGPROBE + { + + public enum Test + { + BreakdownVoltageCenter = Metrology.Test.BreakdownVoltageCenter, + BreakdownVoltageEdge = Metrology.Test.BreakdownVoltageEdge, + BreakdownVoltageMiddle8in = Metrology.Test.BreakdownVoltageMiddle8in + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08CVHGPROBE802B150.cs b/APC Viewer/Shared/Metrology/MET08CVHGPROBE802B150.cs new file mode 100644 index 0000000..1f1f923 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08CVHGPROBE802B150.cs @@ -0,0 +1,16 @@ +namespace Shared.Metrology +{ + + public class MET08CVHGPROBE802B150 + { + + public enum Test + { + CV = Metrology.Test.CV, + MonthlyCV = Metrology.Test.MonthlyCV, + WeeklyCV = Metrology.Test.WeeklyCV + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08DDINCAN8620.cs b/APC Viewer/Shared/Metrology/MET08DDINCAN8620.cs new file mode 100644 index 0000000..d08382c --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08DDINCAN8620.cs @@ -0,0 +1,18 @@ +namespace Shared.Metrology +{ + + public class MET08DDINCAN8620 + { + + public enum Test + { + CandelaKlarfDC = Metrology.Test.CandelaKlarfDC, + CandelaLaser = Metrology.Test.CandelaLaser, + CandelaVerify = Metrology.Test.CandelaVerify, + CandelaPSL = Metrology.Test.CandelaPSL, + CandelaProdU = Metrology.Test.CandelaProdU + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08DDUPSFS6420.cs b/APC Viewer/Shared/Metrology/MET08DDUPSFS6420.cs new file mode 100644 index 0000000..cbc2e74 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08DDUPSFS6420.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08DDUPSFS6420 + { + + public enum Test + { + Tencor = Metrology.Test.Tencor + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08DDUPSP1TBI.cs b/APC Viewer/Shared/Metrology/MET08DDUPSP1TBI.cs new file mode 100644 index 0000000..f60c7d1 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08DDUPSP1TBI.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08DDUPSP1TBI + { + + public enum Test + { + SP1 = Metrology.Test.SP1 + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08EBEAMINTEGRITY26.cs b/APC Viewer/Shared/Metrology/MET08EBEAMINTEGRITY26.cs new file mode 100644 index 0000000..ba016ca --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08EBEAMINTEGRITY26.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08EBEAMINTEGRITY26 + { + + public enum Test + { + Denton = Metrology.Test.Denton + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08HALLHL5580.cs b/APC Viewer/Shared/Metrology/MET08HALLHL5580.cs new file mode 100644 index 0000000..cc3231f --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08HALLHL5580.cs @@ -0,0 +1,16 @@ +namespace Shared.Metrology +{ + + public class MET08HALLHL5580 + { + + public enum Test + { + Hall = Metrology.Test.Hall, + MonthlyHall = Metrology.Test.MonthlyHall, + WeeklyHall = Metrology.Test.WeeklyHall + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08MESMICROSCOPE.cs b/APC Viewer/Shared/Metrology/MET08MESMICROSCOPE.cs new file mode 100644 index 0000000..125c248 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08MESMICROSCOPE.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08MESMICROSCOPE + { + + public enum Test + { + Microscope = Metrology.Test.Microscope + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08NDFRESIMAP151C.cs b/APC Viewer/Shared/Metrology/MET08NDFRESIMAP151C.cs new file mode 100644 index 0000000..6f0bc5a --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08NDFRESIMAP151C.cs @@ -0,0 +1,15 @@ +namespace Shared.Metrology +{ + + public class MET08NDFRESIMAP151C + { + + public enum Test + { + Lehighton = Metrology.Test.Lehighton, + VerificationLehighton = Metrology.Test.VerificationLehighton + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08PLMAPRPM.cs b/APC Viewer/Shared/Metrology/MET08PLMAPRPM.cs new file mode 100644 index 0000000..4c1cdb8 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08PLMAPRPM.cs @@ -0,0 +1,20 @@ +namespace Shared.Metrology +{ + + public class MET08PLMAPRPM + { + + public enum Test + { + RPMXY = Metrology.Test.RPMXY, + RPMAverage = Metrology.Test.RPMAverage, + RPMPLRatio = Metrology.Test.RPMPLRatio, + DailyRPMXY = Metrology.Test.DailyRPMXY, + DailyRPMAverage = Metrology.Test.DailyRPMAverage, + DailyRPMPLRatio = Metrology.Test.DailyRPMPLRatio, + VerificationRPM = Metrology.Test.VerificationRPM + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08PRFUSB4000.cs b/APC Viewer/Shared/Metrology/MET08PRFUSB4000.cs new file mode 100644 index 0000000..502f524 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08PRFUSB4000.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08PRFUSB4000 + { + + public enum Test + { + Photoreflectance = Metrology.Test.Photoreflectance + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08RESIHGCV.cs b/APC Viewer/Shared/Metrology/MET08RESIHGCV.cs new file mode 100644 index 0000000..1146728 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08RESIHGCV.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08RESIHGCV + { + + public enum Test + { + HgCV = Metrology.Test.HgCV + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08RESIMAPCDE.cs b/APC Viewer/Shared/Metrology/MET08RESIMAPCDE.cs new file mode 100644 index 0000000..61dbeda --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08RESIMAPCDE.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08RESIMAPCDE + { + + public enum Test + { + CDE = Metrology.Test.CDE + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08THFTIRQS408M.cs b/APC Viewer/Shared/Metrology/MET08THFTIRQS408M.cs new file mode 100644 index 0000000..b122e73 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08THFTIRQS408M.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08THFTIRQS408M + { + + public enum Test + { + BioRadQS408M = Metrology.Test.BioRadQS408M + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08THFTIRSTRATUS.cs b/APC Viewer/Shared/Metrology/MET08THFTIRSTRATUS.cs new file mode 100644 index 0000000..64687ed --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08THFTIRSTRATUS.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08THFTIRSTRATUS + { + + public enum Test + { + BioRadStratus = Metrology.Test.BioRadStratus + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08UVH44GS100M.cs b/APC Viewer/Shared/Metrology/MET08UVH44GS100M.cs new file mode 100644 index 0000000..ce10493 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08UVH44GS100M.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08UVH44GS100M + { + + public enum Test + { + UV = Metrology.Test.UV + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08VPDSUBCON.cs b/APC Viewer/Shared/Metrology/MET08VPDSUBCON.cs new file mode 100644 index 0000000..3bcd0d6 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08VPDSUBCON.cs @@ -0,0 +1,14 @@ +namespace Shared.Metrology +{ + + public class MET08VPDSUBCON + { + + public enum Test + { + VpdIcpmsAnalyte = Metrology.Test.VpdIcpmsAnalyte + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08WGEOMX203641Q.cs b/APC Viewer/Shared/Metrology/MET08WGEOMX203641Q.cs new file mode 100644 index 0000000..c85b973 --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08WGEOMX203641Q.cs @@ -0,0 +1,15 @@ +namespace Shared.Metrology +{ + + public class MET08WGEOMX203641Q + { + + public enum Test + { + WarpAndBow = Metrology.Test.WarpAndBow, + VerificationWarpAndBow = Metrology.Test.VerificationWarpAndBow + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/MET08XRDXPERTPROMRDXL.cs b/APC Viewer/Shared/Metrology/MET08XRDXPERTPROMRDXL.cs new file mode 100644 index 0000000..b3a8def --- /dev/null +++ b/APC Viewer/Shared/Metrology/MET08XRDXPERTPROMRDXL.cs @@ -0,0 +1,23 @@ +namespace Shared.Metrology +{ + + public class MET08XRDXPERTPROMRDXL + { + + public enum Test + { + XRDXY = Metrology.Test.XRDXY, + XRDWeightedAverage = Metrology.Test.XRDWeightedAverage, + MonthlyXRD = Metrology.Test.MonthlyXRD, + WeeklyXRD = Metrology.Test.WeeklyXRD, + WeeklyXRDAIcomp = Metrology.Test.WeeklyXRDAIcomp, + WeeklyXRDFWHM002 = Metrology.Test.WeeklyXRDFWHM002, + WeeklyXRDFWHM105 = Metrology.Test.WeeklyXRDFWHM105, + WeeklyXRDSLStks = Metrology.Test.WeeklyXRDSLStks, + WeeklyXRDXRR = Metrology.Test.WeeklyXRDXRR, + JVXRD = Metrology.Test.JVXRD + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/ProcessData.Duplicator.cs b/APC Viewer/Shared/Metrology/ProcessData.Duplicator.cs new file mode 100644 index 0000000..8d18507 --- /dev/null +++ b/APC Viewer/Shared/Metrology/ProcessData.Duplicator.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; + +namespace Shared.Metrology +{ + + public class Duplicator + { + + public class Description : IProcessDataDescription + { + + public int Test { get; set; } + public int Count { get; set; } + public int Index { get; set; } + // + public string EventName { get; set; } + public string NullData { get; set; } + public string JobID { get; set; } + public string Sequence { get; set; } + public string MesEntity { get; set; } + public string ReportFullPath { get; set; } + public string ProcessJobID { get; set; } + public string MID { get; set; } + public string Date { get; set; } //2021-02-22 + + public string GetEventDescription() { return "File Has been read and parsed"; } + + public List GetHeaderNames(ILogic logic, ConfigDataBase configDataBase) + { + List results = new List(); + return results; + } + + public List GetDetailNames(ILogic logic, ConfigDataBase configDataBase) + { + List results = new List(); + return results; + } + + public List GetParameterNames(ILogic logic, ConfigDataBase configDataBase) + { + List results = new List(); + return results; + } + + public List GetPairedParameterNames(ILogic logic, ConfigDataBase configDataBase) + { + List results = new List(); + return results; + } + + public List GetIgnoreParameterNames(ILogic logic, ConfigDataBase configDataBase, Test test) + { + List results = new List(); + return results; + } + + public List GetNames(ILogic logic, ConfigDataBase configDataBase) + { + List results = new List(); + IProcessDataDescription processDataDescription = GetDefault(logic, configDataBase); + string json = JsonSerializer.Serialize(processDataDescription, processDataDescription.GetType()); + object @object = JsonSerializer.Deserialize(json); + if (!(@object is JsonElement jsonElement)) + throw new Exception(); + foreach (JsonProperty jsonProperty in jsonElement.EnumerateObject()) + results.Add(jsonProperty.Name); + return results; + } + + public IProcessDataDescription GetDisplayNames(ILogic logic, ConfigDataBase configDataBase) + { + Description result = new Description(); + return result; + } + + public IProcessDataDescription GetDefault(ILogic logic, ConfigDataBase configDataBase) + { + Description result = new Description + { + Test = -1, + Count = 0, + Index = -1, + // + EventName = configDataBase.GetEventName(), + NullData = string.Empty, + JobID = logic.Logistics.JobID, + Sequence = logic.Logistics.Sequence.ToString(), + MesEntity = logic.Logistics.MesEntity, + ReportFullPath = logic.Logistics.ReportFullPath, + ProcessJobID = logic.Logistics.ProcessJobID, + MID = logic.Logistics.MID, + Date = logic.Logistics.DateTimeFromSequence.ToUniversalTime().ToString("MM/dd/yyyy HH:mm:ss"), + }; + return result; + } + + public List GetDescription(ILogic logic, ConfigDataBase configDataBase, List tests, IProcessData iProcessData) + { + List results = new List(); + return results; + } + + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/ProcessDataStandardFormat.cs b/APC Viewer/Shared/Metrology/ProcessDataStandardFormat.cs new file mode 100644 index 0000000..f43da21 --- /dev/null +++ b/APC Viewer/Shared/Metrology/ProcessDataStandardFormat.cs @@ -0,0 +1,527 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.Json; + +namespace Shared.Metrology +{ + + public class ProcessDataStandardFormat + { + + public const string RecordStart = "RECORD_START"; + + public enum SearchFor + { + EquipmentIntegration = 1, + BusinessIntegration = 2, + SystemExport = 3, + Archive = 4 + } + + public static string GetPDSFText(ILogic logic, string eventName, string equipmentType, JsonElement jsonElement, string logisticsText) + { + string result; + if (jsonElement.ValueKind != JsonValueKind.Array) + result = string.Empty; + else + { + int columns = 0; + List lines; + string endOffset = "E#######T"; + string dataOffset = "D#######T"; + string headerOffset = "H#######T"; + string format = "MM/dd/yyyy HH:mm:ss"; + StringBuilder stringBuilder = new StringBuilder(); + lines = new string[] { "HEADER_TAG\tHEADER_VALUE", "FORMAT\t2.00", "NUMBER_PASSES\t0001", string.Concat("HEADER_OFFSET\t", headerOffset), string.Concat("DATA_OFFSET\t", dataOffset), string.Concat("END_OFFSET\t", endOffset) }.ToList(); + stringBuilder.Append("\"Time\"").Append('\t'); + stringBuilder.Append("\"A_LOGISTICS\"").Append('\t'); + stringBuilder.Append("\"B_LOGISTICS\"").Append('\t'); + JsonElement[] jsonElements = jsonElement.EnumerateArray().ToArray(); + for (int i = 0; i < jsonElements.Length;) + { + foreach (JsonProperty jsonProperty in jsonElements[0].EnumerateObject()) + { + columns += 1; + stringBuilder.Append("\"").Append(jsonProperty.Name).Append("\"").Append('\t'); + } + break; + } + stringBuilder.Remove(stringBuilder.Length - 1, 1); + lines.Add(stringBuilder.ToString()); + for (int i = 0; i < jsonElements.Length; i++) + { + stringBuilder.Clear(); + stringBuilder.Append("0.1").Append('\t'); + stringBuilder.Append("1").Append('\t'); + stringBuilder.Append("2").Append('\t'); + foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject()) + stringBuilder.Append(jsonProperty.Value).Append('\t'); + stringBuilder.Remove(stringBuilder.Length - 1, 1); + lines.Add(stringBuilder.ToString()); + } + lines.Add(string.Concat("NUM_DATA_ROWS ", jsonElements.Length.ToString().PadLeft(9, '0'))); + lines.Add(string.Concat("NUM_DATA_COLUMNS ", (columns + 3).ToString().PadLeft(9, '0'))); + lines.Add("DELIMITER ;"); + lines.Add(string.Concat("START_TIME_FORMAT ", format)); + lines.Add(string.Concat("START_TIME ", logic.Logistics.DateTimeFromSequence.ToString(format))); //12/26/2019 15:22:44 + lines.Add(string.Concat("LOGISTICS_COLUMN", '\t', "A_LOGISTICS")); + lines.Add(string.Concat("LOGISTICS_COLUMN", '\t', "B_LOGISTICS")); + if (!string.IsNullOrEmpty(logisticsText)) + lines.Add(logisticsText); + else + { + lines.Add(string.Concat("LOGISTICS_1", '\t', "A_CHAMBER=;A_INFO=", eventName, ";A_INFO2=", equipmentType, ";A_JOBID=", logic.Logistics.JobID, ";A_MES_ENTITY=", logic.Logistics.MesEntity, ";A_MID=", logic.Logistics.MID, ";A_NULL_DATA=", logic.Logistics.NullData, ";A_PPID=NO_PPID;A_PROCESS_JOBID=", logic.Logistics.ProcessJobID, ";A_PRODUCT=;A_SEQUENCE=", logic.Logistics.Sequence, ";A_WAFER_ID=;")); + lines.Add(string.Concat("LOGISTICS_2", '\t', "B_CHAMBER=;B_INFO=", eventName, ";B_INFO2=", equipmentType, ";B_JOBID=", logic.Logistics.JobID, ";B_MES_ENTITY=", logic.Logistics.MesEntity, ";B_MID=", logic.Logistics.MID, ";B_NULL_DATA=", logic.Logistics.NullData, ";B_PPID=NO_PPID;B_PROCESS_JOBID=", logic.Logistics.ProcessJobID, ";B_PRODUCT=;B_SEQUENCE=", logic.Logistics.Sequence, ";B_WAFER_ID=;")); + lines.Add("END_HEADER"); + } + stringBuilder.Clear(); + foreach (string line in lines) + stringBuilder.AppendLine(line); + result = stringBuilder.ToString(); + result = result.Replace(headerOffset, result.IndexOf("NUM_DATA_ROWS").ToString().PadLeft(9, '0')). + Replace(dataOffset, result.IndexOf('"').ToString().PadLeft(9, '0')). + Replace(endOffset, result.Length.ToString().PadLeft(9, '0')); + } + return result; + } + + public static Tuple GetLogisticsColumnsAndBody(string reportFullPath, string[] lines = null) + { + string segment; + List body = new List(); + StringBuilder logistics = new StringBuilder(); + if (lines is null) + lines = File.ReadAllLines(reportFullPath); + string[] segments; + if (lines.Length < 7) + segments = new string[] { }; + else + segments = lines[6].Trim().Split('\t'); + List columns = new List(); + for (int c = 0; c < segments.Length; c++) + { + segment = segments[c].Substring(1, segments[c].Length - 2); + if (!columns.Contains(segment)) + columns.Add(segment); + else + { + for (short i = 1; i < short.MaxValue; i++) + { + segment = string.Concat(segment, "_", i); + if (!columns.Contains(segment)) + { + columns.Add(segment); + break; + } + } + } + } + bool lookForLogistics = false; + for (int r = 7; r < lines.Count(); r++) + { + if (lines[r].StartsWith("NUM_DATA_ROWS")) + lookForLogistics = true; + if (!lookForLogistics) + { + body.Add(lines[r]); + continue; + } + if (lines[r].StartsWith("LOGISTICS_1")) + { + for (int i = r; i < lines.Count(); i++) + { + if (lines[r].StartsWith("END_HEADER")) + break; + logistics.AppendLine(lines[i]); + } + break; + } + } + return new Tuple(logistics.ToString(), columns.ToArray(), body.ToArray()); + } + + public static JsonElement GetArray(Tuple pdsf, bool lookForNumbers = false) + { + JsonElement result; + string logistics = pdsf.Item1; + string[] columns = pdsf.Item2; + string[] bodyLines = pdsf.Item3; + if (!bodyLines.Any() || !bodyLines[0].Contains('\t')) + result = JsonSerializer.Deserialize("[]"); + else + { + string value; + string[] segments; + StringBuilder stringBuilder = new StringBuilder(); + foreach (string bodyLine in bodyLines) + { + stringBuilder.Append('{'); + segments = bodyLine.Trim().Split('\t'); + if (!lookForNumbers) + { + for (int c = 1; c < segments.Length; c++) + { + value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\"); + stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\","); + } + } + else + { + for (int c = 1; c < segments.Length; c++) + { + value = segments[c].Replace("\"", "\\\"").Replace("\\", "\\\\"); + if (string.IsNullOrEmpty(value)) + stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append("null,"); + else if (value.All(char.IsDigit)) + stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append(","); + else + stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\","); + } + } + stringBuilder.Remove(stringBuilder.Length - 1, 1); + stringBuilder.AppendLine("},"); + } + stringBuilder.Remove(stringBuilder.Length - 3, 3); + result = JsonSerializer.Deserialize(string.Concat("[", stringBuilder, "]")); + } + return result; + } + + public static Dictionary> GetDictionary(Tuple pdsf) + { + Dictionary> results = new Dictionary>(); + string[] segments; + string[] columns = pdsf.Item2; + string[] bodyLines = pdsf.Item3; + foreach (string column in columns) + results.Add(column, new List()); + foreach (string bodyLine in bodyLines) + { + segments = bodyLine.Split('\t'); + for (int c = 1; c < segments.Length; c++) + { + if (c >= columns.Length) + continue; + results[columns[c]].Add(segments[c]); + } + } + return results; + } + + public static Tuple>>> GetTestDictionary(Tuple pdsf) + { + Dictionary>> results = new Dictionary>>(); + string testColumn = Description.RowColumn.Test.ToString(); + Dictionary> keyValuePairs = GetDictionary(pdsf); + if (!keyValuePairs.ContainsKey(testColumn)) + throw new Exception(); + int min; + int max; + Test testKey; + List vs; + string columnKey; + Dictionary> tests = new Dictionary>(); + for (int i = 0; i < keyValuePairs[testColumn].Count; i++) + { + if (Enum.TryParse(keyValuePairs[testColumn][i], out Test test)) + { + if (!results.ContainsKey(test)) + { + tests.Add(test, new List()); + results.Add(test, new Dictionary>()); + } + tests[test].Add(i); + } + } + foreach (KeyValuePair> testKeyValuePair in tests) + { + testKey = testKeyValuePair.Key; + min = testKeyValuePair.Value.Min(); + max = testKeyValuePair.Value.Max() + 1; + foreach (KeyValuePair> keyValuePair in keyValuePairs) + results[testKey].Add(keyValuePair.Key, new List()); + foreach (KeyValuePair> keyValuePair in keyValuePairs) + { + vs = keyValuePair.Value; + columnKey = keyValuePair.Key; + for (int i = min; i < max; i++) + { + if (vs.Count > i) + results[testKey][columnKey].Add(vs[i]); + else + results[testKey][columnKey].Add(string.Empty); + } + } + } + return new Tuple>>>(pdsf.Item1, results); + } + + private static string GetString(SearchFor searchFor, bool addSpaces, char separator = ' ') + { + if (!addSpaces) + return string.Concat(((int)searchFor).ToString().PadLeft(2, '0'), searchFor); + else + return string.Concat(((int)searchFor).ToString().PadLeft(2, '0'), separator, searchFor.ToString().Replace("In", string.Concat(separator, "In")).Replace("Ex", string.Concat(separator, "Ex"))); + } + + public static string EquipmentIntegration(bool addSpaces = true, char separator = ' ') + { + return GetString(SearchFor.EquipmentIntegration, addSpaces, separator); + } + + public static string BusinessIntegration(bool addSpaces = true, char separator = ' ') + { + return GetString(SearchFor.BusinessIntegration, addSpaces, separator); + } + + public static string SystemExport(bool addSpaces = true, char separator = ' ') + { + return GetString(SearchFor.SystemExport, addSpaces, separator); + } + + public static string Archive(bool addSpaces = true, char separator = ' ') + { + return GetString(SearchFor.Archive, addSpaces, separator); + } + + public static string GetLines(Logistics logistics, IScopeInfo scopeInfo, Dictionary> keyValuePairs, Enum[] enumColumns, string dateFormat, string timeFormat, Column[] pairedColumns, bool useDateTimeFromSequence = true, string format = "", Dictionary alternateDisplayName = null, Enum[] ignoreColumns = null) + { + StringBuilder result = new StringBuilder(); + if (useDateTimeFromSequence && !string.IsNullOrEmpty(format)) + throw new Exception(); + else if (!useDateTimeFromSequence && string.IsNullOrEmpty(format)) + throw new Exception(); + int start; + string ckey; + string pKey; + int pairedColumnsCount; + string firstDuplicate = "_1"; + if (ignoreColumns is null) + ignoreColumns = new Enum[] { }; + if (alternateDisplayName is null) + alternateDisplayName = new Dictionary(); + string columnDate = Column.Date.ToString(); + string columnTime = Column.Time.ToString(); + List columnKeys = new List(); + foreach (Enum item in enumColumns) + { + if (ignoreColumns.Contains(item)) + continue; + columnKeys.Add(item.ToString()); + } + result.AppendLine(scopeInfo.Header); + StringBuilder line = new StringBuilder(); + int count = keyValuePairs[Description.RowColumn.Count.ToString()].Count(); + string nullData; + if (logistics.NullData is null) + nullData = string.Empty; + else + nullData = logistics.NullData.ToString(); + if (pairedColumns is null) + { + start = -1; + pairedColumnsCount = 0; + } + else + { + start = 0; + pairedColumnsCount = pairedColumns.Length; + } + for (int r = 0; r < count; r++) + { + for (int p = start; p < pairedColumnsCount; p++) + { + if (pairedColumnsCount == 0) + pKey = string.Empty; + else if (!(ignoreColumns is null) && ignoreColumns.Contains(pairedColumns[p])) + continue; + else + { + pKey = pairedColumns[p].ToString(); + if (!keyValuePairs.ContainsKey(pKey)) + continue; + else if (keyValuePairs[pKey][r] == nullData) + continue; + } + if (pairedColumnsCount == 0 || !string.IsNullOrEmpty(pKey)) + { + line.Clear(); + line.Append("!"); + for (int i = 0; i < columnKeys.Count; i++) + { + ckey = columnKeys[i]; + if (!keyValuePairs.ContainsKey(ckey)) + line.Append(string.Empty); + else + { + if (useDateTimeFromSequence && ckey == columnDate) + line.Append(logistics.DateTimeFromSequence.ToString(dateFormat)); + else if (useDateTimeFromSequence && ckey == columnTime) + line.Append(logistics.DateTimeFromSequence.ToString(timeFormat)); + else if (!useDateTimeFromSequence && ckey == columnDate && keyValuePairs[ckey][r].Length == format.Length) + line.Append(DateTime.ParseExact(keyValuePairs[ckey][r], format, CultureInfo.InvariantCulture).ToString(dateFormat)); + else if (!useDateTimeFromSequence && ckey == columnTime && keyValuePairs.ContainsKey(string.Concat(ckey, firstDuplicate)) && keyValuePairs[string.Concat(ckey, firstDuplicate)][r].Length == format.Length) + line.Append(DateTime.ParseExact(keyValuePairs[string.Concat(ckey, firstDuplicate)][r], format, CultureInfo.InvariantCulture).ToString(timeFormat)); + else + line.Append(keyValuePairs[ckey][r]); + } + line.Append(';'); + } + if (pairedColumnsCount > 0) + { + if (!alternateDisplayName.ContainsKey(pairedColumns[p])) + line.Append(pairedColumns[p].GetDiplayName()); + else + line.Append(alternateDisplayName[pairedColumns[p]]); + line.Append(';'); + line.Append(keyValuePairs[pKey][r]); + line.Append(';'); + } + line.Remove(line.Length - 1, 1); + result.AppendLine(line.ToString()); + } + } + } + return result.ToString(); + } + + public static string GetLines(Logistics logistics, IScopeInfo scopeInfo, List names, Dictionary> keyValuePairs, string dateFormat, string timeFormat, List pairedParameterNames, bool useDateTimeFromSequence = true, string format = "", List ignoreParameterNames = null) + { + StringBuilder result = new StringBuilder(); + if (ignoreParameterNames is null) + ignoreParameterNames = new List(); + if (useDateTimeFromSequence && !string.IsNullOrEmpty(format)) + throw new Exception(); + else if (!useDateTimeFromSequence && string.IsNullOrEmpty(format)) + throw new Exception(); + string nullData; + const string columnDate = "Date"; + const string columnTime = "Time"; + const string firstDuplicate = "_1"; + result.AppendLine(scopeInfo.Header); + StringBuilder line = new StringBuilder(); + if (logistics.NullData is null) + nullData = string.Empty; + else + nullData = logistics.NullData.ToString(); + int count = (from l in keyValuePairs select l.Value.Count).Min(); + for (int r = 0; r < count; r++) + { + line.Clear(); + line.Append("!"); + foreach (KeyValuePair> keyValuePair in keyValuePairs) + { + if (!names.Contains(keyValuePair.Key)) + continue; + if (ignoreParameterNames.Contains(keyValuePair.Key)) + continue; + if (pairedParameterNames.Contains(keyValuePair.Key)) + { + if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData) + continue; + else + result.Append(line).Append(keyValuePair.Key).Append(';').AppendLine(keyValuePair.Value[r]); + } + else + { + if (useDateTimeFromSequence && keyValuePair.Key == columnDate) + line.Append(logistics.DateTimeFromSequence.ToString(dateFormat)); + else if (useDateTimeFromSequence && keyValuePair.Key == columnTime) + line.Append(logistics.DateTimeFromSequence.ToString(timeFormat)); + else if (!useDateTimeFromSequence && keyValuePair.Key == columnDate && keyValuePair.Value[r].Length == format.Length) + line.Append(DateTime.ParseExact(keyValuePair.Value[r], format, CultureInfo.InvariantCulture).ToString(dateFormat)); + else if (!useDateTimeFromSequence && keyValuePair.Key == columnTime && keyValuePairs.ContainsKey(string.Concat(keyValuePair.Key, firstDuplicate)) && keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r].Length == format.Length) + line.Append(DateTime.ParseExact(keyValuePairs[string.Concat(keyValuePair.Key, firstDuplicate)][r], format, CultureInfo.InvariantCulture).ToString(timeFormat)); + else if (string.IsNullOrEmpty(keyValuePair.Value[r]) || keyValuePair.Value[r] == nullData) + line.Append(nullData); + else + line.Append(keyValuePair.Value[r]); + line.Append(';'); + } + } + if (!pairedParameterNames.Any()) + { + line.Remove(line.Length - 1, 1); + result.AppendLine(line.ToString()); + } + } + return result.ToString(); + } + + public static List PDSFToFixedWidth(string reportFullPath) + { + List results = new List(); + if (!File.Exists(reportFullPath)) + throw new Exception(); + int[] group; + string line; + int startsAt = 0; + string[] segments; + int? currentGroup = null; + char inputSeperator = '\t'; + char outputSeperator = '\t'; + List vs = new List(); + List groups = new List(); + string[] lines = File.ReadAllLines(reportFullPath); + StringBuilder stringBuilder = new StringBuilder(); + for (int i = 0; i < lines.Length; i++) + { + if (string.IsNullOrEmpty(lines[i])) + continue; + segments = lines[i].Split(inputSeperator); + if (currentGroup is null) + currentGroup = segments.Length; + if (segments.Length != currentGroup) + { + currentGroup = segments.Length; + groups.Add(new int[] { startsAt, i - 1 }); + startsAt = i; + } + } + if (startsAt == lines.Length - 1 && lines[0].Split(inputSeperator).Length != currentGroup) + groups.Add(new int[] { lines.Length - 1, lines.Length - 1 }); + for (int g = 0; g < groups.Count; g++) + { + vs.Clear(); + group = groups[g]; + line = lines[group[0]]; + segments = line.Split(inputSeperator); + for (int s = 0; s < segments.Length; s++) + vs.Add(segments[s].Length); + for (int i = group[0]; i <= group[1]; i++) + { + line = lines[i]; + segments = line.Split(inputSeperator); + for (int s = 0; s < segments.Length; s++) + { + if (vs[s] < segments[s].Length) + vs[s] = segments[s].Length; + } + } + stringBuilder.Clear(); + for (int s = 0; s < segments.Length; s++) + stringBuilder.Append((s + 1).ToString().PadLeft(vs[s], ' ')).Append(outputSeperator); + stringBuilder.Remove(stringBuilder.Length - 1, 1); + results.Add(stringBuilder.ToString()); + for (int i = group[0]; i <= group[1]; i++) + { + line = lines[i]; + stringBuilder.Clear(); + segments = line.Split(inputSeperator); + for (int s = 0; s < segments.Length; s++) + stringBuilder.Append(segments[s].PadLeft(vs[s], ' ')).Append(outputSeperator); + stringBuilder.Remove(stringBuilder.Length - 1, 1); + results.Add(stringBuilder.ToString()); + } + results.Add(string.Empty); + } + return results; + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Shared/Metrology/Test.cs b/APC Viewer/Shared/Metrology/Test.cs new file mode 100644 index 0000000..a24ac29 --- /dev/null +++ b/APC Viewer/Shared/Metrology/Test.cs @@ -0,0 +1,57 @@ +namespace Shared.Metrology +{ + + public enum Test + { + AFMRoughness = 34, + BioRadQS408M = 25, + BioRadStratus = 26, + BreakdownVoltageCenter = 0, + BreakdownVoltageEdge = 1, + BreakdownVoltageMiddle8in = 2, + CandelaKlarfDC = 6, + CandelaLaser = 36, + CandelaProdU = 39, + CandelaPSL = 38, + CandelaVerify = 37, + CDE = 24, + CV = 3, + DailyRPMAverage = 19, + DailyRPMPLRatio = 20, + DailyRPMXY = 18, + Denton = 9, + DiffusionLength = 45, + Hall = 10, + HgCV = 23, + Lehighton = 13, + Microscope = 46, + MonthlyCV = 4, + MonthlyHall = 11, + MonthlyXRD = 32, + Photoreflectance = 22, + PlatoA = 48, //Largest + RPMAverage = 16, + RPMPLRatio = 17, + RPMXY = 15, + SP1 = 8, + Tencor = 7, + UV = 35, + VerificationLehighton = 14, + VerificationRPM = 21, + VerificationWarpAndBow = 29, + VpdIcpmsAnalyte = 27, + WarpAndBow = 28, + WeeklyCV = 5, + WeeklyHall = 12, + WeeklyXRD = 33, + WeeklyXRDAIcomp = 40, + WeeklyXRDFWHM002 = 41, + WeeklyXRDFWHM105 = 42, + WeeklyXRDSLStks = 43, + WeeklyXRDXRR = 44, + XRDWeightedAverage = 31, + JVXRD = 47, + XRDXY = 30 + } + +} \ No newline at end of file diff --git a/APC Viewer/Singleton/Background.cs b/APC Viewer/Singleton/Background.cs new file mode 100644 index 0000000..daf7e9b --- /dev/null +++ b/APC Viewer/Singleton/Background.cs @@ -0,0 +1,1020 @@ +using APCViewer.Models; +using Infineon.Monitoring.MonA; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; +using Shared; +using Shared.Metrology; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +namespace APCViewer.Singleton +{ + + public class Background : IBackground + { + + public List Timers => _Timers; + public string Message { get; private set; } + public AppSettings AppSettings => _AppSettings; + public WebClient WebClient { get; private set; } + public string WorkingDirectory { get; private set; } + public IsEnvironment IsEnvironment => _IsEnvironment; + public List Exceptions { get; private set; } + + private bool _ShuttingDown; + private readonly object _Lock; + private readonly List _Timers; + private readonly AppSettings _AppSettings; + private readonly string[] _SiEquipmentTypes; + private readonly string[] _GaNEquipmentTypes; + private readonly IsEnvironment _IsEnvironment; + + private const string _Site = "sjc"; + + private Log _Log; + private DateTime _PrimaryInstanceSetAt; + private readonly Dictionary _GaNPDSFFiles; + private readonly Dictionary _SiPDSFFiles; + private readonly Dictionary _GaNIPDSFFiles; + private readonly Dictionary _SiIPDSFFiles; + private readonly Dictionary _GaNAPCLogistics; + private readonly Dictionary _SiAPCLogistics; + private readonly Dictionary _GaNEDALogistics; + private readonly Dictionary _SiEDALogistics; + private readonly Dictionary _GaNEAFLogLogistics; + private readonly Dictionary _SiEAFLogLogistics; + + public Background(IsEnvironment isEnvironment, IConfiguration configuration, string workingDirectory) + { + _Log = null; + _Lock = new object(); + _ShuttingDown = false; + if (_Lock is null) + { } + Message = string.Empty; + AppSettings appSettings = new AppSettings(); + configuration.Bind(appSettings); + if (!isEnvironment.Production) + appSettings.Server = appSettings.Server.Replace('.', '_'); + _AppSettings = appSettings; + _Timers = new List(); + _IsEnvironment = isEnvironment; + Exceptions = new List(); + WorkingDirectory = workingDirectory; + _PrimaryInstanceSetAt = DateTime.MinValue; + _GaNPDSFFiles = new Dictionary(); + _SiPDSFFiles = new Dictionary(); + _GaNIPDSFFiles = new Dictionary(); + _SiIPDSFFiles = new Dictionary(); + _GaNAPCLogistics = new Dictionary(); + _SiAPCLogistics = new Dictionary(); + _GaNEDALogistics = new Dictionary(); + _SiEDALogistics = new Dictionary(); + _GaNEAFLogLogistics = new Dictionary(); + _SiEAFLogLogistics = new Dictionary(); + _GaNEquipmentTypes = GetEquipmentTypes(isGaN: true, isSi: false); + _SiEquipmentTypes = GetEquipmentTypes(isGaN: false, isSi: true); + } + + public void Dispose() + { + foreach (Timer timer in _Timers) + timer.Dispose(); + } + + void IBackground.Update(ILogger logger, WebClient webClient) + { + Update(logger, webClient); + } + + internal void Update(ILogger logger, WebClient webClient) + { + WebClient = webClient; + _Log = new Log(logger); + //https://blog.magnusmontin.net/2018/11/05/platform-conditional-compilation-in-net-core/ + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + _Log.Debug("Running on Linux!"); + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + _Log.Debug("Running on macOS!"); + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + _Log.Debug("Running on Windows!"); +#if Linux + _Log.Debug("Built on Linux!"); +#elif OSX + _Log.Debug("Built on macOS!"); +#elif Windows + _Log.Debug("Built in Windows!"); +#else + ()("Built in unkown!"); +#endif + if (string.IsNullOrEmpty(_AppSettings.URLs) && !_IsEnvironment.Development) + throw new Exception("Invalid Application Settings URLs!"); + } + + internal void Catch(Exception exception) + { + Exceptions.Add(exception); + _Log.Error(exception); + if (!string.IsNullOrEmpty(_AppSettings.MonARessource)) + { + MonIn monIn = MonIn.GetInstance(); + monIn.SendStatus(_Site, _AppSettings.MonARessource, "Heartbeat", State.Warning); + } + } + + public void SendStatusOk() + { + if (!string.IsNullOrEmpty(_AppSettings.MonARessource)) + { + MonIn monIn = MonIn.GetInstance(); + monIn.SendStatus(_Site, _AppSettings.MonARessource, "Heartbeat", State.Ok); + } + } + + public string GetCountDirectory(string verb) + { + DateTime dateTime = DateTime.Now; + CultureInfo cultureInfo = new("en-US"); + Calendar calendar = cultureInfo.Calendar; + string weekOfYear = calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00"); + //string nameSpace = System.Reflection.Assembly.GetExecutingAssembly().EntryPoint.DeclaringType.Namespace; + string nameSpace = GetType().Namespace.Split('.')[0]; + if (!string.IsNullOrEmpty(_AppSettings.MonARessource)) + { + MonIn monIn = MonIn.GetInstance(); + monIn.SendStatus(_Site, _AppSettings.MonARessource, "Heartbeat", State.Up); + } + return string.Concat(@"\\", _AppSettings.Server, @"\EC_APC\Counts\", dateTime.ToString("yyyy"), @"\", "Week_", weekOfYear, @"\", dateTime.ToString("yyyy - MM - dd"), @"\", "Application", @"\", nameSpace, @"\", verb, @"\", dateTime.Ticks); + } + + public void Stop(bool immediate) + { + _ShuttingDown = true; + foreach (Timer timer in _Timers) + timer.Change(Timeout.Infinite, 0); + if (!_IsEnvironment.Development) + { + if (!string.IsNullOrEmpty(_AppSettings.MonARessource)) + { + MonIn monIn = MonIn.GetInstance(); + monIn.SendStatus(_Site, _AppSettings.MonARessource, "Heartbeat", State.Down); + } + string countDirectory = GetCountDirectory("Stop"); + Directory.CreateDirectory(countDirectory); + } + } + + public void ClearMessage() + { + Message = string.Empty; + } + + public void SetIsPrimaryInstance() + { + _PrimaryInstanceSetAt = DateTime.Now; + } + + public void ClearIsPrimaryInstance() + { + _PrimaryInstanceSetAt = DateTime.MinValue; + } + + public bool IsPrimaryInstance() + { + bool result; + DateTime dateTime = DateTime.Now.AddDays(-1); + result = _PrimaryInstanceSetAt > dateTime; + return result; + } + + public void LogisticsClear() + { + _GaNAPCLogistics.Clear(); + _SiAPCLogistics.Clear(); + _GaNEDALogistics.Clear(); + _SiEDALogistics.Clear(); + _GaNEAFLogLogistics.Clear(); + _SiEAFLogLogistics.Clear(); + } + + public void APCDataCallback() + { + Data(_AppSettings.Server, _SiEquipmentTypes, _SiAPCLogistics, _SiPDSFFiles, isAPC: true); + Data(_AppSettings.Server, _GaNEquipmentTypes, _GaNAPCLogistics, _GaNPDSFFiles, isAPC: true); + } + + public void EDADataCallback() + { + Data(_AppSettings.Server, _SiEquipmentTypes, _SiEDALogistics, _SiPDSFFiles, isEDA: true); + Data(_AppSettings.Server, _GaNEquipmentTypes, _GaNEDALogistics, _GaNPDSFFiles, isEDA: true); + } + + public void EAFLogDataCallback() + { + Data(_AppSettings.Server, _SiEquipmentTypes, _SiEAFLogLogistics, _SiIPDSFFiles, isEAFLog: true); + Data(_AppSettings.Server, _GaNEquipmentTypes, _GaNEAFLogLogistics, _GaNIPDSFFiles, isEAFLog: true); + } + + public string GetPDSF(long Sequence) + { + string result = string.Empty; + if (string.IsNullOrEmpty(result)) + { + foreach (KeyValuePair element in _GaNEDALogistics) + { + if (((Logistics)element.Value).Sequence == Sequence) + { + result = element.Key; + break; + } + } + } + if (string.IsNullOrEmpty(result)) + { + foreach (KeyValuePair element in _SiEDALogistics) + { + if (((Logistics)element.Value).Sequence == Sequence) + { + result = element.Key; + break; + } + } + } + if (string.IsNullOrEmpty(result)) + { + foreach (KeyValuePair element in _GaNAPCLogistics) + { + if (((Logistics)element.Value).Sequence == Sequence) + { + result = element.Key; + break; + } + } + } + if (string.IsNullOrEmpty(result)) + { + foreach (KeyValuePair element in _SiAPCLogistics) + { + if (((Logistics)element.Value).Sequence == Sequence) + { + result = element.Key; + break; + } + } + } + return result; + } + + public string GetIPDSF(long Sequence) + { + string result = string.Empty; + if (string.IsNullOrEmpty(result)) + { + foreach (KeyValuePair element in _GaNEAFLogLogistics) + { + if (((Logistics)element.Value).Sequence == Sequence) + { + result = element.Key; + break; + } + } + } + if (string.IsNullOrEmpty(result)) + { + foreach (KeyValuePair element in _SiEAFLogLogistics) + { + if (((Logistics)element.Value).Sequence == Sequence) + { + result = element.Key; + break; + } + } + } + return result; + } + + public Tuple SetViewBag(string directory, string filter, bool isGaN = false, bool isSi = false, bool forPDSF = false, bool forIPDSF = false) + { + Tuple result; + if (isGaN && isSi) + throw new Exception(); + else if (!isGaN && !isSi) + isGaN = true; + if (isGaN) + result = SetViewBag(_GaNAPCLogistics, _GaNEDALogistics, _GaNEAFLogLogistics, directory, filter, forPDSF, forIPDSF); + else if (isSi) + result = SetViewBag(_SiAPCLogistics, _SiEDALogistics, _SiEAFLogLogistics, directory, filter, forPDSF, forIPDSF); + else + throw new Exception(); + return result; + } + + public Tuple, List> GetTimePivot(bool isGaN = false, bool isSi = false) + { + List forPDSF; + List forIPDSF; + if (isGaN && isSi) + throw new Exception(); + else if (!isGaN && !isSi) + isGaN = true; + if (isGaN) + { + forIPDSF = GetTimePivot(_GaNEquipmentTypes, _GaNAPCLogistics, _GaNEDALogistics, _GaNEAFLogLogistics, forPDSF: false, forIPDSF: true); + forPDSF = GetTimePivot(_GaNEquipmentTypes, _GaNAPCLogistics, _GaNEDALogistics, _GaNEAFLogLogistics, forPDSF: true, forIPDSF: false); + } + else if (isSi) + { + forIPDSF = GetTimePivot(_SiEquipmentTypes, _SiAPCLogistics, _SiEDALogistics, _SiEAFLogLogistics, forPDSF: false, forIPDSF: true); + forPDSF = GetTimePivot(_SiEquipmentTypes, _SiAPCLogistics, _SiEDALogistics, _SiEAFLogLogistics, forPDSF: true, forIPDSF: false); + } + else + throw new Exception(); + return new Tuple, List>(forIPDSF, forPDSF); + } + + public static string[] GetEquipmentTypes(bool isGaN = false, bool isSi = false) + { + string[] results; + if (isGaN && isSi) + throw new Exception(); + else if (!isGaN && !isSi) + isGaN = true; + if (isSi) + { + results = new string[] + { + Shared.EquipmentType.MET08ANLYSDIFAAST230_Semi.ToString(), + Shared.EquipmentType.MET08DDUPSFS6420.ToString(), + Shared.EquipmentType.MET08DDUPSP1TBI.ToString(), + Shared.EquipmentType.MET08RESIHGCV.ToString(), + Shared.EquipmentType.MET08RESIMAPCDE.ToString(), + Shared.EquipmentType.MET08THFTIRQS408M.ToString(), + Shared.EquipmentType.MET08THFTIRSTRATUS.ToString() + }; + } + else if (isGaN) + { + results = new string[] + { + Shared.EquipmentType.DEP08EGANAIXG5.ToString(), + Shared.EquipmentType.MET08AFMD3100.ToString(), + Shared.EquipmentType.MET08BVHGPROBE.ToString(), + Shared.EquipmentType.MET08CVHGPROBE802B150.ToString(), + Shared.EquipmentType.MET08CVHGPROBE802B150_Monthly.ToString(), + Shared.EquipmentType.MET08CVHGPROBE802B150_Weekly.ToString(), + Shared.EquipmentType.MET08DDINCAN8620.ToString(), + Shared.EquipmentType.MET08DDINCAN8620_Daily.ToString(), + Shared.EquipmentType.MET08EBEAMINTEGRITY26.ToString(), + Shared.EquipmentType.MET08HALLHL5580.ToString(), + Shared.EquipmentType.MET08HALLHL5580_Monthly.ToString(), + Shared.EquipmentType.MET08HALLHL5580_Weekly.ToString(), + Shared.EquipmentType.MET08MESMICROSCOPE.ToString(), + Shared.EquipmentType.MET08NDFRESIMAP151C.ToString(), + Shared.EquipmentType.MET08NDFRESIMAP151C_Verification.ToString(), + Shared.EquipmentType.MET08PLMAPRPM.ToString(), + Shared.EquipmentType.MET08PLMAPRPM_Daily.ToString(), + Shared.EquipmentType.MET08PLMAPRPM_Verification.ToString(), + Shared.EquipmentType.MET08PLMPPLATO.ToString(), + Shared.EquipmentType.MET08PRFUSB4000.ToString(), + Shared.EquipmentType.MET08UVH44GS100M.ToString(), + Shared.EquipmentType.MET08VPDSUBCON.ToString(), + Shared.EquipmentType.MET08WGEOMX203641Q.ToString(), + Shared.EquipmentType.MET08WGEOMX203641Q_Verification.ToString(), + Shared.EquipmentType.METBRXRAYJV7300L.ToString(), + Shared.EquipmentType.MET08XRDXPERTPROMRDXL.ToString(), + Shared.EquipmentType.MET08XRDXPERTPROMRDXL_Monthly.ToString(), + Shared.EquipmentType.MET08XRDXPERTPROMRDXL_Weekly.ToString() + }; + } + else + throw new Exception(); + return results; + } + + public Tuple SetViewBag(Dictionary apcLogistics, Dictionary edaLogistics, Dictionary eafLogLogistics, string directory = null, string filter = null, bool forPDSF = false, bool forIPDSF = false) + { + Tuple result; + int files = 0; + string eaf = "EAF"; + string eda = "EDA"; + string apc = "APC"; + string[] technologies = new string[] { eaf, eda, apc }; + string root = "Root"; + string staging = "Staging"; + string production = "Production"; + string development = "Development"; + string[] enviroments = new string[] { root, staging, production, development }; + string error = "Error !!!"; + List> sorted = new List>(); + Dictionary logisticsCollection = new Dictionary(); + Dictionary> pairs = new Dictionary>(); + Dictionary>> grouped = new Dictionary>>(); + foreach (string t in technologies) + { + if (_ShuttingDown) + break; + foreach (string e in enviroments) + { + if (_ShuttingDown) + break; + grouped.Add(string.Concat(t, " - ", e), new Dictionary>()); + grouped.Add(string.Concat(t, " - ", e, " ", error), new Dictionary>()); + } + } + string searchPattern; + if (forPDSF && forIPDSF) + throw new Exception(); + else if (!forPDSF && !forIPDSF) + throw new Exception(); + else if (forPDSF) + searchPattern = "*.pdsf"; + else if (forIPDSF) + searchPattern = "*.ipdsf"; + else + throw new Exception(); + if (!string.IsNullOrEmpty(directory) && Directory.Exists(directory)) + { + Logistics logistics; + Tuple pdsf; + string[] pdsfFiles = Directory.GetFiles(directory, searchPattern, SearchOption.AllDirectories); + foreach (string pdsfFile in pdsfFiles) + { + if (_ShuttingDown) + break; + pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(pdsfFile); + logistics = new Logistics(pdsfFile, pdsf.Item1); + if (!logistics.Logistics2.Any()) + logistics.Logistics2.Add(new Logistics2(string.Empty)); + logisticsCollection.Add(pdsfFile, logistics); + } + } + else if (forIPDSF) + { + if (!(eafLogLogistics is null)) + { + foreach (KeyValuePair element in eafLogLogistics) + logisticsCollection.Add(element.Key, (Logistics)element.Value); + } + } + else if (forPDSF) + { + if (!(edaLogistics is null)) + { + foreach (KeyValuePair element in edaLogistics) + logisticsCollection.Add(element.Key, (Logistics)element.Value); + } + if (!(apcLogistics is null)) + { + foreach (KeyValuePair element in apcLogistics) + logisticsCollection.Add(element.Key, (Logistics)element.Value); + } + } + if (logisticsCollection.Any()) + { + string key; + string technology; + string environment; + string equipmentType; + List sequences = new List(); + foreach (KeyValuePair element in logisticsCollection) + { + if (_ShuttingDown) + break; + if (element.Key.Contains(@"\EC_EAFLog\")) + technology = eaf; + else if (element.Key.Contains(@"\EC_EDA\")) + technology = eda; + else if (element.Key.Contains(@"\EC_APC\")) + technology = apc; + else + technology = eaf; + if (element.Key.Contains(@"\Production\")) + environment = production; + else if (element.Key.Contains(@"\Staging\")) + environment = staging; + else if (element.Key.Contains(@"\DEV\")) + environment = development; + else + environment = root; + equipmentType = Path.GetFileNameWithoutExtension(Path.GetDirectoryName(Path.GetDirectoryName(element.Key))); + if (equipmentType == "ViewerPath") + equipmentType = Path.GetFileNameWithoutExtension(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(element.Key)))); + if (string.IsNullOrEmpty(filter) || technology == filter || environment == filter || equipmentType == filter) + { + files += 1; + if (!element.Key.Contains(@"\Error\") && !element.Key.Contains(@"\BadPath\")) + key = string.Concat(technology, " - ", environment); + else + key = string.Concat(technology, " - ", environment, " ", error); + if (!grouped[key].ContainsKey(equipmentType)) + grouped[key].Add(equipmentType, new List()); + grouped[key][equipmentType].Add(element.Value); + if (!sequences.Contains(element.Value.Sequence)) + { + sequences.Add(element.Value.Sequence); + pairs.Add(element.Value.Sequence, new Tuple(new string[] { key, equipmentType }, element.Value)); + } + else + { + for (short i = 1; i < short.MaxValue; i++) + { + if (_ShuttingDown) + break; + if (sequences.Contains(element.Value.Sequence + i)) + continue; + else + { + sequences.Add(element.Value.Sequence + i); + pairs.Add(element.Value.Sequence + i, new Tuple(new string[] { string.Concat("*", key), equipmentType }, element.Value)); + break; + } + } + } + } + } + sequences = (from l in sequences orderby l descending select l).ToList(); + foreach (long sequence in sequences) + sorted.Add(pairs[sequence]); + } + result = new Tuple(files, grouped, sorted, directory); + return result; + } + + public List GetTimePivot(string[] equipmentTypes, Dictionary apcLogistics, Dictionary edaLogistics, Dictionary eafLogLogistics, bool forPDSF = false, bool forIPDSF = false) + { + List results = new List(); + Dictionary logisticsCollection = new Dictionary(); + if (forPDSF && forIPDSF) + throw new Exception(); + else if (!forPDSF && !forIPDSF) + throw new Exception(); + else if (forIPDSF) + { + if (!(eafLogLogistics is null)) + { + foreach (KeyValuePair element in eafLogLogistics) + logisticsCollection.Add(element.Key, (Logistics)element.Value); + } + } + else if (forPDSF) + { + if (!(edaLogistics is null)) + { + foreach (KeyValuePair element in edaLogistics) + logisticsCollection.Add(element.Key, (Logistics)element.Value); + } + if (!(apcLogistics is null)) + { + foreach (KeyValuePair element in apcLogistics) + logisticsCollection.Add(element.Key, (Logistics)element.Value); + } + } + if (logisticsCollection.Any()) + { + int eT = 0; + int jID = 1; + int pJID = 2; + int pN = 3; + int k = 4; + string key; + string partNumber; + string equipmentConnection; + DateTime dateTime = DateTime.Now; + List segments = new List(); + StringBuilder stringBuilder = new StringBuilder(); + long minutes15 = dateTime.AddMinutes(-15).Ticks; + long minutes30 = dateTime.AddMinutes(-30).Ticks; + long hours1 = dateTime.AddHours(-1).Ticks; + long hours3 = dateTime.AddHours(-3).Ticks; + long days1 = dateTime.AddDays(-1).Ticks; + long days2 = dateTime.AddDays(-2).Ticks; + long days4 = dateTime.AddDays(-4).Ticks; + long days7 = dateTime.AddDays(-7).Ticks; + List keys = new List(); + List keySegments = new List(); + List equipmentConnections = new List(); + foreach (string item in equipmentTypes) + equipmentConnections.Add(item.ToString()); + Dictionary> m15 = new Dictionary>(); + Dictionary> m30 = new Dictionary>(); + Dictionary> h1 = new Dictionary>(); + Dictionary> h3 = new Dictionary>(); + Dictionary> d1 = new Dictionary>(); + Dictionary> d2 = new Dictionary>(); + Dictionary> d4 = new Dictionary>(); + Dictionary> d7 = new Dictionary>(); + Dictionary> more = new Dictionary>(); + string[] si = new string[] { EquipmentType.MET08DDUPSFS6420.ToString(), EquipmentType.MET08DDUPSP1TBI.ToString(), EquipmentType.MET08RESIHGCV.ToString(), EquipmentType.MET08RESIMAPCDE.ToString(), EquipmentType.MET08THFTIRQS408M.ToString(), EquipmentType.MET08THFTIRSTRATUS.ToString() }; + foreach (KeyValuePair element in logisticsCollection) + { + if (_ShuttingDown) + break; + equipmentConnection = Path.GetFileNameWithoutExtension(Path.GetDirectoryName(Path.GetDirectoryName(element.Key))); + if (equipmentConnections.Contains(equipmentConnection)) + equipmentConnections.Remove(equipmentConnection); + if (!element.Value.Logistics2.Any()) + partNumber = string.Empty; + else + partNumber = element.Value.Logistics2[0].PartNumber; + if (string.IsNullOrEmpty(partNumber) && element.Value.Logistics1.Any()) + { + key = "PRODUCT="; + if (element.Value.Logistics1[0].Contains(key)) + { + segments = element.Value.Logistics1[0].Split(new string[] { key }, StringSplitOptions.RemoveEmptyEntries).ToList(); + partNumber = segments[1].Split(';')[0]; + } + } + if (string.IsNullOrEmpty(partNumber)) + partNumber = " "; + segments.Clear(); + segments.Add(equipmentConnection); + segments.Add(element.Value.JobID); + if (si.Contains(equipmentConnection)) + segments.Add("Si"); + else + segments.Add(element.Value.ProcessJobID); + segments.Add(partNumber); + stringBuilder.Clear(); + foreach (string segment in segments) + stringBuilder.Append(segment).Append('|'); + key = stringBuilder.ToString(); + segments.Add(key); + if (element.Value.Sequence > minutes15) + { + if (!keys.Contains(key)) + { + keys.Add(key); + keySegments.Add(segments.ToArray()); + m15.Add(key, new List()); + m30.Add(key, new List()); + h1.Add(key, new List()); + h3.Add(key, new List()); + d1.Add(key, new List()); + d2.Add(key, new List()); + d4.Add(key, new List()); + d7.Add(key, new List()); + more.Add(key, new List()); + } + m15[key].Add(element.Value); + } + else if (element.Value.Sequence > minutes30) + { + if (!keys.Contains(key)) + { + keys.Add(key); + keySegments.Add(segments.ToArray()); + m15.Add(key, new List()); + m30.Add(key, new List()); + h1.Add(key, new List()); + h3.Add(key, new List()); + d1.Add(key, new List()); + d2.Add(key, new List()); + d4.Add(key, new List()); + d7.Add(key, new List()); + more.Add(key, new List()); + } + m30[key].Add(element.Value); + } + else if (element.Value.Sequence > hours1) + { + if (!keys.Contains(key)) + { + keys.Add(key); + keySegments.Add(segments.ToArray()); + m15.Add(key, new List()); + m30.Add(key, new List()); + h1.Add(key, new List()); + h3.Add(key, new List()); + d1.Add(key, new List()); + d2.Add(key, new List()); + d4.Add(key, new List()); + d7.Add(key, new List()); + more.Add(key, new List()); + } + h1[key].Add(element.Value); + } + else if (element.Value.Sequence > hours3) + { + if (!keys.Contains(key)) + { + keys.Add(key); + keySegments.Add(segments.ToArray()); + m15.Add(key, new List()); + m30.Add(key, new List()); + h1.Add(key, new List()); + h3.Add(key, new List()); + d1.Add(key, new List()); + d2.Add(key, new List()); + d4.Add(key, new List()); + d7.Add(key, new List()); + more.Add(key, new List()); + } + h3[key].Add(element.Value); + } + else if (element.Value.Sequence > days1) + { + if (!keys.Contains(key)) + { + keys.Add(key); + keySegments.Add(segments.ToArray()); + m15.Add(key, new List()); + m30.Add(key, new List()); + h1.Add(key, new List()); + h3.Add(key, new List()); + d1.Add(key, new List()); + d2.Add(key, new List()); + d4.Add(key, new List()); + d7.Add(key, new List()); + more.Add(key, new List()); + } + d1[key].Add(element.Value); + } + else if (element.Value.Sequence > days2) + { + if (!keys.Contains(key)) + { + keys.Add(key); + keySegments.Add(segments.ToArray()); + m15.Add(key, new List()); + m30.Add(key, new List()); + h1.Add(key, new List()); + h3.Add(key, new List()); + d1.Add(key, new List()); + d2.Add(key, new List()); + d4.Add(key, new List()); + d7.Add(key, new List()); + more.Add(key, new List()); + } + d2[key].Add(element.Value); + } + else if (element.Value.Sequence > days4) + { + if (!keys.Contains(key)) + { + keys.Add(key); + keySegments.Add(segments.ToArray()); + m15.Add(key, new List()); + m30.Add(key, new List()); + h1.Add(key, new List()); + h3.Add(key, new List()); + d1.Add(key, new List()); + d2.Add(key, new List()); + d4.Add(key, new List()); + d7.Add(key, new List()); + more.Add(key, new List()); + } + d4[key].Add(element.Value); + } + else if (element.Value.Sequence > days7) + { + if (!keys.Contains(key)) + { + keys.Add(key); + keySegments.Add(segments.ToArray()); + m15.Add(key, new List()); + m30.Add(key, new List()); + h1.Add(key, new List()); + h3.Add(key, new List()); + d1.Add(key, new List()); + d2.Add(key, new List()); + d4.Add(key, new List()); + d7.Add(key, new List()); + more.Add(key, new List()); + } + d7[key].Add(element.Value); + } + else + { + if (!keys.Contains(key)) + { + keys.Add(key); + keySegments.Add(segments.ToArray()); + m15.Add(key, new List()); + m30.Add(key, new List()); + h1.Add(key, new List()); + h3.Add(key, new List()); + d1.Add(key, new List()); + d2.Add(key, new List()); + d4.Add(key, new List()); + d7.Add(key, new List()); + more.Add(key, new List()); + } + more[key].Add(element.Value); + } + } + int count; + List row; + results.Add(new string[] { "ET", nameof(Logistics.JobID), nameof(Logistics.ProcessJobID), nameof(Logistics2.PartNumber), "m15", "m30", "h1", "h3", "d1", "d2", "d4", "d7", "more" }); + for (int i = 0; i < equipmentConnections.Count; i++) + results.Add(new string[] { equipmentConnections[i], " ", " ", " ", "0", "0", "0", "0", "0", "0", "0", "0", "0" }); + keySegments = (from l in keySegments orderby l[eT], l[jID], l[pJID], l[pN] select l).ToList(); + foreach (string[] keySegment in keySegments) + { + if (_ShuttingDown) + break; + count = 0; + key = keySegment[k]; + row = new List(new string[] { keySegment[eT], keySegment[pJID], keySegment[jID], keySegment[pN] }); + count += m15[key].Count; + row.Add(count.ToString()); + count += m30[key].Count; + row.Add(count.ToString()); + count += h1[key].Count; + row.Add(count.ToString()); + count += h3[key].Count; + row.Add(count.ToString()); + count += d1[key].Count; + row.Add(count.ToString()); + count += d2[key].Count; + row.Add(count.ToString()); + count += d4[key].Count; + row.Add(count.ToString()); + count += d7[key].Count; + row.Add(count.ToString()); + count += more[key].Count; + row.Add(count.ToString()); + results.Add(row.ToArray()); + } + } + return results; + } + + public void Data(string server, string[] equipmentTypes, Dictionary inputLogistics, Dictionary inputPDSFFiles, bool isEAFLog = false, bool isEDA = false, bool isAPC = false) + { + DateTime dateTime; + string[] pdsfFiles; + string checkDirectory; + DateTime creationTime; + DateTime lastWriteTime; + string[] cellInstanceDirectories; + string[] equipmentTypeDirectories; + long ticks = DateTime.Now.AddDays(-5).Ticks; + List pdsfFileCollection = new List(); + long pollPathTicks = DateTime.Now.AddMinutes(-5).Ticks; + Tuple pdsf; + if (inputLogistics is null) + inputLogistics = new Dictionary(); + if (inputPDSFFiles is null) + inputPDSFFiles = new Dictionary(); + if (inputLogistics.Any()) + { + string[] fileKeys = inputLogistics.Keys.ToArray(); + foreach (string fileKey in fileKeys) + { + if (_ShuttingDown) + break; + if (!File.Exists(fileKey)) + continue; + creationTime = new FileInfo(fileKey).CreationTime; + lastWriteTime = new FileInfo(fileKey).LastWriteTime; + if (creationTime < lastWriteTime) + dateTime = creationTime; + else + dateTime = lastWriteTime; + if (dateTime.Ticks < ticks) + { + if (inputLogistics.ContainsKey(fileKey)) + inputLogistics.Remove(fileKey); + continue; + } + } + } + string key; + int loopEnd; + int loopStart; + string searchPattern; + string equipmentType; + string rootDirectoryPath; + bool isDuplicatorDirectory; + if (isEAFLog && isEDA && isAPC) + throw new Exception(); + else if (!isEAFLog && !isEDA && !isAPC) + throw new Exception(); + else if (isEAFLog) + { + loopEnd = 4; + loopStart = 1; + searchPattern = "*.ipdsf"; + rootDirectoryPath = string.Concat(@"\\", server, @"\EC_EAFLog"); + } + else if (isEDA) + { + loopEnd = 6; + loopStart = 2; + searchPattern = "*.pdsf"; + rootDirectoryPath = string.Concat(@"\\", server, @"\EC_EDA"); + } + else if (isAPC) + { + loopEnd = 7; + loopStart = 6; + searchPattern = "*.pdsf"; + rootDirectoryPath = string.Concat(@"\\", server, @"\EC_APC"); + } + else + throw new Exception(); + string[] rootDirectories = Directory.GetDirectories(rootDirectoryPath, "*", SearchOption.TopDirectoryOnly); + foreach (string rootDirectory in rootDirectories) + { + if (_ShuttingDown) + break; + if (rootDirectory.Contains(@"\DEV")) + continue; + checkDirectory = string.Concat(rootDirectory, @"\Traces"); + if (!Directory.Exists(checkDirectory)) + continue; + equipmentTypeDirectories = Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly); + foreach (string equipmentTypeDirectory in equipmentTypeDirectories) + { + if (_ShuttingDown) + break; + equipmentType = Path.GetFileName(equipmentTypeDirectory); + if (!equipmentTypes.Contains(equipmentType)) + continue; + for (int i = loopStart; i < loopEnd; i++) + { + if (_ShuttingDown) + break; + checkDirectory = i switch + { + 1 => string.Concat(equipmentTypeDirectory, @"\Source"), + 2 => string.Concat(equipmentTypeDirectory, @"\Error"), + 3 => string.Concat(equipmentTypeDirectory, @"\Target"), + 4 => string.Concat(equipmentTypeDirectory, @"\BadPath"), + 5 => string.Concat(equipmentTypeDirectory, @"\PollPath"), + 6 => string.Concat(equipmentTypeDirectory, @"\ViewerPath"), + _ => throw new Exception(), + }; + if (!Directory.Exists(checkDirectory)) + continue; + pdsfFiles = Directory.GetFiles(checkDirectory, searchPattern, SearchOption.AllDirectories); + if (isAPC && !pdsfFiles.Any() && i == 6) + { + pdsfFileCollection.Clear(); + cellInstanceDirectories = Directory.GetDirectories(checkDirectory, "*", SearchOption.TopDirectoryOnly); + foreach (string cellInstanceDirectory in cellInstanceDirectories) + pdsfFileCollection.AddRange(Directory.GetFiles(cellInstanceDirectory, searchPattern, SearchOption.TopDirectoryOnly)); + pdsfFiles = pdsfFileCollection.ToArray(); + } + foreach (string pdsfFile in pdsfFiles) + { + if (_ShuttingDown) + break; + creationTime = new FileInfo(pdsfFile).CreationTime; + lastWriteTime = new FileInfo(pdsfFile).LastWriteTime; + isDuplicatorDirectory = Path.GetDirectoryName(pdsfFile) != checkDirectory && Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(pdsfFile))) == equipmentType; + if (creationTime < lastWriteTime) + dateTime = creationTime; + else + dateTime = lastWriteTime; + if (dateTime.Ticks < ticks) + { + if (inputLogistics.ContainsKey(pdsfFile)) + { + inputLogistics.Remove(pdsfFile); + continue; + } + } + else if (isDuplicatorDirectory) + continue; + else if (checkDirectory.Contains("PollPath") && dateTime.Ticks > pollPathTicks) + continue; + else if (!inputLogistics.ContainsKey(pdsfFile)) + { + pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(pdsfFile); + Logistics logistics = new Logistics(pdsfFile, pdsf.Item1); + if (!logistics.Logistics2.Any()) + logistics.Logistics2.Add(new Logistics2(string.Empty)); + key = Path.GetFileName(pdsfFile); + if (!inputPDSFFiles.ContainsKey(key)) + inputPDSFFiles.Add(key, pdsfFile); + else + { + foreach (KeyValuePair element in inputLogistics) + { + if (Path.GetFileName(element.Key) == key) + { + if (!File.Exists(element.Key)) + inputLogistics.Remove(element.Key); + } + } + } + inputLogistics.Add(pdsfFile, logistics); + } + } + } + } + } + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Singleton/IBackground.cs b/APC Viewer/Singleton/IBackground.cs new file mode 100644 index 0000000..683e234 --- /dev/null +++ b/APC Viewer/Singleton/IBackground.cs @@ -0,0 +1,35 @@ +using APCViewer.Models; +using Microsoft.Extensions.Logging; +using Shared; +using System; +using System.Collections.Generic; +using System.Net; + +namespace APCViewer.Singleton +{ + + public interface IBackground : Models.IBackground, IDisposable + { + + void ClearMessage(); + void SendStatusOk(); + void LogisticsClear(); + string Message { get; } + IsEnvironment IsEnvironment { get; } + bool IsPrimaryInstance(); + void SetIsPrimaryInstance(); + WebClient WebClient { get; } + void ClearIsPrimaryInstance(); + AppSettings AppSettings { get; } + string GetPDSF(long Sequence); + string GetIPDSF(long Sequence); + string WorkingDirectory { get; } + List Exceptions { get; } + string GetCountDirectory(string verb); + void Update(ILogger logger, WebClient webClient); + Tuple, List> GetTimePivot(bool isGaN = false, bool isSi = false); + Tuple SetViewBag(string directory, string filter, bool isGaN = false, bool isSi = false, bool forPDSF = false, bool forIPDSF = false); + + } + +} \ No newline at end of file diff --git a/APC Viewer/Startup.cs b/APC Viewer/Startup.cs new file mode 100644 index 0000000..55ea4e9 --- /dev/null +++ b/APC Viewer/Startup.cs @@ -0,0 +1,166 @@ +using APCViewer.HostedService; +using APCViewer.Models; +using APCViewer.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 APCViewer +{ + + public class Startup + { + + private Background _Background; + private readonly IsEnvironment _IsEnvironment; + private readonly IConfiguration _Configuration; + private readonly IWebHostEnvironment _WebHostEnvironment; + + public Startup(IConfiguration configuration, IWebHostEnvironment webHostEnvironment) + { + _Configuration = configuration; + _WebHostEnvironment = webHostEnvironment; + if (!(configuration is ConfigurationRoot configurationRoot)) + _IsEnvironment = new IsEnvironment(webHostEnvironment.IsDevelopment(), webHostEnvironment.IsStaging(), webHostEnvironment.IsProduction()); + else + { + foreach (IConfigurationProvider provider in configurationRoot.Providers) + { + if (!(provider is JsonConfigurationProvider jsonConfigurationProvider)) + continue; + if (jsonConfigurationProvider.Source.Optional) + continue; + _IsEnvironment = new IsEnvironment(jsonConfigurationProvider.Source.Path); + } + } + } + + // 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(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(configurationSection.Value, out log4netLogLevel)) + log4netLogLevel = defaultLogLevel; + Assembly assembly = Assembly.GetExecutingAssembly(); + string workingDirectory = Log.GetWorkingDirectory(assembly.GetName().Name, "IFXApps"); + 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(); + services.AddSingleton(); + + _Background = new Background(_IsEnvironment, _Configuration, workingDirectory); + services.AddSingleton(b => _Background); + services.AddHostedService(t => new TimedHostedService(_Background, _Configuration, t.GetRequiredService())); + + services.AddSwaggerGen(c => + { + c.SwaggerDoc("v1", new OpenApiInfo { Title = "APCViewer", 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(_Background.Storage.UrlRoot)) + { + Environment.ExitCode = -1; + lifetime.StopApplication(); + } + + app.UseDeveloperExceptionPage(); + + app.UseSwagger(c => + { + c.SerializeAsV2 = true; + }); + + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "APC 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("/APCViewer/swagger/v1/swagger.json", "APC 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?}"); + }); + + app.UseDirectoryBrowser(new DirectoryBrowserOptions + { + FileProvider = new PhysicalFileProvider(Path.Combine(env.WebRootPath, "images")), + RequestPath = "/MyImages" + }); + } + + } + +} \ No newline at end of file diff --git a/APC Viewer/Views/Home/Background.cshtml b/APC Viewer/Views/Home/Background.cshtml new file mode 100644 index 0000000..eeb033a --- /dev/null +++ b/APC Viewer/Views/Home/Background.cshtml @@ -0,0 +1,47 @@ +@using APCViewer.Controllers +@{ + ViewBag.Title = "Background"; + int i = 0; + string homeController = nameof(HomeController).Replace("Controller", string.Empty); +} + +
+

APC - @(ViewBag.IsPrimaryInstance) - @(ViewBag.Profile) - @(ViewBag.URLs) - 013

+

@(ViewBag.WorkingDirectory)

+

@(ViewBag.Message)

+

@(ViewBag.ExceptionsCount)

+
+ +

 

+
+
+
+ @foreach (Exception exception in ViewBag.Exceptions) + { +

+ @Html.Raw(string.Concat("")); +

+

+ @Html.Raw(string.Concat("")); +

+
+ @(i += 1); + } +
+
+@section scripts { + +} diff --git a/APC Viewer/Views/Home/Directory.cshtml b/APC Viewer/Views/Home/Directory.cshtml new file mode 100644 index 0000000..ab38d11 --- /dev/null +++ b/APC Viewer/Views/Home/Directory.cshtml @@ -0,0 +1,69 @@ +@{ + ViewBag.Title = "PDSF"; + Dictionary>> _KeyValuePairs = ViewBag.Grouped; + List> _Tuples = ViewBag.Sorted; +} +

@(ViewBag.Files) File(s)

+ +

+ + + + + + + + + + + @foreach (var item in _Tuples) + { + + + + + + + + + + } +
EnvironmentEquipment TypeSequenceReactorRDSPart NumberDate
@item.Item1[0]@item.Item1[1]@item.Item2.Sequence@item.Item2.ProcessJobID@item.Item2.MID@item.Item2.Logistics2[0].PartNumber@item.Item2.DateTimeFromSequence
+


+ + + + + + + + + + + @foreach (var element in _KeyValuePairs) + { + foreach (var innerElement in element.Value) + { + foreach (var item in innerElement.Value) + { + + + + + + + + + + } + } + } +
EnvironmentEquipment TypeSequenceReactorRDSPart NumberDate
@element.Key@innerElement.Key@item.Sequence@item.ProcessJobID@item.MID@item.Logistics2[0].PartNumber@item.DateTimeFromSequence
+

+@section scripts { + +} \ No newline at end of file diff --git a/APC Viewer/Views/Home/IPDSF.cshtml b/APC Viewer/Views/Home/IPDSF.cshtml new file mode 100644 index 0000000..fc5a2bb --- /dev/null +++ b/APC Viewer/Views/Home/IPDSF.cshtml @@ -0,0 +1,91 @@ +@{ + string viewLink; + string downloadLink; + ViewBag.Title = "IPDSF"; + string _Directory = ViewBag.Directory; + List> _Tuples = ViewBag.Sorted; + Dictionary>> _KeyValuePairs = ViewBag.Grouped; +} +

@(ViewBag.Files) File(s)

+ +

+ + + + + + + + + + + + @foreach (var item in _Tuples) + { + if (!string.IsNullOrEmpty(_Directory) && item.Item2.ReportFullPath.Contains(_Directory)) + { + viewLink = string.Concat("~/Home/ViewCustomIPDSF/?ipdsf_file=", Html.Encode(item.Item2.ReportFullPath)); + downloadLink = string.Concat("~/Home/DownloadCustomIPDSF/?ipdsf_file=", Html.Encode(item.Item2.ReportFullPath)); + } + else + { + viewLink = string.Concat("~/Home/ViewIPDSF/sequence_", item.Item2.Sequence); + downloadLink = string.Concat("~/Home/DownloadIPDSF/sequence_", item.Item2.Sequence); + } + + + + + + + + + + + } +
Technology - EnvironmentEquipment TypeSequenceReactorRDSPart NumberFile NameDate
@item.Item1[0]@item.Item1[1]@item.Item2.Sequence@item.Item2.ProcessJobID@item.Item2.MID@item.Item2.Logistics2[0].PartNumber@System.IO.Path.GetFileNameWithoutExtension(item.Item2.ReportFullPath)@item.Item2.DateTimeFromSequence
+ @if (string.IsNullOrEmpty(_Directory)) + { +


+ + + + + + + + + + + + @foreach (var element in _KeyValuePairs) + { + foreach (var innerElement in element.Value) + { + foreach (var item in innerElement.Value) + { + viewLink = string.Concat("~/Home/ViewIPDSF/sequence_", item.Sequence); + downloadLink = string.Concat("~/Home/DownloadIPDSF/sequence_", item.Sequence); + + + + + + + + + + + } + } + } +
Technology - EnvironmentEquipment TypeSequenceReactorRDSPart NumberFile NameDate
@element.Key@innerElement.Key@item.Sequence@item.ProcessJobID@item.MID@item.Logistics2[0].PartNumber@System.IO.Path.GetFileNameWithoutExtension(item.ReportFullPath)@item.DateTimeFromSequence
+ } +

+@section scripts { + +} \ No newline at end of file diff --git a/APC Viewer/Views/Home/Index.cshtml b/APC Viewer/Views/Home/Index.cshtml new file mode 100644 index 0000000..043da2b --- /dev/null +++ b/APC Viewer/Views/Home/Index.cshtml @@ -0,0 +1,12 @@ +@{ + ViewData["Title"] = "Home Page"; +} + +
+

Welcome

+

Learn about building Web apps with ASP.NET Core.

+
+ +
+ +
diff --git a/APC Viewer/Views/Home/PDSF.cshtml b/APC Viewer/Views/Home/PDSF.cshtml new file mode 100644 index 0000000..81d0ef8 --- /dev/null +++ b/APC Viewer/Views/Home/PDSF.cshtml @@ -0,0 +1,91 @@ +@{ + string viewLink; + string downloadLink; + ViewBag.Title = "PDSF"; + string _Directory = ViewBag.Directory; + List> _Tuples = ViewBag.Sorted; + Dictionary>> _KeyValuePairs = ViewBag.Grouped; +} +

@(ViewBag.Files) File(s)

+ +

+ + + + + + + + + + + + @foreach (var item in _Tuples) + { + if (!string.IsNullOrEmpty(_Directory) && item.Item2.ReportFullPath.Contains(_Directory)) + { + viewLink = string.Concat("~/Home/ViewCustomPDSF/?pdsf_file=", Html.Encode(item.Item2.ReportFullPath)); + downloadLink = string.Concat("~/Home/DownloadCustomPDSF/?pdsf_file=", Html.Encode(item.Item2.ReportFullPath)); + } + else + { + viewLink = string.Concat("~/Home/ViewPDSF/sequence_", item.Item2.Sequence); + downloadLink = string.Concat("~/Home/DownloadPDSF/sequence_", item.Item2.Sequence); + } + + + + + + + + + + + } +
Technology - EnvironmentEquipment TypeSequenceReactorRDSPart NumberFile NameDate
@item.Item1[0]@item.Item1[1]@item.Item2.Sequence@item.Item2.ProcessJobID@item.Item2.MID@item.Item2.Logistics2[0].PartNumber@System.IO.Path.GetFileNameWithoutExtension(item.Item2.ReportFullPath)@item.Item2.DateTimeFromSequence
+ @if (string.IsNullOrEmpty(_Directory)) + { +


+ + + + + + + + + + + + @foreach (var element in _KeyValuePairs) + { + foreach (var innerElement in element.Value) + { + foreach (var item in innerElement.Value) + { + viewLink = string.Concat("~/Home/ViewPDSF/sequence_", item.Sequence); + downloadLink = string.Concat("~/Home/DownloadPDSF/sequence_", item.Sequence); + + + + + + + + + + + } + } + } +
Technology - EnvironmentEquipment TypeSequenceReactorRDSPart NumberFile NameDate
@element.Key@innerElement.Key@item.Sequence@item.ProcessJobID@item.MID@item.Logistics2[0].PartNumber@System.IO.Path.GetFileNameWithoutExtension(item.ReportFullPath)@item.DateTimeFromSequence
+ } +

+@section scripts { + +} \ No newline at end of file diff --git a/APC Viewer/Views/Home/Privacy.cshtml b/APC Viewer/Views/Home/Privacy.cshtml new file mode 100644 index 0000000..d01477f --- /dev/null +++ b/APC Viewer/Views/Home/Privacy.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Privacy Policy"; +} +

@ViewData["Title"]

+ +

Use this page to detail your site's privacy policy.

diff --git a/APC Viewer/Views/Home/TimePivot.cshtml b/APC Viewer/Views/Home/TimePivot.cshtml new file mode 100644 index 0000000..0a8c07f --- /dev/null +++ b/APC Viewer/Views/Home/TimePivot.cshtml @@ -0,0 +1,37 @@ +@{ + ViewBag.Title = "TimePivot"; + List forIPDSF = ViewBag.forIPDSF; + List forPDSF = ViewBag.forPDSF; +} +

*.ipdsf

+ + @foreach (var segments in forIPDSF) + { + + @for (int i = 0; i < segments.Length; i++) + { + + } + + } +
@(segments[i])
+
+

*.pdsf

+ + @foreach (var segments in forPDSF) + { + + @for (int i = 0; i < segments.Length; i++) + { + + } + + } +
@(segments[i])
+@section scripts { + +} \ No newline at end of file diff --git a/APC Viewer/Views/Shared/Error.cshtml b/APC Viewer/Views/Shared/Error.cshtml new file mode 100644 index 0000000..0c47bb0 --- /dev/null +++ b/APC Viewer/Views/Shared/Error.cshtml @@ -0,0 +1,25 @@ +@model ErrorViewModel +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

+ +@if (Model.ShowRequestId) +{ +

+ Request ID: @Model.RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

diff --git a/APC Viewer/Views/Shared/_Layout.cshtml b/APC Viewer/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..2ed79bc --- /dev/null +++ b/APC Viewer/Views/Shared/_Layout.cshtml @@ -0,0 +1,92 @@ +@using APCViewer.Controllers +@{ + string pdsf = nameof(HomeController.PDSF); + string index = nameof(HomeController.Index); + string ipdsf = nameof(HomeController.IPDSF); + string privacy = nameof(HomeController.Privacy); + string timePivot = nameof(HomeController.TimePivot); + string background = nameof(HomeController.Background); + string homeController = nameof(HomeController).Replace("Controller", string.Empty); + string schemeHostURL = string.Concat(Context.Request.Scheme, "://", Context.Request.Host); +} + + + + + + + + @await RenderSectionAsync("Meta", required: false) + @ViewData["Title"] - APCViewer + + + + + + + + + + + @await RenderSectionAsync("Style", required: false) + + + + +
+ +
+
+ @RenderBody() +
+
+
+ © 2021 - APCViewer - Privacy +
+
+ + + + + @await RenderSectionAsync("Scripts", required: false) + + diff --git a/APC Viewer/Views/Shared/_ValidationScriptsPartial.cshtml b/APC Viewer/Views/Shared/_ValidationScriptsPartial.cshtml new file mode 100644 index 0000000..7d8dd3e --- /dev/null +++ b/APC Viewer/Views/Shared/_ValidationScriptsPartial.cshtml @@ -0,0 +1,2 @@ + + diff --git a/APC Viewer/Views/_ViewImports.cshtml b/APC Viewer/Views/_ViewImports.cshtml new file mode 100644 index 0000000..71dc13e --- /dev/null +++ b/APC Viewer/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using APCViewer +@using APCViewer.Models +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/APC Viewer/Views/_ViewStart.cshtml b/APC Viewer/Views/_ViewStart.cshtml new file mode 100644 index 0000000..820a2f6 --- /dev/null +++ b/APC Viewer/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/APC-Viewer.sln b/APC-Viewer.sln new file mode 100644 index 0000000..7e8909d --- /dev/null +++ b/APC-Viewer.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30114.105 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APC Viewer", "APC Viewer\APC Viewer.csproj", "{7557A33D-4DCE-406C-9E62-2EE0B743CFBA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APC Viewer.Tests", "APC Viewer.Tests\APC Viewer.Tests.csproj", "{1AD19A02-D271-4074-8870-46000DA5E964}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7557A33D-4DCE-406C-9E62-2EE0B743CFBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7557A33D-4DCE-406C-9E62-2EE0B743CFBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7557A33D-4DCE-406C-9E62-2EE0B743CFBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7557A33D-4DCE-406C-9E62-2EE0B743CFBA}.Release|Any CPU.Build.0 = Release|Any CPU + {1AD19A02-D271-4074-8870-46000DA5E964}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1AD19A02-D271-4074-8870-46000DA5E964}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1AD19A02-D271-4074-8870-46000DA5E964}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1AD19A02-D271-4074-8870-46000DA5E964}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/README.md b/README.md index 0ca446a..7b4388d 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # Introduction -TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project. +APC Viewer # Getting Started -TODO: Guide users through getting your code up and running on their own system. In this section you can talk about: -1. Installation process -2. Software dependencies -3. Latest releases -4. API references +1. dotnet core - APC Viewer.csproj +2. dotnet core - Adaptation\APC Viewer.Tests.csproj +3. https://tfs.intra.infineon.com/tfs/ManufacturingIT/_packaging/eaf/nuget/v3/index.json +4. https://packagemanagement.eu.infineon.com:4430/packages # Build and Test -TODO: Describe and show how to build your code and run the tests. +See Adaptation\_Tests for dotnet core tests -# Contribute -TODO: Explain how other users and developers can contribute to make your code better. +# TFS +$/Mesa_FI/APC Viewer -If you want to learn more about creating good readme files then refer the following [guidelines](https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops). You can also seek inspiration from the below readme files: -- [ASP.NET Core](https://github.com/aspnet/Home) -- [Visual Studio Code](https://github.com/Microsoft/vscode) -- [Chakra Core](https://github.com/Microsoft/ChakraCore) \ No newline at end of file +# Last TFS Changeset +303361 Phares Mike (IFAM IT FI MES) 2/1/2022 7:48:23 PM APC Viewer - Move solution for Azure DevOps git + +# Git +git@tfs.intra.infineon.com:22/tfs/ManufacturingIT/Mesa_FI/_git/APC-Viewer diff --git a/package.json b/package.json new file mode 100644 index 0000000..8247f48 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "build": "dotnet build --runtime win-x64 --self-contained", + "dotnet-format": "dotnet format --report .vscode --verbosity detailed --severity error", + "pull": "git pull", + "garbage-collect": "git gc" + } +} \ No newline at end of file