diff --git a/.gitignore b/.gitignore index 1fcd98b..c3c2046 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,9 @@ ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +Source/TestStand/Sequences/**/Report +Source/_Deployment Source/HalTempFolder -Source/TestStand/Reports Source/Nuget/cache/ Source/Nuget/SolutionPackages/* !Source/Nuget/SolutionPackages/readme.txt @@ -370,4 +371,4 @@ MigrationBackup/ # Fody - auto-generated XML schema FodyWeavers.xsd -!**/HAL/Implementations/BIT/COEComm/build/** \ No newline at end of file +!**/TSRealLib/Common/Raytheon.Common/COE/Dependecies/** \ No newline at end of file diff --git a/Source/.editorconfig b/Source/.editorconfig new file mode 100644 index 0000000..375a844 --- /dev/null +++ b/Source/.editorconfig @@ -0,0 +1,268 @@ +# 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 = 2 +indent_style = space +tab_width = 2 + +# New line preferences +end_of_line = crlf +insert_final_newline = false + +#### .NET Code Actions #### + +# Type members +dotnet_hide_advanced_members = false +dotnet_member_insertion_location = with_other_members_of_the_same_kind +dotnet_property_generation_behavior = prefer_throwing_properties + +# Symbol search +dotnet_search_reference_assemblies = true + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false +dotnet_style_qualification_for_field = false +dotnet_style_qualification_for_method = false +dotnet_style_qualification_for_property = false + +# 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_prefer_system_hash_code = true +dotnet_style_coalesce_expression = true +dotnet_style_collection_initializer = true +dotnet_style_explicit_tuple_names = true +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true +dotnet_style_object_initializer = true +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true +dotnet_style_prefer_collection_expression = when_types_loosely_match +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = true +dotnet_style_prefer_conditional_expression_over_return = true +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true +dotnet_style_prefer_simplified_boolean_expressions = true +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true + +# Parameter preferences +dotnet_code_quality_unused_parameters = all + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +# New line preferences +dotnet_style_allow_multiple_blank_lines_experimental = true +dotnet_style_allow_statement_immediately_after_block_experimental = true + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = false +csharp_style_var_for_built_in_types = false +csharp_style_var_when_type_is_apparent = false + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true +csharp_style_pattern_matching_over_is_with_cast_check = true +csharp_style_prefer_extended_property_pattern = true +csharp_style_prefer_not_pattern = true +csharp_style_prefer_pattern_matching = true +csharp_style_prefer_switch_expression = true + +# Null-checking preferences +csharp_style_conditional_delegate_call = true + +# Modifier preferences +csharp_prefer_static_anonymous_function = true +csharp_prefer_static_local_function = true +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async +csharp_style_prefer_readonly_struct = true +csharp_style_prefer_readonly_struct_member = true + +# Code-block preferences +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_system_threading_lock = true:suggestion +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_prefer_top_level_statements = true:silent + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_deconstructed_variable_declaration = true +csharp_style_implicit_object_creation_when_type_is_apparent = true +csharp_style_inlined_variable_declaration = true +csharp_style_prefer_implicitly_typed_lambda_expression = true +csharp_style_prefer_index_operator = true +csharp_style_prefer_local_over_anonymous_function = true +csharp_style_prefer_null_check_over_type_check = true:suggestion +csharp_style_prefer_range_operator = true +csharp_style_prefer_tuple_swap = true +csharp_style_prefer_unbound_generic_type_in_nameof = true +csharp_style_prefer_utf8_string_literals = true +csharp_style_throw_expression = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable +csharp_style_unused_value_expression_statement_preference = discard_variable + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +# New line preferences +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true +csharp_style_allow_blank_line_after_token_in_conditional_expression_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 = true + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +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 = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +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.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.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 + +[*.{cs,vb}] +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 3 +indent_size = 3 +end_of_line = crlf +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_collection_expression = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_namespace_match_folder = true:suggestion \ No newline at end of file diff --git a/Source/Documentation/NGSRI MTS TE Setup.pdf b/Source/Documentation/NGSRI MTS TE Setup.pdf new file mode 100644 index 0000000..4dc84e7 Binary files /dev/null and b/Source/Documentation/NGSRI MTS TE Setup.pdf differ diff --git a/Source/Documentation/Test Center CSharp Coding Standards.docx b/Source/Documentation/Test Center CSharp Coding Standards.docx new file mode 100644 index 0000000..55c4315 Binary files /dev/null and b/Source/Documentation/Test Center CSharp Coding Standards.docx differ diff --git a/Source/Nuget/NugetOrg/microsoft.xaml.behaviors.wpf.1.1.135.nupkg b/Source/Nuget/NugetOrg/microsoft.xaml.behaviors.wpf.1.1.135.nupkg new file mode 100644 index 0000000..24c5624 Binary files /dev/null and b/Source/Nuget/NugetOrg/microsoft.xaml.behaviors.wpf.1.1.135.nupkg differ diff --git a/Source/Program.sln b/Source/Program.sln index 4441917..70d17e0 100644 --- a/Source/Program.sln +++ b/Source/Program.sln @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TSRealLib", "TSRealLib", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_1_Solution_Items", "_1_Solution_Items", "{F05B61B8-F842-4D7B-B1FB-FD7838AFA0C3}" ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig nuget.config = nuget.config readme.txt = readme.txt Solution.props = Solution.props @@ -63,10 +64,12 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raytheon.Instruments.Implementation", "TSRealLib\HAL\ImplementationMaster\Raytheon.Instruments.Implementation\Raytheon.Instruments.Implementation.csproj", "{B8C9F396-089A-4280-A26D-57A3472B717D}" ProjectSection(ProjectDependencies) = postProject {02E3B946-989E-4B21-AA73-1C94E869D1DA} = {02E3B946-989E-4B21-AA73-1C94E869D1DA} + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824} = {0A62EF72-0CCA-4FE1-A215-A715AC5BA824} {0AFD4A07-0D47-460A-84AA-4E2968B8FC74} = {0AFD4A07-0D47-460A-84AA-4E2968B8FC74} - {0E3AAF01-A095-48A8-9C03-78B56D01EDC0} = {0E3AAF01-A095-48A8-9C03-78B56D01EDC0} + {0E666045-9D4C-4201-B223-43CE214207DF} = {0E666045-9D4C-4201-B223-43CE214207DF} {0E74A4AC-BE82-4081-812B-30140DA44A34} = {0E74A4AC-BE82-4081-812B-30140DA44A34} {0EB1E967-572F-4529-A692-0D4DA35C9A91} = {0EB1E967-572F-4529-A692-0D4DA35C9A91} + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008} = {0F8C0C49-34FD-4446-B0B5-C28F6D58A008} {17AEB6D6-A495-438B-A718-F2DE2B129A69} = {17AEB6D6-A495-438B-A718-F2DE2B129A69} {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D} = {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D} {294755E1-B1FC-4A3D-935A-822244DBBBD4} = {294755E1-B1FC-4A3D-935A-822244DBBBD4} @@ -85,7 +88,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raytheon.Instruments.Implem {62EDDCCC-9E4A-487C-A868-F5610AC81765} = {62EDDCCC-9E4A-487C-A868-F5610AC81765} {636D154F-827B-4116-806B-93FB79AF15AD} = {636D154F-827B-4116-806B-93FB79AF15AD} {697D54AD-03CE-48F5-9EA5-C48ECC158E1D} = {697D54AD-03CE-48F5-9EA5-C48ECC158E1D} - {6AA94144-9108-4620-85ED-869BFE729303} = {6AA94144-9108-4620-85ED-869BFE729303} {6CB5F73E-1DAF-4764-B85B-3007A08FADDB} = {6CB5F73E-1DAF-4764-B85B-3007A08FADDB} {6D332C2E-5CF3-4BFF-9D8F-D256E574033B} = {6D332C2E-5CF3-4BFF-9D8F-D256E574033B} {6F66D13A-2347-4186-A98E-ADE59B7552ED} = {6F66D13A-2347-4186-A98E-ADE59B7552ED} @@ -94,13 +96,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raytheon.Instruments.Implem {789A1184-DCBB-4CD1-BD0D-A136B0601631} = {789A1184-DCBB-4CD1-BD0D-A136B0601631} {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06} = {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06} {80E2A78C-7515-45E3-93EB-2EAD660495A3} = {80E2A78C-7515-45E3-93EB-2EAD660495A3} - {88D00E0D-1FF5-410B-9C11-17CC98BFD3BE} = {88D00E0D-1FF5-410B-9C11-17CC98BFD3BE} {8EB251DC-80E5-4334-A869-DC96929418CE} = {8EB251DC-80E5-4334-A869-DC96929418CE} {8EC8E495-4B07-4B69-A22A-4F18F19197EC} = {8EC8E495-4B07-4B69-A22A-4F18F19197EC} {9FE0FC5C-D97F-4127-8607-C420138301AB} = {9FE0FC5C-D97F-4127-8607-C420138301AB} {A330F9A5-061F-44A2-B87E-FD2E3A65716D} = {A330F9A5-061F-44A2-B87E-FD2E3A65716D} {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74} = {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74} {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90} = {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90} + {ACDE147D-DEB7-4770-BA09-B1605DF15716} = {ACDE147D-DEB7-4770-BA09-B1605DF15716} {C4D5E27E-6130-44E9-B756-1F320F15431E} = {C4D5E27E-6130-44E9-B756-1F320F15431E} {C638A7CA-5E7D-4D08-9913-EB47352B788C} = {C638A7CA-5E7D-4D08-9913-EB47352B788C} {C77DFB22-DCCD-40F9-A822-8115FDFA35C5} = {C77DFB22-DCCD-40F9-A822-8115FDFA35C5} @@ -110,6 +112,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raytheon.Instruments.Implem {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A} = {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A} {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF} = {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF} {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340} = {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340} + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5} = {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5} {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D} = {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D} {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D} = {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D} EndProjectSection @@ -122,13 +125,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DIOSiUSBXp", "TSRealLib\HAL EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DIOTeradyneEDigital6020A", "TSRealLib\HAL\Implementations\DIO\DIOTeradyneEDigital6020A\DIOTeradyneEDigital6020A.csproj", "{168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BIT", "BIT", "{197DBD10-4BFC-455B-A20C-74C56BF50114}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "COEComm", "TSRealLib\HAL\Implementations\BIT\COEComm\COEComm.csproj", "{88D00E0D-1FF5-410B-9C11-17CC98BFD3BE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BITCOEDeviceNode", "TSRealLib\HAL\Implementations\BIT\BITCOEDeviceNode\BITCOEDeviceNode.csproj", "{0E3AAF01-A095-48A8-9C03-78B56D01EDC0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "COECommDevice", "TSRealLib\HAL\Implementations\BIT\COECommDevice\COECommDevice.csproj", "{6AA94144-9108-4620-85ED-869BFE729303}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "COE", "COE", "{197DBD10-4BFC-455B-A20C-74C56BF50114}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Chiller", "Chiller", "{4120F08F-0461-406D-88A4-B31E0984F2F4}" EndProject @@ -196,7 +193,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FpgaSim", "TSRealLib\HAL\Im EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomAsciiSerial", "TSRealLib\HAL\Implementations\FPGA\CustomAsciiSerial\CustomAsciiSerial.csproj", "{02E3B946-989E-4B21-AA73-1C94E869D1DA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ethernet", "TSRealLib\HAL\Implementations\FPGA\Ethernet\Ethernet.csproj", "{FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FpgaEthernet", "TSRealLib\HAL\Implementations\FPGA\Ethernet\FpgaEthernet.csproj", "{FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FpgaHssubChassisSs", "TSRealLib\HAL\Implementations\FPGA\FpgaHssubChassisSs\FpgaHssubChassisSs.csproj", "{6CB5F73E-1DAF-4764-B85B-3007A08FADDB}" EndProject @@ -294,8 +291,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VideoRecorderSim", "TSRealL EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VideoRecorderVrsClient", "TSRealLib\HAL\Implementations\VideoRecorder\VideoRecorderVrsClient\VideoRecorderVrsClient.csproj", "{6D332C2E-5CF3-4BFF-9D8F-D256E574033B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitGenSoftMeasurementManager", "TSRealLib\MAL\Managers\BitGenSoftMeasurementManager\BitGenSoftMeasurementManager.csproj", "{75DE8955-BA8B-49F5-9FD2-4797EE418C3E}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ManagerMaster", "ManagerMaster", "{9FF47FE0-9E1B-482D-B15C-AA714D9266A6}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BitMeasurementManager", "TSRealLib\MAL\Managers\BitMeasurementManager\BitMeasurementManager.csproj", "{9B2CD357-F5BF-4620-A30D-1E64493C4727}" @@ -328,8 +323,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpticalBenchMeasurementMana EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TelemetryMeasurementManager", "TSRealLib\MAL\Managers\TelemetryMeasurementManager\TelemetryMeasurementManager.csproj", "{0FDC7C29-F359-41E2-B069-0B64A59CE1BD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBit", "TSRealLib\HAL\Interfaces\IBit\IBit.csproj", "{20802E22-C010-4F99-8A75-2904B5EC2FBF}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IChiller", "TSRealLib\HAL\Interfaces\IChiller\IChiller.csproj", "{CF288338-4B3F-4913-BD0E-9A741CED3023}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IFlowMeter", "TSRealLib\HAL\Interfaces\IFlowMeter\IFlowMeter.csproj", "{BB1C6133-FE01-40EA-9DB5-D5B8210F501B}" @@ -362,751 +355,1475 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerSupplyMeasurementManag EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Program", "Program\Program.csproj", "{FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DucLib", "DucLib", "{F20B097A-6283-426E-A9B5-D71E498E4A78}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SwitchMatrixPickering40x", "TSRealLib\HAL\Implementations\Switch\SwitchMatrixPickering40x\SwitchMatrixPickering40x.csproj", "{0A62EF72-0CCA-4FE1-A215-A715AC5BA824}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpClient", "DucLib\TcpClient\TcpClient.csproj", "{4D2E2A24-9FD4-49C9-8448-F7006ED790B8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProgramPostBuild", "ProgramPostBuild\ProgramPostBuild.csproj", "{7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}" + ProjectSection(ProjectDependencies) = postProject + {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A} = {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A} + EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeysightN67XX", "DucLib\PowerSupplies\Keysight67XX\KeysightN67XX.csproj", "{CCD1C6AA-2C4E-40E1-8233-20875B5833D3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SwitchMultiplexerPickering60x", "TSRealLib\HAL\Implementations\Switch\SwitchMultiplexerPickering60x\SwitchMultiplexerPickering60x.csproj", "{F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerSupplySim", "DucLib\PowerSupplies\PowerSupplySim\PowerSupplySim.csproj", "{059FF15F-D78A-4727-BA84-16836EB9F2DF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DIOIcs8003", "TSRealLib\HAL\Implementations\DIO\DIOIcs8003\DIOIcs8003.csproj", "{ACDE147D-DEB7-4770-BA09-B1605DF15716}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerSupplyBasic", "DucLib\PowerSupplies\PowerSupplyBasic\PowerSupplyBasic.csproj", "{675101BD-867F-4268-838B-F1E673B9007A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommDeviceSerial", "TSRealLib\HAL\Implementations\CommDevice\CommDeviceSerial\CommDeviceSerial.csproj", "{0F8C0C49-34FD-4446-B0B5-C28F6D58A008}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PowerSupplies", "PowerSupplies", "{C2277D2F-C982-420A-AD8D-82452A83793B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoeCommDevice", "TSRealLib\HAL\Implementations\COE\CoeCommDevice\CoeCommDevice.csproj", "{0E666045-9D4C-4201-B223-43CE214207DF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoeMeasurementManager", "TSRealLib\MAL\Managers\CoeMeasurementManager\CoeMeasurementManager.csproj", "{11CB72C0-B53B-4611-83AF-B6CA62B4EC05}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoeComm", "TSRealLib\HAL\Interfaces\ICoeComm\CoeComm.csproj", "{D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 Deploy|Any CPU = Deploy|Any CPU + Deploy|x86 = Deploy|x86 Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9425542E-2602-4043-8583-1378BD959589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9425542E-2602-4043-8583-1378BD959589}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9425542E-2602-4043-8583-1378BD959589}.Debug|x86.ActiveCfg = Debug|Any CPU + {9425542E-2602-4043-8583-1378BD959589}.Debug|x86.Build.0 = Debug|Any CPU {9425542E-2602-4043-8583-1378BD959589}.Deploy|Any CPU.ActiveCfg = Debug|Any CPU {9425542E-2602-4043-8583-1378BD959589}.Deploy|Any CPU.Build.0 = Debug|Any CPU + {9425542E-2602-4043-8583-1378BD959589}.Deploy|x86.ActiveCfg = Debug|Any CPU + {9425542E-2602-4043-8583-1378BD959589}.Deploy|x86.Build.0 = Debug|Any CPU {9425542E-2602-4043-8583-1378BD959589}.Release|Any CPU.ActiveCfg = Release|Any CPU {9425542E-2602-4043-8583-1378BD959589}.Release|Any CPU.Build.0 = Release|Any CPU + {9425542E-2602-4043-8583-1378BD959589}.Release|x86.ActiveCfg = Release|Any CPU + {9425542E-2602-4043-8583-1378BD959589}.Release|x86.Build.0 = Release|Any CPU {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Debug|x86.ActiveCfg = Debug|Any CPU + {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Debug|x86.Build.0 = Debug|Any CPU {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Deploy|x86.Build.0 = Deploy|Any CPU {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Release|Any CPU.ActiveCfg = Release|Any CPU {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Release|Any CPU.Build.0 = Release|Any CPU + {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Release|x86.ActiveCfg = Release|Any CPU + {1E41B47E-5728-43E5-8DD6-97323FAEEC91}.Release|x86.Build.0 = Release|Any CPU {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Debug|x86.ActiveCfg = Debug|Any CPU + {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Debug|x86.Build.0 = Debug|Any CPU {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Deploy|x86.Build.0 = Deploy|Any CPU {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Release|Any CPU.ActiveCfg = Release|Any CPU {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Release|Any CPU.Build.0 = Release|Any CPU + {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Release|x86.ActiveCfg = Release|Any CPU + {B3B62B44-DC3F-4253-8EDB-BBAF16FDD508}.Release|x86.Build.0 = Release|Any CPU {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Debug|x86.ActiveCfg = Debug|Any CPU + {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Debug|x86.Build.0 = Debug|Any CPU {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Deploy|x86.Build.0 = Deploy|Any CPU {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Release|Any CPU.ActiveCfg = Release|Any CPU {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Release|Any CPU.Build.0 = Release|Any CPU + {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Release|x86.ActiveCfg = Release|Any CPU + {5F23BE1B-4E28-415A-8ECA-244DA0D020C5}.Release|x86.Build.0 = Release|Any CPU {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Debug|x86.ActiveCfg = Debug|Any CPU + {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Debug|x86.Build.0 = Debug|Any CPU {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Deploy|x86.Build.0 = Deploy|Any CPU {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Release|Any CPU.ActiveCfg = Release|Any CPU {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Release|Any CPU.Build.0 = Release|Any CPU + {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Release|x86.ActiveCfg = Release|Any CPU + {AC45C05E-41E4-4B21-8CB0-5342F0AB97A4}.Release|x86.Build.0 = Release|Any CPU {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Debug|x86.ActiveCfg = Debug|Any CPU + {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Debug|x86.Build.0 = Debug|Any CPU {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Deploy|x86.Build.0 = Deploy|Any CPU {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Release|Any CPU.ActiveCfg = Release|Any CPU {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Release|Any CPU.Build.0 = Release|Any CPU + {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Release|x86.ActiveCfg = Release|Any CPU + {3EE46DBC-DFDF-4B2F-A946-486FE1EA5EF6}.Release|x86.Build.0 = Release|Any CPU {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Debug|x86.ActiveCfg = Debug|Any CPU + {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Debug|x86.Build.0 = Debug|Any CPU {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Deploy|x86.Build.0 = Deploy|Any CPU {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Release|Any CPU.ActiveCfg = Release|Any CPU {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Release|Any CPU.Build.0 = Release|Any CPU + {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Release|x86.ActiveCfg = Release|Any CPU + {0663A37A-7C4C-4D9C-8B88-CF574E2D28B2}.Release|x86.Build.0 = Release|Any CPU {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Debug|x86.ActiveCfg = Debug|Any CPU + {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Debug|x86.Build.0 = Debug|Any CPU {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Deploy|x86.Build.0 = Deploy|Any CPU {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Release|Any CPU.ActiveCfg = Release|Any CPU {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Release|Any CPU.Build.0 = Release|Any CPU + {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Release|x86.ActiveCfg = Release|Any CPU + {6FBB254A-EBF5-4BBE-B394-3150F84CB39D}.Release|x86.Build.0 = Release|Any CPU {D2E67674-00FA-463F-A184-93C8EA27F654}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D2E67674-00FA-463F-A184-93C8EA27F654}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D2E67674-00FA-463F-A184-93C8EA27F654}.Debug|x86.ActiveCfg = Debug|Any CPU + {D2E67674-00FA-463F-A184-93C8EA27F654}.Debug|x86.Build.0 = Debug|Any CPU {D2E67674-00FA-463F-A184-93C8EA27F654}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {D2E67674-00FA-463F-A184-93C8EA27F654}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {D2E67674-00FA-463F-A184-93C8EA27F654}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {D2E67674-00FA-463F-A184-93C8EA27F654}.Deploy|x86.Build.0 = Deploy|Any CPU {D2E67674-00FA-463F-A184-93C8EA27F654}.Release|Any CPU.ActiveCfg = Release|Any CPU {D2E67674-00FA-463F-A184-93C8EA27F654}.Release|Any CPU.Build.0 = Release|Any CPU + {D2E67674-00FA-463F-A184-93C8EA27F654}.Release|x86.ActiveCfg = Release|Any CPU + {D2E67674-00FA-463F-A184-93C8EA27F654}.Release|x86.Build.0 = Release|Any CPU {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Debug|x86.ActiveCfg = Debug|Any CPU + {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Debug|x86.Build.0 = Debug|Any CPU {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Deploy|x86.Build.0 = Deploy|Any CPU {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Release|Any CPU.ActiveCfg = Release|Any CPU {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Release|Any CPU.Build.0 = Release|Any CPU + {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Release|x86.ActiveCfg = Release|Any CPU + {12657FFD-3306-4F86-8AC4-A002ABD5F4ED}.Release|x86.Build.0 = Release|Any CPU {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Debug|x86.ActiveCfg = Debug|Any CPU + {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Debug|x86.Build.0 = Debug|Any CPU {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Deploy|x86.Build.0 = Deploy|Any CPU {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Release|Any CPU.ActiveCfg = Release|Any CPU {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Release|Any CPU.Build.0 = Release|Any CPU + {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Release|x86.ActiveCfg = Release|Any CPU + {5834B614-FA20-46D7-BBDB-D0310351A5F2}.Release|x86.Build.0 = Release|Any CPU {B8C9F396-089A-4280-A26D-57A3472B717D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B8C9F396-089A-4280-A26D-57A3472B717D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8C9F396-089A-4280-A26D-57A3472B717D}.Debug|x86.ActiveCfg = Debug|Any CPU + {B8C9F396-089A-4280-A26D-57A3472B717D}.Debug|x86.Build.0 = Debug|Any CPU {B8C9F396-089A-4280-A26D-57A3472B717D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {B8C9F396-089A-4280-A26D-57A3472B717D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {B8C9F396-089A-4280-A26D-57A3472B717D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {B8C9F396-089A-4280-A26D-57A3472B717D}.Deploy|x86.Build.0 = Deploy|Any CPU {B8C9F396-089A-4280-A26D-57A3472B717D}.Release|Any CPU.ActiveCfg = Release|Any CPU {B8C9F396-089A-4280-A26D-57A3472B717D}.Release|Any CPU.Build.0 = Release|Any CPU + {B8C9F396-089A-4280-A26D-57A3472B717D}.Release|x86.ActiveCfg = Release|Any CPU + {B8C9F396-089A-4280-A26D-57A3472B717D}.Release|x86.Build.0 = Release|Any CPU {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Debug|x86.ActiveCfg = Debug|Any CPU + {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Debug|x86.Build.0 = Debug|Any CPU {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Deploy|x86.Build.0 = Deploy|Any CPU {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Release|Any CPU.ActiveCfg = Release|Any CPU {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Release|Any CPU.Build.0 = Release|Any CPU + {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Release|x86.ActiveCfg = Release|Any CPU + {3BBA9856-1E71-4ECF-9A91-781B5861BA03}.Release|x86.Build.0 = Release|Any CPU {D3790203-AA88-435F-8249-80A7E4BFA841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D3790203-AA88-435F-8249-80A7E4BFA841}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3790203-AA88-435F-8249-80A7E4BFA841}.Debug|x86.ActiveCfg = Debug|Any CPU + {D3790203-AA88-435F-8249-80A7E4BFA841}.Debug|x86.Build.0 = Debug|Any CPU {D3790203-AA88-435F-8249-80A7E4BFA841}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {D3790203-AA88-435F-8249-80A7E4BFA841}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {D3790203-AA88-435F-8249-80A7E4BFA841}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {D3790203-AA88-435F-8249-80A7E4BFA841}.Deploy|x86.Build.0 = Deploy|Any CPU {D3790203-AA88-435F-8249-80A7E4BFA841}.Release|Any CPU.ActiveCfg = Release|Any CPU {D3790203-AA88-435F-8249-80A7E4BFA841}.Release|Any CPU.Build.0 = Release|Any CPU + {D3790203-AA88-435F-8249-80A7E4BFA841}.Release|x86.ActiveCfg = Release|Any CPU + {D3790203-AA88-435F-8249-80A7E4BFA841}.Release|x86.Build.0 = Release|Any CPU {8EB251DC-80E5-4334-A869-DC96929418CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8EB251DC-80E5-4334-A869-DC96929418CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8EB251DC-80E5-4334-A869-DC96929418CE}.Debug|x86.ActiveCfg = Debug|Any CPU + {8EB251DC-80E5-4334-A869-DC96929418CE}.Debug|x86.Build.0 = Debug|Any CPU {8EB251DC-80E5-4334-A869-DC96929418CE}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {8EB251DC-80E5-4334-A869-DC96929418CE}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {8EB251DC-80E5-4334-A869-DC96929418CE}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {8EB251DC-80E5-4334-A869-DC96929418CE}.Deploy|x86.Build.0 = Deploy|Any CPU {8EB251DC-80E5-4334-A869-DC96929418CE}.Release|Any CPU.ActiveCfg = Release|Any CPU {8EB251DC-80E5-4334-A869-DC96929418CE}.Release|Any CPU.Build.0 = Release|Any CPU + {8EB251DC-80E5-4334-A869-DC96929418CE}.Release|x86.ActiveCfg = Release|Any CPU + {8EB251DC-80E5-4334-A869-DC96929418CE}.Release|x86.Build.0 = Release|Any CPU {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Debug|x86.ActiveCfg = Debug|Any CPU + {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Debug|x86.Build.0 = Debug|Any CPU {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Deploy|x86.Build.0 = Deploy|Any CPU {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Release|Any CPU.ActiveCfg = Release|Any CPU {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Release|Any CPU.Build.0 = Release|Any CPU - {88D00E0D-1FF5-410B-9C11-17CC98BFD3BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88D00E0D-1FF5-410B-9C11-17CC98BFD3BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88D00E0D-1FF5-410B-9C11-17CC98BFD3BE}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU - {88D00E0D-1FF5-410B-9C11-17CC98BFD3BE}.Deploy|Any CPU.Build.0 = Deploy|Any CPU - {88D00E0D-1FF5-410B-9C11-17CC98BFD3BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88D00E0D-1FF5-410B-9C11-17CC98BFD3BE}.Release|Any CPU.Build.0 = Release|Any CPU - {0E3AAF01-A095-48A8-9C03-78B56D01EDC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0E3AAF01-A095-48A8-9C03-78B56D01EDC0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0E3AAF01-A095-48A8-9C03-78B56D01EDC0}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU - {0E3AAF01-A095-48A8-9C03-78B56D01EDC0}.Deploy|Any CPU.Build.0 = Deploy|Any CPU - {0E3AAF01-A095-48A8-9C03-78B56D01EDC0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0E3AAF01-A095-48A8-9C03-78B56D01EDC0}.Release|Any CPU.Build.0 = Release|Any CPU - {6AA94144-9108-4620-85ED-869BFE729303}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6AA94144-9108-4620-85ED-869BFE729303}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6AA94144-9108-4620-85ED-869BFE729303}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU - {6AA94144-9108-4620-85ED-869BFE729303}.Deploy|Any CPU.Build.0 = Deploy|Any CPU - {6AA94144-9108-4620-85ED-869BFE729303}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6AA94144-9108-4620-85ED-869BFE729303}.Release|Any CPU.Build.0 = Release|Any CPU + {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Release|x86.ActiveCfg = Release|Any CPU + {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A}.Release|x86.Build.0 = Release|Any CPU {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Debug|x86.ActiveCfg = Debug|Any CPU + {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Debug|x86.Build.0 = Debug|Any CPU {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Deploy|x86.Build.0 = Deploy|Any CPU {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Release|Any CPU.ActiveCfg = Release|Any CPU {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Release|Any CPU.Build.0 = Release|Any CPU + {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Release|x86.ActiveCfg = Release|Any CPU + {43D621D9-7297-4444-8DE9-B6A0CEFAC079}.Release|x86.Build.0 = Release|Any CPU {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Debug|x86.ActiveCfg = Debug|Any CPU + {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Debug|x86.Build.0 = Debug|Any CPU {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Deploy|x86.Build.0 = Deploy|Any CPU {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Release|Any CPU.ActiveCfg = Release|Any CPU {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Release|Any CPU.Build.0 = Release|Any CPU + {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Release|x86.ActiveCfg = Release|Any CPU + {0AFD4A07-0D47-460A-84AA-4E2968B8FC74}.Release|x86.Build.0 = Release|Any CPU {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Debug|x86.ActiveCfg = Debug|Any CPU + {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Debug|x86.Build.0 = Debug|Any CPU {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Deploy|x86.Build.0 = Deploy|Any CPU {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Release|Any CPU.ActiveCfg = Release|Any CPU {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Release|Any CPU.Build.0 = Release|Any CPU + {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Release|x86.ActiveCfg = Release|Any CPU + {8A895158-9799-40C0-B63A-7F41E5F8FBA0}.Release|x86.Build.0 = Release|Any CPU {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Debug|x86.ActiveCfg = Debug|Any CPU + {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Debug|x86.Build.0 = Debug|Any CPU {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Deploy|x86.Build.0 = Deploy|Any CPU {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Release|Any CPU.ActiveCfg = Release|Any CPU {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Release|Any CPU.Build.0 = Release|Any CPU + {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Release|x86.ActiveCfg = Release|Any CPU + {573097FA-7B92-4A4F-B7E9-817C09B4705F}.Release|x86.Build.0 = Release|Any CPU {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Debug|x86.ActiveCfg = Debug|Any CPU + {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Debug|x86.Build.0 = Debug|Any CPU {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Deploy|x86.Build.0 = Deploy|Any CPU {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Release|Any CPU.ActiveCfg = Release|Any CPU {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Release|Any CPU.Build.0 = Release|Any CPU + {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Release|x86.ActiveCfg = Release|Any CPU + {524A9256-A9AE-488C-9012-BE3DFE01F7CB}.Release|x86.Build.0 = Release|Any CPU {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Debug|x86.ActiveCfg = Debug|Any CPU + {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Debug|x86.Build.0 = Debug|Any CPU {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Deploy|x86.Build.0 = Deploy|Any CPU {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Release|Any CPU.ActiveCfg = Release|Any CPU {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Release|Any CPU.Build.0 = Release|Any CPU + {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Release|x86.ActiveCfg = Release|Any CPU + {6644E15D-7D66-4D6C-AA31-30CD97CD1A88}.Release|x86.Build.0 = Release|Any CPU {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Debug|x86.ActiveCfg = Debug|Any CPU + {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Debug|x86.Build.0 = Debug|Any CPU {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Deploy|x86.Build.0 = Deploy|Any CPU {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Release|Any CPU.ActiveCfg = Release|Any CPU {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Release|Any CPU.Build.0 = Release|Any CPU + {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Release|x86.ActiveCfg = Release|Any CPU + {8EC8E495-4B07-4B69-A22A-4F18F19197EC}.Release|x86.Build.0 = Release|Any CPU {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Debug|x86.ActiveCfg = Debug|Any CPU + {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Debug|x86.Build.0 = Debug|Any CPU {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Deploy|x86.Build.0 = Deploy|Any CPU {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Release|Any CPU.ActiveCfg = Release|Any CPU {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Release|Any CPU.Build.0 = Release|Any CPU + {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Release|x86.ActiveCfg = Release|Any CPU + {A8ADFB84-81D2-4F6E-9AAD-1E46FE0A5C90}.Release|x86.Build.0 = Release|Any CPU {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Debug|x86.ActiveCfg = Debug|Any CPU + {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Debug|x86.Build.0 = Debug|Any CPU {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Deploy|x86.Build.0 = Deploy|Any CPU {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Release|Any CPU.ActiveCfg = Release|Any CPU {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Release|Any CPU.Build.0 = Release|Any CPU + {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Release|x86.ActiveCfg = Release|Any CPU + {5B8E150F-3078-45A2-A11F-100ABD6D269A}.Release|x86.Build.0 = Release|Any CPU {782F99C3-65B6-458F-B5CF-550137FDC54D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {782F99C3-65B6-458F-B5CF-550137FDC54D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {782F99C3-65B6-458F-B5CF-550137FDC54D}.Debug|x86.ActiveCfg = Debug|Any CPU + {782F99C3-65B6-458F-B5CF-550137FDC54D}.Debug|x86.Build.0 = Debug|Any CPU {782F99C3-65B6-458F-B5CF-550137FDC54D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {782F99C3-65B6-458F-B5CF-550137FDC54D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {782F99C3-65B6-458F-B5CF-550137FDC54D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {782F99C3-65B6-458F-B5CF-550137FDC54D}.Deploy|x86.Build.0 = Deploy|Any CPU {782F99C3-65B6-458F-B5CF-550137FDC54D}.Release|Any CPU.ActiveCfg = Release|Any CPU {782F99C3-65B6-458F-B5CF-550137FDC54D}.Release|Any CPU.Build.0 = Release|Any CPU + {782F99C3-65B6-458F-B5CF-550137FDC54D}.Release|x86.ActiveCfg = Release|Any CPU + {782F99C3-65B6-458F-B5CF-550137FDC54D}.Release|x86.Build.0 = Release|Any CPU {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Debug|x86.ActiveCfg = Debug|Any CPU + {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Debug|x86.Build.0 = Debug|Any CPU {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Deploy|x86.Build.0 = Deploy|Any CPU {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Release|Any CPU.ActiveCfg = Release|Any CPU {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Release|Any CPU.Build.0 = Release|Any CPU + {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Release|x86.ActiveCfg = Release|Any CPU + {27200AEB-40FA-4CB7-9676-1FBE930B6D2A}.Release|x86.Build.0 = Release|Any CPU {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Debug|x86.ActiveCfg = Debug|Any CPU + {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Debug|x86.Build.0 = Debug|Any CPU {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Deploy|x86.Build.0 = Deploy|Any CPU {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Release|Any CPU.ActiveCfg = Release|Any CPU {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Release|Any CPU.Build.0 = Release|Any CPU + {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Release|x86.ActiveCfg = Release|Any CPU + {6EDBAC17-1C27-4AA4-87F8-524A6A311F29}.Release|x86.Build.0 = Release|Any CPU {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Debug|x86.ActiveCfg = Debug|Any CPU + {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Debug|x86.Build.0 = Debug|Any CPU {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Deploy|x86.Build.0 = Deploy|Any CPU {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Release|Any CPU.ActiveCfg = Release|Any CPU {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Release|Any CPU.Build.0 = Release|Any CPU + {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Release|x86.ActiveCfg = Release|Any CPU + {64C9B0B5-573E-4E7F-98C1-DDCF25E4FED3}.Release|x86.Build.0 = Release|Any CPU {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Debug|x86.ActiveCfg = Debug|Any CPU + {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Debug|x86.Build.0 = Debug|Any CPU {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Deploy|x86.Build.0 = Deploy|Any CPU {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Release|Any CPU.ActiveCfg = Release|Any CPU {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Release|Any CPU.Build.0 = Release|Any CPU + {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Release|x86.ActiveCfg = Release|Any CPU + {7E9316B6-A386-43CD-ABAE-97D6E1DF7D06}.Release|x86.Build.0 = Release|Any CPU {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Debug|x86.ActiveCfg = Debug|Any CPU + {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Debug|x86.Build.0 = Debug|Any CPU {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Deploy|x86.Build.0 = Deploy|Any CPU {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Release|Any CPU.ActiveCfg = Release|Any CPU {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Release|Any CPU.Build.0 = Release|Any CPU + {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Release|x86.ActiveCfg = Release|Any CPU + {EFBD0787-39B1-40F4-93EC-CE9F1BAA1340}.Release|x86.Build.0 = Release|Any CPU {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Debug|x86.ActiveCfg = Debug|Any CPU + {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Debug|x86.Build.0 = Debug|Any CPU {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Deploy|x86.Build.0 = Deploy|Any CPU {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Release|Any CPU.ActiveCfg = Release|Any CPU {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Release|Any CPU.Build.0 = Release|Any CPU + {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Release|x86.ActiveCfg = Release|Any CPU + {C77DFB22-DCCD-40F9-A822-8115FDFA35C5}.Release|x86.Build.0 = Release|Any CPU {05A2A634-96E3-40EA-8527-10F547666FD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {05A2A634-96E3-40EA-8527-10F547666FD0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05A2A634-96E3-40EA-8527-10F547666FD0}.Debug|x86.ActiveCfg = Debug|Any CPU + {05A2A634-96E3-40EA-8527-10F547666FD0}.Debug|x86.Build.0 = Debug|Any CPU {05A2A634-96E3-40EA-8527-10F547666FD0}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {05A2A634-96E3-40EA-8527-10F547666FD0}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {05A2A634-96E3-40EA-8527-10F547666FD0}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {05A2A634-96E3-40EA-8527-10F547666FD0}.Deploy|x86.Build.0 = Deploy|Any CPU {05A2A634-96E3-40EA-8527-10F547666FD0}.Release|Any CPU.ActiveCfg = Release|Any CPU {05A2A634-96E3-40EA-8527-10F547666FD0}.Release|Any CPU.Build.0 = Release|Any CPU + {05A2A634-96E3-40EA-8527-10F547666FD0}.Release|x86.ActiveCfg = Release|Any CPU + {05A2A634-96E3-40EA-8527-10F547666FD0}.Release|x86.Build.0 = Release|Any CPU {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Debug|x86.ActiveCfg = Debug|Any CPU + {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Debug|x86.Build.0 = Debug|Any CPU {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Deploy|x86.Build.0 = Deploy|Any CPU {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Release|Any CPU.ActiveCfg = Release|Any CPU {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Release|Any CPU.Build.0 = Release|Any CPU + {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Release|x86.ActiveCfg = Release|Any CPU + {8D3E2585-D2CE-4158-96B9-8B75CE8CC99F}.Release|x86.Build.0 = Release|Any CPU {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Debug|x86.ActiveCfg = Debug|Any CPU + {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Debug|x86.Build.0 = Debug|Any CPU {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Deploy|x86.Build.0 = Deploy|Any CPU {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Release|Any CPU.ActiveCfg = Release|Any CPU {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Release|Any CPU.Build.0 = Release|Any CPU + {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Release|x86.ActiveCfg = Release|Any CPU + {EB3D4A0C-4022-4588-8A7F-DF2B30D3953B}.Release|x86.Build.0 = Release|Any CPU {0E74A4AC-BE82-4081-812B-30140DA44A34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0E74A4AC-BE82-4081-812B-30140DA44A34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E74A4AC-BE82-4081-812B-30140DA44A34}.Debug|x86.ActiveCfg = Debug|Any CPU + {0E74A4AC-BE82-4081-812B-30140DA44A34}.Debug|x86.Build.0 = Debug|Any CPU {0E74A4AC-BE82-4081-812B-30140DA44A34}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {0E74A4AC-BE82-4081-812B-30140DA44A34}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {0E74A4AC-BE82-4081-812B-30140DA44A34}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {0E74A4AC-BE82-4081-812B-30140DA44A34}.Deploy|x86.Build.0 = Deploy|Any CPU {0E74A4AC-BE82-4081-812B-30140DA44A34}.Release|Any CPU.ActiveCfg = Release|Any CPU {0E74A4AC-BE82-4081-812B-30140DA44A34}.Release|Any CPU.Build.0 = Release|Any CPU + {0E74A4AC-BE82-4081-812B-30140DA44A34}.Release|x86.ActiveCfg = Release|Any CPU + {0E74A4AC-BE82-4081-812B-30140DA44A34}.Release|x86.Build.0 = Release|Any CPU {4A006486-5DD7-4508-BE68-17126336A9D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4A006486-5DD7-4508-BE68-17126336A9D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A006486-5DD7-4508-BE68-17126336A9D8}.Debug|x86.ActiveCfg = Debug|Any CPU + {4A006486-5DD7-4508-BE68-17126336A9D8}.Debug|x86.Build.0 = Debug|Any CPU {4A006486-5DD7-4508-BE68-17126336A9D8}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {4A006486-5DD7-4508-BE68-17126336A9D8}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {4A006486-5DD7-4508-BE68-17126336A9D8}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {4A006486-5DD7-4508-BE68-17126336A9D8}.Deploy|x86.Build.0 = Deploy|Any CPU {4A006486-5DD7-4508-BE68-17126336A9D8}.Release|Any CPU.ActiveCfg = Release|Any CPU {4A006486-5DD7-4508-BE68-17126336A9D8}.Release|Any CPU.Build.0 = Release|Any CPU + {4A006486-5DD7-4508-BE68-17126336A9D8}.Release|x86.ActiveCfg = Release|Any CPU + {4A006486-5DD7-4508-BE68-17126336A9D8}.Release|x86.Build.0 = Release|Any CPU {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Debug|x86.ActiveCfg = Debug|Any CPU + {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Debug|x86.Build.0 = Debug|Any CPU {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Deploy|x86.Build.0 = Deploy|Any CPU {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Release|Any CPU.ActiveCfg = Release|Any CPU {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Release|Any CPU.Build.0 = Release|Any CPU + {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Release|x86.ActiveCfg = Release|Any CPU + {E2B2402C-4E23-468F-B87D-A4E20EEDFAC9}.Release|x86.Build.0 = Release|Any CPU {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Debug|x86.ActiveCfg = Debug|Any CPU + {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Debug|x86.Build.0 = Debug|Any CPU {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Deploy|x86.Build.0 = Deploy|Any CPU {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Release|Any CPU.ActiveCfg = Release|Any CPU {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Release|Any CPU.Build.0 = Release|Any CPU + {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Release|x86.ActiveCfg = Release|Any CPU + {C7F1C990-FEB2-455F-8049-FF49F17A1D2A}.Release|x86.Build.0 = Release|Any CPU {5EB96A28-829A-440D-9607-8FAB07C4454B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5EB96A28-829A-440D-9607-8FAB07C4454B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EB96A28-829A-440D-9607-8FAB07C4454B}.Debug|x86.ActiveCfg = Debug|Any CPU + {5EB96A28-829A-440D-9607-8FAB07C4454B}.Debug|x86.Build.0 = Debug|Any CPU {5EB96A28-829A-440D-9607-8FAB07C4454B}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {5EB96A28-829A-440D-9607-8FAB07C4454B}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {5EB96A28-829A-440D-9607-8FAB07C4454B}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {5EB96A28-829A-440D-9607-8FAB07C4454B}.Deploy|x86.Build.0 = Deploy|Any CPU {5EB96A28-829A-440D-9607-8FAB07C4454B}.Release|Any CPU.ActiveCfg = Release|Any CPU {5EB96A28-829A-440D-9607-8FAB07C4454B}.Release|Any CPU.Build.0 = Release|Any CPU + {5EB96A28-829A-440D-9607-8FAB07C4454B}.Release|x86.ActiveCfg = Release|Any CPU + {5EB96A28-829A-440D-9607-8FAB07C4454B}.Release|x86.Build.0 = Release|Any CPU {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Debug|x86.ActiveCfg = Debug|Any CPU + {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Debug|x86.Build.0 = Debug|Any CPU {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Deploy|x86.Build.0 = Deploy|Any CPU {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Release|Any CPU.ActiveCfg = Release|Any CPU {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Release|Any CPU.Build.0 = Release|Any CPU + {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Release|x86.ActiveCfg = Release|Any CPU + {80E2A78C-7515-45E3-93EB-2EAD660495A3}.Release|x86.Build.0 = Release|Any CPU {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Debug|x86.ActiveCfg = Debug|Any CPU + {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Debug|x86.Build.0 = Debug|Any CPU {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Deploy|x86.Build.0 = Deploy|Any CPU {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Release|Any CPU.ActiveCfg = Release|Any CPU {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Release|Any CPU.Build.0 = Release|Any CPU + {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Release|x86.ActiveCfg = Release|Any CPU + {D0CBE9EC-93F5-483E-8119-688B036F7B19}.Release|x86.Build.0 = Release|Any CPU {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Debug|x86.ActiveCfg = Debug|Any CPU + {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Debug|x86.Build.0 = Debug|Any CPU {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Deploy|x86.Build.0 = Deploy|Any CPU {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Release|Any CPU.ActiveCfg = Release|Any CPU {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Release|Any CPU.Build.0 = Release|Any CPU + {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Release|x86.ActiveCfg = Release|Any CPU + {02E3B946-989E-4B21-AA73-1C94E869D1DA}.Release|x86.Build.0 = Release|Any CPU {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Debug|x86.ActiveCfg = Debug|Any CPU + {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Debug|x86.Build.0 = Debug|Any CPU {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Deploy|x86.Build.0 = Deploy|Any CPU {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Release|Any CPU.ActiveCfg = Release|Any CPU {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Release|Any CPU.Build.0 = Release|Any CPU + {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Release|x86.ActiveCfg = Release|Any CPU + {FAC1EF7C-E59E-47F7-BBD6-A5A8A0CF2B4D}.Release|x86.Build.0 = Release|Any CPU {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Debug|x86.ActiveCfg = Debug|Any CPU + {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Debug|x86.Build.0 = Debug|Any CPU {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Deploy|x86.Build.0 = Deploy|Any CPU {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Release|Any CPU.ActiveCfg = Release|Any CPU {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Release|Any CPU.Build.0 = Release|Any CPU + {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Release|x86.ActiveCfg = Release|Any CPU + {6CB5F73E-1DAF-4764-B85B-3007A08FADDB}.Release|x86.Build.0 = Release|Any CPU {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Debug|x86.ActiveCfg = Debug|Any CPU + {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Debug|x86.Build.0 = Debug|Any CPU {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Deploy|x86.Build.0 = Deploy|Any CPU {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Release|Any CPU.ActiveCfg = Release|Any CPU {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Release|Any CPU.Build.0 = Release|Any CPU + {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Release|x86.ActiveCfg = Release|Any CPU + {697D54AD-03CE-48F5-9EA5-C48ECC158E1D}.Release|x86.Build.0 = Release|Any CPU {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Debug|x86.Build.0 = Debug|Any CPU {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Deploy|x86.Build.0 = Deploy|Any CPU {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Release|Any CPU.ActiveCfg = Release|Any CPU {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Release|Any CPU.Build.0 = Release|Any CPU + {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Release|x86.ActiveCfg = Release|Any CPU + {D6EB27CB-C5A9-4590-AAB6-0D4F0DE29C5A}.Release|x86.Build.0 = Release|Any CPU {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Debug|x86.ActiveCfg = Debug|Any CPU + {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Debug|x86.Build.0 = Debug|Any CPU {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Deploy|x86.Build.0 = Deploy|Any CPU {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Release|Any CPU.ActiveCfg = Release|Any CPU {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Release|Any CPU.Build.0 = Release|Any CPU + {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Release|x86.ActiveCfg = Release|Any CPU + {3153FB67-9399-4B5E-84EB-56DEEB2DDBDF}.Release|x86.Build.0 = Release|Any CPU {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Debug|x86.ActiveCfg = Debug|Any CPU + {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Debug|x86.Build.0 = Debug|Any CPU {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Deploy|x86.Build.0 = Deploy|Any CPU {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Release|Any CPU.ActiveCfg = Release|Any CPU {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Release|Any CPU.Build.0 = Release|Any CPU + {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Release|x86.ActiveCfg = Release|Any CPU + {A6F8FA83-9C79-43CE-93FD-B1BDD75DCA74}.Release|x86.Build.0 = Release|Any CPU {2F23D966-B489-42D3-B972-EC9E42EEC512}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2F23D966-B489-42D3-B972-EC9E42EEC512}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F23D966-B489-42D3-B972-EC9E42EEC512}.Debug|x86.ActiveCfg = Debug|Any CPU + {2F23D966-B489-42D3-B972-EC9E42EEC512}.Debug|x86.Build.0 = Debug|Any CPU {2F23D966-B489-42D3-B972-EC9E42EEC512}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {2F23D966-B489-42D3-B972-EC9E42EEC512}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {2F23D966-B489-42D3-B972-EC9E42EEC512}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {2F23D966-B489-42D3-B972-EC9E42EEC512}.Deploy|x86.Build.0 = Deploy|Any CPU {2F23D966-B489-42D3-B972-EC9E42EEC512}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F23D966-B489-42D3-B972-EC9E42EEC512}.Release|Any CPU.Build.0 = Release|Any CPU + {2F23D966-B489-42D3-B972-EC9E42EEC512}.Release|x86.ActiveCfg = Release|Any CPU + {2F23D966-B489-42D3-B972-EC9E42EEC512}.Release|x86.Build.0 = Release|Any CPU {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Debug|Any CPU.Build.0 = Debug|Any CPU + {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Debug|x86.ActiveCfg = Debug|Any CPU + {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Debug|x86.Build.0 = Debug|Any CPU {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Deploy|x86.Build.0 = Deploy|Any CPU {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Release|Any CPU.ActiveCfg = Release|Any CPU {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Release|Any CPU.Build.0 = Release|Any CPU + {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Release|x86.ActiveCfg = Release|Any CPU + {789A1184-DCBB-4CD1-BD0D-A136B0601631}.Release|x86.Build.0 = Release|Any CPU {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Debug|x86.ActiveCfg = Debug|Any CPU + {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Debug|x86.Build.0 = Debug|Any CPU {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Deploy|x86.Build.0 = Deploy|Any CPU {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Release|Any CPU.ActiveCfg = Release|Any CPU {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Release|Any CPU.Build.0 = Release|Any CPU + {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Release|x86.ActiveCfg = Release|Any CPU + {C8230DC5-E03E-4D00-9ED7-843E24BCA99C}.Release|x86.Build.0 = Release|Any CPU {C4D5E27E-6130-44E9-B756-1F320F15431E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C4D5E27E-6130-44E9-B756-1F320F15431E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4D5E27E-6130-44E9-B756-1F320F15431E}.Debug|x86.ActiveCfg = Debug|Any CPU + {C4D5E27E-6130-44E9-B756-1F320F15431E}.Debug|x86.Build.0 = Debug|Any CPU {C4D5E27E-6130-44E9-B756-1F320F15431E}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {C4D5E27E-6130-44E9-B756-1F320F15431E}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {C4D5E27E-6130-44E9-B756-1F320F15431E}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {C4D5E27E-6130-44E9-B756-1F320F15431E}.Deploy|x86.Build.0 = Deploy|Any CPU {C4D5E27E-6130-44E9-B756-1F320F15431E}.Release|Any CPU.ActiveCfg = Release|Any CPU {C4D5E27E-6130-44E9-B756-1F320F15431E}.Release|Any CPU.Build.0 = Release|Any CPU + {C4D5E27E-6130-44E9-B756-1F320F15431E}.Release|x86.ActiveCfg = Release|Any CPU + {C4D5E27E-6130-44E9-B756-1F320F15431E}.Release|x86.Build.0 = Release|Any CPU {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Debug|x86.ActiveCfg = Debug|Any CPU + {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Debug|x86.Build.0 = Debug|Any CPU {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Deploy|x86.Build.0 = Deploy|Any CPU {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Release|Any CPU.ActiveCfg = Release|Any CPU {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Release|Any CPU.Build.0 = Release|Any CPU + {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Release|x86.ActiveCfg = Release|Any CPU + {E5C8A941-CB64-47BC-AAEC-A59D3257B7FF}.Release|x86.Build.0 = Release|Any CPU {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Debug|x86.ActiveCfg = Debug|Any CPU + {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Debug|x86.Build.0 = Debug|Any CPU {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Deploy|x86.Build.0 = Deploy|Any CPU {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Release|Any CPU.ActiveCfg = Release|Any CPU {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Release|Any CPU.Build.0 = Release|Any CPU + {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Release|x86.ActiveCfg = Release|Any CPU + {C50C14C8-FEEB-45B7-9174-C79ED8F8876C}.Release|x86.Build.0 = Release|Any CPU {5F477C6B-1149-4A83-894B-1952218A1C1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5F477C6B-1149-4A83-894B-1952218A1C1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F477C6B-1149-4A83-894B-1952218A1C1D}.Debug|x86.ActiveCfg = Debug|Any CPU + {5F477C6B-1149-4A83-894B-1952218A1C1D}.Debug|x86.Build.0 = Debug|Any CPU {5F477C6B-1149-4A83-894B-1952218A1C1D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {5F477C6B-1149-4A83-894B-1952218A1C1D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {5F477C6B-1149-4A83-894B-1952218A1C1D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {5F477C6B-1149-4A83-894B-1952218A1C1D}.Deploy|x86.Build.0 = Deploy|Any CPU {5F477C6B-1149-4A83-894B-1952218A1C1D}.Release|Any CPU.ActiveCfg = Release|Any CPU {5F477C6B-1149-4A83-894B-1952218A1C1D}.Release|Any CPU.Build.0 = Release|Any CPU + {5F477C6B-1149-4A83-894B-1952218A1C1D}.Release|x86.ActiveCfg = Release|Any CPU + {5F477C6B-1149-4A83-894B-1952218A1C1D}.Release|x86.Build.0 = Release|Any CPU {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Debug|x86.ActiveCfg = Debug|Any CPU + {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Debug|x86.Build.0 = Debug|Any CPU {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Deploy|x86.Build.0 = Deploy|Any CPU {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Release|Any CPU.ActiveCfg = Release|Any CPU {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Release|Any CPU.Build.0 = Release|Any CPU + {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Release|x86.ActiveCfg = Release|Any CPU + {1C376A9E-5DEE-4937-91B0-2C70E0C3B54D}.Release|x86.Build.0 = Release|Any CPU {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Debug|x86.ActiveCfg = Debug|Any CPU + {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Debug|x86.Build.0 = Debug|Any CPU {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Deploy|x86.Build.0 = Deploy|Any CPU {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Release|Any CPU.ActiveCfg = Release|Any CPU {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Release|Any CPU.Build.0 = Release|Any CPU + {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Release|x86.ActiveCfg = Release|Any CPU + {5245DE6A-2EB9-4760-9DBC-C3DCEFF94F79}.Release|x86.Build.0 = Release|Any CPU {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Debug|x86.ActiveCfg = Debug|Any CPU + {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Debug|x86.Build.0 = Debug|Any CPU {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Deploy|x86.Build.0 = Deploy|Any CPU {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Release|Any CPU.ActiveCfg = Release|Any CPU {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Release|Any CPU.Build.0 = Release|Any CPU + {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Release|x86.ActiveCfg = Release|Any CPU + {D7C27F0A-A942-4C14-BAAF-6729FCDAECA4}.Release|x86.Build.0 = Release|Any CPU {4666A155-B9AF-4D59-8667-03D8243A053A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4666A155-B9AF-4D59-8667-03D8243A053A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4666A155-B9AF-4D59-8667-03D8243A053A}.Debug|x86.ActiveCfg = Debug|Any CPU + {4666A155-B9AF-4D59-8667-03D8243A053A}.Debug|x86.Build.0 = Debug|Any CPU {4666A155-B9AF-4D59-8667-03D8243A053A}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {4666A155-B9AF-4D59-8667-03D8243A053A}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {4666A155-B9AF-4D59-8667-03D8243A053A}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {4666A155-B9AF-4D59-8667-03D8243A053A}.Deploy|x86.Build.0 = Deploy|Any CPU {4666A155-B9AF-4D59-8667-03D8243A053A}.Release|Any CPU.ActiveCfg = Release|Any CPU {4666A155-B9AF-4D59-8667-03D8243A053A}.Release|Any CPU.Build.0 = Release|Any CPU + {4666A155-B9AF-4D59-8667-03D8243A053A}.Release|x86.ActiveCfg = Release|Any CPU + {4666A155-B9AF-4D59-8667-03D8243A053A}.Release|x86.Build.0 = Release|Any CPU {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Debug|x86.ActiveCfg = Debug|Any CPU + {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Debug|x86.Build.0 = Debug|Any CPU {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Deploy|x86.Build.0 = Deploy|Any CPU {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Release|Any CPU.ActiveCfg = Release|Any CPU {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Release|Any CPU.Build.0 = Release|Any CPU + {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Release|x86.ActiveCfg = Release|Any CPU + {FCD4AE32-1952-48F6-8B96-B72D71323C90}.Release|x86.Build.0 = Release|Any CPU {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Debug|x86.ActiveCfg = Debug|Any CPU + {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Debug|x86.Build.0 = Debug|Any CPU {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Deploy|x86.Build.0 = Deploy|Any CPU {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Release|Any CPU.ActiveCfg = Release|Any CPU {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Release|Any CPU.Build.0 = Release|Any CPU + {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Release|x86.ActiveCfg = Release|Any CPU + {17AEB6D6-A495-438B-A718-F2DE2B129A69}.Release|x86.Build.0 = Release|Any CPU {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Debug|x86.ActiveCfg = Debug|Any CPU + {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Debug|x86.Build.0 = Debug|Any CPU {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Deploy|x86.Build.0 = Deploy|Any CPU {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Release|Any CPU.ActiveCfg = Release|Any CPU {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Release|Any CPU.Build.0 = Release|Any CPU + {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Release|x86.ActiveCfg = Release|Any CPU + {CC8B3270-F70A-42AF-8B50-DC3D5CAC106C}.Release|x86.Build.0 = Release|Any CPU {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Debug|x86.ActiveCfg = Debug|Any CPU + {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Debug|x86.Build.0 = Debug|Any CPU {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Deploy|x86.Build.0 = Deploy|Any CPU {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Release|Any CPU.ActiveCfg = Release|Any CPU {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Release|Any CPU.Build.0 = Release|Any CPU + {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Release|x86.ActiveCfg = Release|Any CPU + {D051CBF6-6FFE-4FFA-979B-6B3662A0D314}.Release|x86.Build.0 = Release|Any CPU {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Debug|Any CPU.Build.0 = Debug|Any CPU + {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Debug|x86.ActiveCfg = Debug|Any CPU + {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Debug|x86.Build.0 = Debug|Any CPU {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Deploy|x86.Build.0 = Deploy|Any CPU {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Release|Any CPU.ActiveCfg = Release|Any CPU {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Release|Any CPU.Build.0 = Release|Any CPU + {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Release|x86.ActiveCfg = Release|Any CPU + {750E3C80-3188-4CE3-B55A-8F3DE808C427}.Release|x86.Build.0 = Release|Any CPU {344945A0-86FC-47D8-BC28-E885E143A051}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {344945A0-86FC-47D8-BC28-E885E143A051}.Debug|Any CPU.Build.0 = Debug|Any CPU + {344945A0-86FC-47D8-BC28-E885E143A051}.Debug|x86.ActiveCfg = Debug|Any CPU + {344945A0-86FC-47D8-BC28-E885E143A051}.Debug|x86.Build.0 = Debug|Any CPU {344945A0-86FC-47D8-BC28-E885E143A051}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {344945A0-86FC-47D8-BC28-E885E143A051}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {344945A0-86FC-47D8-BC28-E885E143A051}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {344945A0-86FC-47D8-BC28-E885E143A051}.Deploy|x86.Build.0 = Deploy|Any CPU {344945A0-86FC-47D8-BC28-E885E143A051}.Release|Any CPU.ActiveCfg = Release|Any CPU {344945A0-86FC-47D8-BC28-E885E143A051}.Release|Any CPU.Build.0 = Release|Any CPU + {344945A0-86FC-47D8-BC28-E885E143A051}.Release|x86.ActiveCfg = Release|Any CPU + {344945A0-86FC-47D8-BC28-E885E143A051}.Release|x86.Build.0 = Release|Any CPU {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Debug|x86.ActiveCfg = Debug|Any CPU + {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Debug|x86.Build.0 = Debug|Any CPU {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Deploy|x86.Build.0 = Deploy|Any CPU {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Release|Any CPU.ActiveCfg = Release|Any CPU {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Release|Any CPU.Build.0 = Release|Any CPU + {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Release|x86.ActiveCfg = Release|Any CPU + {E4ADA2B9-CF19-4DA7-8F70-AA6D05C6EBC9}.Release|x86.Build.0 = Release|Any CPU {636D154F-827B-4116-806B-93FB79AF15AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {636D154F-827B-4116-806B-93FB79AF15AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {636D154F-827B-4116-806B-93FB79AF15AD}.Debug|x86.ActiveCfg = Debug|Any CPU + {636D154F-827B-4116-806B-93FB79AF15AD}.Debug|x86.Build.0 = Debug|Any CPU {636D154F-827B-4116-806B-93FB79AF15AD}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {636D154F-827B-4116-806B-93FB79AF15AD}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {636D154F-827B-4116-806B-93FB79AF15AD}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {636D154F-827B-4116-806B-93FB79AF15AD}.Deploy|x86.Build.0 = Deploy|Any CPU {636D154F-827B-4116-806B-93FB79AF15AD}.Release|Any CPU.ActiveCfg = Release|Any CPU {636D154F-827B-4116-806B-93FB79AF15AD}.Release|Any CPU.Build.0 = Release|Any CPU + {636D154F-827B-4116-806B-93FB79AF15AD}.Release|x86.ActiveCfg = Release|Any CPU + {636D154F-827B-4116-806B-93FB79AF15AD}.Release|x86.Build.0 = Release|Any CPU {9FE0FC5C-D97F-4127-8607-C420138301AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9FE0FC5C-D97F-4127-8607-C420138301AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9FE0FC5C-D97F-4127-8607-C420138301AB}.Debug|x86.ActiveCfg = Debug|Any CPU + {9FE0FC5C-D97F-4127-8607-C420138301AB}.Debug|x86.Build.0 = Debug|Any CPU {9FE0FC5C-D97F-4127-8607-C420138301AB}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {9FE0FC5C-D97F-4127-8607-C420138301AB}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {9FE0FC5C-D97F-4127-8607-C420138301AB}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {9FE0FC5C-D97F-4127-8607-C420138301AB}.Deploy|x86.Build.0 = Deploy|Any CPU {9FE0FC5C-D97F-4127-8607-C420138301AB}.Release|Any CPU.ActiveCfg = Release|Any CPU {9FE0FC5C-D97F-4127-8607-C420138301AB}.Release|Any CPU.Build.0 = Release|Any CPU + {9FE0FC5C-D97F-4127-8607-C420138301AB}.Release|x86.ActiveCfg = Release|Any CPU + {9FE0FC5C-D97F-4127-8607-C420138301AB}.Release|x86.Build.0 = Release|Any CPU {27E3003C-56DB-4AEB-9793-34202019638E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {27E3003C-56DB-4AEB-9793-34202019638E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27E3003C-56DB-4AEB-9793-34202019638E}.Debug|x86.ActiveCfg = Debug|Any CPU + {27E3003C-56DB-4AEB-9793-34202019638E}.Debug|x86.Build.0 = Debug|Any CPU {27E3003C-56DB-4AEB-9793-34202019638E}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {27E3003C-56DB-4AEB-9793-34202019638E}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {27E3003C-56DB-4AEB-9793-34202019638E}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {27E3003C-56DB-4AEB-9793-34202019638E}.Deploy|x86.Build.0 = Deploy|Any CPU {27E3003C-56DB-4AEB-9793-34202019638E}.Release|Any CPU.ActiveCfg = Release|Any CPU {27E3003C-56DB-4AEB-9793-34202019638E}.Release|Any CPU.Build.0 = Release|Any CPU + {27E3003C-56DB-4AEB-9793-34202019638E}.Release|x86.ActiveCfg = Release|Any CPU + {27E3003C-56DB-4AEB-9793-34202019638E}.Release|x86.Build.0 = Release|Any CPU {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Debug|x86.ActiveCfg = Debug|Any CPU + {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Debug|x86.Build.0 = Debug|Any CPU {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Deploy|x86.Build.0 = Deploy|Any CPU {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Release|Any CPU.ActiveCfg = Release|Any CPU {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Release|Any CPU.Build.0 = Release|Any CPU + {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Release|x86.ActiveCfg = Release|Any CPU + {3CF79DF8-6637-4FA8-B6B0-191FF258B85F}.Release|x86.Build.0 = Release|Any CPU {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Debug|x86.ActiveCfg = Debug|Any CPU + {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Debug|x86.Build.0 = Debug|Any CPU {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Deploy|x86.Build.0 = Deploy|Any CPU {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Release|Any CPU.ActiveCfg = Release|Any CPU {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Release|Any CPU.Build.0 = Release|Any CPU + {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Release|x86.ActiveCfg = Release|Any CPU + {61B161F9-60F2-4E59-9606-8953EB4F3EB4}.Release|x86.Build.0 = Release|Any CPU {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Debug|x86.ActiveCfg = Debug|Any CPU + {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Debug|x86.Build.0 = Debug|Any CPU {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Deploy|x86.Build.0 = Deploy|Any CPU {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Release|Any CPU.ActiveCfg = Release|Any CPU {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Release|Any CPU.Build.0 = Release|Any CPU + {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Release|x86.ActiveCfg = Release|Any CPU + {62EDDCCC-9E4A-487C-A868-F5610AC81765}.Release|x86.Build.0 = Release|Any CPU {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Debug|x86.ActiveCfg = Debug|Any CPU + {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Debug|x86.Build.0 = Debug|Any CPU {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Deploy|x86.Build.0 = Deploy|Any CPU {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Release|Any CPU.ActiveCfg = Release|Any CPU {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Release|Any CPU.Build.0 = Release|Any CPU + {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Release|x86.ActiveCfg = Release|Any CPU + {0EB1E967-572F-4529-A692-0D4DA35C9A91}.Release|x86.Build.0 = Release|Any CPU {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Debug|x86.ActiveCfg = Debug|Any CPU + {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Debug|x86.Build.0 = Debug|Any CPU {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Deploy|x86.Build.0 = Deploy|Any CPU {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Release|Any CPU.ActiveCfg = Release|Any CPU {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Release|Any CPU.Build.0 = Release|Any CPU + {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Release|x86.ActiveCfg = Release|Any CPU + {4A381627-AA7E-41DF-AD07-ADB1DF84427D}.Release|x86.Build.0 = Release|Any CPU {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Debug|x86.ActiveCfg = Debug|Any CPU + {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Debug|x86.Build.0 = Debug|Any CPU {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Deploy|x86.Build.0 = Deploy|Any CPU {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Release|Any CPU.ActiveCfg = Release|Any CPU {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Release|Any CPU.Build.0 = Release|Any CPU + {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Release|x86.ActiveCfg = Release|Any CPU + {294755E1-B1FC-4A3D-935A-822244DBBBD4}.Release|x86.Build.0 = Release|Any CPU {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Debug|x86.ActiveCfg = Debug|Any CPU + {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Debug|x86.Build.0 = Debug|Any CPU {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Deploy|x86.Build.0 = Deploy|Any CPU {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Release|Any CPU.ActiveCfg = Release|Any CPU {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Release|Any CPU.Build.0 = Release|Any CPU + {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Release|x86.ActiveCfg = Release|Any CPU + {C638A7CA-5E7D-4D08-9913-EB47352B788C}.Release|x86.Build.0 = Release|Any CPU {47F43756-4A5D-4371-8435-349376E804ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {47F43756-4A5D-4371-8435-349376E804ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47F43756-4A5D-4371-8435-349376E804ED}.Debug|x86.ActiveCfg = Debug|Any CPU + {47F43756-4A5D-4371-8435-349376E804ED}.Debug|x86.Build.0 = Debug|Any CPU {47F43756-4A5D-4371-8435-349376E804ED}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {47F43756-4A5D-4371-8435-349376E804ED}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {47F43756-4A5D-4371-8435-349376E804ED}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {47F43756-4A5D-4371-8435-349376E804ED}.Deploy|x86.Build.0 = Deploy|Any CPU {47F43756-4A5D-4371-8435-349376E804ED}.Release|Any CPU.ActiveCfg = Release|Any CPU {47F43756-4A5D-4371-8435-349376E804ED}.Release|Any CPU.Build.0 = Release|Any CPU + {47F43756-4A5D-4371-8435-349376E804ED}.Release|x86.ActiveCfg = Release|Any CPU + {47F43756-4A5D-4371-8435-349376E804ED}.Release|x86.Build.0 = Release|Any CPU {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Debug|x86.ActiveCfg = Debug|Any CPU + {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Debug|x86.Build.0 = Debug|Any CPU {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Deploy|x86.Build.0 = Deploy|Any CPU {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Release|Any CPU.ActiveCfg = Release|Any CPU {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Release|Any CPU.Build.0 = Release|Any CPU + {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Release|x86.ActiveCfg = Release|Any CPU + {26C1F9D8-BAC7-4B7F-B3F7-3545B1508F22}.Release|x86.Build.0 = Release|Any CPU {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Debug|x86.ActiveCfg = Debug|Any CPU + {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Debug|x86.Build.0 = Debug|Any CPU {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Deploy|x86.Build.0 = Deploy|Any CPU {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Release|Any CPU.ActiveCfg = Release|Any CPU {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Release|Any CPU.Build.0 = Release|Any CPU + {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Release|x86.ActiveCfg = Release|Any CPU + {F3C16EA2-D71C-4DCB-8EA6-DA231001E51D}.Release|x86.Build.0 = Release|Any CPU {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Debug|x86.ActiveCfg = Debug|Any CPU + {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Debug|x86.Build.0 = Debug|Any CPU {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Deploy|x86.Build.0 = Deploy|Any CPU {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Release|Any CPU.Build.0 = Release|Any CPU + {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Release|x86.ActiveCfg = Release|Any CPU + {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84}.Release|x86.Build.0 = Release|Any CPU {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Debug|x86.ActiveCfg = Debug|Any CPU + {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Debug|x86.Build.0 = Debug|Any CPU {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Deploy|x86.Build.0 = Deploy|Any CPU {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Release|Any CPU.ActiveCfg = Release|Any CPU {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Release|Any CPU.Build.0 = Release|Any CPU - {75DE8955-BA8B-49F5-9FD2-4797EE418C3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75DE8955-BA8B-49F5-9FD2-4797EE418C3E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75DE8955-BA8B-49F5-9FD2-4797EE418C3E}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU - {75DE8955-BA8B-49F5-9FD2-4797EE418C3E}.Deploy|Any CPU.Build.0 = Deploy|Any CPU - {75DE8955-BA8B-49F5-9FD2-4797EE418C3E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75DE8955-BA8B-49F5-9FD2-4797EE418C3E}.Release|Any CPU.Build.0 = Release|Any CPU + {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Release|x86.ActiveCfg = Release|Any CPU + {6D332C2E-5CF3-4BFF-9D8F-D256E574033B}.Release|x86.Build.0 = Release|Any CPU {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Debug|x86.ActiveCfg = Debug|Any CPU + {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Debug|x86.Build.0 = Debug|Any CPU {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Deploy|x86.Build.0 = Deploy|Any CPU {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Release|Any CPU.ActiveCfg = Release|Any CPU {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Release|Any CPU.Build.0 = Release|Any CPU + {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Release|x86.ActiveCfg = Release|Any CPU + {9B2CD357-F5BF-4620-A30D-1E64493C4727}.Release|x86.Build.0 = Release|Any CPU {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Debug|Any CPU.Build.0 = Debug|Any CPU + {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Debug|x86.ActiveCfg = Debug|Any CPU + {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Debug|x86.Build.0 = Debug|Any CPU {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Deploy|x86.Build.0 = Deploy|Any CPU {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Release|Any CPU.ActiveCfg = Release|Any CPU {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Release|Any CPU.Build.0 = Release|Any CPU + {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Release|x86.ActiveCfg = Release|Any CPU + {243A86B7-AB5C-41D5-BE20-5DBFC76AF922}.Release|x86.Build.0 = Release|Any CPU {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Debug|x86.ActiveCfg = Debug|Any CPU + {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Debug|x86.Build.0 = Debug|Any CPU {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Deploy|x86.Build.0 = Deploy|Any CPU {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Release|Any CPU.Build.0 = Release|Any CPU + {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Release|x86.ActiveCfg = Release|Any CPU + {F8C8F889-FFA4-4472-B34A-A00A7642D63E}.Release|x86.Build.0 = Release|Any CPU {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Debug|x86.ActiveCfg = Debug|Any CPU + {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Debug|x86.Build.0 = Debug|Any CPU {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Deploy|x86.Build.0 = Deploy|Any CPU {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Release|Any CPU.ActiveCfg = Release|Any CPU {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Release|Any CPU.Build.0 = Release|Any CPU + {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Release|x86.ActiveCfg = Release|Any CPU + {E8697D3D-2124-4ADC-8DF6-124E934AACF2}.Release|x86.Build.0 = Release|Any CPU {6142C17E-AE40-4A3C-AD26-F75713260F54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6142C17E-AE40-4A3C-AD26-F75713260F54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6142C17E-AE40-4A3C-AD26-F75713260F54}.Debug|x86.ActiveCfg = Debug|Any CPU + {6142C17E-AE40-4A3C-AD26-F75713260F54}.Debug|x86.Build.0 = Debug|Any CPU {6142C17E-AE40-4A3C-AD26-F75713260F54}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {6142C17E-AE40-4A3C-AD26-F75713260F54}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {6142C17E-AE40-4A3C-AD26-F75713260F54}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {6142C17E-AE40-4A3C-AD26-F75713260F54}.Deploy|x86.Build.0 = Deploy|Any CPU {6142C17E-AE40-4A3C-AD26-F75713260F54}.Release|Any CPU.ActiveCfg = Release|Any CPU {6142C17E-AE40-4A3C-AD26-F75713260F54}.Release|Any CPU.Build.0 = Release|Any CPU + {6142C17E-AE40-4A3C-AD26-F75713260F54}.Release|x86.ActiveCfg = Release|Any CPU + {6142C17E-AE40-4A3C-AD26-F75713260F54}.Release|x86.Build.0 = Release|Any CPU {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Debug|x86.ActiveCfg = Debug|Any CPU + {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Debug|x86.Build.0 = Debug|Any CPU {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Deploy|x86.Build.0 = Deploy|Any CPU {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Release|Any CPU.ActiveCfg = Release|Any CPU {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Release|Any CPU.Build.0 = Release|Any CPU + {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Release|x86.ActiveCfg = Release|Any CPU + {476BE522-AEA4-468D-8A58-AA3B16EBDBED}.Release|x86.Build.0 = Release|Any CPU {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Debug|x86.ActiveCfg = Debug|Any CPU + {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Debug|x86.Build.0 = Debug|Any CPU {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Deploy|x86.Build.0 = Deploy|Any CPU {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Release|Any CPU.ActiveCfg = Release|Any CPU {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Release|Any CPU.Build.0 = Release|Any CPU + {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Release|x86.ActiveCfg = Release|Any CPU + {BD022297-AB3D-444B-A49E-455C6C1ED39E}.Release|x86.Build.0 = Release|Any CPU {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Debug|x86.ActiveCfg = Debug|Any CPU + {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Debug|x86.Build.0 = Debug|Any CPU {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Deploy|x86.Build.0 = Deploy|Any CPU {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Release|Any CPU.ActiveCfg = Release|Any CPU {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Release|Any CPU.Build.0 = Release|Any CPU + {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Release|x86.ActiveCfg = Release|Any CPU + {3EFB3571-E1D5-4891-85A3-BAD4993DF91F}.Release|x86.Build.0 = Release|Any CPU {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Debug|x86.ActiveCfg = Debug|Any CPU + {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Debug|x86.Build.0 = Debug|Any CPU {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Deploy|x86.Build.0 = Deploy|Any CPU {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Release|Any CPU.ActiveCfg = Release|Any CPU {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Release|Any CPU.Build.0 = Release|Any CPU + {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Release|x86.ActiveCfg = Release|Any CPU + {9315093A-B6D1-46EE-82FC-E709DB3768BF}.Release|x86.Build.0 = Release|Any CPU {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Debug|x86.ActiveCfg = Debug|Any CPU + {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Debug|x86.Build.0 = Debug|Any CPU {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Deploy|x86.Build.0 = Deploy|Any CPU {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Release|Any CPU.ActiveCfg = Release|Any CPU {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Release|Any CPU.Build.0 = Release|Any CPU + {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Release|x86.ActiveCfg = Release|Any CPU + {C1A88E11-9FC2-43FA-8147-05096AFB3519}.Release|x86.Build.0 = Release|Any CPU {FA376050-05BC-479F-8AA8-0DDF7843B174}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FA376050-05BC-479F-8AA8-0DDF7843B174}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA376050-05BC-479F-8AA8-0DDF7843B174}.Debug|x86.ActiveCfg = Debug|Any CPU + {FA376050-05BC-479F-8AA8-0DDF7843B174}.Debug|x86.Build.0 = Debug|Any CPU {FA376050-05BC-479F-8AA8-0DDF7843B174}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {FA376050-05BC-479F-8AA8-0DDF7843B174}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {FA376050-05BC-479F-8AA8-0DDF7843B174}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {FA376050-05BC-479F-8AA8-0DDF7843B174}.Deploy|x86.Build.0 = Deploy|Any CPU {FA376050-05BC-479F-8AA8-0DDF7843B174}.Release|Any CPU.ActiveCfg = Release|Any CPU {FA376050-05BC-479F-8AA8-0DDF7843B174}.Release|Any CPU.Build.0 = Release|Any CPU + {FA376050-05BC-479F-8AA8-0DDF7843B174}.Release|x86.ActiveCfg = Release|Any CPU + {FA376050-05BC-479F-8AA8-0DDF7843B174}.Release|x86.Build.0 = Release|Any CPU {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Debug|x86.ActiveCfg = Debug|Any CPU + {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Debug|x86.Build.0 = Debug|Any CPU {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Deploy|x86.Build.0 = Deploy|Any CPU {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Release|Any CPU.ActiveCfg = Release|Any CPU {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Release|Any CPU.Build.0 = Release|Any CPU + {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Release|x86.ActiveCfg = Release|Any CPU + {08ABBFB2-1EE3-4A4F-B794-98298DC5288D}.Release|x86.Build.0 = Release|Any CPU {79E3B202-0BF5-4113-8297-FCAE55774A30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {79E3B202-0BF5-4113-8297-FCAE55774A30}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79E3B202-0BF5-4113-8297-FCAE55774A30}.Debug|x86.ActiveCfg = Debug|Any CPU + {79E3B202-0BF5-4113-8297-FCAE55774A30}.Debug|x86.Build.0 = Debug|Any CPU {79E3B202-0BF5-4113-8297-FCAE55774A30}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {79E3B202-0BF5-4113-8297-FCAE55774A30}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {79E3B202-0BF5-4113-8297-FCAE55774A30}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {79E3B202-0BF5-4113-8297-FCAE55774A30}.Deploy|x86.Build.0 = Deploy|Any CPU {79E3B202-0BF5-4113-8297-FCAE55774A30}.Release|Any CPU.ActiveCfg = Release|Any CPU {79E3B202-0BF5-4113-8297-FCAE55774A30}.Release|Any CPU.Build.0 = Release|Any CPU + {79E3B202-0BF5-4113-8297-FCAE55774A30}.Release|x86.ActiveCfg = Release|Any CPU + {79E3B202-0BF5-4113-8297-FCAE55774A30}.Release|x86.Build.0 = Release|Any CPU {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Debug|x86.ActiveCfg = Debug|Any CPU + {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Debug|x86.Build.0 = Debug|Any CPU {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Deploy|x86.Build.0 = Deploy|Any CPU {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Release|Any CPU.ActiveCfg = Release|Any CPU {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Release|Any CPU.Build.0 = Release|Any CPU - {20802E22-C010-4F99-8A75-2904B5EC2FBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20802E22-C010-4F99-8A75-2904B5EC2FBF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20802E22-C010-4F99-8A75-2904B5EC2FBF}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU - {20802E22-C010-4F99-8A75-2904B5EC2FBF}.Deploy|Any CPU.Build.0 = Deploy|Any CPU - {20802E22-C010-4F99-8A75-2904B5EC2FBF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20802E22-C010-4F99-8A75-2904B5EC2FBF}.Release|Any CPU.Build.0 = Release|Any CPU + {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Release|x86.ActiveCfg = Release|Any CPU + {0FDC7C29-F359-41E2-B069-0B64A59CE1BD}.Release|x86.Build.0 = Release|Any CPU {CF288338-4B3F-4913-BD0E-9A741CED3023}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CF288338-4B3F-4913-BD0E-9A741CED3023}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF288338-4B3F-4913-BD0E-9A741CED3023}.Debug|x86.ActiveCfg = Debug|Any CPU + {CF288338-4B3F-4913-BD0E-9A741CED3023}.Debug|x86.Build.0 = Debug|Any CPU {CF288338-4B3F-4913-BD0E-9A741CED3023}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {CF288338-4B3F-4913-BD0E-9A741CED3023}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {CF288338-4B3F-4913-BD0E-9A741CED3023}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {CF288338-4B3F-4913-BD0E-9A741CED3023}.Deploy|x86.Build.0 = Deploy|Any CPU {CF288338-4B3F-4913-BD0E-9A741CED3023}.Release|Any CPU.ActiveCfg = Release|Any CPU {CF288338-4B3F-4913-BD0E-9A741CED3023}.Release|Any CPU.Build.0 = Release|Any CPU + {CF288338-4B3F-4913-BD0E-9A741CED3023}.Release|x86.ActiveCfg = Release|Any CPU + {CF288338-4B3F-4913-BD0E-9A741CED3023}.Release|x86.Build.0 = Release|Any CPU {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Debug|x86.ActiveCfg = Debug|Any CPU + {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Debug|x86.Build.0 = Debug|Any CPU {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Deploy|x86.Build.0 = Deploy|Any CPU {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Release|Any CPU.ActiveCfg = Release|Any CPU {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Release|Any CPU.Build.0 = Release|Any CPU + {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Release|x86.ActiveCfg = Release|Any CPU + {BB1C6133-FE01-40EA-9DB5-D5B8210F501B}.Release|x86.Build.0 = Release|Any CPU {92CC097C-A382-4B9A-9837-C6F3828F010F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {92CC097C-A382-4B9A-9837-C6F3828F010F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92CC097C-A382-4B9A-9837-C6F3828F010F}.Debug|x86.ActiveCfg = Debug|Any CPU + {92CC097C-A382-4B9A-9837-C6F3828F010F}.Debug|x86.Build.0 = Debug|Any CPU {92CC097C-A382-4B9A-9837-C6F3828F010F}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {92CC097C-A382-4B9A-9837-C6F3828F010F}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {92CC097C-A382-4B9A-9837-C6F3828F010F}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {92CC097C-A382-4B9A-9837-C6F3828F010F}.Deploy|x86.Build.0 = Deploy|Any CPU {92CC097C-A382-4B9A-9837-C6F3828F010F}.Release|Any CPU.ActiveCfg = Release|Any CPU {92CC097C-A382-4B9A-9837-C6F3828F010F}.Release|Any CPU.Build.0 = Release|Any CPU + {92CC097C-A382-4B9A-9837-C6F3828F010F}.Release|x86.ActiveCfg = Release|Any CPU + {92CC097C-A382-4B9A-9837-C6F3828F010F}.Release|x86.Build.0 = Release|Any CPU {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Debug|x86.ActiveCfg = Debug|Any CPU + {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Debug|x86.Build.0 = Debug|Any CPU {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Deploy|x86.Build.0 = Deploy|Any CPU {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Release|Any CPU.ActiveCfg = Release|Any CPU {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Release|Any CPU.Build.0 = Release|Any CPU + {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Release|x86.ActiveCfg = Release|Any CPU + {756DDA27-5C7B-41A2-AA0C-E3F34E1AC28A}.Release|x86.Build.0 = Release|Any CPU {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Debug|x86.ActiveCfg = Debug|Any CPU + {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Debug|x86.Build.0 = Debug|Any CPU {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Deploy|x86.Build.0 = Deploy|Any CPU {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Release|Any CPU.ActiveCfg = Release|Any CPU {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Release|Any CPU.Build.0 = Release|Any CPU + {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Release|x86.ActiveCfg = Release|Any CPU + {8984D4F7-61D7-4762-BD19-7458F32DA02C}.Release|x86.Build.0 = Release|Any CPU {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Debug|x86.ActiveCfg = Debug|Any CPU + {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Debug|x86.Build.0 = Debug|Any CPU {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Deploy|x86.Build.0 = Deploy|Any CPU {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Release|Any CPU.ActiveCfg = Release|Any CPU {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Release|Any CPU.Build.0 = Release|Any CPU + {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Release|x86.ActiveCfg = Release|Any CPU + {B2DDAF63-D76E-4D8A-AE20-E1ACCFDD80EC}.Release|x86.Build.0 = Release|Any CPU {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Debug|x86.ActiveCfg = Debug|Any CPU + {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Debug|x86.Build.0 = Debug|Any CPU {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Deploy|x86.Build.0 = Deploy|Any CPU {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Release|Any CPU.Build.0 = Release|Any CPU + {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Release|x86.ActiveCfg = Release|Any CPU + {50350EF8-9635-4FF3-90D3-55D41E495EC4}.Release|x86.Build.0 = Release|Any CPU {267585A7-D290-43CF-9268-C3DED5999F00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {267585A7-D290-43CF-9268-C3DED5999F00}.Debug|Any CPU.Build.0 = Debug|Any CPU + {267585A7-D290-43CF-9268-C3DED5999F00}.Debug|x86.ActiveCfg = Debug|Any CPU + {267585A7-D290-43CF-9268-C3DED5999F00}.Debug|x86.Build.0 = Debug|Any CPU {267585A7-D290-43CF-9268-C3DED5999F00}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {267585A7-D290-43CF-9268-C3DED5999F00}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {267585A7-D290-43CF-9268-C3DED5999F00}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {267585A7-D290-43CF-9268-C3DED5999F00}.Deploy|x86.Build.0 = Deploy|Any CPU {267585A7-D290-43CF-9268-C3DED5999F00}.Release|Any CPU.ActiveCfg = Release|Any CPU {267585A7-D290-43CF-9268-C3DED5999F00}.Release|Any CPU.Build.0 = Release|Any CPU + {267585A7-D290-43CF-9268-C3DED5999F00}.Release|x86.ActiveCfg = Release|Any CPU + {267585A7-D290-43CF-9268-C3DED5999F00}.Release|x86.Build.0 = Release|Any CPU {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Debug|x86.ActiveCfg = Debug|Any CPU + {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Debug|x86.Build.0 = Debug|Any CPU {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Deploy|x86.Build.0 = Deploy|Any CPU {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Release|Any CPU.ActiveCfg = Release|Any CPU {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Release|Any CPU.Build.0 = Release|Any CPU + {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Release|x86.ActiveCfg = Release|Any CPU + {6F66D13A-2347-4186-A98E-ADE59B7552ED}.Release|x86.Build.0 = Release|Any CPU {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Debug|x86.ActiveCfg = Debug|Any CPU + {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Debug|x86.Build.0 = Debug|Any CPU {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Deploy|x86.Build.0 = Deploy|Any CPU {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Release|Any CPU.Build.0 = Release|Any CPU + {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Release|x86.ActiveCfg = Release|Any CPU + {A330F9A5-061F-44A2-B87E-FD2E3A65716D}.Release|x86.Build.0 = Release|Any CPU {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Debug|x86.ActiveCfg = Debug|Any CPU + {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Debug|x86.Build.0 = Debug|Any CPU {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Deploy|x86.Build.0 = Deploy|Any CPU {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Release|Any CPU.ActiveCfg = Release|Any CPU {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Release|Any CPU.Build.0 = Release|Any CPU + {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Release|x86.ActiveCfg = Release|Any CPU + {FD580799-3D22-42F1-AA49-0AF82653DFFB}.Release|x86.Build.0 = Release|Any CPU {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Debug|x86.ActiveCfg = Debug|Any CPU + {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Debug|x86.Build.0 = Debug|Any CPU {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Deploy|x86.Build.0 = Deploy|Any CPU {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Release|Any CPU.ActiveCfg = Release|Any CPU {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Release|Any CPU.Build.0 = Release|Any CPU + {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Release|x86.ActiveCfg = Release|Any CPU + {A51FE553-264E-43DE-BB1A-C95ECDDDB760}.Release|x86.Build.0 = Release|Any CPU {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Debug|x86.ActiveCfg = Debug|Any CPU + {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Debug|x86.Build.0 = Debug|Any CPU {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Deploy|x86.Build.0 = Deploy|Any CPU {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Release|Any CPU.ActiveCfg = Release|Any CPU {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Release|Any CPU.Build.0 = Release|Any CPU + {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Release|x86.ActiveCfg = Release|Any CPU + {7342A868-F69D-4BC5-BAEA-7CEEAA1AFCAA}.Release|x86.Build.0 = Release|Any CPU {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Debug|x86.ActiveCfg = Debug|Any CPU + {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Debug|x86.Build.0 = Debug|Any CPU {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Deploy|x86.Build.0 = Deploy|Any CPU {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Release|Any CPU.ActiveCfg = Release|Any CPU {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Release|Any CPU.Build.0 = Release|Any CPU + {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Release|x86.ActiveCfg = Release|Any CPU + {9BE7316F-AA0D-46C5-9AC4-1038697884A0}.Release|x86.Build.0 = Release|Any CPU {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Debug|x86.ActiveCfg = Debug|Any CPU + {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Debug|x86.Build.0 = Debug|Any CPU {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Deploy|x86.Build.0 = Deploy|Any CPU {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Release|Any CPU.ActiveCfg = Release|Any CPU {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Release|Any CPU.Build.0 = Release|Any CPU + {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Release|x86.ActiveCfg = Release|Any CPU + {C402EA41-F756-4270-946C-D3DC4E1BAEB5}.Release|x86.Build.0 = Release|Any CPU {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Debug|x86.ActiveCfg = Debug|Any CPU + {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Debug|x86.Build.0 = Debug|Any CPU {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Deploy|x86.Build.0 = Deploy|Any CPU {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Release|Any CPU.ActiveCfg = Release|Any CPU {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Release|Any CPU.Build.0 = Release|Any CPU - {4D2E2A24-9FD4-49C9-8448-F7006ED790B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4D2E2A24-9FD4-49C9-8448-F7006ED790B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4D2E2A24-9FD4-49C9-8448-F7006ED790B8}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU - {4D2E2A24-9FD4-49C9-8448-F7006ED790B8}.Deploy|Any CPU.Build.0 = Deploy|Any CPU - {4D2E2A24-9FD4-49C9-8448-F7006ED790B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4D2E2A24-9FD4-49C9-8448-F7006ED790B8}.Release|Any CPU.Build.0 = Release|Any CPU - {CCD1C6AA-2C4E-40E1-8233-20875B5833D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CCD1C6AA-2C4E-40E1-8233-20875B5833D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CCD1C6AA-2C4E-40E1-8233-20875B5833D3}.Deploy|Any CPU.ActiveCfg = Debug|Any CPU - {CCD1C6AA-2C4E-40E1-8233-20875B5833D3}.Deploy|Any CPU.Build.0 = Debug|Any CPU - {CCD1C6AA-2C4E-40E1-8233-20875B5833D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CCD1C6AA-2C4E-40E1-8233-20875B5833D3}.Release|Any CPU.Build.0 = Release|Any CPU - {059FF15F-D78A-4727-BA84-16836EB9F2DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {059FF15F-D78A-4727-BA84-16836EB9F2DF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {059FF15F-D78A-4727-BA84-16836EB9F2DF}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU - {059FF15F-D78A-4727-BA84-16836EB9F2DF}.Deploy|Any CPU.Build.0 = Deploy|Any CPU - {059FF15F-D78A-4727-BA84-16836EB9F2DF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {059FF15F-D78A-4727-BA84-16836EB9F2DF}.Release|Any CPU.Build.0 = Release|Any CPU - {675101BD-867F-4268-838B-F1E673B9007A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {675101BD-867F-4268-838B-F1E673B9007A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {675101BD-867F-4268-838B-F1E673B9007A}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU - {675101BD-867F-4268-838B-F1E673B9007A}.Deploy|Any CPU.Build.0 = Deploy|Any CPU - {675101BD-867F-4268-838B-F1E673B9007A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {675101BD-867F-4268-838B-F1E673B9007A}.Release|Any CPU.Build.0 = Release|Any CPU + {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Release|x86.ActiveCfg = Release|Any CPU + {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A}.Release|x86.Build.0 = Release|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Debug|x86.ActiveCfg = Debug|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Debug|x86.Build.0 = Debug|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Deploy|x86.Build.0 = Deploy|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Release|Any CPU.Build.0 = Release|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Release|x86.ActiveCfg = Release|Any CPU + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824}.Release|x86.Build.0 = Release|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Debug|x86.ActiveCfg = Debug|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Debug|x86.Build.0 = Debug|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Deploy|x86.Build.0 = Deploy|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Release|Any CPU.Build.0 = Release|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Release|x86.ActiveCfg = Release|Any CPU + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2}.Release|x86.Build.0 = Release|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Debug|x86.ActiveCfg = Debug|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Debug|x86.Build.0 = Debug|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Deploy|x86.Build.0 = Deploy|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Release|Any CPU.Build.0 = Release|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Release|x86.ActiveCfg = Release|Any CPU + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5}.Release|x86.Build.0 = Release|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Debug|x86.ActiveCfg = Debug|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Debug|x86.Build.0 = Debug|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Deploy|x86.Build.0 = Deploy|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Release|Any CPU.Build.0 = Release|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Release|x86.ActiveCfg = Release|Any CPU + {ACDE147D-DEB7-4770-BA09-B1605DF15716}.Release|x86.Build.0 = Release|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Debug|x86.ActiveCfg = Debug|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Debug|x86.Build.0 = Debug|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Deploy|x86.Build.0 = Deploy|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Release|Any CPU.Build.0 = Release|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Release|x86.ActiveCfg = Release|Any CPU + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008}.Release|x86.Build.0 = Release|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Debug|x86.ActiveCfg = Debug|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Debug|x86.Build.0 = Debug|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Deploy|x86.Build.0 = Deploy|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Release|Any CPU.Build.0 = Release|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Release|x86.ActiveCfg = Release|Any CPU + {0E666045-9D4C-4201-B223-43CE214207DF}.Release|x86.Build.0 = Release|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Debug|x86.ActiveCfg = Debug|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Debug|x86.Build.0 = Debug|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Deploy|x86.Build.0 = Deploy|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Release|Any CPU.ActiveCfg = Release|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Release|Any CPU.Build.0 = Release|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Release|x86.ActiveCfg = Release|Any CPU + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05}.Release|x86.Build.0 = Release|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Debug|x86.ActiveCfg = Debug|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Debug|x86.Build.0 = Debug|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Deploy|x86.ActiveCfg = Deploy|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Deploy|x86.Build.0 = Deploy|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Release|Any CPU.Build.0 = Release|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Release|x86.ActiveCfg = Release|Any CPU + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1140,9 +1857,6 @@ Global {8EB251DC-80E5-4334-A869-DC96929418CE} = {C5F530E1-F5AF-4D37-9250-A7506DAE86C6} {168F3B3F-46FC-42D7-806D-F7E6AB56EB9A} = {C5F530E1-F5AF-4D37-9250-A7506DAE86C6} {197DBD10-4BFC-455B-A20C-74C56BF50114} = {725BD0C7-E20F-44C7-AB93-6B13AFDED524} - {88D00E0D-1FF5-410B-9C11-17CC98BFD3BE} = {197DBD10-4BFC-455B-A20C-74C56BF50114} - {0E3AAF01-A095-48A8-9C03-78B56D01EDC0} = {197DBD10-4BFC-455B-A20C-74C56BF50114} - {6AA94144-9108-4620-85ED-869BFE729303} = {197DBD10-4BFC-455B-A20C-74C56BF50114} {4120F08F-0461-406D-88A4-B31E0984F2F4} = {725BD0C7-E20F-44C7-AB93-6B13AFDED524} {43D621D9-7297-4444-8DE9-B6A0CEFAC079} = {4120F08F-0461-406D-88A4-B31E0984F2F4} {0AFD4A07-0D47-460A-84AA-4E2968B8FC74} = {4120F08F-0461-406D-88A4-B31E0984F2F4} @@ -1225,7 +1939,6 @@ Global {1EC9E282-82E3-4301-999A-653031B7931E} = {725BD0C7-E20F-44C7-AB93-6B13AFDED524} {FF02EAF9-A82E-4EA7-AF12-ADA5479B5D84} = {1EC9E282-82E3-4301-999A-653031B7931E} {6D332C2E-5CF3-4BFF-9D8F-D256E574033B} = {1EC9E282-82E3-4301-999A-653031B7931E} - {75DE8955-BA8B-49F5-9FD2-4797EE418C3E} = {CE2D75B9-FC4A-41C6-84B8-AD838A70C1FF} {9FF47FE0-9E1B-482D-B15C-AA714D9266A6} = {8ED30995-03AD-4E9C-996E-3DC6820F78F9} {9B2CD357-F5BF-4620-A30D-1E64493C4727} = {CE2D75B9-FC4A-41C6-84B8-AD838A70C1FF} {0DC3D58C-E587-48C8-88D6-09C492696A70} = {8ED30995-03AD-4E9C-996E-3DC6820F78F9} @@ -1242,7 +1955,6 @@ Global {08ABBFB2-1EE3-4A4F-B794-98298DC5288D} = {CE2D75B9-FC4A-41C6-84B8-AD838A70C1FF} {79E3B202-0BF5-4113-8297-FCAE55774A30} = {CE2D75B9-FC4A-41C6-84B8-AD838A70C1FF} {0FDC7C29-F359-41E2-B069-0B64A59CE1BD} = {CE2D75B9-FC4A-41C6-84B8-AD838A70C1FF} - {20802E22-C010-4F99-8A75-2904B5EC2FBF} = {22A60CBA-5ADA-47C6-95B4-EAEC014EC878} {CF288338-4B3F-4913-BD0E-9A741CED3023} = {22A60CBA-5ADA-47C6-95B4-EAEC014EC878} {BB1C6133-FE01-40EA-9DB5-D5B8210F501B} = {22A60CBA-5ADA-47C6-95B4-EAEC014EC878} {92CC097C-A382-4B9A-9837-C6F3828F010F} = {22A60CBA-5ADA-47C6-95B4-EAEC014EC878} @@ -1259,11 +1971,14 @@ Global {9BE7316F-AA0D-46C5-9AC4-1038697884A0} = {22A60CBA-5ADA-47C6-95B4-EAEC014EC878} {C402EA41-F756-4270-946C-D3DC4E1BAEB5} = {CE2D75B9-FC4A-41C6-84B8-AD838A70C1FF} {FAFB2DB1-AF3A-4F78-8BBB-124C51C4D62A} = {4D2003A8-CBCB-498C-9186-355650A84D41} - {4D2E2A24-9FD4-49C9-8448-F7006ED790B8} = {F20B097A-6283-426E-A9B5-D71E498E4A78} - {CCD1C6AA-2C4E-40E1-8233-20875B5833D3} = {C2277D2F-C982-420A-AD8D-82452A83793B} - {059FF15F-D78A-4727-BA84-16836EB9F2DF} = {C2277D2F-C982-420A-AD8D-82452A83793B} - {675101BD-867F-4268-838B-F1E673B9007A} = {C2277D2F-C982-420A-AD8D-82452A83793B} - {C2277D2F-C982-420A-AD8D-82452A83793B} = {F20B097A-6283-426E-A9B5-D71E498E4A78} + {0A62EF72-0CCA-4FE1-A215-A715AC5BA824} = {BE5FDAD0-2F5E-4194-8E3A-1132508FF3B0} + {7210E435-8FCB-49FA-B7A6-4D94C57DE7A2} = {4D2003A8-CBCB-498C-9186-355650A84D41} + {F19BB38A-6A21-41A7-89C3-2F5C0FB99FA5} = {BE5FDAD0-2F5E-4194-8E3A-1132508FF3B0} + {ACDE147D-DEB7-4770-BA09-B1605DF15716} = {C5F530E1-F5AF-4D37-9250-A7506DAE86C6} + {0F8C0C49-34FD-4446-B0B5-C28F6D58A008} = {241110F0-E21B-45F0-A8AD-ACE945DDD44E} + {0E666045-9D4C-4201-B223-43CE214207DF} = {197DBD10-4BFC-455B-A20C-74C56BF50114} + {11CB72C0-B53B-4611-83AF-B6CA62B4EC05} = {CE2D75B9-FC4A-41C6-84B8-AD838A70C1FF} + {D908EFB1-B5E1-4CB0-88BE-BD89CB4DE8D3} = {22A60CBA-5ADA-47C6-95B4-EAEC014EC878} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CA9C7EC5-FDF7-444C-99C8-7BDBE8AF4EDB} diff --git a/Source/Program/Actions/PerformSttoAction.cs b/Source/Program/Actions/PerformSttoAction.cs new file mode 100644 index 0000000..5f34e3b --- /dev/null +++ b/Source/Program/Actions/PerformSttoAction.cs @@ -0,0 +1,253 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Windows; +using System.Xml; +using NLog; +using ProgramLib.GUI.Model; +using ProgramLib.GUI.View; +using ProgramLib.GUI.ViewModel; +using Raytheon.Common.PdelWriter.Utilities; +using static MeasurementManagerLib.SwitchMeasurementManager; + +namespace ProgramLib +{ + /// + /// Perform Safe-to-turn-on (STTO) + /// + internal class PerformSttoAction : BasicAction + { + private List _dmmResistanceMeasurements = new List(); + private static NLog.ILogger _logger; + + private Exception _exceptionFromSuportThread; + + public PerformSttoAction() + { + _logger = LogManager.GetCurrentClassLogger(); + } + + /// + /// Run the action + /// + public override void Run() + { + // No need to perform STTO when connected to real missile because signals are not looped back to the switch matrix + if (!Program.Instance().IsThereHardware || Program.Instance().UutInfo.UutBuildLevel == UutInfo.BuildLevel.SELF_TEST) + { + ParseDmmResistanceMeasurementList(); + + Task.Factory.StartNew(() => PerformSttoTask()); + ProgramLib.Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.DEFAULT].Dispatcher.Invoke((Action)delegate + { + ProgramLib.Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].ShowDialog(); + }); + + if (_exceptionFromSuportThread != null) + { + throw new Exception("Check inner exception.", _exceptionFromSuportThread); + } + + RecordDateOfSucessfulSelfTestRunToLog(); + } + else + throw new Exception("Please connect W5 cable to perform STTO checks"); + } + + /// + /// Record date of successful self test run to log + /// + private void RecordDateOfSucessfulSelfTestRunToLog() + { + if (Program.Instance().IsThereHardware) + { + XmlDocumentWrapper doc = new XmlDocumentWrapper(Program.Instance().FileAndFolderManager.GetFile(FileAndFolderManager.Files.CABLE_SELF_TEST_RUN_LOG)); + XmlNode node = doc.GetNode(CableSelfTestConfigXml.SelfTestPath); + + bool existingNodeFound = false; + + while (node != null) + { + if (node.Attributes[CableSelfTestConfigXml.UniversalCableAttributeName] != null && String.Equals(node.Attributes[CableSelfTestConfigXml.UniversalCableAttributeName].Value, Program.Instance().UutInfo.UniversalCableId.ToString(), StringComparison.OrdinalIgnoreCase) + && node.Attributes[CableSelfTestConfigXml.SacrificialCableAttributeName] != null && String.Equals(node.Attributes[CableSelfTestConfigXml.SacrificialCableAttributeName].Value, Program.Instance().UutInfo.SacrificialCableId.ToString(), StringComparison.OrdinalIgnoreCase)) + { + Dictionary attributesDict = new Dictionary(); + attributesDict[CableSelfTestConfigXml.LastRunDateAttributeName] = DateTime.Now.ToString("MM/dd/yyyy"); + + doc.ChangeNode(node, attributesDict); + + existingNodeFound = true; + break; + } + node = node.NextSibling; + } + + if (!existingNodeFound) + { + Dictionary attributesDict = new Dictionary(); + attributesDict[CableSelfTestConfigXml.UniversalCableAttributeName] = Program.Instance().UutInfo.UniversalCableId.ToString(); + attributesDict[CableSelfTestConfigXml.SacrificialCableAttributeName] = Program.Instance().UutInfo.SacrificialCableId.ToString(); + attributesDict[CableSelfTestConfigXml.LastRunDateAttributeName] = DateTime.Now.ToString("MM/dd/yyyy"); + doc.AddNode(CableSelfTestConfigXml.SelfTestPath, attributesDict); + } + + doc.SaveToFile(); + } + } + + /// + /// Parse resistance measurement list + /// + private void ParseDmmResistanceMeasurementList() + { + string SECTION_NAME = "_STTO"; + + string cable = "W3"; + if (ProgramLib.Program.Instance().UutInfo.SacrificialCableId == UutInfo.SacrificialCable.W4) + { + cable = "W4"; + } + + SECTION_NAME = cable + SECTION_NAME; + + List keys = Program.Instance().ProgramSpecificConfig.ReadAllKeys(SECTION_NAME); + foreach (string key in keys) + { + _dmmResistanceMeasurements.Add(Program.Instance().ProgramSpecificConfig.ReadValue(SECTION_NAME, key)); + } + } + + /// + /// Perform Safe-to-turn-on checks + /// + private void PerformSttoTask() + { + ImpedanceDataModel impedanceDataModel; + ImpedanceCheckWindow impedanceCheckWindow = (ImpedanceCheckWindow)ProgramLib.Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK]; + bool sttoSuccess = true; + int firstFailIndex = -1; + + try + { + _logger?.Debug($"{this.GetType().Name}::PerformSttoTask() running..."); + + string measurementStatus = "PASSED"; + + ImpedanceCheckWindowViewModel.Images passFailImage = ImpedanceCheckWindowViewModel.Images.PASS_CHECK; + impedanceCheckWindow.ViewModel.ClearData(); + + string sttoFailMsg = String.Empty; + int loopCount = 0; + + foreach (string measurement in _dmmResistanceMeasurements) + { + TestResult pdelResultInfo = new TestResult(); + measurementStatus = "PASSED"; + passFailImage = ImpedanceCheckWindowViewModel.Images.PASS_CHECK; + impedanceDataModel = new ImpedanceDataModel(); + DMMResistanceMeasurementFields dmmResistanceMeasurementInfo = Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.DmmResistanceMeasurements[measurement]; + double testResult = Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.DmmReadResistance(measurement); + + if (testResult < dmmResistanceMeasurementInfo._lowerLimit || testResult > dmmResistanceMeasurementInfo._upperLimit) + { + passFailImage = ImpedanceCheckWindowViewModel.Images.FAIL_CHECK; + measurementStatus = "FAILED"; + sttoSuccess = false; + } + + string cableAndPinId = dmmResistanceMeasurementInfo._cableAndPinId; + if (Program.Instance().UutInfo.UniversalCableId == UutInfo.UniversalCable.W2) + cableAndPinId = Regex.Replace(cableAndPinId, UutInfo.UniversalCable.W1.ToString() + @"_", UutInfo.UniversalCable.W2.ToString() + @"_", RegexOptions.IgnoreCase); + + impedanceDataModel.PassFailImagePath = impedanceCheckWindow.ViewModel.ImageToResourcePathDict[passFailImage]; + impedanceDataModel.Description = $"{measurement}, {cableAndPinId} Measured {Util.AutoFormatNumberToString(testResult)} Range [{Util.AutoFormatNumberToString(dmmResistanceMeasurementInfo._lowerLimit)}, {Util.AutoFormatNumberToString(dmmResistanceMeasurementInfo._upperLimit)}]"; + + if (sttoSuccess == false && String.IsNullOrEmpty(sttoFailMsg)) + { + sttoFailMsg = impedanceDataModel.Description; + } + + if (Program.TestStandSeqContext != null) + { + Program.TestStandSeqContext.Step.AdditionalResults.CustomResults.Insert($"\"{measurement}, {cableAndPinId}\"", $"\"Measured: {Util.AutoFormatNumberToString(testResult)} Range [{Util.AutoFormatNumberToString(dmmResistanceMeasurementInfo._lowerLimit)}, {Util.AutoFormatNumberToString(dmmResistanceMeasurementInfo._upperLimit)}] - {measurementStatus}\""); + + TestStand.ProgramManager.SaveOriginalStepSetting(ProgramLib.Program.TestStandSeqContext.Step.StepIndex, ProgramLib.Program.TestStandSeqContext.StepGroup, ProgramLib.Program.TestStandSeqContext.Step.PostExpression, true); + } + + impedanceCheckWindow.ViewModel.AddData(impedanceDataModel); + + pdelResultInfo.PCode = dmmResistanceMeasurementInfo._pcode; + pdelResultInfo.TestName = dmmResistanceMeasurementInfo._cableAndPinId; + pdelResultInfo.MeasuredValue = Math.Round(testResult, 5); + pdelResultInfo.Result = PassFailStatus.Fail; + if (measurementStatus == "PASSED") + { + pdelResultInfo.Result = PassFailStatus.Pass; + } + + ProgramLib.Program.Instance().PcodeTestResultList.List.Add(pdelResultInfo); + + if (!sttoSuccess && firstFailIndex == -1) + { + firstFailIndex = loopCount; + } + + loopCount++; + } + + if (!sttoSuccess) + { + throw new Exception(sttoFailMsg); + } + } + catch (Exception ex) + { + _exceptionFromSuportThread = ex; + } + finally + { + ProgramLib.Program.Instance().PdelData.TestStopTime = DateTime.Now; + if (!sttoSuccess) + { + impedanceCheckWindow.Dispatcher.Invoke((Action)delegate + { + impedanceCheckWindow.btnClose.Visibility = Visibility.Visible; + + // scroll to the first failed item + if (firstFailIndex != -1) + { + impedanceCheckWindow.lvImpedanceCheck.ScrollIntoView(impedanceCheckWindow.lvImpedanceCheck.Items.GetItemAt(firstFailIndex)); + } + }); + } + else + { + impedanceCheckWindow.Dispatcher.Invoke((Action)delegate + { + impedanceCheckWindow.Hide(); + }); + } + + _logger?.Debug($"{this.GetType().Name}::PerformSttoTask() exiting..."); + } + } + } +} diff --git a/Source/Program/Actions/PerformTacticalUartCommAction.cs b/Source/Program/Actions/PerformTacticalUartCommAction.cs new file mode 100644 index 0000000..97a7f0e --- /dev/null +++ b/Source/Program/Actions/PerformTacticalUartCommAction.cs @@ -0,0 +1,302 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using NLog; +using Raytheon.Instruments; + +namespace ProgramLib +{ + /// + /// Send Test Messages to UUT via TCP sockets + /// + internal class PerformTacticalUartCommAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + + private ICommDevice _serialDevice; + + private List _receiveByteList = new List(); + + private int _expectedPbitAggregate; + + #endregion + + /// + /// Constructor + /// + /// + public PerformTacticalUartCommAction() + { + string expectedPbitAggregate; + _logger = LogManager.GetCurrentClassLogger(); + + string serialDeviceInstanceName = Program.Instance().ProgramSpecificConfig.ReadValue("UART_INFO", "SERIAL_DEVICE_INSTANCE_NAME"); + expectedPbitAggregate = Program.Instance().ProgramSpecificConfig.ReadValue("PBIT_INFO", "SUCCESSFUL_PBIT_AGGREGATE_VALUE"); + _expectedPbitAggregate = Convert.ToInt32(expectedPbitAggregate, 16); + _serialDevice = (ICommDevice)Program.Instance().InstrumentManager.GetGenericInstrument(serialDeviceInstanceName); + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + if (Program.Instance().IsUutPwrOn) + { + SendHandshakeAndGetResponse(); + SendAckNackAndGetResponse(); + } + else + { + throw new Exception("Cannot send message to UUT because UUT is not powered on."); + } + } + catch (Exception) + { + throw; + } + } + + /// + /// Send AckNack message and get response + /// + /// + public void SendAckNackAndGetResponse() + { + UartAckNackMessage msg = new UartAckNackMessage(0x0C, 1); + List msgByteList = Util.StructToByteList(msg).ToList(); + // remove checksum byte + msgByteList.RemoveAt(msgByteList.Count - 1); + msgByteList.Add(Util.GetTwosComplimentChecksum(msgByteList.ToArray())); + _serialDevice.Write(msgByteList.ToArray(), (uint)msgByteList.Count); + _logger.Info($"Raw AckNackMsg Sent: {Util.ByteArrayToHexString(msgByteList.ToArray())}"); + + UartPbitResultMessage pbitMsg = new UartPbitResultMessage(); + List pbitMsgByteList = Util.StructToByteList(pbitMsg).ToList(); + + _logger.Info($"Waiting for PBIT Result from UUT"); + byte[] byteArray; + DateTime startDateTime = DateTime.Now; + TimeSpan ts = DateTime.Now - startDateTime; + const int MAX_PBIT_WAIT_SEC = 7; + List pBitReceivedByteList = new List(); + bool pBitMsgFound = false; + while (ts.TotalSeconds < MAX_PBIT_WAIT_SEC) + { + ts = DateTime.Now - startDateTime; + + if (TacticalUartReadThread._byteQueue.Count > 0) + { + TacticalUartReadThread._byteQueue.TryDequeue(out byteArray); + _receiveByteList.AddRange(byteArray); + } + else + Thread.Sleep(100); + + if (_receiveByteList.Count < pbitMsgByteList.Count) + { + continue; + } + + int index = 0; + bool needMoreData = false; + do + { + if (_receiveByteList[index] == pbitMsg.Id) + { + pBitReceivedByteList = _receiveByteList.Skip(index).Take(_receiveByteList.Count - index).ToList(); + if (pBitReceivedByteList.Count < pbitMsgByteList.Count) + { + _receiveByteList = pBitReceivedByteList; + needMoreData = true; + break; + } + + pBitReceivedByteList = pBitReceivedByteList.Skip(0).Take(pbitMsgByteList.Count).ToList(); + if (Util.GetTwosComplimentChecksum(pBitReceivedByteList.Skip(0).Take(pbitMsgByteList.Count - 1).ToArray()) != pBitReceivedByteList[pBitReceivedByteList.Count - 1]) + { + index++; + } + else + { + int numBytesToRemove = index + pBitReceivedByteList.Count; + + if (numBytesToRemove == _receiveByteList.Count) + _receiveByteList.Clear(); + else + _receiveByteList = _receiveByteList.Skip(numBytesToRemove).Take(_receiveByteList.Count - numBytesToRemove).ToList(); + + pBitMsgFound = true; + break; + } + } + else + index++; + + if (index == _receiveByteList.Count) + { + _receiveByteList.Clear(); + needMoreData = true; + break; + } + } + while (true); + + if (!needMoreData) + { + break; + } + } + + if (pBitMsgFound) + { + _logger.Info($"Raw Msg Received: {Util.ByteArrayToHexString(pBitReceivedByteList.ToArray(), pbitMsgByteList.Count)}"); + + UartPbitResultMessage rsp = Util.ByteArrayToStruct(pBitReceivedByteList.ToArray()); + _logger.Info($"PbitResult Fields: PbitFinalResult={rsp.PbitFinalResult}, PbitAggregate=0x{rsp.PbitAggregate.ToString("X4")}, GSP_Temp={rsp.GspTemp} C, Lifetime_Time={rsp.LifetimeTime} sec, Lifetime_Count={rsp.LifetimeCount}"); + + if (rsp.PbitAggregate != _expectedPbitAggregate) + { + _logger.Error("UUT's PBIT failed."); + } + } + else + { + throw new Exception("Timed out waiting for PBIT result."); + } + } + + /// + /// Send Handshake message and get response + /// + /// + public void SendHandshakeAndGetResponse() + { + UartHandshakeMessage handshakeMsg = new UartHandshakeMessage(0xCCAAFFEEDDAAEEDD, 0xDDEEAADDEEFFAACC); + List handshakeMsgByteList = Util.StructToByteList(handshakeMsg).ToList(); + // remove checksum byte + handshakeMsgByteList.RemoveAt(handshakeMsgByteList.Count - 1); + handshakeMsgByteList.Add(Util.GetTwosComplimentChecksum(handshakeMsgByteList.ToArray())); + _serialDevice.Write(handshakeMsgByteList.ToArray(), (uint)handshakeMsgByteList.Count); + _logger.Info($"Raw HandshakeMsg Sent: {Util.ByteArrayToHexString(handshakeMsgByteList.ToArray())}"); + + _logger.Info($"Waiting for HandshakeMsg from UUT"); + byte[] byteArray; + DateTime startDateTime = DateTime.Now; + TimeSpan ts = DateTime.Now - startDateTime; + const int MAX_HANDSHAKE_WAIT_SEC = 7; + List handshakeReceivedByteList = new List(); + bool handshakeMsgFound = false; + double secondCount = 0.0; + while (ts.TotalSeconds < MAX_HANDSHAKE_WAIT_SEC) + { + ts = DateTime.Now - startDateTime; + + if (ts.TotalSeconds > secondCount) + { + _serialDevice.Write(handshakeMsgByteList.ToArray(), (uint)handshakeMsgByteList.Count); + _logger.Info($"Raw HandshakeMsg Sent: {Util.ByteArrayToHexString(handshakeMsgByteList.ToArray())}"); + secondCount = ts.TotalSeconds; + } + + if (TacticalUartReadThread._byteQueue.Count > 0) + { + TacticalUartReadThread._byteQueue.TryDequeue(out byteArray); + _receiveByteList.AddRange(byteArray); + } + else + Thread.Sleep(100); + + if (_receiveByteList.Count < handshakeMsgByteList.Count) + { + continue; + } + + int index = 0; + bool needMoreData = false; + do + { + if (_receiveByteList[index] == handshakeMsg.Id) + { + handshakeReceivedByteList = _receiveByteList.Skip(index).Take(_receiveByteList.Count - index).ToList(); + if (handshakeReceivedByteList.Count < handshakeMsgByteList.Count) + { + _receiveByteList = handshakeReceivedByteList; + needMoreData = true; + break; + } + + handshakeReceivedByteList = handshakeReceivedByteList.Skip(0).Take(handshakeMsgByteList.Count).ToList(); + if (Util.GetTwosComplimentChecksum(handshakeReceivedByteList.Skip(0).Take(handshakeMsgByteList.Count - 1).ToArray()) != handshakeReceivedByteList[handshakeReceivedByteList.Count - 1]) + { + index++; + } + else + { + int numBytesToRemove = index + handshakeReceivedByteList.Count; + + if (numBytesToRemove == _receiveByteList.Count) + _receiveByteList.Clear(); + else + _receiveByteList = _receiveByteList.Skip(numBytesToRemove).Take(_receiveByteList.Count - numBytesToRemove).ToList(); + + handshakeMsgFound = true; + break; + } + } + else + index++; + + if (index == _receiveByteList.Count) + { + _receiveByteList.Clear(); + needMoreData = true; + break; + } + } + while (true); + + if (!needMoreData) + { + break; + } + } + + if (handshakeMsgFound) + { + _logger.Info($"Raw Msg Received: {Util.ByteArrayToHexString(handshakeReceivedByteList.ToArray(), handshakeMsgByteList.Count)}"); + + UartHandshakeMessage rsp = Util.ByteArrayToStruct(handshakeReceivedByteList.ToArray()); + _logger.Info($"Handshake Fields: Pattern1=0x{rsp.Pattern1.ToString("X8")}, Pattern2=0x{rsp.Pattern2.ToString("X8")}"); + } + else + { + throw new Exception("Timed out waiting for HandshakeMsg."); + } + } + } +} diff --git a/Source/Program/Actions/SendCoeAdnucMsgToUutAction.cs b/Source/Program/Actions/SendCoeAdnucMsgToUutAction.cs new file mode 100644 index 0000000..b053a85 --- /dev/null +++ b/Source/Program/Actions/SendCoeAdnucMsgToUutAction.cs @@ -0,0 +1,130 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Threading; +using NLog; +using Raytheon.Common.Coe; +using Raytheon.Instruments; + +namespace ProgramLib +{ + /// + /// Send COE Message to UUT + /// + internal class SendCoeAdnucMsgToUutAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + + private string _coeDeviceName; + private string _msgName = "NgsriAdnucStateMsg"; + + public static Coe.MmgrState mMgrState = Coe.MmgrState.NOT_SET; + + #endregion + + /// + /// Constructor + /// + /// name of COE device + /// + public SendCoeAdnucMsgToUutAction(string coeDeviceName) + { + _logger = LogManager.GetCurrentClassLogger(); + + _coeDeviceName = coeDeviceName; + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + if (Program.Instance().IsUutPwrOn) + { + CoeResponseMsgData missionManagerMsg = null; + bool firstMissionManagerMsgReceived = false; + const int MAX_RETRIES = 5; + int retry = 0; + CoeFieldData val = null; + mMgrState = Coe.MmgrState.NOT_SET; + Coe.MmgrState desiredMmgrState = Coe.MmgrState.CALIBRATION; + + string missionManagerMessageName = "MissionManagerMsgLL"; + _logger.Info($"Waiting for message {missionManagerMessageName}"); + do + { + Thread.Sleep(1000); + missionManagerMsg = Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.GetNextResponseInQueue(_coeDeviceName, missionManagerMessageName); + + if (missionManagerMsg != null) + { + if (!firstMissionManagerMsgReceived) + firstMissionManagerMsgReceived = true; + + val = missionManagerMsg.GetFieldData("data.mmgrState"); + + if (Enum.TryParse(val.FieldValue, out mMgrState)) + { + _logger.Info($"Current mission state: {mMgrState.ToString()}"); + + if (mMgrState == desiredMmgrState) + break; + } + else + { + _logger.Warn($"Invalid mission state: {val.FieldValue}"); + } + } + } while (retry++ < MAX_RETRIES && (missionManagerMsg == null || mMgrState != desiredMmgrState)); + + if (!firstMissionManagerMsgReceived) + { + throw new Exception($"Timed out waiting for Mission Manager's state message"); + } + + if (mMgrState != desiredMmgrState) + { + throw new Exception($"Timed out waiting for Mission Manager to transition to {desiredMmgrState}"); + } + + Thread.Sleep(1000); + Message msg = Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.CreateMessage(_coeDeviceName, _msgName); + string adnucState = "2"; + msg.Set("data.adnucState", adnucState); + var parms = msg.GetParameters(); + _logger.Info($"Sending {_msgName}, adnucState={adnucState}"); + Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.SendMessage(_coeDeviceName, _msgName, parms); + } + else + { + throw new Exception("Cannot send message to UUT because UUT is not powered on."); + } + } + catch (Exception) + { + throw; + } + } + } +} diff --git a/Source/Program/Actions/SendCoeBatteryGoodMsgToUutAction.cs b/Source/Program/Actions/SendCoeBatteryGoodMsgToUutAction.cs new file mode 100644 index 0000000..016076f --- /dev/null +++ b/Source/Program/Actions/SendCoeBatteryGoodMsgToUutAction.cs @@ -0,0 +1,130 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Threading; +using NLog; +using Raytheon.Common.Coe; +using Raytheon.Instruments; + +namespace ProgramLib +{ + /// + /// Send COE Message to UUT + /// + internal class SendCoeBatteryGoodMsgToUutAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + + private string _coeDeviceName; + private string _msgName = "UmbilicalRetractBatteryGoodMsg"; + + #endregion + + /// + /// Constructor + /// + /// name of COE device + /// + public SendCoeBatteryGoodMsgToUutAction(string coeDeviceName) + { + _logger = LogManager.GetCurrentClassLogger(); + + _coeDeviceName = coeDeviceName; + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + if (Program.Instance().IsUutPwrOn) + { + if (SendCoeUncageMsgToUutAction.mMgrState == Coe.MmgrState.ACQUISITION) + { + CoeResponseMsgData missionManagerMsg = null; + bool firstMissionManagerMsgReceived = false; + const int MAX_RETRIES = 5; + int retry = 0; + CoeFieldData val = null; + Coe.MmgrState mMgrState = Coe.MmgrState.NOT_SET; + Coe.MmgrState desiredMmgrState = Coe.MmgrState.PRELAUNCH; + + string missionManagerMessageName = "MissionManagerMsgLL"; + _logger.Info($"Waiting for message {missionManagerMessageName}"); + do + { + Thread.Sleep(1000); + missionManagerMsg = Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.GetNextResponseInQueue(_coeDeviceName, missionManagerMessageName); + + if (missionManagerMsg != null) + { + if (!firstMissionManagerMsgReceived) + firstMissionManagerMsgReceived = true; + + val = missionManagerMsg.GetFieldData("data.mmgrState"); + + if (Enum.TryParse(val.FieldValue, out mMgrState)) + { + _logger.Info($"Current mission state: {mMgrState.ToString()}"); + + if (mMgrState == desiredMmgrState) + break; + } + else + { + _logger.Warn($"Invalid mission state: {val.FieldValue}"); + } + } + } while (retry++ < MAX_RETRIES && (missionManagerMsg == null || mMgrState != desiredMmgrState)); + + if (!firstMissionManagerMsgReceived) + { + throw new Exception($"Timed out waiting for Mission Manager's state message"); + } + + if (mMgrState != desiredMmgrState) + { + throw new Exception($"Timed out waiting for Mission Manager to transition to {desiredMmgrState}"); + } + + Message msg = Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.CreateMessage(_coeDeviceName, _msgName); + string batteryGoodState = "1"; + msg.Set("data.umbilicalRetractBatteryGood", batteryGoodState); + var parms = msg.GetParameters(); + _logger.Info($"Sending {_msgName}, umbilicalRetractBatteryGood={batteryGoodState}"); + Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.SendMessage(_coeDeviceName, _msgName, parms); + } + } + else + { + throw new Exception("Cannot send message to UUT because UUT is not powered on."); + } + } + catch (Exception) + { + throw; + } + } + } +} diff --git a/Source/Program/Actions/SendCoeUncageMsgToUutAction.cs b/Source/Program/Actions/SendCoeUncageMsgToUutAction.cs new file mode 100644 index 0000000..71589c5 --- /dev/null +++ b/Source/Program/Actions/SendCoeUncageMsgToUutAction.cs @@ -0,0 +1,132 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Threading; +using NLog; +using Raytheon.Common.Coe; +using Raytheon.Instruments; + +namespace ProgramLib +{ + /// + /// Send COE Message to UUT + /// + internal class SendCoeUncageMsgToUutAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + + private string _coeDeviceName; + private string _msgName = "CageStateMsg"; + + public static Coe.MmgrState mMgrState = Coe.MmgrState.NOT_SET; + + #endregion + + /// + /// Constructor + /// + /// name of COE device + /// + public SendCoeUncageMsgToUutAction(string coeDeviceName) + { + _logger = LogManager.GetCurrentClassLogger(); + + _coeDeviceName = coeDeviceName; + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + if (Program.Instance().IsUutPwrOn) + { + if (SendCoeAdnucMsgToUutAction.mMgrState == Coe.MmgrState.CALIBRATION) + { + CoeResponseMsgData missionManagerMsg = null; + bool firstMissionManagerMsgReceived = false; + const int MAX_RETRIES = 5; + int retry = 0; + CoeFieldData val = null; + mMgrState = Coe.MmgrState.NOT_SET; + Coe.MmgrState desiredMmgrState = Coe.MmgrState.ACQUISITION; + + string missionManagerMessageName = "MissionManagerMsgLL"; + _logger.Info($"Waiting for message {missionManagerMessageName}"); + do + { + Thread.Sleep(1000); + missionManagerMsg = Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.GetNextResponseInQueue(_coeDeviceName, missionManagerMessageName); + + if (missionManagerMsg != null) + { + if (!firstMissionManagerMsgReceived) + firstMissionManagerMsgReceived = true; + + val = missionManagerMsg.GetFieldData("data.mmgrState"); + + if (Enum.TryParse(val.FieldValue, out mMgrState)) + { + _logger.Info($"Current mission state: {mMgrState.ToString()}"); + + if (mMgrState == desiredMmgrState) + break; + } + else + { + _logger.Warn($"Invalid mission state: {val.FieldValue}"); + } + } + } while (retry++ < MAX_RETRIES && (missionManagerMsg == null || mMgrState != desiredMmgrState)); + + if (!firstMissionManagerMsgReceived) + { + throw new Exception($"Timed out waiting for Mission Manager's state message"); + } + + if (mMgrState != desiredMmgrState) + { + throw new Exception($"Timed out waiting for Mission Manager to transition to {desiredMmgrState}"); + } + + Message msg = Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.CreateMessage(_coeDeviceName, _msgName); + string cageState = "1"; + msg.Set("data.uncaged", cageState); + var parms = msg.GetParameters(); + _logger.Info($"Sending {_msgName}, uncaged={cageState}"); + Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.SendMessage(_coeDeviceName, _msgName, parms); + } + } + else + { + throw new Exception("Cannot send message to UUT because UUT is not powered on."); + } + } + catch (Exception) + { + throw; + } + } + } +} diff --git a/Source/Program/Actions/SendTestMessageToUutAction.cs b/Source/Program/Actions/SendTestMessageToUutAction.cs new file mode 100644 index 0000000..17ecc64 --- /dev/null +++ b/Source/Program/Actions/SendTestMessageToUutAction.cs @@ -0,0 +1,234 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Text; +using NLog; +using ProgramLib.GUI.View; + +namespace ProgramLib +{ + /// + /// Send Test Messages to UUT via TCP sockets + /// + internal class SendTestMessageToUutAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + private string _messageName; + private string _iniKeyForData; + + #endregion + + /// + /// Constructor + /// + /// name of the message that is defined in the UutTestMessages.XML file + /// section name in the ProgramSpecific.ini that specifies the values for data fields in this message + /// + public SendTestMessageToUutAction(string messageName, string iniKeyForData = null) + { + _logger = LogManager.GetCurrentClassLogger(); + _messageName = messageName; + _iniKeyForData = iniKeyForData; + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + if (Program.Instance().IsUutPwrOn) + { + SendMessageToUut(); + } + else + { + throw new Exception("Cannot send message to UUT because UUT is not powered on."); + } + } + catch (Exception) + { + throw; + } + } + + /// + /// Send message to UUT + /// + /// + private void SendMessageToUut() + { + string msfrTestCase = null; + if (Program.Instance().EthernetSocketManager.GetTcpClient(TcpClientNames.UUT_TEST_PORT) != null) + { + if (String.Equals(_messageName, "MSFRParameterMsg", StringComparison.OrdinalIgnoreCase)) + { + MsfrTestCasesWindow win = (MsfrTestCasesWindow)ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.MSFR_TEST_CASES]; + + ProgramLib.Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.DEFAULT].Dispatcher.Invoke((Action)delegate + { + if (win.cbMsfrTestCases.SelectedItem != null) + msfrTestCase = win.cbMsfrTestCases.SelectedValue.ToString(); + }); + + if (!String.IsNullOrEmpty(msfrTestCase)) + { + int index = msfrTestCase.IndexOf('.'); + _iniKeyForData = $"TEST_CASE_{msfrTestCase.Substring(0, index)}"; + } + else + throw new Exception("No MSFR test case was specified"); + } + byte[] byteArray = ConstructByteArrayFromMessageData(); + Program.Instance().EthernetSocketManager.GetTcpClient(TcpClientNames.UUT_TEST_PORT).Write(byteArray); + string desc = $"Sent {_messageName}."; + if (String.Equals(_messageName, "MSFRParameterMsg", StringComparison.OrdinalIgnoreCase)) + desc += $" Test case: {msfrTestCase}"; + _logger.Info(desc); + } + else + { + throw new Exception("Cannot send message to UUT because socket connection hasn't been established."); + } + } + + /// + /// Pack all data in the message to byte array to be sent + /// + /// + private byte[] ConstructByteArrayFromMessageData() + { + List byteList = new List(); + string val = String.Empty; + string sourceError = String.Empty; + + if (Program.Instance().UutInfo.UutTestMessageDict.ContainsKey(_messageName)) + { + string[] dataArray = Program.Instance().ProgramSpecificConfig.ReadValue(_messageName, _iniKeyForData).Split(','); + int dataArrayIndex = -1; + if (String.Equals(_messageName, "MSFRParameterMsg", StringComparison.OrdinalIgnoreCase)) + dataArrayIndex++; + + foreach (UutTestMessageDataFieldInfo item in Program.Instance().UutInfo.UutTestMessageDict[_messageName]) + { + dataArrayIndex++; + val = item.Value; + if (String.Equals(item.Value, "not_set", StringComparison.OrdinalIgnoreCase)) + { + sourceError = $"Key: {_iniKeyForData}. Section: {_messageName}. File: {Program.Instance().ProgramSpecificConfig.FileName}"; + val = dataArray[dataArrayIndex].Trim(); + } + else + { + sourceError = $"Message: {_messageName}. Data Field: {item.Name}. File: {Program.Instance().UutInfo.UutTestMessageConfigFilePath}"; + } + + string type = item.Type.ToLower(); + + switch (type) + { + case "string": + if (val.Length > item.ByteCount) + { + throw new Exception($"The value {val} exceeds the allowable length of {item.ByteCount} characters. {sourceError}"); + } + else if (val.Length < item.ByteCount) + { + for (int i = val.Length; i < item.ByteCount; i++) + { + val += '\0'; + } + } + + byteList.AddRange(Encoding.ASCII.GetBytes(val)); + + break; + case "bool": + if (val == "1") + val = "true"; + else if (val == "0") + val = "false"; + if (bool.TryParse(val, out bool boolVal)) + { + byteList.Add(Convert.ToByte(boolVal)); + } + else + { + throw new Exception($"The value {val} is not of type {item.Type}. It must be either true/false. {sourceError}"); + } + break; + case "uint8": + if (byte.TryParse(val, out byte byteVal)) + { + byteList.Add(byteVal); + } + else + { + throw new Exception($"The value {val} is not of type {item.Type}. {sourceError}"); + } + break; + case "uint32": + if (UInt32.TryParse(val, out UInt32 uint32Val)) + { + byteList.AddRange(BitConverter.GetBytes(uint32Val)); + } + else + { + throw new Exception($"The value {val} is not of type {item.Type}. {sourceError}"); + } + break; + case "double": + if (Double.TryParse(val, out Double doubleVal)) + { + byteList.AddRange(BitConverter.GetBytes(doubleVal)); + } + else + { + throw new Exception($"The value {val} is not of type {item.Type}. {sourceError}"); + } + break; + case "float": + if (float.TryParse(val, out float floatVal)) + { + byteList.AddRange(BitConverter.GetBytes(floatVal)); + } + else + { + throw new Exception($"The value {val} is not of type {item.Type}. {sourceError}"); + } + break; + default: + throw new Exception($"{item.Type} is not a supported type. {sourceError}"); + } + } + } + else + { + throw new Exception($"Message {_messageName} does not exist in {Program.Instance().UutInfo.UutTestMessageConfigFilePath}."); + } + + return byteList.ToArray(); + } + } +} diff --git a/Source/Program/Common/ConfigLogic/UutInfo.cs b/Source/Program/Actions/StartTacticalUartReadThreadAction.cs similarity index 61% rename from Source/Program/Common/ConfigLogic/UutInfo.cs rename to Source/Program/Actions/StartTacticalUartReadThreadAction.cs index 298fba6..5759f24 100644 --- a/Source/Program/Common/ConfigLogic/UutInfo.cs +++ b/Source/Program/Actions/StartTacticalUartReadThreadAction.cs @@ -16,54 +16,45 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; +using NLog; namespace ProgramLib { /// - /// Store UUT information - /// - internal class UutInfo + /// Start tactical UART read thread + /// + internal class StartTacticalUartReadThreadAction : BasicAction { - #region PublicMembers - #endregion - #region PrivateClassMembers - // class variables - private readonly string _partNumber; - private readonly string _serialNumber; + private static NLog.ILogger _logger; + #endregion - #region PrivateFuctions /// - /// The constructor + /// Constructor /// - public UutInfo(string partNumber, string serialNumber) + public StartTacticalUartReadThreadAction() { - _partNumber = partNumber; - _serialNumber = serialNumber; + _logger = LogManager.GetCurrentClassLogger(); } - #endregion - - #region PublicFuctions /// - /// + /// Run the action /// /// - internal string GetPartNumber() + public override void Run() { - return _partNumber; - } + try + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); - /// - /// - /// - /// - internal string GetSerialNumber() - { - return _serialNumber; + TacticalUartReadThread tacticalUartReadThread = new TacticalUartReadThread(); + tacticalUartReadThread.Start(); + } + catch (Exception) + { + throw; + } } - - #endregion } } diff --git a/Source/Program/Actions/UartLoopBackAction.cs b/Source/Program/Actions/UartLoopBackAction.cs new file mode 100644 index 0000000..1cf68d3 --- /dev/null +++ b/Source/Program/Actions/UartLoopBackAction.cs @@ -0,0 +1,137 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using NLog; +using Raytheon.Instruments; + +namespace ProgramLib +{ + /// + /// Perform UART loopback test + /// + internal class UartLoopBackAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + + private ICommDevice _serialDevice; + + #endregion + + /// + /// Constructor + /// + /// + public UartLoopBackAction() + { + _logger = LogManager.GetCurrentClassLogger(); + + string serialDeviceInstanceName = Program.Instance().ProgramSpecificConfig.ReadValue("UART_INFO", "SERIAL_DEVICE_INSTANCE_NAME"); + _serialDevice = (ICommDevice)Program.Instance().InstrumentManager.GetGenericInstrument(serialDeviceInstanceName); + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + SendCommandAndGetResponse(); + } + catch (Exception) + { + throw; + } + } + + /// + /// Send commnd and get response + /// + /// + public void SendCommandAndGetResponse() + { + UartHandshakeMessage msg = new UartHandshakeMessage(0xCCAAFFEEDDAAEEDD, 0xDDEEAADDEEFFAACC); + List msgByteList = Util.StructToByteList(msg).ToList(); + // remove checksum byte + msgByteList.RemoveAt(msgByteList.Count - 1); + msgByteList.Add(Util.GetTwosComplimentChecksum(msgByteList.ToArray())); + _serialDevice.Write(msgByteList.ToArray(), (uint)msgByteList.Count); + _logger.Info($"Raw message sent: {Util.ByteArrayToHexString(msgByteList.ToArray())}"); + + List receiveByteList = new List(); + byte[] receiveByteArray = null; + uint totalBytesRead = 0; + + _logger.Info($"Waiting for message to be looped back..."); + + uint numBytesRead = _serialDevice.Read(ref receiveByteArray); + // this is for loopback, we read too fast and we're only getting partial data + if (numBytesRead < msgByteList.Count) + { + _serialDevice.SetReadTimeout(100); + try + { + do + { + totalBytesRead += numBytesRead; + receiveByteList.AddRange(receiveByteArray.Skip(0).Take((int)numBytesRead).ToArray()); + receiveByteArray = null; + numBytesRead = _serialDevice.Read(ref receiveByteArray); + } + while (true); + } + catch { } + // reset to default timeout + _serialDevice.SetReadTimeout(); + receiveByteArray = receiveByteList.ToArray(); + } + else + totalBytesRead = numBytesRead; + + _logger.Info($"Raw Msg Received: {Util.ByteArrayToHexString(receiveByteArray, (int)totalBytesRead)}"); + + if (totalBytesRead != msgByteList.Count) + { + throw new Exception($"Unexpected message size. Expected msg size: {msgByteList.Count}. Actual msg size: {totalBytesRead}"); + } + + bool loopbackSuccess = true; + for (int i = 0; i < totalBytesRead; i++) + { + if (msgByteList[i] != receiveByteArray[i]) + { + loopbackSuccess = false; + break; + } + } + + if (!loopbackSuccess) + { + throw new Exception($"Messages sent and received don't match"); + } + + _logger.Info($"UART loopback is successful."); + } + } +} diff --git a/Source/Program/Actions/UutPowerAction.cs b/Source/Program/Actions/UutPowerAction.cs deleted file mode 100644 index 7b235cb..0000000 --- a/Source/Program/Actions/UutPowerAction.cs +++ /dev/null @@ -1,222 +0,0 @@ -/*------------------------------------------------------------------------- -// UNCLASSIFIED -/*------------------------------------------------------------------------- -RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION -PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS -AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO -UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO -RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS -CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS -OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON -COMPANY. - -THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. -GOVERNMENT. - -UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. --------------------------------------------------------------------------*/ -using NLog; -using ProgramLib.GUI.Model; -using ProgramLib.GUI.View; -using ProgramLib.GUI.ViewModel; -using System; -using System.Threading.Tasks; -using System.Windows; - -namespace ProgramLib -{ - internal class UutPowerAction - { - #region PrivateClassMembers - private static NLog.ILogger _logger; - - private static object powerSyncObj = new object(); - - private bool _sttoSuccess = true; - - private string fatalErrorMsg; - - #endregion - - public UutPowerAction() - { - _logger = LogManager.GetCurrentClassLogger(); - } - - ~UutPowerAction() - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); - } - - /// - /// Power off UUT - /// - /// - /// - public void UutPowerOff() - { - try - { - lock (powerSyncObj) - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); - - if (Program.Instance()._isUutPwrOn) - { - Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputDisable("STE_PVM_5V"); - // enable front panel - Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.DisplayEnable("STE_POWER_SUPPLY_SYSTEM"); - - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Dispatcher.Invoke((Action)delegate - { - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Hide(); - }); - - Program.Instance().EventManager[EventManager.Events.UUT_POWER_ON].Reset(); - Program.Instance().EventManager[EventManager.Events.UUT_POWER_OFF].Set(); - - Program.Instance()._isUutPwrOn = false; - } - } - } - catch (Exception) - { - throw; - } - } - - /// - /// Power on UUT - /// - /// - /// - public void UutPowerOn() - { - try - { - lock (powerSyncObj) - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); - - if (!Program.Instance()._isUutPwrOn) - { - Task.Factory.StartNew(() => PerformSttoTask()); - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].Dispatcher.Invoke((Action)delegate - { - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Hide(); - - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].ShowDialog(); - }); - - if (_sttoSuccess) - { - Program.Instance().PowerSupplySharedData.ResetAll(); - - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].Dispatcher.Invoke((Action)delegate - { - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Show(); - }); - - Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputEnable("STE_PVM_5V"); - - // disable front panel - Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.DisplayDisable("STE_POWER_SUPPLY_SYSTEM"); - - Program.Instance().EventManager[EventManager.Events.UUT_POWER_OFF].Reset(); - Program.Instance().EventManager[EventManager.Events.UUT_POWER_ON].Set(); - - Program.Instance()._isUutPwrOn = true; - } - else - { - throw new Exception(fatalErrorMsg); - } - } - else - { - throw new Exception("UUT power is already on."); - } - } - } - catch (Exception) - { - throw; - } - } - - private async void PerformSttoTask() - { - ImpedanceDataModel impedanceDataModel; - ImpedanceCheckWindow impedanceCheckWindow = (ImpedanceCheckWindow)ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK]; - - try - { - _logger?.Debug($"{this.GetType().Name}::PerformSttoTask() running..."); - - bool forceFail = false; - string measurementStatus = "PASSED"; - - ImpedanceCheckWindowViewModel.Images passFailImage = ImpedanceCheckWindowViewModel.Images.PASS_CHECK; - impedanceCheckWindow.ViewModel.ClearData(); - int MAX_ITERATION = 15; - int cableNum = 17; - int cablePin1 = 5; - int cablePin2 = 7; - int measurement = 5; - string measurementName; - for (int i = 1; i <= MAX_ITERATION; i++) - { - measurementName = $"P{cableNum}_P{cablePin1++}_P{cableNum++}_P{cablePin2++}"; - impedanceDataModel = new ImpedanceDataModel(); - if (i == MAX_ITERATION / 2 && forceFail) - { - passFailImage = ImpedanceCheckWindowViewModel.Images.FAIL_CHECK; - measurementStatus = "FAILED"; - _sttoSuccess = false; - } - - impedanceDataModel.PassFailImagePath = impedanceCheckWindow.ViewModel.ImageToResourcePathDict[passFailImage]; - impedanceDataModel.Description = $"{measurementName} Measured {measurement} Range [0,50]"; - - if (Program.Instance().TestStandSeqContext != null) - { - Program.Instance().TestStandSeqContext.Step.AdditionalResults.CustomResults.Insert($"\"{measurementName}\"", $"\"Measured: {measurement++} Range [0,50] - {measurementStatus}\""); - } - - impedanceCheckWindow.ViewModel.AddData(impedanceDataModel); - - if (!_sttoSuccess) - { - fatalErrorMsg = impedanceDataModel.Description; - throw new Exception(fatalErrorMsg); - } - - await Task.Delay(300); - } - } - catch (Exception ex) - { - _logger.Error(ex.Message + "\n" + ex.StackTrace); - } - finally - { - if (!_sttoSuccess) - { - impedanceCheckWindow.Dispatcher.Invoke((Action)delegate - { - impedanceCheckWindow.btnClose.Visibility = Visibility.Visible; - }); - } - else - { - impedanceCheckWindow.Dispatcher.Invoke((Action)delegate - { - impedanceCheckWindow.Hide(); - }); - } - - _logger?.Debug($"{this.GetType().Name}::PerformSttoTask() exiting..."); - } - } - } -} diff --git a/Source/Program/Actions/UutPowerOffAction.cs b/Source/Program/Actions/UutPowerOffAction.cs new file mode 100644 index 0000000..502f7c9 --- /dev/null +++ b/Source/Program/Actions/UutPowerOffAction.cs @@ -0,0 +1,128 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml; +using NLog; + +namespace ProgramLib +{ + /// + /// Power off UUT + /// + internal class UutPowerOffAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + + private static object _syncObj = new object(); + + #endregion + + /// + /// Constructor + /// + public UutPowerOffAction() + { + _logger = LogManager.GetCurrentClassLogger(); + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + lock (_syncObj) + { + if (Program.Instance().IsUutPwrOn) + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + foreach (var item in ProgramLib.Program.Instance().PowerModulesToBePowered) + Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputDisable(item); + + RecordPowerOffTimeToFile(); + + // enable front panel + //Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.DisplayEnable("STE_POWER_SUPPLY_SYSTEM"); + + Program.Instance().EventManager[EventManager.Events.UUT_POWER_ON].Reset(); + Program.Instance().EventManager[EventManager.Events.UUT_POWER_OFF].Set(); + + Program.Instance().IsUutPwrOn = false; + } + } + } + catch (Exception) + { + throw; + } + } + + /// + /// Parse ini file for modules to be powered on + /// + public void ParseProgramSpecificConfig() + { + try + { + List keys = Program.Instance().ProgramSpecificConfig.ReadAllKeys(ProgramSpecificConfigIni.POWER_MODULES_TO_BE_POWERED.ToString()); + foreach (string key in keys) + { + string powerSupplyModule = Program.Instance().ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.POWER_MODULES_TO_BE_POWERED.ToString(), key); + + if (!Program.Instance().PowerModulesToBePowered.Contains(powerSupplyModule, StringComparer.OrdinalIgnoreCase)) + Program.Instance().PowerModulesToBePowered.Add(powerSupplyModule); + } + } + catch (Exception) + { + throw; + } + } + + /// + /// Record power off time + /// + private void RecordPowerOffTimeToFile() + { + XmlDocumentWrapper doc = new XmlDocumentWrapper(Program.Instance().FileAndFolderManager.GetFile(FileAndFolderManager.Files.TEST_RUN_LOG)); + + XmlNode node = doc.GetNode(TestRunConfigXml.TestRunPowerPath); + + XmlAttribute onDateAttr = node.Attributes[TestRunConfigXml.TestRunPowerOnDateAttributeName]; + XmlAttribute onTimeAttr = node.Attributes[TestRunConfigXml.TestRunPowerOnTimeAttributeName]; + DateTime powerOnDateTime = DateTime.Parse($"{onDateAttr.Value} {onTimeAttr.Value}"); + + DateTime dt = DateTime.Now; + int duration = (int)dt.Subtract(powerOnDateTime).TotalSeconds; + Dictionary attributesDict = new Dictionary(); + attributesDict[TestRunConfigXml.TestRunPowerOffDateAttributeName] = dt.ToString("MM/dd/yyyy"); + attributesDict[TestRunConfigXml.TestRunPowerOffTimeAttributeName] = dt.ToString("HH:mm:ss"); + attributesDict[TestRunConfigXml.TestRunPowerOnDurationAttributeName] = duration.ToString(); + + doc.ChangeNode(node, attributesDict); + + doc.SaveToFile(); + } + } +} diff --git a/Source/Program/Actions/UutPowerOnAction.cs b/Source/Program/Actions/UutPowerOnAction.cs new file mode 100644 index 0000000..a1e09f8 --- /dev/null +++ b/Source/Program/Actions/UutPowerOnAction.cs @@ -0,0 +1,130 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using NLog; + +namespace ProgramLib +{ + /// + /// Power on UUT + /// + internal class UutPowerOnAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + + private static object _syncObj = new object(); + + #endregion + + /// + /// Constructor + /// + public UutPowerOnAction() + { + _logger = LogManager.GetCurrentClassLogger(); + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + lock (_syncObj) + { + if (!Program.Instance().IsUutPwrOn) + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + Program.Instance().TestStation.VerifyCableSelfTestHasRun(); + + if (Program.Instance().PowerModulesToBePowered.Count == 0) + { + ParseProgramSpecificConfig(); + } + + Program.Instance().PowerSupplySharedData.ResetAll(); + + foreach (var item in ProgramLib.Program.Instance().PowerModulesToBePowered) + Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputEnable(item); + + RecordPowerOnTimeToFile(); + + // disable front panel + //Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.DisplayDisable("STE_POWER_SUPPLY_SYSTEM"); + + Program.Instance().EventManager[EventManager.Events.UUT_POWER_OFF].Reset(); + Program.Instance().EventManager[EventManager.Events.UUT_POWER_ON].Set(); + + Program.Instance().IsUutPwrOn = true; + } + else + { + throw new Exception("UUT power is already on."); + } + } + } + catch (Exception) + { + throw; + } + } + + /// + /// Parse ini file for modules to be powered on + /// + public void ParseProgramSpecificConfig() + { + try + { + List keys = Program.Instance().ProgramSpecificConfig.ReadAllKeys(ProgramSpecificConfigIni.POWER_MODULES_TO_BE_POWERED.ToString()); + foreach (string key in keys) + { + string powerSupplyModule = Program.Instance().ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.POWER_MODULES_TO_BE_POWERED.ToString(), key); + + if (!Program.Instance().PowerModulesToBePowered.Contains(powerSupplyModule, StringComparer.OrdinalIgnoreCase)) + Program.Instance().PowerModulesToBePowered.Add(powerSupplyModule); + } + } + catch (Exception) + { + throw; + } + } + + /// + /// Record power on time + /// + private void RecordPowerOnTimeToFile() + { + XmlDocumentWrapper doc = new XmlDocumentWrapper(Program.Instance().FileAndFolderManager.GetFile(FileAndFolderManager.Files.TEST_RUN_LOG)); + + Dictionary attributesDict = new Dictionary(); + attributesDict[TestRunConfigXml.TestRunPowerOnDateAttributeName] = DateTime.Now.ToString("MM/dd/yyyy"); + attributesDict[TestRunConfigXml.TestRunPowerOnTimeAttributeName] = DateTime.Now.ToString("HH:mm:ss"); + doc.AddNode(TestRunConfigXml.TestRunPowerPath, attributesDict, null, XmlDocumentWrapper.AddNodePosition.First); + + doc.SaveToFile(); + } + } +} diff --git a/Source/Program/Actions/UutTestPortConnectAction.cs b/Source/Program/Actions/UutTestPortConnectAction.cs new file mode 100644 index 0000000..a7c87ad --- /dev/null +++ b/Source/Program/Actions/UutTestPortConnectAction.cs @@ -0,0 +1,93 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using NLog; + +namespace ProgramLib +{ + /// + /// Start TCP client and connect to the UUT + /// + internal class UutTestPortConnectAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + private string _uutIpAddress = String.Empty; + private int _uutTestPortTcp = -1; + + #endregion + + /// + /// Constructor + /// + public UutTestPortConnectAction() + { + _logger = LogManager.GetCurrentClassLogger(); + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + if (Program.Instance().IsUutPwrOn) + { + if (Program.Instance().EthernetSocketManager.GetTcpClient(TcpClientNames.UUT_TEST_PORT) == null) + { + ParseProgramSpecificConfig(); + TcpClient tcpClient = new TcpClient(_uutIpAddress, _uutTestPortTcp); + tcpClient.Initialize(); + tcpClient.Connect(); + Program.Instance().EthernetSocketManager.AddTcpClient(TcpClientNames.UUT_TEST_PORT, tcpClient); + } + else + Program.Instance().EthernetSocketManager.GetTcpClient(TcpClientNames.UUT_TEST_PORT).Connect(); + } + else + { + throw new Exception("Cannot connect to UUT test port because UUT is not powered on."); + } + } + catch (Exception) + { + throw; + } + } + + /// + /// Parse ini file + /// + public void ParseProgramSpecificConfig() + { + try + { + _uutIpAddress = Program.Instance().ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.UUT_INFO.ToString(), ProgramSpecificConfigIni.UUT_IP_ADDRESS.ToString()); + Int32.TryParse(Program.Instance().ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.UUT_INFO.ToString(), ProgramSpecificConfigIni.UUT_TEST_PORT_TCP.ToString()), out _uutTestPortTcp); + } + catch (Exception) + { + throw; + } + } + } +} diff --git a/Source/Program/Actions/UutTestPortDisconnectAction.cs b/Source/Program/Actions/UutTestPortDisconnectAction.cs new file mode 100644 index 0000000..92b057a --- /dev/null +++ b/Source/Program/Actions/UutTestPortDisconnectAction.cs @@ -0,0 +1,65 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using NLog; + +namespace ProgramLib +{ + /// + /// Disconnect TCP connection from UUT + /// + internal class UutTestPortDisconnectAction : BasicAction + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + + #endregion + + /// + /// Constructor + /// + public UutTestPortDisconnectAction() + { + _logger = LogManager.GetCurrentClassLogger(); + } + + /// + /// Run the action + /// + /// + public override void Run() + { + try + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + + if (Program.Instance().IsUutPwrOn) + { + if (Program.Instance().EthernetSocketManager.GetTcpClient(TcpClientNames.UUT_TEST_PORT) != null) + { + Program.Instance().EthernetSocketManager.GetTcpClient(TcpClientNames.UUT_TEST_PORT).Disconnect(); + } + } + } + catch (Exception) + { + throw; + } + } + } +} diff --git a/Source/Program/Common/BaseClass/BasicTest.cs b/Source/Program/Common/BaseClass/BasicAction.cs similarity index 76% rename from Source/Program/Common/BaseClass/BasicTest.cs rename to Source/Program/Common/BaseClass/BasicAction.cs index 5a6f22e..34f8249 100644 --- a/Source/Program/Common/BaseClass/BasicTest.cs +++ b/Source/Program/Common/BaseClass/BasicAction.cs @@ -16,22 +16,10 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using System; -using ProgramLib; -using Raytheon.Common; - namespace ProgramLib { - internal abstract class BasicTest + internal abstract class BasicAction { - protected abstract void CheckPrerequisite(); - - protected abstract void ExecuteTest(); - - public void RunTest() - { - CheckPrerequisite(); - ExecuteTest(); - } + abstract public void Run(); } } \ No newline at end of file diff --git a/Source/Program/Common/BaseClass/BasicThread.cs b/Source/Program/Common/BaseClass/BasicThread.cs index ba41ccd..b7896a0 100644 --- a/Source/Program/Common/BaseClass/BasicThread.cs +++ b/Source/Program/Common/BaseClass/BasicThread.cs @@ -15,12 +15,7 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading; -using System.Threading.Tasks; namespace ProgramLib { @@ -31,12 +26,14 @@ namespace ProgramLib { protected Thread _thread; + protected ManualResetEvent _quitEvent = new ManualResetEvent(false); + /// /// Spawn thread and start it /// /// /// - public void Start() + public void Start() { _thread = new Thread(new ThreadStart(DoWork)); _thread.Start(); @@ -55,15 +52,18 @@ namespace ProgramLib /// /// /// - public virtual void Quit() { } + public virtual void Quit() + { + _quitEvent.Set(); + } /// /// Wait for thread to exit /// /// /// - public virtual void WaitForExit() - { + public virtual void WaitForExit() + { if (_thread != null) { // wait for thread to terminate diff --git a/Source/Program/Common/Comm/TcpClient.cs b/Source/Program/Common/Comm/TcpClient.cs new file mode 100644 index 0000000..c80c569 --- /dev/null +++ b/Source/Program/Common/Comm/TcpClient.cs @@ -0,0 +1,226 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ + +using System; +using System.Net; +using System.Net.NetworkInformation; +using System.Net.Sockets; +using System.Text.RegularExpressions; + +namespace ProgramLib +{ + /// + /// Class for controlling a TCP client communication device + /// + internal class TcpClient + { + #region PrivateClassMembers + + private Socket _sock; + private string _remoteAddress; + private int _remotePort; + private IPEndPoint _remoteEP = null; + private IPAddress _ipAddress = null; + private object _syncObj = new object(); + + #endregion + + #region Public Functions + + /// + /// Constructor + /// + /// + /// + public TcpClient(string remoteAddress, int remotePort) + { + _remoteAddress = remoteAddress; + _remotePort = remotePort; + } + + /// + /// initialize instrument + /// + public void Initialize() + { + // if remoteAddress is a hostname + if (!IPAddress.TryParse(_remoteAddress, out _ipAddress)) + { + string preferredSubnet = ""; + + IPHostEntry host = Dns.GetHostEntry(_remoteAddress); + foreach (IPAddress ip in host.AddressList) + { + AddressFamily af = ip.AddressFamily; + if (af == AddressFamily.InterNetwork) + { + if (preferredSubnet != String.Empty) + { + if (Regex.IsMatch(ip.ToString(), preferredSubnet, RegexOptions.IgnoreCase)) + _ipAddress = ip; + } + else + _ipAddress = ip; + + if (_ipAddress != null) + break; + } + } + } + + if (_ipAddress != null) + { + if (_remoteEP == null) + _remoteEP = new IPEndPoint(_ipAddress, _remotePort); + } + else + throw new Exception($"Unable to create IPEndPoint to {_remoteAddress}, port {_remotePort}"); + + if (_sock == null) + _sock = new Socket(_ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp); + } + + /// + /// Connect to remote host + /// + /// + public void Connect() + { + lock (_syncObj) + { + try + { + if (!_sock.Connected && IsRemoteHostAlive()) + _sock.Connect(_remoteEP); + } + catch (ObjectDisposedException) + { + _sock = new Socket(_ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp); + if (IsRemoteHostAlive()) + _sock.Connect(_remoteEP); + } + catch (Exception) { throw; } + } + } + + /// + /// Disconnect from remote host + /// + /// + public void Disconnect() + { + lock (_syncObj) + { + if (_sock.Connected) + { + _sock.Shutdown(SocketShutdown.Both); + _sock.Disconnect(true); + _sock.Close(); + } + } + } + + /// + /// Ping if remote host is alive + /// + /// true/false + bool IsRemoteHostAlive() + { + bool isRemoteHostAlive = true; + + //Do a ping test to see if the server is reachable + try + { + Ping pingTest = new Ping(); + PingReply reply = pingTest.Send(_ipAddress); + if (reply.Status != IPStatus.Success) + isRemoteHostAlive = false; + } + catch (PingException) + { + isRemoteHostAlive = false; + } + + //See if the tcp state is ok + if (_sock.Poll(5000, SelectMode.SelectRead) && (_sock.Available == 0)) + { + isRemoteHostAlive = false; + } + + return isRemoteHostAlive; + } + + /// + /// Read data from the device. + /// + /// + /// + /// The number of bytes read + public uint Read(ref byte[] dataBuf) + { + int bytesRec = 0; + lock (_syncObj) + { + try + { + bytesRec = _sock.Receive(dataBuf); + } + catch (SocketException) + { + bytesRec = 0; + } + } + + return (uint)bytesRec; + } + + /// + /// Sets the read timeout + /// + /// + public void SetReadTimeout(uint timeoutMs) + { + _sock.ReceiveTimeout = (int)timeoutMs; + } + + /// + /// Write data to device. + /// + /// + /// The number of bytes written + public uint Write(byte[] dataBuf) + { + int bytesWritten = 0; + lock (_syncObj) + { + try + { + bytesWritten = _sock.Send(dataBuf, dataBuf.Length, SocketFlags.None); + } + catch (SocketException) + { + bytesWritten = 0; + } + } + + return (uint)bytesWritten; + } + + #endregion + } +} diff --git a/Source/Program/Common/ConfigLogic/CableSelfTestConfigXml.cs b/Source/Program/Common/ConfigLogic/CableSelfTestConfigXml.cs new file mode 100644 index 0000000..33d57fc --- /dev/null +++ b/Source/Program/Common/ConfigLogic/CableSelfTestConfigXml.cs @@ -0,0 +1,34 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +namespace ProgramLib +{ + /// + /// Define non-specific constants + /// + internal static class CableSelfTestConfigXml + { + // define all paths here + public const string RootPath = "/root"; + public const string SelfTestPath = RootPath + "/selftest"; + + // define all attribute names here + public const string UniversalCableAttributeName = "universal_cable"; + public const string SacrificialCableAttributeName = "sacrificial_cable"; + public const string LastRunDateAttributeName = "last_run_date"; + } +} diff --git a/Source/Program/Common/ConfigLogic/ProgramGeneralConfigIni.cs b/Source/Program/Common/ConfigLogic/ProgramGeneralConfigIni.cs new file mode 100644 index 0000000..d6bfaeb --- /dev/null +++ b/Source/Program/Common/ConfigLogic/ProgramGeneralConfigIni.cs @@ -0,0 +1,53 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +namespace ProgramLib +{ + /// + /// Define all the sections and keys that exists in the INI file + /// + internal enum ProgramGeneralConfigIni + { + // list all the sections below + GENERAL, + + // list all the keys below + + // file names + PROGRAM_SPECIFIC_CONFIG_FILE_NAME, + SWITCH_MEASUREMENT_MANAGER_CONFIG_FILE_NAME, + COE_MEASUREMENT_MANAGER_CONFIG_FILE_NAME, + UUT_TEST_MESSAGES_CONFIG_FILE_NAME, + CABLE_SELF_TEST_RUN_LOG_FILE_NAME, + TEST_RUN_LOG_FILE_NAME, + + // file name prefix + NLOG_FILE_NAME_PREFIX, + + // folder names + NLOG_FOLDER_NAME, + TESTSTAND_FOLDER_NAME, + HARDWARE_CONFIG_FOLDER_NAME, + SIM_CONFIG_FOLDER_NAME, + INSTRUMENT_CONFIG_FOLDER_NAME, + MEASUREMENT_CONFIG_FOLDER_NAME, + PDEL_FOLDER_NAME, + + // teststand variable names + DESTINATION_TEST_REPORT_PATH_VAR_NAME, + } +} diff --git a/Source/Program/Common/ConfigLogic/ProgramSpecificConfigIni.cs b/Source/Program/Common/ConfigLogic/ProgramSpecificConfigIni.cs new file mode 100644 index 0000000..6eca2d7 --- /dev/null +++ b/Source/Program/Common/ConfigLogic/ProgramSpecificConfigIni.cs @@ -0,0 +1,75 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +namespace ProgramLib +{ + /// + /// Define all the sections and keys that exists in the INI file + /// + internal enum ProgramSpecificConfigIni + { + // list all the sections below + CABLE_ID_RELAYS, + FILE_NAMES, + GENERAL, + POLL_RATES, + POWER_MODULES_TO_BE_POWERED, + POWER_MODULES_TO_BE_DISPLAYED, + UUT_INFO, + + // list all the keys below + + // general + PRIMARY_DRIVE, + SECONDARY_DRIVE, + DATA_BASE_FOLDER, + DATA_GENERAL_FOLDER_NAME, + DATA_GENERAL_TEMP_FOLDER_NAME, + + APP_RELEASE_CONTROLLED_FOLDER, + + LOG_DASHBOARD_APP_PATH, + + ENFORCE_CABLE_SELF_TEST_IS_RUN, + + // relays + W1_CABLE_PART_NUMBER, + W1_CABLE_SERIAL_NUMBER, + W2_CABLE_PART_NUMBER, + W2_CABLE_SERIAL_NUMBER, + W3_CABLE_PART_NUMBER, + W3_CABLE_SERIAL_NUMBER, + W4_CABLE_PART_NUMBER, + W4_CABLE_SERIAL_NUMBER, + W5_CABLE_PART_NUMBER, + W5_CABLE_SERIAL_NUMBER, + + // poll rates + POWER_SUPPLY_LOG_RATE, + POWER_SUPPLY_READ_RATE, + PASSTHROUGH_DATA_UPDATE_RATE, + + // File names + POWER_SUPPLY_LOG_PREFIX, + POWER_SUPPLY_LOG_FILE_EXTENSION, + + // UUT info + UUT_IP_ADDRESS, + UUT_TEST_PORT_TCP, + + } +} diff --git a/Source/Program/Common/ConfigLogic/TestRunConfigXml.cs b/Source/Program/Common/ConfigLogic/TestRunConfigXml.cs new file mode 100644 index 0000000..c58664e --- /dev/null +++ b/Source/Program/Common/ConfigLogic/TestRunConfigXml.cs @@ -0,0 +1,45 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +namespace ProgramLib +{ + /// + /// Define non-specific constants + /// + internal static class TestRunConfigXml + { + // define all paths here + public const string RootPath = "/root"; + public const string TestRunPath = RootPath + "/test_run"; + public const string TestRunPowerPath = TestRunPath + "/power"; + + // define all attribute names here + public const string TestRunPathAttributeName = "path"; + public const string TestRunTestNameAttributeName = "test_name"; + public const string TestRunTesterAttributeName = "tester"; + public const string TestRunStartDateAttributeName = "start_date"; + public const string TestRunStartTimeAttributeName = "start_time"; + public const string TestRunEndDateAttributeName = "end_date"; + public const string TestRunEndTimeAttributeName = "end_time"; + + public const string TestRunPowerOnDateAttributeName = "on_date"; + public const string TestRunPowerOnTimeAttributeName = "on_time"; + public const string TestRunPowerOffDateAttributeName = "off_date"; + public const string TestRunPowerOffTimeAttributeName = "off_time"; + public const string TestRunPowerOnDurationAttributeName = "duration_sec"; + } +} diff --git a/Source/TSRealLib/Common/Raytheon.Common/Interfaces/ISerialPort.cs b/Source/Program/Common/Exceptions/FatalFailureException.cs similarity index 55% rename from Source/TSRealLib/Common/Raytheon.Common/Interfaces/ISerialPort.cs rename to Source/Program/Common/Exceptions/FatalFailureException.cs index 67ffbdd..577ec20 100644 --- a/Source/TSRealLib/Common/Raytheon.Common/Interfaces/ISerialPort.cs +++ b/Source/Program/Common/Exceptions/FatalFailureException.cs @@ -1,4 +1,5 @@ -// UNCLASSIFIED +/*------------------------------------------------------------------------- +// UNCLASSIFIED /*------------------------------------------------------------------------- RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS @@ -14,39 +15,25 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ - using System; -namespace Raytheon.Common +namespace ProgramLib { /// - /// An interface to a serial port device + /// Exception for support threads to throw to signal to main thread of a fatal failure /// - public interface ISerialPort : IDisposable + internal class FatalFailureException : Exception { - /// - /// Close the communication interface - /// - void Close(); + protected FatalFailureException() { } - /// - /// - /// - void Open(); + public FatalFailureException(string message) + : base(message) + { + } - /// - /// - /// - /// - /// - UInt32 Read(ref byte[] dataRead); - - /// - /// - /// - /// - void Write(byte[] dataToWrite); - - void Write(String dataToWrite); + public FatalFailureException(string message, Exception innerException) + : base(message, innerException) + { + } } } diff --git a/Source/Program/Common/Lib/EthernetSocketManager.cs b/Source/Program/Common/Lib/EthernetSocketManager.cs new file mode 100644 index 0000000..ba486b6 --- /dev/null +++ b/Source/Program/Common/Lib/EthernetSocketManager.cs @@ -0,0 +1,75 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System.Collections.Generic; + +namespace ProgramLib +{ + internal enum TcpClientNames + { + UUT_TEST_PORT + } + + /// + /// Stores global events that any thread can use to wait on + /// + internal class EthernetSocketManager + { + private Dictionary _tcpClientsDict = new Dictionary(); + + /// + /// The private constructor + /// + public EthernetSocketManager() + { + + } + + /// + /// Destructor + /// + ~EthernetSocketManager() + { + foreach (KeyValuePair item in _tcpClientsDict) + { + item.Value.Disconnect(); + } + } + + /// + /// Get Tcp Client Socket + /// + public TcpClient GetTcpClient(TcpClientNames tcpClientName) + { + TcpClient tcpClient = null; + + if (_tcpClientsDict.ContainsKey(tcpClientName)) + tcpClient = _tcpClientsDict[tcpClientName]; + + return tcpClient; + } + + /// + /// Add Tcp Client Socket + /// + public void AddTcpClient(TcpClientNames tcpClientName, TcpClient tcpClient) + { + if (!_tcpClientsDict.ContainsKey(tcpClientName)) + _tcpClientsDict[tcpClientName] = tcpClient; + } + } +} diff --git a/Source/Program/Common/Misc/EventGroup.cs b/Source/Program/Common/Lib/EventGroup.cs similarity index 98% rename from Source/Program/Common/Misc/EventGroup.cs rename to Source/Program/Common/Lib/EventGroup.cs index fa79fe9..d6fd4fc 100644 --- a/Source/Program/Common/Misc/EventGroup.cs +++ b/Source/Program/Common/Lib/EventGroup.cs @@ -18,9 +18,7 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading; -using System.Threading.Tasks; namespace ProgramLib { @@ -57,7 +55,7 @@ namespace ProgramLib /// if (id == Events.EVENT1){} /// /// - internal class EventGroup + internal class EventGroup { Dictionary _eventDict = null; T2[] _eventArray = null; diff --git a/Source/Program/Common/Misc/EventManager.Datatypes.cs b/Source/Program/Common/Lib/EventManager.Datatypes.cs similarity index 91% rename from Source/Program/Common/Misc/EventManager.Datatypes.cs rename to Source/Program/Common/Lib/EventManager.Datatypes.cs index 48933db..58577a8 100644 --- a/Source/Program/Common/Misc/EventManager.Datatypes.cs +++ b/Source/Program/Common/Lib/EventManager.Datatypes.cs @@ -15,12 +15,6 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace ProgramLib { /// diff --git a/Source/Program/Common/Misc/EventManager.cs b/Source/Program/Common/Lib/EventManager.cs similarity index 92% rename from Source/Program/Common/Misc/EventManager.cs rename to Source/Program/Common/Lib/EventManager.cs index 6d8859f..5781324 100644 --- a/Source/Program/Common/Misc/EventManager.cs +++ b/Source/Program/Common/Lib/EventManager.cs @@ -16,16 +16,13 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading; -using System.Threading.Tasks; namespace ProgramLib { /// - /// Stores global events that any thread can use to monitor + /// Stores global events that any thread can use to wait on /// internal partial class EventManager { diff --git a/Source/Program/Common/Misc/FileAndFolderManager.Datatypes.cs b/Source/Program/Common/Lib/FileAndFolderManager.Datatypes.cs similarity index 86% rename from Source/Program/Common/Misc/FileAndFolderManager.Datatypes.cs rename to Source/Program/Common/Lib/FileAndFolderManager.Datatypes.cs index 04f00f8..5c0f18a 100644 --- a/Source/Program/Common/Misc/FileAndFolderManager.Datatypes.cs +++ b/Source/Program/Common/Lib/FileAndFolderManager.Datatypes.cs @@ -15,12 +15,6 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace ProgramLib { /// @@ -32,12 +26,19 @@ namespace ProgramLib { // List data folder + its subfolders DATA, - DATA_TEMP, + DATA_GENERAL, + DATA_GENERAL_TEMP, + DATA_TEST, + + CONFIG, + CONFIG_MEASUREMENT } public enum Files { - POWER_SUPPLY_SELF_TEST_DATETIME + NLOG_TEMP, + CABLE_SELF_TEST_RUN_LOG, + TEST_RUN_LOG } } } diff --git a/Source/Program/Common/Lib/FileAndFolderManager.cs b/Source/Program/Common/Lib/FileAndFolderManager.cs new file mode 100644 index 0000000..72726bf --- /dev/null +++ b/Source/Program/Common/Lib/FileAndFolderManager.cs @@ -0,0 +1,227 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Text.RegularExpressions; +using Raytheon.Common; + +namespace ProgramLib +{ + /// + /// Partial class... this is the main class responsible for parsing config.ini in order + /// to construct file paths and folder paths + /// + internal partial class FileAndFolderManager + { + private Dictionary foldersDict = new Dictionary(); + private Dictionary filesDict = new Dictionary(); + + private IConfigurationFile _programGeneralConfig; + private IConfigurationFile _programSpecificConfig; + private bool _isThereHardware; + private string _configSubFolderName; + + /// + /// Constructor + /// + /// the UUT part number + public FileAndFolderManager(IConfigurationFile programGeneralConfig, out IConfigurationFile programSpecificConfig, bool isThereHardware, string configSubFolderName) + { + _programGeneralConfig = programGeneralConfig; + _isThereHardware = isThereHardware; + _configSubFolderName = configSubFolderName; + + ConstructFolderPaths(); + CreateFolders(); + ConstructFilePaths(); + + programSpecificConfig = _programSpecificConfig; + } + + /// + /// Destructor + /// + ~FileAndFolderManager() + { + if (foldersDict.ContainsKey(Folders.DATA_TEST)) + { + if (Directory.Exists(foldersDict[Folders.DATA_TEST]) && Directory.Exists(foldersDict[Folders.DATA])) + { + // delete all empty test folders + if (foldersDict[Folders.DATA_TEST].Contains(foldersDict[Folders.DATA])) + { + string parentFolder = Path.GetFullPath(Path.Combine(foldersDict[Folders.DATA_TEST], "..")); + + while (!String.Equals(parentFolder, foldersDict[Folders.DATA], StringComparison.OrdinalIgnoreCase)) + { + string[] dirs = Directory.GetDirectories(parentFolder); + + foreach (string dir in dirs) + { + if (Util.IsDirectoryEmpty(dir)) + Directory.Delete(dir, true); + } + + if (Util.IsDirectoryEmpty(parentFolder)) + Directory.Delete(parentFolder, true); + + parentFolder = Path.GetFullPath(Path.Combine(parentFolder, "..")); + } + } + } + } + } + + public void ConstructTestFolder(UutInfo uutInfo, TestInfo testInfo) + { + string buildLevel = uutInfo.UutBuildLevel.ToString(); + if (uutInfo.UutBuildLevel == UutInfo.BuildLevel.NOT_SET) + { + buildLevel = "NO_UUT"; + } + foldersDict[Folders.DATA_TEST] = Path.Combine(foldersDict[Folders.DATA], buildLevel, uutInfo.PartNumber, + uutInfo.SerialNumber, testInfo.TestType.ToLower(), testInfo.TestStartDateTime.ToString("yyyy_MM_dd"), + testInfo.TestName, testInfo.TestStartDateTime.ToString("HH_mm_ss")); + + CreateFolders(); + } + + /// + /// Build folder paths so we can acccess them later + /// + /// + private void ConstructFolderPaths() + { + string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + + string configHardwareOrSimSubFolderName = _programGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.SIM_CONFIG_FOLDER_NAME.ToString()); + if (_isThereHardware) + configHardwareOrSimSubFolderName = _programGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.HARDWARE_CONFIG_FOLDER_NAME.ToString()); + + foldersDict[Folders.CONFIG] = Path.Combine(assemblyFolder, GeneralConstants.ConfigFolderName, configHardwareOrSimSubFolderName, _configSubFolderName); + + string measurementConfigFolderName = _programGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.MEASUREMENT_CONFIG_FOLDER_NAME.ToString()); + foldersDict[Folders.CONFIG_MEASUREMENT] = Path.Combine(foldersDict[Folders.CONFIG], measurementConfigFolderName); + + string programSpecificConfigFilePath = Path.Combine(GetFolder(Folders.CONFIG), _programGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.PROGRAM_SPECIFIC_CONFIG_FILE_NAME.ToString())); + _programSpecificConfig = new ConfigurationFile(programSpecificConfigFilePath); + + string dataRootPath; + + // If primary drive exists on machine, all TE software files and folders should be located on that drive + string drive = _programSpecificConfig.ReadValue(ProgramSpecificConfigIni.GENERAL.ToString(), ProgramSpecificConfigIni.PRIMARY_DRIVE.ToString()); + if (!Directory.Exists(drive)) + { + drive = _programSpecificConfig.ReadValue(ProgramSpecificConfigIni.GENERAL.ToString(), ProgramSpecificConfigIni.SECONDARY_DRIVE.ToString()); + } + dataRootPath = Path.Combine(drive, _programSpecificConfig.ReadValue(ProgramSpecificConfigIni.GENERAL.ToString(), ProgramSpecificConfigIni.DATA_BASE_FOLDER.ToString())); + + if (!Path.IsPathRooted(dataRootPath)) + dataRootPath = Path.Combine(assemblyFolder, dataRootPath); + else + { + Match regexMatch; + + regexMatch = Regex.Match(dataRootPath, @"^([a-zA-Z]:\\).+", RegexOptions.IgnoreCase); + + if (regexMatch.Success) + { + string driveLetter = regexMatch.Groups[1].Value; + + if (!Directory.Exists(driveLetter)) + { + + string err = $@"Invalid drive: {driveLetter}. Please provide a valid drive, ie C:\. File: {programSpecificConfigFilePath}. Section: {ProgramSpecificConfigIni.GENERAL.ToString()}. Key: {ProgramSpecificConfigIni.PRIMARY_DRIVE.ToString()} and Key: {ProgramSpecificConfigIni.SECONDARY_DRIVE.ToString()} were invalid drives."; + + throw new Exception(err); + } + } + else + { + string err = $@"Invalid path: {dataRootPath}. Please specify desired folder name, i.e. Data. File: {programSpecificConfigFilePath}. Section: {ProgramSpecificConfigIni.GENERAL.ToString()}. Key: {ProgramSpecificConfigIni.DATA_BASE_FOLDER.ToString()}"; + + throw new Exception(err); + } + } + + foldersDict[Folders.DATA] = Path.GetFullPath(dataRootPath); + + string val = _programSpecificConfig.ReadValue(ProgramSpecificConfigIni.GENERAL.ToString(), ProgramSpecificConfigIni.DATA_GENERAL_FOLDER_NAME.ToString()); + foldersDict[Folders.DATA_GENERAL] = Path.Combine(dataRootPath, val); + + val = _programSpecificConfig.ReadValue(ProgramSpecificConfigIni.GENERAL.ToString(), ProgramSpecificConfigIni.DATA_GENERAL_TEMP_FOLDER_NAME.ToString()); + foldersDict[Folders.DATA_GENERAL_TEMP] = Path.Combine(foldersDict[Folders.DATA_GENERAL], val); + } + + /// + /// We create all the necessary folders + /// + /// + private void CreateFolders() + { + // create all the folders if they don't exist + foreach (KeyValuePair entry in foldersDict) + { + Directory.CreateDirectory(entry.Value); + } + } + + /// + /// Build file paths so we can acccess them later + /// + /// + private void ConstructFilePaths() + { + string nlogFileNamePrefix = _programGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.NLOG_FILE_NAME_PREFIX.ToString()); + filesDict[Files.NLOG_TEMP] = Path.Combine(GetFolder(FileAndFolderManager.Folders.DATA_GENERAL_TEMP), _programGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.NLOG_FOLDER_NAME.ToString()), DateTime.Now.ToString("yyyy_MM_dd"), Util.GenerateUniqueFilenameUsingDateTime(nlogFileNamePrefix, "log")); + filesDict[Files.CABLE_SELF_TEST_RUN_LOG] = Path.Combine(GetFolder(FileAndFolderManager.Folders.DATA_GENERAL), _programGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.CABLE_SELF_TEST_RUN_LOG_FILE_NAME.ToString())); + filesDict[Files.TEST_RUN_LOG] = Path.Combine(GetFolder(FileAndFolderManager.Folders.DATA_GENERAL), _programGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.TEST_RUN_LOG_FILE_NAME.ToString())); + } + + /// + /// Return the full folder path + /// + /// + /// + public string GetFolder(Folders folder) + { + if (foldersDict.ContainsKey(folder)) + { + return foldersDict[folder]; + } + else + throw new Exception($"{folder.ToString()} is invalid"); + } + + /// + /// Return the full file path + /// + /// + public string GetFile(Files file) + { + if (filesDict.ContainsKey(file)) + { + return filesDict[file]; + } + else + throw new Exception($"{file.ToString()} is invalid"); + } + } +} diff --git a/Source/Program/Common/Misc/GeneralConstants.cs b/Source/Program/Common/Lib/GeneralConstants.cs similarity index 75% rename from Source/Program/Common/Misc/GeneralConstants.cs rename to Source/Program/Common/Lib/GeneralConstants.cs index 8a59fb8..30c29ee 100644 --- a/Source/Program/Common/Misc/GeneralConstants.cs +++ b/Source/Program/Common/Lib/GeneralConstants.cs @@ -15,12 +15,6 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace ProgramLib { /// @@ -28,8 +22,8 @@ namespace ProgramLib /// internal static class GeneralConstants { - public const string ProgramConfigFilename = "config.ini"; - public const string TestMethodConfigFolderName = "TestMethodConfig"; - public const string TestMethodConfigFileName = "Test_Method_Configuration.ini"; + public const string ConfigFolderName = "ConfigFiles"; + + public const string ProgramGeneralConfigFilename = "ProgramGeneral.ini"; } } diff --git a/Source/Program/Common/Lib/Util.cs b/Source/Program/Common/Lib/Util.cs new file mode 100644 index 0000000..ced6c98 --- /dev/null +++ b/Source/Program/Common/Lib/Util.cs @@ -0,0 +1,307 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.DirectoryServices; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using NLog; + +namespace ProgramLib +{ + /// + /// Provides utility functions for other classes to use + /// + internal static class Util + { + /// + /// Check if directory is empty + /// + public static bool IsDirectoryEmpty(string path) + { + return !Directory.EnumerateFileSystemEntries(path).Any(); + } + + /// + /// Generate random fractional part + /// + public static float GenerateRandomFraction() + { + Random rnd = new Random(); + int randNum = 0; + const int minimum = 1; + + randNum = rnd.Next(20); + + if (randNum <= minimum) + { + randNum += minimum; + } + + return (float)(1.0 / (float)randNum); + } + + /// + /// Generate unique file name + /// Format: [Prefix]_YYYY_MM_DD_HH_MM_SS.[ext] + /// + public static string GenerateUniqueFilenameUsingDateTime(string prefix, string fileExtension) + { + string filename = prefix + "_" + DateTime.Now.ToString("yyyy_MM_dd") + "_" + DateTime.Now.ToString("HH_mm_ss"); + + if (fileExtension[0] != '.') + { + fileExtension = "." + fileExtension; + } + + filename += fileExtension; + + return filename; + } + + /// + /// Log Exception + /// + public static string LogException(Exception ex, ILogger logger) + { + string errorMsg = ex.Message; + string stackTrace = ex.StackTrace; + + Exception innerEx = ex.InnerException; + while (innerEx != null) + { + errorMsg = innerEx.Message; + stackTrace = innerEx.StackTrace + "\r\n" + stackTrace; + + innerEx = innerEx.InnerException; + } + + logger.Error(errorMsg + "\r\n" + stackTrace); + + return errorMsg; + } + + /// + /// Auto format any numeric type to string + /// + /// number of digits to display for the whole number before it display in scientific notation + public static string AutoFormatNumberToString(T o, int wholeNumberMaxDigits = 3, int numDecimalPlaces = 2) where T : IConvertible + { + try + { + if (Convert.ChangeType(o, typeof(double)) is double @double) + { + string originalStr = @double.ToString("G"); // Most compact + string tempStr = originalStr; + int indexOfDecimalPoint = tempStr.IndexOf("."); + if (indexOfDecimalPoint == -1) + tempStr += ".0"; + indexOfDecimalPoint = tempStr.IndexOf("."); + int tempStrIndex = 0; + int indexOfMinusSign = tempStr.IndexOf("-"); + if (indexOfMinusSign != -1) + tempStrIndex = 1; + int wholeNumberNumDigits = tempStr.Substring(tempStrIndex, indexOfDecimalPoint - tempStrIndex).Length; + int fractionalNumDigits = tempStr.Substring(indexOfDecimalPoint + 1, tempStr.Length - (indexOfDecimalPoint + 1)).Length; + if (wholeNumberNumDigits > wholeNumberMaxDigits || tempStr.IndexOf("E") != -1) + { + string decimalPlaces = String.Empty; + for (int i = 1; i <= numDecimalPlaces; i++) + { + decimalPlaces += "#"; + } + var custom = @double.ToString($"0.{decimalPlaces}E0").Replace("E+", "E"); + while (custom.Contains("E0")) custom = custom.Replace("E0", "E"); + while (custom.Contains("-0")) custom = custom.Replace("-0", "-"); + if ((@double < 0) && custom[0] != '-') + { + custom.Insert(0, "-"); + } + return custom; + } + else if (fractionalNumDigits > numDecimalPlaces) + { + return @double.ToString("0.##"); + } + else + { + return originalStr; + } + } + } + catch { } + return o.ToString(); + } + + /// + /// Get full name of windows user + /// + public static string GetWindowsUserFullName(string domain, string userName) + { + string name = ""; + + try + { + DirectoryEntry userEntry = new DirectoryEntry("WinNT://" + domain + "/" + userName + ",User"); + name = (string)userEntry.Properties["fullname"].Value; + } + catch + { + name = userName; + } + + return name; + } + + /// + /// Convert struct to byte array + /// + public static byte[] StructToByteList(T data) + { + int size = Marshal.SizeOf(data); + + byte[] arr = new byte[size]; + + GCHandle h = default(GCHandle); + + try + { + h = GCHandle.Alloc(arr, GCHandleType.Pinned); + + Marshal.StructureToPtr(data, h.AddrOfPinnedObject(), false); + } + finally + { + if (h.IsAllocated) + { + h.Free(); + } + } + + return arr; + } + + /// + /// Convert byte array to struct + /// + public static T ByteArrayToStruct(byte[] array) + { + object obj; + + GCHandle h = default(GCHandle); + + try + { + h = GCHandle.Alloc(array, GCHandleType.Pinned); + + obj = Marshal.PtrToStructure(h.AddrOfPinnedObject(), typeof(T)); + + } + finally + { + if (h.IsAllocated) + { + h.Free(); + } + } + + return (T)obj; + } + + /// + /// Get Two's Compliment Checksum + /// + public static byte GetTwosComplimentChecksum(byte[] array) + { + return (byte)(0x100u - ComputeSum(array)); + } + + /// + /// Add up all bytes in a byte array + /// + public static byte ComputeSum(byte[] array) + { + byte sum = 0; + + for (int i = 0; i < array.Length; i++) + sum += array[i]; + + return sum; + } + + /// + /// Display each byte in byte array as hex string + /// + public static string ByteArrayToHexString(byte[] bytes, int numBytes = -1) + { + StringBuilder Result = new StringBuilder(bytes.Length * 2); + string HexAlphabet = "0123456789ABCDEF"; + + if (numBytes < 1) + { + numBytes = bytes.Length; + } + + for (int i = 0; i < numBytes; i++) + { + Result.Append("0x" + HexAlphabet[(int)(bytes[i] >> 4)]); + Result.Append(HexAlphabet[(int)(bytes[i] & 0xF)] + " "); + } + + return Result.ToString(); + } + + /// + /// Given a variable of type TimeSpan, describe the time in days, hours, mins, seconds + /// + public static string DescribeTimeElapsed(TimeSpan ts) + { + string describe = ""; + + if (ts.Days > 0) + describe += ts.Days.ToString() + " d"; + + if (ts.Hours > 0) + { + if (describe.Length > 0) + describe += " "; + describe += ts.Hours.ToString() + " h"; + } + + if (ts.Minutes > 0) + { + if (describe.Length > 0) + describe += " "; + describe += ts.Minutes.ToString() + " m"; + } + + if (ts.Seconds > 0) + { + if (describe.Length > 0) + describe += " "; + describe += ts.Seconds.ToString() + " s"; + } + + if (describe.Length == 0) + describe = "0 s"; + + return describe; + } + } +} diff --git a/Source/Program/Common/Lib/XmlDocumentWrapper.cs b/Source/Program/Common/Lib/XmlDocumentWrapper.cs new file mode 100644 index 0000000..86cfac0 --- /dev/null +++ b/Source/Program/Common/Lib/XmlDocumentWrapper.cs @@ -0,0 +1,237 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; + +namespace ProgramLib +{ + /// + /// A XML Wrapper class to create/modify XML files + /// + internal class XmlDocumentWrapper + { + public enum AddNodePosition + { + First, + Last + } + + private XmlDocument _xmlDoc = null; + private string _xmlFilePath = String.Empty; + private object _syncObj = new object(); + + /// + /// Constructor + /// + /// XML file path + /// name of the root node. + public XmlDocumentWrapper(string xmlFilePath, string rootNodeName = "root") + { + _xmlFilePath = xmlFilePath; + CreateXmlDocument(rootNodeName); + + _xmlDoc = new XmlDocument(); + _xmlDoc.Load(xmlFilePath); + } + + /// + /// Create XML document if it doesn't exist + /// + private void CreateXmlDocument(string rootNodeName) + { + if (!File.Exists(_xmlFilePath)) + { + XmlDocument doc = new XmlDocument(); + XmlElement root = doc.CreateElement(rootNodeName); + doc.AppendChild(root); + + using (TextWriter sw = new StreamWriter(_xmlFilePath, false, Encoding.UTF8)) + { + doc.Save(sw); + } + } + } + + /// + /// Save XML document to file + /// + public void SaveToFile() + { + lock (_syncObj) + { + using (TextWriter sw = new StreamWriter(_xmlFilePath, false, Encoding.UTF8)) + { + _xmlDoc.Save(sw); + } + } + } + + /// + /// Add a node defined by {path} + /// + /// example: /root/node1/node2 + /// a dictionary of [name,value] pairs + /// text of the node + public void AddNode(string path, Dictionary attributesDict = null, string innerText = null, AddNodePosition addNodePosition = AddNodePosition.Last) + { + lock (_syncObj) + { + XmlElement elem = (XmlElement)MakeXPath(_xmlDoc, path, addNodePosition); + + if (!String.IsNullOrEmpty(innerText)) + elem.InnerText = innerText; + + if (attributesDict != null) + { + List attributes = new List(); + + foreach (KeyValuePair item in attributesDict) + { + XmlAttribute attr = _xmlDoc.CreateAttribute(item.Key); + attr.Value = item.Value; + + attributes.Add(attr); + } + + SetAttrSafe(elem, attributes.ToArray()); + } + } + } + + /// + /// Remove a node + /// + public void RemoveNode(XmlNode node) + { + lock (_syncObj) + { + node.ParentNode.RemoveChild(node); + } + } + + /// + /// Change attributes and/or inner text of an existing node + /// + public void ChangeNode(XmlNode node, Dictionary attributesDict = null, string innerText = null) + { + lock (_syncObj) + { + if (!String.IsNullOrEmpty(innerText)) + node.InnerText = innerText; + + if (attributesDict != null) + { + List attributes = new List(); + + foreach (KeyValuePair item in attributesDict) + { + XmlAttribute attr = _xmlDoc.CreateAttribute(item.Key); + attr.Value = item.Value; + + attributes.Add(attr); + } + + SetAttrSafe(node, attributes.ToArray()); + } + } + } + + /// + /// Get the first node in {path} + /// Useful for iterating through the sibling nodes to find the node with a specific attribute so we can modify the node + /// + /// example: /root/node1/node2 + public XmlNode GetNode(string path) + { + lock (_syncObj) + { + return _xmlDoc.SelectSingleNode(path); + } + } + + /// + /// Get all the nodes matching the path + /// Useful for iterating through the matched nodes + /// + /// example: /root/node1/node2 + public XmlNodeList GetNodes(string path) + { + lock (_syncObj) + { + return _xmlDoc.SelectNodes(path); + } + } + + /// + /// Set attribute + /// + private void SetAttrSafe(XmlNode node, XmlAttribute[] attrList) + { + foreach (var attr in attrList) + { + if (node.Attributes[attr.Name] != null) + { + node.Attributes[attr.Name].Value = attr.Value; + } + else + { + node.Attributes.Append(attr); + } + } + } + + /// + /// Add a node using {xpath} + /// + /// example: /root/node1/node2 + private XmlNode MakeXPath(XmlDocument doc, string xpath, AddNodePosition addNodePosition) + { + return MakeXPath(doc, doc as XmlNode, xpath, addNodePosition); + } + + /// + /// Iterate through each node in {xpath} and create them + /// + private XmlNode MakeXPath(XmlDocument doc, XmlNode parent, string xpath, AddNodePosition addNodePosition) + { + // grab the next node name in the xpath; or return parent if empty + string[] partsOfXPath = xpath.Trim('/').Split('/'); + string nextNodeInXPath = partsOfXPath.First(); + if (string.IsNullOrEmpty(nextNodeInXPath)) + return parent; + + // get or create the node from the name + XmlNode node = parent.SelectSingleNode(nextNodeInXPath); + if (partsOfXPath.Length == 1) + { + if (addNodePosition == AddNodePosition.Last) + node = parent.AppendChild(doc.CreateElement(nextNodeInXPath)); + else + node = parent.PrependChild(doc.CreateElement(nextNodeInXPath)); + } + + // rejoin the remainder of the array as an xpath expression and recurse + string rest = String.Join("/", partsOfXPath.Skip(1).ToArray()); + return MakeXPath(doc, node, rest, addNodePosition); + } + } +} diff --git a/Source/Program/Common/Misc/FileAndFolderManager.cs b/Source/Program/Common/Misc/FileAndFolderManager.cs deleted file mode 100644 index 45e1c2b..0000000 --- a/Source/Program/Common/Misc/FileAndFolderManager.cs +++ /dev/null @@ -1,120 +0,0 @@ -/*------------------------------------------------------------------------- -// UNCLASSIFIED -/*------------------------------------------------------------------------- -RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION -PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS -AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO -UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO -RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS -CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS -OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON -COMPANY. - -THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. -GOVERNMENT. - -UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. --------------------------------------------------------------------------*/ -using Raytheon.Common; -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; - -namespace ProgramLib -{ - /// - /// Partial class... this is the main class responsible for parsing config.ini in order - /// to construct file paths and folder paths - /// - internal partial class FileAndFolderManager - { - private Dictionary foldersDict = new Dictionary(); - private Dictionary filesDict = new Dictionary(); - - private IConfigurationFile _programConfig; - - /// - /// The private constructor - /// - /// the UUT part number - public FileAndFolderManager(IConfigurationFile programConfig) - { - _programConfig = programConfig; - - ConstructFolderPaths(); - CreateFolders(); - ConstructFilePaths(); - } - - /// - /// Build folder paths so we can acccess them later - /// - /// - /// - private void ConstructFolderPaths() - { - string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - - string dataRootPath = _programConfig.ReadValue(ProgramConfigIni.GENERAL.ToString(), ProgramConfigIni.DATA_BASE_PATH.ToString(), "NOT SET"); - if (!Path.IsPathRooted(dataRootPath)) - dataRootPath = Path.Combine(assemblyFolder, dataRootPath); - - foldersDict[Folders.DATA] = Path.GetFullPath(dataRootPath); - - string val = _programConfig.ReadValue(ProgramConfigIni.GENERAL.ToString(), ProgramConfigIni.DATA_TEMP_PATH.ToString(), "NOT SET"); - foldersDict[Folders.DATA_TEMP] = Path.Combine(dataRootPath, val); - } - - /// - /// We create all the necessary folders - /// - /// - /// - private void CreateFolders() - { - Directory.CreateDirectory(foldersDict[Folders.DATA_TEMP]); - } - - /// - /// Build file paths so we can acccess them later - /// - /// - /// - private void ConstructFilePaths() - { - string val = _programConfig.ReadValue(ProgramConfigIni.GENERAL.ToString(), ProgramConfigIni.POWER_SUPPLY_SELF_TEST_DATETIME.ToString(), "NOT SET"); - filesDict[Files.POWER_SUPPLY_SELF_TEST_DATETIME] = Path.Combine(foldersDict[Folders.DATA_TEMP], val); - } - - /// - /// Return the full folder path - /// - /// - /// - public string getFolder(Folders folder) - { - if (foldersDict.ContainsKey(folder)) - { - return foldersDict[folder]; - } - else - throw new Exception($"{folder.ToString()} is invalid"); - } - - /// - /// Return the full file path - /// - /// - /// - public string getFile(Files file) - { - if (filesDict.ContainsKey(file)) - { - return filesDict[file]; - } - else - throw new Exception($"{file.ToString()} is invalid"); - } - } -} diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeDeviceNodeTCP.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeDeviceNodeTCP.xml new file mode 100644 index 0000000..50c7230 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeDeviceNodeTCP.xml @@ -0,0 +1,143 @@ + + + +
+ + + + + + + + +
+
+ + + + + + + + + + + +
+
+ + + +
+
+ +
+
+ + + + + + + + +
+
+ + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + 10 + + + 100 + + + + ./CoeXmlFiles/NGSRI/GimbalMsgs.xml + ./CoeXmlFiles/NGSRI/NgsriUmbilicalMsgs.xml + ./CoeXmlFiles/NGSRI/NgsriMissionManagerMsgs.xml + ./CoeXmlFiles/NGSRI/NgsriFirmwareMsg.xml + + + + + + + MissionManagerMsgLL + + + + + + + + + MissionManagerMsgLL + + +
diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/BitRspMsg.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/BitRspMsg.xml new file mode 100644 index 0000000..cefd863 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/BitRspMsg.xml @@ -0,0 +1,491 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VipConfigDataMsg.xml + cstdint + + + ngsri + + The number of VIP bit voltages defined by the enum VipBitVoltages + uint32_t + NUMBER_OF_VIP_BIT_VOLTAGES + 29 + + + VoltageBitRspData + + ngsri::NUMBER_OF_VIP_BIT_VOLTAGES + 0.0 + voltages + float + + + + CasBitRspMsgData + Valid ACU states: STANDBY + + 0x43u + ID + uint8_t + Message Identity + + + 0x0Au + BC + uint8_t + Byte count (number of bytes to follow the byte command) + + + 0u + STS + uint8_t + Incomplete or corrupt message response and the status of the BIT operation + + + 0u + BIT_RESULT + uint8_t + Shows the BIT results. bit 0 is PBIT result, bit 1 is IBIT result, and bit 2 is SBIT result. Bit 3 is a spare. Bits 4:5 tells the last BIT performed, and bits 6:7 tells the BIT diagnostic log results + + + 0u + BIT_LOG_DIAG1A + uint8_t + Bit 0 is the DSP PLL and DSP ID Test, pass = 1, fail = 0; Bit 1 is the RAM Integrity Test, pass = 1, fail = 0; Bit 2 is the ROM Program CRC Test, pass = 1, fail = 0; Bit 3 is the ROM CRC Tables Test, pass = 1, fail = 0; Bit 4 is the ROM Calibration Tables Test, pass = 1, fail = 0; Bit 5 is the DSP Timer Test, pass = 1, fail = 0; Bits 6:7 are reserved, value = 0 + + + 0u + BIT_LOG_DIAG1B + uint8_t + Bit 0 is the DSP Analog-to-Digital (ADC) Test, pass = 1, FAIL = 0; Bit 1 is the Actuator Battery Voltage Test, pass = 1, fail = 0; Bits 2:7 are reserved bits, value = 0 + + + 0u + BIT_LOG_DIAG1C + uint8_t + Bit 0 is the Channel A Motor Phase Drive Test, pass = 1, fail = 0; Bit 1 is the Channel B Motor Phase Drive Test, pass = 1, fail = 0; Bit 2 is the Channel C Motor Phase Drive Test, pass = 1, fail = 0; Bit 3 is a reserved bit, value = 0; Bit 4 is the Channel A Motor Position Sensor test, pass = 1, fail = 0; Bit 5 is the Channel B Motor Position Sensor test, pass = 1, fail = 0; Bit 6 is the Channel C Motor Position Sensor test, pass = 1, fail = 0; Bit 7 is a reserved bit, value = 0 + + + 0u + BIT_LOG_DIAG1D + uint8_t + Reserved, value = 0 + + + 0u + BIT_LOG_SPARE1 + uint8_t + Spare, value = 0 + + + 0u + BIT_LOG_SPARE2 + uint8_t + Spare, value = 0 + + + 0u + Spare + uint8_t + Spare, value = 0 + + + 0u + CSUM + uint8_t + Checksum: 0 - (Modulo 256 byte-wise addition of bytes 0 to 10) + + + 2 + 0 + padding_cas + uint8_t + + + + GspBitRspMsgData + GSP BIT Response Message + + 0u + encResult + uint8_t + Encoder PBIT Result + + + 0u + gspResult + uint8_t + GSP PBIT Result. Positioned before imuResult to comply with the 2-byte struct alignment rule, reference the IDD for true byte order + + + 0u + imuResult + uint16_t + IMU PBIT Result + + + 0 + voltage5p15 + int16_t + Raw 5p15 voltage value in mV + + + 0 + voltage3p3 + int16_t + Raw 3p3 voltage value in mV + + + 0 + tempGsp + int16_t + Raw GSP temperature value in Celcius + + + 2 + 0 + padding_gsp + uint8_t + + + + MccBitResultsData + + 0.0f + voltageP20V + float + P20 voltage in V + + + 0.0f + voltageN20V + float + N20 voltage in V + + + 0.0f + voltageP3V3 + float + 3v3 voltage in V + + + 0.0f + voltageP1V2 + float + 1v2 voltage in V + + + 0.0f + voltage12V + float + 12V voltage in V + + + 0.0f + tempMCC + float + MCC temperature value in Celsius + + + 0u + testResults + uint8_t + MCC Bit Result Data + + + 2 + 0 + padding_mcc + uint8_t + + + + SicBitRspMsgData + + 0.0f + idaTempVolt + float + SIC ADC AIN channel 0: IDA temperature in Voltage: Expected range: [0.567V, 0.889V] + + + 0.0f + idaPowerSysVolt0 + float + SIC ADC AIN channel 1: IDA power system. Nominal V: 1.08V | band: +-5% + + + 0.0f + idaPowerSysVolt1 + float + SIC ADC AIN channel 2: IDA power system. Nominal V: 1.98V | band: +-5% + + + 0.0f + idaPowerSysVolt2 + float + SIC ADC AIN channel 3: IDA power system. Nominal V: 2.0256V | band: +-5% + + + 0.0f + idaCurrFlowVolt0 + float + SIC ADC AIN channel 4: IDA current flow. Nominal V: 1.1443V | band: -50% + + + 0.0f + idaCurrFlowVolt1 + float + SIC ADC AIN channel 5: IDA current flow. Nominal V: 1.2851V | band: -50% + + + 0.0f + idaCurrFlowVolt2 + float + SIC ADC AIN channel 6: IDA current flow. Nominal V: 1.1525V | band: -50% + + + 0.0f + idaAbitVolt + float + SIC ADC AIN channel 7: IDA ABIT. Nominal voltage: 1.65V | +-5% + + + 0.0f + tempCelsius + float + SIC ADC die temperature in degrees Celsius: [-40.0 degrees Celsius, 125.0 degrees Celsius] + + + + IdaBitResponseMsgData + + 0u + dBit + uint8_t + DBIT from the IDA. 1 means DBIT passed, 0 means DBIT failed. + + + 3 + 0 + padding_ida + uint8_t + + + + ProxBitRspMsgData + + 0u + resultData + uint8_t + Prox Bit Result Data + + + 0u + maxTimeOfFlightExtEcho + uint8_t + Prox echoing back the received time of flight extension value + + + 0u + proxSwVersion + uint8_t + Proximity Sensors SW version + + + + PolarFireBitRspMsgData + + 0.0f + channel_0_V + float + PolarFire TVS CH0 (1.0V rail) in Volts + + + 0.0f + channel_1_V + float + PolarFire TVS CH1 (1.8V rail) in Volts + + + 0.0f + channel_2_V + float + PolarFire TVS CH2 (2.5V rail) in Volts + + + 0.0f + channel_3_dieTemp_Celsius + float + PolarFire TVS CH3 temperature in Celcius + + + 0.0f + tmp102_Celsius + float + PolarFire chip temperature in Celsius + + + ngsri::VERSION_STRLEN + 0 + fwVers + char + PolarFire FW Build Version + + + 2 + 0 + padding_pf + uint8_t + + + + LieBitRspMsgData + + 0 + resultData + uint8_t + LIE Bit Result Data + + + + CasBitRspMsg + 0x00 + + CasBitRspMsg + + payload + ngsri::CasBitRspMsgData + + + + GspBitRspMsg + 0x00 + + GspBitRspMsg + + payload + ngsri::GspBitRspMsgData + + + + MccBitResultsMsg + 0x00 + + MccBitResultsMsg + + payload + ngsri::MccBitResultsData + + + + ProxBitRspMsg + 0x00 + + ProxBitRspMsg + + payload + ngsri::ProxBitRspMsgData + + + + LieBitRspMsg + 0x00 + + LieBitRspMsg + + payload + ngsri::LieBitRspMsgData + + + + UmbilicalSendMsg + 0x00 + + UmbilicalSendMsg + + 0 + payload + uint32_t + Data not used, reciept of message triggers UmbilicalComp to send data to Launcher over UART. + + + + SicBitResponseMsg + 0x00 + + SicBitResponseMsg + + payload + ngsri::SicBitRspMsgData + message sent by the SicComp after receiveing BIT results from the SIC + + + + IdaBitResponseMsg + 0x00 + + IdaBitResponseMsg + + payload + ngsri::IdaBitResponseMsgData + message sent by the FwSigProcComp after receiveing DBIT results from the IDA + + + + PolarFireBitRspMsg + 0x00 + + PolarFireBitRspMsg + + payload + ngsri::PolarFireBitRspMsgData + + + + VoltageBitRspMsg + 0x00 + + VoltageBitRspMsg + + payload + ngsri::VoltageBitRspData + VIP voltage registers + + + + + + + + + diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/Common.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/Common.xml new file mode 100644 index 0000000..f1bbadb --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/Common.xml @@ -0,0 +1,649 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + wosa + + uint32_t + MAX_EFFECTOR_COUNT + 8 + + + uint32_t + MAX_MSG_PROD + 500 + + + uint32_t + MAX_NUM_TARGETS + 10 + + + uint32_t + VALID + 0 + + + uint32_t + INVALID + 1 + + + uint32_t + ALL_VALID + 0 + + + uint32_t + ALL_INVALID + 0xFFFFFFFF + + + EffectorType + + ACM + 0x01 + + + SURFACE + 0x02 + + + + MDT_File_Number + Allowable enumerations for the MDT File Type to be used by the WIM Defined DMN_Initialization Message + + ALMANAC + 4 + + + EPHEMERIS + 5 + + + COMPLEMENTARYNAV + 19 + + + MISSIONDATA + 20 + + + WDL_KEY_1 + 25 + + + WDL_KEY_2 + 26 + + + WDL_KEY_3 + 27 + + + + BIT_Report_e + Allowable enumerations for the DMN_Status_Monitor.Subsystem_BIT_Report field. All other values are Reserved or WIM defined. + + BIT_PASS + 0 + + + BIT_DEGRADED + 1 + + + BIT_FAILED + 2 + + + NO_RESULTS + 3 + + + + Message_Rate + + 0xFFFFFFFF + messageInvalidityBitFlags + uint32_t + + + 0 + messageID + uint8_t + + + 3 + 0 + reserved2 + uint8_t + + + 0 + msgUpdateRateHz + float + + + 0xFFFFFFFF + msgVersionNumber + uint32_t + + + + Target_Priority + + 0 + targetIdPriority + uint8_t + + + 3 + 0 + reserved2 + uint8_t + + + + Target_State_ECEF + + 0xFFFFFFFF + messageInvalidityBitFlags + uint64_t + + + 0 + timeValidNanoSec + uint64_t + + + 0.0 + tgtPosEcefX + double + + + 0.0 + tgtPosEcefY + double + + + 0.0 + tgtPosEcefZ + double + + + 3 + 3 + 0.0 + tgtPosCovEcef + double + + + 0.0 + tgtVelEcefX + double + + + 0.0 + tgtVelEcefY + double + + + 0.0 + tgtVelEcefZ + double + + + 3 + 3 + 0.0 + tgtVelCovEcef + double + + + 0.0 + tgtAccEcefX + double + + + 0.0 + tgtAccEcefY + double + + + 0.0 + tgtAccEcefZ + double + + + 3 + 3 + 0.0 + tgtAccCovEcef + double + + + 0 + tgtId + uint64_t + + + 0 + tgtType + uint32_t + + + 0 + tgtPriority + uint8_t + + + 3 + 0 + reserved2 + uint8_t + + + 0 + tgtIntention + uint32_t + + + 0 + clusterIndicator + uint32_t + + + + Target_State_LOS + + 0xFFFFFFFF + messageInvalidityBitFlags + uint64_t + + + 0 + timeValidNanoSec + uint64_t + + + 0.0 + tgtRange + double + + + 0.0 + tgtRangeRate + double + + + 0.0 + tgtRelXrot + double + + + 0.0 + tgtRelYrot + double + + + 0.0 + tgtRelZrot + double + + + 3 + 3 + 0.0 + tgtLosCov + double + + + 0.0 + tgtRelXrotRate + double + + + 0.0 + tgtRelYrotRate + double + + + 0.0 + tgtRelZrotRate + double + + + 3 + 3 + 0.0 + tgtLosRateCov + double + + + 0 + tgtId + uint64_t + + + 0 + tgtType + uint32_t + + + 0 + tgtIntention + uint32_t + + + 0 + tgtPriority + uint32_t + + + 0 + refLocX + uint32_t + + + 0 + refLocY + uint32_t + + + 0 + refLocZ + uint32_t + + + 3 + 3 + 0 + refCov + uint32_t + + + 0 + clusterIndicator + uint32_t + + + + Header + + 0 + domainID + uint8_t + + + 0 + instanceID + uint8_t + + + 0 + elementID + uint8_t + + + 0 + messageID + uint8_t + + + 0 + messageCount + uint16_t + + + 0 + payloadLengthBytes + uint16_t + + + 0 + timeStampNanoSec + uint64_t + + + + Trailer + + 0 + messageCRC + uint32_t + + + + DMN_LookTo_ECEF + + 0 + numTgts + uint8_t + Number of Target ECEF cues + + + 3 + 0 + reserved + uint8_t + + + wosa::MAX_NUM_TARGETS + targetStateEcef + wosa::Target_State_ECEF + + + + DMN_LookTo_LOS + + 0 + numTgts + uint8_t + Number of Targets Look To LOS + + + 3 + 0 + reserved + uint8_t + + + wosa::MAX_NUM_TARGETS + targetStateLos + wosa::Target_State_LOS + + + + DMN_Metamodule_Message + + 0xFFFFFFFF + messageInvalidityBitFlags + uint32_t + + + 0 + vendorRegistry + uint8_t + + + 0 + vendorSystemNumber + uint8_t + + + 0 + vendorModel + uint8_t + + + 0 + vendorSoftware + uint8_t + + + 0 + numMsgsProduced + uint8_t + + + 3 + 0 + reserved + uint8_t + + + wosa::MAX_MSG_PROD + messageRate + wosa::Message_Rate + + + + DMN_Priority + + 0xFFFFFFFF + messageInvalidityBitFlags + uint32_t + + + 0 + numTgts + uint8_t + + + 3 + 0 + reserved + uint8_t + + + wosa::MAX_NUM_TARGETS + targetPriority + wosa::Target_Priority + + + + DMN_Status_Monitor + + 0xFFFFFFFF + messageInvalidityBitFlags + uint32_t + + + 0 + subsystemBITreport + uint16_t + + + 0 + storeStatusWord1 + uint16_t + + + 0 + storeStatusWord2 + uint16_t + + + 0 + storeStatusWord3 + uint16_t + + + 0 + storeStatusWord4 + uint16_t + + + 0 + storeStatusWord5 + uint16_t + + + 0 + msnExecControlAck + uint16_t + + + 0 + reserved + uint16_t + + + + DMN_Initialization + + 0 + MDT_File_Number + uint16_t + Enumeration: Type of MDT File (4 = Almanac, 5 = Ephemeris, etc) + + + 64 + numberOfRecords + uint16_t + Width of 2D Array + + + 29 + numberOfBlocks + uint16_t + Height of 2D Array + + + 64 + 29 + 0 + MDT_Data + uint16_t + WIM Specified Initialization Data, typically this data structure is defined in an external standard and only used for initialization [unitless] + + + + + + + + + diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/Gimbal.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/Gimbal.xml new file mode 100644 index 0000000..3add465 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/Gimbal.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + roll and nod + uint32_t + N_AXES + 2 + + + Bits + + 0 + posLoop + uint32_t + bit + + + 0 + velLoop + uint32_t + bit + + + 0 + velCmd + uint32_t + bit + + + 0 + injCur + uint32_t + bit + + + 0 + injVel + uint32_t + bit + + + 0 + injPos + uint32_t + bit + + + 0 + fricComp + uint32_t + bit + + + + AxisMode + + b + Bits + + + + Axis + + mode + AxisMode + + + 0 + pos + double + rad + + + 0 + vel + double + rad/sec + + + + AlgorithmProcAxis + + 0.0 + posFltRad + double + + + 0.0 + velFltRps + double + + + + CurrentMeasurements + + 0.0 + dvtCurrAdcSec + double + + + 0.0 + measPhaseACurrAdcA + double + + + 0.0 + measPhaseBCurrAdcA + double + + + + + + + + diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/GimbalMsgs.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/GimbalMsgs.xml new file mode 100644 index 0000000..9de601c --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/GimbalMsgs.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gimbal.xml + cstdint + + + GimbalCommandDataType + \\<EximItarRestricted> ----------------------------------------------------------------------------// WARNING - This document contains Technical Data whose export or disclosure // to Non-U.S. Persons, wherever located, is restricted by the International // Traffic in Arms Regulations (ITAR) (22 C.F.R Sections 120-130). Violations // are subject to severe criminal penalties. // ----------------------------------------------------------------------------// \\<\EximItarRestricted> + + 0 + time + double + + + 0 + valid + unsigned int + + + 0.0 + cmdGimbalAzFromHousingInBody + double + + + 0.0 + cmdGimbalElFromHousingInBody + double + + + + GimbalStateDataType + + 0.0 + measTime + double + + + 0.0 + measRoll + double + + + 0.0 + measNod + double + + + + CageDataType + + 0 + cagedPitch + int32_t + + + 0 + cagedRoll + int32_t + + + 0 + uncaged + int + + + + GimbalCurrentCommandDataType + + N_AXES + 0.0 + currentCommands + double + + + 0.0f + pwmRollPhaseA + float + + + 0.0f + pwmRollPhaseB + float + + + 0.0f + pwmRollPhaseC + float + + + 0.0f + pwmNodPos + float + + + 0.0f + pwmNodNeg + float + + + + GimbalCurrentMeasurementDataType + + N_AXES + curr + CurrentMeasurements + + + + GimbalSensorProcessorTmStruct + Telemetry payload struct for the GSPComp + + -1.0 + encoderMeasTime + double + Time (s) at which the encoder measurement was taken + + + 0 + imuValidityTimeNs + uint64_t + Time in nanoseconds that the IMU measurement is valid for. See SW/DataModel/WOSA/IMU.xml + + + 0 + nodEncoderData + double + + + 0 + rollEncoderData + double + + + 3 + 0 + ImuAccelData + float + + + 3 + 0 + ImuGyroData + float + + + + GimbalMisalignmentDataType + + 3 + 0 + pTa + double + + + 3 + 0 + gTp + double + + + 3 + 0 + tTg + double + + + 3 + 0 + dTp + double + + + 3 + 0 + r1 + double + + + 3 + 0 + r2 + double + + + 3 + 0 + r3 + double + + + 3 + 0 + n1 + double + + + + GimbalCommandMsg + 0x00 + + GimbalCommandMsg + + data + GimbalCommandDataType + + + + GimbalStateMsg + 0x00 + + GimbalStateMsg + + data + GimbalStateDataType + + + + EncoderHwifMsg + 0x00 + + EncoderHwifMsg + + data + GimbalStateDataType + Message sent from GspHwif to itself after delay + + + + CageStateMsg + 0x00 + + CageStateMsg + + data + CageDataType + + + + GimbalCurrentCommandMsg + 0x00 + + GimbalCurrentCommandMsg + + data + GimbalCurrentCommandDataType + + + + GimbalCurrentMeasurementMsg + 0x00 + + GimbalCurrentMeasurementMsg + + data + GimbalCurrentMeasurementDataType + + + + GimbalSensorProcessorTmMsg + 0x00 + + GimbalSensorProcessorTmMsg + + data + GimbalSensorProcessorTmStruct + + + + GimbalMisalignmentDataMsg + 0x00 + + GimbalMisalignmentDataMsg + + data + GimbalMisalignmentDataType + + + + + + + + diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriFirmwareMsg.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriFirmwareMsg.xml new file mode 100644 index 0000000..50ff198 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriFirmwareMsg.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + ngsri + + With input from SP, maximum expected segements in the scene is 500 + uint32_t + MAX_SEGMENT_SIZE + 500 + + + NgsriSegmentData + + 0 + numSegments + uint16_t + The actual number of segments + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentRow + uint8_t + The row of the segment in the original image + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentBeginCol + uint8_t + The column of the first pixel in the segment + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentEndCol + uint8_t + The column after the last pixel of the segment + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentLength + uint8_t + The number of pixels in the segment + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentColMoment + uint32_t + The sum of the columns of the pixels in the segment + + + ngsri::MAX_SEGMENT_SIZE + 0.0f + segmentMaxIntensity + float + The highest intensity out of the pixels in the segment + + + ngsri::MAX_SEGMENT_SIZE + 0.0f + segmentSumIntensity + float + The sum of pixel intensities within segment + + + 0.0 + tov + double + + + 0 + frameNumber + unsigned int + + + + NgsriAdnucStateData + + 0 + adnucState + uint8_t + + + 3 + 0 + padding + uint8_t + + + + NgsriRobSegmentsMsg + 0x00 + + NgsriRobSegmentsMsg + + payload + ngsri::NgsriSegmentData + + + + NgsriLogSegmentsMsg + 0x00 + + NgsriLogSegmentsMsg + + payload + ngsri::NgsriSegmentData + + + + NgsriAdnucStateMsg + 0x00 + + NgsriAdnucStateMsg + + data + ngsri::NgsriAdnucStateData + + + + + + + + + diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriMissionManagerMsgs.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriMissionManagerMsgs.xml new file mode 100644 index 0000000..58e583f --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriMissionManagerMsgs.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + ngsri + + MissionMode + + TACTICAL + 0 + + + MSFR + 1 + + + PATHFINDER + 2 + + + RTF + 3 + + + LBT + 4 + + + CFT + 5 + + + GFT + 6 + + + + MissionManagerDataTypeLL + + 0 + CTS + unsigned int + + + 0 + pad_one + unsigned int + + + 3 + 0.0 + tgtPosLocal + double + + + 3 + 0.0 + tgtVelLocal + double + + + 3 + 0.0 + tgtAccLocal + double + + + 3 + 3 + 0.0 + tgtPosCovNED + double + + + 3 + 3 + 0.0 + tgtVelCovNED + double + + + 3 + 3 + 0.0 + tgtAccCovNED + double + + + 0.0 + timeOfValidity + double + + + 0 + guideState + int + + + 0 + seekerState + int + + + 0 + seekerReady + int + + + 0 + cageState + int + bool + + + 0 + adnucState + int + + + 0 + mmgrState + uint8_t + See MissionManagerTypes.hpp + + + 3 + 0 + pad_two + uint8_t + + + 0 + recage + int + bool + + + 0 + mmgrMode + uint8_t + Mission manager mode of operation + + + 3 + 0 + pad_three + uint8_t + + + 99999.0 + tacticalLaunchTimeSec + double + + + + MissionManagerAdnucType + + 0 + adnucState + int + + + 0 + startAdnuc + unsigned int + bool + + + + MissionManagerCoarseAlignType + + 0 + AlignmentDuration + double + + + + MissionManagerCompTmType + + 0 + mmgrState + uint8_t + See MissionManagerTypes.hpp + + + 0 + adnucState + uint8_t + See MissionManagerTypes.hpp + + + 0 + testListSize + uint64_t + Part of MissileKit CommonEmbeddedTest framework + + + 0 + testListStatus + uint64_t + Part of MissileKit CommonEmbeddedTest framework + + + 0.0 + measTime + double + See TimeUtility.hpp getTimeNow_sec(). This field is needed to align measurements from other packets without introducing in variation from the Telemetry component + + + 0.0 + navTime + float + + + + MissionManagerSyncReqData + + 0 + activateSyncs + uint8_t + Enables the FSync and GSync pulses in FW + + + + MissionManagerMsgLL + 0x00 + + MissionManagerMsgLL + + data + ngsri::MissionManagerDataTypeLL + + + + MissionManagerAdnucMsg + 0x00 + + MissionManagerAdnucMsg + + data + ngsri::MissionManagerAdnucType + + + + MissionManagerAlignmentMsg + 0x00 + + MissionManagerAlignmentMsg + + data + ngsri::MissionManagerCoarseAlignType + + + + MissionManagerCompTmMsg + 0x00 + + MissionManagerCompTmMsg + + data + ngsri::MissionManagerCompTmType + + + + MissionManagerSyncReqMsg + 0x00 + + MissionManagerSyncReqMsg + + data + ngsri::MissionManagerSyncReqData + + + + MissionManagerIdaTempReqMsg + 0x00 + + MissionManagerIdaTempReqMsg + + 0 + payload + uint32_t + Sent to IdaComp to determine if IDA temp is overthreshold. No payload, message receipt dictates behavior + + + + + + + + + diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriUmbilicalMsgs.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriUmbilicalMsgs.xml new file mode 100644 index 0000000..176c2b4 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriUmbilicalMsgs.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + ngsri + + UmbilicalRetractBatteryGoodDataType + + 0 + umbilicalRetractBatteryGood + unsigned int + bool + + + + UmbilicalTmDataType + Telemetry payload struct for the UmbilicalComp + + 2 + 0 + losData + int32_t + + + 2 + 0 + cageVectorPitchRollData + int32_t + roll and pitch units where roll is 1 rotation about X and pitch is 2 rotation about Y in bits per degrees notation + + + 0 + uncageData + int + + + 0 + cageCount + uint32_t + + + 0 + toneData + double + + + 0 + umbilicalRetractBatteryGoodData + unsigned int + bool + + + 0 + orientationRspData + uint16_t + + + 0 + lifetimeTime + uint32_t + seconds + + + 0 + lifetimeCount + uint8_t + + + + UmbilicalRetractBatteryGoodMsg + 0x00 + + UmbilicalRetractBatteryGoodMsg + + data + ngsri::UmbilicalRetractBatteryGoodDataType + + + + UmbilicalTmMsg + 0x00 + + UmbilicalTmMsg + + data + ngsri::UmbilicalTmDataType + + + + + + + + + diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/VipConfigDataMsg.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/VipConfigDataMsg.xml new file mode 100644 index 0000000..966204c --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/CoeXmlFiles/NGSRI/VipConfigDataMsg.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + ngsri + + Length of the version string including the null character - compliant with the Digital Product Version Convention. + uint8_t + VERSION_STRLEN + 14 + + + VipConfigData + + ngsri::VERSION_STRLEN + 0 + fwVers + char + Firmware Build Version + + + ngsri::VERSION_STRLEN + 0 + swVers + char + Software Build Version + + + ngsri::VERSION_STRLEN + 0 + reserved + char + May be used for 'Hardware Model' or other use case + + + 2 + 0 + padding_vip + uint8_t + + + 0 + ImageCrc + uint32_t + 32-bit CRC value for the combined .text and .data sections of software binary + + + + GspVerData + + ngsri::VERSION_STRLEN + 0 + verStr + char + GSP Build Version + + + 2 + 0 + padding_gsp + uint8_t + + + 0 + imageCrc + uint32_t + 32-bit CRC value for the GSP software binary + + + + MccVerData + + ngsri::VERSION_STRLEN + 0 + verStr + char + MCC Build Version + + + 2 + 0 + padding_mcc + uint8_t + + + 0 + core0Crc + uint32_t + 32-bit CRC value for the MCC Core 0 software binary + + + 0 + core1Crc + uint32_t + 32-bit CRC value for the MCC Core 1 software binary + + + + VipConfigDataMsg + 0x00 + + VipConfigDataMsg + + payload + ngsri::VipConfigData + + + + GspVerDataMsg + 0x00 + + GspVerDataMsg + + payload + ngsri::GspVerData + + + + MccVerDataMsg + 0x00 + + MccVerDataMsg + + payload + ngsri::MccVerData + + + + + + + + + diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/DIO_MODULES.ini b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/DIO_MODULES.ini new file mode 100644 index 0000000..961bc46 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/DIO_MODULES.ini @@ -0,0 +1,25 @@ +; =============================================================================================================== +; This name must match the name specified in the Instrument.xml for an instrument of type DIO +[PICKERING_DIO_1] +LXI_IP_ADDRESS = 192.168.1.15 +DEVICE_NUMBER = 15 +BUS_NUMBER = 3 + +SHALL_WE_DRIVE_OUTPUT_UPON_INITIALIZATION = false +; number channels per port +NUM_CHANNELS_PER_PORT=8 +; either 0 or 1 as the starting channel index +CHANNEL_START_INDEX=0 +NUM_OUTPUT_CHANNELS = 32 +NUM_INPUT_CHANNELS = 32 + +;format is = | +; is either 0 or 1 or 2(Logic Z) +[PICKERING_DIO_1.OUTPUT_SIGNALS] +SIGNAL_1 = 0|1 +SIGNAL_2 = 1|0 + +;format is = +[PICKERING_DIO_1.INPUT_SIGNALS] +SIGNAL_3 = 0 +SIGNAL_4 = 0 diff --git a/Source/Program/InstrumentConfigFiles/Instruments.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/Instruments.xml similarity index 55% rename from Source/Program/InstrumentConfigFiles/Instruments.xml rename to Source/Program/ConfigFiles/Hardware/MTS/Instruments/Instruments.xml index d6a98ba..44babfe 100644 --- a/Source/Program/InstrumentConfigFiles/Instruments.xml +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/Instruments.xml @@ -8,29 +8,37 @@ - STE_POWER_SUPPLY_SYSTEM - PowerSupplySystemKeysightFactory + CoeDeviceNodeTCP + CoeCommDeviceFactory - UUT_POWER_SUPPLY_SYSTEM + UUT_POWER_SUPPLY_SYSTEM_20V PowerSupplySystemKeysightFactory PICKERING_DIO_1 DIOPickering40xFactory + + - ADVANTECH_DIO_1 - DIOAdvantechFactory - - - PICKERING_SWITCH_1 - SwitchPickeringPipx40Factory + PICKERING_SWITCH_MATRIX_64X4 + SwitchMatrixPickering40xFactory KEYSIGHT_DMM_1 DMMKeysightScpiFactory + + SERIAL_COM_PORT_1 + CommDeviceSerialFactory + \ No newline at end of file diff --git a/Source/Program/InstrumentConfigFiles/PICKERING_SWITCH_1.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/KEYSIGHT_DMM_1.xml similarity index 63% rename from Source/Program/InstrumentConfigFiles/PICKERING_SWITCH_1.xml rename to Source/Program/ConfigFiles/Hardware/MTS/Instruments/KEYSIGHT_DMM_1.xml index feb5c18..b5c1631 100644 --- a/Source/Program/InstrumentConfigFiles/PICKERING_SWITCH_1.xml +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/KEYSIGHT_DMM_1.xml @@ -1,8 +1,8 @@  -
- +
+
diff --git a/Source/Program/InstrumentConfigFiles/KEYSIGHT_SCPI_DEF.ini b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini similarity index 100% rename from Source/Program/InstrumentConfigFiles/KEYSIGHT_SCPI_DEF.ini rename to Source/Program/ConfigFiles/Hardware/MTS/Instruments/KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini diff --git a/Source/Program/InstrumentConfigFiles/PICKERING_DIO_1.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_DIO_1.xml similarity index 68% rename from Source/Program/InstrumentConfigFiles/PICKERING_DIO_1.xml rename to Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_DIO_1.xml index d5836e8..744feae 100644 --- a/Source/Program/InstrumentConfigFiles/PICKERING_DIO_1.xml +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_DIO_1.xml @@ -2,7 +2,7 @@
- +
diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_RELAY_SWITCH_16CH.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_RELAY_SWITCH_16CH.xml new file mode 100644 index 0000000..1a79507 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_RELAY_SWITCH_16CH.xml @@ -0,0 +1,12 @@ + + + +
+ + + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_RELAY_SWITCH_32CH.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_RELAY_SWITCH_32CH.xml new file mode 100644 index 0000000..2a8c33b --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_RELAY_SWITCH_32CH.xml @@ -0,0 +1,12 @@ + + + +
+ + + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_SWITCH_MATRIX_64X4.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_SWITCH_MATRIX_64X4.xml new file mode 100644 index 0000000..668b395 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/PICKERING_SWITCH_MATRIX_64X4.xml @@ -0,0 +1,11 @@ + + + +
+ + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/POWER_SUPPLY_SYSTEMS.ini b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/POWER_SUPPLY_SYSTEMS.ini new file mode 100644 index 0000000..442d1f6 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/POWER_SUPPLY_SYSTEMS.ini @@ -0,0 +1,32 @@ +; =============================================================================================================== +; This name must match the name specified in the Instrument.xml that is associated with the power supply system +[UUT_POWER_SUPPLY_SYSTEM_20V] +SCPI_DEF_FILEPATH = KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini +ETHERNET_ADDRESS = 192.168.1.19 +ETHERNET_PORT = 5025 +MODULE_DEFINITION = P20V, N20V +; 0 means no coupled modules. +; couple means turning on/off any one of the module, turns on/off the others +COUPLED_MODULES = P20V, N20V +; 0 means no grouped modules. +; group means turning combining 2 or more modules thus acting as one module +GROUPED_MODULES = 0 +INTERFACE = ETHERNET + +[UUT_POWER_SUPPLY_SYSTEM_20V.P20V] +INDEX = 1 +OCP = 8.5 +OVP = 25.0 +VOLTAGE_SETPOINT = 20.0 + +MIN_VOLTAGE = 16.0 +MAX_VOLTAGE = 24.0 + +[UUT_POWER_SUPPLY_SYSTEM_20V.N20V] +INDEX = 2 +OCP = 8.5 +OVP = 25.0 +VOLTAGE_SETPOINT = 20.0 + +MIN_VOLTAGE = 16.0 +MAX_VOLTAGE = 24.0 \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Instruments/SERIAL_COM_PORT_1.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/SERIAL_COM_PORT_1.xml new file mode 100644 index 0000000..8924e36 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/SERIAL_COM_PORT_1.xml @@ -0,0 +1,15 @@ + + + +
+ + + + + + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/InstrumentConfigFiles/STE_POWER_SUPPLY_SYSTEM.xml b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/UUT_POWER_SUPPLY_SYSTEM_20V.xml similarity index 51% rename from Source/Program/InstrumentConfigFiles/STE_POWER_SUPPLY_SYSTEM.xml rename to Source/Program/ConfigFiles/Hardware/MTS/Instruments/UUT_POWER_SUPPLY_SYSTEM_20V.xml index adf28d2..5f22f59 100644 --- a/Source/Program/InstrumentConfigFiles/STE_POWER_SUPPLY_SYSTEM.xml +++ b/Source/Program/ConfigFiles/Hardware/MTS/Instruments/UUT_POWER_SUPPLY_SYSTEM_20V.xml @@ -1,8 +1,8 @@  -
- +
+
diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Measurements/CoeMeasurementManager.ini b/Source/Program/ConfigFiles/Hardware/MTS/Measurements/CoeMeasurementManager.ini new file mode 100644 index 0000000..b638053 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Measurements/CoeMeasurementManager.ini @@ -0,0 +1,2 @@ +[GENERAL] +CheckForMessageIntervalMs = 10 \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/MTS/Measurements/SwitchMeasurementManager.ini b/Source/Program/ConfigFiles/Hardware/MTS/Measurements/SwitchMeasurementManager.ini new file mode 100644 index 0000000..3c7735e --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/Measurements/SwitchMeasurementManager.ini @@ -0,0 +1,36 @@ +;format is name = range|resolution|delay(ms)|scale factor|relays|voltRange|numReads +;Use device number to identifiy switch card... see switch configuration +[DmmReadFrequency] + +;format is signal_name = range|resolution|min_delay(ms)|max_delay(ms)|scale factor|relays|type|cable, connector and pin id|lower_limit|upper_limit +;Type is TWO or FOUR for two wire and four wire measurements +;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Path1],[Path2] +; [Card_Name] - must match the name of the switch card defined in the Instrument.xml +; [Path] +; For a simple relay switch: [channel_id] +; For a 2-d switch matrix: [subUnit].[channel_x].[channel_y] +;Cable and Pin Id Format: [Cable_Id]_[Connecto_Id][Pin_Id]_[Cable_Id]_[Connector_Id]_[Pin_Id] +[DmmReadResistance] +; Cable IDs +W1_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.59.1,0.60.2|TWO|W1_P1_J13_W1_P1_J14|950.0|1100.0 +W1_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.63.1,0.64.2|TWO|W1_P1_J15_W1_P1_J16|950.0|1050.0 +W2_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.59.1,0.60.2|TWO|W1_P1_J13_W1_P1_J14|1950.0|2100.0 +W2_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.63.1,0.64.2|TWO|W1_P1_J15_W1_P1_J16|950.0|1050.0 +W3_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.57.1,0.58.2|TWO|W1_P3_63_W1_P3_64|2900.0|3100.0 +W3_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.61.1,0.62.2|TWO|W1_P3_65_W1_P3_66|950.0|1050.0 +W4_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.57.1,0.58.2|TWO|W1_P3_63_W1_P3_64|3900.0|4100.0 +W4_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.61.1,0.62.2|TWO|W1_P3_65_W1_P3_66|950.0|1050.0 +W5_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.5.1,0.8.2|TWO|W1_P4_50_W1_P4_51|4900.0|5100.0 +W5_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.22.1,0.43.2|TWO|W1_P4_13_W1_P4_52|950.0|1050.0 + +;format is name = range|resolution|delay(ms)|scale factor|relays +[DmmReadVoltage] + + +;format is name = relays|channelNumber|edge|timePerDivision|timeOffset(S)|triggerLevel|voltageOffset(V)|voltageScale(V)|InputImpedance|Delay After Closing Relays(ms)|ShallImageBeSaved (True or False)|Max trigger Wait Time (ms) +;edge can be FALLING or RISING or HOLDING +[ScopeReadFrequency] + +;format is name = relays|channelNumber|edge|timePerDivision|timeOffset(S)|triggerLevel|voltageOffset(V)|voltageScale(V)|InputImpedance|Delay After Closing Relays(ms)|ShallImageBeSaved (True or False)|Max trigger Wait Time (ms) +;edge can be FALLING or RISING or HOLDING +[ScopeReadPulseWidth] diff --git a/Source/Program/ConfigFiles/Hardware/MTS/ProgramSpecific.ini b/Source/Program/ConfigFiles/Hardware/MTS/ProgramSpecific.ini new file mode 100644 index 0000000..5eae494 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/ProgramSpecific.ini @@ -0,0 +1,681 @@ +[GENERAL] +; specify data folder and all subfolders in it +PRIMARY_DRIVE = D:\ +SECONDARY_DRIVE = C:\ +DATA_BASE_FOLDER = Data_NGSRI +DATA_GENERAL_FOLDER_NAME = General +DATA_GENERAL_TEMP_FOLDER_NAME = Temp + +; this is the path where formal ATP runs use to run MTS software +APP_RELEASE_CONTROLLED_FOLDER = Release_NGSRI + +LOG_DASHBOARD_APP_PATH = Release_NGSRI\LogDashboard\Raytheon.LogDashboard.exe + +; make sure self test is run before powering on UUT +; value: true or false +ENFORCE_CABLE_SELF_TEST_IS_RUN = FALSE + +[UUT_INFO] +UUT_IP_ADDRESS = 192.168.1.45 +UUT_TEST_PORT_TCP = 65500 + +[CABLE_ID_RELAYS] +W1_CABLE_PART_NUMBER = W1_CABLE_PART_NUMBER +W1_CABLE_SERIAL_NUMBER = W1_CABLE_SERIAL_NUMBER +W2_CABLE_PART_NUMBER = W2_CABLE_PART_NUMBER +W2_CABLE_SERIAL_NUMBER = W2_CABLE_SERIAL_NUMBER +W3_CABLE_PART_NUMBER = W3_CABLE_PART_NUMBER +W3_CABLE_SERIAL_NUMBER = W3_CABLE_SERIAL_NUMBER +W4_CABLE_PART_NUMBER = W4_CABLE_PART_NUMBER +W4_CABLE_SERIAL_NUMBER = W4_CABLE_SERIAL_NUMBER +W5_CABLE_PART_NUMBER = W5_CABLE_PART_NUMBER +W5_CABLE_SERIAL_NUMBER = W5_CABLE_SERIAL_NUMBER + +;===================================================================================================================== + +[POLL_RATES] +; seconds +POWER_SUPPLY_LOG_RATE = 1 +; seconds +POWER_SUPPLY_READ_RATE = 1 +; seconds +PASSTHROUGH_DATA_UPDATE_RATE = 1 + +;===================================================================================================================== + +[FILE_NAMES] +POWER_SUPPLY_LOG_PREFIX = PowerSupplyLog +POWER_SUPPLY_LOG_FILE_EXTENSION = csv + +;===================================================================================================================== + +[POWER_MODULES_TO_BE_POWERED] +MODULE_1 = P20V + +[POWER_MODULES_TO_BE_DISPLAYED] +MODULE_1 = P20V +MODULE_2 = N20V + +;===================================================================================================================== + +[UART_INFO] +SERIAL_DEVICE_INSTANCE_NAME = SERIAL_COM_PORT_1 + +;===================================================================================================================== + +[PBIT_INFO] +SUCCESSFUL_PBIT_AGGREGATE_VALUE = 0x3F + +;===================================================================================================================== + +[TestModeMsg] +DATA_1 = TestMode,MODE,SHCK,1 + +;===================================================================================================================== + +[MSFRParameterMsg] +TEST_CASE_1 = Open Loop Polarity - Roll Channel,TestMode,MSFR,1,1,0,0,0,4,1,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,10,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_2 = Open Loop Polarity - Pitch Channel,TestMode,MSFR,1,1,0,0,0,5,1,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,10,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_3 = Open Loop Polarity - Yaw Channel,TestMode,MSFR,1,1,0,0,0,6,1,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,10,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_4 = Open Loop Polarity - Gimbal Channel,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,0.5,0,0.087266463,0.087266463,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_5 = Open Loop Test - Gimbal Stabilized,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_6a = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_6b = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_6c = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_6d = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_6e = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_6f = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_6g = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_6h = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_7a = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_7b = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_7c = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_7d = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_7e = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_7f = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_7g = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_7h = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_8a = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_8b = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_8c = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_8d = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_8e = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_8f = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_8g = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_8h = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_9a = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_9b = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_9c = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_9d = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_9e = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_9f = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_9g = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_9h = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_10a = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_10b = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_10c = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_10d = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_10e = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_10f = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_10g = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_10h = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_11a = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_11b = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_11c = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_11d = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_11e = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_11f = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_11g = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_11h = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_12a = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_12b = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_12c = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_12d = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_12e = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_12f = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_12g = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_12h = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_13a = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_13b = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_13c = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_13d = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_13e = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_13f = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_13g = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_13h = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_14a = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_14b = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_14c = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_14d = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_14e = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_14f = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_14g = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_14h = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_15a = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_15b = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_15c = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_15d = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_15e = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_15f = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_15g = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_15h = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_16a = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_16b = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_16c = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_16d = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_16e = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_16f = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_16g = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_16h = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_17a = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_17b = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_17c = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_17d = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_17e = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_17f = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_17g = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_17h = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_18a = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_18b = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_18c = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_18d = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_18e = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_18f = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_18g = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_18h = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_19a = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_19b = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_19c = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_19d = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_19e = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_19f = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_19g = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_19h = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,90,200,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_20a = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_20b = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_20c = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_20d = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_20e = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_20f = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_20g = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_20h = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_21a = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_21b = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_21c = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_21d = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_21e = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_21f = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_21g = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_21h = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_22a = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_22b = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_22c = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_22d = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_22e = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_22f = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_22g = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_22h = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_23a = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_23b = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_23c = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_23d = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_23e = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_23f = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_23g = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_23h = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_24a = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_24b = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_24c = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_24d = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_24e = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_24f = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_24g = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_24h = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_25a = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_25b = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_25c = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_25d = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_25e = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_25f = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_25g = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_25h = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_26a = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_26b = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_26c = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_26d = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_26e = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_26f = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_26g = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_26h = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_27a = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_27b = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_27c = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_27d = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_27e = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_27f = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_27g = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_27h = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_28a = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_28b = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_28c = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_28d = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_28e = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_28f = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_28g = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_28h = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_29a = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_29b = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_29c = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_29d = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_29e = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_29f = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_29g = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_29h = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_30a = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_30b = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_30c = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_30d = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_30e = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_30f = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_30g = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_30h = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_31a = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_31b = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_31c = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_31d = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_31e = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_31f = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_31g = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_31h = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_32a = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_32b = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_32c = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_32d = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_32e = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_32f = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_32g = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_32h = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,10,180,0,0.008726646,0.000872665,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_33a = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_33b = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_33c = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_33d = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_33e = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_33f = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_33g = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_33h = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,70,150,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_34a = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_34b = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_34c = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_34d = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_34e = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_34f = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_34g = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_34h = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_35a = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_35b = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_35c = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_35d = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_35e = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_35f = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_35g = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_35h = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,60,160,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_36a = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_36b = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_36c = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_36d = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_36e = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_36f = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_36g = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_36h = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,120,500,0,0.000872665,8.73E-05,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_37a = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_37b = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_37c = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_37d = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_37e = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_37f = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_37g = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_37h = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_38a = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_38b = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_38c = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_38d = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_38e = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_38f = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_38g = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_38h = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_39a = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_39b = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_39c = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_39d = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_39e = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_39f = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_39g = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_39h = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,400,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_40a = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_40b = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_40c = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_40d = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_40e = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_40f = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_40g = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_40h = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,40,240,0,0.003490659,0.000698132,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_41a = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_41b = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_41c = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_41d = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_41e = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_41f = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_41g = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_41h = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_42a = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_42b = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_42c = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_42d = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_42e = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_42f = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_42g = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_42h = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_43a = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_43b = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_43c = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_43d = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_43e = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_43f = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_43g = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_43h = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,150,300,0,5,5,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_44a = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_44b = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_44c = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_44d = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_44e = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_44f = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_44g = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_44h = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,2.5,20,90,130,0,0.005585054,0.002792527,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_45a = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_46a = Gain Margin Test - Iso Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_45b = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_46b = Gain Margin Test - Iso Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_45c = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_46c = Gain Margin Test - Iso Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_45d = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_46d = Gain Margin Test - Iso Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_45e = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_46e = Gain Margin Test - Iso Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_45f = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_46f = Gain Margin Test - Iso Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_45g = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_46g = Gain Margin Test - Iso Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_45h = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_46h = Gain Margin Test - Iso Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_47a = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_48a = Gain Margin Test - Iso Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_47b = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_48b = Gain Margin Test - Iso Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_47c = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_48c = Gain Margin Test - Iso Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_47d = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_48d = Gain Margin Test - Iso Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_47e = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_48e = Gain Margin Test - Iso Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_47f = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_48f = Gain Margin Test - Iso Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_47g = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_48g = Gain Margin Test - Iso Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_47h = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_48h = Gain Margin Test - Iso Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_49a = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_50a = Gain Margin Test - Iso Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_49b = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_50b = Gain Margin Test - Iso Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_49c = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_50c = Gain Margin Test - Iso Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_49d = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_50d = Gain Margin Test - Iso Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_49e = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_50e = Gain Margin Test - Iso Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_49f = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_50f = Gain Margin Test - Iso Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_49g = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_50g = Gain Margin Test - Iso Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_49h = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_50h = Gain Margin Test - Iso Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_51a = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_52a = Gain Margin Test - Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_51b = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_52b = Gain Margin Test - Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_51c = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_52c = Gain Margin Test - Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_51d = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_52d = Gain Margin Test - Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_51e = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_52e = Gain Margin Test - Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_51f = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_52f = Gain Margin Test - Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_51g = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_52g = Gain Margin Test - Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_51h = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_52h = Gain Margin Test - Roll - P14 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_53a = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_54a = Gain Margin Test - Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_53b = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_54b = Gain Margin Test - Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_53c = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_54c = Gain Margin Test - Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_53d = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_54d = Gain Margin Test - Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_53e = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_54e = Gain Margin Test - Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_53f = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_54f = Gain Margin Test - Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_53g = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_54g = Gain Margin Test - Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_53h = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_54h = Gain Margin Test - Pitch - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_55a = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_56a = Gain Margin Test - Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_55b = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_56b = Gain Margin Test - Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_55c = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_56c = Gain Margin Test - Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_55d = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_56d = Gain Margin Test - Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_55e = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_56e = Gain Margin Test - Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_55f = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_56f = Gain Margin Test - Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_55g = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_56g = Gain Margin Test - Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_55h = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_56h = Gain Margin Test - Yaw - P11 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,11,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_57a = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_58a = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_57b = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_58b = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_57c = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_58c = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_57d = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_58d = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_57e = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_58e = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_57f = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_58f = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_57g = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_58g = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_57h = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_58h = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_59a = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_60a = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_59b = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_60b = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_59c = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_60c = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_59d = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_60d = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_59e = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_60e = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_59f = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_60f = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_59g = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_60g = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_59h = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_60h = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_61a = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_62a = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_61b = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_62b = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_61c = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_62c = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_61d = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_62d = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_61e = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_62e = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_61f = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_62f = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_61g = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_62g = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_61h = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_62h = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_63a = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_64a = Gain Margin Test - Iso Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_63b = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_64b = Gain Margin Test - Iso Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_63c = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_64c = Gain Margin Test - Iso Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_63d = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_64d = Gain Margin Test - Iso Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_63e = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_64e = Gain Margin Test - Iso Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_63f = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_64f = Gain Margin Test - Iso Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_63g = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_64g = Gain Margin Test - Iso Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_63h = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_64h = Gain Margin Test - Iso Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_65a = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_66a = Gain Margin Test - Iso Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_65b = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_66b = Gain Margin Test - Iso Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_65c = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_66c = Gain Margin Test - Iso Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_65d = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_66d = Gain Margin Test - Iso Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_65e = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_66e = Gain Margin Test - Iso Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_65f = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_66f = Gain Margin Test - Iso Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_65g = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_66g = Gain Margin Test - Iso Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_65h = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_66h = Gain Margin Test - Iso Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_67a = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_68a = Gain Margin Test - Iso Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_67b = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_68b = Gain Margin Test - Iso Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_67c = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_68c = Gain Margin Test - Iso Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_67d = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_68d = Gain Margin Test - Iso Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_67e = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_68e = Gain Margin Test - Iso Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_67f = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_68f = Gain Margin Test - Iso Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_67g = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_68g = Gain Margin Test - Iso Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_67h = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_68h = Gain Margin Test - Iso Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_69a = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_70a = Gain Margin Test - Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_69b = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_70b = Gain Margin Test - Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_69c = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_70c = Gain Margin Test - Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_69d = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_70d = Gain Margin Test - Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_69e = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_70e = Gain Margin Test - Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_69f = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_70f = Gain Margin Test - Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_69g = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_70g = Gain Margin Test - Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_69h = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_70h = Gain Margin Test - Roll - P14 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,14,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_71a = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_72a = Gain Margin Test - Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_71b = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_72b = Gain Margin Test - Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_71c = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_72c = Gain Margin Test - Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_71d = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_72d = Gain Margin Test - Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_71e = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_72e = Gain Margin Test - Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_71f = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_72f = Gain Margin Test - Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_71g = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_72g = Gain Margin Test - Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_71h = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_72h = Gain Margin Test - Pitch - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_73a = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_74a = Gain Margin Test - Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_73b = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_74b = Gain Margin Test - Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_73c = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_74c = Gain Margin Test - Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_73d = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_74d = Gain Margin Test - Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_73e = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_74e = Gain Margin Test - Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_73f = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_74f = Gain Margin Test - Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_73g = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_74g = Gain Margin Test - Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_73h = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_74h = Gain Margin Test - Yaw - P7 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,7,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_75a = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_76a = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_75b = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_76b = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_75c = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_76c = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_75d = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_76d = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_75e = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_76e = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_75f = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_76f = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_75g = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_76g = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_75h = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_76h = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_77a = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_78a = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_77b = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_78b = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_77c = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_78c = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_77d = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_78d = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_77e = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_78e = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_77f = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_78f = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_77g = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_78g = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_77h = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_78h = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_79a = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_80a = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_79b = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_80b = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_79c = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_80c = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_79d = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_80d = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_79e = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_80e = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_79f = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_80f = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_79g = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_80g = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_79h = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_80h = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 diff --git a/Source/Program/ConfigFiles/Hardware/MTS/UutTestMessages.xml b/Source/Program/ConfigFiles/Hardware/MTS/UutTestMessages.xml new file mode 100644 index 0000000..fcb86f1 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/MTS/UutTestMessages.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/Instruments.xml b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/Instruments.xml new file mode 100644 index 0000000..68e6bd7 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/Instruments.xml @@ -0,0 +1,24 @@ + + + +
+ +
+
+ + + + UUT_POWER_SUPPLY_SYSTEM_20V + PowerSupplySystemKeysightFactory + + + PICKERING_SWITCH_MATRIX_64X4 + SwitchMatrixPickering40xFactory + + + KEYSIGHT_DMM_1 + DMMKeysightScpiFactory + + + +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/KEYSIGHT_DMM_1.xml b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/KEYSIGHT_DMM_1.xml new file mode 100644 index 0000000..b5c1631 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/KEYSIGHT_DMM_1.xml @@ -0,0 +1,9 @@ + + + +
+ +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini new file mode 100644 index 0000000..4ea80fd --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini @@ -0,0 +1,56 @@ +[SYSTEM] +;system commands +CLEAR_CMD = *CLS +RESET_CMD = *RST +SELFTEST_CMD = *TST? +READ_ERROR_CODE_CMD = SYST:ERR? +REBOOT_CMD = SYST:REB + +;panel disable/enable commands +SET_FRONTPANEL_DISABLE_CMD = SYST:COMM:RLST RWL +SET_FRONTPANEL_ENABLE_CMD = SYST:COMM:RLST REM + +;watchdog commands +SET_WATCHDOGDELAY_CMD = OUTP:PROT:WDOG:DEL +SET_WATCHDOGON_CMD = OUTP:PROT:WDOG ON +SET_WATCHDOGOFF_CMD = OUTP:PROT:WDOG OFF + +;coupling commands +SET_COUPLE_CHANNELS_CMD = OUTP:COUP:CHAN +SET_COUPLE_ON_CMD = OUTP:COUP ON +SET_COUPLE_OUTPUT_PROTECT_ON_CMD = OUTP:PROT:COUP ON +QUERY_COUPLE_CHANNELS = OUTP:COUP:CHAN? +QUERY_COUPLE_STATE = OUTP:COUP? + +; Grouping Commands +SET_GROUP_DEFINE_CMD = SYST:GRO:DEF +UNGROUP_ALL_CHANNELS_CMD = SYST:GRO:DEL:ALL +QUERY_GROUP_CHANNELS = SYST:GRO:CAT? + +[MODULE] +; current commands +SET_INRUSH_DELAY_CMD = CURR:PROT:DEL +READ_INRUSH_DELAY_CMD = CURR:PROT:DEL? +READ_CURRENT_CMD = MEAS:CURR? +SET_OCP_CMD = CURR:LEV +READ_OCP_CMD = CURR:LEV? +SET_OCP_ON_CMD = CURR:PROT:STAT ON + +; voltage commands +SET_OVP_CMD = VOLT:PROT +SET_VOLTAGE_SLEW_CMD = VOLT:SLEW +SET_VOLTAGE_SETPOINT_CMD = VOLT:LEV +SET_CONSTANT_VOLTAGE_CMD = STAT:OPER:ENAB 1 +READ_VOLTAGE_CMD = MEAS:VOLT? +READ_VOLTAGE_SETPOINT_CMD = VOLT? +READ_OVP_CMD = VOLT:PROT? +READ_VOLTAGE_SLEW_CMD = VOLT:SLEW? + +; set output commands +SET_OUTPUT_DISABLE_CMD = OUTP OFF +SET_OUTPUT_ENABLE_CMD = OUTP ON + +; query status +READ_OUTPUT_STATUS_CMD = OUTP? +READ_ERROR_STATUS_CMD = SYST:ERR? +READ_PROTECTION_STATUS_CMD = STAT:QUES:COND? \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/PICKERING_SWITCH_MATRIX_64X4.xml b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/PICKERING_SWITCH_MATRIX_64X4.xml new file mode 100644 index 0000000..668b395 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/PICKERING_SWITCH_MATRIX_64X4.xml @@ -0,0 +1,11 @@ + + + +
+ + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/POWER_SUPPLY_SYSTEMS.ini b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/POWER_SUPPLY_SYSTEMS.ini new file mode 100644 index 0000000..442d1f6 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/POWER_SUPPLY_SYSTEMS.ini @@ -0,0 +1,32 @@ +; =============================================================================================================== +; This name must match the name specified in the Instrument.xml that is associated with the power supply system +[UUT_POWER_SUPPLY_SYSTEM_20V] +SCPI_DEF_FILEPATH = KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini +ETHERNET_ADDRESS = 192.168.1.19 +ETHERNET_PORT = 5025 +MODULE_DEFINITION = P20V, N20V +; 0 means no coupled modules. +; couple means turning on/off any one of the module, turns on/off the others +COUPLED_MODULES = P20V, N20V +; 0 means no grouped modules. +; group means turning combining 2 or more modules thus acting as one module +GROUPED_MODULES = 0 +INTERFACE = ETHERNET + +[UUT_POWER_SUPPLY_SYSTEM_20V.P20V] +INDEX = 1 +OCP = 8.5 +OVP = 25.0 +VOLTAGE_SETPOINT = 20.0 + +MIN_VOLTAGE = 16.0 +MAX_VOLTAGE = 24.0 + +[UUT_POWER_SUPPLY_SYSTEM_20V.N20V] +INDEX = 2 +OCP = 8.5 +OVP = 25.0 +VOLTAGE_SETPOINT = 20.0 + +MIN_VOLTAGE = 16.0 +MAX_VOLTAGE = 24.0 \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/UUT_POWER_SUPPLY_SYSTEM_20V.xml b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/UUT_POWER_SUPPLY_SYSTEM_20V.xml new file mode 100644 index 0000000..5f22f59 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/SelfTest/Instruments/UUT_POWER_SUPPLY_SYSTEM_20V.xml @@ -0,0 +1,9 @@ + + + +
+ +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Hardware/SelfTest/Measurements/SwitchMeasurementManager.ini b/Source/Program/ConfigFiles/Hardware/SelfTest/Measurements/SwitchMeasurementManager.ini new file mode 100644 index 0000000..cf9e7c5 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/SelfTest/Measurements/SwitchMeasurementManager.ini @@ -0,0 +1,153 @@ +;format is name = range|resolution|delay(ms)|scale factor|relays|voltRange|numReads +;Use device number to identifiy switch card... see switch configuration +[DmmReadFrequency] + +;format is signal_name = range|resolution|min_delay(ms)|max_delay(ms)|scale factor|relays|type|cable, connector and pin id|lower_limit|upper_limit +;Type is TWO or FOUR for two wire and four wire measurements +;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Path1],[Path2] +; [Card_Name] - must match the name of the switch card defined in the Instrument.xml +; [Path] +; For a simple relay switch: [channel_id] +; For a 2-d switch matrix: [subUnit].[channel_x].[channel_y] +;Cable and Pin Id Format: [Cable_Id]_[Connecto_Id][Pin_Id]_[Cable_Id]_[Connector_Id]_[Pin_Id] +[DmmReadResistance] +; Cable IDs +W1_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.59.1,0.60.2|TWO|W1_P1_J13_W1_P1_J14|950.0|1100.0 +W1_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.63.1,0.64.2|TWO|W1_P1_J15_W1_P1_J16|950.0|1050.0 +W2_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.59.1,0.60.2|TWO|W1_P1_J13_W1_P1_J14|1950.0|2100.0 +W2_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.63.1,0.64.2|TWO|W1_P1_J15_W1_P1_J16|950.0|1050.0 +W3_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.57.1,0.58.2|TWO|W1_P3_63_W1_P3_64|2900.0|3100.0 +W3_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.61.1,0.62.2|TWO|W1_P3_65_W1_P3_66|950.0|1050.0 +W4_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.57.1,0.58.2|TWO|W1_P3_63_W1_P3_64|3900.0|4100.0 +W4_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.61.1,0.62.2|TWO|W1_P3_65_W1_P3_66|950.0|1050.0 +W5_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.5.1,0.8.2|TWO|W1_P4_50_W1_P4_51|4900.0|5100.0 +W5_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.22.1,0.43.2|TWO|W1_P4_13_W1_P4_52|950.0|1050.0 + +; W3 Continuity +W3_AUD_GDNC_FILTER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.16.2|TWO|W1_P3_52_W1_P4_4|0.0|5.0 +W3_TIMER_START = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.39.1,0.56.2|TWO|W1_P3_5_W1_P4_7|0.0|5.0 +W3_SIGNAL_RETURN = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.56.1,0.19.2|TWO|W1_P3_7_W1_P4_8|0.0|5.0 +W3_GEU_TO_EMULATOR_UART = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.55.1,0.20.2|TWO|W1_P3_9_W1_P4_9|0.0|5.0 +W3_TIMER_START_TO_SIGNAL_RETURN = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.39.1,0.19.2|TWO|W1_P3_5_W1_P4_8|0.0|5.0 + +; W3 Resistance +W3_P20VDC_TEST_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.47.1,0.1.2|TWO|W1_P4_71_W1_P4_1|70.0|90.0 +W3_N20VDC_TEST_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.48.1,0.1.2|TWO|W1_P4_72_W1_P4_1|70.0|90.0 +W3_P20VDC_TEST_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.47.1,0.48.2|TWO|W1_P4_71_W1_P4_72|150.0|170.0 +W3_BATTERY_ACTIVATE_P3_TO_N20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.9.1,0.26.2|TWO|W1_P4_18_W1_P4_17|70.0|90.0 +W3_BATTERY_ACTIVATE_P3_TO_N20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.9.1,0.29.2|TWO|W1_P4_18_W1_P4_21|70.0|90.0 +W3_BATTERY_ACTIVATE_P3_TO_N20VDC_TEST_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.9.1,0.30.2|TWO|W1_P4_18_W1_P4_22|70.0|90.0 +W3_BATTERY_ACTIVATE_P3_TO_P20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.9.1,0.32.2|TWO|W1_P4_18_W1_P4_24|70.0|90.0 +W3_BATTERY_ACTIVATE_P3_TO_P20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.9.1,0.35.2|TWO|W1_P4_18_W1_P4_28|70.0|90.0 + +; W3 AUD_GDNC_FILTER Isolation checks +W3_AUD_GDNC_FILTER_TO_P20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.47.2|TWO|W1_P3_52_W1_P4_71|9.9E+30|9.9E+40 +W3_AUD_GDNC_FILTER_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.26.2|TWO|W1_P3_52_W1_P4_72|9.9E+30|9.9E+40 +W3_AUD_GDNC_FILTER_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.1.2|TWO|W1_P3_52_W1_P4_1|9.9E+30|9.9E+40 + +; W3 SIGNAL_RETURN Isolation checks +; DO NOT perform isolation checks on signals that are tied to SIGNAL_RETURN +; Signals tied to SIGNAL_RETURN: TIMER START +W3_SIGNAL_RETURN_TO_P20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.56.1,0.47.2|TWO|W1_P3_7_W1_P4_71|9.9E+30|9.9E+40 +W3_SIGNAL_RETURN_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.56.1,0.48.2|TWO|W1_P3_7_W1_P4_72|9.9E+30|9.9E+40 +W3_SIGNAL_RETURN_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.56.1,0.1.2|TWO|W1_P3_7_W1_P4_1|9.9E+30|9.9E+40 + +; W3 GEU_TO_EMULATOR_UART Isolation checks +W3_GEU_TO_EMULATOR_UART_TO_P20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.55.1,0.47.2|TWO|W1_P3_9_W1_P4_71|9.9E+30|9.9E+40 +W3_GEU_TO_EMULATOR_UART_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.55.1,0.48.2|TWO|W1_P3_9_W1_P4_72|9.9E+30|9.9E+40 +W3_GEU_TO_EMULATOR_UART_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.55.1,0.1.2|TWO|W1_P3_9_W1_P4_1|9.9E+30|9.9E+40 + +; W3 N20V_EXTERNAL Isolation checks +W3_N20V_EXTERNAL_TO_P20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.14.1,0.47.2|TWO|W1_P4_2_W1_P4_71|9.9E+30|9.9E+40 +W3_N20V_EXTERNAL_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.14.1,0.48.2|TWO|W1_P4_2_W1_P4_72|9.9E+30|9.9E+40 +W3_N20V_EXTERNAL_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.14.1,0.1.2|TWO|W1_P4_2_W1_P4_1|9.9E+30|9.9E+40 + +; W3 P20V_EXTERNAL Isolation checks +W3_P20V_EXTERNAL_TO_P20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.15.1,0.47.2|TWO|W1_P4_3_W1_P4_71|9.9E+30|9.9E+40 +W3_P20V_EXTERNAL_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.15.1,0.48.2|TWO|W1_P4_3_W1_P4_72|9.9E+30|9.9E+40 +W3_P20V_EXTERNAL_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.15.1,0.1.2|TWO|W1_P4_3_W1_P4_1|9.9E+30|9.9E+40 + +; W3 ARM_IFC_SQUIB_P Isolation checks +W3_ARM_IFC_SQUIB_P_TO_P20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.11.1,0.47.2|TWO|W1_P4_32_W1_P4_71|9.9E+30|9.9E+40 +W3_ARM_IFC_SQUIB_P_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.11.1,0.48.2|TWO|W1_P4_32_W1_P4_72|9.9E+30|9.9E+40 +W3_ARM_IFC_SQUIB_P_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.11.1,0.1.2|TWO|W1_P4_32_W1_P4_1|9.9E+30|9.9E+40 + +; W3 ARM_IFC_SQUIB_N Isolation checks +W3_ARM_IFC_SQUIB_N_TO_P20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.12.1,0.47.2|TWO|W1_P4_67_W1_P4_71|9.9E+30|9.9E+40 +W3_ARM_IFC_SQUIB_N_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.12.1,0.48.2|TWO|W1_P4_67_W1_P4_72|9.9E+30|9.9E+40 +W3_ARM_IFC_SQUIB_N_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.12.1,0.1.2|TWO|W1_P4_67_W1_P4_1|9.9E+30|9.9E+40 + +; W3 BATTERY_ACTIVATE_P3 Isolation checks +W3_BATTERY_ACTIVATE_P3_TO_BATTERY_ACTIVATE_P2 = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.9.1,0.3.2|TWO|W1_P4_18_W1_P4_7|9.9E+30|9.9E+40 + +; W3 POWER_RETURN Isolation checks +W3_POWER_RETURN_TO_BATTERY_ACTIVATE_P2 = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.1.1,0.3.2|TWO|W1_P4_1_W1_P4_7|9.9E+30|9.9E+40 +W3_POWER_RETURN_TO_LAUNCHER_INTERLOCK = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.1.1,0.42.2|TWO|W1_P4_1_W1_P4_11|9.9E+30|9.9E+40 +W3_POWER_RETURN_TO_FUZE_INTERLOCK = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.1.1,0.7.2|TWO|W1_P4_1_W1_P4_12|9.9E+30|9.9E+40 + +; W3 ETH_SPE_P Isolation checks +W3_ETH_SPE_P_TO_P20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.40.1,0.47.2|TWO|W1_P4_10_W1_P4_71|9.9E+30|9.9E+40 +W3_ETH_SPE_P_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.40.1,0.48.2|TWO|W1_P4_10_W1_P4_72|9.9E+30|9.9E+40 +W3_ETH_SPE_P_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.40.1,0.1.2|TWO|W1_P4_10_W1_P4_1|9.9E+30|9.9E+40 + +; W3 ETH_SPE_N Isolation checks +W3_ETH_SPE_N_TO_P20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.23.1,0.47.2|TWO|W1_P4_14_W1_P4_71|9.9E+30|9.9E+40 +W3_ETH_SPE_N_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.23.1,0.48.2|TWO|W1_P4_14_W1_P4_72|9.9E+30|9.9E+40 +W3_ETH_SPE_N_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.23.1,0.1.2|TWO|W1_P4_14_W1_P4_1|9.9E+30|9.9E+40 + +; W4 Continuity +W4_LAUNCH_MOTOR_INIT_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.41.1,0.1.2|TWO|W1_P4_16_W1_P4_1|0.0|5.0 +W4_LAUNCH_MOTOR_INIT_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.52.1,0.1.2|TWO|W1_P4_25_W1_P4_1|0.0|5.0 +W4_BATTERY_INIT_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.36.1,0.1.2|TWO|W1_P4_29_W1_P4_1|0.0|5.0 +W4_BATTERY_INIT_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.13.1,0.1.2|TWO|W1_P4_33_W1_P4_1|0.0|5.0 +W4_LIE_N20V = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.19.1,0.48.2|TWO|W1_P4_8_W1_P4_72|0.0|5.0 +W4_CAGE_COIL_OUT = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.32.2|TWO|W1_P3_51_W1_P4_24|0.0|5.0 +W4_AUD_GDNC_FILTER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.33.2|TWO|W1_P3_52_W1_P4_26|0.0|5.0 +W4_AUDIO_OUTPUT_LOW = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.24.2|TWO|W1_P3_8_W1_P4_15|0.0|5.0 + +; W4 Resistance +W4_P20VDC_EXTERNAL_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.47.1,0.1.2|TWO|W1_P4_71_W1_P4_1|70.0|90.0 +W4_N20VDC_EXTERNAL_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.48.1,0.1.2|TWO|W1_P4_72_W1_P4_1|70.0|90.0 +W4_P20VDC_TEST_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.47.1,0.48.2|TWO|W1_P4_71_W1_P4_72|150.0|170.0 + +; W4 CAGE_COIL_OUT Isolation checks +W4_CAGE_COIL_OUT_TO_P20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.47.2|TWO|W1_P3_51_W1_P4_71|9.9E+30|9.9E+40 +W4_CAGE_COIL_OUT_TO_N20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.48.2|TWO|W1_P3_51_W1_P4_72|9.9E+30|9.9E+40 +W4_CAGE_COIL_OUT_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.1.2|TWO|W1_P3_51_W1_P4_1|9.9E+30|9.9E+40 + +; W4 AUD_GDNC_FILTER Isolation checks +W4_AUD_GDNC_FILTER_TO_P20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.47.2|TWO|W1_P3_52_W1_P4_71|9.9E+30|9.9E+40 +W4_AUD_GDNC_FILTER_TO_N20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.48.2|TWO|W1_P3_52_W1_P4_72|9.9E+30|9.9E+40 +W4_AUD_GDNC_FILTER_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.1.2|TWO|W1_P3_52_W1_P4_1|9.9E+30|9.9E+40 + +; W4 AUDIO_OUTPUT_LOW Isolation checks +W4_AUDIO_OUTPUT_LOW_TO_P20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.47.2|TWO|W1_P3_8_W1_P4_71|9.9E+30|9.9E+40 +W4_AUDIO_OUTPUT_LOW_TO_N20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.48.2|TWO|W1_P3_8_W1_P4_72|9.9E+30|9.9E+40 +W4_AUDIO_OUTPUT_LOW_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.1.2|TWO|W1_P3_8_W1_P4_1|9.9E+30|9.9E+40 + +; W4 AUDIO_OUTPUT_HIGH Isolation checks +W4_AUDIO_OUTPUT_HIGH_TO_P20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.21.1,0.47.2|TWO|W1_P3_4_W1_P4_71|9.9E+30|9.9E+40 +W4_AUDIO_OUTPUT_HIGH_TO_N20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.21.1,0.48.2|TWO|W1_P3_4_W1_P4_72|9.9E+30|9.9E+40 +W4_AUDIO_OUTPUT_HIGH_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.21.1,0.1.2|TWO|W1_P3_4_W1_P4_1|9.9E+30|9.9E+40 + +; W4 ETH_SPE_P Isolation checks +W4_ETH_SPE_P_TO_P20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.39.1,0.47.2|TWO|W1_P4_5_W1_P4_71|9.9E+30|9.9E+40 +W4_ETH_SPE_P_TO_N20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.39.1,0.48.2|TWO|W1_P4_5_W1_P4_72|9.9E+30|9.9E+40 +W4_ETH_SPE_P_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.39.1,0.1.2|TWO|W1_P4_5_W1_P4_1|9.9E+30|9.9E+40 + +; W4 ETH_SPE_N Isolation checks +W4_ETH_SPE_N_TO_P20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.18.1,0.47.2|TWO|W1_P4_6_W1_P4_71|9.9E+30|9.9E+40 +W4_ETH_SPE_N_TO_N20VDC_EXTERNAL = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.18.1,0.48.2|TWO|W1_P4_6_W1_P4_72|9.9E+30|9.9E+40 +W4_ETH_SPE_N_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|1500|1|PICKERING_SWITCH_MATRIX_64X4:0.18.1,0.1.2|TWO|W1_P4_6_W1_P4_1|9.9E+30|9.9E+40 + +;format is name = range|resolution|delay(ms)|scale factor|relays +[DmmReadVoltage] + + +;format is name = relays|channelNumber|edge|timePerDivision|timeOffset(S)|triggerLevel|voltageOffset(V)|voltageScale(V)|InputImpedance|Delay After Closing Relays(ms)|ShallImageBeSaved (True or False)|Max trigger Wait Time (ms) +;edge can be FALLING or RISING or HOLDING +[ScopeReadFrequency] + +;format is name = relays|channelNumber|edge|timePerDivision|timeOffset(S)|triggerLevel|voltageOffset(V)|voltageScale(V)|InputImpedance|Delay After Closing Relays(ms)|ShallImageBeSaved (True or False)|Max trigger Wait Time (ms) +;edge can be FALLING or RISING or HOLDING +[ScopeReadPulseWidth] diff --git a/Source/Program/ConfigFiles/Hardware/SelfTest/ProgramSpecific.ini b/Source/Program/ConfigFiles/Hardware/SelfTest/ProgramSpecific.ini new file mode 100644 index 0000000..74ae386 --- /dev/null +++ b/Source/Program/ConfigFiles/Hardware/SelfTest/ProgramSpecific.ini @@ -0,0 +1,149 @@ +[GENERAL] +; specify data folder and all subfolders in it +PRIMARY_DRIVE = D:\ +SECONDARY_DRIVE = C:\ +DATA_BASE_FOLDER = Data_NGSRI +DATA_GENERAL_FOLDER_NAME = General +DATA_GENERAL_TEMP_FOLDER_NAME = Temp + +; this is the path where formal ATP runs use to run MTS software +APP_RELEASE_CONTROLLED_FOLDER = Release_NGSRI + +LOG_DASHBOARD_APP_PATH = Release_NGSRI\LogDashboard\Raytheon.LogDashboard.exe + +[CABLE_ID_RELAYS] +W1_CABLE_PART_NUMBER = W1_CABLE_PART_NUMBER +W1_CABLE_SERIAL_NUMBER = W1_CABLE_SERIAL_NUMBER +W2_CABLE_PART_NUMBER = W2_CABLE_PART_NUMBER +W2_CABLE_SERIAL_NUMBER = W2_CABLE_SERIAL_NUMBER +W3_CABLE_PART_NUMBER = W3_CABLE_PART_NUMBER +W3_CABLE_SERIAL_NUMBER = W3_CABLE_SERIAL_NUMBER +W4_CABLE_PART_NUMBER = W4_CABLE_PART_NUMBER +W4_CABLE_SERIAL_NUMBER = W4_CABLE_SERIAL_NUMBER +W5_CABLE_PART_NUMBER = W5_CABLE_PART_NUMBER +W5_CABLE_SERIAL_NUMBER = W5_CABLE_SERIAL_NUMBER + +;===================================================================================================================== + +[POLL_RATES] +; seconds +POWER_SUPPLY_LOG_RATE = 1 +; seconds +POWER_SUPPLY_READ_RATE = 1 +; seconds +PASSTHROUGH_DATA_UPDATE_RATE = 1 + +;===================================================================================================================== + +[FILE_NAMES] +POWER_SUPPLY_LOG_PREFIX = PowerSupplyLog +POWER_SUPPLY_LOG_FILE_EXTENSION = csv + +;===================================================================================================================== + +[POWER_MODULES_TO_BE_POWERED] +MODULE_1 = P20V + +[POWER_MODULES_TO_BE_DISPLAYED] +MODULE_1 = P20V +MODULE_2 = N20V + +;===================================================================================================================== + +[W3_STTO] +R01 = W3_AUD_GDNC_FILTER +R02 = W3_TIMER_START +R03 = W3_SIGNAL_RETURN +R04 = W3_GEU_TO_EMULATOR_UART +R05 = W3_TIMER_START_TO_SIGNAL_RETURN + +; W3 Resistance +R06 = W3_P20VDC_TEST_TO_POWER_RETURN +R07 = W3_N20VDC_TEST_TO_POWER_RETURN +R08 = W3_P20VDC_TEST_TO_N20VDC_TEST +R09 = W3_BATTERY_ACTIVATE_P3_TO_N20VDC_TEST_1 +R10 = W3_BATTERY_ACTIVATE_P3_TO_N20VDC_TEST_2 +R11 = W3_BATTERY_ACTIVATE_P3_TO_N20VDC_TEST_3 +R12 = W3_BATTERY_ACTIVATE_P3_TO_P20VDC_TEST_1 +R13 = W3_BATTERY_ACTIVATE_P3_TO_P20VDC_TEST_2 + +; W3 AUD_GDNC_FILTER Isolation checks +R14 = W3_AUD_GDNC_FILTER_TO_P20VDC_TEST +R15 = W3_AUD_GDNC_FILTER_TO_N20VDC_TEST +R16 = W3_AUD_GDNC_FILTER_TO_POWER_RETURN + +; W3 SIGNAL_RETURN Isolation checks +R17 = W3_SIGNAL_RETURN_TO_P20VDC_TEST +R18 = W3_SIGNAL_RETURN_TO_N20VDC_TEST +R19 = W3_SIGNAL_RETURN_TO_POWER_RETURN + +; W3 GEU_TO_EMULATOR_UART Isolation checks +R20 = W3_GEU_TO_EMULATOR_UART_TO_P20VDC_TEST +R21 = W3_GEU_TO_EMULATOR_UART_TO_N20VDC_TEST +R22 = W3_GEU_TO_EMULATOR_UART_TO_POWER_RETURN + +; W3 N20V_EXTERNAL Isolation checks +R23 = W3_N20V_EXTERNAL_TO_P20VDC_TEST +R24 = W3_N20V_EXTERNAL_TO_N20VDC_TEST +R25 = W3_N20V_EXTERNAL_TO_POWER_RETURN + +; W3 P20V_EXTERNAL Isolation checks +R26 = W3_P20V_EXTERNAL_TO_P20VDC_TEST +R27 = W3_P20V_EXTERNAL_TO_N20VDC_TEST +R28 = W3_P20V_EXTERNAL_TO_POWER_RETURN + +; W3 ARM_IFC_SQUIB_P Isolation checks +R29 = W3_ARM_IFC_SQUIB_P_TO_P20VDC_TEST +R30 = W3_ARM_IFC_SQUIB_P_TO_N20VDC_TEST +R31 = W3_ARM_IFC_SQUIB_P_TO_POWER_RETURN + +; W3 ARM_IFC_SQUIB_N Isolation checks +R32 = W3_ARM_IFC_SQUIB_N_TO_P20VDC_TEST +R33 = W3_ARM_IFC_SQUIB_N_TO_N20VDC_TEST +R34 = W3_ARM_IFC_SQUIB_N_TO_POWER_RETURN + +; W3 BATTERY_ACTIVATE_P3 Isolation checks +R35 = W3_BATTERY_ACTIVATE_P3_TO_BATTERY_ACTIVATE_P2 + +; W3 POWER_RETURN Isolation checks +R36 = W3_POWER_RETURN_TO_BATTERY_ACTIVATE_P2 +R37 = W3_POWER_RETURN_TO_LAUNCHER_INTERLOCK +R38 = W3_POWER_RETURN_TO_FUZE_INTERLOCK + +;===================================================================================================================== + +[W4_STTO] +R01 = W4_LAUNCH_MOTOR_INIT_1 +R02 = W4_LAUNCH_MOTOR_INIT_2 +R03 = W4_BATTERY_INIT_1 +R04 = W4_BATTERY_INIT_2 +R05 = W4_LIE_N20V +R06 = W4_CAGE_COIL_OUT +R07 = W4_AUD_GDNC_FILTER +R08 = W4_AUDIO_OUTPUT_LOW + +; W4 Resistance +R09 = W4_P20VDC_EXTERNAL_TO_POWER_RETURN +R10 = W4_N20VDC_EXTERNAL_TO_POWER_RETURN +R11 = W4_P20VDC_TEST_TO_N20VDC_TEST + +; W4 CAGE_COIL_OUT Isolation checks +R12 = W4_CAGE_COIL_OUT_TO_P20VDC_EXTERNAL +R13 = W4_CAGE_COIL_OUT_TO_N20VDC_EXTERNAL +R14 = W4_CAGE_COIL_OUT_TO_POWER_RETURN + +; W4 AUD_GDNC_FILTER Isolation checks +R15 = W4_AUD_GDNC_FILTER_TO_P20VDC_EXTERNAL +R16 = W4_AUD_GDNC_FILTER_TO_N20VDC_EXTERNAL +R17 = W4_AUD_GDNC_FILTER_TO_POWER_RETURN + +; W4 AUDIO_OUTPUT_LOW Isolation checks +R18 = W4_AUDIO_OUTPUT_LOW_TO_P20VDC_EXTERNAL +R19 = W4_AUDIO_OUTPUT_LOW_TO_N20VDC_EXTERNAL +R20 = W4_AUDIO_OUTPUT_LOW_TO_POWER_RETURN + +; W4 AUDIO_OUTPUT_HIGH Isolation checks +R21 = W4_AUDIO_OUTPUT_HIGH_TO_P20VDC_EXTERNAL +R22 = W4_AUDIO_OUTPUT_HIGH_TO_N20VDC_EXTERNAL +R23 = W4_AUDIO_OUTPUT_HIGH_TO_POWER_RETURN + diff --git a/Source/Program/ConfigFiles/NLog.config b/Source/Program/ConfigFiles/NLog.config new file mode 100644 index 0000000..bc5607f --- /dev/null +++ b/Source/Program/ConfigFiles/NLog.config @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Program/ConfigFiles/ProgramGeneral.ini b/Source/Program/ConfigFiles/ProgramGeneral.ini new file mode 100644 index 0000000..2dc4cb8 --- /dev/null +++ b/Source/Program/ConfigFiles/ProgramGeneral.ini @@ -0,0 +1,23 @@ +[GENERAL] +; file names +PROGRAM_SPECIFIC_CONFIG_FILE_NAME = ProgramSpecific.ini +SWITCH_MEASUREMENT_MANAGER_CONFIG_FILE_NAME = SwitchMeasurementManager.ini +COE_MEASUREMENT_MANAGER_CONFIG_FILE_NAME = CoeMeasurementManager.ini +UUT_TEST_MESSAGES_CONFIG_FILE_NAME = UutTestMessages.xml +CABLE_SELF_TEST_RUN_LOG_FILE_NAME = Cable_SelfTest_Run_Log.xml +TEST_RUN_LOG_FILE_NAME = Test_Run_Log.xml + +; file name prefix +NLOG_FILE_NAME_PREFIX = Mts + +; folder names +NLOG_FOLDER_NAME = _NLog +TESTSTAND_FOLDER_NAME = _TestStand +HARDWARE_CONFIG_FOLDER_NAME = Hardware +SIM_CONFIG_FOLDER_NAME = Sim +INSTRUMENT_CONFIG_FOLDER_NAME = Instruments +MEASUREMENT_CONFIG_FOLDER_NAME = Measurements +PDEL_FOLDER_NAME = PDEL + +; teststand variable names +DESTINATION_TEST_REPORT_PATH_VAR_NAME = DestinationTestReportPath diff --git a/Source/Program/InstrumentConfigFiles/ADVANTECH_DIO_1.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/ADVANTECH_DIO_1.xml similarity index 100% rename from Source/Program/InstrumentConfigFiles/ADVANTECH_DIO_1.xml rename to Source/Program/ConfigFiles/Sim/MTS/Instruments/ADVANTECH_DIO_1.xml diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeDeviceNodeTCP.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeDeviceNodeTCP.xml new file mode 100644 index 0000000..872cbfd --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeDeviceNodeTCP.xml @@ -0,0 +1,143 @@ + + + +
+ + + + + + + + +
+
+ + + + + + + + + + + +
+
+ + + +
+
+ +
+
+ + + + + + + + +
+
+ + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + 10 + + + 100 + + + + ./CoeXmlFiles/NGSRI/GimbalMsgs.xml + ./CoeXmlFiles/NGSRI/NgsriUmbilicalMsgs.xml + ./CoeXmlFiles/NGSRI/NgsriMissionManagerMsgs.xml + ./CoeXmlFiles/NGSRI/NgsriFirmwareMsg.xml + + + + + + + MissionManagerMsgLL + + + + + + + + + MissionManagerMsgLL + + +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGI/MTestCombined.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGI/MTestCombined.xml new file mode 100644 index 0000000..de1141c --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGI/MTestCombined.xml @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint.xml + + + unsigned int + PDATA_BYTE_SIZE + 512 + + + MTestConfigLwirBiasPacket + + 0 + lwirSensorPower + unsigned char + 1 + + + 3.2901 + vpD3p3 + float + 3.18999 + 3.430001 + + + 3.32 + vpA3p3 + float + 3.1899 + 3.4301 + + + 1.1835 + vpD1p2 + float + 1.07999 + 1.3201 + + + 1.157 + vpA1p2 + float + 1.07999 + 1.32001 + + + 1.22 + vpOCX + float + 1.16049 + 1.2701 + + + 1.22 + vpDIO + float + 1.16049 + 1.2701 + + + 1.2 + vDetCom_Band1 + float + 0.8999 + 1.5001 + + + 0 + vDetCom_Band2 + float + -0.3001 + 0.30001 + + + + MTestConfigLwirDroicPacket + + PDATA_BYTE_SIZE + 0 + pDataControlWord + unsigned char + + + + ConfigureLwirSensorBiasVoltageCmdMsg + 0x00 + + ConfigureLwirSensorBiasVoltageCmdMsg + + data + MTestConfigLwirBiasPacket + Payload should be named "data" + + + + ConfigureLwirSensorBiasVoltageCmdRsp + 0x00 + + ConfigureLwirSensorBiasVoltageCmdRsp + + data + MTestConfigLwirBiasPacket + Payload should be named "data" + + + + ConfigureLwirSensorDroicCmdMsg + 0x00 + + ConfigureLwirSensorDroicCmdMsg + + data + MTestConfigLwirDroicPacket + Payload should be named "data" + + + + ConfigureLwirSensorDroicCmdRsp + 0x00 + + ConfigureLwirSensorDroicCmdRsp + + data + MTestConfigLwirDroicPacket + Payload should be named "data" + + + + NackPacket + + 0 + item1 + unsigned int + + + + NackRspMsg + 0x00 + + NackRspMsg + + data + NackPacket + + + + + + + + diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGI/cstdint.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGI/cstdint.xml new file mode 100644 index 0000000..e5f2643 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGI/cstdint.xml @@ -0,0 +1,52 @@ + + + uint32_t + + type + unsignedint + + + + uint16_t + + type + unsignedshort + + + + uint64_t + + type + unsignedlonglong + + + + uint8_t + + type + unsignedchar + + + + int32_t + + type + int + + + + int16_t + + type + short + + + + int64_t + + type + longlong + + + + \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/Common.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/Common.xml new file mode 100644 index 0000000..f1bbadb --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/Common.xml @@ -0,0 +1,649 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + wosa + + uint32_t + MAX_EFFECTOR_COUNT + 8 + + + uint32_t + MAX_MSG_PROD + 500 + + + uint32_t + MAX_NUM_TARGETS + 10 + + + uint32_t + VALID + 0 + + + uint32_t + INVALID + 1 + + + uint32_t + ALL_VALID + 0 + + + uint32_t + ALL_INVALID + 0xFFFFFFFF + + + EffectorType + + ACM + 0x01 + + + SURFACE + 0x02 + + + + MDT_File_Number + Allowable enumerations for the MDT File Type to be used by the WIM Defined DMN_Initialization Message + + ALMANAC + 4 + + + EPHEMERIS + 5 + + + COMPLEMENTARYNAV + 19 + + + MISSIONDATA + 20 + + + WDL_KEY_1 + 25 + + + WDL_KEY_2 + 26 + + + WDL_KEY_3 + 27 + + + + BIT_Report_e + Allowable enumerations for the DMN_Status_Monitor.Subsystem_BIT_Report field. All other values are Reserved or WIM defined. + + BIT_PASS + 0 + + + BIT_DEGRADED + 1 + + + BIT_FAILED + 2 + + + NO_RESULTS + 3 + + + + Message_Rate + + 0xFFFFFFFF + messageInvalidityBitFlags + uint32_t + + + 0 + messageID + uint8_t + + + 3 + 0 + reserved2 + uint8_t + + + 0 + msgUpdateRateHz + float + + + 0xFFFFFFFF + msgVersionNumber + uint32_t + + + + Target_Priority + + 0 + targetIdPriority + uint8_t + + + 3 + 0 + reserved2 + uint8_t + + + + Target_State_ECEF + + 0xFFFFFFFF + messageInvalidityBitFlags + uint64_t + + + 0 + timeValidNanoSec + uint64_t + + + 0.0 + tgtPosEcefX + double + + + 0.0 + tgtPosEcefY + double + + + 0.0 + tgtPosEcefZ + double + + + 3 + 3 + 0.0 + tgtPosCovEcef + double + + + 0.0 + tgtVelEcefX + double + + + 0.0 + tgtVelEcefY + double + + + 0.0 + tgtVelEcefZ + double + + + 3 + 3 + 0.0 + tgtVelCovEcef + double + + + 0.0 + tgtAccEcefX + double + + + 0.0 + tgtAccEcefY + double + + + 0.0 + tgtAccEcefZ + double + + + 3 + 3 + 0.0 + tgtAccCovEcef + double + + + 0 + tgtId + uint64_t + + + 0 + tgtType + uint32_t + + + 0 + tgtPriority + uint8_t + + + 3 + 0 + reserved2 + uint8_t + + + 0 + tgtIntention + uint32_t + + + 0 + clusterIndicator + uint32_t + + + + Target_State_LOS + + 0xFFFFFFFF + messageInvalidityBitFlags + uint64_t + + + 0 + timeValidNanoSec + uint64_t + + + 0.0 + tgtRange + double + + + 0.0 + tgtRangeRate + double + + + 0.0 + tgtRelXrot + double + + + 0.0 + tgtRelYrot + double + + + 0.0 + tgtRelZrot + double + + + 3 + 3 + 0.0 + tgtLosCov + double + + + 0.0 + tgtRelXrotRate + double + + + 0.0 + tgtRelYrotRate + double + + + 0.0 + tgtRelZrotRate + double + + + 3 + 3 + 0.0 + tgtLosRateCov + double + + + 0 + tgtId + uint64_t + + + 0 + tgtType + uint32_t + + + 0 + tgtIntention + uint32_t + + + 0 + tgtPriority + uint32_t + + + 0 + refLocX + uint32_t + + + 0 + refLocY + uint32_t + + + 0 + refLocZ + uint32_t + + + 3 + 3 + 0 + refCov + uint32_t + + + 0 + clusterIndicator + uint32_t + + + + Header + + 0 + domainID + uint8_t + + + 0 + instanceID + uint8_t + + + 0 + elementID + uint8_t + + + 0 + messageID + uint8_t + + + 0 + messageCount + uint16_t + + + 0 + payloadLengthBytes + uint16_t + + + 0 + timeStampNanoSec + uint64_t + + + + Trailer + + 0 + messageCRC + uint32_t + + + + DMN_LookTo_ECEF + + 0 + numTgts + uint8_t + Number of Target ECEF cues + + + 3 + 0 + reserved + uint8_t + + + wosa::MAX_NUM_TARGETS + targetStateEcef + wosa::Target_State_ECEF + + + + DMN_LookTo_LOS + + 0 + numTgts + uint8_t + Number of Targets Look To LOS + + + 3 + 0 + reserved + uint8_t + + + wosa::MAX_NUM_TARGETS + targetStateLos + wosa::Target_State_LOS + + + + DMN_Metamodule_Message + + 0xFFFFFFFF + messageInvalidityBitFlags + uint32_t + + + 0 + vendorRegistry + uint8_t + + + 0 + vendorSystemNumber + uint8_t + + + 0 + vendorModel + uint8_t + + + 0 + vendorSoftware + uint8_t + + + 0 + numMsgsProduced + uint8_t + + + 3 + 0 + reserved + uint8_t + + + wosa::MAX_MSG_PROD + messageRate + wosa::Message_Rate + + + + DMN_Priority + + 0xFFFFFFFF + messageInvalidityBitFlags + uint32_t + + + 0 + numTgts + uint8_t + + + 3 + 0 + reserved + uint8_t + + + wosa::MAX_NUM_TARGETS + targetPriority + wosa::Target_Priority + + + + DMN_Status_Monitor + + 0xFFFFFFFF + messageInvalidityBitFlags + uint32_t + + + 0 + subsystemBITreport + uint16_t + + + 0 + storeStatusWord1 + uint16_t + + + 0 + storeStatusWord2 + uint16_t + + + 0 + storeStatusWord3 + uint16_t + + + 0 + storeStatusWord4 + uint16_t + + + 0 + storeStatusWord5 + uint16_t + + + 0 + msnExecControlAck + uint16_t + + + 0 + reserved + uint16_t + + + + DMN_Initialization + + 0 + MDT_File_Number + uint16_t + Enumeration: Type of MDT File (4 = Almanac, 5 = Ephemeris, etc) + + + 64 + numberOfRecords + uint16_t + Width of 2D Array + + + 29 + numberOfBlocks + uint16_t + Height of 2D Array + + + 64 + 29 + 0 + MDT_Data + uint16_t + WIM Specified Initialization Data, typically this data structure is defined in an external standard and only used for initialization [unitless] + + + + + + + + + diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/Gimbal.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/Gimbal.xml new file mode 100644 index 0000000..3add465 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/Gimbal.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + roll and nod + uint32_t + N_AXES + 2 + + + Bits + + 0 + posLoop + uint32_t + bit + + + 0 + velLoop + uint32_t + bit + + + 0 + velCmd + uint32_t + bit + + + 0 + injCur + uint32_t + bit + + + 0 + injVel + uint32_t + bit + + + 0 + injPos + uint32_t + bit + + + 0 + fricComp + uint32_t + bit + + + + AxisMode + + b + Bits + + + + Axis + + mode + AxisMode + + + 0 + pos + double + rad + + + 0 + vel + double + rad/sec + + + + AlgorithmProcAxis + + 0.0 + posFltRad + double + + + 0.0 + velFltRps + double + + + + CurrentMeasurements + + 0.0 + dvtCurrAdcSec + double + + + 0.0 + measPhaseACurrAdcA + double + + + 0.0 + measPhaseBCurrAdcA + double + + + + + + + + diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/GimbalMsgs.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/GimbalMsgs.xml new file mode 100644 index 0000000..9de601c --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/GimbalMsgs.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gimbal.xml + cstdint + + + GimbalCommandDataType + \\<EximItarRestricted> ----------------------------------------------------------------------------// WARNING - This document contains Technical Data whose export or disclosure // to Non-U.S. Persons, wherever located, is restricted by the International // Traffic in Arms Regulations (ITAR) (22 C.F.R Sections 120-130). Violations // are subject to severe criminal penalties. // ----------------------------------------------------------------------------// \\<\EximItarRestricted> + + 0 + time + double + + + 0 + valid + unsigned int + + + 0.0 + cmdGimbalAzFromHousingInBody + double + + + 0.0 + cmdGimbalElFromHousingInBody + double + + + + GimbalStateDataType + + 0.0 + measTime + double + + + 0.0 + measRoll + double + + + 0.0 + measNod + double + + + + CageDataType + + 0 + cagedPitch + int32_t + + + 0 + cagedRoll + int32_t + + + 0 + uncaged + int + + + + GimbalCurrentCommandDataType + + N_AXES + 0.0 + currentCommands + double + + + 0.0f + pwmRollPhaseA + float + + + 0.0f + pwmRollPhaseB + float + + + 0.0f + pwmRollPhaseC + float + + + 0.0f + pwmNodPos + float + + + 0.0f + pwmNodNeg + float + + + + GimbalCurrentMeasurementDataType + + N_AXES + curr + CurrentMeasurements + + + + GimbalSensorProcessorTmStruct + Telemetry payload struct for the GSPComp + + -1.0 + encoderMeasTime + double + Time (s) at which the encoder measurement was taken + + + 0 + imuValidityTimeNs + uint64_t + Time in nanoseconds that the IMU measurement is valid for. See SW/DataModel/WOSA/IMU.xml + + + 0 + nodEncoderData + double + + + 0 + rollEncoderData + double + + + 3 + 0 + ImuAccelData + float + + + 3 + 0 + ImuGyroData + float + + + + GimbalMisalignmentDataType + + 3 + 0 + pTa + double + + + 3 + 0 + gTp + double + + + 3 + 0 + tTg + double + + + 3 + 0 + dTp + double + + + 3 + 0 + r1 + double + + + 3 + 0 + r2 + double + + + 3 + 0 + r3 + double + + + 3 + 0 + n1 + double + + + + GimbalCommandMsg + 0x00 + + GimbalCommandMsg + + data + GimbalCommandDataType + + + + GimbalStateMsg + 0x00 + + GimbalStateMsg + + data + GimbalStateDataType + + + + EncoderHwifMsg + 0x00 + + EncoderHwifMsg + + data + GimbalStateDataType + Message sent from GspHwif to itself after delay + + + + CageStateMsg + 0x00 + + CageStateMsg + + data + CageDataType + + + + GimbalCurrentCommandMsg + 0x00 + + GimbalCurrentCommandMsg + + data + GimbalCurrentCommandDataType + + + + GimbalCurrentMeasurementMsg + 0x00 + + GimbalCurrentMeasurementMsg + + data + GimbalCurrentMeasurementDataType + + + + GimbalSensorProcessorTmMsg + 0x00 + + GimbalSensorProcessorTmMsg + + data + GimbalSensorProcessorTmStruct + + + + GimbalMisalignmentDataMsg + 0x00 + + GimbalMisalignmentDataMsg + + data + GimbalMisalignmentDataType + + + + + + + + diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriFirmwareMsg.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriFirmwareMsg.xml new file mode 100644 index 0000000..50ff198 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriFirmwareMsg.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + ngsri + + With input from SP, maximum expected segements in the scene is 500 + uint32_t + MAX_SEGMENT_SIZE + 500 + + + NgsriSegmentData + + 0 + numSegments + uint16_t + The actual number of segments + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentRow + uint8_t + The row of the segment in the original image + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentBeginCol + uint8_t + The column of the first pixel in the segment + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentEndCol + uint8_t + The column after the last pixel of the segment + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentLength + uint8_t + The number of pixels in the segment + + + ngsri::MAX_SEGMENT_SIZE + 0 + segmentColMoment + uint32_t + The sum of the columns of the pixels in the segment + + + ngsri::MAX_SEGMENT_SIZE + 0.0f + segmentMaxIntensity + float + The highest intensity out of the pixels in the segment + + + ngsri::MAX_SEGMENT_SIZE + 0.0f + segmentSumIntensity + float + The sum of pixel intensities within segment + + + 0.0 + tov + double + + + 0 + frameNumber + unsigned int + + + + NgsriAdnucStateData + + 0 + adnucState + uint8_t + + + 3 + 0 + padding + uint8_t + + + + NgsriRobSegmentsMsg + 0x00 + + NgsriRobSegmentsMsg + + payload + ngsri::NgsriSegmentData + + + + NgsriLogSegmentsMsg + 0x00 + + NgsriLogSegmentsMsg + + payload + ngsri::NgsriSegmentData + + + + NgsriAdnucStateMsg + 0x00 + + NgsriAdnucStateMsg + + data + ngsri::NgsriAdnucStateData + + + + + + + + + diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriMissionManagerMsgs.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriMissionManagerMsgs.xml new file mode 100644 index 0000000..58e583f --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriMissionManagerMsgs.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + ngsri + + MissionMode + + TACTICAL + 0 + + + MSFR + 1 + + + PATHFINDER + 2 + + + RTF + 3 + + + LBT + 4 + + + CFT + 5 + + + GFT + 6 + + + + MissionManagerDataTypeLL + + 0 + CTS + unsigned int + + + 0 + pad_one + unsigned int + + + 3 + 0.0 + tgtPosLocal + double + + + 3 + 0.0 + tgtVelLocal + double + + + 3 + 0.0 + tgtAccLocal + double + + + 3 + 3 + 0.0 + tgtPosCovNED + double + + + 3 + 3 + 0.0 + tgtVelCovNED + double + + + 3 + 3 + 0.0 + tgtAccCovNED + double + + + 0.0 + timeOfValidity + double + + + 0 + guideState + int + + + 0 + seekerState + int + + + 0 + seekerReady + int + + + 0 + cageState + int + bool + + + 0 + adnucState + int + + + 0 + mmgrState + uint8_t + See MissionManagerTypes.hpp + + + 3 + 0 + pad_two + uint8_t + + + 0 + recage + int + bool + + + 0 + mmgrMode + uint8_t + Mission manager mode of operation + + + 3 + 0 + pad_three + uint8_t + + + 99999.0 + tacticalLaunchTimeSec + double + + + + MissionManagerAdnucType + + 0 + adnucState + int + + + 0 + startAdnuc + unsigned int + bool + + + + MissionManagerCoarseAlignType + + 0 + AlignmentDuration + double + + + + MissionManagerCompTmType + + 0 + mmgrState + uint8_t + See MissionManagerTypes.hpp + + + 0 + adnucState + uint8_t + See MissionManagerTypes.hpp + + + 0 + testListSize + uint64_t + Part of MissileKit CommonEmbeddedTest framework + + + 0 + testListStatus + uint64_t + Part of MissileKit CommonEmbeddedTest framework + + + 0.0 + measTime + double + See TimeUtility.hpp getTimeNow_sec(). This field is needed to align measurements from other packets without introducing in variation from the Telemetry component + + + 0.0 + navTime + float + + + + MissionManagerSyncReqData + + 0 + activateSyncs + uint8_t + Enables the FSync and GSync pulses in FW + + + + MissionManagerMsgLL + 0x00 + + MissionManagerMsgLL + + data + ngsri::MissionManagerDataTypeLL + + + + MissionManagerAdnucMsg + 0x00 + + MissionManagerAdnucMsg + + data + ngsri::MissionManagerAdnucType + + + + MissionManagerAlignmentMsg + 0x00 + + MissionManagerAlignmentMsg + + data + ngsri::MissionManagerCoarseAlignType + + + + MissionManagerCompTmMsg + 0x00 + + MissionManagerCompTmMsg + + data + ngsri::MissionManagerCompTmType + + + + MissionManagerSyncReqMsg + 0x00 + + MissionManagerSyncReqMsg + + data + ngsri::MissionManagerSyncReqData + + + + MissionManagerIdaTempReqMsg + 0x00 + + MissionManagerIdaTempReqMsg + + 0 + payload + uint32_t + Sent to IdaComp to determine if IDA temp is overthreshold. No payload, message receipt dictates behavior + + + + + + + + + diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriUmbilicalMsgs.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriUmbilicalMsgs.xml new file mode 100644 index 0000000..176c2b4 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/CoeXmlFiles/NGSRI/NgsriUmbilicalMsgs.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cstdint + + + ngsri + + UmbilicalRetractBatteryGoodDataType + + 0 + umbilicalRetractBatteryGood + unsigned int + bool + + + + UmbilicalTmDataType + Telemetry payload struct for the UmbilicalComp + + 2 + 0 + losData + int32_t + + + 2 + 0 + cageVectorPitchRollData + int32_t + roll and pitch units where roll is 1 rotation about X and pitch is 2 rotation about Y in bits per degrees notation + + + 0 + uncageData + int + + + 0 + cageCount + uint32_t + + + 0 + toneData + double + + + 0 + umbilicalRetractBatteryGoodData + unsigned int + bool + + + 0 + orientationRspData + uint16_t + + + 0 + lifetimeTime + uint32_t + seconds + + + 0 + lifetimeCount + uint8_t + + + + UmbilicalRetractBatteryGoodMsg + 0x00 + + UmbilicalRetractBatteryGoodMsg + + data + ngsri::UmbilicalRetractBatteryGoodDataType + + + + UmbilicalTmMsg + 0x00 + + UmbilicalTmMsg + + data + ngsri::UmbilicalTmDataType + + + + + + + + + diff --git a/Source/Program/InstrumentConfigFiles/DIO_MODULES.ini b/Source/Program/ConfigFiles/Sim/MTS/Instruments/DIO_MODULES.ini similarity index 63% rename from Source/Program/InstrumentConfigFiles/DIO_MODULES.ini rename to Source/Program/ConfigFiles/Sim/MTS/Instruments/DIO_MODULES.ini index d362cd6..da50094 100644 --- a/Source/Program/InstrumentConfigFiles/DIO_MODULES.ini +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/DIO_MODULES.ini @@ -1,7 +1,10 @@ ; =============================================================================================================== ; This name must match the name specified in the Instrument.xml for an instrument of type DIO [PICKERING_DIO_1] -PXI_CARD_SLOT_INDEX = 0 +LXI_IP_ADDRESS = 192.160.1.15 +DEVICE_NUMBER = 14 +BUS_NUMBER = 3 + SHALL_WE_DRIVE_OUTPUT_UPON_INITIALIZATION = false ; number channels per port NUM_CHANNELS_PER_PORT=8 @@ -42,4 +45,28 @@ SIGNAL_6 = 1|0 ;format is = [ADVANTECH_DIO_1.INPUT_SIGNALS] SIGNAL_7 = 0 -SIGNAL_8 = 0 \ No newline at end of file +SIGNAL_8 = 0 + +; =============================================================================================================== +; This name must match the name specified in the Instrument.xml for an instrument of type DIO +[ICS8003_DIO_1] +DIO_ADDRESS = localhost +DIO_PORT = 23 +SHALL_WE_DRIVE_OUTPUT_UPON_INITIALIZATION = false +; number channels per port +NUM_CHANNELS_PER_PORT=8 +; either 0 or 1 as the starting channel index +CHANNEL_START_INDEX=0 +NUM_OUTPUT_CHANNELS = 32 +NUM_INPUT_CHANNELS = 32 + +;format is = | +; is either 0 or 1 or 2(Logic Z) +[ICS8003_DIO_1.OUTPUT_SIGNALS] +SIGNAL_9 = 0|1 +SIGNAL_10 = 1|0 + +;format is = +[ICS8003_DIO_1.INPUT_SIGNALS] +SIGNAL_11 = 0 +SIGNAL_12 = 0 \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/ICS8003_DIO_1.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/ICS8003_DIO_1.xml new file mode 100644 index 0000000..f0f2ad1 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/ICS8003_DIO_1.xml @@ -0,0 +1,9 @@ + + + +
+ +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/Instruments.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/Instruments.xml new file mode 100644 index 0000000..f7053e0 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/Instruments.xml @@ -0,0 +1,56 @@ + + + +
+ +
+
+ + + + CoeDeviceNodeTCP + CoeCommDeviceFactory + + + UUT_POWER_SUPPLY_SYSTEM_20V + PowerSupplySystemKeysightFactory + + + UUT_POWER_SUPPLY_SYSTEM_5V + PowerSupplySystemKeysightFactory + + + PICKERING_DIO_1 + DIOPickering40xFactory + + + PICKERING_RELAY_SWITCH_16CH + SwitchPickeringLxi60_522_SoapFactory + + + PICKERING_RELAY_SWITCH_32CH + SwitchPickeringLxi60_522_SoapFactory + + + PICKERING_SWITCH_MATRIX_64X4 + SwitchMatrixPickering40xFactory + + + KEYSIGHT_DMM_1 + DMMKeysightScpiFactory + + + PICKERING_SWITCH_MULTIPLEXER_96X4 + SwitchMultiplexerPickering60xFactory + + + ICS8003_DIO_1 + DIOIcs8003Factory + + + SERIAL_COM_PORT_1 + CommDeviceSerialFactory + + + +
\ No newline at end of file diff --git a/Source/Program/InstrumentConfigFiles/KEYSIGHT_DMM_1.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/KEYSIGHT_DMM_1.xml similarity index 79% rename from Source/Program/InstrumentConfigFiles/KEYSIGHT_DMM_1.xml rename to Source/Program/ConfigFiles/Sim/MTS/Instruments/KEYSIGHT_DMM_1.xml index 1fe2192..526b633 100644 --- a/Source/Program/InstrumentConfigFiles/KEYSIGHT_DMM_1.xml +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/KEYSIGHT_DMM_1.xml @@ -2,7 +2,7 @@
- +
diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini b/Source/Program/ConfigFiles/Sim/MTS/Instruments/KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini new file mode 100644 index 0000000..4ea80fd --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini @@ -0,0 +1,56 @@ +[SYSTEM] +;system commands +CLEAR_CMD = *CLS +RESET_CMD = *RST +SELFTEST_CMD = *TST? +READ_ERROR_CODE_CMD = SYST:ERR? +REBOOT_CMD = SYST:REB + +;panel disable/enable commands +SET_FRONTPANEL_DISABLE_CMD = SYST:COMM:RLST RWL +SET_FRONTPANEL_ENABLE_CMD = SYST:COMM:RLST REM + +;watchdog commands +SET_WATCHDOGDELAY_CMD = OUTP:PROT:WDOG:DEL +SET_WATCHDOGON_CMD = OUTP:PROT:WDOG ON +SET_WATCHDOGOFF_CMD = OUTP:PROT:WDOG OFF + +;coupling commands +SET_COUPLE_CHANNELS_CMD = OUTP:COUP:CHAN +SET_COUPLE_ON_CMD = OUTP:COUP ON +SET_COUPLE_OUTPUT_PROTECT_ON_CMD = OUTP:PROT:COUP ON +QUERY_COUPLE_CHANNELS = OUTP:COUP:CHAN? +QUERY_COUPLE_STATE = OUTP:COUP? + +; Grouping Commands +SET_GROUP_DEFINE_CMD = SYST:GRO:DEF +UNGROUP_ALL_CHANNELS_CMD = SYST:GRO:DEL:ALL +QUERY_GROUP_CHANNELS = SYST:GRO:CAT? + +[MODULE] +; current commands +SET_INRUSH_DELAY_CMD = CURR:PROT:DEL +READ_INRUSH_DELAY_CMD = CURR:PROT:DEL? +READ_CURRENT_CMD = MEAS:CURR? +SET_OCP_CMD = CURR:LEV +READ_OCP_CMD = CURR:LEV? +SET_OCP_ON_CMD = CURR:PROT:STAT ON + +; voltage commands +SET_OVP_CMD = VOLT:PROT +SET_VOLTAGE_SLEW_CMD = VOLT:SLEW +SET_VOLTAGE_SETPOINT_CMD = VOLT:LEV +SET_CONSTANT_VOLTAGE_CMD = STAT:OPER:ENAB 1 +READ_VOLTAGE_CMD = MEAS:VOLT? +READ_VOLTAGE_SETPOINT_CMD = VOLT? +READ_OVP_CMD = VOLT:PROT? +READ_VOLTAGE_SLEW_CMD = VOLT:SLEW? + +; set output commands +SET_OUTPUT_DISABLE_CMD = OUTP OFF +SET_OUTPUT_ENABLE_CMD = OUTP ON + +; query status +READ_OUTPUT_STATUS_CMD = OUTP? +READ_ERROR_STATUS_CMD = SYST:ERR? +READ_PROTECTION_STATUS_CMD = STAT:QUES:COND? \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_DIO_1.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_DIO_1.xml new file mode 100644 index 0000000..744feae --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_DIO_1.xml @@ -0,0 +1,9 @@ + + + +
+ +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_RELAY_SWITCH_16CH.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_RELAY_SWITCH_16CH.xml new file mode 100644 index 0000000..c3f259c --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_RELAY_SWITCH_16CH.xml @@ -0,0 +1,12 @@ + + + +
+ + + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_RELAY_SWITCH_32CH.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_RELAY_SWITCH_32CH.xml new file mode 100644 index 0000000..2943b76 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_RELAY_SWITCH_32CH.xml @@ -0,0 +1,12 @@ + + + +
+ + + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_SWITCH_MATRIX_64X4.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_SWITCH_MATRIX_64X4.xml new file mode 100644 index 0000000..668b395 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_SWITCH_MATRIX_64X4.xml @@ -0,0 +1,11 @@ + + + +
+ + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_SWITCH_MULTIPLEXER_96X4.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_SWITCH_MULTIPLEXER_96X4.xml new file mode 100644 index 0000000..ddbff60 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/PICKERING_SWITCH_MULTIPLEXER_96X4.xml @@ -0,0 +1,12 @@ + + + +
+ + + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/InstrumentConfigFiles/POWER_SUPPLY_SYSTEMS.ini b/Source/Program/ConfigFiles/Sim/MTS/Instruments/POWER_SUPPLY_SYSTEMS.ini similarity index 61% rename from Source/Program/InstrumentConfigFiles/POWER_SUPPLY_SYSTEMS.ini rename to Source/Program/ConfigFiles/Sim/MTS/Instruments/POWER_SUPPLY_SYSTEMS.ini index f5b6b3c..03cac8c 100644 --- a/Source/Program/InstrumentConfigFiles/POWER_SUPPLY_SYSTEMS.ini +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/POWER_SUPPLY_SYSTEMS.ini @@ -1,30 +1,30 @@ ; =============================================================================================================== ; This name must match the name specified in the Instrument.xml that is associated with the power supply system -[STE_POWER_SUPPLY_SYSTEM] -SCPI_DEF_FILEPATH = .\InstrumentConfig\KEYSIGHT_SCPI_DEF.ini +[UUT_POWER_SUPPLY_SYSTEM_5V] +SCPI_DEF_FILEPATH = KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini ETHERNET_ADDRESS = localhost ETHERNET_PORT = 5025 -MODULE_DEFINITION = UUT_REF_3_3V, STE_PVM_5V, STE_GU_INTERFACE_RELAYS_25V, STE_GU_INTERFACE_RF_INTERFACE_5V +MODULE_DEFINITION = MODULE_1, MODULE_2 ; 0 means no coupled modules. ; couple means turning on/off any one of the module, turns on/off the others -COUPLED_MODULES = STE_PVM_5V, STE_GU_INTERFACE_RELAYS_25V, STE_GU_INTERFACE_RF_INTERFACE_5V +COUPLED_MODULES = 0 ; 0 means no grouped modules. ; group means turning combining 2 or more modules thus acting as one module GROUPED_MODULES = 0 INTERFACE = ETHERNET -[STE_POWER_SUPPLY_SYSTEM.UUT_REF_3_3V] +[UUT_POWER_SUPPLY_SYSTEM_5V.MODULE_1] INDEX = 1 OCP = 2.0 OVP = 4.0 -VOLTAGE_SETPOINT = 3.3 +VOLTAGE_SETPOINT = 3.0 MIN_VOLTAGE = 3.0 MAX_VOLTAGE = 3.75 MAX_CURRENT = 2.0 MIN_CURRENT = -0.25 -[STE_POWER_SUPPLY_SYSTEM.STE_PVM_5V] +[UUT_POWER_SUPPLY_SYSTEM_5V.MODULE_2] INDEX = 2 OCP = 2.0 OVP = 8.0 @@ -35,35 +35,14 @@ MAX_VOLTAGE = 5.5 MAX_CURRENT = 1.5 MIN_CURRENT = -.25 -[STE_POWER_SUPPLY_SYSTEM.STE_GU_INTERFACE_RELAYS_25V] -INDEX = 3 -OCP = 3.0 -OVP = 34.0 -VOLTAGE_SETPOINT = 25.0 - -MIN_VOLTAGE = 22.0 -MAX_VOLTAGE = 30.0 -MAX_CURRENT = 3.0 -MIN_CURRENT = -0.25 - -[STE_POWER_SUPPLY_SYSTEM.STE_GU_INTERFACE_RF_INTERFACE_5V] -INDEX = 4 -OCP = 5.0 -OVP = 6.5 -VOLTAGE_SETPOINT = 5.0 - -MIN_VOLTAGE = 4.0 -MAX_VOLTAGE = 6.3 -MAX_CURRENT = 4.5 -MIN_CURRENT = -.25 ; =============================================================================================================== ; This name must match the name specified in the Instrument.xml that is associated with the power supply system -[UUT_POWER_SUPPLY_SYSTEM] -SCPI_DEF_FILEPATH = .\InstrumentConfig\KEYSIGHT_SCPI_DEF.ini +[UUT_POWER_SUPPLY_SYSTEM_20V] +SCPI_DEF_FILEPATH = KEYSIGHT_POWER_SUPPLY_SCPI_DEF.ini ETHERNET_ADDRESS = localhost ETHERNET_PORT = 5026 -MODULE_DEFINITION = UUT_P20V, UUT_N20V +MODULE_DEFINITION = P20V, N20V ; 0 means no coupled modules. ; couple means turning on/off any one of the module, turns on/off the others COUPLED_MODULES = 0 @@ -72,18 +51,18 @@ COUPLED_MODULES = 0 GROUPED_MODULES = 0 INTERFACE = ETHERNET -[UUT_POWER_SUPPLY_SYSTEM.UUT_P20V] +[UUT_POWER_SUPPLY_SYSTEM_20V.P20V] INDEX = 1 OCP = 1.5 OVP = 22.0 -VOLTAGE_SETPOINT = 20.0 +VOLTAGE_SETPOINT = 21.0 MIN_VOLTAGE = 19.0 MAX_VOLTAGE = 22.75 MAX_CURRENT = 2.3 MIN_CURRENT = -0.25 -[UUT_POWER_SUPPLY_SYSTEM.UUT_N20V] +[UUT_POWER_SUPPLY_SYSTEM_20V.N20V] INDEX = 2 OCP = 1.8 OVP = 22.5 diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/SERIAL_COM_PORT_1.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/SERIAL_COM_PORT_1.xml new file mode 100644 index 0000000..1978ead --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/SERIAL_COM_PORT_1.xml @@ -0,0 +1,15 @@ + + + +
+ + + + + + + +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/UUT_POWER_SUPPLY_SYSTEM_20V.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/UUT_POWER_SUPPLY_SYSTEM_20V.xml new file mode 100644 index 0000000..5f22f59 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/UUT_POWER_SUPPLY_SYSTEM_20V.xml @@ -0,0 +1,9 @@ + + + +
+ +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Instruments/UUT_POWER_SUPPLY_SYSTEM_5V.xml b/Source/Program/ConfigFiles/Sim/MTS/Instruments/UUT_POWER_SUPPLY_SYSTEM_5V.xml new file mode 100644 index 0000000..e375644 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Instruments/UUT_POWER_SUPPLY_SYSTEM_5V.xml @@ -0,0 +1,9 @@ + + + +
+ +
+
+ +
\ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Measurements/CoeMeasurementManager.ini b/Source/Program/ConfigFiles/Sim/MTS/Measurements/CoeMeasurementManager.ini new file mode 100644 index 0000000..b638053 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Measurements/CoeMeasurementManager.ini @@ -0,0 +1,2 @@ +[GENERAL] +CheckForMessageIntervalMs = 10 \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/Measurements/SwitchMeasurementManager.ini b/Source/Program/ConfigFiles/Sim/MTS/Measurements/SwitchMeasurementManager.ini new file mode 100644 index 0000000..207c4af --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/Measurements/SwitchMeasurementManager.ini @@ -0,0 +1,118 @@ +;format is name = range|resolution|delay(ms)|scale factor|relays|voltRange|numReads +;Use device number to identifiy switch card... see switch configuration +[DmmReadFrequency] +F1 = 10|0.001|100|1|PICKERING_RELAY_SWITCH_16CH:97,98|10|1 + +;format is signal_name = range|resolution|min_delay(ms)|max_delay(ms)|scale factor|relays|type|cable, connector and pin id|lower_limit|upper_limit +;Type is TWO or FOUR for two wire and four wire measurements +;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Path1],[Path2] +; [Card_Name] - must match the name of the switch card defined in the Instrument.xml +; [Path] +; For a simple relay switch: [channel_id] +; For a 2-d switch matrix: [subUnit].[channel_x].[channel_y] +;Cable and Pin Id Format: [Cable_Id]_[Connecto_Id][Pin_Id]_[Cable_Id]_[Connector_Id]_[Pin_Id] +[DmmReadResistance] +; Cable IDs +W1_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.59.1,0.60.2|TWO|W1_P1_J13_W1_P1_J14|0.0|200000.0 +W1_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.63.1,0.64.2|TWO|W1_P1_J15_W1_P1_J16|0.0|200000.0 +W2_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.59.1,0.60.2|TWO|W1_P1_J13_W1_P1_J14|0.0|200000.0 +W2_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.63.1,0.64.2|TWO|W1_P1_J15_W1_P1_J16|0.0|200000.0 +W3_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.57.1,0.58.2|TWO|W1_P3_63_W1_P3_64|0.0|200000.0 +W3_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.61.1,0.62.2|TWO|W1_P3_65_W1_P3_66|0.0|200000.0 +W4_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.57.1,0.58.2|TWO|W1_P3_63_W1_P3_64|0.0|200000.0 +W4_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.61.1,0.62.2|TWO|W1_P3_65_W1_P3_66|0.0|200000.0 +W5_CABLE_PART_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.5.1,0.8.2|TWO|W1_P4_50_W1_P4_51|0.0|200000.0 +W5_CABLE_SERIAL_NUMBER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.22.1,0.43.2|TWO|W1_P4_13_W1_P4_52|0.0|200000.0 + +; W3 Continuity +W3_AUD_GDNC_FILTER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.16.2|TWO|W1_P3_52_W1_P4_4|-2.0|2.0 +W3_TIMER_START = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.56.1,0.39.2|TWO|W1_P3_7_W1_P4_5|-2.0|2.0 +W3_SIGNAL_RETURN = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.56.1,0.19.2|TWO|W1_P3_7_W1_P4_8|-2.0|2.0 +W3_GEU_TO_EMULATOR_UART = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.55.1,0.20.2|TWO|W1_P3_9_W1_P4_9|-2.0|2.0 +W3_POWER_RETURN_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.1.1,0.24.2|TWO|W1_P4_1_W1_P4_15|-2.0|2.0 +W3_POWER_RETURN_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.1.1,0.27.2|TWO|W1_P4_1_W1_P4_19|0.0|2.0 +W3_POWER_RETURN_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.1.1,0.28.2|TWO|W1_P4_1_W1_P4_20|0.0|2.0 +W3_P20VDC_TEST = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.47.1,0.32.2|TWO|W1_P4_71_W1_P4_24|0.0|2.0 +W3_P20VDC_TEST_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.47.1,0.1.2|TWO|W1_P4_71_W1_P4_1|70.0|85.0 +W3_N20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.48.1,0.26.2|TWO|W1_P4_72_W1_P4_17|0.0|2.0 +W3_N20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.48.1,0.29.2|TWO|W1_P4_72_W1_P4_21|0.0|2.0 +W3_N20VDC_TEST_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.48.1,0.30.2|TWO|W1_P4_72_W1_P4_22|0.0|2.0 +W3_N20VDC_TEST_TO_POWER_RETURN = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.48.1,0.1.2|TWO|W1_P4_72_W1_P4_1|70.0|85.0 +W3_P20VDC_TEST_TO_N20VDC_TEST = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.47.1,0.48.2|TWO|W1_P4_71_W1_P4_72|140.0|170.0 +W3_P20VDC_TEST_TO_N20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.32.1,0.26.2|TWO|W1_P4_24_W1_P4_17|140.0|170.0 +W3_ARM_IFC_SQUIB_N = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.12.1,0.38.2|TWO|W1_P4_67_W1_P4_31|0.0|2.0 +W3_ARM_IFC_SQUIB_P_TO_ARM_IFC_SQUIB_N = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.53.1,0.12.2|TWO|W1_P4_68_W1_P4_67|0.0|2.0 +W3_BATTERY_ACTIVATE_P3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.9.1,0.10.2|TWO|W1_P4_18_W1_P4_66|0.0|2.0 +W3_LAUNCHER_INTERLOCK = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.42.1,0.6.2|TWO|W1_P4_11_W1_P4_64|0.0|2.0 +W3_FUZE_INTERLOCK = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.7.1,0.46.2|TWO|W1_P4_12_W1_P4_65|0.0|2.0 +W3_BATTERY_ACTIVATE_P2_TO_LAUNCHER_INTERLOCK = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.3.1,0.42.2|TWO|W1_P4_7_W1_P4_11|0.0|2.0 +W3_BATTERY_ACTIVATE_P2_TO_FUZE_INTERLOCK = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.3.1,0.7.2|TWO|W1_P4_7_W1_P4_12|0.0|2.0 + +; W3 AUD_GDNC_FILTER Isolation checks +W3_AUD_GDNC_FILTER_TO_POWER_RETURN_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.24.2|TWO|W1_P3_52_W1_P4_15|9.9E+10|9.9E+40 +W3_AUD_GDNC_FILTER_TO_N20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.26.2|TWO|W1_P3_52_W1_P4_17|9.9E+10|9.9E+40 +W3_AUD_GDNC_FILTER_TO_POWER_RETURN_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.27.2|TWO|W1_P3_52_W1_P4_19|9.9E+10|9.9E+40 +W3_AUD_GDNC_FILTER_TO_POWER_RETURN_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.28.2|TWO|W1_P3_52_W1_P4_20|9.9E+10|9.9E+40 +W3_AUD_GDNC_FILTER_TO_N20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.29.2|TWO|W1_P3_52_W1_P4_21|9.9E+10|9.9E+40 +W3_AUD_GDNC_FILTER_TO_N20VDC_TEST_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.30.2|TWO|W1_P3_52_W1_P4_22|9.9E+10|9.9E+40 +W3_AUD_GDNC_FILTER_TO_P20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.32.2|TWO|W1_P3_52_W1_P4_24|9.9E+10|9.9E+40 +W3_AUD_GDNC_FILTER_TO_P20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.35.2|TWO|W1_P3_52_W1_P4_28|9.9E+10|9.9E+40 + +; W4 Continuity +W4_LAUNCH_MOTOR_INIT_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.41.1,0.1.2|TWO|W1_P4_16_W1_P4_1|-2.0|2.0 +W4_LAUNCH_MOTOR_INIT_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.52.1,0.1.2|TWO|W1_P4_25_W1_P4_1|-2.0|2.0 +W4_BATTERY_INIT_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.36.1,0.1.2|TWO|W1_P4_29_W1_P4_1|-2.0|2.0 +W4_BATTERY_INIT_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.13.1,0.1.2|TWO|W1_P4_33_W1_P4_1|-2.0|2.0 +W4_LIE_N20V = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.19.1,0.48.2|TWO|W1_P4_8_W1_P4_72|-2.0|2.0 +W4_CAGE_COIL_OUT = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.32.2|TWO|W1_P3_51_W1_P4_24|-2.0|2.0 +W4_AUD_GDNC_FILTER = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.33.2|TWO|W1_P3_52_W1_P4_26|-2.0|2.0 +W4_AUDIO_OUTPUT_LOW = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.24.2|TWO|W1_P3_8_W1_P4_15|-2.0|2.0 + +; W4 CAGE_COIL_OUT Isolation checks +W4_CAGE_COIL_OUT_TO_POWER_RETURN_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.24.2|TWO|W1_P3_51_W1_P4_15|9.9E+10|9.9E+40 +W4_CAGE_COIL_OUT_TO_N20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.26.2|TWO|W1_P3_51_W1_P4_17|9.9E+10|9.9E+40 +W4_CAGE_COIL_OUT_TO_POWER_RETURN_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.27.2|TWO|W1_P3_51_W1_P4_19|9.9E+10|9.9E+40 +W4_CAGE_COIL_OUT_TO_POWER_RETURN_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.28.2|TWO|W1_P3_51_W1_P4_20|9.9E+10|9.9E+40 +W4_CAGE_COIL_OUT_TO_N20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.29.2|TWO|W1_P3_51_W1_P4_21|9.9E+10|9.9E+40 +W4_CAGE_COIL_OUT_TO_N20VDC_TEST_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.30.2|TWO|W1_P3_51_W1_P4_22|9.9E+10|9.9E+40 +W4_CAGE_COIL_OUT_TO_P20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.25.1,0.35.2|TWO|W1_P3_51_W1_P4_28|9.9E+10|9.9E+40 + +; W4 AUD_GDNC_FILTER Isolation checks +W4_AUD_GDNC_FILTER_TO_POWER_RETURN_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.24.2|TWO|W1_P3_52_W1_P4_15|9.9E+10|9.9E+40 +W4_AUD_GDNC_FILTER_TO_N20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.26.2|TWO|W1_P3_52_W1_P4_17|9.9E+10|9.9E+40 +W4_AUD_GDNC_FILTER_TO_POWER_RETURN_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.27.2|TWO|W1_P3_52_W1_P4_19|9.9E+10|9.9E+40 +W4_AUD_GDNC_FILTER_TO_POWER_RETURN_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.28.2|TWO|W1_P3_52_W1_P4_20|9.9E+10|9.9E+40 +W4_AUD_GDNC_FILTER_TO_N20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.29.2|TWO|W1_P3_52_W1_P4_21|9.9E+10|9.9E+40 +W4_AUD_GDNC_FILTER_TO_N20VDC_TEST_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.30.2|TWO|W1_P3_52_W1_P4_22|9.9E+10|9.9E+40 +W4_AUD_GDNC_FILTER_TO_P20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.32.2|TWO|W1_P3_52_W1_P4_24|9.9E+10|9.9E+40 +W4_AUD_GDNC_FILTER_TO_P20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.35.2|TWO|W1_P3_52_W1_P4_28|9.9E+10|9.9E+40 + +; W4 AUDIO_OUTPUT_LOW Isolation checks +W4_AUDIO_OUTPUT_LOW_TO_N20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.26.2|TWO|W1_P3_8_W1_P4_17|9.9E+10|9.9E+40 +W4_AUDIO_OUTPUT_LOW_TO_POWER_RETURN_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.27.2|TWO|W1_P3_8_W1_P4_19|9.9E+10|9.9E+40 +W4_AUDIO_OUTPUT_LOW_TO_POWER_RETURN_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.28.2|TWO|W1_P3_8_W1_P4_20|9.9E+10|9.9E+40 +W4_AUDIO_OUTPUT_LOW_TO_N20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.29.2|TWO|W1_P3_8_W1_P4_21|9.9E+10|9.9E+40 +W4_AUDIO_OUTPUT_LOW_TO_N20VDC_TEST_3 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.30.2|TWO|W1_P3_8_W1_P4_22|9.9E+10|9.9E+40 +W4_AUDIO_OUTPUT_LOW_TO_P20VDC_TEST_1 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.32.2|TWO|W1_P3_8_W1_P4_24|9.9E+10|9.9E+40 +W4_AUDIO_OUTPUT_LOW_TO_P20VDC_TEST_2 = NO_PCODE|-1|0.001|100|100|1|PICKERING_SWITCH_MATRIX_64X4:0.54.1,0.35.2|TWO|W1_P3_8_W1_P4_28|9.9E+10|9.9E+40 + +;format is name = range|resolution|delay(ms)|scale factor|relays +[DmmReadVoltage] +V1 = 100|0.01|1|1|PICKERING_RELAY_SWITCH_16CH:65|DC + +;format is name = relays|channelNumber|edge|timePerDivision|timeOffset(S)|triggerLevel|voltageOffset(V)|voltageScale(V)|InputImpedance|Delay After Closing Relays(ms)|ShallImageBeSaved (True or False)|Max trigger Wait Time (ms) +;edge can be FALLING or RISING or HOLDING +[ScopeReadFrequency] +F1 = PICKERING_RELAY_SWITCH_16CH:56,57|2|FALLING|1.0|2.0|3.0|4.0|5.0|DC|100|False|1500 +F2 = PICKERING_RELAY_SWITCH_16CH:56,57|2|FALLING|1.0|2.0|3.0|4.0|5.0|DC|100|False|1500 + +;format is name = relays|channelNumber|edge|timePerDivision|timeOffset(S)|triggerLevel|voltageOffset(V)|voltageScale(V)|InputImpedance|Delay After Closing Relays(ms)|ShallImageBeSaved (True or False)|Max trigger Wait Time (ms) +;edge can be FALLING or RISING or HOLDING +[ScopeReadPulseWidth] +P1 = PICKERING_RELAY_SWITCH_16CH:56,57|2|FALLING|1.0|2.0|3.0|4.0|5.0|DC|100|False|1500 +P2 = PICKERING_RELAY_SWITCH_16CH:56,-57|2|FALLING|1.0|2.0|3.0|4.0|5.0|DC|100|False|1500 + +; define all the relays we want to control +[RELAYS] +R1 = PICKERING_RELAY_SWITCH_16CH:65 +R2 = PICKERING_RELAY_SWITCH_16CH:66 \ No newline at end of file diff --git a/Source/Program/ConfigFiles/Sim/MTS/ProgramSpecific.ini b/Source/Program/ConfigFiles/Sim/MTS/ProgramSpecific.ini new file mode 100644 index 0000000..898165a --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/ProgramSpecific.ini @@ -0,0 +1,756 @@ +[GENERAL] +; specify data folder and all subfolders in it +PRIMARY_DRIVE = D:\ +SECONDARY_DRIVE = C:\ +DATA_BASE_FOLDER = Data_NGSRI +DATA_GENERAL_FOLDER_NAME = General +DATA_GENERAL_TEMP_FOLDER_NAME = Temp + +; this is the path where formal ATP runs use to run MTS software +APP_RELEASE_CONTROLLED_FOLDER = Release_NGSRI + +LOG_DASHBOARD_APP_PATH = Release_NGSRI\LogDashboard\Raytheon.LogDashboard.exe + +; make sure self test is run before powering on UUT +; value: true or false +ENFORCE_CABLE_SELF_TEST_IS_RUN = TRUE + +[UUT_INFO] +UUT_IP_ADDRESS = localhost +UUT_TEST_PORT_TCP = 5025 + +[CABLE_ID_RELAYS] +W1_CABLE_PART_NUMBER = W1_CABLE_PART_NUMBER +W1_CABLE_SERIAL_NUMBER = W1_CABLE_SERIAL_NUMBER +W2_CABLE_PART_NUMBER = W2_CABLE_PART_NUMBER +W2_CABLE_SERIAL_NUMBER = W2_CABLE_SERIAL_NUMBER +W3_CABLE_PART_NUMBER = W3_CABLE_PART_NUMBER +W3_CABLE_SERIAL_NUMBER = W3_CABLE_SERIAL_NUMBER +W4_CABLE_PART_NUMBER = W4_CABLE_PART_NUMBER +W4_CABLE_SERIAL_NUMBER = W4_CABLE_SERIAL_NUMBER +W5_CABLE_PART_NUMBER = W5_CABLE_PART_NUMBER +W5_CABLE_SERIAL_NUMBER = W5_CABLE_SERIAL_NUMBER + +;===================================================================================================================== + +[POLL_RATES] +; seconds +POWER_SUPPLY_LOG_RATE = 1 +; seconds +POWER_SUPPLY_READ_RATE = 1 +; seconds +PASSTHROUGH_DATA_UPDATE_RATE = 1 + +;===================================================================================================================== + +[FILE_NAMES] +POWER_SUPPLY_LOG_PREFIX = PowerSupplyLog +POWER_SUPPLY_LOG_FILE_EXTENSION = csv + +;===================================================================================================================== + +[POWER_MODULES_TO_BE_POWERED] +MODULE_1 = P20V +MODULE_2 = N20V + +[POWER_MODULES_TO_BE_DISPLAYED] +MODULE_1 = P20V +MODULE_2 = N20V + +;===================================================================================================================== + +[UART_INFO] +SERIAL_DEVICE_INSTANCE_NAME = SERIAL_COM_PORT_1 + +;===================================================================================================================== + +[PBIT_INFO] +SUCCESSFUL_PBIT_AGGREGATE_VALUE = 0x3F + +;===================================================================================================================== + +[W3_STTO] +R01 = W3_AUD_GDNC_FILTER +R02 = W3_TIMER_START +R03 = W3_SIGNAL_RETURN +R04 = W3_GEU_TO_EMULATOR_UART +R05 = W3_POWER_RETURN_1 +R06 = W3_POWER_RETURN_2 +R07 = W3_POWER_RETURN_3 +R08 = W3_P20VDC_TEST +R09 = W3_P20VDC_TEST_TO_POWER_RETURN +R10 = W3_N20VDC_TEST_1 +R11 = W3_N20VDC_TEST_2 +R12 = W3_N20VDC_TEST_3 +R13 = W3_N20VDC_TEST_TO_POWER_RETURN +R14 = W3_P20VDC_TEST_TO_N20VDC_TEST +R15 = W3_P20VDC_TEST_TO_N20VDC_TEST_2 +R16 = W3_ARM_IFC_SQUIB_N +R17 = W3_ARM_IFC_SQUIB_P_TO_ARM_IFC_SQUIB_N +R18 = W3_BATTERY_ACTIVATE_P3 +R19 = W3_LAUNCHER_INTERLOCK +R20 = W3_FUZE_INTERLOCK +R21 = W3_BATTERY_ACTIVATE_P2_TO_LAUNCHER_INTERLOCK +R22 = W3_BATTERY_ACTIVATE_P2_TO_FUZE_INTERLOCK + +; ; W3 AUD_GDNC_FILTER Isolation checks +R23 = W3_AUD_GDNC_FILTER_TO_POWER_RETURN_1 +R24 = W3_AUD_GDNC_FILTER_TO_N20VDC_TEST_1 +R25 = W3_AUD_GDNC_FILTER_TO_POWER_RETURN_2 +R26 = W3_AUD_GDNC_FILTER_TO_POWER_RETURN_3 +R27 = W3_AUD_GDNC_FILTER_TO_N20VDC_TEST_2 +R28 = W3_AUD_GDNC_FILTER_TO_N20VDC_TEST_3 +R29 = W3_AUD_GDNC_FILTER_TO_P20VDC_TEST_1 +R30 = W3_AUD_GDNC_FILTER_TO_P20VDC_TEST_2 + +;===================================================================================================================== + +[W4_STTO] +R01 = W4_LAUNCH_MOTOR_INIT_1 +R02 = W4_LAUNCH_MOTOR_INIT_2 +R03 = W4_BATTERY_INIT_1 +R04 = W4_BATTERY_INIT_2 +R05 = W4_LIE_N20V +R06 = W4_CAGE_COIL_OUT +R07 = W4_AUD_GDNC_FILTER +R08 = W4_AUDIO_OUTPUT_LOW + +; W4 CAGE_COIL_OUT Isolation checks +; R09 = W4_CAGE_COIL_OUT_TO_POWER_RETURN_1 +; R10 = W4_CAGE_COIL_OUT_TO_N20VDC_TEST_1 +; R11 = W4_CAGE_COIL_OUT_TO_POWER_RETURN_2 +; R12 = W4_CAGE_COIL_OUT_TO_POWER_RETURN_3 +; R13 = W4_CAGE_COIL_OUT_TO_N20VDC_TEST_2 +; R14 = W4_CAGE_COIL_OUT_TO_N20VDC_TEST_3 +; R15 = W4_CAGE_COIL_OUT_TO_P20VDC_TEST_2 + +; W4 AUD_GDNC_FILTER Isolation checks +; R16 = W4_AUD_GDNC_FILTER_TO_POWER_RETURN_1 +; R17 = W4_AUD_GDNC_FILTER_TO_N20VDC_TEST_1 +; R18 = W4_AUD_GDNC_FILTER_TO_POWER_RETURN_2 +; R19 = W4_AUD_GDNC_FILTER_TO_POWER_RETURN_3 +; R20 = W4_AUD_GDNC_FILTER_TO_N20VDC_TEST_2 +; R21 = W4_AUD_GDNC_FILTER_TO_N20VDC_TEST_3 +; R22 = W4_AUD_GDNC_FILTER_TO_P20VDC_TEST_1 +; R23 = W4_AUD_GDNC_FILTER_TO_P20VDC_TEST_2 + +; W4 AUDIO_OUTPUT_LOW Isolation checks +; R24 = W4_AUDIO_OUTPUT_LOW_TO_N20VDC_TEST_1 +; R25 = W4_AUDIO_OUTPUT_LOW_TO_POWER_RETURN_2 +; R26 = W4_AUDIO_OUTPUT_LOW_TO_POWER_RETURN_3 +; R27 = W4_AUDIO_OUTPUT_LOW_TO_N20VDC_TEST_2 +; R28 = W4_AUDIO_OUTPUT_LOW_TO_N20VDC_TEST_3 +; R29 = W4_AUDIO_OUTPUT_LOW_TO_P20VDC_TEST_1 +; R30 = W4_AUDIO_OUTPUT_LOW_TO_P20VDC_TEST_2 + +;===================================================================================================================== + +[TestModeMsg] +DATA_1 = TestMode,MODE,SHCK,1 + +[MSFRParameterMsg] +TEST_CASE_1 = Open Loop Polarity - Roll Channel,TestMode,MSFR,1,1,0,0,0,4,1,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,10,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_2 = Open Loop Polarity - Pitch Channel,TestMode,MSFR,1,1,0,0,0,5,1,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,10,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_3 = Open Loop Polarity - Yaw Channel,TestMode,MSFR,1,1,0,0,0,6,1,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,10,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_4 = Open Loop Polarity - Gimbal Channel,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,0.5,0,0.087266463,0.087266463,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_5 = Open Loop Test - Gimbal Stabilized,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_6a = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_6b = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_6c = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_6d = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_6e = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_6f = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_6g = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_6h = Closed Loop Test - Isolated Roll,TestMode,MSFR,1,1,1,0,0,4,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_7a = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_7b = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_7c = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_7d = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_7e = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_7f = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_7g = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_7h = Closed Loop Test - Isolated Pitch,TestMode,MSFR,1,1,1,0,0,5,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_8a = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_8b = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_8c = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_8d = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_8e = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_8f = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_8g = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_8h = Closed Loop Test - Isolated Yaw,TestMode,MSFR,1,1,1,0,0,6,0,0,0,0,0,1,0,1,0,1,20,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_9a = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_9b = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_9c = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_9d = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_9e = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_9f = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_9g = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_9h = Closed Loop Polarity Test - Roll,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_10a = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_10b = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_10c = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_10d = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_10e = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_10f = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_10g = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_10h = Closed Loop Polarity Test - Pitch,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_11a = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_11b = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_11c = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_11d = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_11e = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_11f = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_11g = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_11h = Closed Loop Polarity Test - Yaw,TestMode,MSFR,1,1,1,0,0,2,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_12a = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_12b = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_12c = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_12d = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_12e = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_12f = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_12g = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_12h = Closed Loop Polarity Test - Gimbal Closed,TestMode,MSFR,1,1,1,0,0,1,0,0,0,0,0,1,0,1,0,1,60,0.5,0.5,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_13a = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_13b = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_13c = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_13d = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_13e = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_13f = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_13g = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_13h = Frequency Response - Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_14a = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_14b = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_14c = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_14d = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_14e = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_14f = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_14g = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_14h = Frequency Response - Pitch - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_15a = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_15b = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_15c = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_15d = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_15e = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_15f = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_15g = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_15h = Frequency Response - Yaw - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_16a = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_16b = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_16c = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_16d = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_16e = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_16f = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_16g = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_16h = Frequency Response - Gimbal Roll - Log Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_17a = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_17b = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_17c = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_17d = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_17e = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_17f = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_17g = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_17h = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_18a = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_18b = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_18c = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_18d = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_18e = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_18f = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_18g = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_18h = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_19a = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_19b = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_19c = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_19d = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_19e = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_19f = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_19g = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_19h = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,75,95,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_20a = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,75,95,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_20b = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,75,95,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_20c = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,75,95,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_20d = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,75,95,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_20e = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,75,95,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_20f = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,75,95,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_20g = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,75,95,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_20h = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,75,95,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_21a = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_21b = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_21c = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_21d = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_21e = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_21f = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_21g = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_21h = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_22a = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_22b = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_22c = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_22d = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_22e = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_22f = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_22g = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_22h = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_23a = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_23b = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_23c = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_23d = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_23e = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_23f = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_23g = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_23h = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,200,220,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_24a = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,200,220,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_24b = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,200,220,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_24c = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,200,220,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_24d = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,200,220,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_24e = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,200,220,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_24f = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,200,220,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_24g = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,200,220,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_24h = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,200,220,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_25a = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_25b = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_25c = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_25d = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_25e = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_25f = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_25g = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_25h = Frequency Response - Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_26a = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_26b = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_26c = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_26d = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_26e = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_26f = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_26g = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_26h = Frequency Response - Pitch - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_27a = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_27b = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_27c = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_27d = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_27e = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_27f = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_27g = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_27h = Frequency Response - Yaw - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,245,265,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_28a = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,245,265,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_28b = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,245,265,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_28c = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,245,265,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_28d = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,245,265,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_28e = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,245,265,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_28f = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,245,265,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_28g = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,245,265,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_28h = Frequency Response - Gimbal Roll - Linear Chirp - Empty,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,245,265,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_29a = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_29b = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_29c = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_29d = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_29e = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_29f = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_29g = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_29h = Frequency Response - Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_30a = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_30b = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_30c = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_30d = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_30e = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_30f = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_30g = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_30h = Frequency Response - Pitch - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_31a = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_31b = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_31c = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_31d = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_31e = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_31f = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_31g = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_31h = Frequency Response - Yaw - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,4,0,0,0,0,1,0,1,0,1,20,0.5,500,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_32a = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_32b = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_32c = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_32d = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_32e = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_32f = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_32g = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_32h = Frequency Response - Gimbal Roll - Log Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,0.5,500,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_33a = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_33b = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_33c = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_33d = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_33e = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_33f = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_33g = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_33h = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_34a = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_34b = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_34c = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_34d = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_34e = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_34f = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_34g = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_34h = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_35a = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_35b = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_35c = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_35d = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_35e = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_35f = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_35g = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_35h = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,92,112,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_36a = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,92,112,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_36b = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,92,112,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_36c = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,92,112,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_36d = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,92,112,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_36e = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,92,112,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_36f = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,92,112,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_36g = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,92,112,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_36h = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,92,112,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_37a = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_37b = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_37c = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_37d = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_37e = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_37f = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_37g = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_37h = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_38a = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_38b = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_38c = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_38d = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_38e = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_38f = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_38g = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_38h = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_39a = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_39b = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_39c = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_39d = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_39e = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_39f = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_39g = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_39h = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,206,226,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_40a = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,206,226,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_40b = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,206,226,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_40c = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,206,226,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_40d = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,206,226,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_40e = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,206,226,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_40f = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,206,226,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_40g = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,206,226,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_40h = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,206,226,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_41a = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_41b = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_41c = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_41d = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_41e = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_41f = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_41g = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_41h = Frequency Response - Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,4,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_42a = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_42b = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_42c = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_42d = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_42e = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_42f = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_42g = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_42h = Frequency Response - Pitch - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,5,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_43a = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_43b = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_43c = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_43d = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_43e = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_43f = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_43g = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_43h = Frequency Response - Yaw - linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,6,3,0,0,0,0,1,0,1,0,1,20,230,250,0,5,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_44a = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,230,250,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,-0.1745329,30 +TEST_CASE_44b = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,230,250,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0.7853982,-0.1745329,30 +TEST_CASE_44c = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,230,250,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,1.570796,-0.1745329,30 +TEST_CASE_44d = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,230,250,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,2.356194,-0.1745329,30 +TEST_CASE_44e = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,230,250,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.141593,-0.1745329,30 +TEST_CASE_44f = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,230,250,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,3.926991,-0.1745329,30 +TEST_CASE_44g = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,230,250,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,4.712389,-0.1745329,30 +TEST_CASE_44h = Frequency Response - Gimbal Roll - Linear Chirp - Full,TestMode,MSFR,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,4,20,230,250,0,0.017453293,0.017453293,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,5.497787,-0.1745329,30 +TEST_CASE_45a = Gain Margin Test - Iso Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_46a = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_45b = Gain Margin Test - Iso Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_46b = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_45c = Gain Margin Test - Iso Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_46c = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_45d = Gain Margin Test - Iso Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_46d = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_45e = Gain Margin Test - Iso Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_46e = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_45f = Gain Margin Test - Iso Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_46f = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_45g = Gain Margin Test - Iso Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_46g = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_45h = Gain Margin Test - Iso Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_46h = Gain Margin Test - Iso Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_47a = Gain Margin Test - Iso Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_48a = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_47b = Gain Margin Test - Iso Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_48b = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_47c = Gain Margin Test - Iso Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_48c = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_47d = Gain Margin Test - Iso Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_48d = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_47e = Gain Margin Test - Iso Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_48e = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_47f = Gain Margin Test - Iso Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_48f = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_47g = Gain Margin Test - Iso Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_48g = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_47h = Gain Margin Test - Iso Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_48h = Gain Margin Test - Iso Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_49a = Gain Margin Test - Iso Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_50a = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_49b = Gain Margin Test - Iso Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_50b = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_49c = Gain Margin Test - Iso Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_50c = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_49d = Gain Margin Test - Iso Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_50d = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_49e = Gain Margin Test - Iso Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_50e = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_49f = Gain Margin Test - Iso Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_50f = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_49g = Gain Margin Test - Iso Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_50g = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_49h = Gain Margin Test - Iso Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_50h = Gain Margin Test - Iso Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_51a = Gain Margin Test - Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_52a = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_51b = Gain Margin Test - Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_52b = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_51c = Gain Margin Test - Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_52c = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_51d = Gain Margin Test - Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_52d = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_51e = Gain Margin Test - Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_52e = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_51f = Gain Margin Test - Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_52f = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_51g = Gain Margin Test - Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_52g = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_51h = Gain Margin Test - Roll - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_52h = Gain Margin Test - Roll - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_53a = Gain Margin Test - Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_54a = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_53b = Gain Margin Test - Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_54b = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_53c = Gain Margin Test - Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_54c = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_53d = Gain Margin Test - Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_54d = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_53e = Gain Margin Test - Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_54e = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_53f = Gain Margin Test - Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_54f = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_53g = Gain Margin Test - Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_54g = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_53h = Gain Margin Test - Pitch - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_54h = Gain Margin Test - Pitch - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_55a = Gain Margin Test - Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_56a = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_55b = Gain Margin Test - Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_56b = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_55c = Gain Margin Test - Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_56c = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_55d = Gain Margin Test - Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_56d = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_55e = Gain Margin Test - Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_56e = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_55f = Gain Margin Test - Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_56f = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_55g = Gain Margin Test - Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_56g = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_55h = Gain Margin Test - Yaw - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_56h = Gain Margin Test - Yaw - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_57a = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_58a = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_57b = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_58b = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_57c = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_58c = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_57d = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_58d = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_57e = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_58e = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_57f = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_58f = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_57g = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_58g = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_57h = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_58h = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_59a = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_60a = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_59b = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_60b = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_59c = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_60c = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_59d = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_60d = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_59e = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_60e = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_59f = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_60f = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_59g = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_60g = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_59h = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_60h = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_61a = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_62a = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_61b = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_62b = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_61c = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_62c = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_61d = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_62d = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_61e = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_62e = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_61f = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_62f = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_61g = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_62g = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_61h = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_62h = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Full,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_63a = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_64a = Gain Margin Test - Iso Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_63b = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_64b = Gain Margin Test - Iso Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_63c = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_64c = Gain Margin Test - Iso Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_63d = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_64d = Gain Margin Test - Iso Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_63e = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_64e = Gain Margin Test - Iso Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_63f = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_64f = Gain Margin Test - Iso Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_63g = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_64g = Gain Margin Test - Iso Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_63h = Gain Margin Test - Iso Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_64h = Gain Margin Test - Iso Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,4,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_65a = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_66a = Gain Margin Test - Iso Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_65b = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_66b = Gain Margin Test - Iso Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_65c = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_66c = Gain Margin Test - Iso Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_65d = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_66d = Gain Margin Test - Iso Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_65e = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_66e = Gain Margin Test - Iso Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_65f = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_66f = Gain Margin Test - Iso Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_65g = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_66g = Gain Margin Test - Iso Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_65h = Gain Margin Test - Iso Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_66h = Gain Margin Test - Iso Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,5,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_67a = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_68a = Gain Margin Test - Iso Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_67b = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_68b = Gain Margin Test - Iso Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_67c = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_68c = Gain Margin Test - Iso Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_67d = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_68d = Gain Margin Test - Iso Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_67e = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_68e = Gain Margin Test - Iso Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_67f = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_68f = Gain Margin Test - Iso Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_67g = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_68g = Gain Margin Test - Iso Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_67h = Gain Margin Test - Iso Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_68h = Gain Margin Test - Iso Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,6,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_69a = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_70a = Gain Margin Test - Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_69b = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_70b = Gain Margin Test - Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_69c = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_70c = Gain Margin Test - Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_69d = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_70d = Gain Margin Test - Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_69e = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_70e = Gain Margin Test - Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_69f = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_70f = Gain Margin Test - Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_69g = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_70g = Gain Margin Test - Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_69h = Gain Margin Test - Roll - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_70h = Gain Margin Test - Roll - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_71a = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_72a = Gain Margin Test - Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_71b = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_72b = Gain Margin Test - Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_71c = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_72c = Gain Margin Test - Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_71d = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_72d = Gain Margin Test - Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_71e = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_72e = Gain Margin Test - Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_71f = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_72f = Gain Margin Test - Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_71g = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_72g = Gain Margin Test - Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_71h = Gain Margin Test - Pitch - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_72h = Gain Margin Test - Pitch - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_73a = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_74a = Gain Margin Test - Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0,-0.1745329,0 +TEST_CASE_73b = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_74b = Gain Margin Test - Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,0.7853982,-0.1745329,0 +TEST_CASE_73c = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_74c = Gain Margin Test - Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,1.570796,-0.1745329,0 +TEST_CASE_73d = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_74d = Gain Margin Test - Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,2.356194,-0.1745329,0 +TEST_CASE_73e = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_74e = Gain Margin Test - Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.141593,-0.1745329,0 +TEST_CASE_73f = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_74f = Gain Margin Test - Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,3.926991,-0.1745329,0 +TEST_CASE_73g = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_74g = Gain Margin Test - Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,4.712389,-0.1745329,0 +TEST_CASE_73h = Gain Margin Test - Yaw - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_74h = Gain Margin Test - Yaw - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,18,5.497787,-0.1745329,0 +TEST_CASE_75a = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_76a = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_75b = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_76b = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_75c = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_76c = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_75d = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_76d = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_75e = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_76e = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_75f = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_76f = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_75g = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_76g = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_75h = Gain Margin Test - Roll - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_76h = Gain Margin Test - Roll - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,1,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_77a = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_78a = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_77b = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_78b = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_77c = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_78c = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_77d = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_78d = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_77e = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_78e = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_77f = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_78f = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_77g = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_78g = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_77h = Gain Margin Test - Pitch - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_78h = Gain Margin Test - Pitch - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,2,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_79a = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_80a = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0,-0.1745329,0 +TEST_CASE_79b = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_80b = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,0.7853982,-0.1745329,0 +TEST_CASE_79c = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_80c = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,1.570796,-0.1745329,0 +TEST_CASE_79d = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_80d = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,2.356194,-0.1745329,0 +TEST_CASE_79e = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_80e = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.141593,-0.1745329,0 +TEST_CASE_79f = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_80f = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,3.926991,-0.1745329,0 +TEST_CASE_79g = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_80g = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,4.712389,-0.1745329,0 +TEST_CASE_79h = Gain Margin Test - Yaw - Stabilized Gimbal - P0 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 +TEST_CASE_80h = Gain Margin Test - Yaw - Stabilized Gimbal - P6 dB - Empty,TestMode,MSFR,1,1,1,0,0,3,12,0,0,0,0,1,0,6,4000,1,39.999,0.5,0.5,0,0,0,0,0,5,6,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0.6,0,0,0,0,7,5.497787,-0.1745329,0 diff --git a/Source/Program/ConfigFiles/Sim/MTS/UutTestMessages.xml b/Source/Program/ConfigFiles/Sim/MTS/UutTestMessages.xml new file mode 100644 index 0000000..fcb86f1 --- /dev/null +++ b/Source/Program/ConfigFiles/Sim/MTS/UutTestMessages.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Program/DataDef/Coe.Datatypes.cs b/Source/Program/DataDef/Coe.Datatypes.cs new file mode 100644 index 0000000..45e2a99 --- /dev/null +++ b/Source/Program/DataDef/Coe.Datatypes.cs @@ -0,0 +1,45 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ + +namespace ProgramLib +{ + /// + /// Define all complex data types here for COE messaging + /// + internal static class Coe + { + // got this from SW\Algorithms\ngsri\MissionManager\Algorithm\MissionManagerTypes.hpp + // repo: https://tfs.rms.ray.com/LWS/NGSRI/_git/MissileKit2.NGSRI + public enum MmgrState + { + INIT, // Initialization including Power-on Bit + COOL_DOWN, // TODO: Remove as this will be covered by PBit test + CALIBRATION, + ACQUISITION, + PRELAUNCH, + COMMIT, + LAUNCH, + MIDCOURSE, + TERMINAL, + ENDGAME, // Final nominal state + SELF_DESTRUCT, // Off-nominal state to abort the mission post-launch + + NOT_SET // this must be last + }; + } +} diff --git a/Source/Program/DataDef/PowerSupplyData.cs b/Source/Program/DataDef/PowerSupplyData.cs index 060d05e..a51200b 100644 --- a/Source/Program/DataDef/PowerSupplyData.cs +++ b/Source/Program/DataDef/PowerSupplyData.cs @@ -1,4 +1,21 @@ -using Raytheon.Instruments.PowerSupply; +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using Raytheon.Instruments.PowerSupply; namespace ProgramLib { @@ -8,7 +25,7 @@ namespace ProgramLib internal class PowerSupplyData { public double Voltage { get; set; } - public double Current { get; set; } + public double Current { get; set; } public PowerSupplyModuleInfo PowerSupplyModuleInfo { get; set; } public bool Initialized { get; set; } diff --git a/Source/Program/DataDef/PowerSupplySharedData.cs b/Source/Program/DataDef/PowerSupplySharedData.cs index 746b7bd..491efd4 100644 --- a/Source/Program/DataDef/PowerSupplySharedData.cs +++ b/Source/Program/DataDef/PowerSupplySharedData.cs @@ -1,4 +1,22 @@ -using System.Collections.Generic; +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; using Raytheon.Instruments.PowerSupply; namespace ProgramLib @@ -9,7 +27,7 @@ namespace ProgramLib internal class PowerSupplySharedData { private object syncObj = new object(); - private Dictionary syncObjDict = new Dictionary(); + private Dictionary syncObjDict = new Dictionary(); private Dictionary _powerSupplyDataDict = new Dictionary(); /// @@ -65,6 +83,21 @@ namespace ProgramLib } } + /// + /// Get all power modules + /// + public List GetAllPowerModules() + { + List powerModuleList = new List(); + + lock (syncObj) + { + powerModuleList = _powerSupplyDataDict.Keys.ToList(); + } + + return powerModuleList; + } + /// /// Set each power supply data to uninialized /// diff --git a/Source/Program/Program.FunctionalTests.cs b/Source/Program/DataDef/TestInfo.cs similarity index 60% rename from Source/Program/Program.FunctionalTests.cs rename to Source/Program/DataDef/TestInfo.cs index 0f564f0..59b6a9f 100644 --- a/Source/Program/Program.FunctionalTests.cs +++ b/Source/Program/DataDef/TestInfo.cs @@ -20,27 +20,26 @@ using System; namespace ProgramLib { /// - /// Partial class that define all the Functional Tests for all the Functional Test Requirements in the TRD - /// - public partial class Program + /// Store test information + /// + internal class TestInfo { - /// - /// GMA_ATP_001 - Perform UUT Safe-to-turn-on - /// - public void Perform_GMA_ATP_001_UUT_STTO() - { - try - { - BasicTest test = new GMA_ATP_001_UUT_STTO(); - test.RunTest(); + // class variables + public string TestType { get; set; } + public string TestOperator { get; set; } + public string TestName { get; set; } + public DateTime TestStartDateTime { get; set; } - } - catch (Exception ex) - { - // DO NOT THROW in this block - // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand - TerminateTestOnMainThreadError(ex); - } + /// + /// The constructor + /// + public TestInfo(string testType, string testName, string testOperator = "DefaultTestOperator", DateTime testStartTime = default) + { + TestType = testType; + TestName = testName; + TestOperator = testOperator; + TestStartDateTime = testStartTime; } + } } diff --git a/Source/Program/DataDef/UartMessages.cs b/Source/Program/DataDef/UartMessages.cs new file mode 100644 index 0000000..6c88467 --- /dev/null +++ b/Source/Program/DataDef/UartMessages.cs @@ -0,0 +1,79 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Runtime.InteropServices; + +namespace ProgramLib +{ + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct UartHandshakeMessage + { + public byte Id { get; set; } + public UInt64 Pattern1 { get; set; } + public UInt64 Pattern2 { get; set; } + public byte Checksum { get; set; } + + public UartHandshakeMessage(UInt64 pattern1, UInt64 pattern2) + { + Id = 0x0C; + Pattern1 = pattern1; + Pattern2 = pattern2; + Checksum = 0; + } + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct UartAckNackMessage + { + public byte Id { get; set; } + public byte AckId { get; set; } + public byte Ack { get; set; } + public byte Checksum { get; set; } + + public UartAckNackMessage(byte ackId, byte ack) + { + Id = 0x03; + AckId = ackId; + Ack = ack; + Checksum = 0; + } + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct UartPbitResultMessage + { + public byte Id { get; set; } + public byte PbitFinalResult { get; set; } + public UInt16 PbitAggregate { get; set; } + public Int16 GspTemp { get; set; } + public UInt32 LifetimeTime { get; set; } + public byte LifetimeCount { get; set; } + public byte Checksum { get; set; } + + public UartPbitResultMessage() + { + Id = 0xC0; + PbitFinalResult = 0; + PbitAggregate = 0; + GspTemp = 0; + LifetimeTime = 0; + LifetimeCount = 0; + Checksum = 0; + } + } +} diff --git a/Source/Program/DataDef/UutInfo.cs b/Source/Program/DataDef/UutInfo.cs new file mode 100644 index 0000000..837faae --- /dev/null +++ b/Source/Program/DataDef/UutInfo.cs @@ -0,0 +1,148 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml.XPath; + +namespace ProgramLib +{ + /// + /// Store UUT information + /// + internal class UutInfo + { + public enum UniversalCable + { + W1, + W2, + NOT_SET + } + + public enum BuildLevel + { + GMA, + AUR, + SELF_TEST, + NOT_SET + } + + public enum SacrificialCable + { + W3, + W4, + NOT_SET + } + + // class variables + public string PartNumber { get; private set; } + public string SerialNumber { get; private set; } + public BuildLevel UutBuildLevel { get; set; } + public UniversalCable UniversalCableId { get; set; } + public SacrificialCable SacrificialCableId { get; set; } + public Dictionary> UutTestMessageDict { get; set; } + public string UutTestMessageConfigFilePath { get; private set; } + + /// + /// The constructor + /// + public UutInfo(string partNumber, string serialNumber) + { + PartNumber = partNumber; + SerialNumber = serialNumber; + + UutBuildLevel = BuildLevel.NOT_SET; + + UniversalCableId = UniversalCable.NOT_SET; + + SacrificialCableId = SacrificialCable.NOT_SET; + + UutTestMessageDict = new Dictionary>(StringComparer.OrdinalIgnoreCase); + } + + /// + /// Initialize + /// + public void Initialize() + { + ParseUutTestMessagesConfig(); + } + + /// + /// Parse UUT Test Messages Config + /// + private void ParseUutTestMessagesConfig() + { + string configFileName = Program.Instance().ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.UUT_TEST_MESSAGES_CONFIG_FILE_NAME.ToString()); + UutTestMessageConfigFilePath = Path.Combine(Program.Instance().FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.CONFIG), configFileName); + + if (File.Exists(UutTestMessageConfigFilePath)) + { + XPathDocument document = new XPathDocument(UutTestMessageConfigFilePath); + XPathNavigator nav = document.CreateNavigator(); + + // move to root node + nav.MoveToRoot(); + + // move to 1st and 2nd level node + if (nav.MoveToFirstChild() && nav.MoveToFirstChild()) + { + string messageName; + do + { + messageName = nav.GetAttribute("name", String.Empty); + + // move to 3rd level node + if (nav.MoveToFirstChild()) + { + UutTestMessageDict[messageName] = ProcessUutTestMessageData(nav); + + nav.MoveToParent(); + } + } while (nav.MoveToNext()); + } + } + } + + /// + /// Process uut test message data + /// + static List ProcessUutTestMessageData(XPathNavigator nav) + { + List messageDataFieldList = new List(); + UutTestMessageDataFieldInfo messageDataField; + + do + { + messageDataField = new UutTestMessageDataFieldInfo(); + messageDataField.Name = nav.GetAttribute("name", String.Empty); + if (Int32.TryParse(nav.GetAttribute("byte_count", String.Empty), out int byteCount)) + { + messageDataField.ByteCount = byteCount; + } + messageDataField.Type = nav.GetAttribute("type", String.Empty); + messageDataField.Value = nav.GetAttribute("value", String.Empty); + + messageDataFieldList.Add(messageDataField); + + } while (nav.MoveToNext()); + + return messageDataFieldList; + } + } +} diff --git a/Source/Program/DataDef/UutTestMessageDataFieldInfo.cs b/Source/Program/DataDef/UutTestMessageDataFieldInfo.cs new file mode 100644 index 0000000..e6d3bcc --- /dev/null +++ b/Source/Program/DataDef/UutTestMessageDataFieldInfo.cs @@ -0,0 +1,34 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +namespace ProgramLib +{ + /// + /// Definition for a UUT Test Message Data Field + /// + internal class UutTestMessageDataFieldInfo + { + public UutTestMessageDataFieldInfo() + { + } + + public string Name { get; set; } + public int ByteCount { get; set; } + public string Type { get; set; } + public string Value { get; set; } + } +} diff --git a/Source/Program/FunctionalTests/GMA_ATP_001_UUT_STTO.cs b/Source/Program/FunctionalTests/GMA_ATP_001_UUT_STTO.cs deleted file mode 100644 index dc9b5b3..0000000 --- a/Source/Program/FunctionalTests/GMA_ATP_001_UUT_STTO.cs +++ /dev/null @@ -1,206 +0,0 @@ -/*------------------------------------------------------------------------- -// UNCLASSIFIED -/*------------------------------------------------------------------------- -RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION -PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS -AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO -UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO -RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS -CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS -OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON -COMPANY. - -THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. -GOVERNMENT. - -UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. --------------------------------------------------------------------------*/ -using NLog; -using ProgramLib.GUI.Model; -using ProgramLib.GUI.View; -using ProgramLib.GUI.ViewModel; -using Raytheon.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; -using static MeasurementManagerLib.SwitchMeasurementManager; - -namespace ProgramLib -{ - /// - /// GMA/AUR TRD GMA_ATP_001 - UUT STTO - /// - internal class GMA_ATP_001_UUT_STTO : BasicTest - { - private readonly Dictionary _dmmResistanceMeasurements = new Dictionary(StringComparer.InvariantCultureIgnoreCase); - private List _relayExclusionList; - private static NLog.ILogger _logger; - - private bool _sttoSuccess = false; - private string fatalErrorMsg; - - public GMA_ATP_001_UUT_STTO() - { - _logger = LogManager.GetCurrentClassLogger(); - ParseMeasurementDef(); - } - - /// - /// Execute Test - /// - protected override void ExecuteTest() - { - Task.Factory.StartNew(() => PerformSttoTask()); - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].Dispatcher.Invoke((Action)delegate - { - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Hide(); - - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK].ShowDialog(); - }); - - Program.Instance().SttoSuccess = _sttoSuccess; - - if (!_sttoSuccess) - { - throw new Exception(fatalErrorMsg); - } - } - - /// - /// Check Pre Conditions - /// - protected override void CheckPrerequisite() - { - // add pre req checks as needed - } - - /// - /// Perform Safe-to-turn-on checks - /// - private void PerformSttoTask() - { - ImpedanceDataModel impedanceDataModel; - ImpedanceCheckWindow impedanceCheckWindow = (ImpedanceCheckWindow)ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.IMPEDANCE_CHECK]; - - try - { - _logger?.Debug($"{this.GetType().Name}::PerformSttoTask() running..."); - - _sttoSuccess = true; - string measurementStatus = "PASSED"; - - ImpedanceCheckWindowViewModel.Images passFailImage = ImpedanceCheckWindowViewModel.Images.PASS_CHECK; - impedanceCheckWindow.ViewModel.ClearData(); - - foreach (KeyValuePair measurement in _dmmResistanceMeasurements) - { - impedanceDataModel = new ImpedanceDataModel(); - double testResult = Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.DmmReadResistance(measurement.Key); - - if (testResult < measurement.Value._lowerLimit || testResult > measurement.Value._upperLimit) - { - passFailImage = ImpedanceCheckWindowViewModel.Images.FAIL_CHECK; - measurementStatus = "FAILED"; - _sttoSuccess = false; - } - - impedanceDataModel.PassFailImagePath = impedanceCheckWindow.ViewModel.ImageToResourcePathDict[passFailImage]; - impedanceDataModel.Description = $"{measurement.Value._cableAndPinId} Measured {testResult.ToString("0.00")} Range [{measurement.Value._lowerLimit},{measurement.Value._upperLimit}]"; - - if (Program.Instance().TestStandSeqContext != null) - { - Program.Instance().TestStandSeqContext.Step.AdditionalResults.CustomResults.Insert($"\"{measurement.Value._cableAndPinId}\"", $"\"Measured: {testResult.ToString("0.00")} Range [{measurement.Value._lowerLimit},{measurement.Value._upperLimit}] - {measurementStatus}\""); - } - - impedanceCheckWindow.ViewModel.AddData(impedanceDataModel); - - if (!_sttoSuccess) - { - fatalErrorMsg = impedanceDataModel.Description; - } - } - } - catch (Exception ex) - { - _logger.Error(ex.Message + "\n" + ex.StackTrace); - } - finally - { - if (!_sttoSuccess) - { - impedanceCheckWindow.Dispatcher.Invoke((Action)delegate - { - impedanceCheckWindow.btnClose.Visibility = Visibility.Visible; - }); - } - else - { - impedanceCheckWindow.Dispatcher.Invoke((Action)delegate - { - impedanceCheckWindow.Hide(); - }); - } - - _logger?.Debug($"{this.GetType().Name}::PerformSttoTask() exiting..."); - } - } - - /// - /// Parses the ini file for measurement definitions - /// Populates the Dictionaries with the enum names and ini file data - /// - private void ParseMeasurementDef() - { - const string MAIN_SECTION_NAME = "GMA_ATP_001_UUT_STTO"; - const string DMM_RESISTANCE_SECTION_NAME = $"{MAIN_SECTION_NAME}.DMM_RESISTANCE_MEASUREMENTS"; - const string RELAY_EXCLUSION_SECTION_NAME = $"{MAIN_SECTION_NAME}.RELAY_EXCLUSION_LIST"; - - const string EXCLUSION_LIST_KEY = "EXCLUSION_LIST"; - ConfigurationFile configurationFile = new ConfigurationFile(Program.Instance().TestMethodConfigFilePath); - - const char COMMA_DELIM = ','; - - // read in relay exclusion list - string relayExclusions = configurationFile.ReadValue(RELAY_EXCLUSION_SECTION_NAME, EXCLUSION_LIST_KEY); - _relayExclusionList = relayExclusions.Split(COMMA_DELIM).ToList(); - - for (int i = 0; i < _relayExclusionList.Count; ++i) - { - _relayExclusionList[i] = _relayExclusionList[i].TrimEnd(' '); - _relayExclusionList[i] = _relayExclusionList[i].TrimStart(' '); - } - - List keys = configurationFile.ReadAllKeys(DMM_RESISTANCE_SECTION_NAME); - foreach (string key in keys) - { - List valueList = configurationFile.ReadList(DMM_RESISTANCE_SECTION_NAME, key); - - int index = 0; - string pcode = valueList[index++]; - double range = Convert.ToDouble(valueList[index++]); - double res = Convert.ToDouble(valueList[index++]); - int delay = Convert.ToInt32(valueList[index++]); - double scaleFactor = Convert.ToDouble(valueList[index++]); - - List relayList = valueList[index++].Split(COMMA_DELIM).ToList(); - for (int i = 0; i < relayList.Count; ++i) - { - relayList[i] = relayList[i].Trim(); - } - - string resistanceTypeStr = valueList[index++].Trim(); - DMMResistanceType type = (DMMResistanceType)Enum.Parse(typeof(DMMResistanceType), resistanceTypeStr, true); - string cableAndPinId = valueList[index++]; - double lowerLimit = Convert.ToDouble(valueList[index++]); - double upperLimit = Convert.ToDouble(valueList[index++]); - - _dmmResistanceMeasurements.Add(key.ToUpper(), new DMMResistanceMeasurementFields(pcode, range, res, delay, scaleFactor, relayList, type, cableAndPinId, lowerLimit, upperLimit)); - } - - Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.DmmResistanceMeasurements = _dmmResistanceMeasurements; - Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.RelayExclusionList = _relayExclusionList; - } - } -} diff --git a/Source/Program/GUI/Common/Util.cs b/Source/Program/GUI/Common/Util.cs new file mode 100644 index 0000000..320b02c --- /dev/null +++ b/Source/Program/GUI/Common/Util.cs @@ -0,0 +1,58 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System.Globalization; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; + +namespace ProgramLib.GUI +{ + /// + /// Provides utility functions related to GUI + /// + internal class Util + { + public enum StandardButtons + { + OK_YES, + CANCEL_NO, + + NOT_SET + } + + /// + /// Calculate the width and height of a string in pixels. + /// This is useful if we want to resize window to fit dynamic text + /// + public static Size MeasureString(string text) + { + TextBlock tb = new TextBlock(); + var formattedText = new FormattedText( + text, + CultureInfo.CurrentCulture, + FlowDirection.LeftToRight, + new Typeface(tb.FontFamily, tb.FontStyle, tb.FontWeight, tb.FontStretch), + tb.FontSize, + Brushes.Black, + new NumberSubstitution(), + VisualTreeHelper.GetDpi(tb).PixelsPerDip); + + return new Size(formattedText.Width, formattedText.Height); + } + } +} diff --git a/Source/Program/GUI/Model/CoeMessageDataModel.cs b/Source/Program/GUI/Model/CoeMessageDataModel.cs new file mode 100644 index 0000000..da780c7 --- /dev/null +++ b/Source/Program/GUI/Model/CoeMessageDataModel.cs @@ -0,0 +1,54 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.ObjectModel; +using CommunityToolkit.Mvvm.ComponentModel; + +namespace ProgramLib.GUI.Model +{ + /// + /// Coe Message Data model used for data binding + /// + internal partial class CoeMessageDataModel : ObservableObject + { + [ObservableProperty] + private string name; + [ObservableProperty] + private string value; + [ObservableProperty] + private string type; + [ObservableProperty] + private string isFocusable; + [ObservableProperty] + private ObservableCollection subItems; + + public CoeMessageDataModel(string aName, string aValue, string aType) + { + name = aName; + value = aValue; + type = aType; + isFocusable = Boolean.TrueString; + subItems = new ObservableCollection(); + } + + public CoeMessageDataModel() + { + subItems = new ObservableCollection(); + } + } +} diff --git a/Source/Program/GUI/Model/ImpedanceDataModel.cs b/Source/Program/GUI/Model/ImpedanceDataModel.cs index 0442306..59d619c 100644 --- a/Source/Program/GUI/Model/ImpedanceDataModel.cs +++ b/Source/Program/GUI/Model/ImpedanceDataModel.cs @@ -1,7 +1,27 @@ -using CommunityToolkit.Mvvm.ComponentModel; +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using CommunityToolkit.Mvvm.ComponentModel; namespace ProgramLib.GUI.Model { + /// + /// Impedance Data model used for data binding + /// internal partial class ImpedanceDataModel : ObservableObject { [ObservableProperty] diff --git a/Source/Program/GUI/Model/PassthroughData.Types.cs b/Source/Program/GUI/Model/PassthroughData.Types.cs index 97d2e86..f3d3040 100644 --- a/Source/Program/GUI/Model/PassthroughData.Types.cs +++ b/Source/Program/GUI/Model/PassthroughData.Types.cs @@ -1,11 +1,27 @@ -using System; +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ProgramLib.GUI.Model { + /// + /// Data types for Passthrough Data model + /// internal partial class PassthroughData { private struct VariableInfo @@ -18,59 +34,24 @@ namespace ProgramLib.GUI.Model } public enum Variables { - VAR1, - VAR2, - VAR3, - VAR4, - VAR5, - VAR6, - VAR7, - VAR8, - VAR9, - VAR10, - VAR11, - VAR12, - VAR13, - VAR14, - VAR15, - VAR16, - VAR17, - VAR18, - VAR19, - VAR20, - VAR21, - VAR22, - VAR23, - VAR24, - VAR25, - VAR26, - VAR27, - VAR28, - VAR29, - VAR30, - VAR31, - VAR32, - VAR33, - VAR34, - VAR35, - VAR36, - VAR37, - VAR38, - VAR39, - VAR40, - VAR41, - VAR42, + VAR01, VAR02, VAR03, VAR04, VAR05, VAR06, + VAR07, VAR08, VAR09, VAR10, VAR11, VAR12, + VAR13, VAR14, VAR15, VAR16, VAR17, VAR18, + VAR19, VAR20, VAR21, VAR22, VAR23, VAR24, + VAR25, VAR26, VAR27, VAR28, VAR29, VAR30, + VAR31, VAR32, VAR33, VAR34, VAR35, VAR36, + VAR37, VAR38, VAR39, VAR40, VAR41, VAR42, }; private Dictionary _variableEnumToDescriptionDict = new Dictionary { - { Variables.VAR1, "IDA Temp" }, - { Variables.VAR2, "FPGA Temp" }, - { Variables.VAR3, "IDA Bias" }, - { Variables.VAR4, "TINT" }, - { Variables.VAR5, "Pitch" }, - { Variables.VAR6, "Yaw" }, - { Variables.VAR7, "Roll" }, + { Variables.VAR01, "IDA Temp" }, + { Variables.VAR02, "FPGA Temp" }, + { Variables.VAR03, "IDA Bias" }, + { Variables.VAR04, "TINT" }, + { Variables.VAR05, "Pitch" }, + { Variables.VAR06, "Yaw" }, + { Variables.VAR07, "Roll" }, }; } } diff --git a/Source/Program/GUI/Model/PassthroughData.cs b/Source/Program/GUI/Model/PassthroughData.cs index e98fb8c..10bd899 100644 --- a/Source/Program/GUI/Model/PassthroughData.cs +++ b/Source/Program/GUI/Model/PassthroughData.cs @@ -1,13 +1,29 @@ -using System; +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; namespace ProgramLib.GUI.Model { + /// + /// Passthrough Data model used for data binding + /// internal partial class PassthroughData { private int _datagridColumnCount = 0; @@ -49,15 +65,35 @@ namespace ProgramLib.GUI.Model } } + /// + /// Get data model dictionary + /// public Dictionary> GetPassthroughDataModelDict() { return _rowNumberToPassthroughDataDict; } + /// + /// Set value for a variable + /// public void SetValue(Variables variableName, string val) { _rowNumberToPassthroughDataDict[_variableEnumToVariableInfoDict[variableName].passthroughDataModelDictIndex][_variableEnumToVariableInfoDict[variableName].passthroughDataModelItemIndex] = _variableEnumToDescriptionDict[variableName]; _rowNumberToPassthroughDataDict[_variableEnumToVariableInfoDict[variableName].passthroughDataModelDictIndex][_variableEnumToVariableInfoDict[variableName].passthroughDataModelItemIndex + 1] = val; } + + /// + /// Blank all data for every variable + /// + public void BlankAllData() + { + foreach (KeyValuePair> item in _rowNumberToPassthroughDataDict) + { + for (int i = 0; i < item.Value.Count; i++) + { + item.Value[i] = ""; + } + } + } } } diff --git a/Source/Program/GUI/Model/PowerModuleDataModel.cs b/Source/Program/GUI/Model/PowerModuleDataModel.cs index 2b05df3..9665035 100644 --- a/Source/Program/GUI/Model/PowerModuleDataModel.cs +++ b/Source/Program/GUI/Model/PowerModuleDataModel.cs @@ -1,14 +1,38 @@ -using CommunityToolkit.Mvvm.ComponentModel; +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using CommunityToolkit.Mvvm.ComponentModel; namespace ProgramLib.GUI.Model { + /// + /// Power module data model used for data binding + /// internal partial class PowerModuleDataModel : ObservableObject { + [ObservableProperty] + private string name; + [ObservableProperty] + private string powerLed; [ObservableProperty] private string expectedVoltage; [ObservableProperty] private string actualVoltage; [ObservableProperty] private string actualCurrent; - } + } } diff --git a/Source/Program/GUI/ProgramGuiManager.cs b/Source/Program/GUI/ProgramGuiManager.cs index bd033fe..59d63d8 100644 --- a/Source/Program/GUI/ProgramGuiManager.cs +++ b/Source/Program/GUI/ProgramGuiManager.cs @@ -1,14 +1,34 @@ -using NLog; -using ProgramLib.GUI.View; +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Windows; using System.Windows.Threading; +using NLog; +using ProgramLib.GUI.View; namespace ProgramLib { + /// + /// Class that manages all GUIs + /// internal class ProgramGuiManager : IDisposable { #region Private Members @@ -23,7 +43,13 @@ namespace ProgramLib public enum WINDOWS { LIVE_DATA, - IMPEDANCE_CHECK + MANUAL_CONTROL, + IMPEDANCE_CHECK, + MSFR_TEST_CASES, + CONFIRMATION, + + // DO NOT modify this. + DEFAULT } #endregion @@ -35,18 +61,16 @@ namespace ProgramLib _logger = LogManager.GetCurrentClassLogger(); } - /// - /// The Finalizer - /// Do not call Dispose() in here - /// - ~ProgramGuiManager() - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); - } - public Window this[WINDOWS window] { - get { return _windowDict[window]; } + get + { + if (window == WINDOWS.DEFAULT) + { + return _windowDict[(WINDOWS)0]; + } + return _windowDict[window]; + } } /// @@ -61,13 +85,19 @@ namespace ProgramLib _allGuiInitializedEvent.WaitOne(); } + /// + /// Constructor + /// private void GuiManagerThread() { _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running..."); // instantiate all the windows here _windowDict[WINDOWS.LIVE_DATA] = new LiveDataWindow(); + _windowDict[WINDOWS.MANUAL_CONTROL] = new ManualControlWindow(); _windowDict[WINDOWS.IMPEDANCE_CHECK] = new ImpedanceCheckWindow(); + _windowDict[WINDOWS.MSFR_TEST_CASES] = new MsfrTestCasesWindow(); + _windowDict[WINDOWS.CONFIRMATION] = new ConfirmationWindow(); _allGuiInitializedEvent.Set(); @@ -77,6 +107,29 @@ namespace ProgramLib _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting..."); } + /// + /// Destructor + /// + ~ProgramGuiManager() + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); + } + + /// + /// Open a wait window with countdown timer + /// + /// message to display + /// number to seconds to wait + /// + public void DisplayWaitMessage(string message, double delaySec) + { + this[ProgramGuiManager.WINDOWS.DEFAULT].Dispatcher.Invoke((Action)delegate + { + WaitWindow waitWindow = new WaitWindow(message, delaySec); + waitWindow.ShowDialog(); + }); + } + /// /// Dispose of this object. /// diff --git a/Source/Program/GUI/View/ConfirmationWindow.xaml b/Source/Program/GUI/View/ConfirmationWindow.xaml new file mode 100644 index 0000000..86dee83 --- /dev/null +++ b/Source/Program/GUI/View/ConfirmationWindow.xaml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Confirmation + + + + + + + + + + + + + + + diff --git a/Source/Program/GUI/View/ConfirmationWindow.xaml.cs b/Source/Program/GUI/View/ConfirmationWindow.xaml.cs new file mode 100644 index 0000000..997b2e9 --- /dev/null +++ b/Source/Program/GUI/View/ConfirmationWindow.xaml.cs @@ -0,0 +1,111 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Windows; +using System.Windows.Media.Imaging; +using NLog; + +namespace ProgramLib.GUI.View +{ + /// + /// Interaction logic for ConfirmationWindow.xaml + /// + internal partial class ConfirmationWindow : Window + { + private ILogger _logger; + public GUI.Util.StandardButtons ClickedButton { get; private set; } + public string ConfirmationMessage + { + private get + { + return lblMessage.Content.ToString(); + } + + set + { + lblMessage.Content = value; + } + } + public string OkButtonText + { + private get + { + return btnOK.Content.ToString(); + } + + set + { + btnOK.Content = value; + } + } + public string CancelButtonText + { + private get + { + return btnCancel.Content.ToString(); + } + + set + { + btnCancel.Content = value; + } + } + + public ConfirmationWindow() + { + InitializeComponent(); + + _logger = LogManager.GetCurrentClassLogger(); + + Uri iconUri = new Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Icons/app.ico"); + this.Icon = BitmapFrame.Create(iconUri); + + ClickedButton = Util.StandardButtons.NOT_SET; + + WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; + } + + protected override void OnContentRendered(EventArgs e) + { + base.OnContentRendered(e); + + // Content of window may be black in case of SizeToContent is set. + // This eliminates the problem. + // Do not use InvalidateVisual because it may implicitly break your markup. + InvalidateMeasure(); + } + + private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + DragMove(); + } + + private void btnOK_Click(object sender, RoutedEventArgs e) + { + ClickedButton = Util.StandardButtons.OK_YES; + this.Hide(); + } + + private void btnCancel_Click(object sender, RoutedEventArgs e) + { + ClickedButton = Util.StandardButtons.CANCEL_NO; + this.Hide(); + + } + } +} diff --git a/Source/Program/GUI/View/DataLocationWindow.xaml b/Source/Program/GUI/View/DataLocationWindow.xaml new file mode 100644 index 0000000..604db04 --- /dev/null +++ b/Source/Program/GUI/View/DataLocationWindow.xaml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Data Locations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Program/GUI/View/DataLocationWindow.xaml.cs b/Source/Program/GUI/View/DataLocationWindow.xaml.cs new file mode 100644 index 0000000..1a2b191 --- /dev/null +++ b/Source/Program/GUI/View/DataLocationWindow.xaml.cs @@ -0,0 +1,81 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Media.Imaging; +using NLog; + +namespace ProgramLib.GUI.View +{ + /// + /// Interaction logic for DataLocationWindow.xaml + /// + internal partial class DataLocationWindow : Window + { + private ILogger _logger; + + public DataLocationWindow() + { + InitializeComponent(); + + _logger = LogManager.GetCurrentClassLogger(); + + Uri iconUri = new Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Icons/app.ico"); + this.Icon = BitmapFrame.Create(iconUri); + + WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; + + uutDataLocationTb.Text = Program.Instance().FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA_TEST); + } + + private void btnClose_Click(object sender, RoutedEventArgs e) + { + this.Close(); + } + + private void btnMax_Click(object sender, RoutedEventArgs e) + { + if (this.WindowState == WindowState.Maximized) + { + this.WindowState = WindowState.Normal; + imgMax.Source = new BitmapImage(new System.Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/Title_Bar_Buttons/maximize.png")); + } + else + { + this.WindowState = WindowState.Maximized; + imgMax.Source = new BitmapImage(new System.Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/Title_Bar_Buttons/restore.png")); + } + } + + private void btnMin_Click(object sender, RoutedEventArgs e) + { + this.WindowState = WindowState.Minimized; + } + + private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + DragMove(); + } + + private void uutDataLocationBtn_Click(object sender, RoutedEventArgs e) + { + Process.Start(@$"{uutDataLocationTb.Text}"); + } + } +} diff --git a/Source/Program/GUI/View/ImpedanceCheckWindow.xaml b/Source/Program/GUI/View/ImpedanceCheckWindow.xaml index c73817b..f87d74a 100644 --- a/Source/Program/GUI/View/ImpedanceCheckWindow.xaml +++ b/Source/Program/GUI/View/ImpedanceCheckWindow.xaml @@ -8,11 +8,12 @@ mc:Ignorable="d" Title="Impedance Check" WindowStyle="None" + Topmost="True" MouseLeftButtonDown="Window_MouseLeftButtonDown" - Height="300" - Width="400"> + Height="500" + Width="720"> - + @@ -57,14 +58,14 @@ Impedance Check - + - + + + @@ -386,16 +411,21 @@ - + - [App Title Here] + Missile Test Set (MTS) - + + + + + + @@ -411,8 +441,19 @@ + + + + + + + - + + + + + @@ -431,36 +472,19 @@ - - - - - - - - - + + + + + + + + + + + + Manual Control + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --- + + + + + + + + + + + + + + + + Low + High + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Program/GUI/View/ManualControlWindow.xaml.cs b/Source/Program/GUI/View/ManualControlWindow.xaml.cs new file mode 100644 index 0000000..6fa9463 --- /dev/null +++ b/Source/Program/GUI/View/ManualControlWindow.xaml.cs @@ -0,0 +1,728 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media.Imaging; +using System.Xml.XPath; +using MeasurementManagerLib; +using NLog; +using ProgramGui.GUI.ViewModel; +using ProgramLib.GUI.Model; +using Raytheon.Common.Coe; +using Raytheon.Instruments; +using Raytheon.Instruments.PowerSupply; + +namespace ProgramLib.GUI.View +{ + /// + /// Interaction logic for ManualControlWindow.xaml + /// + internal partial class ManualControlWindow : Window + { + public ManualWindowViewModel _manualWindowViewModel; + + public LiveDataWindow LiveDataWindow { get; set; } + + private ILogger _logger; + + private Message _currentMsg; + + private Dictionary _xmlDocs = new Dictionary(); + + private Dictionary _fieldNameToCoeMessageDataDict = new Dictionary(); + + private ManualGuiPowerSupplyReadThread _powerSupplyReadThread; + + private CancellationTokenSource _coeSendMessageTaskCancellationSource = new CancellationTokenSource(); + + public ManualControlWindow() + { + InitializeComponent(); + + _logger = LogManager.GetCurrentClassLogger(); + + Uri iconUri = new Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Icons/app.ico"); + this.Icon = BitmapFrame.Create(iconUri); + + WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; + + _manualWindowViewModel = new ManualWindowViewModel(); + DataContext = _manualWindowViewModel; + + _manualWindowViewModel._poweredModuleDataItems = new ObservableCollection(); + _manualWindowViewModel._powerModuleComboBoxDataItems = new ObservableCollection(); + } + + ~ManualControlWindow() + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); + + _coeSendMessageTaskCancellationSource.Cancel(); + + if (_powerSupplyReadThread != null) + { + _powerSupplyReadThread.Quit(); + _powerSupplyReadThread.WaitForExit(); + } + } + + + private void btnClose_Click(object sender, RoutedEventArgs e) + { + if (_powerSupplyReadThread != null) + { + _powerSupplyReadThread.Quit(); + _powerSupplyReadThread.WaitForExit(); + _powerSupplyReadThread = null; + } + this.Hide(); + if (LiveDataWindow != null) + { + LiveDataWindow.Show(); + LiveDataWindow = null; + } + } + + private void btnMax_Click(object sender, RoutedEventArgs e) + { + if (this.WindowState == WindowState.Maximized) + { + this.WindowState = WindowState.Normal; + imgMax.Source = new BitmapImage(new System.Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/Title_Bar_Buttons/maximize.png")); + } + else + { + this.WindowState = WindowState.Maximized; + imgMax.Source = new BitmapImage(new System.Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/Title_Bar_Buttons/restore.png")); + } + } + + private void btnMin_Click(object sender, RoutedEventArgs e) + { + this.WindowState = WindowState.Minimized; + } + + private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + TextBox textBox = Keyboard.FocusedElement as TextBox; + // unfocus text box if click outside of textbox + if (textBox != null) + { + // Kill logical focus + FocusManager.SetFocusedElement(FocusManager.GetFocusScope(textBox), null); + // Kill keyboard focus + Keyboard.ClearFocus(); + } + + DragMove(); + } + + private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) + { + TextBox textBox = Keyboard.FocusedElement as TextBox; + // unfocus text box if enter key is pressed + if (textBox != null) + { + if (e.Key == Key.Return) + { + if (e.Key == Key.Enter) + { + // Kill logical focus + FocusManager.SetFocusedElement(FocusManager.GetFocusScope(textBox), null); + // Kill keyboard focus + Keyboard.ClearFocus(); + } + } + } + } + + private void TextBox_GotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e) + { + TextBox tb = (TextBox)sender; + tb.Dispatcher.BeginInvoke(new Action(() => tb.SelectAll())); + } + + private void TextBox_GotFocus(object sender, RoutedEventArgs e) + { + TextBox tb = (TextBox)sender; + tb.SelectAll(); + } + + private void Window_Loaded(object sender, RoutedEventArgs e) + { + try + { + poppulatePowerSupplyTab(); + poppulateDiscreteTab(); + poppulateCoeTab(); + } + catch (Exception ex) + { + _logger.Error(ex.Message + "\r\n" + ex.StackTrace); + } + } + + private void Window_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (this.Visibility == Visibility.Visible) + { + List moduleList = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetPowerModuleList(); + + foreach (string module in moduleList) + { + PowerModuleDataModel powerData = GetPowerModuleDataFromDatagridDataItems(module); + PowerModuleDataModel powerData2 = GetPowerModuleDataFromComboBoxDataItems(module); + if (powerData != null && !Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.IsPowerSupplyOn(module)) + { + // update datagrid + _manualWindowViewModel._poweredModuleDataItems.Remove(powerData); + + if (powerData2 != null) + powerData2.PowerLed = _manualWindowViewModel._imageToResourcePathDict[ManualWindowViewModel.Images.LED_OFF]; + } + else if (Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.IsPowerSupplyOn(module)) + { + // update datagrid + _manualWindowViewModel._poweredModuleDataItems.Add(powerData); + + if (powerData2 != null) + powerData2.PowerLed = _manualWindowViewModel._imageToResourcePathDict[ManualWindowViewModel.Images.LED_ON]; + } + } + + if (powerModuleCb.SelectedItem != null) + { + string powerModule = ((PowerModuleDataModel)powerModuleCb.SelectedItem).Name; + if (Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.IsPowerSupplyOn(powerModule)) + { + powerOnBtn.Content = "Power Off"; + } + else + powerOnBtn.Content = "Power On"; + } + } + } + + /// + /// Populate power supply tab + /// + private void poppulatePowerSupplyTab() + { + string sectionName = "MANUAL_CONTROL_GUI.POWER_MODULES"; + + List keys = Program.Instance().ProgramSpecificConfig.ReadAllKeys(sectionName); + + try + { + List moduleList = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetPowerModuleList(); + + foreach (string module in moduleList) + { + PowerModuleDataModel data = new PowerModuleDataModel(); + data.PowerLed = _manualWindowViewModel._imageToResourcePathDict[ManualWindowViewModel.Images.LED_OFF]; + if (Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.IsPowerSupplyOn(module)) + { + data.PowerLed = _manualWindowViewModel._imageToResourcePathDict[ManualWindowViewModel.Images.LED_ON]; + } + data.Name = module; + + data.ExpectedVoltage = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetVoltageSetpoint(module).ToString("0.00"); + _manualWindowViewModel._powerModuleComboBoxDataItems.Add(data); + } + } + catch (MalMeasurementManagerNullReferenceException ex) + { + _logger.Warn(ex.Message + "\r\n" + ex.StackTrace); + } + } + + private void powerOnBtn_Click(object sender, RoutedEventArgs e) + { + bool success = true; + + if (Program.Instance().IsUutPwrOn) + { + MessageBox.Show("Power to UUT is currently on. Please turn off power to UUT before manually controlling the power modules.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + } + else + { + try + { + ((Button)sender).IsEnabled = false; + + _manualWindowViewModel.GetPoweredModuleDataItemsSem().WaitOne(); + + string moduleName = ((PowerModuleDataModel)powerModuleCb.SelectedValue).Name; + + PowerData data = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.ReadPowerData(moduleName); + + if (data.Voltage > 0.0) + { + Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputDisable(moduleName); + } + + string text = ((Button)sender).Content.ToString(); + + if (Regex.IsMatch(text, "power on", RegexOptions.IgnoreCase)) + { + double voltageSetpoint = 0.0; + double ovp = 0.0; + double ocp = 0.0; + + if (!Double.TryParse(voltageSetpointTb.Text, out voltageSetpoint)) + { + MessageBox.Show("Voltage setpoint is invalid.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + success = false; + } + + if (success) + { + if (!Double.TryParse(ovpTb.Text, out ovp)) + { + MessageBox.Show("OVP is invalid.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + success = false; + } + } + + if (success) + { + if (!Double.TryParse(ocpTb.Text, out ocp)) + { + MessageBox.Show("OCP is invalid.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + success = false; + } + } + + if (success) + { + Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.SetOverVoltageProtection(moduleName, ovp); + Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.SetVoltageSetpoint(moduleName, voltageSetpoint); + Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.SetOverCurrentProtection(moduleName, ocp); + Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputEnable(moduleName); + + ((Button)sender).Content = "Power Off"; + + if (_powerSupplyReadThread == null) + { + _powerSupplyReadThread = new ManualGuiPowerSupplyReadThread(); + _powerSupplyReadThread.Start(); + } + } + } + else + { + Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputDisable(moduleName); + ((Button)sender).Content = "Power On"; + } + } + catch (Exception ex) + { + _logger.Error(ex.Message + "\r\n" + ex.StackTrace); + + MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); + } + finally + { + _manualWindowViewModel.GetPoweredModuleDataItemsSem().Release(); + + ((Button)sender).IsEnabled = true; + } + } + } + + private void powerModuleCb_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + string moduleName = ((PowerModuleDataModel)((ComboBox)sender).SelectedValue).Name; + + double voltageSetpoint = 0.0; + double ovp = 0.0; + double ocp = 0.0; + + voltageSetpoint = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetVoltageSetpoint(moduleName); + ovp = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetOverVoltageProtection(moduleName); + ocp = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetOverCurrentProtection(moduleName); + + voltageSetpointTb.Text = voltageSetpoint.ToString("0.00"); + ovpTb.Text = ovp.ToString("0.00"); + ocpTb.Text = ocp.ToString("0.00"); + + if (Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.IsPowerSupplyOn(moduleName)) + { + powerOnBtn.Content = "Power Off"; + } + else + powerOnBtn.Content = "Power On"; + } + + private void voltageSetpointTb_LostFocus(object sender, RoutedEventArgs e) + { + double voltageSetpoint = 0.0; + + if (Double.TryParse(((TextBox)sender).Text, out voltageSetpoint) && powerModuleCb.SelectedItem != null) + { + string moduleName = ((PowerModuleDataModel)powerModuleCb.SelectedValue).Name; + PowerModuleDataModel data = GetPowerModuleDataFromComboBoxDataItems(moduleName); + string currentVoltageSetpoint = data.ExpectedVoltage; + if (voltageSetpoint.ToString("0.00") != currentVoltageSetpoint) + { + data.ExpectedVoltage = voltageSetpoint.ToString("0.00"); + double ovp = voltageSetpoint + 0.5; + ovpTb.Text = ovp.ToString("0.00"); + } + } + } + + /// + /// Get power module data from ComboBox + /// + public PowerModuleDataModel GetPowerModuleDataFromComboBoxDataItems(string powerModuleName) + { + PowerModuleDataModel data = null; + foreach (PowerModuleDataModel item in _manualWindowViewModel._powerModuleComboBoxDataItems) + { + if (item.Name == powerModuleName) + data = item; + } + + return data; + } + + /// + /// Get power module data from datagrid + /// + public PowerModuleDataModel GetPowerModuleDataFromDatagridDataItems(string powerModuleName) + { + PowerModuleDataModel data = null; + foreach (PowerModuleDataModel item in _manualWindowViewModel._poweredModuleDataItems) + { + if (item.Name == powerModuleName) + data = item; + } + + return data; + } + + /// + /// Populate Discrete tab + /// + private void poppulateDiscreteTab() + { + try + { + foreach (KeyValuePair item in Program.Instance().MalMeasurementLibManager.DioMeasurementManager.SignalNameToChannelInfoMap) + { + if (item.Value.ioType == IODatatypes.IOType.DigitalInput) + { + inputDiscretesCb.Items.Add(item.Key); + } + else + outputDiscretesCb.Items.Add(item.Key); + } + } + catch (MalMeasurementManagerNullReferenceException ex) + { + _logger.Warn(ex.Message + "\r\n" + ex.StackTrace); + } + } + + private void inputDiscreteReadBtn_Click(object sender, RoutedEventArgs e) + { + try + { + if (inputDiscretesCb.SelectedItem != null) + { + if (Program.Instance().MalMeasurementLibManager != null && Program.Instance().MalMeasurementLibManager.DioMeasurementManager != null) + { + IODatatypes.BitState state = Program.Instance().MalMeasurementLibManager.DioMeasurementManager.GetInputSignalState(inputDiscretesCb.SelectedValue.ToString()); + + inputDiscreteStatusTb.Text = state.ToString(); + } + } + else + { + MessageBox.Show("Please select an input signal.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + } + } + catch (Exception ex) + { + _logger.Error(ex.Message + "\r\n" + ex.StackTrace); + } + } + + private void outputDiscreteWriteBtn_Click(object sender, RoutedEventArgs e) + { + bool success = true; + try + { + if (outputDiscretesCb.SelectedItem == null) + { + MessageBox.Show("Please select an output signal.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + success = false; + } + + if (success) + { + if (outputDiscreteStateCb.SelectedItem == null) + { + MessageBox.Show("Please select an output signal state.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + success = false; + } + } + + if (success) + { + if (Program.Instance().MalMeasurementLibManager != null && Program.Instance().MalMeasurementLibManager.DioMeasurementManager != null) + { + IODatatypes.BitState state; + if (Enum.TryParse(outputDiscreteStateCb.SelectedValue.ToString(), out state)) + { + Program.Instance().MalMeasurementLibManager.DioMeasurementManager.SetOutputSignalState(outputDiscretesCb.SelectedValue.ToString(), state); + } + } + } + } + catch (Exception ex) + { + _logger.Error(ex.Message + "\r\n" + ex.StackTrace); + } + } + + /// + /// Populate COE tab + /// + private void poppulateCoeTab() + { + try + { + ICollection coeDeviceList = Program.Instance().InstrumentManager.GetInstruments(typeof(CoeComm)); + foreach (CoeComm coeDevice in coeDeviceList) + { + coeDeviceCb.Items.Add(Path.GetFileName(coeDevice.Name)); + } + + } + catch (MalMeasurementManagerNullReferenceException ex) + { + _logger.Warn(ex.Message + "\r\n" + ex.StackTrace); + } + } + + private void coeDeviceCb_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + xmlFileCb.Items.Clear(); + + var xmlDocObject = Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.GetXmlDocs(coeDeviceCb.SelectedValue.ToString()); + + if (xmlDocObject != null && xmlDocObject.GetType() == _xmlDocs.GetType()) + { + _xmlDocs = (Dictionary)xmlDocObject; + + foreach (KeyValuePair item in _xmlDocs) + { + xmlFileCb.Items.Add(Path.GetFileName(item.Key)); + } + } + } + + private void xmlFileCb_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + coeMessagesCb.Items.Clear(); + _manualWindowViewModel._coeMessageDataItems.Clear(); + string coeXmlFolderPath = Path.GetDirectoryName(_xmlDocs.First().Key.ToString()); + string coeXmlFilePath = Path.Combine(coeXmlFolderPath, ((ComboBox)sender).SelectedValue.ToString()); + XPathNavigator Node = _xmlDocs[coeXmlFilePath].CreateNavigator(); + XPathNodeIterator Nodeset = Node.Select("interface/message/name"); + while (Nodeset.MoveNext()) + { + coeMessagesCb.Items.Add(Nodeset.Current.Value); + } + } + + private void coeMessagesCb_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (((ComboBox)sender).SelectedItem != null) + { + string coeXmlFolderPath = Path.GetDirectoryName(_xmlDocs.First().Key.ToString()); + string coeXmlFilePath = Path.Combine(coeXmlFolderPath, xmlFileCb.SelectedValue.ToString()); + _currentMsg = new Message(((ComboBox)sender).SelectedValue.ToString(), _xmlDocs[coeXmlFilePath]); + _currentMsg.Default(); + List visibleData = new List(); + visibleData.AddRange(_currentMsg.MessageDataArray); + + _manualWindowViewModel._coeMessageDataItems.Clear(); + _fieldNameToCoeMessageDataDict.Clear(); + CoeMessageDataModel coeMessage; + foreach (MessageData messageData in visibleData) + { + coeMessage = new CoeMessageDataModel(messageData.FieldName, messageData.FieldValue, messageData.FieldType); + if (!String.IsNullOrEmpty(messageData.FormattedValue) && Regex.IsMatch(messageData.FormattedValue, @"^0x.+", RegexOptions.IgnoreCase)) + { + coeMessage.Value = messageData.FormattedValue; + } + _fieldNameToCoeMessageDataDict[messageData.FieldName] = coeMessage; + if (messageData.FieldName[0] == '$') + { + coeMessage.IsFocusable = Boolean.FalseString; + } + // add data item to TreeView control + _manualWindowViewModel._coeMessageDataItems.Add(coeMessage); + ProcessChildMessage(messageData.MessageArray, coeMessage); + } + } + } + + /// + /// Process child message + /// + private void ProcessChildMessage(MessageData[] messageArray, CoeMessageDataModel coeMessageParent) + { + if (messageArray != null && messageArray.Count() > 0) + { + coeMessageParent.SubItems = new ObservableCollection(); + foreach (var message in messageArray) + { + string simpliedFiledName = message.FieldName; + Match regexMatch = Regex.Match(message.FieldName, @"([^\\.]+)$", RegexOptions.IgnoreCase); + + if (regexMatch.Success) + { + simpliedFiledName = regexMatch.Groups[1].Value; + } + CoeMessageDataModel coeMessage = new CoeMessageDataModel(simpliedFiledName, message.FieldValue, message.FieldType); + _fieldNameToCoeMessageDataDict[message.FieldName] = coeMessage; + if (String.IsNullOrEmpty(message.FieldValue)) + { + coeMessage.IsFocusable = Boolean.FalseString; + } + coeMessageParent.SubItems.Add(coeMessage); + ProcessChildMessage(message.MessageArray, coeMessage); + } + } + } + + private void coeSendBtn_Click(object sender, RoutedEventArgs e) + { + if (_currentMsg != null) + { + string text = ((Button)sender).Content.ToString(); + + if (Regex.IsMatch(text, "send", RegexOptions.IgnoreCase)) + { + var parms = GetParameters(_currentMsg.MessageDataArray); + int rateHz = -1; + if (int.TryParse(coeSendRate.Text, out rateHz)) + { + int minRateHz = 1; + int maxRateHz = 60; + if (rateHz < minRateHz || rateHz > maxRateHz) + { + MessageBox.Show($"Rate {rateHz} Hz is out of range. Must be between {minRateHz} and {maxRateHz} Hz"); + } + else + { + _coeSendMessageTaskCancellationSource = new CancellationTokenSource(); + string instr = coeDeviceCb.SelectedValue.ToString(); + Task.Factory.StartNew(() => SendCoeMessageTask(instr, _currentMsg.Name, parms, rateHz)); + ((Button)sender).Content = "Stop"; + } + } + else + { + try + { + Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.SendMessage(coeDeviceCb.SelectedValue.ToString(), _currentMsg.Name, parms); + } + catch (Exception ex) + { + _logger.Error(ex.Message + "\r\n" + ex.StackTrace); + } + } + } + else + { + _coeSendMessageTaskCancellationSource.Cancel(); + ((Button)sender).Content = "Send"; + } + } + } + + /// + /// Send COE message periodically + /// + private async void SendCoeMessageTask(string instr, string msgName, List> parms, int rateHz) + { + _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running..."); + + int sleepIntervalMs = 1000 / rateHz; + + try + { + while (!_coeSendMessageTaskCancellationSource.Token.IsCancellationRequested) + { + Program.Instance().MalMeasurementLibManager.CoeMeasurementManager.SendMessage(instr, msgName, parms); + + await Task.Delay(sleepIntervalMs); + } + } + catch (Exception ex) + { + _logger.Error(ex.Message + "\r\n" + ex.StackTrace); + } + + _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting..."); + } + + /// + /// Get parameters in the message + /// + private List> GetParameters(MessageData[] array) + { + if (array == null || array.Length == 0) + return null; + + List> parms = new List>(); + + foreach (var item in array.Where(m => !m.FieldName.StartsWith("$"))) + { + if (_fieldNameToCoeMessageDataDict.ContainsKey(item.FieldName)) + { + parms.Add(new KeyValuePair(item.FieldName, _fieldNameToCoeMessageDataDict[item.FieldName].Value)); + } + if (item.MessageArray != null && item.MessageArray.Any()) + { + var innerParams = GetParameters(item.MessageArray); + if (innerParams != null) + { + parms.AddRange(innerParams); + } + } + } + + return parms; + } + } +} diff --git a/Source/Program/GUI/View/MsfrTestCasesWindow.xaml b/Source/Program/GUI/View/MsfrTestCasesWindow.xaml new file mode 100644 index 0000000..1486a47 --- /dev/null +++ b/Source/Program/GUI/View/MsfrTestCasesWindow.xaml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSFR Test Cases + + + + + + + + + + + + + + + + diff --git a/Source/Program/GUI/View/MsfrTestCasesWindow.xaml.cs b/Source/Program/GUI/View/MsfrTestCasesWindow.xaml.cs new file mode 100644 index 0000000..76947da --- /dev/null +++ b/Source/Program/GUI/View/MsfrTestCasesWindow.xaml.cs @@ -0,0 +1,95 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.Windows; +using System.Windows.Media.Imaging; +using NLog; + +namespace ProgramLib.GUI.View +{ + /// + /// Interaction logic for MsfrTestCasesWindow.xaml + /// + internal partial class MsfrTestCasesWindow : Window + { + private ILogger _logger; + public GUI.Util.StandardButtons ClickedButton { get; private set; } + + public MsfrTestCasesWindow() + { + InitializeComponent(); + + _logger = LogManager.GetCurrentClassLogger(); + + Uri iconUri = new Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Icons/app.ico"); + this.Icon = BitmapFrame.Create(iconUri); + + ClickedButton = Util.StandardButtons.NOT_SET; + + WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; + } + + private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + DragMove(); + } + + private void Window_Loaded(object sender, RoutedEventArgs e) + { + PopulateTestCaseComboBox(); + } + + private void btnOK_Click(object sender, RoutedEventArgs e) + { + if (cbMsfrTestCases.SelectedItem == null) + { + MessageBox.Show("Please select a test case", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + } + else + { + ClickedButton = Util.StandardButtons.OK_YES; + _logger.Info($"Selected MSFR test case: {cbMsfrTestCases.SelectedValue.ToString()}"); + this.Hide(); + } + } + + private void btnCancel_Click(object sender, RoutedEventArgs e) + { + ClickedButton = Util.StandardButtons.CANCEL_NO; + + this.Hide(); + + } + + private void PopulateTestCaseComboBox() + { + const string MSFR_TEST_CASE_SECTION_NAME = "MSFRParameterMsg"; + List keys = Program.Instance().ProgramSpecificConfig.ReadAllKeys(MSFR_TEST_CASE_SECTION_NAME); + foreach (string key in keys) + { + string val = Program.Instance().ProgramSpecificConfig.ReadValue(MSFR_TEST_CASE_SECTION_NAME, key); + int index = val.IndexOf(','); + string testCaseId = Regex.Replace(key, @"test_case_", @"", RegexOptions.IgnoreCase); + string testCaseDescription = $"{testCaseId}. {val.Substring(0, index)}"; + cbMsfrTestCases.Items.Add(testCaseDescription); + } + } + } +} diff --git a/Source/Program/GUI/View/WaitWindow.xaml b/Source/Program/GUI/View/WaitWindow.xaml new file mode 100644 index 0000000..850a0e7 --- /dev/null +++ b/Source/Program/GUI/View/WaitWindow.xaml @@ -0,0 +1,129 @@ + + + + + + pack://application:,,,/Program;component/Resources/Fonts/#Digital-7 Mono + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Wait + + + + + + Message + + 00:00.00 + + + + + + diff --git a/Source/Program/GUI/View/WaitWindow.xaml.cs b/Source/Program/GUI/View/WaitWindow.xaml.cs new file mode 100644 index 0000000..b1ac5d9 --- /dev/null +++ b/Source/Program/GUI/View/WaitWindow.xaml.cs @@ -0,0 +1,90 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Windows; +using System.Windows.Media.Imaging; +using System.Windows.Threading; + +namespace ProgramLib.GUI.View +{ + /// + /// Interaction logic for WaitWindow.xaml + /// + internal partial class WaitWindow : Window + { + private DispatcherTimer _timer; + private int _delayMs; + private const int _timerTickIntervalMs = 25; + private DateTime _startDateTime; + + public WaitWindow(string message, double delaySec) + { + InitializeComponent(); + + Uri iconUri = new Uri($"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Icons/app.ico"); + this.Icon = BitmapFrame.Create(iconUri); + + WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; + + tbMessage.Text = message; + + _delayMs = (int)(delaySec * 1000.0); + + _timer = new DispatcherTimer(); + _timer.Interval = TimeSpan.FromMilliseconds(_timerTickIntervalMs); + _timer.Tick += new EventHandler(Timer_Tick); + _timer.Start(); + + _startDateTime = DateTime.Now; + } + + private void Window_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + DragMove(); + } + + protected override void OnContentRendered(EventArgs e) + { + base.OnContentRendered(e); + + // Content of window may be black in case of SizeToContent is set. + // This eliminates the problem. + // Do not use InvalidateVisual because it may implicitly break your markup. + InvalidateMeasure(); + } + + /// + /// Show count down timer + /// + private void Timer_Tick(object sender, EventArgs e) + { + TimeSpan ts = DateTime.Now - _startDateTime; + int remainingMs = _delayMs - (int)ts.TotalMilliseconds; + if (remainingMs >= 0) + { + TimeSpan ts2 = TimeSpan.FromMilliseconds(remainingMs); + tbCountDownTimer.Text = String.Format(@"{0:mm\:ss\.ff}", ts2); + } + else + { + _timer.Stop(); + this.Close(); + } + } + } +} diff --git a/Source/Program/GUI/ViewModel/ImpedanceCheckWindowViewModel.cs b/Source/Program/GUI/ViewModel/ImpedanceCheckWindowViewModel.cs index ac47987..86bd97b 100644 --- a/Source/Program/GUI/ViewModel/ImpedanceCheckWindowViewModel.cs +++ b/Source/Program/GUI/ViewModel/ImpedanceCheckWindowViewModel.cs @@ -1,10 +1,9 @@ -using CommunityToolkit.Mvvm.ComponentModel; -using ProgramLib.GUI.Model; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Windows; -using System.Windows.Threading; +using CommunityToolkit.Mvvm.ComponentModel; +using ProgramLib.GUI.Model; namespace ProgramLib.GUI.ViewModel { @@ -17,38 +16,39 @@ namespace ProgramLib.GUI.ViewModel FAIL_CHECK } - public Dictionary ImageToResourcePathDict - { + public Dictionary ImageToResourcePathDict + { get { return _imageToResourcePathDict; } - private set { } + private set { } } - private Dictionary _imageToResourcePathDict = new Dictionary() - { - {Images.PASS_CHECK, @"pack://application:,,,/Program;component/Resources/Images/green-check-mark.png" }, - {Images.FAIL_CHECK, @"pack://application:,,,/Program;component/Resources/Images/red-cross-mark.png" } - }; - + private Dictionary _imageToResourcePathDict; #region Data Bindings - public ObservableCollection _listviewImpedanceDatatems { get; set; } + public ObservableCollection _listviewImpedanceDataItems { get; set; } #endregion Data Bindings public ImpedanceCheckWindowViewModel(Window window) { _window = window; - _listviewImpedanceDatatems = new ObservableCollection(); + _listviewImpedanceDataItems = new ObservableCollection(); + + _imageToResourcePathDict = new Dictionary() + { + {Images.PASS_CHECK, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/green-check-mark.png" }, + {Images.FAIL_CHECK, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/red-cross-mark.png" } + }; } public void AddData(ImpedanceDataModel item) { _window.Dispatcher.Invoke((Action)delegate { - _listviewImpedanceDatatems.Add(item); + _listviewImpedanceDataItems.Add(item); }); } @@ -56,7 +56,7 @@ namespace ProgramLib.GUI.ViewModel { _window.Dispatcher.Invoke((Action)delegate { - _listviewImpedanceDatatems.Clear(); + _listviewImpedanceDataItems.Clear(); }); } } diff --git a/Source/Program/GUI/ViewModel/LiveDataWindowViewModel.cs b/Source/Program/GUI/ViewModel/LiveDataWindowViewModel.cs index e5359c1..66e07d0 100644 --- a/Source/Program/GUI/ViewModel/LiveDataWindowViewModel.cs +++ b/Source/Program/GUI/ViewModel/LiveDataWindowViewModel.cs @@ -1,12 +1,9 @@ -using CommunityToolkit.Mvvm.ComponentModel; -using ProgramLib.GUI.Model; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; +using CommunityToolkit.Mvvm.ComponentModel; +using ProgramLib.GUI.Model; namespace ProgramLib.GUI.ViewModel { @@ -30,11 +27,7 @@ namespace ProgramLib.GUI.ViewModel private set { } } - private Dictionary _imageToResourcePathDict = new Dictionary() - { - {Images.LED_ON, @"pack://application:,,,/ProgramGui;component/Resources/Images/green-led.png" }, - {Images.LED_OFF, @"pack://application:,,,/ProgramGui;component/Resources/Images/black-led.png" } - }; + private Dictionary _imageToResourcePathDict; #region Data Bindings public ObservableCollection _dataGridPowerDatatems { get; set; } @@ -50,24 +43,48 @@ namespace ProgramLib.GUI.ViewModel [ObservableProperty] private string tePowerLedImagePath; + [ObservableProperty] + private string w1CableImagePath; + + [ObservableProperty] + private string w2CableImagePath; + + [ObservableProperty] + private string w3CableImagePath; + + [ObservableProperty] + private string w4CableImagePath; + + [ObservableProperty] + private string w5CableImagePath; + + [ObservableProperty] + private string labelGradientAppControlledOrUnControlled; + + [ObservableProperty] + private string testTimeStr; + + [ObservableProperty] + private string powerOnTimeStr; + #endregion Data Bindings - public LiveDataWindowViewModel(Window window) - { + public LiveDataWindowViewModel(Window window) + { _window = window; _dataGridPowerDatatems = new ObservableCollection(); _dataGridPassthroughDatatems = new ObservableCollection>(); - UutPowerLedImagePath = _imageToResourcePathDict[Images.LED_OFF]; - TePowerLedImagePath = _imageToResourcePathDict[Images.LED_ON]; + _imageToResourcePathDict = new Dictionary() + { + {Images.LED_ON, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/green-led.png" }, + {Images.LED_OFF, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/black-led.png" } + }; } - public void AddPowerData(Dictionary powerModuleToPowerDataModelDict) + public void AddPowerData(PowerModuleDataModel powerData) { - foreach (var item in powerModuleToPowerDataModelDict) - { - _dataGridPowerDatatems.Add(item.Value); - } + _dataGridPowerDatatems.Add(powerData); } public void AddPassthroughData(Dictionary> rowNumberToPassthroughDataDict) diff --git a/Source/Program/GUI/ViewModel/ManualWindowViewModel.cs b/Source/Program/GUI/ViewModel/ManualWindowViewModel.cs new file mode 100644 index 0000000..802903e --- /dev/null +++ b/Source/Program/GUI/ViewModel/ManualWindowViewModel.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Threading; + +using CommunityToolkit.Mvvm.ComponentModel; +using ProgramLib.GUI.Model; + +namespace ProgramGui.GUI.ViewModel +{ + internal partial class ManualWindowViewModel : ObservableObject + { + public enum Images + { + LED_ON, + LED_OFF + } + + public Dictionary _imageToResourcePathDict; + + public ObservableCollection _coeMessageDataItems { get; set; } + + public ObservableCollection _poweredModuleDataItems { get; set; } + + public ObservableCollection _powerModuleComboBoxDataItems { get; set; } + + private Semaphore _poweredModuleDataItemsSemObj = new Semaphore(initialCount: 1, maximumCount: 1); + + public ManualWindowViewModel() + { + _coeMessageDataItems = new ObservableCollection(); + + _imageToResourcePathDict = new Dictionary() + { + {Images.LED_ON, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/green-led.png" }, + {Images.LED_OFF, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/black-led.png" } + }; + } + + public Semaphore GetPoweredModuleDataItemsSem() { return _poweredModuleDataItemsSemObj; } + } +} diff --git a/Source/Program/InstrumentConfigFiles/UUT_POWER_SUPPLY_SYSTEM.xml b/Source/Program/InstrumentConfigFiles/UUT_POWER_SUPPLY_SYSTEM.xml deleted file mode 100644 index 8c8d2fd..0000000 --- a/Source/Program/InstrumentConfigFiles/UUT_POWER_SUPPLY_SYSTEM.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -
- -
-
- -
\ No newline at end of file diff --git a/Source/Program/Misc/TestStation.cs b/Source/Program/Misc/TestStation.cs new file mode 100644 index 0000000..6b7f609 --- /dev/null +++ b/Source/Program/Misc/TestStation.cs @@ -0,0 +1,222 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Text.RegularExpressions; +using System.Xml; +using NLog; +using static MeasurementManagerLib.SwitchMeasurementManager; + +namespace ProgramLib +{ + /// + /// Class that manages anything to do with Special Test Equipment (STE) + /// + internal class TestStation + { + #region PrivateClassMembers + private static NLog.ILogger _logger; + + #endregion + + public TestStation() + { + _logger = LogManager.GetCurrentClassLogger(); + + Program.Instance().InitializeSwitchMeasurementManager(); + } + + /// + /// Perform cable checks + /// + /// + /// + public void PerformCableChecks() + { + try + { + if (Program.Instance().IsThereHardware) + { + if (Program.Instance().UutInfo.UniversalCableId == UutInfo.UniversalCable.NOT_SET) + { + if (CableCheck(ProgramSpecificConfigIni.W1_CABLE_PART_NUMBER.ToString())) + { + Program.Instance().UutInfo.UniversalCableId = UutInfo.UniversalCable.W1; + CableCheck(ProgramSpecificConfigIni.W1_CABLE_SERIAL_NUMBER.ToString()); + } + } + + if (Program.Instance().UutInfo.UniversalCableId == UutInfo.UniversalCable.NOT_SET) + { + if (CableCheck(ProgramSpecificConfigIni.W2_CABLE_PART_NUMBER.ToString())) + { + Program.Instance().UutInfo.UniversalCableId = UutInfo.UniversalCable.W2; + CableCheck(ProgramSpecificConfigIni.W2_CABLE_SERIAL_NUMBER.ToString()); + } + } + + if (Program.Instance().UutInfo.UniversalCableId == UutInfo.UniversalCable.NOT_SET) + { + throw new Exception($"Universal cable ({UutInfo.UniversalCable.W1.ToString()}/{UutInfo.UniversalCable.W2.ToString()}) is not connected."); + } + + // check if UUT is SELF_TEST Cable + if (Program.Instance().UutInfo.UutBuildLevel == UutInfo.BuildLevel.NOT_SET) + { + if (CableCheck(ProgramSpecificConfigIni.W5_CABLE_PART_NUMBER.ToString())) + { + Program.Instance().UutInfo.UutBuildLevel = UutInfo.BuildLevel.SELF_TEST; + CableCheck(ProgramSpecificConfigIni.W5_CABLE_SERIAL_NUMBER.ToString()); + } + } + + // check for W3 Cable + if (CableCheck(ProgramSpecificConfigIni.W3_CABLE_PART_NUMBER.ToString())) + { + CableCheck(ProgramSpecificConfigIni.W3_CABLE_SERIAL_NUMBER.ToString()); + if (Program.Instance().UutInfo.UutBuildLevel != UutInfo.BuildLevel.SELF_TEST) + { + Program.Instance().UutInfo.UutBuildLevel = UutInfo.BuildLevel.GMA; + } + Program.Instance().UutInfo.SacrificialCableId = UutInfo.SacrificialCable.W3; + } + + // check for W4 Cable + if (Program.Instance().UutInfo.SacrificialCableId == UutInfo.SacrificialCable.NOT_SET) + { + if (CableCheck(ProgramSpecificConfigIni.W4_CABLE_PART_NUMBER.ToString())) + { + CableCheck(ProgramSpecificConfigIni.W4_CABLE_SERIAL_NUMBER.ToString()); + if (Program.Instance().UutInfo.UutBuildLevel != UutInfo.BuildLevel.SELF_TEST) + { + Program.Instance().UutInfo.UutBuildLevel = UutInfo.BuildLevel.AUR; + } + Program.Instance().UutInfo.SacrificialCableId = UutInfo.SacrificialCable.W4; + } + } + + if (Program.Instance().UutInfo.SacrificialCableId == UutInfo.SacrificialCable.NOT_SET) + { + throw new Exception($"Sacrificial cable ({UutInfo.SacrificialCable.W3.ToString()}/{UutInfo.SacrificialCable.W4.ToString()}) is not connected."); + } + } + } + catch (Exception) + { + throw; + } + } + + /// + /// Verify if cable self test has been run + /// + public bool VerifyCableSelfTestHasRun() + { + bool enforceSelfTestHasRun = false; + + try + { + string val = Program.Instance().ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.GENERAL.ToString(), ProgramSpecificConfigIni.ENFORCE_CABLE_SELF_TEST_IS_RUN.ToString()); + + if (String.Equals(val, "true", StringComparison.OrdinalIgnoreCase)) + { + enforceSelfTestHasRun = true; + } + } + catch (Exception) { } + + if (enforceSelfTestHasRun) + { + if (!Program.Instance().CableSelfTestHasRun && Program.Instance().IsThereHardware) + { + if (Program.Instance().UutInfo.UutBuildLevel != UutInfo.BuildLevel.SELF_TEST) + { + if (Program.Instance().UutInfo.UniversalCableId != UutInfo.UniversalCable.NOT_SET + && Program.Instance().UutInfo.SacrificialCableId != UutInfo.SacrificialCable.NOT_SET) + { + XmlDocumentWrapper doc = new XmlDocumentWrapper(Program.Instance().FileAndFolderManager.GetFile(FileAndFolderManager.Files.CABLE_SELF_TEST_RUN_LOG)); + XmlNode node = doc.GetNode(CableSelfTestConfigXml.SelfTestPath); + + bool selfTestAlreadyRanToday = false; + while (node != null) + { + if (node.Attributes[CableSelfTestConfigXml.UniversalCableAttributeName] != null && String.Equals(node.Attributes[CableSelfTestConfigXml.UniversalCableAttributeName].Value, Program.Instance().UutInfo.UniversalCableId.ToString(), StringComparison.OrdinalIgnoreCase) + && node.Attributes[CableSelfTestConfigXml.SacrificialCableAttributeName] != null && String.Equals(node.Attributes[CableSelfTestConfigXml.SacrificialCableAttributeName].Value, Program.Instance().UutInfo.SacrificialCableId.ToString(), StringComparison.OrdinalIgnoreCase) + && node.Attributes[CableSelfTestConfigXml.LastRunDateAttributeName] != null) + { + + string lastRunDateStr = node.Attributes[CableSelfTestConfigXml.LastRunDateAttributeName].Value; + + DateTime lastRunDate = DateTime.Parse(lastRunDateStr); + + if (lastRunDate == DateTime.Now.Date) + selfTestAlreadyRanToday = true; + + break; + } + node = node.NextSibling; + } + + if (!selfTestAlreadyRanToday) + { + throw new Exception($"Please run self-test on cables {Program.Instance().UutInfo.UniversalCableId} + {Program.Instance().UutInfo.SacrificialCableId}."); + } + } + else + throw new Exception("Please perform cable checks before cable self-test enforcement can begin."); + } + else + Program.Instance().CableSelfTestHasRun = true; + } + else + Program.Instance().CableSelfTestHasRun = true; + } + else + Program.Instance().CableSelfTestHasRun = true; + + + return Program.Instance().CableSelfTestHasRun; + } + + /// + /// Verify cable id + /// + /// + /// + private bool CableCheck(string iniRelayKeyName) + { + bool checkPass = false; + + string relayName = Program.Instance().ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.CABLE_ID_RELAYS.ToString(), iniRelayKeyName); + + DMMResistanceMeasurementFields dmmResistanceMeasurementInfo = Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.DmmResistanceMeasurements[relayName]; + double testResult = Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.DmmReadResistance(relayName); + + string cableAndPinId = dmmResistanceMeasurementInfo._cableAndPinId; + if (Program.Instance().UutInfo.UniversalCableId == UutInfo.UniversalCable.W2 || Regex.IsMatch(relayName, UutInfo.UniversalCable.W2.ToString() + @"_", RegexOptions.IgnoreCase)) + cableAndPinId = Regex.Replace(cableAndPinId, UutInfo.UniversalCable.W1.ToString() + @"_", UutInfo.UniversalCable.W2.ToString() + @"_", RegexOptions.IgnoreCase); + string description = $"{relayName}, {cableAndPinId} Measured {Util.AutoFormatNumberToString(testResult)} Range [{Util.AutoFormatNumberToString(dmmResistanceMeasurementInfo._lowerLimit)}, {Util.AutoFormatNumberToString(dmmResistanceMeasurementInfo._upperLimit)}]"; + _logger.Info(description); + if (testResult >= dmmResistanceMeasurementInfo._lowerLimit && testResult <= dmmResistanceMeasurementInfo._upperLimit) + { + checkPass = true; + } + + return checkPass; + } + } +} diff --git a/Source/Program/MiscConfigFiles/NLog.config b/Source/Program/MiscConfigFiles/NLog.config deleted file mode 100644 index 86df6fa..0000000 --- a/Source/Program/MiscConfigFiles/NLog.config +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/Program/Program.Actions.cs b/Source/Program/Program.Actions.cs deleted file mode 100644 index 9b1cdb2..0000000 --- a/Source/Program/Program.Actions.cs +++ /dev/null @@ -1,72 +0,0 @@ -/*------------------------------------------------------------------------- -// UNCLASSIFIED -/*------------------------------------------------------------------------- -RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION -PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS -AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO -UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO -RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS -CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS -OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON -COMPANY. - -THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. -GOVERNMENT. - -UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. --------------------------------------------------------------------------*/ -using ProgramLib; -using Raytheon.Instruments; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace ProgramLib -{ - /// - /// Partial class that define all the actions that can be executed - /// - public partial class Program - { - public void UutPowerOn() - { - try - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); - - UutPowerAction uutPowerAction = new UutPowerAction(); - - uutPowerAction.UutPowerOn(); - - } - catch (Exception ex) - { - // DO NOT THROW in this block - // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand - TerminateTestOnMainThreadError(ex); - } - } - - public void UutPowerOff() - { - try - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); - - UutPowerAction uutPowerAction = new UutPowerAction(); - - uutPowerAction.UutPowerOff(); - - } - catch (Exception ex) - { - // DO NOT THROW in this block - // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand - TerminateTestOnMainThreadError(ex); - } - } - } -} diff --git a/Source/Program/Program.SetupManager.cs b/Source/Program/Program.SetupManager.cs new file mode 100644 index 0000000..a58df3b --- /dev/null +++ b/Source/Program/Program.SetupManager.cs @@ -0,0 +1,175 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using MeasurementManagerLib; +using Raytheon.Instruments; + +namespace ProgramLib +{ + /// + /// Initialization of instruments, measurements, gui, support threads, etc + /// + internal partial class Program + { + private ProgramGuiManager _guiManager = null; + + internal ProgramGuiManager GuiManager + { + get + { + if (_guiManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(ProgramGuiManager)); + + return _guiManager; + } + + private set + { + _guiManager = value; + } + } + + internal bool IsUutPwrOn { get; set; } + internal PowerSupplySharedData PowerSupplySharedData { get; set; } + + /// + /// Initialize power supply measurement manager + /// + /// + /// + internal void InitializePowerSupplyMeasurementManager() + { + IsUutPwrOn = false; + PowerSupplySharedData = new PowerSupplySharedData(); + MalMeasurementLibManager.InitializePowerSupplyMeasurementManager(); + } + + /// + /// Initialize DIO measurement manager + /// + /// + /// + internal void InitializeDioMeasurementManager() + { + MalMeasurementLibManager.InitializeDioMeasurementManager(); + } + + /// + /// Initialize switch measurement manager + /// + /// + /// + internal void InitializeSwitchMeasurementManager() + { + string switchMeasurementConfigFilename = ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.SWITCH_MEASUREMENT_MANAGER_CONFIG_FILE_NAME.ToString()); + string configFullPath = Path.Combine(FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.CONFIG_MEASUREMENT), switchMeasurementConfigFilename); + MalMeasurementLibManager.InitializeSwitchMeasurementManager(configFullPath); + } + + /// + /// Initialize switch measurement manager + /// + /// + /// + internal void InitializeCoeMeasurementManager() + { + string coeMeasurementConfigFilename = ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.COE_MEASUREMENT_MANAGER_CONFIG_FILE_NAME.ToString()); + string configFullPath = Path.Combine(FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.CONFIG_MEASUREMENT), coeMeasurementConfigFilename); + MalMeasurementLibManager.InitializeCoeMeasurementManager(configFullPath); + } + + /// + /// Initialize serial devices + /// + /// + /// + internal void InitializeSerialDevices() + { + ICollection serialDevList = InstrumentManager.GetInstruments(typeof(ICommDevice)); + foreach (ICommDevice dev in serialDevList) + { + dev.Initialize(); + } + } + + /// + /// Initialize GUI manager + /// + /// + /// + internal void InitializeGuiManager() + { + if (_guiManager == null) + { + _guiManager = new ProgramGuiManager(); + _guiManager.Initialize(); + GuiManager[ProgramGuiManager.WINDOWS.DEFAULT].Dispatcher.Invoke((Action)delegate + { + GuiManager[ProgramGuiManager.WINDOWS.LIVE_DATA].Show(); + }); + } + } + + /// + /// Start all the monitor/read threads here + /// Call this only after ProgramGuiManager and PowerSupplyManager has been initialized since these threads could be + /// accessing those objects + /// + /// + /// + internal void InitializeSupportThreads() + { + int pollRateMs = 1000; + + if (_threadList.Count() == 0) + { + _threadList.Add(new FailureMonitorThread()); + _threadList.Last().Start(); + + ICollection powerSystemList = _instrumentManager.GetInstruments(typeof(IPowerSupplySystem)); + + if (Int32.TryParse(ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.POLL_RATES.ToString(), ProgramSpecificConfigIni.POWER_SUPPLY_READ_RATE.ToString()), out pollRateMs)) + pollRateMs = pollRateMs * 1000; + foreach (IPowerSupplySystem powerSystem in powerSystemList) + { + _threadList.Add(new PowerSupplyReadThread(powerSystem.Name, pollRateMs)); + _threadList.Last().Start(); + } + + pollRateMs = 1000; + if (Int32.TryParse(ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.POLL_RATES.ToString(), ProgramSpecificConfigIni.PASSTHROUGH_DATA_UPDATE_RATE.ToString()), out pollRateMs)) + pollRateMs = pollRateMs * 1000; + _threadList.Add(new PassthroughDataUpdateThread(pollRateMs)); + _threadList.Last().Start(); + + pollRateMs = 1000; + if (Int32.TryParse(ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.POLL_RATES.ToString(), ProgramSpecificConfigIni.POWER_SUPPLY_LOG_RATE.ToString()), out pollRateMs)) + pollRateMs = pollRateMs * 1000; + + string logNamePrefix = ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.FILE_NAMES.ToString(), ProgramSpecificConfigIni.POWER_SUPPLY_LOG_PREFIX.ToString()); + string logFileExtension = ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.FILE_NAMES.ToString(), ProgramSpecificConfigIni.POWER_SUPPLY_LOG_FILE_EXTENSION.ToString()); + _threadList.Add(new PowerSupplyUpdateThread(pollRateMs, logNamePrefix, logFileExtension)); + + _threadList.Last().Start(); + } + } + } +} diff --git a/Source/Program/Program.cs b/Source/Program/Program.cs index 282b74c..e0754ac 100644 --- a/Source/Program/Program.cs +++ b/Source/Program/Program.cs @@ -16,60 +16,88 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; +using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Reflection; -using System.Collections.Generic; -using System.Linq; - +using System.Text.RegularExpressions; +using System.Xml; +using MeasurementManagerLib; using NationalInstruments.TestStand.Interop.API; using NLog; -using Raytheon.Instruments; +using NLog.Targets; +using NLog.Targets.Wrappers; using Raytheon.Common; -using MeasurementManagerLib; +using Raytheon.Common.PdelWriter; +using Raytheon.Common.PdelWriter.Utilities; +using Raytheon.Instruments; namespace ProgramLib { /// - /// Class for interfacing with any Test Executive such as third party test executive such as Test Stand + /// Class for interfacing with any third party test executive such as Test Stand /// DO NOT implement IDisposable interface for this class. If there are unmanaged resources that need to be freed, /// do it in the destructor. - /// - public partial class Program + /// + internal partial class Program { #region PrivateMemberVariables // the one and only program - private static Program _program; + internal static Program _program = null; - private object _terminateTestSyncObj = new object(); - private bool _terminateTestInitiated = false; - - // simulation - private readonly bool _isThereHardware; - - // file management - private string _partNumber; - private string _serialNumber; + internal static object _terminateTestSyncObj = new object(); + internal static bool _terminateTestInitiated = false; private List _threadList = new List(); private IInstrumentManager _instrumentManager; - private ILogger _logger; + internal static ILogger _logger; - private object _fatalErrorMsgFromSupportThreadSyncObj = new object(); - private string _fatalErrorMsgFromSupportThread; + private object _fatalFailureExceptionFromSupportThreadSyncObj = new object(); + internal static Exception _fatalFailureExceptionFromSupportThread; + + private MalMeasurementLibManager _malMeasurementLibManager; #endregion - internal SequenceContext TestStandSeqContext { get; private set; } + internal IInstrumentManager InstrumentManager + { + get { return _instrumentManager; } + set { _instrumentManager = value; } + } + internal bool IsThereHardware { get; private set; } + internal bool IsAppControlled { get; private set; } + internal bool CableSelfTestHasRun { get; set; } + internal static SequenceContext TestStandSeqContext { get; private set; } internal UutInfo UutInfo { get; private set; } - internal EventManager EventManager { get; private set; } - internal FileAndFolderManager FileAndFolderManager { get; set; } - internal IConfigurationFile ProgramConfig { get; private set; } - internal MalMeasurementLibManager MalMeasurementLibManager { get; private set; } - internal string TestMethodConfigFilePath { get; private set; } + internal TestInfo TestInfo { get; private set; } + internal EventManager EventManager { get; private set; } + internal FileAndFolderManager FileAndFolderManager { get; private set; } + internal IConfigurationFile ProgramGeneralConfig { get; private set; } + internal IConfigurationFile ProgramSpecificConfig { get; private set; } + internal TestStation TestStation { get; private set; } + internal EthernetSocketManager EthernetSocketManager { get; private set; } + internal PdelInformation PdelData { get; private set; } + internal TestResultList PcodeTestResultList { get; private set; } - internal bool SttoSuccess { get; set; } + internal MalMeasurementLibManager MalMeasurementLibManager + { + get + { + if (_malMeasurementLibManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(MalMeasurementLibManager)); + + return _malMeasurementLibManager; + } + + private set + { + _malMeasurementLibManager = value; + } + } + + internal List PowerModulesToBePowered { get; set; } /// /// Create an instance of this class. Only one instance is allowed @@ -78,100 +106,168 @@ namespace ProgramLib /// The UUT serial number /// false for simulation /// - public static Program Instance(string partNumber = "", string serialNumber = "", bool isThereHardware = true, object testStandSeqContext = null) + internal static Program Instance(string partNumber = "", string serialNumber = "", string testType = "", string testName = "", bool isThereHardware = true, string configSubFolderName = "Default", object testStandSeqContext = null) { + if (testStandSeqContext != null) + { + TestStandSeqContext = testStandSeqContext as SequenceContext; + } + + if (_logger == null) + { + // this line is for when this is called from third-party test executive such as TestStand. Without this, NLOG library won't be able to find the NLog.config file + NLog.LogManager.Setup().LoadConfigurationFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "NLog.config")); + + _logger = LogManager.GetCurrentClassLogger(); + } + if (_program == null) { - _program = new Program(partNumber, serialNumber, isThereHardware, testStandSeqContext); + _program = new Program(partNumber, serialNumber, testType, testName, isThereHardware, configSubFolderName); + _program.Initialize(); } return _program; } - /// - /// This function is only meant to be called from third-party test executive such as TestStand. - /// By settting this object to null, Garbage collection is initiated on this objects and any objects created by this object - /// with the exception of static objects. Static objects needs to be explicitly killed by setting them to null - /// - /// - public static void KillInstance() - { - if (_program != null) - { - // signal to all running threads to exit - _program.EventManager[EventManager.Events.GLOBAL_QUIT].Set(); - - UutPowerAction uutPowerAction = new UutPowerAction(); - uutPowerAction.UutPowerOff(); - - // needs to kill all the support threads since they could be accessing GUI - _program.KillSupportThreads(); - - // Because the GuiManager class starts a STA thread to manage WPF GUIs - // the destructor doesn't get called if we don't shut down the STA thread first - // so we explicitly call Dispose here to shutdown the thread. This is a special case. - // All other classes call Dispose() in their Destructor - _program.GetGuiManager()?.Dispose(); - - // this starts garbage collection on this object which then in turn start garbage collection - // on all objects it created - _program = null; - } - } - /// /// The private constructor /// /// the UUT part number /// the UUT serial number /// false for simulation - private Program(string partNumber, string serialNumber, bool isThereHardware, object testStandSeqContext) + private Program(string partNumber, string serialNumber, string testType, string testName, bool isThereHardware, string configSubFolderName) { - // this line is for when this is called from third-party test executive such as TestStand. Without this, NLOG library won't be able to find the NLog.config file - NLog.LogManager.Setup().LoadConfigurationFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "NLog.config")); - - _logger = LogManager.GetCurrentClassLogger(); - - string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - ProgramConfig = new ConfigurationFile(Path.Combine(assemblyFolder, GeneralConstants.ProgramConfigFilename)); - - TestMethodConfigFilePath = Path.Combine(assemblyFolder, GeneralConstants.TestMethodConfigFolderName, GeneralConstants.TestMethodConfigFileName); - - EventManager = new EventManager(); - FileAndFolderManager = new FileAndFolderManager(ProgramConfig); - - if (testStandSeqContext != null) - { - TestStandSeqContext = testStandSeqContext as SequenceContext; - } - - // make sure PN/SN are valid (TS may not pass in the PN) - if (partNumber == "" || partNumber == null) - { - partNumber = "DefaultPN"; - } - - if (serialNumber == "" || serialNumber == null) - { - serialNumber = "DefaultSN"; - } - - _partNumber = partNumber; - _serialNumber = serialNumber; - _isThereHardware = isThereHardware; - - SttoSuccess = false; - - // Initialze all other configuration that the program needs - UutInfo = new UutInfo(_partNumber, _serialNumber); - try { - var configFolder = Path.Combine(assemblyFolder, Raytheon.Common.Constants.InstrumentConfigFolder); - _instrumentManager = new GeneralInstrumentManager(assemblyFolder, configFolder, _isThereHardware); + PdelData = new PdelInformation(); + PcodeTestResultList = new TestResultList(); + IsThereHardware = isThereHardware; + + CableSelfTestHasRun = false; + + _terminateTestInitiated = false; + + _fatalFailureExceptionFromSupportThread = null; + + string testOperator = Util.GetWindowsUserFullName(Environment.UserDomainName, Environment.UserName); + + DateTime assemblyBuildDateTime = File.GetLastWriteTime(GetType().Assembly.Location); + string assemblyBuildDateTimeStr = assemblyBuildDateTime.ToString("MM/dd/yyyy"); + + Version appVersion = GetType().Assembly.GetName().Version; + string softwareBuildInfo = $"{assemblyBuildDateTimeStr} - Version " + appVersion.Major.ToString() + "." + appVersion.Minor.ToString(); + + if (String.IsNullOrEmpty(testOperator)) + testOperator = Environment.UserName; + + if (TestStandSeqContext != null) + { + partNumber = TestStandSeqContext.FileGlobals.GetValString("UUT.PartNumber", PropertyOptions.PropOption_CaseInsensitive); + serialNumber = TestStandSeqContext.FileGlobals.GetValString("UUT.SerialNumber", PropertyOptions.PropOption_CaseInsensitive); + + testType = TestStandSeqContext.FileGlobals.GetValString("UUT.AdditionalData.TEST_CATEGORY", PropertyOptions.PropOption_CaseInsensitive); + + if (String.Equals(testType, "engineering", StringComparison.OrdinalIgnoreCase)) + { + testType = "en"; + } + else + testType = "at"; + + testName = TestStandSeqContext.FileGlobals.GetValString("UUT.AdditionalData.TEST_NAME", PropertyOptions.PropOption_CaseInsensitive); + + if (!String.IsNullOrEmpty(testOperator)) + TestStandSeqContext.FileGlobals.SetValString("UUT.AdditionalData.TEST_OPERATOR", PropertyOptions.PropOption_CaseInsensitive, testOperator); + else + testOperator = TestStandSeqContext.FileGlobals.GetValString("UUT.AdditionalData.TEST_OPERATOR", PropertyOptions.PropOption_CaseInsensitive); + + string dateTimeStr = TestStandSeqContext.Root.Locals.GetValString("StartDate.ShortText", PropertyOptions.PropOption_CaseInsensitive); + dateTimeStr += " " + TestStandSeqContext.Root.Locals.GetValString("StartTime.Text", PropertyOptions.PropOption_CaseInsensitive); + TestInfo = new TestInfo(testType, testName, testOperator, DateTime.Parse(dateTimeStr)); + + TestStandSeqContext.FileGlobals.SetValString("UUT.AdditionalData.MTS_Software_Build", PropertyOptions.PropOption_CaseInsensitive, softwareBuildInfo); + } + else + { + // make sure PN/SN are valid (TS may not pass in the PN) + if (String.IsNullOrEmpty(partNumber)) + { + partNumber = "DefaultPN"; + } + + if (String.IsNullOrEmpty(serialNumber)) + { + serialNumber = "DefaultSN"; + } + + if (String.Equals(testType, "en", StringComparison.OrdinalIgnoreCase) || String.Equals(testType, "at", StringComparison.OrdinalIgnoreCase)) + { + TestInfo = new TestInfo(testType, testName, testOperator, DateTime.Now); + } + else + { + throw new Exception("Argument testType is invalid. Must be either 'en' or 'at'"); + } + + if (String.IsNullOrEmpty(testName)) + { + throw new Exception("Argument testName is invalid. Please provide name of test"); + } + } + + PdelData.TestOperator = testOperator; + PdelData.TestSoftwareIdentification = softwareBuildInfo; + PdelData.UutIdentification = partNumber; + PdelData.UutSerialNumber = serialNumber; + PdelData.TestStartTime = TestInfo.TestStartDateTime; + PdelData.TestCategory = TestCategory.ENGINEERING_TEST; + if (TestInfo.TestType == "at") + { + PdelData.TestCategory = TestCategory.ACCEPTANCE_TEST; + } + + string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + ProgramGeneralConfig = new ConfigurationFile(Path.Combine(assemblyFolder, GeneralConstants.ConfigFolderName, GeneralConstants.ProgramGeneralConfigFilename)); + + PowerModulesToBePowered = new List(); + EventManager = new EventManager(); + IConfigurationFile programSpecificConfig; + FileAndFolderManager = new FileAndFolderManager(ProgramGeneralConfig, out programSpecificConfig, isThereHardware, configSubFolderName); + ProgramSpecificConfig = programSpecificConfig; + + StartLogDashBoard(); + + CheckForControlledSoftware(); + + Target target = LogManager.Configuration.FindTargetByName("RunFile"); + + if (target != null) + { + FileTarget fileTarget = null; + WrapperTargetBase wrapperTarget = target as WrapperTargetBase; + + if (wrapperTarget == null) + { + fileTarget = target as FileTarget; + } + else + { + fileTarget = wrapperTarget.WrappedTarget as FileTarget; + } + + // re-direct NLOG log to specific folder + fileTarget.FileName = FileAndFolderManager.GetFile(FileAndFolderManager.Files.NLOG_TEMP); + LogManager.ReconfigExistingLoggers(); + } + + UutInfo = new UutInfo(partNumber, serialNumber); + + var configFolder = Path.Combine(FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.CONFIG), ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.INSTRUMENT_CONFIG_FOLDER_NAME.ToString())); + _instrumentManager = new GeneralInstrumentManager(assemblyFolder, configFolder, IsThereHardware); _instrumentManager.Initialize(); - MalMeasurementLibManager = new MalMeasurementLibManager(_instrumentManager); + _malMeasurementLibManager = new MalMeasurementLibManager(_instrumentManager); } catch (Exception) { @@ -186,24 +282,292 @@ namespace ProgramLib { _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); - if (TestStandSeqContext != null) + if (TestStandSeqContext == null) { - // clear any setting that we have added for any steps in the Setup Group - for (int i = 0; i < TestStandSeqContext.Sequence.GetNumSteps(StepGroups.StepGroup_Setup); i++) + // signal to all running threads to exit + EventManager[EventManager.Events.GLOBAL_QUIT].Set(); + + if (IsUutPwrOn) { - TestStandSeqContext.Sequence.GetStep(i, StepGroups.StepGroup_Setup).PostExpression = ""; + BasicAction action = new UutPowerOffAction(); + action.Run(); } - // clear any setting that we have added for any steps in the Main Group - for (int i = 0; i < TestStandSeqContext.Sequence.GetNumSteps(StepGroups.StepGroup_Main); i++) + // needs to kill all the support threads since they could be accessing GUI + foreach (BasicThread thread in _threadList) { - TestStandSeqContext.Sequence.GetStep(i, StepGroups.StepGroup_Main).PostExpression = ""; - TestStandSeqContext.Sequence.GetStep(i, StepGroups.StepGroup_Main).AdditionalResults.CustomResults.Clear(); + thread.Quit(); + thread.WaitForExit(); } } } - private void KillSupportThreads() + /// + /// Perform initializations + /// + internal void Initialize() + { + UutInfo.Initialize(); + + EthernetSocketManager = new EthernetSocketManager(); + + TestStation = new TestStation(); + TestStation.PerformCableChecks(); + + FileAndFolderManager.ConstructTestFolder(UutInfo, TestInfo); + + RecordTestRunStartInfoToFile(); + + if (TestStandSeqContext != null) + { + string testStandReportPath = Path.Combine(FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA_TEST), ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.TESTSTAND_FOLDER_NAME.ToString())); + + if (!Directory.Exists(testStandReportPath)) + Directory.CreateDirectory(testStandReportPath); + + string testStandVarName = ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.DESTINATION_TEST_REPORT_PATH_VAR_NAME.ToString()); + TestStandSeqContext.Main.FileGlobals.SetValString(testStandVarName, PropertyOptions.PropOption_CaseInsensitive, testStandReportPath); + } + } + + /// + /// Check if we are running controlled software + /// + internal void CheckForControlledSoftware() + { + try + { + string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + IsAppControlled = false; + + string drive = FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA).Substring(0, 2); + + string appControlledPath = Path.Combine(drive, ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.GENERAL.ToString(), ProgramSpecificConfigIni.APP_RELEASE_CONTROLLED_FOLDER.ToString())); + + if (Regex.IsMatch(assemblyFolder, @"^" + Regex.Escape(appControlledPath), RegexOptions.IgnoreCase)) + { + IsAppControlled = true; + + if (TestStandSeqContext != null) + { + string testStandSeqFilePath = TestStandSeqContext.Sequence.SequenceFile.Path; + + if (!Regex.IsMatch(testStandSeqFilePath, @"^" + Regex.Escape(appControlledPath), RegexOptions.IgnoreCase)) + { + if (IsThereHardware) + _logger.Warn($"Uncontrolled TestStand sequence execution is detected. {testStandSeqFilePath} is not running out of {appControlledPath}."); + IsAppControlled = false; + } + } + } + else + { + if (IsThereHardware) + _logger.Warn($"Uncontrolled software execution is detected. {Assembly.GetExecutingAssembly().Location} is not running out of {appControlledPath}."); + } + } + catch { } + } + + /// + /// Start LogDashboard application + /// + internal void StartLogDashBoard() + { + try + { + string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + + string drive = FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA).Substring(0, 2); + + string logDashboardAppPath = Path.Combine(drive, ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.GENERAL.ToString(), ProgramSpecificConfigIni.LOG_DASHBOARD_APP_PATH.ToString())); + string logDashboardProcessName = Path.GetFileNameWithoutExtension(logDashboardAppPath); + + if (!Path.IsPathRooted(logDashboardAppPath)) + logDashboardAppPath = Path.Combine(assemblyFolder, logDashboardAppPath); + + if (!String.IsNullOrEmpty(logDashboardAppPath) && !String.IsNullOrEmpty(logDashboardProcessName)) + { + if (File.Exists(logDashboardAppPath)) + { + Process[] procArray = Process.GetProcessesByName(logDashboardProcessName); + + if (procArray.Length == 0) + { + Process.Start(logDashboardAppPath); + + int maxRetries = 5; + int retriev = 0; + do + { + System.Threading.Thread.Sleep(1000); + procArray = Process.GetProcessesByName(logDashboardProcessName); + } while (retriev++ < maxRetries && procArray.Length == 0); + } + } + } + } + catch { } + } + + /// + /// Perform post test activities + /// + internal void PerformPostTestActivities() + { + try + { + MoveNlogToTestFolder(); + RecordTestRunEndInfoToFile(); + CreatePdelFile(); + } + catch (Exception) { } + } + + /// + /// Create PDEL file if there are PDEL results + /// + internal void CreatePdelFile() + { + if (PcodeTestResultList.List.Count > 0) + { + PdelWriter pdelWriter = new PdelWriter(); + string pdelReportPath = Path.Combine(FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA_TEST), ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.PDEL_FOLDER_NAME.ToString())); + pdelWriter.CreatePdelFile(PcodeTestResultList.List, PdelData, pdelReportPath); + } + } + + /// + /// Move NLog to test folder + /// + private void MoveNlogToTestFolder() + { + if (FileAndFolderManager != null) + { + string nlogFilePath = FileAndFolderManager.GetFile(FileAndFolderManager.Files.NLOG_TEMP); + // move nlog log to test folder + if (File.Exists(nlogFilePath)) + { + string destPath = String.Empty; + + int numTries = 1; + while (numTries++ <= 2) + { + try + { + destPath = Path.Combine(FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA_TEST), ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.NLOG_FOLDER_NAME.ToString())); + } + catch (Exception) + { + FileAndFolderManager.ConstructTestFolder(UutInfo, TestInfo); + + if (TestStandSeqContext != null) + { + string testStandReportPath = Path.Combine(FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA_TEST), ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.TESTSTAND_FOLDER_NAME.ToString())); + + if (!Directory.Exists(testStandReportPath)) + Directory.CreateDirectory(testStandReportPath); + + string testStandVarName = ProgramGeneralConfig.ReadValue(ProgramGeneralConfigIni.GENERAL.ToString(), ProgramGeneralConfigIni.DESTINATION_TEST_REPORT_PATH_VAR_NAME.ToString()); + TestStandSeqContext.Main.FileGlobals.SetValString(testStandVarName, PropertyOptions.PropOption_CaseInsensitive, testStandReportPath); + } + } + } + + if (!Directory.Exists(destPath)) + { + Directory.CreateDirectory(destPath); + } + + if (Directory.Exists(destPath)) + { + string destFilePath = Path.Combine(destPath, Path.GetFileName(nlogFilePath)); + File.Move(nlogFilePath, destFilePath); + } + } + } + } + + /// + /// Record general information about start of test run to file + /// + private void RecordTestRunStartInfoToFile() + { + XmlDocumentWrapper doc = new XmlDocumentWrapper(FileAndFolderManager.GetFile(FileAndFolderManager.Files.TEST_RUN_LOG)); + XmlNodeList nodeList = doc.GetNodes(TestRunConfigXml.TestRunPath); + + int maxNumTestRunRecordsToKeep = 50; + for (int i = maxNumTestRunRecordsToKeep - 1; i < nodeList.Count; i++) + { + doc.RemoveNode(nodeList[i]); + } + + Dictionary attributesDict = new Dictionary(); + attributesDict[TestRunConfigXml.TestRunPathAttributeName] = FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA_TEST); + attributesDict[TestRunConfigXml.TestRunTestNameAttributeName] = TestInfo.TestName; + attributesDict[TestRunConfigXml.TestRunTesterAttributeName] = TestInfo.TestOperator; + attributesDict[TestRunConfigXml.TestRunStartDateAttributeName] = TestInfo.TestStartDateTime.ToString("MM/dd/yyyy"); + attributesDict[TestRunConfigXml.TestRunStartTimeAttributeName] = TestInfo.TestStartDateTime.ToString("HH:mm:ss"); + doc.AddNode(TestRunConfigXml.TestRunPath, attributesDict, null, XmlDocumentWrapper.AddNodePosition.First); + + doc.SaveToFile(); + } + + /// + /// Record general information about end of test run to file + /// + private void RecordTestRunEndInfoToFile() + { + XmlDocumentWrapper doc = new XmlDocumentWrapper(FileAndFolderManager.GetFile(FileAndFolderManager.Files.TEST_RUN_LOG)); + XmlNodeList nodeList = doc.GetNodes(TestRunConfigXml.TestRunPath); + + int maxNumTestRunRecordsToKeep = 50; + for (int i = maxNumTestRunRecordsToKeep - 1; i < nodeList.Count; i++) + { + doc.RemoveNode(nodeList[i]); + } + + XmlNode node = doc.GetNode(TestRunConfigXml.TestRunPath); + + if (node != null) + { + XmlAttribute attr = node.Attributes["path"]; + + if (attr != null) + { + if (String.Equals(attr.Value, FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA_TEST), StringComparison.OrdinalIgnoreCase)) + { + Dictionary attributesDict = new Dictionary(); + attributesDict[TestRunConfigXml.TestRunEndDateAttributeName] = DateTime.Now.ToString("MM/dd/yyyy"); + attributesDict[TestRunConfigXml.TestRunEndTimeAttributeName] = DateTime.Now.ToString("HH:mm:ss"); + doc.ChangeNode(node, attributesDict); + } + } + } + + doc.SaveToFile(); + } + + /// + /// Kill GUI thread + /// + internal void KillGuiThread() + { + try + { + // Because the GuiManager class starts a STA thread to manage WPF GUIs + // the Program destructor doesn't get called if we don't shut down the STA thread first + // so we explicitly call Dispose here to shutdown the thread. This is a special case. + // All other classes call Dispose() in their Destructor + _program.GuiManager?.Dispose(); + } + catch (MalMeasurementManagerNullReferenceException) { } + } + + /// + /// Kill support threads + /// + internal void KillSupportThreads() { foreach (BasicThread thread in _threadList) { @@ -212,82 +576,18 @@ namespace ProgramLib } } - /// - /// All code module should not throw exception into teststand and let teststand handle the exception - /// We give the teststand step a nice error message and tell teststand to go to cleanup - /// If we are not calling into code from teststand, then we throw exception as usual - /// Call this only from code executing on the main TestStand thread - /// - /// - /// - private void TerminateTestOnMainThreadError(Exception ex) - { - if (TestStandSeqContext != null) - { - _logger.Error(ex.Message + "\n" + ex.StackTrace); - - lock (_terminateTestSyncObj) - { - if (!_terminateTestInitiated) - { - // tells teststand there's a exception occurred and give it the error message - TestStandSeqContext.Step.PostExpression = $"Step.Result.Error.Msg=\"{ex.Message} \", Step.Result.Error.Occurred=True"; - - TestStandSeqContext.Step.ResultStatus = "Error"; - - // tells TestStand to go to clean up - TestStandSeqContext.StepGroup = StepGroups.StepGroup_Cleanup; - TestStandSeqContext.NextStepIndex = 0; - - _terminateTestInitiated = true; - } - } - } - else - throw ex; - } - - /// - /// Support threads such as monitor threads need a way to stop the sequence if it encounters an error - /// This function is meant to be called from FailureMonitorThread which monitors any error signaled by any - /// support thread. - /// - /// - /// - internal void TerminateTestOnSupportThreadError() - { - if (TestStandSeqContext != null) - { - lock (_terminateTestSyncObj) - { - if (!_terminateTestInitiated) - { - // tells teststand there's a exception occurred and give it the error message - TestStandSeqContext.SequenceErrorMessage = _fatalErrorMsgFromSupportThread + " "; - TestStandSeqContext.SequenceErrorOccurred = true; - - // tells TestStand to go to clean up - TestStandSeqContext.StepGroup = StepGroups.StepGroup_Cleanup; - TestStandSeqContext.NextStepIndex = 0; - - _terminateTestInitiated = true; - } - } - } - } - /// /// Save error message originated from other threads /// /// /// - internal void SetFatalErrorMsgFromSupportThread(string errorMsg) + internal void SetFatalFailureExceptionFromSupportThread(Exception fatalFailureException) { - lock(_fatalErrorMsgFromSupportThreadSyncObj) + lock (_fatalFailureExceptionFromSupportThreadSyncObj) { - if (String.IsNullOrEmpty(_fatalErrorMsgFromSupportThread)) + if (_fatalFailureExceptionFromSupportThread == null) { - _fatalErrorMsgFromSupportThread = errorMsg; + _fatalFailureExceptionFromSupportThread = fatalFailureException; } } } diff --git a/Source/Program/Program.csproj b/Source/Program/Program.csproj index 022b275..0ebd061 100644 --- a/Source/Program/Program.csproj +++ b/Source/Program/Program.csproj @@ -13,10 +13,11 @@ 1.0.0 Resources\Icons\app.ico - 10.0 + 12.0 + @@ -29,12 +30,20 @@ ..\ProgramLib\Dependencies\NationalInstruments.TestStand.Interop.API.dll + + + + + + + + @@ -62,27 +71,47 @@ Settings.Designer.cs + + + + + <_Parameter1>UnitTests + + - + - - - + + - - - - - + + + + + + + + + + + + + + + + + + + + - - + + - diff --git a/Source/Program/ProgramConfigFiles/config.ini b/Source/Program/ProgramConfigFiles/config.ini deleted file mode 100644 index d79781b..0000000 --- a/Source/Program/ProgramConfigFiles/config.ini +++ /dev/null @@ -1,10 +0,0 @@ -[GENERAL] -; specify data folder and all subfolders in it -DATA_BASE_PATH = .\Output -DATA_TEMP_PATH = Temp - -; Log names -POWER_SUPPLY_SELF_TEST_DATETIME = power_supply_self_test_datetime.xml - -; Rates for tasks/threads (secs) -POWER_SUPPLY_READ_RATE = 2 \ No newline at end of file diff --git a/Source/Program/Resources/Fonts/Digital-7 Mono-Italic.ttf b/Source/Program/Resources/Fonts/Digital-7 Mono-Italic.ttf new file mode 100644 index 0000000..eb548ab Binary files /dev/null and b/Source/Program/Resources/Fonts/Digital-7 Mono-Italic.ttf differ diff --git a/Source/Program/Resources/Fonts/Digital-7 Mono.ttf b/Source/Program/Resources/Fonts/Digital-7 Mono.ttf new file mode 100644 index 0000000..74209e6 Binary files /dev/null and b/Source/Program/Resources/Fonts/Digital-7 Mono.ttf differ diff --git a/Source/Program/Resources/Images/aur.png b/Source/Program/Resources/Images/aur.png new file mode 100644 index 0000000..5cc944d Binary files /dev/null and b/Source/Program/Resources/Images/aur.png differ diff --git a/Source/Program/Resources/Images/folders.png b/Source/Program/Resources/Images/folders.png new file mode 100644 index 0000000..9820089 Binary files /dev/null and b/Source/Program/Resources/Images/folders.png differ diff --git a/Source/Program/Resources/Images/game_controller.png b/Source/Program/Resources/Images/game_controller.png new file mode 100644 index 0000000..46ef463 Binary files /dev/null and b/Source/Program/Resources/Images/game_controller.png differ diff --git a/Source/Program/Resources/Images/gma.png b/Source/Program/Resources/Images/gma.png new file mode 100644 index 0000000..ca5afe1 Binary files /dev/null and b/Source/Program/Resources/Images/gma.png differ diff --git a/Source/Program/TestMethodConfigFiles/Test_Method_Configuration.ini b/Source/Program/TestMethodConfigFiles/Test_Method_Configuration.ini deleted file mode 100644 index 56066a5..0000000 --- a/Source/Program/TestMethodConfigFiles/Test_Method_Configuration.ini +++ /dev/null @@ -1,73 +0,0 @@ -[GMA_ATP_001_UUT_STTO] -PLACEHOLDER = PLACEHOLDER - -;format is name = range|resolution|delay(ms)|scale factor|relays|type|cable and pin id|lower_limit|upper_limit -;Type is TWO or FOUR for two wire and four wire measurements -;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Relay_Channel#]-[Relay_Channel#] -; [Card_Name] - must match the name of the switch card defined in the Instrument.xml -;Cable and Pin Id Format: [Cable_Id]_[Pin_Id]_[Cable_Id]_[Pin_Id] -[GMA_ATP_001_UUT_STTO.DMM_RESISTANCE_MEASUREMENTS] -R1 = PCODE1|-1|0.001|100|1|PICKERING_SWITCH_1-56,PICKERING_SWITCH_1-57|TWO|J1_P1_J1_P2|1.0|2.0 -R2 = PCODE2|-1|0.001|100|1|PICKERING_SWITCH_1-58,PICKERING_SWITCH_1-59|TWO|J1_P3_J1_P4|1.0|2.0 - -; a list of relays that the software will reject if commanded.. -; cannot be empty, put "NONE" if there are no exclusions -[GMA_ATP_001_UUT_STTO.RELAY_EXCLUSION_LIST] -EXCLUSION_LIST = NONE - -;===================================================================================================================== - -[GMA_ATP_002_UUT_CI] -PLACEHOLDER = PLACEHOLDER - -;format is name = range|resolution|delay(ms)|scale factor|relays|type|cable and pin id|lower_limit|upper_limit -;Type is TWO or FOUR for two wire and four wire measurements -;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Relay_Channel#]-[Relay_Channel#] -; [Card_Name] - must match the name of the switch card defined in the Instrument.xml -;Cable and Pin Id Format: [Cable_Id]_[Pin_Id]_[Cable_Id]_[Pin_Id] -[GMA_ATP_002_UUT_CI.DMM_RESISTANCE_MEASUREMENTS] -R1 = PCODE1|-1|0.001|100|1|PICKERING_SWITCH_1-56,PICKERING_SWITCH_1-57|TWO|J1_P1_J1_P2|1.0|2.0 -R2 = PCODE2|-1|0.001|100|1|PICKERING_SWITCH_1-58,PICKERING_SWITCH_1-59|TWO|J1_P3_J1_P4|1.0|2.0 - -; a list of relays that the software will reject if commanded.. -; cannot be empty, put "NONE" if there are no exclusions -[GMA_ATP_002_UUT_CI.RELAY_EXCLUSION_LIST] -EXCLUSION_LIST = NONE - -;===================================================================================================================== - -[AUR_ATP_001_UUT_STTO] -PLACEHOLDER = PLACEHOLDER - -;format is name = range|resolution|delay(ms)|scale factor|relays|type|cable and pin id|lower_limit|upper_limit -;Type is TWO or FOUR for two wire and four wire measurements -;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Relay_Channel#]-[Relay_Channel#] -; [Card_Name] - must match the name of the switch card defined in the Instrument.xml -;Cable and Pin Id Format: [Cable_Id]_[Pin_Id]_[Cable_Id]_[Pin_Id] -[AUR_ATP_001_UUT_STTO.DMM_RESISTANCE_MEASUREMENTS] -R1 = PCODE1|-1|0.001|100|1|PICKERING_SWITCH_1:-56,PICKERING_SWITCH_1-57|TWO|J1_P1_J1_P2|1.0|2.0 -R2 = PCODE2|-1|0.001|100|1|PICKERING_SWITCH_1-58,PICKERING_SWITCH_1-59|TWO|J1_P3_J1_P4|1.0|2.0 - -; a list of relays that the software will reject if commanded.. -; cannot be empty, put "NONE" if there are no exclusions -[AUR_ATP_001_UUT_STTO.RELAY_EXCLUSION_LIST] -EXCLUSION_LIST = NONE - -;===================================================================================================================== - -[AUR_ATP_002_UUT_CI] -PLACEHOLDER = PLACEHOLDER - -;format is name = range|resolution|delay(ms)|scale factor|relays|type|cable and pin id|lower_limit|upper_limit -;Type is TWO or FOUR for two wire and four wire measurements -;Relay Format: [Card_Name]-[Relay_Channel#],[Card_Name]-[Relay_Channel#]-[Relay_Channel#] -; [Card_Name] - must match the name of the switch card defined in the Instrument.xml -;Cable and Pin Id Format: [Cable_Id]_[Pin_Id]_[Cable_Id]_[Pin_Id] -[AUR_ATP_002_UUT_CI.DMM_RESISTANCE_MEASUREMENTS] -R1 = PCODE1|-1|0.001|100|1|PICKERING_SWITCH_1:-56,PICKERING_SWITCH_1-57|TWO|J1_P1_J1_P2|1.0|2.0 -R2 = PCODE2|-1|0.001|100|1|PICKERING_SWITCH_1-58,PICKERING_SWITCH_1-59|TWO|J1_P3_J1_P4|1.0|2.0 - -; a list of relays that the software will reject if commanded.. -; cannot be empty, put "NONE" if there are no exclusions -[AUR_ATP_002_UUT_CI.RELAY_EXCLUSION_LIST] -EXCLUSION_LIST = NONE \ No newline at end of file diff --git a/Source/Program/TestStand/TestStand.ActionManager.cs b/Source/Program/TestStand/TestStand.ActionManager.cs new file mode 100644 index 0000000..721358b --- /dev/null +++ b/Source/Program/TestStand/TestStand.ActionManager.cs @@ -0,0 +1,369 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using NationalInstruments.TestStand.Interop.API; +using ProgramLib; +using ProgramLib.GUI.View; + +namespace TestStand +{ + /// + /// Provide wrapper function to call into Action classes + /// All methods defined in this class must be called from TestStand. + /// No other code should be calling these methods outside of TestStand. + /// + public static class ActionManager + { + /// + /// Reset display for steps in a loop. Call this function right after While, Do or For step + /// + public static void ResetDisplayForStepsInLoop() + { + try + { + if (ProgramLib.Program.TestStandSeqContext != null) + { + int numSteps = ProgramLib.Program.TestStandSeqContext.Sequence.GetNumSteps(ProgramLib.Program.TestStandSeqContext.Step.StepGroup); + int currentStepIndex = ProgramLib.Program.TestStandSeqContext.Step.StepIndex; + while (++currentStepIndex < numSteps) + { + Step step = ProgramLib.Program.TestStandSeqContext.Sequence.GetStep(currentStepIndex, ProgramLib.Program.TestStandSeqContext.Step.StepGroup); + if (!string.IsNullOrEmpty(step.ResultStatus)) + step.ResultStatus = ""; + } + + ProgramLib.Program.TestStandSeqContext.Engine.PostUIMessage(ProgramLib.Program.TestStandSeqContext.Execution, ProgramLib.Program.TestStandSeqContext.Thread, UIMessageCodes.UIMsg_RefreshWindows, 0, "", null, true); + } + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Power on + /// + /// + /// + public static void UutPowerOn() + { + try + { + ProgramLib.BasicAction action = new ProgramLib.UutPowerOnAction(); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Power off + /// + /// + /// + public static void UutPowerOff() + { + try + { + ProgramLib.BasicAction action = new ProgramLib.UutPowerOffAction(); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Perform Safe-to-turn-on (STTO) + /// + /// + /// + public static void PerformStto() + { + try + { + ProgramLib.BasicAction action = new ProgramLib.PerformSttoAction(); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Connect to UUT test port + /// + /// + /// + public static void UutTestPortConnect() + { + try + { + ProgramLib.BasicAction action = new ProgramLib.UutTestPortConnectAction(); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Disconnect from UUT test port + /// + /// + /// + public static void UutTestPortDisconnect() + { + try + { + ProgramLib.BasicAction action = new ProgramLib.UutTestPortDisconnectAction(); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Select a MSFR test case + /// + /// Unique comment to identify the end step associated with the loop we trying to break out of + /// + public static void SelectMsfrTestCase(string endStepComment = default) + { + ProgramLib.GUI.Util.StandardButtons button = ProgramLib.GUI.Util.StandardButtons.NOT_SET; + try + { + ProgramLib.Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.DEFAULT].Dispatcher.Invoke((Action)delegate + { + ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.LIVE_DATA].Hide(); + ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.MSFR_TEST_CASES].ShowDialog(); + ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.LIVE_DATA].Show(); + + button = ((MsfrTestCasesWindow)ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.MSFR_TEST_CASES]).ClickedButton; + }); + + if (button == ProgramLib.GUI.Util.StandardButtons.CANCEL_NO && !string.IsNullOrEmpty(endStepComment)) + { + Util.BreakOutOfLoop(endStepComment); + } + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Display a confirmation message. Can use the cancel button as a mechanism to break out of loop if we're in a loop + /// + /// Unique comment to identify the end step associated with the loop we trying to break out of + /// + public static void DisplayConfirmationMessage(string message, string leftButtonText = "OK", string rightButtonText = "Cancel", string endStepComment = default) + { + ProgramLib.GUI.Util.StandardButtons button = ProgramLib.GUI.Util.StandardButtons.NOT_SET; + try + { + ConfirmationWindow window = (ConfirmationWindow)ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.CONFIRMATION]; + ProgramLib.Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.DEFAULT].Dispatcher.Invoke((Action)delegate + { + ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.LIVE_DATA].Hide(); + window.ConfirmationMessage = message; + window.OkButtonText = leftButtonText; + window.CancelButtonText = rightButtonText; + window.ShowDialog(); + ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.LIVE_DATA].Show(); + + button = window.ClickedButton; + }); + + if (button == ProgramLib.GUI.Util.StandardButtons.CANCEL_NO && !string.IsNullOrEmpty(endStepComment)) + { + Util.BreakOutOfLoop(endStepComment); + } + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Display wait message with countdown timer + /// + /// message to display + /// number of seconds to wait + /// + public static void DisplayWaitMessage(string message, double delaySec) + { + try + { + ProgramLib.Program.Instance().GuiManager.DisplayWaitMessage(message, delaySec); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Send test message to UUT + /// + /// + /// + public static void SendTestMessageToUut(string messageName, string configSectionName = null) + { + try + { + ProgramLib.BasicAction action = new ProgramLib.SendTestMessageToUutAction(messageName, configSectionName); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Send Uart Handshake message to UUT + /// + /// + /// + public static void StartTacticalUartReadThreadAction() + { + try + { + ProgramLib.BasicAction action = new ProgramLib.StartTacticalUartReadThreadAction(); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Send Uart Handshake message to UUT + /// + /// + /// + public static void PerformTacticalUartCommAction() + { + try + { + ProgramLib.BasicAction action = new ProgramLib.PerformTacticalUartCommAction(); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Send Uart Handshake message to UUT + /// + /// + /// + public static void SendCoeAdnucMsgToUut(string coeDeviceName, bool continueOnError = false) + { + try + { + ProgramLib.BasicAction action = new ProgramLib.SendCoeAdnucMsgToUutAction(coeDeviceName); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex, continueOnError); + } + } + + /// + /// Send Uart Handshake message to UUT + /// + /// + /// + public static void SendCoeUncageMsgToUut(string coeDeviceName, bool continueOnError = false) + { + try + { + ProgramLib.BasicAction action = new ProgramLib.SendCoeUncageMsgToUutAction(coeDeviceName); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex, continueOnError); + } + } + + /// + /// Send Uart Handshake message to UUT + /// + /// + /// + public static void SendCoeBatteryGoodMsgToUut(string coeDeviceName, bool continueOnError = false) + { + try + { + ProgramLib.BasicAction action = new ProgramLib.SendCoeBatteryGoodMsgToUutAction(coeDeviceName); + action.Run(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex, continueOnError); + } + } + } +} diff --git a/Source/Program/TestStand/TestStand.ProgramManager.cs b/Source/Program/TestStand/TestStand.ProgramManager.cs new file mode 100644 index 0000000..850883e --- /dev/null +++ b/Source/Program/TestStand/TestStand.ProgramManager.cs @@ -0,0 +1,334 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Text.RegularExpressions; +using NationalInstruments.TestStand.Interop.API; +using ProgramLib; + +namespace TestStand +{ + internal class OriginalStepSetting + { + public int _stepIndex; + public StepGroups _stepGroup; + public string _postExpression; + public bool _clearAdditionalResults; + + public OriginalStepSetting(int stepIndex, StepGroups stepGroups, string postExpression, bool clearAdditionalResults = false) + { + _stepIndex = stepIndex; + _stepGroup = stepGroups; + _postExpression = postExpression; + _clearAdditionalResults = clearAdditionalResults; + } + } + + internal class StepErrorSetting + { + public int _stepIndex; + public StepGroups _stepGroup; + public string _errorMessage; + + public StepErrorSetting(int stepIndex, StepGroups stepGroups, string errorMessage) + { + _stepIndex = stepIndex; + _stepGroup = stepGroups; + _errorMessage = errorMessage; + } + } + + /// + /// Provide wrapper function to intialize and finalize Program class + /// All methods defined in this class must be called from TestStand. + /// No other code should be calling these methods outside of TestStand. + /// + public static class ProgramManager + { + // keep track of all the steps that have their settings changed by this program + private static List _originalStepSettingList = new List(); + + // keep track of all the steps that have errors + private static List _stepErrorSettingList = new List(); + + /// + /// Initialize power supply measurement manager + /// + /// + /// + public static void InitializeProgram(string partNumber = "", string serialNumber = "", string testType = "", string testName = "", bool isThereHardware = true, string configSubFolderName = "Default", object testStandSeqContext = null) + { + try + { + _originalStepSettingList = new List(); + _stepErrorSettingList = new List(); + ProgramLib.Program.Instance(partNumber, serialNumber, testType, testName, isThereHardware, configSubFolderName, testStandSeqContext); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Initialize power supply measurement manager + /// + /// + /// + public static void FinalizeProgram(bool openTestDataFolder = true) + { + try + { + if (ProgramLib.Program._program != null) + { + // signal to all running threads to exit + ProgramLib.Program._program.EventManager[EventManager.Events.GLOBAL_QUIT].Set(); + + BasicAction action = new UutPowerOffAction(); + action.Run(); + + // needs to kill all the support threads since they could be accessing GUI + ProgramLib.Program._program.KillSupportThreads(); + + // must kill GUI thread before Program destructor can get called + ProgramLib.Program._program.KillGuiThread(); + + if (ProgramLib.Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager != null) + { + ProgramLib.Program.Instance().MalMeasurementLibManager.SwitchMeasurementManager.Dispose(); + } + + PerformTestStandEndOfRunActivities(); + + ProgramLib.Program._program.PerformPostTestActivities(); + + if (openTestDataFolder) + Process.Start(@$"{ProgramLib.Program._program.FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA_TEST)}"); + + // this starts garbage collection on this object which then in turn start garbage collection + // on all objects it created + ProgramLib.Program._program = null; + } + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Perform TestStand End-of-Run activities + /// + /// + internal static void PerformTestStandEndOfRunActivities() + { + if (ProgramLib.Program.TestStandSeqContext != null) + { + // restore original settings for steps that have been modified by this program + foreach (OriginalStepSetting setting in _originalStepSettingList) + { + ProgramLib.Program.TestStandSeqContext.Sequence.GetStep(setting._stepIndex, setting._stepGroup).PostExpression = setting._postExpression; + + if (setting._clearAdditionalResults) + ProgramLib.Program.TestStandSeqContext.Sequence.GetStep(setting._stepIndex, setting._stepGroup).AdditionalResults.CustomResults.Clear(); + } + + // for the first step that has an error in the Main group but is allowed to continue, + // we want to flag it at the end of the sequence + if (!ProgramLib.Program._terminateTestInitiated) + { + int numSteps = ProgramLib.Program.TestStandSeqContext.Sequence.GetNumSteps(StepGroups.StepGroup_Main); + bool foundError = false; + for (int i = 0; i < numSteps; i++) + { + foreach (StepErrorSetting setting in _stepErrorSettingList) + { + if (setting._stepIndex == i && setting._stepGroup == StepGroups.StepGroup_Main) + { + Step step = ProgramLib.Program.TestStandSeqContext.Sequence.GetStep(setting._stepIndex, setting._stepGroup); + + if (String.Equals(step.ResultStatus, "Error")) + { + // tells teststand there's a exception occurred and give it the error message + ProgramLib.Program.TestStandSeqContext.SequenceErrorMessage = setting._errorMessage + " "; + ProgramLib.Program.TestStandSeqContext.SequenceErrorOccurred = true; + foundError = true; + break; + } + } + } + + if (foundError) + { + break; + } + } + } + } + } + + /// + /// This function is only meant to be called from third-party test executive such as TestStand. + /// + /// + public static void MoveTestStandTestReportToTestFolder(string sourceTestReportFilePath, string destinationTestReportPath) + { + string filenameWithoutExt = Path.GetFileNameWithoutExtension(sourceTestReportFilePath); + string pdfFilename = filenameWithoutExt + ".pdf"; + sourceTestReportFilePath = Path.Combine(Path.GetDirectoryName(sourceTestReportFilePath), pdfFilename); + string destinationTestReportFilePath = Path.Combine(destinationTestReportPath, pdfFilename); + + // wait until the teststand report is created + int maxRetries = 5; + int retries = 0; + while (retries++ < maxRetries && !File.Exists(sourceTestReportFilePath)) + { + System.Threading.Thread.Sleep(1000); + } + + if (File.Exists(sourceTestReportFilePath) && Directory.Exists(destinationTestReportPath)) + { + File.Move(sourceTestReportFilePath, destinationTestReportFilePath); + + try + { + string reportDir = Path.GetDirectoryName(sourceTestReportFilePath); + if (Regex.IsMatch(reportDir, @"\\report\\?$", RegexOptions.IgnoreCase)) + { + Directory.Delete(Path.GetDirectoryName(sourceTestReportFilePath), true); + } + } + catch { } + } + } + + /// + /// All code module should not throw exception into teststand and let teststand handle the exception + /// We give the teststand step a nice error message and tell teststand to go to cleanup + /// If we are not calling into code from teststand, then we throw exception as usual + /// Call this only from code executing on the main TestStand thread + /// + /// + /// + internal static void TerminateTestOnMainThreadError(Exception ex, bool continueOnError = false) + { + if (ProgramLib.Program.TestStandSeqContext != null) + { + string message = ProgramLib.Util.LogException(ex, ProgramLib.Program._logger); + message = Regex.Replace(message, "[\"]+", ""); + message = Regex.Replace(message, @"\\([nrt])", @"\\$1", RegexOptions.IgnoreCase); + + lock (ProgramLib.Program._terminateTestSyncObj) + { + if (!ProgramLib.Program._terminateTestInitiated) + { + if (!continueOnError) + { + ProgramLib.Program.TestStandSeqContext.Step.AsPropertyObject().SetValBoolean("Result.Error.Occurred", 0, true); + ProgramLib.Program._terminateTestInitiated = true; + } + else + { + bool foundError = false; + foreach (StepErrorSetting setting in _stepErrorSettingList) + { + if (setting._stepIndex == ProgramLib.Program.TestStandSeqContext.Step.StepIndex && setting._stepGroup == ProgramLib.Program.TestStandSeqContext.Step.StepGroup) + { + setting._errorMessage = message; + foundError = true; + break; + } + } + + if (!foundError) + _stepErrorSettingList.Add(new StepErrorSetting(ProgramLib.Program.TestStandSeqContext.Step.StepIndex, ProgramLib.Program.TestStandSeqContext.Step.StepGroup, message)); + } + + ProgramLib.Program.TestStandSeqContext.Step.AsPropertyObject().SetValString("Result.Error.Msg", 0, $"{message} "); + ProgramLib.Program.TestStandSeqContext.Step.ResultStatus = "Error"; + } + } + } + else + { + throw new Exception("Check inner exception.", ex); + } + } + + /// + /// Support threads such as monitor threads need a way to stop the sequence if it encounters a fatal error + /// This function is meant to be called from background threads such as FailureMonitorThread which monitors any error signaled by any + /// other background thread. + /// + /// + /// + internal static void TerminateTestOnSupportThreadError() + { + if (ProgramLib.Program.TestStandSeqContext != null) + { + string message = ProgramLib.Util.LogException(ProgramLib.Program._fatalFailureExceptionFromSupportThread, ProgramLib.Program._logger); + message = Regex.Replace(message, "[\"]+", ""); + message = Regex.Replace(message, @"\\([nrt])", @"\\$1", RegexOptions.IgnoreCase); + + lock (ProgramLib.Program._terminateTestSyncObj) + { + if (!ProgramLib.Program._terminateTestInitiated) + { + // tells teststand there's a exception occurred and give it the error message + ProgramLib.Program.TestStandSeqContext.SequenceErrorMessage = message + " "; + ProgramLib.Program.TestStandSeqContext.SequenceErrorOccurred = true; + + // tells TestStand to go to clean up + ProgramLib.Program.TestStandSeqContext.StepGroup = StepGroups.StepGroup_Cleanup; + ProgramLib.Program.TestStandSeqContext.NextStepIndex = 0; + + ProgramLib.Program._terminateTestInitiated = true; + } + } + } + } + + /// + /// Save original step settings so we can restore them. + /// If we don't restore step settings that we change in this program, then the sequence file will be marked as unsaved + /// + internal static void SaveOriginalStepSetting(int stepIndex, StepGroups stepGroup, string postExpression, bool clearAdditionResults = false) + { + bool stepAlreadyExist = false; + foreach (OriginalStepSetting setting in _originalStepSettingList) + { + if (setting._stepIndex == stepIndex && setting._stepGroup == stepGroup) + { + stepAlreadyExist = true; + break; + } + } + + if (!stepAlreadyExist) + { + _originalStepSettingList.Add(new OriginalStepSetting(stepIndex, stepGroup, postExpression, clearAdditionResults)); + } + } + } +} diff --git a/Source/Program/Program.MeasurementManager.cs b/Source/Program/TestStand/TestStand.SetupManager.cs similarity index 57% rename from Source/Program/Program.MeasurementManager.cs rename to Source/Program/TestStand/TestStand.SetupManager.cs index c8067bf..35faf41 100644 --- a/Source/Program/Program.MeasurementManager.cs +++ b/Source/Program/TestStand/TestStand.SetupManager.cs @@ -1,4 +1,4 @@ -/*------------------------------------------------------------------------- +/*------------------------------------------------------------------------- // UNCLASSIFIED /*------------------------------------------------------------------------- RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION @@ -16,40 +16,32 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using System.Collections.Generic; -using System.Linq; -using MeasurementManagerLib; -using Raytheon.Instruments; -namespace ProgramLib +namespace TestStand { /// - /// Initialization of measurement managers and get methods + /// Provide wrapper functions to initialize instruments, measurements, gui, support threads, etc + /// All methods defined in this class must be called from TestStand. + /// No other code should be calling these methods outside of TestStand. /// - public partial class Program + public static class SetupManager { - private ProgramGuiManager _guiManager = null; - - internal bool _isUutPwrOn = false; - internal PowerSupplySharedData PowerSupplySharedData { get; set; } - /// /// Initialize power supply measurement manager /// /// /// - public void InitializePowerSupplyMeasurementManager() + public static void InitializePowerSupplyMeasurementManager() { try { - PowerSupplySharedData = new PowerSupplySharedData(); - MalMeasurementLibManager.InitializePowerSupplyMeasurementManager(); + ProgramLib.Program.Instance().InitializePowerSupplyMeasurementManager(); } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand - TerminateTestOnMainThreadError(ex); + ProgramManager.TerminateTestOnMainThreadError(ex); } } @@ -58,17 +50,17 @@ namespace ProgramLib /// /// /// - public void InitializeDioMeasurementManager() + public static void InitializeDioMeasurementManager() { try { - MalMeasurementLibManager.InitializeDioMeasurementManager(); ; + ProgramLib.Program.Instance().InitializeDioMeasurementManager(); } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand - TerminateTestOnMainThreadError(ex); + ProgramManager.TerminateTestOnMainThreadError(ex); } } @@ -77,17 +69,55 @@ namespace ProgramLib /// /// /// - public void InitializeSwitchMeasurementManager() + public static void InitializeSwitchMeasurementManager() { try { - MalMeasurementLibManager.InitializeSwitchMeasurementManager(); + ProgramLib.Program.Instance().InitializeSwitchMeasurementManager(); } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand - TerminateTestOnMainThreadError(ex); + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Initialize switch measurement manager + /// + /// + /// + public static void InitializeCoeMeasurementManager() + { + try + { + ProgramLib.Program.Instance().InitializeCoeMeasurementManager(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); + } + } + + /// + /// Initialize serial devices + /// + /// + /// + public static void InitializeSerialDevices() + { + try + { + ProgramLib.Program.Instance().InitializeSerialDevices(); + } + catch (Exception ex) + { + // DO NOT THROW in this block + // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand + ProgramManager.TerminateTestOnMainThreadError(ex); } } @@ -96,18 +126,17 @@ namespace ProgramLib /// /// /// - public void InitializeGuiManager() + public static void InitializeGuiManager() { try { - _guiManager = new ProgramGuiManager(); - _guiManager.Initialize(); + ProgramLib.Program.Instance().InitializeGuiManager(); } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand - TerminateTestOnMainThreadError(ex); + ProgramManager.TerminateTestOnMainThreadError(ex); } } @@ -118,49 +147,18 @@ namespace ProgramLib /// /// /// - public void InitializeSupportThreads() + public static void InitializeSupportThreads() { try { - if (_threadList.Count() == 0) - { - _threadList.Add(new FailureMonitorThread()); - _threadList.Last().Start(); - - ICollection powerSystemList = _instrumentManager.GetInstruments(typeof(IPowerSupplySystem)); - - foreach (IPowerSupplySystem powerSystem in powerSystemList) - { - _threadList.Add(new PowerSupplyReadThread(powerSystem.Name)); - _threadList.Last().Start(); - } - - _threadList.Add(new PassthroughDataUpdateThread()); - _threadList.Last().Start(); - - _threadList.Add(new PowerSupplyUpdateThread()); - _threadList.Last().Start(); - } + ProgramLib.Program.Instance().InitializeSupportThreads(); } catch (Exception ex) { // DO NOT THROW in this block // this function will handle the error accordingly since we could be calling this from third-party test executive like TestStand - TerminateTestOnMainThreadError(ex); + ProgramManager.TerminateTestOnMainThreadError(ex); } } - - /// - /// Get Gui manager object - /// - /// - /// - internal ProgramGuiManager GetGuiManager() - { - if (_guiManager == null) - InitializeGuiManager(); - - return _guiManager; - } } } diff --git a/Source/Program/TestStand/Util.cs b/Source/Program/TestStand/Util.cs new file mode 100644 index 0000000..662780f --- /dev/null +++ b/Source/Program/TestStand/Util.cs @@ -0,0 +1,64 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using NationalInstruments.TestStand.Interop.API; + +namespace TestStand +{ + /// + /// TestStand utility functions + /// + internal static class Util + { + /// + /// Break out of while, do and for loop + /// + /// + /// + public static void BreakOutOfLoop(string endStepComment) + { + if (ProgramLib.Program.TestStandSeqContext != null) + { + int numSteps = ProgramLib.Program.TestStandSeqContext.Sequence.GetNumSteps(ProgramLib.Program.TestStandSeqContext.Step.StepGroup); + int currentStepIndex = ProgramLib.Program.TestStandSeqContext.Step.StepIndex; + + while (++currentStepIndex < numSteps) + { + Step step = ProgramLib.Program.TestStandSeqContext.Sequence.GetStep(currentStepIndex, ProgramLib.Program.TestStandSeqContext.Step.StepGroup); + + if (string.Equals(step.AsPropertyObject().Comment, endStepComment, System.StringComparison.OrdinalIgnoreCase)) + { + // we at the end of the Main group + if (currentStepIndex == numSteps - 1) + { + // tells TestStand to go to clean up + ProgramLib.Program.TestStandSeqContext.StepGroup = StepGroups.StepGroup_Cleanup; + ProgramLib.Program.TestStandSeqContext.NextStepIndex = 0; + } + else + { + ProgramLib.Program.TestStandSeqContext.NextStepIndex = ++currentStepIndex; + } + break; + } + } + } + } + + + } +} diff --git a/Source/Program/Threads/FailureMonitorThread.cs b/Source/Program/Threads/FailureMonitorThread.cs index 944cdd4..c195877 100644 --- a/Source/Program/Threads/FailureMonitorThread.cs +++ b/Source/Program/Threads/FailureMonitorThread.cs @@ -15,10 +15,10 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; using System; using System.Collections.Generic; using System.Threading; +using NLog; namespace ProgramLib { @@ -30,6 +30,7 @@ namespace ProgramLib private enum Events { GLOBAL_QUIT, + QUIT, FATAL_FAILURE, // DO NOT change the name @@ -47,14 +48,6 @@ namespace ProgramLib _logger = LogManager.GetCurrentClassLogger(); } - /// - /// Destructor - /// - ~FailureMonitorThread() - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); - } - /// /// Method that executes on the thread. /// @@ -66,6 +59,7 @@ namespace ProgramLib { Dictionary eventDict = new Dictionary(); eventDict[Events.GLOBAL_QUIT] = Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT]; + eventDict[Events.QUIT] = _quitEvent; eventDict[Events.FATAL_FAILURE] = Program.Instance().EventManager[EventManager.Events.FATAL_FAILURE]; eventDict[Events.EVENT_TIMED_OUT] = null; @@ -77,10 +71,10 @@ namespace ProgramLib { Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT].Set(); - UutPowerAction uutPowerAction = new UutPowerAction(); - uutPowerAction.UutPowerOff(); + BasicAction action = new UutPowerOffAction(); + action.Run(); - Program.Instance().TerminateTestOnSupportThreadError(); + TestStand.ProgramManager.TerminateTestOnSupportThreadError(); } } catch (Exception ex) diff --git a/Source/Program/Threads/ManualGuiPowerSupplyReadThread.cs b/Source/Program/Threads/ManualGuiPowerSupplyReadThread.cs new file mode 100644 index 0000000..16298f7 --- /dev/null +++ b/Source/Program/Threads/ManualGuiPowerSupplyReadThread.cs @@ -0,0 +1,232 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading; +using NLog; +using ProgramGui.GUI.ViewModel; +using ProgramLib.GUI.Model; +using ProgramLib.GUI.View; +using Raytheon.Instruments.PowerSupply; + +namespace ProgramLib +{ + /// + /// Class to spawn thread to read power supply data + /// + internal class ManualGuiPowerSupplyReadThread : BasicThread + { + private enum Events + { + GLOBAL_QUIT, + QUIT, + + // DO NOT change the name + // This must be the last member in the enum + EVENT_TIMED_OUT + } + + private ILogger _logger; + + /// + /// Constructor + /// + public ManualGuiPowerSupplyReadThread() + { + _logger = LogManager.GetCurrentClassLogger(); + } + + /// + /// Method that executes on the thread. + /// + /// + /// + protected override void DoWork() + { + _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running..."); + + try + { + ReadPowerSupplyData(); + } + catch (Exception ex) + { + _logger?.Error(ex.Message + "\n" + ex.StackTrace); + } + + _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting..."); + + } + + /// + /// Read power supply data and check for faults + /// + /// + /// + private void ReadPowerSupplyData() + { + int pollRateMs = 1000; + _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running..."); + + try + { + Dictionary eventDict = new Dictionary(); + eventDict[Events.GLOBAL_QUIT] = Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT]; + eventDict[Events.QUIT] = _quitEvent; + eventDict[Events.EVENT_TIMED_OUT] = null; + + EventGroup eventGroup = new EventGroup(eventDict); + ManualControlWindow manualGui = (ManualControlWindow)Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.MANUAL_CONTROL]; + while (true) + { + Events id = eventGroup.WaitAny(pollRateMs); + + if (id == Events.EVENT_TIMED_OUT) + { + try + { + manualGui._manualWindowViewModel.GetPoweredModuleDataItemsSem().WaitOne(); + + List moduleList = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetPowerModuleList(); + + foreach (string module in moduleList) + { + PowerData data = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.ReadPowerData(module); + + if (data.IsOutputOn) + { + PowerModuleDataModel powerData = manualGui.GetPowerModuleDataFromDatagridDataItems(module); + if (powerData == null) + { + powerData = new PowerModuleDataModel(); + powerData.Name = module; + powerData.PowerLed = manualGui._manualWindowViewModel._imageToResourcePathDict[ManualWindowViewModel.Images.LED_ON]; + + manualGui.Dispatcher.Invoke((Action)delegate + { + // update datagrid + manualGui._manualWindowViewModel._poweredModuleDataItems.Add(powerData); + }); + + powerData = manualGui.GetPowerModuleDataFromComboBoxDataItems(module); + if (powerData != null) + { + // update combo box + powerData.PowerLed = manualGui._manualWindowViewModel._imageToResourcePathDict[ManualWindowViewModel.Images.LED_ON]; + } + } + + BitArray statusReg = new BitArray(new int[] { data.FaultStatus }); + + bool ovpTriggeredInPowerSupply = statusReg[0]; + bool ocpTriggeredInPowerSupply = statusReg[1]; + + if (ovpTriggeredInPowerSupply && ocpTriggeredInPowerSupply) + { + string errorMsg = String.Empty; + + if (ovpTriggeredInPowerSupply) + { + errorMsg = powerData.Name + "'s OVP circuitry has tripped"; + } + else if (ocpTriggeredInPowerSupply) + { + errorMsg = powerData.Name + "'s OCP circuitry has tripped"; + } + + throw new Exception(errorMsg); + } + else + { + powerData.ExpectedVoltage = data.VoltageSetpoint.ToString("0.00"); + powerData.ActualVoltage = data.Voltage.ToString("0.00"); + powerData.ActualCurrent = data.Current.ToString("0.00"); + } + } + else + { + + PowerModuleDataModel powerData = manualGui.GetPowerModuleDataFromDatagridDataItems(module); + if (powerData != null) + { + manualGui.Dispatcher.Invoke((Action)delegate + { + // update datagrid + manualGui._manualWindowViewModel._poweredModuleDataItems.Remove(powerData); + }); + } + + powerData = manualGui.GetPowerModuleDataFromComboBoxDataItems(module); + if (powerData != null) + { + // update combo box + powerData.PowerLed = manualGui._manualWindowViewModel._imageToResourcePathDict[ManualWindowViewModel.Images.LED_OFF]; + } + } + } + } + catch (Exception) + { + throw; + } + finally + { + manualGui._manualWindowViewModel.GetPoweredModuleDataItemsSem().Release(); + } + } + else + { + try + { + manualGui._manualWindowViewModel.GetPoweredModuleDataItemsSem().WaitOne(); + + List moduleList = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.GetPowerModuleList(); + + foreach (string module in moduleList) + { + PowerData data = Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.ReadPowerData(module); + + if (data.IsOutputOn) + { + Program.Instance().MalMeasurementLibManager.PowerSupplyMeasurementManager.OutputDisable(module); + } + } + } + catch (Exception) + { + throw; + } + finally + { + manualGui._manualWindowViewModel.GetPoweredModuleDataItemsSem().Release(); + } + + break; + } + } + } + catch (Exception) + { + throw; + } + + _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting..."); + } + } +} diff --git a/Source/Program/Threads/PassthroughDataUpdateThread.cs b/Source/Program/Threads/PassthroughDataUpdateThread.cs index ba2ed05..026b2ab 100644 --- a/Source/Program/Threads/PassthroughDataUpdateThread.cs +++ b/Source/Program/Threads/PassthroughDataUpdateThread.cs @@ -15,13 +15,13 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Threading; using NLog; using ProgramLib.GUI.Model; using ProgramLib.GUI.View; using ProgramLib.GUI.ViewModel; -using System; -using System.Collections.Generic; -using System.Threading; namespace ProgramLib { @@ -33,6 +33,7 @@ namespace ProgramLib private enum Events { GLOBAL_QUIT, + QUIT, UUT_POWER_ON, UUT_POWER_OFF, @@ -44,27 +45,26 @@ namespace ProgramLib private ILogger _logger; private LiveDataWindow _liveDataWindow; private PassthroughData _passthroughData = null; + int _pollRateMs; /// /// Constructor /// - public PassthroughDataUpdateThread() + public PassthroughDataUpdateThread(int pollRateMs) { _logger = LogManager.GetCurrentClassLogger(); - _liveDataWindow = (LiveDataWindow)ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA]; + _liveDataWindow = (LiveDataWindow)ProgramLib.Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.LIVE_DATA]; _passthroughData = new PassthroughData(_liveDataWindow.datagridPassthroughData.Columns.Count); - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Dispatcher.Invoke((Action)delegate + _pollRateMs = pollRateMs; + + _liveDataWindow.Dispatcher.Invoke((Action)delegate { _liveDataWindow.LiveDataWindowViewModel.AddPassthroughData(_passthroughData.GetPassthroughDataModelDict()); }); - } - - ~PassthroughDataUpdateThread() - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); + _pollRateMs = pollRateMs; } /// @@ -80,6 +80,7 @@ namespace ProgramLib { Dictionary eventDict = new Dictionary(); eventDict[Events.GLOBAL_QUIT] = Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT]; + eventDict[Events.QUIT] = _quitEvent; eventDict[Events.UUT_POWER_ON] = Program.Instance().EventManager[EventManager.Events.UUT_POWER_ON]; eventDict[Events.EVENT_TIMED_OUT] = null; @@ -113,74 +114,73 @@ namespace ProgramLib /// private void UpdatePassthroughData() { - int pollRateMs = 1000; _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running..."); try { Dictionary eventDict = new Dictionary(); eventDict[Events.GLOBAL_QUIT] = Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT]; + eventDict[Events.QUIT] = _quitEvent; eventDict[Events.UUT_POWER_OFF] = Program.Instance().EventManager[EventManager.Events.UUT_POWER_OFF]; eventDict[Events.EVENT_TIMED_OUT] = null; EventGroup eventGroup = new EventGroup(eventDict); - Random rnd = new Random(); + _liveDataWindow.LiveDataWindowViewModel.UutPowerLedImagePath = _liveDataWindow.LiveDataWindowViewModel.ImageToResourcePathDict[LiveDataWindowViewModel.Images.LED_ON]; + while (true) { - Events id = eventGroup.WaitAny(pollRateMs); + Events id = eventGroup.WaitAny(_pollRateMs); if (id == Events.EVENT_TIMED_OUT) { - rnd = new Random(); - _liveDataWindow.LiveDataWindowViewModel.UutPowerLedImagePath = _liveDataWindow.LiveDataWindowViewModel.ImageToResourcePathDict[LiveDataWindowViewModel.Images.LED_OFF]; - - float num = 70.0f + GenerateRandomFraction(); - _passthroughData.SetValue(PassthroughData.Variables.VAR1, num.ToString("0.00")); - - Thread.Sleep(100); - num = 30.0f + GenerateRandomFraction(); - _passthroughData.SetValue(PassthroughData.Variables.VAR2, num.ToString("0.00")); - Thread.Sleep(200); - num = 40.0f + GenerateRandomFraction(); - _passthroughData.SetValue(PassthroughData.Variables.VAR3, num.ToString("0.00")); - Thread.Sleep(100); - num = 50.0f + GenerateRandomFraction(); - _passthroughData.SetValue(PassthroughData.Variables.VAR4, num.ToString("0.00")); - Thread.Sleep(100); - _liveDataWindow.LiveDataWindowViewModel.UutPowerLedImagePath = _liveDataWindow.LiveDataWindowViewModel.ImageToResourcePathDict[LiveDataWindowViewModel.Images.LED_ON]; - num = 60.0f + GenerateRandomFraction(); - _passthroughData.SetValue(PassthroughData.Variables.VAR5, num.ToString("0.00")); - Thread.Sleep(200); - num = 10.0f + GenerateRandomFraction(); - _passthroughData.SetValue(PassthroughData.Variables.VAR6, num.ToString("0.00")); + if (!Program.Instance().IsThereHardware) + SimulatePassThroughData(); } else break; } } - catch (Exception ex) + catch (Exception) { - _logger.Error(ex.Message + "\n" + ex.StackTrace); + throw; + } + finally + { + _passthroughData.BlankAllData(); + _liveDataWindow.LiveDataWindowViewModel.UutPowerLedImagePath = _liveDataWindow.LiveDataWindowViewModel.ImageToResourcePathDict[LiveDataWindowViewModel.Images.LED_OFF]; } _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting..."); } - static float GenerateRandomFraction() + /// + /// Simulate passthrough data + /// + private void SimulatePassThroughData() { Random rnd = new Random(); - int randNum = 0; - const int minimum = 1; - randNum = rnd.Next(20); + float num = 70.0f + Util.GenerateRandomFraction(); + _passthroughData.SetValue(PassthroughData.Variables.VAR01, num.ToString("0.00")); - if (randNum <= minimum) - { - randNum += minimum; - } - - return (float)(1.0 / (float)randNum); + Thread.Sleep(100); + num = 30.0f + Util.GenerateRandomFraction(); + _passthroughData.SetValue(PassthroughData.Variables.VAR02, num.ToString("0.00")); + Thread.Sleep(200); + num = 40.0f + Util.GenerateRandomFraction(); + _passthroughData.SetValue(PassthroughData.Variables.VAR03, num.ToString("0.00")); + Thread.Sleep(100); + num = 50.0f + Util.GenerateRandomFraction(); + _passthroughData.SetValue(PassthroughData.Variables.VAR04, num.ToString("0.00")); + Thread.Sleep(100); + num = 60.0f + Util.GenerateRandomFraction(); + _passthroughData.SetValue(PassthroughData.Variables.VAR05, num.ToString("0.00")); + Thread.Sleep(200); + num = 10.0f + Util.GenerateRandomFraction(); + _passthroughData.SetValue(PassthroughData.Variables.VAR06, num.ToString("0.00")); } + + } } diff --git a/Source/Program/Threads/PowerSupplyReadThread.cs b/Source/Program/Threads/PowerSupplyReadThread.cs index d464a5f..4871e10 100644 --- a/Source/Program/Threads/PowerSupplyReadThread.cs +++ b/Source/Program/Threads/PowerSupplyReadThread.cs @@ -32,6 +32,7 @@ namespace ProgramLib private enum Events { GLOBAL_QUIT, + QUIT, UUT_POWER_ON, UUT_POWER_OFF, @@ -46,22 +47,21 @@ namespace ProgramLib private List _powerModuleNameList; + private int _pollRateMs; + Dictionary _powerSupplyModuleInfoDict; /// /// Constructor /// - public PowerSupplyReadThread(string powerSupplySystemName) + public PowerSupplyReadThread(string powerSupplySystemName, int pollRateMs) { _logger = LogManager.GetCurrentClassLogger(); _powerSupplySystemName = powerSupplySystemName; - } + _pollRateMs = pollRateMs; - ~PowerSupplyReadThread() - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); } /// @@ -77,6 +77,7 @@ namespace ProgramLib { Dictionary eventDict = new Dictionary(); eventDict[Events.GLOBAL_QUIT] = Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT]; + eventDict[Events.QUIT] = _quitEvent; eventDict[Events.UUT_POWER_ON] = Program.Instance().EventManager[EventManager.Events.UUT_POWER_ON]; eventDict[Events.EVENT_TIMED_OUT] = null; @@ -113,13 +114,13 @@ namespace ProgramLib /// private void ReadPowerSupplyData() { - int pollRateMs = 1000; _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() for {_powerSupplySystemName} is running..."); try { Dictionary eventDict = new Dictionary(); eventDict[Events.GLOBAL_QUIT] = Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT]; + eventDict[Events.QUIT] = _quitEvent; eventDict[Events.UUT_POWER_OFF] = Program.Instance().EventManager[EventManager.Events.UUT_POWER_OFF]; eventDict[Events.EVENT_TIMED_OUT] = null; @@ -127,7 +128,7 @@ namespace ProgramLib while (true) { - Events id = eventGroup.WaitAny(pollRateMs); + Events id = eventGroup.WaitAny(_pollRateMs); if (id == Events.EVENT_TIMED_OUT) { @@ -143,6 +144,8 @@ namespace ProgramLib if (!ovpTriggeredInPowerSupply && !ocpTriggeredInPowerSupply) { Program.Instance().PowerSupplySharedData.SetData(moduleName, data.Voltage, data.Current, _powerSupplyModuleInfoDict[moduleName]); + + CheckVoltageWithinLimits(moduleName, data.Voltage); } else { @@ -157,9 +160,7 @@ namespace ProgramLib errorMsg = moduleName + "'s OCP circuitry has tripped"; } - HandleOutOfToleranceCondition(errorMsg); - - break; + throw new Exception(errorMsg); } } } @@ -169,68 +170,30 @@ namespace ProgramLib } catch (Exception ex) { - _logger.Error(ex.Message + "\n" + ex.StackTrace); + if (!Program.Instance().EventManager[EventManager.Events.FATAL_FAILURE].WaitOne(0)) + { + Program.Instance().SetFatalFailureExceptionFromSupportThread(ex); + Program.Instance().EventManager[EventManager.Events.FATAL_FAILURE].Set(); + } } _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() for {_powerSupplySystemName} is exiting..."); } - /// - /// Check for current's upper limit - /// - /// - /// - private bool IsCurrentWithinLimits(string moduleName, double current) - { - bool outOfLimits = false; - - // Duc - is this function needed? - //Raytheon.Instruments.PowerSupplies.PowerSupplyModuleInfo powerSupplyModuleInfo = _powerSupplyModuleInfoDict[moduleName]; - - //if ((current < powerSupplyModuleInfo.currentLowerLimit_ || current > powerSupplyModuleInfo.currentUpperLimit_) && powerSupplyModuleInfo.isOn_) - //{ - // outOfLimits = true; - // string errorMsg = moduleName + "'s current is out of limits (" + powerSupplyModuleInfo.currentLowerLimit_.ToString("0.00") + "," + powerSupplyModuleInfo.currentUpperLimit_.ToString("0.00") + "). Current reading: " + current.ToString("0.00"); - // HandleOutOfToleranceCondition(errorMsg); - //} - - return outOfLimits; - } - /// /// Check for voltage's limit exceedence /// /// /// - private bool IsVoltageWithinLimits(string moduleName, double voltage) + private void CheckVoltageWithinLimits(string moduleName, double voltage) { - bool outOfLimits = false; - // Duc - is this function needed? - //Raytheon.Instruments.PowerSupplies.PowerSupplyModuleInfo powerSupplyModuleInfo = _powerSupplyModuleInfoDict[moduleName]; + PowerSupplyModuleInfo powerSupplyModuleInfo = _powerSupplyModuleInfoDict[moduleName]; - //if ((voltage < powerSupplyModuleInfo.voltageLowerLimit_ || voltage > powerSupplyModuleInfo.voltageUpperLimit_) && powerSupplyModuleInfo.isOn_) - //{ - // outOfLimits = true; - // string errorMsg = moduleName + "'s voltage is out of limits (" + powerSupplyModuleInfo.voltageLowerLimit_.ToString("0.00") + "," + powerSupplyModuleInfo.voltageUpperLimit_.ToString("0.00") + "). Voltage reading: " + voltage.ToString("0.00"); - // HandleOutOfToleranceCondition(errorMsg); - //} - - return outOfLimits; - } - - /// - /// Handle power fault conditions - /// - /// - /// - private void HandleOutOfToleranceCondition(string errorMsg) - { - if (!Program.Instance().EventManager[EventManager.Events.FATAL_FAILURE].WaitOne(0)) + if ((voltage < powerSupplyModuleInfo.voltageLowerLimit_ || voltage > powerSupplyModuleInfo.voltageUpperLimit_) && powerSupplyModuleInfo.isOn_) { - Program.Instance().SetFatalErrorMsgFromSupportThread(errorMsg); - Program.Instance().EventManager[EventManager.Events.FATAL_FAILURE].Set(); + string errorMsg = moduleName + "'s voltage is out of limits (" + powerSupplyModuleInfo.voltageLowerLimit_.ToString("0.00") + "V, " + powerSupplyModuleInfo.voltageUpperLimit_.ToString("0.00") + "V). Voltage reading: " + voltage.ToString("0.00") + "V"; + throw new Exception(errorMsg); } } - } } diff --git a/Source/Program/Threads/PowerSupplyUpdateThread.cs b/Source/Program/Threads/PowerSupplyUpdateThread.cs index 5976e08..d095954 100644 --- a/Source/Program/Threads/PowerSupplyUpdateThread.cs +++ b/Source/Program/Threads/PowerSupplyUpdateThread.cs @@ -15,12 +15,14 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; using NLog; using ProgramLib.GUI.Model; using ProgramLib.GUI.View; -using System; -using System.Collections.Generic; -using System.Threading; namespace ProgramLib { @@ -32,6 +34,7 @@ namespace ProgramLib private enum Events { GLOBAL_QUIT, + QUIT, UUT_POWER_ON, UUT_POWER_OFF, @@ -41,31 +44,51 @@ namespace ProgramLib } private ILogger _logger; - private LiveDataWindow _mainWindow; + private LiveDataWindow _liveDataWindow; - private Dictionary _powerModuleToPowerDataModelDict = new Dictionary(); + private Dictionary _powerModuleToPowerDataModelDict = new Dictionary(StringComparer.OrdinalIgnoreCase); + int _pollRateMs; + private StreamWriter _fileWriter; + private List _powerModulesToBeDisplayed = new List(); + private string _logNamePrefix; + private string _logFileExtension; /// /// Constructor /// - public PowerSupplyUpdateThread() + public PowerSupplyUpdateThread(int pollRateMs, string logNamePrefix, string logFileExtension) { - _logger = LogManager.GetCurrentClassLogger(); - - _mainWindow = (LiveDataWindow)ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA]; - - _powerModuleToPowerDataModelDict["UUT_P20V"] = new PowerModuleDataModel(); - _powerModuleToPowerDataModelDict["UUT_N20V"] = new PowerModuleDataModel(); - - ProgramLib.Program.Instance().GetGuiManager()[ProgramGuiManager.WINDOWS.LIVE_DATA].Dispatcher.Invoke((Action)delegate + try { - _mainWindow.LiveDataWindowViewModel.AddPowerData(_powerModuleToPowerDataModelDict); - }); - } + _logger = LogManager.GetCurrentClassLogger(); - ~PowerSupplyUpdateThread() - { - _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); + _pollRateMs = pollRateMs; + + _logNamePrefix = logNamePrefix; + + _logFileExtension = logFileExtension; + + _liveDataWindow = (LiveDataWindow)ProgramLib.Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.LIVE_DATA]; + + ParseConfig(); + + foreach (string powerModule in _powerModulesToBeDisplayed) + { + if (!_powerModuleToPowerDataModelDict.ContainsKey(powerModule)) + { + _powerModuleToPowerDataModelDict[powerModule] = new PowerModuleDataModel(); + _powerModuleToPowerDataModelDict[powerModule].Name = powerModule; + _liveDataWindow.Dispatcher.Invoke((Action)delegate + { + _liveDataWindow.LiveDataWindowViewModel.AddPowerData(_powerModuleToPowerDataModelDict[powerModule]); + }); + } + } + } + catch (Exception) + { + throw; + } } /// @@ -81,6 +104,7 @@ namespace ProgramLib { Dictionary eventDict = new Dictionary(); eventDict[Events.GLOBAL_QUIT] = Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT]; + eventDict[Events.QUIT] = _quitEvent; eventDict[Events.UUT_POWER_ON] = Program.Instance().EventManager[EventManager.Events.UUT_POWER_ON]; eventDict[Events.EVENT_TIMED_OUT] = null; @@ -114,47 +138,105 @@ namespace ProgramLib /// private void UpdatePowerSupplyData() { - int pollRateMs = 1000; _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running..."); try { Dictionary eventDict = new Dictionary(); eventDict[Events.GLOBAL_QUIT] = Program.Instance().EventManager[EventManager.Events.GLOBAL_QUIT]; + eventDict[Events.QUIT] = _quitEvent; eventDict[Events.UUT_POWER_OFF] = Program.Instance().EventManager[EventManager.Events.UUT_POWER_OFF]; eventDict[Events.EVENT_TIMED_OUT] = null; EventGroup eventGroup = new EventGroup(eventDict); + const string LOG_PREFIX = "DateTime,Module,Voltage,VoltageSetpoint,Current,IsOutputOn"; + string logFilePath = Path.Combine(Program.Instance().FileAndFolderManager.GetFolder(FileAndFolderManager.Folders.DATA_TEST), Util.GenerateUniqueFilenameUsingDateTime(_logNamePrefix, _logFileExtension)); + _fileWriter = new StreamWriter(logFilePath); + _fileWriter.Write(LOG_PREFIX); + _fileWriter.Flush(); + while (true) { - Events id = eventGroup.WaitAny(pollRateMs); + Events id = eventGroup.WaitAny(_pollRateMs); if (id == Events.EVENT_TIMED_OUT) { - PowerSupplyData data = Program.Instance().PowerSupplySharedData.GetData("STE_PVM_5V"); - - if (data != null && data.Initialized) + string logText = String.Empty; + foreach (string powerModule in Program.Instance().PowerSupplySharedData.GetAllPowerModules()) { - _powerModuleToPowerDataModelDict["UUT_P20V"].ActualVoltage = data.Voltage.ToString("0.00"); - _powerModuleToPowerDataModelDict["UUT_P20V"].ExpectedVoltage = data.PowerSupplyModuleInfo.voltageSetpoint_.ToString("0.00"); - _powerModuleToPowerDataModelDict["UUT_P20V"].ActualCurrent = data.Current.ToString("0.00"); + PowerSupplyData data = Program.Instance().PowerSupplySharedData.GetData(powerModule); + + if (data != null && data.Initialized) + { + if (_powerModuleToPowerDataModelDict.ContainsKey(powerModule)) + { + _powerModuleToPowerDataModelDict[powerModule].ActualVoltage = data.Voltage.ToString("0.00"); + _powerModuleToPowerDataModelDict[powerModule].ExpectedVoltage = data.PowerSupplyModuleInfo.voltageSetpoint_.ToString("0.00"); + _powerModuleToPowerDataModelDict[powerModule].ActualCurrent = data.Current.ToString("0.00"); + } + } + + if (!String.IsNullOrEmpty(logText)) + logText += "\r\n"; + + logText += DateTime.Now.ToString("yyyy_MM_dd") + "_" + DateTime.Now.ToString("HH_mm_ss") + "," + powerModule + "," + data.Voltage.ToString("0.00") + + "," + data.PowerSupplyModuleInfo.voltageSetpoint_.ToString("0.00") + "," + data.Current.ToString("0.00") + "," + data.PowerSupplyModuleInfo.isOn_.ToString(); - _powerModuleToPowerDataModelDict["UUT_N20V"].ActualVoltage = data.Voltage.ToString("0.00"); - _powerModuleToPowerDataModelDict["UUT_N20V"].ExpectedVoltage = data.PowerSupplyModuleInfo.voltageSetpoint_.ToString("0.00"); - _powerModuleToPowerDataModelDict["UUT_N20V"].ActualCurrent = data.Current.ToString("0.00"); } + + // log out the data + _fileWriter.WriteLine(logText); + _fileWriter.Flush(); } else break; } } - catch (Exception ex) + catch (Exception) { - _logger.Error(ex.Message + "\n" + ex.StackTrace); + throw; + } + finally + { + if (_fileWriter != null) + { + _fileWriter.Flush(); + _fileWriter.Close(); + _fileWriter = null; + } + + foreach (KeyValuePair item in _powerModuleToPowerDataModelDict) + { + item.Value.ExpectedVoltage = ""; + item.Value.ActualVoltage = ""; + item.Value.ActualCurrent = ""; + } } _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting..."); } + + /// + /// Parse ini file + /// + public void ParseConfig() + { + try + { + List keys = Program.Instance().ProgramSpecificConfig.ReadAllKeys(ProgramSpecificConfigIni.POWER_MODULES_TO_BE_DISPLAYED.ToString()); + foreach (string key in keys) + { + string powerSupplyModule = Program.Instance().ProgramSpecificConfig.ReadValue(ProgramSpecificConfigIni.POWER_MODULES_TO_BE_DISPLAYED.ToString(), key); + + if (!_powerModulesToBeDisplayed.Contains(powerSupplyModule, StringComparer.OrdinalIgnoreCase)) + _powerModulesToBeDisplayed.Add(powerSupplyModule); + } + } + catch (Exception) + { + throw; + } + } } } diff --git a/Source/Program/Threads/TacticalUartReadThread.cs b/Source/Program/Threads/TacticalUartReadThread.cs new file mode 100644 index 0000000..325978c --- /dev/null +++ b/Source/Program/Threads/TacticalUartReadThread.cs @@ -0,0 +1,93 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using NLog; +using Raytheon.Instruments; + +namespace ProgramLib +{ + /// + /// Thread to read tactical UART data + /// + internal class TacticalUartReadThread : BasicThread + { + private ILogger _logger; + + public static ConcurrentQueue _byteQueue = new ConcurrentQueue(); + + /// + /// Constructor + /// + public TacticalUartReadThread() + { + _logger = LogManager.GetCurrentClassLogger(); + _byteQueue = new ConcurrentQueue(); + } + + ~TacticalUartReadThread() + { + _logger.Debug($"Waiting for {this.GetType().Name} to exit..."); + WaitForExit(); + } + + /// + /// Method that executes on the thread. + /// + protected override void DoWork() + { + _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is running..."); + + string serialDeviceInstanceName = Program.Instance().ProgramSpecificConfig.ReadValue("UART_INFO", "SERIAL_DEVICE_INSTANCE_NAME"); + ICommDevice _serialDevice = (ICommDevice)Program.Instance().InstrumentManager.GetGenericInstrument(serialDeviceInstanceName); + DateTime startDateTime = DateTime.Now; + const int MAX_PBIT_WAIT_SEC = 17; + + try + { + byte[] receiveByteArray = null; + uint numBytesRead = 0; + do + { + try + { + numBytesRead = _serialDevice.Read(ref receiveByteArray); + List bytelist = receiveByteArray.ToList(); + _byteQueue.Enqueue(bytelist.Skip(0).Take((int)numBytesRead).ToArray()); + } + catch { } + + TimeSpan ts = DateTime.Now - startDateTime; + + if (ts.TotalSeconds > MAX_PBIT_WAIT_SEC) + break; + } + while (true); + } + catch (Exception ex) + { + _logger.Error(ex.Message + "\n" + ex.StackTrace); + } + + _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() is exiting..."); + + } + } +} diff --git a/Source/ProgramPostBuild/ConfigFiles/NLog.config b/Source/ProgramPostBuild/ConfigFiles/NLog.config new file mode 100644 index 0000000..bc5607f --- /dev/null +++ b/Source/ProgramPostBuild/ConfigFiles/NLog.config @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/ProgramPostBuild/ConfigFiles/config.ini b/Source/ProgramPostBuild/ConfigFiles/config.ini new file mode 100644 index 0000000..158db2c --- /dev/null +++ b/Source/ProgramPostBuild/ConfigFiles/config.ini @@ -0,0 +1,3 @@ +[TESTSTAND] +DLL_PATH = ..\..\..\..\_Deployment\MTS +TESTSTAND_SEQUENCE_PATH = ..\..\..\..\_Deployment\TestStand diff --git a/Source/ProgramPostBuild/Dependencies/NLogWrapper.Part.dll b/Source/ProgramPostBuild/Dependencies/NLogWrapper.Part.dll new file mode 100644 index 0000000..7a303d5 Binary files /dev/null and b/Source/ProgramPostBuild/Dependencies/NLogWrapper.Part.dll differ diff --git a/Source/ProgramPostBuild/ProgramPostBuild.cs b/Source/ProgramPostBuild/ProgramPostBuild.cs new file mode 100644 index 0000000..42c1389 --- /dev/null +++ b/Source/ProgramPostBuild/ProgramPostBuild.cs @@ -0,0 +1,190 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; + +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using NLog; +using Raytheon.Common; + +namespace ProgramPostBuild +{ + /// + /// Perform any needed function after Program project is built + /// + internal class Program + { + private static ILogger _logger; + private static object syncObj = new object(); + private static Dictionary dllNameDict = new Dictionary(); + + static void Main(string[] args) + { + _logger = LogManager.GetCurrentClassLogger(); + + ModifyDllPathsInTestStandSequences(); + } + + /// + /// Modify paths to DLLs in TestStand sequence files + /// + static void ModifyDllPathsInTestStandSequences() + { + string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + IConfigurationFile config = new ConfigurationFile(Path.Combine(assemblyFolder, "config.ini")); + + string dllPath = config.ReadValue("TESTSTAND", "DLL_PATH"); + dllPath = Path.GetFullPath(Path.Combine(assemblyFolder, dllPath)); + string testStandSequencePath = config.ReadValue("TESTSTAND", "TESTSTAND_SEQUENCE_PATH"); + testStandSequencePath = Path.GetFullPath(Path.Combine(assemblyFolder, testStandSequencePath)); + + if (Directory.Exists(dllPath) && Directory.Exists(testStandSequencePath)) + { + // get all DLL files + string[] dllFileArray = Directory.GetFiles(dllPath, "*.dll"); + + // get all teststand sequence files + List seqFileList = Directory.GetFiles(testStandSequencePath, "*.seq", SearchOption.AllDirectories).ToList(); + + int maxTaskNum = Environment.ProcessorCount; + List taskList = new List(); + + while (seqFileList.Count > 0) + { + if (taskList.Count < maxTaskNum) + { + string seqFilePath = seqFileList[0]; + taskList.Add(Task.Factory.StartNew(() => ModifyDllPathsInTestStandSequence(seqFilePath, dllFileArray))); + seqFileList.RemoveAt(0); + } + else + { + int index = Task.WaitAny(taskList.ToArray()); + taskList.RemoveAt(index); + } + } + + Task.WaitAll(taskList.ToArray()); + } + } + + /// + /// Modify paths to DLLs in a TestStand sequence + /// + static void ModifyDllPathsInTestStandSequence(string seqFilePath, string[] dllFileArray) + { + string seqNewContent = ""; + FileStream fs = new FileStream(seqFilePath, FileMode.Open, FileAccess.Read); + StreamReader reader = new StreamReader(fs, Encoding.Default); + + string line; + Console.WriteLine($"Processing {seqFilePath}"); + while ((line = reader.ReadLine()) != null) + { + Match regexMatch; + + regexMatch = Regex.Match(line, @".+\\([^\.]+\.dll)", RegexOptions.IgnoreCase); + + if (regexMatch.Success) + { + string dllFile = regexMatch.Groups[1].Value; + + bool dllExists = false; + string[] dllStringArray = null; + int index = 0; + string[] seqStringArray = seqFilePath.Split('\\'); + + lock (syncObj) + { + if (dllNameDict.ContainsKey(dllFile)) + { + dllStringArray = dllNameDict[dllFile].Split('\\'); + dllExists = true; + } + } + + if (!dllExists) + { + foreach (string dllFilePath in dllFileArray) + { + if (Regex.IsMatch(dllFilePath, Regex.Escape(dllFile) + @"$", RegexOptions.IgnoreCase)) + { + lock (syncObj) + { + dllStringArray = dllFilePath.Split('\\'); + + if (!dllNameDict.ContainsKey(dllFile)) + { + dllNameDict[dllFile] = dllFilePath; + } + } + + break; + } + } + } + + while (String.Equals(dllStringArray[index], seqStringArray[index], StringComparison.OrdinalIgnoreCase)) + { + index++; + } + + int numGoBacks = seqStringArray.Length - (index + 1); + + string goBackString = String.Empty; + for (int i = 1; i <= numGoBacks; i++) + { + if (!String.IsNullOrEmpty(goBackString)) + goBackString += @"\"; + goBackString += ".."; + } + + string goForwardString = String.Empty; + + for (int i = index; i < dllStringArray.Length; i++) + { + if (!String.IsNullOrEmpty(goForwardString)) + goForwardString += @"\"; + goForwardString += dllStringArray[i]; + } + + string newRelPath = Path.Combine(goBackString, goForwardString); + + line = Regex.Replace(line, @"(.+\\[^\.]+\.dll)", "" + newRelPath + "", RegexOptions.IgnoreCase); + + } + + seqNewContent += line + "\r\n"; + } + + reader.Close(); + fs.Close(); + + FileStream fs2 = null; + StreamWriter writer = null; + try + { + fs2 = new FileStream(seqFilePath, FileMode.Create, FileAccess.ReadWrite); + writer = new StreamWriter(fs2, Encoding.Default); + writer.Write(seqNewContent); + } + catch (System.Exception ex) + { + throw ex; + } + finally + { + if (writer != null) + { + writer.Close(); + fs2.Close(); + } + } + + Console.WriteLine($"Completed {seqFilePath}"); + } + } +} diff --git a/Source/ProgramPostBuild/ProgramPostBuild.csproj b/Source/ProgramPostBuild/ProgramPostBuild.csproj new file mode 100644 index 0000000..4c02293 --- /dev/null +++ b/Source/ProgramPostBuild/ProgramPostBuild.csproj @@ -0,0 +1,35 @@ + + + + net472 + exe + Raytheon Technologies + Raytheon Common Library + Raytheon Common Library + TEEC + Copyright © Raytheon Technologies $([System.DateTime]::get_now().ToString("yyyy")) + + + + + + 1.3.0 + Debug;Release;Deploy + 8.0 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/Solution.props b/Source/Solution.props index 27591c5..f235eb9 100644 --- a/Source/Solution.props +++ b/Source/Solution.props @@ -25,7 +25,11 @@ true - $(SolutionDir)HalTempFolder + $(SolutionDir)HalTempFolder\ + + $(SolutionDir)_Deployment\ + + $(DeploymentFolder)MTS\ diff --git a/Source/TSRealLib/Common/Raytheon.Common/COE/Dependecies/x86/coeWindows-shared.dll b/Source/TSRealLib/Common/Raytheon.Common/COE/Dependecies/x86/coeWindows-shared.dll new file mode 100644 index 0000000..3c4782b Binary files /dev/null and b/Source/TSRealLib/Common/Raytheon.Common/COE/Dependecies/x86/coeWindows-shared.dll differ diff --git a/Source/TSRealLib/Common/Raytheon.Common/COE/Dependecies/x86/readme.txt b/Source/TSRealLib/Common/Raytheon.Common/COE/Dependecies/x86/readme.txt new file mode 100644 index 0000000..4afb701 --- /dev/null +++ b/Source/TSRealLib/Common/Raytheon.Common/COE/Dependecies/x86/readme.txt @@ -0,0 +1,11 @@ +coeWindows-shared.dll must be built from the "coeWindows-shared" project in the NGSRI_TE_Common_SRNSTE72374 repo https://tfs.rms.ray.com/TE/NGSRI_TE/_git/NGSRI_TE_Common_SRNSTE72374 +Branch: Dev +Commit: 748d125cceab2fb7988876b425313b48f83fe04f +COE version: v04.09.00.56 + +Had to fix a bug in "coeWindows-shared" code where it doesn't process the flag TCP_SELECT_VALUE which determine whether COE messaging goes through TCP or UDP in TCP mode. So it always uses UDP mode for COE messaging no matter what we set for TCP_SELECT_VALUE. +Need Windows SDK Version 10.0.22621.0 in order to build + +This DLL must be built in release mode. If need to debug, rebuild the project in debug mode and replace this DLL with it. +Only use debug DLL for debugging only. Otherwise, need to use the release DLL in order to process COE messages as fast as possible. + \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/BitFieldGeneric.cs b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/BitFieldGeneric.cs similarity index 99% rename from Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/BitFieldGeneric.cs rename to Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/BitFieldGeneric.cs index 384cb7c..e40188f 100644 --- a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/BitFieldGeneric.cs +++ b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/BitFieldGeneric.cs @@ -32,7 +32,7 @@ // ********************************************************************************************************** using System; -namespace Raytheon.Instruments.MessagingUtilities +namespace Raytheon.Common.Coe { // This is a generic class used to apply a bitfield to // a value to get the desired value diff --git a/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/BytePackingXml.cs b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/BytePackingXml.cs new file mode 100644 index 0000000..c4de9bd --- /dev/null +++ b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/BytePackingXml.cs @@ -0,0 +1,525 @@ +// ********************************************************************************************************** +// BytePackingXml.cs +// 5/18/2022 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.RegularExpressions; +using System.Xml; +using System.Xml.XPath; + +namespace Raytheon.Common.Coe +{ + // Takes an XML ICD and adds in nodes to represent the byte packing + // The padding added will be displayed in the tool as arrays of characters + internal class BytePackingXml : XmlDocument + { + private readonly int m_Packing = 0; + private readonly Dictionary m_ConstMap; + private readonly Dictionary m_SizeMap; + private readonly Dictionary m_PadMap; + + public BytePackingXml(string icdStr) : base() + { + // Create the dictionaries + m_ConstMap = new Dictionary(); + m_PadMap = new Dictionary(); + m_SizeMap = new Dictionary(); + + // Create an XML document from the string + LoadXml(icdStr); + + XPathNavigator node = CreateNavigator(); + //Get the type of packing + XPathNodeIterator nodeset = node.Select("/interface/packing"); + if (nodeset.MoveNext() == true) + { + if (!Parse.Try(nodeset.Current.Value.Trim(), out m_Packing)) + { + switch (nodeset.Current.Value.Trim()) + { + case "char": + case "1": + m_Packing = 1; + break; + case "short": + case "2": + m_Packing = 2; + break; + case "long": + case "4": + m_Packing = 4; + break; + case "double": + case "8": + default: + m_Packing = 8; + break; + } + } + } + + // Handle all of the constants + nodeset = node.Select("/interface/constant|/interface/namespace/constant"); + while (nodeset.MoveNext()) + { + ProcessConstantNode(nodeset.Current); + } + + nodeset = node.Select("/interface/typedef|/interface/namespace/typedef"); + while (nodeset.MoveNext()) + { + ProcessTypedefNode(nodeset.Current); + } + + nodeset = node.Select("/interface/enum|/interface/namespace/enum"); + while (nodeset.MoveNext()) + { + ProcessEnumerationNode(nodeset.Current); + } + + nodeset = node.Select("/interface/structure|/interface/message|/interface/namespace/structure|/interface/namespace/message"); + while (nodeset.MoveNext()) + { + ProcessStructureNode(nodeset.Current); + } + + NormalizeIcdLabels(); + } + + // This function takes all of the messages in the ICD + // and converts the labels into decimal, so when we do + // a string lookup, they will all be in the same known format + private void NormalizeIcdLabels() + { + XPathNavigator navigator = CreateNavigator(); + XPathNodeIterator nodeset; + + nodeset = navigator.Select("/interface/message/label|/interface/namespace/message/label"); + while (nodeset.MoveNext()) + { + try + { + double dLabel = GetConstFromString(nodeset.Current.Value); + nodeset.Current.SetValue(((int)dLabel).ToString()); + } + catch + { + throw new Exception("Message Label, " + nodeset.Current.Value + ", can not be converted to an integer"); + } + } + } + + private void ProcessConstantNode(XPathNavigator node) + { + string name = ""; + string constStr = ""; + double constNum = 0; + + if (node.MoveToChild("name", "")) + { + name = node.Value.Trim(); + node.MoveToParent(); + } + if (node.MoveToChild("value", "")) + { + constStr = node.Value.Trim(); + if ((constStr.Length != 0) && (constStr[0] != '\"')) + { + constNum = GetConstFromString(constStr); + } + else + { + constNum = 0; + } + node.MoveToParent(); + } + + // Verify the correctnes of the tag + if ((name != "") && (constStr != "")) + { + AddItemToMap(m_ConstMap, name, constNum); + } + else + { + throw new Exception( + "ERROR: Constant Definition Incorrect - :" + name + + " :" + constStr); + } + } + + private void ProcessTypedefNode(XPathNavigator node) + { + string name = ""; + string type = ""; + int typeSize = 0; // Size of the item + int typePad = 0; //Size of the largest item to pad to + + if (node.MoveToChild("name", "")) + { + name = node.Value.Trim(); + node.MoveToParent(); + } + if (node.MoveToChild("value", "")) + { + type = node.Value.Trim(); + GetSizeFromType(type, out typeSize, out typePad); + node.MoveToParent(); + } + + // Verify the correctnes of the tag + if ((name != "") && (type != "")) + { + AddItemToMap(m_PadMap, name, typePad); + AddItemToMap(m_SizeMap, name, typeSize); + } + else + { + throw new Exception( + "ERROR: Typedef Definition Incorrect - :" + name + + " :" + type); + } + } + + private void ProcessEnumerationNode(XPathNavigator node) + { + string name; + double constNum = 0; + var constStr = string.Empty; + + if (node.MoveToChild("name", "")) + { + name = node.Value.Trim(); + AddItemToMap(m_PadMap, name, 4); + AddItemToMap(m_SizeMap, name, 4); + node.MoveToParent(); + } + else + { + throw new Exception("ERROR: Enumeration Definition Incorrect. No tag present."); + } + + XPathNodeIterator nodeSet = node.Select("item|enum_item"); + while (nodeSet.MoveNext()) + { + name = string.Empty; + + if ((nodeSet.Current.MoveToChild("name", "")) || + (nodeSet.Current.MoveToChild("item_name", ""))) + { + name = nodeSet.Current.Value.Trim(); + nodeSet.Current.MoveToParent(); + } + if (nodeSet.Current.MoveToChild("value", "")) + { + constStr = nodeSet.Current.Value.Trim(); + constNum = GetConstFromString(constStr); + nodeSet.Current.MoveToParent(); + } + + // Verify the correctnes of the tag + if ((name != "") && (constStr != "")) + { + AddItemToMap(m_ConstMap, name, constNum); + } + else + { + throw new Exception($"ERROR: Enumeration Item Definition Incorrect - : {name} : {constStr}"); + } + } + } + + private void ProcessStructureNode(XPathNavigator node) + { + string name; + + if (node.MoveToChild("name", "")) + { + name = node.Value.Trim(); + node.MoveToParent(); + } + else + { + throw new Exception("ERROR: Stucture/Message Definition Incorrect. No tag present."); + } + + int maxSize = 0; + int padCount = 0; + uint bitCount = 0; // Used to see how many bits have been processed. + int lastItemSize = 0; + + var nodeSet = node.Select("item|struct_item|msg_item"); + while (nodeSet.MoveNext()) + { + GetItemSize(nodeSet.Current, out int padSize, out int itemSize, out int reps, out uint bits); + if ((lastItemSize != itemSize) || ((bitCount + bits) > (uint)(itemSize * 8))) + { + bitCount = 0; // Size changed or bit rollover + } + + if (bitCount == 0) + { + padCount += AddPadding(node, nodeSet.Current, padSize, padCount); + + // Set maxSize + if (padSize > maxSize) + { + maxSize = padSize; + } + + // Keep up with the pad count + padCount += (itemSize * reps); + } + + lastItemSize = itemSize; + bitCount += bits; + } + + if (maxSize != 0) + { + // Add final padding + padCount += AddPadding(node, null, maxSize, padCount); + } + + AddItemToMap(m_PadMap, name, maxSize); + AddItemToMap(m_SizeMap, name, padCount); + } + + private void GetItemSize(XPathNavigator node, out int padSize, out int itemSize, out int reps, out uint bits) + { + string name = ""; + + if ((node.MoveToChild("name", "")) || + (node.MoveToChild("item_name", ""))) + { + name = node.Value.Trim(); + node.MoveToParent(); + } + + itemSize = -1; + padSize = -1; + reps = 1; + bits = 0; + + var nodeSet = node.Select("type"); + while (nodeSet.MoveNext()) + { + GetSizeFromType(nodeSet.Current.Value.Trim(), out padSize, out itemSize); + } + + nodeSet = node.Select("bits"); + if (nodeSet.MoveNext()) + { + bits = (uint)GetConstFromString(nodeSet.Current.Value.Trim()); + } + + nodeSet = node.Select("arrayLength|imageWidth|imageHeight"); + while (nodeSet.MoveNext()) + { + try + { + reps *= (int)GetConstFromString(nodeSet.Current.Value.Trim()); + } + catch (Exception e) + { + throw new Exception + (e.Message + " item name = \"" + name + "\", tag = <" + + nodeSet.Current.Name + ">."); + + } + } + + if ((itemSize == -1) || (padSize == -1)) + { + throw new Exception + ("ERROR: Item named " + name + "does not contain a tag."); + } + + if (bits == 0) + bits = (uint)padSize * 8; + } + + private double GetConstFromString(string constStr) + { + // remove namespace + constStr = Regex.Replace(constStr, @"[^:]+::([^:]+)", "$1"); + if ((constStr.Length > 0) && (constStr[0] == '\'')) + { + byte charData = (byte)constStr[1]; + constStr = charData.ToString(); + } + + if (Parse.Try(constStr, out double data) == false) + { + if (Parse.Try(constStr, out int iData) == false) + { + try + { + data = m_ConstMap[constStr]; + } + catch + { + throw new Exception("ERROR: ConstantValue - \"" + constStr + "\" does not resolve to a number."); + } + } + else + { + data = (double)iData; + } + } + return data; + } + + private void AddItemToMap(Dictionary map, string name, int value) + { + if (map.ContainsKey(name)) + { + throw new Exception("ERROR: Element " + name + " is defined multiple times."); + } + else + { + map.Add(name, value); + } + } + + private void AddItemToMap(Dictionary map, string name, double value) + { + if (map.ContainsKey(name)) + { + throw new Exception("ERROR: Element " + name + " is defined multiple times."); + } + else + { + map.Add(name, value); + } + } + + private void GetSizeFromType(string type, out int typePad, out int typeSize) + { + // Remove all whitespace + type = type.Replace(" ", ""); + // remove namespace + type = Regex.Replace(type, @"[^:]+::([^:]+)", "$1"); + + switch (type) + { + case "uint8_t": + type = "char"; + break; + case "uint16_t": + case "int16_t": + type = "short"; + break; + case "uint32_t": + case "int32_t": + type = "int"; + break; + case "uint64_t": + case "int64_t": + type = "double"; + break; + } + + if ((type == "char")) + { + typePad = 1; + typeSize = 1; + } + else if ((type == "short")) + { + typePad = 2; + typeSize = 2; + } + else if ((Regex.IsMatch(type, @"unsigned", RegexOptions.IgnoreCase)) || (type == "int") || (type == "float") || + (type == "boolean") || (type == "address")) + { + typePad = 4; + typeSize = 4; + } + else if ((type == "double")) + { + typePad = 8; + typeSize = 8; + } + else // The type is complex and has already been defined + { + try + { + typePad = m_PadMap[type]; + typeSize = m_SizeMap[type]; + } + catch + { + throw new Exception("ERROR: - " + type + " used without being defined."); + } + } + } + + private int AddPadding(XPathNavigator ParentElement, XPathNavigator CurrentElement, int padSize, int padCount) + { + int padAdd = 0; + int padTo = padSize; + + if (m_Packing < padSize) + { + padTo = m_Packing; + } + + if (m_Packing > 0 && padTo != 0 && (padCount % padTo != 0)) + { + padAdd = padTo - (padCount % padTo); + InsertPaddingNode(ParentElement, CurrentElement, padAdd); + } + + return padAdd; + } + + private void InsertPaddingNode(XPathNavigator ParentElement, XPathNavigator CurrentElement, int padAdd) + { + string pad = "" + + "" + Message.PADDING_ITEM_NAME + "" + + "char" + + "" + padAdd + "" + + "S" + + ""; + if (CurrentElement != null) + { + CurrentElement.InsertBefore(pad); + } + else // End padding + { + ParentElement.AppendChild(pad); + } + } + + } +} diff --git a/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/Message.cs b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/Message.cs new file mode 100644 index 0000000..60cf8c1 --- /dev/null +++ b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/Message.cs @@ -0,0 +1,2309 @@ +// ********************************************************************************************************** +// Message.cs +// 5/18/2022 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** +// Ignore Spelling: Instru + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Xml; +using System.Xml.XPath; + +namespace Raytheon.Common.Coe +{ + public class Message : IEnumerable, ICloneable + { + public const string PADDING_ITEM_NAME = "****************"; + + public string Name { get { return _name; } set { _name = value; } } + public string InstruLabel => _instruLabel; + + private string _name; + private string _label; + public string Label { get => _label; } + + private string _hexLabel; + + private string _instruLabel; + private string _adapationStoreLabel; + private coeDataInterchange.FormatPacketType _packet = null; + + //private Logger Log; + private static NLog.Logger _logger = NLog.LogManager.GetCurrentClassLogger(); + private XPathNavigator Messages; + + public MessageData[] MessageDataArray; + + private int _packing = 8; + private uint _count = 0; + private readonly int _extraFieldCount = 3; + + private ulong _sendSecond = 0; + private uint _sendFracOfSec = 0; + private string _mDomain = "0"; + + private MessageXmlDocument m_Icd = null; + + //Message Maps to support faster creation. + //We only want to parse the XML once. + private Dictionary m_MsgNameMap = null; + private Dictionary m_MsgLabelMap = null; + + // Used to protect the critical section + private static readonly object m_LockObj = new object(); + + // Default values + public static string IntegerDefault = "0"; + public static string FloatDefault = "0.00"; + public static string HexXDefault = "0x0"; + public static string HexBDefault = "0x0"; + public static string BinaryDefault = "0"; + public static string BitFieldDefault = "0"; + public static string StringDefault = ""; + public static string SubimageDefault = "c:\\image.bmp"; + + public bool LogData { get; set; } + + // Default Logger object + //public static Logger m_DefaultLog = new Logger(); + + private Message() + { + LogData = true; + } + private Message(MessageXmlDocument MessageDatabase) + { + LogData = true; + m_Icd = MessageDatabase; + + // Create the static maps if necessary + if ((m_MsgNameMap == null) || (m_MsgLabelMap == null)) + { + m_MsgNameMap = new Dictionary(); + m_MsgLabelMap = new Dictionary(); + } + } + + public Message(string messageName, MessageXmlDocument messageDatabase, bool logData = true) + { + LogData = logData; + m_Icd = messageDatabase; + + // Create the static maps if necessary + if ((m_MsgNameMap == null) || (m_MsgLabelMap == null)) + { + m_MsgNameMap = new Dictionary(); + m_MsgLabelMap = new Dictionary(); + } + + if (m_MsgNameMap.ContainsKey(messageName) == true) + { + RetrieveClone((Message)m_MsgNameMap[messageName]); + } + else + { + messageDatabase.LogData = LogData; + string messageSpecificationString = messageDatabase.GetMessage(messageName); + if (messageSpecificationString == null) + { + throw new Exception(messageName + " Message not found in the ICD."); + } + else + { + Messages = messageDatabase.CreateNavigator(); + _name = messageName; + + ParseMessageString(messageSpecificationString); + + if (LogData) + _logger.Debug("Loading Message Data..."); + + Message clone = (Message)Clone(); + if (m_MsgNameMap.ContainsKey(_name) == false) + { + m_MsgNameMap.Add(_name, clone); + } + else + { + throw new Exception("Message <" + _name + "> is defined multiple times in the ICD."); + } + + if (_label != null) + { + if (m_MsgLabelMap.ContainsKey(_label) == false) + { + m_MsgLabelMap.Add(_label, clone); + } + else + { + m_MsgNameMap.Remove(_name); + throw new Exception("Message <" + _name + "> and Message <" + m_MsgLabelMap[_label]._instruLabel + + "> are both defined with Label " + _label + " in the ICD."); + } + } + } + } + } + + /// + /// This constructor populates the Message based on the Message Label + /// instead of the Message Name + /// + /// + /// + public Message(MessageXmlDocument messageDatabase, string messageLabel, bool logData = true) + { + LogData = logData; + m_Icd = messageDatabase; + + // Create the static maps if necessary + if ((m_MsgNameMap == null) || (m_MsgLabelMap == null)) + { + m_MsgNameMap = new Dictionary(); + m_MsgLabelMap = new Dictionary(); + } + + if (m_MsgLabelMap.ContainsKey(messageLabel) == true) + { + RetrieveClone((Message)m_MsgLabelMap[messageLabel]); + } + else + { + var messageSpecificationString = messageDatabase.GetMessageFromLabel(messageLabel); + if (messageSpecificationString == null) + { + throw new Exception("Message with label " + messageLabel + " not found in ICD"); + } + else + { + Messages = messageDatabase.CreateNavigator(); + + ParseMessageString(messageSpecificationString); + + if (LogData) + _logger.Debug("Loading Message Data..."); + + Message clone = (Message)Clone(); + if (m_MsgNameMap.ContainsKey(_name) == false) + { + m_MsgNameMap.Add(_name, clone); + } + if (m_MsgLabelMap.ContainsKey(_label) == false) + { + m_MsgLabelMap.Add(_label, clone); + } + } + } + } + + public MessageXmlDocument ICD + { + get { return m_Icd; } + } + + public string SendTime + { + get + { + double frac = _sendFracOfSec; + frac /= 0x100000000; + string time = _sendSecond.ToString() + frac.ToString(".00000000000000"); + return time; + } + } + + public ulong SendSecond + { + get { return _sendSecond; } + set { _sendSecond = value; } + } + + public uint SendSecondFraction + { + get { return _sendFracOfSec; } + set { _sendFracOfSec = value; } + } + + public string Domain + { + get { return _mDomain; } + set { _mDomain = value; } + } + + public static void SetDefaults + ( + string integerDefault, string floatDefault, + string hexXDefault, string hexBDefault, + string binaryDefault, string bitFieldDefault, + string stringDefault, string subimageDefault + ) + { + IntegerDefault = integerDefault; + FloatDefault = floatDefault; + HexXDefault = hexXDefault; + HexBDefault = hexBDefault; + BinaryDefault = binaryDefault; + BitFieldDefault = bitFieldDefault; + StringDefault = stringDefault; + SubimageDefault = subimageDefault; + } + + public void Default() + { + SetEnumerationType(EnumerationType.ALL_NODES); + foreach (MessageData data in this) + { + if ((data.isArray != true) && + (data.isArrayOfStructures != true) && + (data.isStructure != true)) + { + if ((data.FieldDefaultValue != null) && (data.FieldDefaultValue.Trim() != "")) + { + data.FieldValue = data.FieldDefaultValue; + } + else if ((data.FieldMinValue != null) && (data.FieldMinValue.Trim() != "")) + { + data.FieldValue = data.FieldMinValue; + } + else if ((data.FieldMaxValue != null) && (data.FieldMaxValue.Trim() != "")) + { + data.FieldValue = data.FieldMaxValue; + } + else + { + // Get the defaults from the Injection + // pane of the options window + if (data.FieldInstruType == "I") + data.FieldValue = IntegerDefault; + else if (data.FieldInstruType == "F") + data.FieldValue = FloatDefault; + else if (data.FieldInstruType == "X") + data.FieldValue = HexXDefault; + else if (data.FieldInstruType == "B") + data.FieldValue = HexBDefault; + else if (data.FieldInstruType == "N") + data.FieldValue = BinaryDefault; + else if (data.FieldInstruType == "T") + data.FieldValue = BitFieldDefault; + else if (data.FieldInstruType == "S") + data.FieldValue = StringDefault; + else if (data.FieldInstruType == "P") + data.FieldValue = SubimageDefault; + else + data.FieldValue = ""; + } + } + } + } + + public coeDataInterchange.FormatPacketType GetInstruPacket() + { + if (_packet == null) + { + int count = 0; + uint length = 1; + char instru_type; + uint size; + uint ctr = 0; + MessageData lastData = null; + coeDataInterchange.FormatType lastInstru = null; + + coeDataInterchange.FormatType[] format = new coeDataInterchange.FormatType[GetCountForDataInterchange()]; + SetEnumerationType(Message.EnumerationType.FIELDS | + Message.EnumerationType.EXPAND_ARRAYS | + Message.EnumerationType.EXPAND_STRUCTURES); + + foreach (MessageData data in this) + { + if (ctr++ < _extraFieldCount) // Skip $msg_domain, $msg_label and $msg_send_time + continue; + + // When handling bit fields, we do not know if we want to move to the + // next byte (Index) until we examine the next element. + // + // ex. unsigned x:4; unsigned y:8; Both x and y operate on the same + // byte, but we don't know the same byte is being operated on until + // we see the declaration of y. + // + // Therefore, we are going to increase the index by staying one declaration + // ahead of the Index increase. If this declaration is operating on a new + // byte, then add the size of the previous byte. The last declaration + // will then be added on the end to get the appropriate size. + if (lastData != null) + { + if (IncreaseIndex(data)) + { + length = 1; + size = GetTypeSize(lastData.FieldType, lastData.isEnum); + instru_type = lastData.FieldInstruType[0]; + if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) + { + // Strings are handled individually + length = (uint)lastData.arrayLength; + } + if (lastData.FieldInstruType == "P") + { + size = lastData.imagePixelSize; + length = lastData.imageHeight * lastData.imageWidth; + instru_type = 'X'; + } + + format[count] = + new coeDataInterchange.FormatType(lastData.FieldName, + length, + size, + instru_type); + + if (lastData.bitMask != 0) + { + if (lastInstru != null) + { + format[count].m_Repetition = 0; + format[count].m_FormatLength = GetNumBitsInMask(lastData.bitMask); + format[count].m_Format = 't'; + lastInstru.m_Repetition++; + lastInstru = null; + } + else + { + format[count].m_Repetition = 1; + format[count].m_Format = 'T'; + + format[count + 1] = + new coeDataInterchange.FormatType(lastData.FieldName, + 0, + GetNumBitsInMask(lastData.bitMask), + 't'); + count++; + } + } + + count++; + } + else + { + if (lastInstru == null) + { + format[count] = + new coeDataInterchange.FormatType(lastData.FieldName, + 0, + GetTypeSize(lastData.FieldType, lastData.isEnum), + 'T'); + lastInstru = format[count]; + count++; + } + + format[count] = + new coeDataInterchange.FormatType(lastData.FieldName, + 0, + GetNumBitsInMask(lastData.bitMask), + 't'); + lastInstru.m_Repetition++; + count++; + } + } + lastData = data; + } + + if (lastData != null) // The message has 1 or more elements + { + // Add the last element to the size + length = 1; + size = GetTypeSize(lastData.FieldType, lastData.isEnum); + instru_type = lastData.FieldInstruType[0]; + if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) + { + // Strings are handled individually + length = (uint)lastData.arrayLength; + } + if (lastData.FieldInstruType == "P") + { + size = lastData.imagePixelSize; + length = lastData.imageHeight * lastData.imageWidth; + instru_type = 'X'; + } + + if (lastData.bitMask == 0) + { + format[count] = + new coeDataInterchange.FormatType(lastData.FieldName, + length, + size, + instru_type); + } + else // (lastData.bitMask != 0) + { + if (lastInstru == null) + { + format[count] = + new coeDataInterchange.FormatType(lastData.FieldName, + 0, + size, + 'T'); + lastInstru = format[count]; + count++; + } + + format[count] = + new coeDataInterchange.FormatType(lastData.FieldName, + 0, + GetNumBitsInMask(lastData.bitMask), + 't'); + lastInstru.m_Repetition++; + } + _packet = new coeDataInterchange.FormatPacketType(_name, GetMessageSize(), (uint)format.Length, format); + } + else // There are no items in the message + { + _packet = new coeDataInterchange.FormatPacketType(_name, GetMessageSize(), 0, new coeDataInterchange.FormatType[0]); + } + } + + // FOR DEBUG PURPOSES +#if false + Debug.WriteLine(""); + Debug.WriteLine("-------------------------------------------------------------------------"); + Debug.WriteLine("Message Name = " + Packet.m_Name); + Debug.WriteLine(""); + foreach (DataInterchange.FormatType f in Packet.m_Format) + Debug.WriteLine("\"" + f.m_FieldName + + "\", " + f.m_Repetition + + ", " + f.m_FormatLength + + ", \'" + f.m_Format + + "\'"); + Debug.WriteLine("-------------------------------------------------------------------------"); +#endif + + return _packet; + } + + private uint GetNumBitsInMask(ulong mask) + { + uint count = 0; + ulong bit = 1; + for (int i = 0; i < sizeof(ulong) * 8; i++) + { + if ((bit & mask) != 0) + { + count++; + } + + bit <<= 1; + } + + return count; + } + + private void ParseMessageString(string messageSpecificationString) + { + lock (m_LockObj) + { + var messageSpecification = new XmlDocument(); + int index = 0; + + messageSpecification.LoadXml(messageSpecificationString); + var item = messageSpecification.CreateNavigator(); + + //Get the type of packing + var nodeset = item.Select("/packing"); + if (nodeset.MoveNext() == true) + { + if (!Parse.Try(nodeset.Current.Value.Trim(), out _packing)) + { + switch (nodeset.Current.Value.Trim()) + { + case "char": + _packing = 1; + break; + case "short": + _packing = 2; + break; + case "long": + _packing = 4; + break; + case "double": + default: + _packing = 8; + break; + } + } + } + + // Three extra fields will be added to the top of every + // Message in CMIT, $msg_domain, $msg_label, $msg_send_time + nodeset = item.Select("/message/item|/message/msg_item"); + MessageDataArray = new MessageData[nodeset.Count + _extraFieldCount]; + //MessageData.m_BitCounter = 0; // Reset the bit counter for each new message + + item.MoveToChild("message", ""); + if (item.MoveToChild("name", "")) + { + _name = item.Value.Trim(); + item.MoveToParent(); + } + if (item.MoveToChild("label", "")) + { + // Convert the label from whatever format it is in to decimal. + uint msgLabel = 0; + + _label = NormalizeValue(item.Value.Trim()); + + if (Parse.Try(_label, out int temp) == false) + { + throw new Exception("Message Label for " + _name + " could not be evaluated to an integer"); + } + + if (temp < 0) + { + byte[] array = BitConverter.GetBytes(temp); + msgLabel = BitConverter.ToUInt32(array, 0); + } + else + msgLabel = Convert.ToUInt32(temp); + + _label = msgLabel.ToString(); + _hexLabel = msgLabel.ToString("X"); + + item.MoveToParent(); + } + if (item.MoveToChild("instruLabel", "")) + { + _instruLabel = item.Value.Trim(); + item.MoveToParent(); + } + if (item.MoveToChild("adaptationSaveLabel", "")) + { + _adapationStoreLabel = item.Value.Trim(); + item.MoveToParent(); + } + + MessageDataArray[index] = new MessageData("$msg_domain", + "unsigned int", Domain, Domain, m_Icd); + MessageDataArray[index++].FieldInstruType = "X"; + MessageDataArray[index] = new MessageData("$msg_label", + "unsigned int", _label, _label, m_Icd); + MessageDataArray[index++].FieldInstruType = "X"; + MessageDataArray[index] = new MessageData("$msg_send_time", + "double", null, null, m_Icd); + MessageDataArray[index++].FieldInstruType = "F"; + + while (nodeset.MoveNext()) + { + AddToMessageData(nodeset.Current.Clone(), "", MessageDataArray, index++, 0); + } + } + } + + private void ParseMessageString(string messageSpecificationString, + string messageSelectionString, + string namePrefix, + MessageData parentField) + { + var messageSpecification = new XmlDocument(); + int index = 0; + + messageSpecification.LoadXml(messageSpecificationString); + XPathNavigator item = messageSpecification.CreateNavigator(); + + XPathNodeIterator nodeset = item.Select(messageSelectionString); + parentField.SetStructureSize(nodeset.Count); + + while (nodeset.MoveNext()) + { + AddToMessageData(nodeset.Current.Clone(), namePrefix, parentField.MessageArray, index++, parentField.depth + 1); + } + } + + private void AddToMessageData(XPathNavigator item, + string namePrefix, + MessageData[] dataArray, + int arrayIndex, + int depth) + { + + string fieldName = null; + string fieldType = null; + string fieldDefaultValue = null; + XPathNavigator structureDefinition; + bool isEnum = false; + + int arrayLength; + LinkedList length = new LinkedList(); + // + // Extract the name, type, default value, and array length values + // for the field + // + + if (item.MoveToChild("name", "")) + { + fieldName = item.Value.Trim(); + item.MoveToParent(); + } + if (item.MoveToChild("item_name", "")) + { + fieldName = item.Value.Trim(); + item.MoveToParent(); + } + if (item.MoveToChild("type", "")) + { + fieldType = NormalizeType(item.Value, ref isEnum); + // remove namespace + fieldType = Regex.Replace(fieldType, @"[^:]+::([^:]+)", "$1"); + item.MoveToParent(); + } + if (item.MoveToChild("default", "")) + { + fieldDefaultValue = NormalizeValue(item.Value); + item.MoveToParent(); + } + else if (item.MoveToChild("minRange", "")) + { + fieldDefaultValue = NormalizeValue(item.Value); + item.MoveToParent(); + } + + // + // Check to see if this field is a structure by locating the structure + // definition. + // + + structureDefinition = Messages.SelectSingleNode("/interface/structure[name='" + fieldType + "']|/interface/message[name='" + fieldType + "']"); + + // + // Create the MessageData object for this field and put it in the array. + // Set max and min range values if they exist. + // + + dataArray[arrayIndex] = new MessageData(namePrefix + fieldName, + fieldType, null, fieldDefaultValue, m_Icd, LogData); + //If Type is an enum sent the isEnum field to true + if (isEnum) + { + dataArray[arrayIndex].isEnum = true; + } + + XPathNodeIterator nodeSet = item.Select("arrayLength"); + while (nodeSet.MoveNext()) + { + arrayLength = 0; + Parse.Try(NormalizeValue(nodeSet.Current.Value), out arrayLength); + if (arrayLength != 0) + { + length.AddFirst(arrayLength); + } + } + + if (item.MoveToChild("imageWidth", "")) + { + Parse.Try(NormalizeValue(item.Value), out uint width); + if (width != 0) + { + dataArray[arrayIndex].imageWidth = width; + } + item.MoveToParent(); + } + if (item.MoveToChild("imageHeight", "")) + { + Parse.Try(NormalizeValue(item.Value), out uint height); + if (height != 0) + { + dataArray[arrayIndex].imageHeight = height; + } + item.MoveToParent(); + } + if (item.MoveToChild("imagePixelSize", "")) + { + Parse.Try(NormalizeValue(item.Value), out uint pixelSize); + if (pixelSize != 0) + { + dataArray[arrayIndex].imagePixelSize = pixelSize; + } + item.MoveToParent(); + } + if (item.MoveToChild("maxRange", "")) + { + dataArray[arrayIndex].SetMaxValue(item.Value.Trim()); + item.MoveToParent(); + } + if (item.MoveToChild("minRange", "")) + { + dataArray[arrayIndex].SetMinValue(item.Value.Trim()); + item.MoveToParent(); + } + + if (item.MoveToChild("bits", "")) + { + Parse.Try(NormalizeValue(item.Value), out int bits); + dataArray[arrayIndex].SetBitValue(bits); + item.MoveToParent(); + } + else + { + dataArray[arrayIndex].SetBitValue(0); + } + + if (item.MoveToChild("instruType", "")) + { + dataArray[arrayIndex].SetInstruType(item.Value.Trim()); + if ((dataArray[arrayIndex].FieldInstruType == "S") && (dataArray[arrayIndex].FieldType == "unsigned char")) + { + // In CMIT, all strings are of type char. If the user defines a string of unsigned chars, we + // can still handle them if type is changed to char. + dataArray[arrayIndex].FieldType = "char"; + } + else if ((dataArray[arrayIndex].FieldInstruType == "S") && (dataArray[arrayIndex].FieldType != "char")) + { + // If the type is not char, the CMIT will not handle strings. We will change the instruType + // to X, so these fields are handled properly. + dataArray[arrayIndex].FieldInstruType = "X"; + } + item.MoveToParent(); + } + + // Initialize the image buffer if this is a subimage item + if ((dataArray[arrayIndex].imageWidth != 0) && (dataArray[arrayIndex].imageHeight != 0)) + { + dataArray[arrayIndex].imageBufferSize = + dataArray[arrayIndex].imageWidth * + dataArray[arrayIndex].imageHeight * + GetTypeSize(dataArray[arrayIndex].FieldType, dataArray[arrayIndex].isEnum); + dataArray[arrayIndex].imageBuffer = new byte[dataArray[arrayIndex].imageBufferSize]; + dataArray[arrayIndex].SetInstruType("P"); + dataArray[arrayIndex].SetPixelSize(); + } + else if (dataArray[arrayIndex].FieldInstruType == "P") + { + // If no imageWidth and imageHeight are defined, then + // this item can not have an instruType of "P" + dataArray[arrayIndex].FieldInstruType = "X"; + } + + dataArray[arrayIndex].depth = depth; + // + // If the field is a singleton, we're done. Other combinations + // could be an array, a structure, or an array of structures. + // + + if (length.Count > 0) + { + ParseArray(structureDefinition, + dataArray[arrayIndex], + length); + } + else if (structureDefinition != null) + { + ParseMessageString(structureDefinition.OuterXml, "/structure/item|/message/item|/structure/struct_item|/message/msg_item", dataArray[arrayIndex].FieldName + ".", + dataArray[arrayIndex]); + } + } + + private void ParseArray + ( + XPathNavigator StructureDefinition, + MessageData DataArray, + LinkedList ArrayLength + ) + { + int length = ArrayLength.Last.Value; + ArrayLength.RemoveLast(); + if (length > 0) + { + // If the array type is an enumeration type, need to make it an integer + XPathNavigator navigator = m_Icd.CreateNavigator(); + XPathNavigator position; + try + { + position = navigator.SelectSingleNode("/interface/enum[name='" + DataArray.FieldType + "']"); + if (position != null) + { + DataArray.FieldType = "unsigned int"; + } + } + catch (Exception e) + { + System.Diagnostics.Debug.WriteLine(e.Message); + } + + DataArray.SetArraySize(length); + + if (ArrayLength.Count != 0) + { + for (int index = 0; index < length; index++) + { + ParseArray(StructureDefinition, + DataArray.MessageArray[index], + ArrayLength); + } + } + else + { + if (StructureDefinition != null) + { + ParseMessageString(StructureDefinition.OuterXml, "/structure/item|/message/item|/structure/struct_item|/message/msg_item", + DataArray.MessageArray[0].FieldName + ".", + DataArray.MessageArray[0]); + for (int index = 1; index < length; index++) + { + DataArray.MessageArray[index].isStructure = true; + + DataArray.MessageArray[index].MessageArray = CloneMessageData(DataArray.MessageArray[0].MessageArray); + CorrectClonedArrayIndex(DataArray.MessageArray[index].MessageArray, + DataArray.MessageArray[0].FieldName.Trim(), + DataArray.MessageArray[index].FieldName.Trim()); + } + DataArray.isArrayOfStructures = true; + } + } + } + + ArrayLength.AddFirst(length); + } + + private void CorrectClonedArrayIndex(MessageData[] array, + string old_str, + string new_str) + { + foreach (MessageData data in array) + { + // We want to replace the index in the name of the structure. The "begin" substring + // ensures we only replace the first instance of the string + string begin = data.FieldName.Substring(0, new_str.Length); + begin = begin.Replace(old_str, new_str); + + data.FieldName = begin + data.FieldName.Substring(new_str.Length); + if (data.MessageArray != null) + { + CorrectClonedArrayIndex(data.MessageArray, old_str, new_str); + } + } + } + + internal string NormalizeValue(string value) + { + XPathNavigator messagesItem; + bool iterating; + + value = value.Trim(); + do + { + iterating = false; + if ((value.Length > 0) && (value[0] != '\"') && (value[0] != '\'')) + { + messagesItem = Messages.SelectSingleNode("/interface/constant[name='" + value + "']|/interface/enum/item[name='" + value + "']"); + if (messagesItem == null) + { + messagesItem = Messages.SelectSingleNode("/interface/constant[name='" + value + "']|/interface/enum/enum_item[name='" + value + "']"); + } + if (messagesItem != null) + { + messagesItem.MoveToChild("value", ""); + value = messagesItem.InnerXml; + iterating = true; + } + } + } while (iterating); + + return value; + } + + private string NormalizeType(string value, ref bool isEnum) + { + XPathNavigator MessagesItem; + bool iterating; + + do + { + iterating = false; + MessagesItem = Messages.SelectSingleNode("/interface/typedef[name='" + NormalizeValue(value) + "']"); + if (MessagesItem != null) + { + MessagesItem.MoveToChild("value", ""); + value = MessagesItem.InnerXml; + iterating = true; + } + //Check if Value is an enumeration + MessagesItem = Messages.SelectSingleNode("/interface/enum[name='" + NormalizeValue(value) + "']"); + if (MessagesItem != null) + { + isEnum = true; + } + } while (iterating); + + return value; + } + + public void Reset() + { + SetEnumerationType(EnumerationType.EXPANDED_FIELDS); + foreach (MessageData data in this) + { + data.FieldValue = null; + data.usesRegister = false; + } + } + + public MessageData Set(string field, string value) + { + MessageData LocatedDataItem = null; + + SetEnumerationType(EnumerationType.ALL_NODES); + foreach (MessageData data in this) + { + if (string.Compare(field, data.FieldName) == 0) + { + if (data.isArrayOfStructures) + { + ; // Do nothing in this case + } + if (data.isArray || data.isStructure) + { + data.FieldValue = value; + if (value.StartsWith("$")) + { + data.usesRegister = true; + } + foreach (MessageData ArrayData in data.MessageArray) + { + if (!ArrayData.isArray && !ArrayData.isArrayOfStructures && !ArrayData.isStructure) + { + ArrayData.FieldArrayValue = value; + if (value.StartsWith("$")) + { + ArrayData.usesRegister = true; + } + } + } + } + else + { + data.FieldValue = value; + if (value.StartsWith("$")) + { + data.usesRegister = true; + } + LocatedDataItem = data; + } + break; + } + } + return LocatedDataItem; + } + + public MessageData GetItemFromMsg(string name) + { + // Add each message item to the tree + SetEnumerationType(EnumerationType.ALL_NODES); + foreach (MessageData Data in this) + { + // Find the Item that has been selected in current Message + if (Data.FieldName == name) + { + return Data; + } + } + + return null; + } + + /// + /// logs message with all the fields + /// + /// + /// + public void SendToLog(EnumerationType enumerationType = EnumerationType.EXPANDED_FIELDS, MessageDirection direction = MessageDirection.File) + { + string directionSign = direction == MessageDirection.File ? "_" : direction == MessageDirection.In ? "<<<" : ">>>"; + _logger.Log(NLog.LogLevel.Info, $"{directionSign} Message Name: {_name}; Label: {_label} (0x{_hexLabel})"); + SetEnumerationType(enumerationType); + foreach (MessageData data in this) + { + string displayFieldValue; + if (data.FieldName == "$msg_label") + { + displayFieldValue = $"{data.FieldValue} (0x{_hexLabel})"; + } + else + { + displayFieldValue = data.FieldValue ?? $"{data.FieldDefaultValue} (D)"; + } + var spacer = new string(Enumerable.Repeat(' ', data.depth * 4).ToArray()); + _logger.Log(NLog.LogLevel.Info, $"{spacer}{data.FieldName} ({data.FieldType}) = {displayFieldValue}"); + } + } + + // helps with visual identification in the log of incoming vs outgoing + public enum MessageDirection + { + File, + In, + Out + } + + // This class supplies an enumerator that is capable of iterating over the fields in the + // message with a variety of options. The SetEnumerationType method sets how the enumerator + // will iterate over the fields. The enumeration values can be added to derive various + // combinations of iterations. The values are as follows: + // FIELDS Only non array and structure fields + // ARRAY_NODES The message_data nodes that have isArray set + // STRUCTURE_NODES The message_data nodes that have isStructure set + // ARRAY_PRIMITIVE_NODES Nodes with isArray set that are not arrays of structures + // EXPAND_ARRAYS The array fields linked onto an array node + // EXPAND_STRUCTURES The structure fields linked onto a structure node + // TOP_NODES Top level Fields and array/structure nodes + // EXPANDED_FIELDS All fields, structures and arrays expanded + // ALL_NODES All nodes (the sum of all the above) + // + + public enum EnumerationType + { + FIELDS = 0x01, + ARRAY_NODES = 0x02, + STRUCTURE_NODES = 0x04, + ARRAY_PRIMITIVE_NODES = 0x08, + EXPAND_ARRAYS = 0x10, + EXPAND_STRUCTURES = 0x20, + TOP_NODES = 0x07, + EXPANDED_FIELDS = 0x31, + ALL_NODES = 0xFF + }; + private EnumerationType EnumType = EnumerationType.TOP_NODES; + + public void SetEnumerationType(EnumerationType type) + { + EnumType = type; + } + + public IEnumerator GetEnumerator() + { + return new MessageEnumerator(MessageDataArray, EnumType); + } + + private class MessageEnumerator : IEnumerator + { + + private int CurrentIndex; + private bool doExpandArray; + private readonly EnumerationType enumType = EnumerationType.TOP_NODES; + private readonly MessageData[] RootMessageArray; + private MessageData[] CurrentMessageArray; + private readonly Stack indexStack = new Stack(); + private readonly Stack messageStack = new Stack(); + + private MessageEnumerator() + { + Reset(); + } + + public MessageEnumerator(MessageData[] Root, EnumerationType Type) + { + RootMessageArray = Root; + enumType = Type; + Reset(); + } + + public void Reset() + { + CurrentIndex = -1; + CurrentMessageArray = RootMessageArray; + doExpandArray = false; + indexStack.Clear(); + messageStack.Clear(); + } + + public bool MoveNext() + { + bool Scanning = true; + bool Status = true; + + while (Scanning) + { + CurrentIndex++; + // + // If need to start expanding an array (array or structure), do so + // + if (doExpandArray) + { + doExpandArray = false; + indexStack.Push(CurrentIndex); + messageStack.Push(CurrentMessageArray); + CurrentMessageArray = CurrentMessageArray[CurrentIndex - 1].MessageArray; + CurrentIndex = -1; + } + // + // Else see if this node needs to be returned + // + else + { + // + // If at the end of an array, pop the stacks + // + while (CurrentIndex >= CurrentMessageArray.Length) + { + if (indexStack.Count == 0) + { + return false; // End of iteration + } + else + { + CurrentIndex = indexStack.Pop(); + CurrentMessageArray = messageStack.Pop(); + } + } + if (CurrentMessageArray[CurrentIndex].isStructure) + { + if ((enumType & EnumerationType.STRUCTURE_NODES) != 0) + { + Scanning = false; + } + if ((enumType & EnumerationType.EXPAND_STRUCTURES) != 0) + { + doExpandArray = true; + } + } + else if (CurrentMessageArray[CurrentIndex].isArray) + { + if ((enumType & EnumerationType.ARRAY_NODES) != 0) + { + Scanning = false; + } + if ((enumType & EnumerationType.ARRAY_PRIMITIVE_NODES) != 0) + { + if (!CurrentMessageArray[CurrentIndex].isArrayOfStructures) + { + Scanning = false; + } + } + if ((enumType & EnumerationType.EXPAND_ARRAYS) != 0) + { + doExpandArray = true; + } + } + else + { + if ((enumType & EnumerationType.FIELDS) != 0) + { + Scanning = false; + } + } + } + } + return Status; + } + + public object Current + { + get + { + return CurrentMessageArray[CurrentIndex]; + } + } + + } + + enum TypeSize + { + INT = 4, + UINT = 4, + CHAR = 1, + SHORT = 2, + USHORT = 2, + UNSIGNED_CHAR = 1, + BOOL = 1, + DOUBLE = 8, + LONGLONG = 8, + FLOAT = 4, + ENUM = 4 + } + + public void MsgDataToBuffer(ref byte[] DataBuffer, out uint MessageSize) + { + int Index = 0; + uint pictureSize; + int Offset = 0; + MessageData lastData = null; + byte[] ByteArray; + int ctr = 0; + + // Data buffer was just passed from a fresh "new byte[]" so all values are guaranteed to + // be 0 at the beginning. + // + // For each element in data element in the message, the string representation of + // the data will be passed to the BitFieldGeneric class with its bit mask to + // be converted into a binary value. The BitFieldGeneric value will then be + // Bitwise ORed to buffer, allowing bit fields to be handled properly. This + // ORed value will then be converted into a byte array and placed in the data + // buffer for transfer. + + SetEnumerationType(EnumerationType.FIELDS | + EnumerationType.EXPAND_ARRAYS | + EnumerationType.EXPAND_STRUCTURES); + + foreach (MessageData data in this) + { + //Handle $msg_domain, $msg_label and $msg_send_time appropriately + if (ctr == 0) // handle $msg_domain + { + Domain = data.FieldValue; + ctr++; + continue; + } + else if (ctr == 1) // handle $msg_label + { + // Do we want the user to be able to change the label on the fly + //Label = data.FieldValue; + ctr++; + continue; + } + else if (ctr == 2) // handle $msg_send_time + { + ctr++; + continue; + } + + + // Padding may have FieldValue set to null, change it to "" + if (data.FieldValue == null) + data.FieldValue = ""; + + // This increases the index into the buffer. See GetMessageSize() + // for a detailed explanation of the algorithm + if (lastData != null) + { + if (IncreaseIndex(data)) + { + if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) + { + // Strings are handled individually + Index += (int)TypeSize.CHAR * lastData.arrayLength; + } + else if (lastData.FieldInstruType == "P") + { + pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); + pictureSize *= lastData.imageWidth * lastData.imageHeight; + Index += (int)pictureSize; + } + else + { + Index += (int)GetTypeSize(lastData.FieldType, lastData.isEnum); + } + } + } + lastData = data; + + // Process each message element based on its type + if ((data.FieldInstruType == "P") && (data.imageBuffer != null)) + { + data.imageBuffer.CopyTo(DataBuffer, Index); + } + else + { + switch (data.FieldType) + { + case "char": + decimal ParsedValue; + if (data.FieldInstruType == "S") + { + // If this is a string, copy the entire string + for (int i = 0; i < data.arrayLength; i++) + { + if (i < data.FieldValue.Length) + { + DataBuffer[Index + i] = (byte)data.FieldValue[i]; + } + else + { + DataBuffer[Index + i] = 0; + } + } + } + else // This is not a string + { + if (Parse.Try(data.FieldValue, out ParsedValue)) + { + BitFieldGeneric sbParsedValue = new BitFieldGeneric + (data.FieldValue, data.bitMask); + sbParsedValue.BitOR((sbyte)DataBuffer[Index]); + DataBuffer[Index] = (byte)sbParsedValue.ToSByte(); + } + else if ((data.FieldValue != null) && (data.FieldValue.Length > 0)) + { + DataBuffer[Index] = (byte)data.FieldValue[0]; + } + else + { + DataBuffer[Index] = 0; + } + } + break; + case "unsigned char": + case "unsignedchar": + case "uint8_t": + if (Parse.Try(data.FieldValue, out ParsedValue)) + { + BitFieldGeneric sbParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); + sbParsedValue.BitOR(DataBuffer[Index]); + DataBuffer[Index] = (byte)sbParsedValue.ToSByte(); + } + else if ((data.FieldValue != null) && (data.FieldValue.Length > 0)) + { + DataBuffer[Index] = (byte)data.FieldValue[0]; + } + else + { + DataBuffer[Index] = 0; + } + break; + case "short": + BitFieldGeneric sParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); + sParsedValue.BitOR(BitConverter.ToInt16(DataBuffer, Index)); + ByteArray = BitConverter.GetBytes(sParsedValue.ToShort()); + ByteArray.CopyTo(DataBuffer, Index); + break; + case "unsigned short": + case "unsignedshort": + case "uint16_t": + BitFieldGeneric usParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); + usParsedValue.BitOR(BitConverter.ToUInt16(DataBuffer, Index)); + ByteArray = BitConverter.GetBytes(usParsedValue.ToUShort()); + ByteArray.CopyTo(DataBuffer, Index); + break; + case "int": + case "int32_t": + BitFieldGeneric iParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); + iParsedValue.BitOR(BitConverter.ToInt32(DataBuffer, Index)); + ByteArray = BitConverter.GetBytes(iParsedValue.ToInt()); + ByteArray.CopyTo(DataBuffer, Index); + break; + case "unsigned int": + case "unsignedint": + case "unsigned": + case "uint32_t": + case "boolean": + case "address": + BitFieldGeneric uiParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); + uiParsedValue.BitOR(BitConverter.ToUInt32(DataBuffer, Index)); + ByteArray = BitConverter.GetBytes(uiParsedValue.ToUInt()); + ByteArray.CopyTo(DataBuffer, Index + Offset); + break; + case "float": + float FlParsedValue; + if (!Parse.Try(string.IsNullOrEmpty(data.FieldValue) ? "0" : data.FieldValue, out FlParsedValue)) + { + throw new Exception($"Unable to parse value = {data.FieldValue} "); + } + ByteArray = BitConverter.GetBytes(FlParsedValue); + ByteArray.CopyTo(DataBuffer, Index); + break; + case "double": + double DbParsedValue; + if (!Parse.Try(string.IsNullOrEmpty(data.FieldValue) ? "0" : data.FieldValue, out DbParsedValue)) + { + throw new Exception($"Unable to parse value = {data.FieldValue} "); + } + ByteArray = BitConverter.GetBytes(DbParsedValue); + ByteArray.CopyTo(DataBuffer, Index); + break; + case "long long": + case "longlong": + case "int64_t": + BitFieldGeneric llParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); + llParsedValue.BitOR(BitConverter.ToInt64(DataBuffer, Index)); + ByteArray = BitConverter.GetBytes(llParsedValue.ToLong()); + ByteArray.CopyTo(DataBuffer, Index); + break; + case "unsigned long long": + case "unsignedlonglong": + case "uint64_t": + BitFieldGeneric ullParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); + ullParsedValue.BitOR(BitConverter.ToUInt64(DataBuffer, Index)); + ByteArray = BitConverter.GetBytes(ullParsedValue.ToULong()); + ByteArray.CopyTo(DataBuffer, Index); + break; + default: + if (data.isEnum) + { + data.FieldValue = GetEnumerationValue(data.FieldValue, data.FieldType); + BitFieldGeneric eParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); + eParsedValue.BitOR(BitConverter.ToUInt32(DataBuffer, Index)); + ByteArray = BitConverter.GetBytes(eParsedValue.ToUInt()); + ByteArray.CopyTo(DataBuffer, Index); + } + else + throw new Exception($"Type {data.FieldType} is invalid in COE message"); + + break; + } + } + } + + if (lastData != null) // Ensure the message has items + { + // Add the last element to the size + if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) + { + // Strings are handled individually + Index += (int)TypeSize.CHAR * lastData.arrayLength; + } + else if (lastData.FieldInstruType == "P") + { + pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); + pictureSize *= lastData.imageWidth * lastData.imageHeight; + Index += (int)pictureSize; + } + else + { + Index += (int)GetTypeSize(lastData.FieldType, lastData.isEnum); + } + } + + MessageSize = (uint)Index; + } + + private string GetEnumerationValue(string Value, string Type) + { + uint value; // enum value + string returnValue = ""; + + if (Parse.Try(Value, out value) == false) + { + Dictionary enums = m_Icd.GetEnumerations(Type); + foreach (KeyValuePair pair in enums) + { + if (Value == pair.Key) + { + returnValue = pair.Value; + break; + } + } + } + else + { + returnValue = value.ToString(); + } + + if (returnValue == "") + { + throw new Exception("Unable to parse value = " + Value + ". No valid enumeration exists."); + } + + return returnValue; + } + + public bool BufferToMsgData(byte[] DataBuffer) + { + int index = 0; + MessageData lastData = null; + int ctr = 0; + + SetEnumerationType(EnumerationType.FIELDS | + EnumerationType.EXPAND_ARRAYS | + EnumerationType.EXPAND_STRUCTURES); + foreach (MessageData data in this) + { + if (ctr == 0) // handle $msg_domain + { + data.FieldValue = Domain; + ctr++; + continue; + } + else if (ctr == 1) // handle $msg_label + { + data.FieldValue = _label; + ctr++; + continue; + } + else if (ctr == 2) // handle $msg_send_time + { + data.FieldValue = SendTime; + ctr++; + continue; + } + + // This increases the index into the buffer. See GetMessageSize() + // for a detailed explanation of the algorithm + if (lastData != null) + { + if (IncreaseIndex(data)) + { + if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) + { + // Strings are handled individually + index += (int)TypeSize.CHAR * lastData.arrayLength; + } + else if (lastData.FieldInstruType == "P") + { + uint pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); + pictureSize *= lastData.imageWidth * lastData.imageHeight; + index += (int)pictureSize; + } + else + { + index += (int)GetTypeSize(lastData.FieldType, lastData.isEnum); + } + } + } + lastData = data; + + // Process each message element based on its type + if ((data.FieldInstruType == "P") && (data.imageBuffer != null)) + { + for (int i = 0; i < data.imageBuffer.Length; i++) + { + data.imageBuffer[i] = DataBuffer[index + i]; + } + data.FieldValue = "--- Subimage --- "; + } + else + { + switch (data.FieldType) + { + case "char": + if (data.FieldInstruType == "S") + { + // Handle string + data.FieldValue = ""; + for (int i = 0; i < data.arrayLength; i++) + { + if (DataBuffer[index + i] == 0) break; + data.FieldValue += (char)DataBuffer[index + i]; + } + } + else + { + BitFieldGeneric CValue = new BitFieldGeneric + ((sbyte)DataBuffer[index], data.bitMask); + CValue.ToSigned(); + data.FieldValue = CValue.ToString(); + } + break; + case "unsigned char": + case "unsignedchar": + case "uint8_t": + BitFieldGeneric SBValue = new BitFieldGeneric + (DataBuffer[index], data.bitMask); + data.FieldValue = SBValue.ToString(); /*ACB*/ + //data.FieldValue = DataBuffer[Index].ToString(); + break; + case "short": + BitFieldGeneric SValue = new BitFieldGeneric + (BitConverter.ToInt16(DataBuffer, index), data.bitMask); + SValue.ToSigned(); + data.FieldValue = SValue.ToString(); + break; + case "unsigned short": + case "unsignedshort": + case "uint16_t": + BitFieldGeneric USValue = new BitFieldGeneric + (BitConverter.ToUInt16(DataBuffer, index), data.bitMask); + data.FieldValue = USValue.ToString(); + break; + case "int": + case "int32_t": + BitFieldGeneric IValue = new BitFieldGeneric + (BitConverter.ToInt32(DataBuffer, index), data.bitMask); + IValue.ToSigned(); + data.FieldValue = IValue.ToString(); + break; + case "unsigned int": + case "unsignedint": + case "uint32_t": + case "unsigned": + case "address": + case "boolean": + BitFieldGeneric UIValue = new BitFieldGeneric + (BitConverter.ToUInt32(DataBuffer, index), data.bitMask); + data.FieldValue = UIValue.ToString(); + break; + case "float": + float FValue = BitConverter.ToSingle(DataBuffer, index); + data.FieldValue = FValue.ToString(); + break; + case "double": + double DValue = BitConverter.ToDouble(DataBuffer, index); + data.FieldValue = DValue.ToString(); + break; + case "long long": + case "longlong": + case "int64_t": + BitFieldGeneric LLValue = new BitFieldGeneric + (BitConverter.ToInt64(DataBuffer, index), data.bitMask); + LLValue.ToSigned(); + data.FieldValue = LLValue.ToString(); + break; + case "unsigned long long": + case "unsignedlonglong": + case "uint64_t": + BitFieldGeneric ULLValue = new BitFieldGeneric + (BitConverter.ToUInt64(DataBuffer, index), data.bitMask); + data.FieldValue = ULLValue.ToString(); + break; + default: + if (data.isEnum) + { + BitFieldGeneric EnumValue = new BitFieldGeneric + (BitConverter.ToUInt32(DataBuffer, index), data.bitMask); + data.FieldValue = EnumValue.ToString(); + } + else + throw new Exception($"Type {data.FieldType} is invalid in COE message"); + break; + } + } + } + + return true; + } + + /// + /// Get parameters in the message + /// + public List> GetParameters() + { + List> parms = new List>(); + + foreach (var item in MessageDataArray.Where(m => !m.FieldName.StartsWith("$"))) + { + parms.Add(new KeyValuePair(item.FieldName, item.FieldValue)); + if (item.MessageArray != null && item.MessageArray.Any()) + { + var innerParams = GetParameters(item.MessageArray); + if (innerParams != null) + { + parms.AddRange(innerParams); + } + } + } + + return parms; + } + + /// + /// Get parameters recursively in the message + /// + private List> GetParameters(MessageData[] array) + { + List> parms = new List>(); + + foreach (var item in array.Where(m => !m.FieldName.StartsWith("$"))) + { + parms.Add(new KeyValuePair(item.FieldName, item.FieldValue)); + if (item.MessageArray != null && item.MessageArray.Any()) + { + var innerParams = GetParameters(item.MessageArray); + if (innerParams != null) + { + parms.AddRange(innerParams); + } + } + } + + return parms; + } + + internal uint GetCountForDataInterchange() + { + uint ctr = 0; + if (_count == 0) + { + MessageData lastData = null; + + SetEnumerationType(Message.EnumerationType.FIELDS | + Message.EnumerationType.EXPAND_ARRAYS | + Message.EnumerationType.EXPAND_STRUCTURES); + + foreach (MessageData data in this) + { + if (ctr++ < _extraFieldCount) // Skip $msg_domain, $msg_label and $msg_send_time + continue; + + // When handling bit fields, we do not know if we want to move to the + // next byte (Index) until we examine the next element. + // + // ex. unsigned x:4; unsigned y:8; Both x and y operate on the same + // byte, but we don't know the same byte is being operated on until + // we see the declaration of y. + // + // Therefore, we are going to increase the index by staying one declaration + // ahead of the Index increase. If this declaration is operating on a new + // byte, then add the size of the previous byte. The last declaration + // will then be added on the end to get the appropriate size. + if (lastData != null) + { + if (IncreaseIndex(data)) + { + _count++; + if (lastData.bitMask != 0) + { + _count++; + } + } + else + { + _count++; + } + } + lastData = data; + } + + // Add the last element to the size + _count++; + if (lastData.bitMask != 0) + { + _count++; + } + } + + return (uint)_count; + } + + public uint GetMessageSize() + { + uint Index = 0; + uint pictureSize; + MessageData lastData = null; + uint ctr = 0; + + SetEnumerationType(Message.EnumerationType.FIELDS | + Message.EnumerationType.EXPAND_ARRAYS | + Message.EnumerationType.EXPAND_STRUCTURES); + + foreach (MessageData data in this) + { + + if (ctr++ < _extraFieldCount) // Skip $msg_domain, $msg_label and $msg_send_time + continue; + // When handling bit fields, we do not know if we want to move to the + // next byte (Index) until we examine the next element. + // + // ex. unsigned x:4; unsigned y:8; Both x and y operate on the same + // byte, but we don't know the same byte is being operated on until + // we see the declaration of y. + // + // Therefore, we are going to increase the index by staying one declaration + // ahead of the Index increase. If this declaration is operating on a new + // byte, then add the size of the previous byte. The last declaration + // will then be added on the end to get the appropriate size. + if (lastData != null) + { + if (IncreaseIndex(data)) + { + if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) + { + // Strings are handled individually + Index += (uint)TypeSize.CHAR * (uint)lastData.arrayLength; + } + else if (lastData.FieldInstruType == "P") + { + pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); + pictureSize *= lastData.imageWidth * lastData.imageHeight; + Index += pictureSize; + } + else + { + Index += GetTypeSize(lastData.FieldType, lastData.isEnum); + } + } + } + lastData = data; + } + + if (lastData != null) // Ensure there are items in the message + { + // Add the last element to the size + if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) + { + // Strings are handled individually + Index += (uint)TypeSize.CHAR * (uint)lastData.arrayLength; + } + else if (lastData.FieldInstruType == "P") + { + pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); + pictureSize *= lastData.imageWidth * lastData.imageHeight; + Index += pictureSize; + } + else + { + Index += GetTypeSize(lastData.FieldType, lastData.isEnum); + } + } + + return (uint)Index; + } + + private bool IncreaseIndex(MessageData Data) + { + if ((Data.bitMask == 0) || ((Data.bitMask & 1) == 1)) + { + return true; + } + else + { + return false; + } + } + + static internal uint GetTypeSize(string Type, bool IsEnum, bool logData = true) + { + uint size = 4; + + switch (Type) + { + case "char": + case "unsigned char": + case "unsignedchar": + case "uint8_t": + size = (uint)TypeSize.CHAR; + break; + + case "short": + case "unsigned short": + case "unsignedshort": + case "uint16_t": + size = (uint)TypeSize.SHORT; + break; + + case "int": + case "int32_t": + case "unsigned int": + case "unsignedint": + case "unsigned": + case "uint32_t": + case "address": + case "boolean": + case "float": + size = (uint)TypeSize.INT; + break; + + case "double": + case "long long": + case "longlong": + case "unsigned long long": + case "unsignedlonglong": + case "uint64_t": + case "int64_t": + size = (uint)TypeSize.LONGLONG; + break; + + default: + if (IsEnum == true) + size = (uint)TypeSize.ENUM; + else + { + if (logData) + _logger.Debug($"Type {Type} is not recognized as basic type"); + } + break; + } + + return size; + } + + // + // This function validates that the FieldValue is of the correct type and + // is within the Max and Min values. If all the data is valid this + // function returns true. If the data is invalid the function returns + // false and the inValid MessageData elements will have there isValid + // field set to false. + // + public bool ValidateMsgData() + { + bool DataValid = true; + SetEnumerationType(Message.EnumerationType.FIELDS | + Message.EnumerationType.EXPAND_ARRAYS | + Message.EnumerationType.EXPAND_STRUCTURES); + + foreach (MessageData data in this) + { + data.isValid = true; + switch (data.FieldType) + { + case "int": + int IntParsedValue; + int IMaxValue, IMinValue; + if (!Parse.Try(data.FieldValue, out IntParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out IMinValue) && + Parse.Try(data.FieldMaxValue, out IMaxValue)) + { + if (IntParsedValue < IMinValue || IntParsedValue > IMaxValue) + { + DataValid = false; + data.isValid = false; + } + } + break; + + case "char": + char ChParsedValue; + byte ByteParsedValue; + //If the value can be parsed as a byte assume it is a byte, if not try as char + if (Parse.Try(data.FieldValue, out ByteParsedValue)) + { + //TODO: Validate against Min and Max here + } + else + { + if (Parse.Try(data.FieldValue, out ChParsedValue)) + { + //TODO: Validate against Min and Max here + } + else + { + if (data.FieldValue != null) + { + DataValid = false; + data.isValid = false; + } + } + } + break; + case "short": + short ShParsedValue; + short ShMaxValue, ShMinValue; + if (!Parse.Try(data.FieldValue, out ShParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out ShMinValue) && + Parse.Try(data.FieldMaxValue, out ShMaxValue)) + { + if (ShParsedValue < ShMinValue || ShParsedValue > ShMaxValue) + { + DataValid = false; + data.isValid = false; + } + } + break; + case "unsigned char": + case "unsignedchar": + byte UchParsedValue; + byte UchMaxValue, UchMinValue; + if (!Parse.Try(data.FieldValue, out UchParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out UchMinValue) && + Parse.Try(data.FieldMaxValue, out UchMaxValue)) + { + if (UchParsedValue < UchMinValue || UchParsedValue > UchMaxValue) + { + DataValid = false; + data.isValid = false; + } + } + break; + case "unsigned short": + case "unsignedshort": + ushort UshParsedValue; + ushort UshMaxValue, UshMinValue; + if (!Parse.Try(data.FieldValue, out UshParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out UshMinValue) && + Parse.Try(data.FieldMaxValue, out UshMaxValue)) + { + if (UshParsedValue < UshMinValue || UshParsedValue > UshMaxValue) + { + DataValid = false; + data.isValid = false; + } + } + break; + case "unsigned int": + case "unsignedint": + case "unsigned": + uint UiParsedValue; + uint UiMaxValue, UiMinValue; + if (!Parse.Try(data.FieldValue, out UiParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out UiMinValue) && + Parse.Try(data.FieldMaxValue, out UiMaxValue)) + { + if (UiParsedValue < UiMinValue || UiParsedValue > UiMaxValue) + { + DataValid = false; + data.isValid = false; + } + } + break; + case "float": + float FlParsedValue; + float FlMaxValue, FlMinValue; + if (!Parse.Try(data.FieldValue, out FlParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out FlMinValue) && + Parse.Try(data.FieldMaxValue, out FlMaxValue)) + { + if (FlParsedValue < FlMinValue || FlParsedValue > FlMaxValue) + { + DataValid = false; + data.isValid = false; + } + } + break; + case "double": + double DbParsedValue; + double DbMaxValue, DbMinValue; + if (!Parse.Try(data.FieldValue, out DbParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out DbMinValue) && + Parse.Try(data.FieldMaxValue, out DbMaxValue)) + { + if (DbParsedValue < DbMinValue || DbParsedValue > DbMaxValue) + { + DataValid = false; + data.isValid = false; + } + } + break; + case "long long": + case "longlong": + long LlParsedValue; + long LlMaxValue, LlMinValue; + if (!Parse.Try(data.FieldValue, out LlParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out LlMinValue) && + Parse.Try(data.FieldMaxValue, out LlMaxValue)) + { + if (LlParsedValue < LlMinValue || LlParsedValue > LlMaxValue) + { + DataValid = false; + data.isValid = false; + } + } + break; + case "unsigned long long": + case "unsignedlonglong": + ulong ULlParsedValue; + ulong ULlMaxValue, ULlMinValue; + if (!Parse.Try(data.FieldValue, out ULlParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out ULlMinValue) && + Parse.Try(data.FieldMaxValue, out ULlMaxValue)) + { + if (ULlParsedValue < ULlMinValue || ULlParsedValue > ULlMaxValue) + { + DataValid = false; + data.isValid = false; + } + } + break; + case "boolean": + uint BParsedValue; + if (!Parse.Try(data.FieldValue, out BParsedValue)) + { + DataValid = false; + data.isValid = false; + break; + } + if (Parse.Try(data.FieldMinValue, out UiMinValue) && + Parse.Try(data.FieldMaxValue, out UiMaxValue)) + { + if (BParsedValue < 0 || BParsedValue > 1) + { + DataValid = false; + data.isValid = false; + } + } + break; + case "address": + + break; + default: + //This fn will not validate enumerations + if (!data.isEnum) + { + //Data is invalid because it is of an unknown type + DataValid = false; + data.isValid = false; + throw new Exception($"Type {data.FieldType} is invalid in COE message"); + } + break; + } + } + return DataValid; + } + + public bool CompareFieldValues(Message Msg) + { + Msg.SetEnumerationType(EnumerationType.EXPANDED_FIELDS); + foreach (MessageData Data in Msg) + { + + foreach (MessageData ThisData in this) + { + if (ThisData.FieldName == Data.FieldName) + { + if (ThisData.FieldValue != Data.FieldValue) + return false; + break; + } + } + } + //If this function has not returned at this point than the Value fields are equal + return true; + } + + #region Serialization/Deserialization for COE send + public byte[] serialize() + { + uint MsgSize = GetMessageSize(); + uint MsgSizeOut = 0; + byte[] buffer = new byte[MsgSize]; + + //Write MessageData to OE Message Buffer + MsgDataToBuffer(ref buffer, out MsgSizeOut); + if (MsgSize != MsgSizeOut) + { + buffer = null; // error + throw new Exception("Message " + _name + ": serialization failed"); + } + return buffer; + } + + public bool deserialize(byte[] stream) + { + return BufferToMsgData(stream); + } + #endregion + + #region ICloneable Members + + public void RetrieveClone(Message clone) + { + _name = clone._name; + _label = clone._label; + Domain = clone.Domain; + _instruLabel = clone._instruLabel; + _packet = clone._packet; + _adapationStoreLabel = clone._adapationStoreLabel; + + //Log = clone.Log; + Messages = clone.Messages; + _packing = clone._packing; + _count = clone._count; + m_Icd = clone.m_Icd; + + if (clone.MessageDataArray == null) + { + MessageDataArray = null; + } + else + { + MessageDataArray = new MessageData[clone.MessageDataArray.Length]; + for (int i = 0; i < clone.MessageDataArray.Length; i++) + { + MessageDataArray[i] = (MessageData)clone.MessageDataArray[i].Clone(); + } + } + } + + /// + /// + /// + /// + public object Clone() + { + Message clone = new Message + { + _name = _name, + _label = _label, + Domain = Domain, + _instruLabel = _instruLabel, + _adapationStoreLabel = _adapationStoreLabel, + _packet = _packet, + /*clone.Log = Log;*/ + Messages = Messages, + _packing = _packing, + _count = _count, + m_Icd = m_Icd, + MessageDataArray = CloneMessageData(MessageDataArray) + }; + return clone; + } + + /// + /// + /// + /// + /// + private MessageData[] CloneMessageData(MessageData[] orig) + { + MessageData[] clone = null; + if (orig != null) + { + clone = new MessageData[orig.Length]; + for (int i = 0; i < orig.Length; i++) + { + clone[i] = (MessageData)orig[i].Clone(); + } + } + + return clone; + } + + #endregion + } +} diff --git a/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/MessageData.cs b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/MessageData.cs new file mode 100644 index 0000000..22fdd65 --- /dev/null +++ b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/MessageData.cs @@ -0,0 +1,604 @@ +// ********************************************************************************************************** +// MessageData.cs +// 5/18/2022 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** +using System; +using System.Collections.Generic; +using System.IO; + +namespace Raytheon.Common.Coe +{ + public class MessageData : ICloneable + { + public string FieldName; + public string FieldType; + public string FieldValue; + public string FieldArrayValue; + public string FieldDefaultValue; + public string FieldMaxValue; + public string FieldMinValue; + public string FieldBitValue; + public string FieldInstruType; + public string Variable; + public string MaxOffset; + public string MinOffset; + public string VerifyType; + public bool isSelected; + public bool isArray; + public bool isStructure; + public bool isArrayOfStructures; + public bool isEnum; + public bool usesRegister; + public bool isValid; + public bool useRange; + public int arrayLength; + public uint imageWidth; + public uint imageHeight; + public uint imagePixelSize; + public ulong bitMask; + public bool expanded; + public int depth; + public byte[] imageBuffer; + public uint imageBufferSize; + public MessageData[] MessageArray; + + public delegate coe.Status ReadImageDelegate + ( + string filename, + uint columns, + uint rows, + uint pixel_size, + byte[] buffer + ); + + private MessageXmlDocument m_Icd; + + internal int m_BitCounter = 0; // used to calculate the bit mask + + internal static Dictionary m_ReadFunctions = null; + + public bool LogData { get; set; } + + private MessageData() { } + private MessageData(MessageXmlDocument Icd) + { + FieldName = null; + FieldType = null; + FieldValue = null; + FieldArrayValue = null; + FieldDefaultValue = null; + FieldMaxValue = null; + FieldMinValue = null; + FieldBitValue = null; + Variable = null; + MaxOffset = null; + MinOffset = null; + VerifyType = null; + isSelected = false; + isArray = false; + isStructure = false; + isArrayOfStructures = false; + usesRegister = false; + useRange = false; + arrayLength = 0; + imageWidth = 0; + imageHeight = 0; + imagePixelSize = 0; + bitMask = 0; + expanded = false; + depth = 0; + imageBufferSize = 0; + imageBuffer = null; + + m_Icd = Icd; + } + + public MessageData(string fieldname, + string fieldtype, + string fieldvalue, + string fielddefaultvalue, + MessageXmlDocument Icd, + bool logData = true) : + this(Icd) + { + FieldName = fieldname; + FieldType = fieldtype; + FieldValue = fieldvalue; + + LogData = logData; + + SetInstruType(null); + SetDefaultValue(fielddefaultvalue); + + } + + public MessageData(string fieldname, + string fieldtype, + string fieldvalue, + string fielddefaultvalue, + string fieldmaxvalue, + string fieldminvalue, + MessageXmlDocument Icd) : + this(fieldname, fieldtype, fieldvalue, fielddefaultvalue, Icd) + { + SetMaxValue(fieldmaxvalue); + SetMinValue(fieldminvalue); + } + + public string FormattedValue + { + get { return FormatValue(FieldValue); } + } + public string FormattedMinValue + { + get { return FormatValue(FieldMinValue); } + } + public string FormattedMaxValue + { + get { return FormatValue(FieldMaxValue); } + } + + public static string ImageFileReadTypes + { + get + { + string fileTypes = ""; + if (m_ReadFunctions == null) return null; + foreach (string type in m_ReadFunctions.Keys) + { + if (fileTypes != "") + fileTypes += "|"; + + fileTypes += type.ToUpper() + " files (*." + type.ToLower() + ")|*." + type.ToLower(); + } + + return fileTypes; + } + } + + public void AddReadExtension(string extension, ReadImageDelegate readFunc) + { + if (m_ReadFunctions == null) + m_ReadFunctions = new Dictionary(); + + if (m_ReadFunctions.ContainsKey(extension)) + m_ReadFunctions[extension] = readFunc; + else + m_ReadFunctions.Add(extension, readFunc); + } + + public void UpdateImage() + { + if (FieldInstruType == "P") + { + if (File.Exists(FieldValue)) + { + string extension = FieldValue.Substring(FieldValue.LastIndexOf(".") + 1); + m_ReadFunctions[extension](FieldValue, + imageWidth, + imageHeight, + imagePixelSize, + imageBuffer); + } + else + { + // TODO add error message + //MessageBox.Show("Unable to open file " + FieldValue + + // " to populate " + FieldName, + // "File Read Error", + // MessageBoxButtons.OK, + // MessageBoxIcon.Error); + FieldValue = ""; + for (int i = 0; i < imageBuffer.Length; i++) + { + imageBuffer[i] = 0; + } + } + } + } + + + public void SetDefaultValue(string fieldDefaultValue) + { + // Initialize uninitialized value + if (fieldDefaultValue == null) + { + fieldDefaultValue = ""; + } + + if ((FieldType == "char") && (fieldDefaultValue.Contains("\""))) + { + FieldInstruType = "S"; + } + + FieldDefaultValue = RemoveCharFromString(fieldDefaultValue, '\"'); + } + + public void SetMaxValue(string fieldmaxvalue) + { + if (fieldmaxvalue == null) return; /* Bad argument */ + + if ((FieldType == "char") && (fieldmaxvalue.Contains("\""))) + { + FieldInstruType = "S"; + } + + FieldMaxValue = RemoveCharFromString(fieldmaxvalue, '\"'); + } + + public void SetMinValue(string fieldminvalue) + { + if (fieldminvalue == null) return; /* Bad argument */ + + if ((FieldType == "char") && (fieldminvalue.Contains("\""))) + { + FieldInstruType = "S"; + } + + FieldMinValue = RemoveCharFromString(fieldminvalue, '\"'); + } + + public void SetBitValue(int bits) + { + int size = (int)Message.GetTypeSize(FieldType, isEnum, LogData); + + // Determine the bitMask + if (bits == 0) + { + m_BitCounter = 0; + FieldBitValue = null; + } + else + { + FieldBitValue = bits.ToString(); + + // If bits overflow across the type boundary, then + // they start at the next boundary. + // + // MSDN : + // "Note that nYear is 8 bits long and would overflow + // the word boundary of the declared type, unsigned short. + // Therefore, it is begun at the beginning of a + // new unsigned short." + if (m_BitCounter + bits > size * 8) + { + m_BitCounter = 0; + } + + // 2^bits-1 will give a bit mask with bit# of 1's + // ex: bits = 5, bitMask = 11111 + bitMask = (ulong)Math.Pow(2, (double)bits) - 1; + + // We must slide the bitMask left to put it in place + bitMask <<= m_BitCounter; + m_BitCounter += bits; + + // If we have used all the bits in the type that was defined, then + // restart the counter + if (m_BitCounter == size * 8) + m_BitCounter = 0; + } + + if (bitMask == 0xffffff) + { + bitMask = 0; + } + } + + public void SetArraySize(int size) + { + char result; + + arrayLength = size; // Save the size + + if (!isArray && !isStructure) + { + // Don't handle strings as arrays + if ((FieldInstruType != "S") && (FieldInstruType != "P")) + { + isArray = true; + + MessageArray = new MessageData[size]; + // If the field type is char or unsigned char and the default value + // exists and is a string then write one char of the string to + // each element of the array + if ((FieldType == "char" || FieldType == "unsigned char") && + FieldDefaultValue != null && + !Parse.Try(FieldDefaultValue, out result)) + { + for (uint index = 0; index < size; index++) + { + //Only the elements that are required to spell out the string should + //receive default values. + if (index < FieldDefaultValue.Length) + { + MessageArray[index] = new MessageData(FieldName + "[" + index + "]", + FieldType, FieldValue, FieldDefaultValue[(int)index].ToString(), + FieldMaxValue, FieldMinValue, m_Icd); + MessageArray[index].FieldInstruType = FieldInstruType; + } + else + { + MessageArray[index] = new MessageData(FieldName + "[" + index + "]", + FieldType, FieldValue, "0", + FieldMaxValue, FieldMinValue, m_Icd); + MessageArray[index].FieldInstruType = FieldInstruType; + } + MessageArray[index].depth = depth + 1; + } + } + else + { + for (uint index = 0; index < size; index++) + { + MessageArray[index] = new MessageData(FieldName + "[" + index + "]", + FieldType, FieldValue, FieldDefaultValue, FieldMaxValue, + FieldMinValue, m_Icd); + MessageArray[index].FieldInstruType = FieldInstruType; + MessageArray[index].depth = depth + 1; + } + } + + } + } + } + + public void SetStructureSize(int size) + { + if (!isArray && !isStructure) + { + isStructure = true; + MessageArray = new MessageData[size]; + for (uint index = 0; index < size; index++) + { + MessageArray[index] = new MessageData(FieldName + ".", null, null, null, m_Icd); + } + } + } + + internal void SetInstruType(string Type) + { + if (Type != null) + { + FieldInstruType = Type; + + // Ensure 'S' is used properly + if ((Type == "S") && (FieldType != "char")) + { + return; /* << EXIT >> */ + } + } + else + { + if ((FieldType != null) && + ((FieldType.Trim() == "float") || (FieldType.Trim() == "double"))) + { + FieldInstruType = "F"; + } + else + { + FieldInstruType = "I"; + } + } + } + + internal void SetPixelSize() + { + // Only do this if the user did not define a size + if (imagePixelSize == 0) + { + switch (FieldType) + { + case "char": + case "unsigned char": + case "unsignedchar": + imagePixelSize = 1; + break; + + case "short": + case "unsigned short": + case "unsignedshort": + imagePixelSize = 2; + break; + + case "int": + case "unsigned int": + case "unsignedint": + case "unsigned": + case "boolean": + case "address": + case "float": + imagePixelSize = 4; + break; + + case "double": + case "long long": + case "longlong": + case "unsigned long long": + case "unsignedlonglong": + imagePixelSize = 8; + break; + + default: + if (isEnum) + { + imagePixelSize = 4; + } + else // Error case + { + imagePixelSize = 1; + } + break; + } + } + } + + + private string FormatValue(string Value) + { + if ((Value == null) || (Value == "")) + { + return ""; + } + else // Value exists + { + if (isEnum == false) + { + if (FieldInstruType == "I") + { + // This is being represented as a decimal + if (Parse.Try(Value, out long dec) == true) + { + return dec.ToString(); + } + } + else if (FieldInstruType == "F") + { + // This is being represented as floating point + if (Parse.Try(Value, out double flt) == true) + { + return flt.ToString(); + } + } + else if ((FieldInstruType == "X") || + (FieldInstruType == "B") || + (FieldInstruType == "T")) + { + // This is being represented as a hexadecimal value + if (Parse.Try(Value, out long hex) == true) + { + return "0x" + hex.ToString("X"); + } + } + else if (FieldInstruType == "N") + { + // This is being represented as a binary number + if (Parse.Try(Value, out long bin) == true) + { + return Convert.ToString(bin, 2) + "b"; + } + } + // else InstruType == 'S' or 'P' or anything else return the value + } + else // This value is an enumeration + { + Dictionary enums = m_Icd.GetEnumerations(FieldType); + if (enums.ContainsValue(Value) == true) + { + foreach (KeyValuePair pair in enums) + { + if (pair.Value.Trim() == Value.Trim()) + { + return pair.Key; + } + } + } + } + } + + return Value; // If nothing above applies, simply return the value string + } + + private String RemoveCharFromString(String str, char c) + { + if (str == null) return null; // Handle null case + + int index = str.IndexOf(c); + while (index != -1) + { + str = str.Remove(index, 1); + index = str.IndexOf(c); + } + + return str; + } + + #region ICloneable Members + + public object Clone() + { + MessageData clone = new MessageData(); + + clone.FieldName = FieldName; + clone.FieldType = FieldType; + clone.FieldValue = FieldValue; + clone.FieldArrayValue = FieldArrayValue; + clone.FieldDefaultValue = FieldDefaultValue; + clone.FieldMaxValue = FieldMaxValue; + clone.FieldMinValue = FieldMinValue; + clone.FieldBitValue = FieldBitValue; + clone.FieldInstruType = FieldInstruType; + clone.Variable = Variable; + clone.MaxOffset = MaxOffset; + clone.MinOffset = MinOffset; + clone.VerifyType = VerifyType; + clone.isSelected = isSelected; + clone.isArray = isArray; + clone.isStructure = isStructure; + clone.isArrayOfStructures = isArrayOfStructures; + clone.isEnum = isEnum; + clone.usesRegister = usesRegister; + clone.isValid = isValid; + clone.useRange = useRange; + clone.arrayLength = arrayLength; + clone.bitMask = bitMask; + clone.expanded = expanded; + clone.depth = depth; + clone.m_Icd = m_Icd; + clone.imageWidth = imageWidth; + clone.imageHeight = imageHeight; + clone.imagePixelSize = imagePixelSize; + clone.imageBufferSize = imageBufferSize; + if (imageBufferSize > 0) + { + clone.imageBuffer = new byte[imageBufferSize]; + imageBuffer.CopyTo(clone.imageBuffer, 0); + } + + if (MessageArray == null) + { + clone.MessageArray = null; + } + else + { + clone.MessageArray = new MessageData[MessageArray.Length]; + for (int i = 0; i < MessageArray.Length; i++) + { + clone.MessageArray[i] = (MessageData)MessageArray[i].Clone(); + } + } + + return clone; + } + + #endregion + } +} diff --git a/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/MessageXmlDocument.cs b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/MessageXmlDocument.cs new file mode 100644 index 0000000..b65ce8a --- /dev/null +++ b/Source/TSRealLib/Common/Raytheon.Common/COE/MessagingUtilities/MessageXmlDocument.cs @@ -0,0 +1,449 @@ +// ********************************************************************************************************** +// MessageXmlDocument.cs +// 5/18/2022 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text.RegularExpressions; +using System.Threading; +using System.Xml; +using System.Xml.XPath; +using NLog; + +namespace Raytheon.Common.Coe +{ + public class MessageXmlDocument : XmlDocument + { + private readonly ILogger _logger; + private readonly string _XmlFileName; + private string BuiltXML = ""; + + private uint m_MaxMsgSize = 0; + private readonly List m_IncludeList; + + public bool LogData { get; set; } + + private MessageXmlDocument() : base() + { + LogData = true; + } + + public MessageXmlDocument(string Pathname, bool logData = true) : + base() + { + LogData = logData; + + _logger = LogManager.GetCurrentClassLogger(); + _XmlFileName = Pathname; + + m_IncludeList = new List(); + RecurseProcessing(Pathname); + + BuiltXML = string.Concat(BuiltXML, ""); + BytePackingXml addPacking = new BytePackingXml(BuiltXML); + LoadXml(addPacking.OuterXml); + } + + public Dictionary GetEnumerations(string Type) + { + Dictionary enumList = new Dictionary(); + + // Get XML nodes to parse the XML ICD document + XPathNavigator Node = CreateNavigator(); + XPathNodeIterator Nodeset = Node.Select("interface/enum/name"); + + while (Nodeset.MoveNext()) + { + // Find the enumeration with the name of the type + if (Nodeset.Current.Value.Trim().Equals(Type.Trim())) + { + // Find all the enumeration items + XPathNavigator enumNode = Nodeset.Current.Clone(); + while (enumNode.MoveToNext()) + { + if (enumNode.Name.Trim().Equals("item") || + enumNode.Name.Trim().Equals("enum_item")) + { + string name = null; + string value = null; + + // Find all name nodes + XPathNavigator childNode = enumNode.Clone(); + childNode.MoveToFirstChild(); + do + { + if (childNode.Name.Trim().Equals("name")) + { + name = childNode.Value.Trim(); + } + else if (childNode.Name.Trim().Equals("item_name")) + { + name = childNode.Value.Trim(); + } + + if (childNode.Name.Trim().Equals("value")) + { + value = childNode.Value.Trim(); + } + + // Once we find the name & value, add it to the list + if ((name != null) && (value != null)) + { + enumList.Add(name, value); + break; + } + } while (childNode.MoveToNext()); + } + } + + break; // We found the enumeration we wanted + } + } + + return enumList; + } + + private void RecurseProcessing(string pathName) + { + string directory; + string IncludePathname; + XPathNodeIterator nodeset; + + // Only process each file once + pathName = pathName.Replace('/', '\\'); + if (m_IncludeList.Contains(pathName)) + { + return; // This file has already been processed + } + else + { + m_IncludeList.Add(pathName); + } + + if (LogData) + _logger.Info($"Loading File: {pathName}"); + XPathDocument document = new XPathDocument(pathName); + XPathNavigator navigator = document.CreateNavigator(); + + // Verify this is a COE XML ICD + nodeset = navigator.Select("/interface"); + if (nodeset.Count == 0) + { + // This is not an XML ICD + throw new Exception($"Invalid COE XML Format. Unable to process {pathName}" + + "\nEnsure this is a properly formatted ICD."); + } + + nodeset = navigator.Select("/interface/include/file"); + while (nodeset.MoveNext()) + { + try + { + directory = DirectoryOf(pathName); + } + catch + { + directory = ".\\"; + } + + IncludePathname = nodeset.Current.Value.Trim(); + if ((!IncludePathname.StartsWith("\\")) && (!IncludePathname.Contains(":"))) + { + while (IncludePathname.StartsWith(".")) + { + if ((IncludePathname.StartsWith("..\\")) || (IncludePathname.StartsWith("../"))) + { + directory = DirectoryOf(directory); + IncludePathname = IncludePathname.Remove(0, 3); + } + else if ((IncludePathname.StartsWith(".\\")) || (IncludePathname.StartsWith("./"))) + { + IncludePathname = IncludePathname.Remove(0, 2); + } + } + IncludePathname = string.Concat(directory, "\\", IncludePathname); + } + + if (Regex.IsMatch(IncludePathname, @"\.xml", RegexOptions.IgnoreCase)) + RecurseProcessing(IncludePathname); + } + + nodeset = navigator.Select("/interface/packing|/interface/typedef|/interface/namespace/typedef|" + + "/interface/constant|/interface/namespace/constant|interface/enum|interface/namespace/enum|" + + "/interface/structure|/interface/namespace/structure|/interface/message|/interface/namespace/message"); + while (nodeset.MoveNext()) + { + string item = nodeset.Current.OuterXml; + int index; + while ((index = item.IndexOf("")) != -1) + { + item = item.Remove(index, item.IndexOf("") + 14 - index); + } + while ((index = item.IndexOf("") + 3 - index); + } + while (item.IndexOf("> ") != -1) + { + item = item.Replace("> ", ">"); + } + while (item.IndexOf(" <") != -1) + { + item = item.Replace(" <", "<"); + } + //_logger.Log(LogLevel.Trace, $"Loading Node :\n{item}"); + Thread.Sleep(1); + BuiltXML = string.Concat(BuiltXML, item); + } + } + + private string DirectoryOf(string Pathname) + { + return Pathname.Remove(Pathname.LastIndexOf("\\")); + } + + // + // From the XML document, the definition of a single message can be identified + // from the Message Name and returned as an XML string. + // + public string XmlFileName + { + get + { + return _XmlFileName; + } + } + + public string GetMessage(string messageName) + { + string message; + + messageName = messageName.Trim(); + + if (LogData) + _logger.Info($"Searching for message : {messageName}"); + try + { + message = SelectSingleNode($"/interface/message[name='{messageName}']").OuterXml; + message = TranslateValue(message); + + string labelStr = Regex.Replace(message, @".+ + ACCEPTANCE_TEST, + + /// + /// A Manufacturing Test + /// + MANUFACTURING_TEST, + + /// + /// An Engineering Test + /// + ENGINEERING_TEST, + + /// + /// A Calibration Test + /// + CALIBRATION_TEST, + } +} \ No newline at end of file diff --git a/Source/TSRealLib/Common/Raytheon.Common/Pdel/TestResult.cs b/Source/TSRealLib/Common/Raytheon.Common/Pdel/TestResult.cs new file mode 100644 index 0000000..421d6bd --- /dev/null +++ b/Source/TSRealLib/Common/Raytheon.Common/Pdel/TestResult.cs @@ -0,0 +1,140 @@ +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; +using System.Xml.Serialization; + +namespace Raytheon.Common.PdelWriter.Utilities +{ + [XmlType("ASICTestExecutive-UutTestConfiguration")] + public class TestResultList + { + [XmlArray("TestResultList")] + [XmlArrayItem("TestResult")] + public List List { get; set; } + public TestResultList() + { + List = new List(); + } + } + + public class TestResult : INotifyPropertyChanged + { + [XmlElement("PCode")] + public string PCode { get; set; } + + [XmlElement("TestName")] + public string TestName { get; set; } + + [XmlElement("UnitOfMeasure")] + public string UnitOfMeasure { get; set; } + + [XmlIgnore] + public string MethodName { get; set; } + + [XmlIgnore] + private string messages; + + [XmlIgnore] + public string Messages + { + get { return messages; } + set + { + if (value != messages) + { + messages = value; + OnPropertyChanged("Messages"); + } + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + [XmlIgnore] + private PassFailStatus result; + + [XmlIgnore] + public PassFailStatus Result + { + get { return result; } + set + { + if (value != result) + { + result = value; + OnPropertyChanged("Result"); + } + } + } + + [XmlElement] + public object MeasuredValue { get; set; } + + [XmlIgnore] + public StringBuilder AdditionalInformation { get; set; } + + [XmlIgnore] + private bool testHasAdditionalInformation; + + [XmlIgnore] + public bool TestHasAdditionalInformation + { + get { return testHasAdditionalInformation; } + set + { + if (value != testHasAdditionalInformation) + { + testHasAdditionalInformation = value; + OnPropertyChanged("TestHasAdditionalInformation"); + } + } + } + + public TestResult() + { + AdditionalInformation = new StringBuilder(); + Result = PassFailStatus.Unknown; + } + + /// + /// Copy constructor. + /// + /// + public TestResult(TestResult copyThis) + { + AdditionalInformation = new StringBuilder(copyThis.AdditionalInformation.ToString()); + result = copyThis.result; + PCode = copyThis.PCode; + MethodName = copyThis.MethodName; + testHasAdditionalInformation = copyThis.testHasAdditionalInformation; + TestName = copyThis.TestName; + UnitOfMeasure = copyThis.UnitOfMeasure; + messages = copyThis.messages; + PropertyChanged = copyThis.PropertyChanged; + } + + /// + /// Handles property change events for all public properties that are bound to the view. + /// + /// + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChangedEventHandler handler = this.PropertyChanged; + + if (handler != null) + { + var e = new PropertyChangedEventArgs(propertyName); + handler(this, e); + } + } + + /// + /// Sets the test results to the grid for the user to view. + /// + /// + public void SetTestResults(bool testHasAdditionalInformation) + { + TestHasAdditionalInformation = testHasAdditionalInformation; + } + } +} \ No newline at end of file diff --git a/Source/TSRealLib/Common/Raytheon.Common/Raytheon.Common.csproj b/Source/TSRealLib/Common/Raytheon.Common/Raytheon.Common.csproj index 0d7c9d3..264d6ce 100644 --- a/Source/TSRealLib/Common/Raytheon.Common/Raytheon.Common.csproj +++ b/Source/TSRealLib/Common/Raytheon.Common/Raytheon.Common.csproj @@ -29,16 +29,8 @@ - - {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52} - 2 - 8 - 0 - primary - False - True - - + + Dependencies\Microsoft.Office.Interop.Excel.dll {00020813-0000-0000-C000-000000000046} 1 9 @@ -46,16 +38,16 @@ primary False True - - - {0002E157-0000-0000-C000-000000000046} - 5 - 3 - 0 - primary - False - True - + + + + + true + lib\$(TargetFramework) + + + + \ No newline at end of file diff --git a/Source/TSRealLib/Common/Raytheon.Common/ThreadWorkers/MsgProcessorWorker.cs b/Source/TSRealLib/Common/Raytheon.Common/ThreadWorkers/MsgProcessorWorker.cs index e3ebdaa..4a4e4ee 100644 --- a/Source/TSRealLib/Common/Raytheon.Common/ThreadWorkers/MsgProcessorWorker.cs +++ b/Source/TSRealLib/Common/Raytheon.Common/ThreadWorkers/MsgProcessorWorker.cs @@ -17,6 +17,7 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. using System; using System.Threading; +using NLog; namespace Raytheon.Common { @@ -32,6 +33,7 @@ namespace Raytheon.Common private AutoResetEvent _quitEvent; private bool _threadQuitControl; private MsgDevice.CompleteMessageCallback _completeMsgCallback; + private readonly ILogger _logger; #endregion #region PrivateFunctions @@ -41,23 +43,9 @@ namespace Raytheon.Common /// protected virtual void Dispose(bool disposing) { - try + if (disposing) { - if (disposing) - { - _quitEvent.Dispose(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } + _quitEvent.Dispose(); } } @@ -73,6 +61,7 @@ namespace Raytheon.Common /// A singal to let us know that data has arrived public MsgProcessorWorker(IMsgParser msgParser, ref DataBuffer dataBuffer, ref AutoResetEvent dataInBufferEvent) { + _logger = LogManager.GetCurrentClassLogger(); _msgParser = msgParser; _dataBuffer = dataBuffer; _dataInBufferEvent = dataInBufferEvent; @@ -93,23 +82,9 @@ namespace Raytheon.Common /// public void Dispose() { - try - { - Dispose(true); + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + GC.SuppressFinalize(this); } /// @@ -121,7 +96,7 @@ namespace Raytheon.Common { if (_completeMsgCallback == null) { - throw new Exception("MsgProcessorWorker::DoWork() - Callback not set"); + throw new Exception("Callback not set"); } WaitHandle[] waithandles = new WaitHandle[2]; @@ -170,9 +145,9 @@ namespace Raytheon.Common if (_msgParser.Run(payLoadPtr, numBytesLeftInTempBuffer, ref numBytesToRemove, ref msgId, ref errorCode) == true) { - string msg = "MsgProcessorWorker::DoWork() - removing " + numBytesToRemove.ToString() + " bytes, for msg id: " + msgId.ToString("X8"); + string msg = "removing " + numBytesToRemove.ToString() + " bytes, for msg id: " + msgId.ToString("X8"); - ErrorLogger.Instance().Write(msg, ErrorLogger.LogLevel.INFO); + _logger.Debug(msg); // we have a complete message, invoke the call back _completeMsgCallback(msgId, payLoadPtr, numBytesToRemove, errorCode); @@ -192,18 +167,18 @@ namespace Raytheon.Common // were we signaled to quit? if (_threadQuitControl == true) { - ErrorLogger.Instance().Write("MsgProcessorWorker::DoWork() - in the midst of procesing data, the quit event was detected, exiting", ErrorLogger.LogLevel.INFO); + _logger.Debug("in the midst of procesing data, the quit event was detected, exiting"); isTheWorkDone = true; } } } - + //Check start of data back in since we are done with it _dataBuffer.CheckInStartOfData(); } else if (eventIndex == 1) // _quitEvent { - ErrorLogger.Instance().Write("MsgProcessorWorker::DoWork() - quit event was detected, exiting", ErrorLogger.LogLevel.INFO); + _logger.Debug("quit event was detected, exiting"); isTheWorkDone = true; } else if (eventIndex == WaitHandle.WaitTimeout) @@ -212,16 +187,11 @@ namespace Raytheon.Common } else { - ErrorLogger.Instance().Write("MsgProcessorWorker::DoWork() - Unhandled return from WaitHandle.WaitAny(): " + eventIndex.ToString()); + _logger.Debug(" Unhandled return from WaitHandle.WaitAny(): " + eventIndex.ToString()); } } - - ErrorLogger.Instance().Write("MsgProcessorWorker::DoWork() - exiting", ErrorLogger.LogLevel.INFO); - } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); } + catch { } } /// diff --git a/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/BITCOEDeviceInstrument.cs b/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/BITCOEDeviceInstrument.cs deleted file mode 100644 index f8bd962..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/BITCOEDeviceInstrument.cs +++ /dev/null @@ -1,1113 +0,0 @@ -// ********************************************************************************************************** -// BITCOEDeviceInstrument.cs -// 6/21/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** -using System; -using Raytheon.Instruments.MessagingUtilities; -using System.Xml.XPath; -using System.Collections.Generic; -using System.Threading.Tasks; -using System.Linq; -using System.Threading; -using Raytheon.Common; -using Raytheon.Instruments.coeCSharp; -using Raytheon.Instruments.Exceptions; -using System.Collections.Concurrent; -using static Raytheon.Instruments.MessagingUtilities.Message; -using System.IO; -using System.Reflection; -using System.Globalization; -using System.Runtime.CompilerServices; -using NLog; - -[assembly: InternalsVisibleTo("BITCOEDeviceNode.Tests")] -namespace Raytheon.Instruments -{ - /// - /// This device supports different ways of communicating with other COE nodes - /// TCP - /// UDP - /// Serial - /// - public enum DriverType - { - Undefined, - TCP, - UDP, - Serial - }; - - /// - /// Implementation of the IBit interface - /// - public class BITCOEDeviceInstrument : IBit - { - /// - /// Nlog logger - /// - private readonly ILogger _logger; - - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - /// - /// reference to the main wrapper class for Common Operating Environment - /// - private readonly coe _coe; - - /// - /// COE endpoint - /// - private coeEndpoint _endpoint; - - /// - /// cancellation token for stopping reading thread - /// - private CancellationTokenSource _cancellationTokenSource = null; - - /// - /// collection of the messages received - /// - private readonly Dictionary>> _messages; - - /// - /// UDP, TCP, Serial or Undefined - /// - private DriverType _driverType; - - /// - /// dictionary of options when initializing COE endpoint and router - /// - private readonly Dictionary>> _options = new Dictionary>>(); - - /// - /// used for initialization of the endpoint - /// - private uint _maxMessageSize; - private uint _epQueueDepth; - - /// - /// Number of milliseconds to wake up and check the message when receiving - /// - private int _checkForMessageIntervalMs; - - /// - /// collection of all labels with message names per every XML file - /// - private readonly Dictionary> _icds = new Dictionary>(); - - /// - /// collection of response labels or messages that COE endpoint should be registered for - /// - private readonly List _responseLabels = new List(); - - /// - /// collection of message XML documents (processed XML files) used in COE communications - /// - private readonly Dictionary _xmlDocs = new Dictionary(); - - /// - /// when set to true the instrument will check every value and if empty - /// will populate it with the default value - /// - private bool _alwaysSendDefaults; - - /// - /// instrument constructor - /// - public BITCOEDeviceInstrument(string name, IConfigurationManager configurationManager, DriverType driverType = DriverType.Undefined, ILogger logger = null) - { - Info = new InstrumentMetadata - { - ModelNumber = "COECommDevice" - }; - - if (logger == null) - logger = LogManager.GetCurrentClassLogger(); - - _logger = logger; - - Status = State.Uninitialized; - DetailedStatus = "COE Uninitialized"; - - Name = name; - - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } - - if (configurationManager == null) - { - _logger.Error($"Cannot create {Name} without a configuration manager"); - return; - } - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _messages = new Dictionary>>(); - - _driverType = driverType; - - _coe = new coe(); - } - - public string DetailedStatus { get; protected set; } - - public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } - - public InstrumentMetadata Info { get; set; } - - public string Name { get; protected set; } - - public SelfTestResult SelfTestResult => PerformSelfTest(); - - public State Status { get; set; } - - public bool ClearErrors() - { - return true; - } - - /// - /// Initializes COE instrument - /// - public void Initialize() - { - _logger.Trace($"{Name}({_driverType}) Initializing..."); - - if (_driverType == DriverType.Undefined) - _driverType = _configuration.GetConfigurationValue("Parameters", "DriverType", "TCP"); - - _alwaysSendDefaults = _configuration.GetConfigurationValue("Parameters", "AlwaysSendDefaults", false); - - _options.Clear(); - _options.Add("ROUTER_CONFIG", new List> - { - { new KeyValuePair("NODE_ID", _configuration.GetConfigurationValue("ROUTER_CONFIG", "NODE_ID", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_STATE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_STATE", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_LABEL_MESSAGE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_LABEL_MESSAGE", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_BRIDGE_REGISTRATION", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_BRIDGE_REGISTRATION", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_ROUTER_DATABASE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_ROUTER_DATABASE", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - { new KeyValuePair("BUFFER_SIZE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "BUFFER_SIZE", "256")) }, - { new KeyValuePair("ENABLE_REGISTRATION_MESSAGES", _configuration.GetConfigurationValue("ROUTER_CONFIG", "ENABLE_REGISTRATION_MESSAGES", "1")) }, - { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "THREAD_STACK_SIZE", "16384")) }, - }); - - _options.Add("ROUTER_PROTOCOL_CONFIG", new List> - { - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("ROUTER_PROTOCOL_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("ROUTER_PROTOCOL_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("ROUTER_PROTOCOL_CONFIG", "THREAD_STACK_SIZE", "16384")) }, - }); - - var poolEntry = _configuration.GetConfigurationValue("ROUTER_BUFFER_POOLS", "POOL_ENTRY", "100,32|50,128|100,384|150,1536|10,65535"); - if (!string.IsNullOrEmpty(poolEntry)) - { - var poolEntries = poolEntry.Split('|'); - if (poolEntries.Any()) - { - var entries = new List>(); - foreach (var entry in poolEntries) - { - entries.Add(new KeyValuePair("POOL_ENTRY", entry)); - } - _options.Add("ROUTER_BUFFER_POOLS", entries); - } - } - - _options.Add("BASIC_REGISTRATION_CONFIG", new List> - { - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND_BUFFER", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_SEND_BUFFER", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV_BUFFER", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_RECV_BUFFER", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_STATE", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_STATE", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_PING_SEND", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_PING_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_PING_RECV", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_PING_RECV", "0")) }, - { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "THREAD_STACK_SIZE", "16384")) }, - }); - - switch (_driverType) - { - case DriverType.UDP: - _options.Add("UDP_MEDIA_BINDING_CONFIG", new List> - { - { new KeyValuePair("LOCAL_IP_ADDRESS", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "LOCAL_IP_ADDRESS", "127.0.0.1")) }, - { new KeyValuePair("REMOTE_IP_ADDRESS", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "REMOTE_IP_ADDRESS", "127.0.0.1")) }, - { new KeyValuePair("LOCAL_SEND_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "LOCAL_SEND_PORT", "32010")) }, - { new KeyValuePair("LOCAL_RECV_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "LOCAL_RECV_PORT", "32020")) }, - { new KeyValuePair("REMOTE_SEND_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "REMOTE_SEND_PORT", "32011")) }, - { new KeyValuePair("REMOTE_RECV_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "REMOTE_RECV_PORT", "32021")) }, - { new KeyValuePair("RECV_TIMEOUT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "RECV_TIMEOUT", "200")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - { new KeyValuePair("MTU_SIZE", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "MTU_SIZE", "1472")) }, - { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "THREAD_STACK_SIZE", "16384")) }, - { new KeyValuePair("THREAD_NAME", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "THREAD_NAME", "UDP_MB_RCV")) }, - }); - break; - - case DriverType.TCP: - _options.Add("TCP_MEDIA_BINDING_CONFIG", new List> - { - { new KeyValuePair("LOCAL_PORT", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "LOCAL_PORT", "9990")) }, - { new KeyValuePair("NUM_PORTS", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "NUM_PORTS", "32")) }, - { new KeyValuePair("NUM_DYNAMIC_NODES", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "NUM_DYNAMIC_NODES", "32")) }, - { new KeyValuePair("SERVER_ADDRESS", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "SERVER_ADDRESS", "127.0.0.1:9990")) }, - { new KeyValuePair("UDP_TX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "UDP_TX_BUFFER_SIZE", "5000")) }, - { new KeyValuePair("UDP_RX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "UDP_RX_BUFFER_SIZE", "32768")) }, - { new KeyValuePair("TCP_TX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TCP_TX_BUFFER_SIZE", "5000")) }, - { new KeyValuePair("TCP_RX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TCP_RX_BUFFER_SIZE", "4096")) }, - { new KeyValuePair("PACKET_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "PACKET_SIZE", "5128")) }, - { new KeyValuePair("TCP_SELECT_VALUE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TCP_SELECT_VALUE", "1")) }, - { new KeyValuePair("DISABLE_NAG_DELAY", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISABLE_NAG_DELAY", "1")) }, - { new KeyValuePair("TIMER_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TIMER_RATE", "1000")) }, - { new KeyValuePair("CONNECT_KA_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "CONNECT_KA_RATE", "1")) }, - { new KeyValuePair("RECV_KA_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_KA_RATE", "1")) }, - { new KeyValuePair("SERVER_CONNECT_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "SERVER_CONNECT_RATE", "1")) }, - { new KeyValuePair("RECV_THREAD_STACK_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_STACK_SIZE", "4096")) }, - { new KeyValuePair("RECV_THREAD_PRIORITY", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_PRIORITY", "0")) }, - { new KeyValuePair("RECV_THREAD_AFFINITY", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_AFFINITY", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND_BUFFER", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_UDP_RECV", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_UDP_RECV", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_UDP_RECV_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_UDP_RECV_BUFFER", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_TCP_RECV", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_TCP_RECV", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_TCP_RECV_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_TCP_RECV_BUFFER", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV_BUFFER", "1")) }, - }); - break; - - case DriverType.Serial: - _options.Add("SERIAL_MEDIA_BINDING_CONFIG", new List> - { - { new KeyValuePair("DEVICE_NAME", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DEVICE_NAME", "\\\\.\\COM1")) }, - { new KeyValuePair("BAUD_RATE", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "BAUD_RATE", "9600")) }, - { new KeyValuePair("DATA_BITS", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DATA_BITS", "8")) }, - { new KeyValuePair("STOP_BITS", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "STOP_BITS", "1")) }, - { new KeyValuePair("PARITY", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "PARITY", "0")) }, - { new KeyValuePair("FLOW_CONTROL", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "FLOW_CONTROL", "0")) }, - { new KeyValuePair("MTU_SIZE", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "MTU_SIZE", "256")) }, - { new KeyValuePair("RECV_PROCESSING_DELAY", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "RECV_PROCESSING_DELAY", "100")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - }); - break; - - default: - _logger.Error($"{Name}({_driverType}) Configured driver type not valid"); - break; - } - - _maxMessageSize = _configuration.GetConfigurationValue("Parameters", "MaxMessageSize", "5000"); - _epQueueDepth = _configuration.GetConfigurationValue("Parameters", "EPQueueDepth", "5000"); - _checkForMessageIntervalMs = _configuration.GetConfigurationValue("Parameters", "CheckForMessageIntervalMs", "100"); - - var responseLabels = _configuration.GetConfigurationListValue("ResponseMessageIds", "ResponseLabel", new List { "1", "2" }); - - var bitFilePaths = _configuration.GetConfigurationListValue("BitFilePaths", "FilePath", new List { "File1", "File2" }); - - _xmlDocs.Clear(); - foreach (var path in bitFilePaths) - { - _xmlDocs.Add(path, new MessageXmlDocument(path, _logger)); - } - - _icds.Clear(); - foreach (var path in bitFilePaths) - { - _icds.Add(path, ProcessFileForNamesAndLabels(path)); - } - - foreach (var strLabel in responseLabels) - { - uint label = GetLabelFromMessageId(strLabel); - if (label > 0) - _responseLabels.Add(label); - } - - DetailedStatus = "COE Initialized"; - Status = State.Ready; - } - - /// - /// performs self-test - /// - /// - public SelfTestResult PerformSelfTest() - { - _logger.Trace($"{Name}({_driverType}) Performing Self Test..."); - - // TODO implement method - return SelfTestResult.Pass; - } - - /// - /// Resets COE device comms - /// - /// - public void Reset() - { - _logger.Trace($"{Name}({_driverType}) Resetting..."); - - Close(); - - Open(); - } - - /// - /// Shuts down COE device - /// - public void Shutdown() - { - _logger.Trace($"{Name}({_driverType}) Shutting Down..."); - try - { - Close(); - //coe.UnloadImportedDll("coeWindows-shared.dll"); - } - catch (Exception ex) - { - _logger.Error(ex, $"{Name}({_driverType}) Error while closing"); - } - } - - #region IBit functions - /// - /// Opens COE connection - /// - /// - public void Open() - { - _logger.Trace($"{Name}({_driverType}) Opening..."); - - try - { - switch (_driverType) - { - case DriverType.TCP: - - if (_coe.tcp_media_binding_configure(_options, _logger) != coe.Status.SUCCESS) - { - _logger.Error($"{Name}({_driverType}) COE TCP media binding initialization failure.\nTry checking your connection configuration.\nYou could have a port collision."); - Status = State.CommunicationFailure; - throw new BitNotConnectedException($"{Name}({_driverType}) COE TCP media binding initialization failure"); - } - _logger.Trace($"{Name}({_driverType}) COE TCP media binding initialization, {_coe.ProtocolCmitName}"); - break; - case DriverType.UDP: - if (_coe.udp_media_binding_configure(_options, _logger) != coe.Status.SUCCESS) - { - _logger.Error($"{Name}({_driverType}) COE UDP media binding initialization failure.\nTry checking your connection configuration.\nYou could have a port collision."); - Status = State.CommunicationFailure; - throw new BitNotConnectedException($"{Name}({_driverType}) COE UDP media binding initialization failure"); - } - _logger.Trace($"{Name}({_driverType}) COE UDP media binding initialization, Local: {_coe.ProtocolCmitName} Remote: {_coe.ProtocolName}"); - break; - case DriverType.Serial: - if (_coe.serial_media_binding_configure(_options, _logger) != coe.Status.SUCCESS) - { - _logger.Error($"{Name}({_driverType}) COE Serial media binding initialization failure.\nTry checking your connection configuration.\nYou could have a port collision."); - Status = State.CommunicationFailure; - throw new BitNotConnectedException($"{Name}({_driverType}) COE Serial media binding initialization failure"); - } - _logger.Trace($"{Name}({_driverType}) COE Serial media binding initialization, {_coe.ProtocolCmitName}"); - break; - default: - _logger.Error($"{Name}({_driverType}) Configured driver type not valid"); - throw new BitNotConnectedException($"{Name}({_driverType}) Configured driver type not valid"); - } - - foreach (var item in _options) - { - _logger.Trace($"{item.Key}:"); - foreach (var pair in item.Value) - { - _logger.Trace(string.Format("{0,-50} {1, -40}", pair.Key, pair.Value)); - } - } - - } - catch (Exception ex) - { - _logger.Error(ex); - Status = State.CommunicationFailure; - DetailedStatus = "Unable to Open"; - throw; - } - - try - { - _coe.SetConnected(true); - - //_endpoint = new coeEndpoint(_maxMessageSize, _epQueueDepth, _coe.Router); - _endpoint = new coeEndpoint(_maxMessageSize, _epQueueDepth); - - _logger.Info($"{Name}({_driverType}) Endpoint Created, Max Message Size: {_maxMessageSize}, Queue Depth: {_epQueueDepth}"); - - foreach (var item in _responseLabels) - { - var fileName = WhichFileContainsTheLabel(item); - if (!string.IsNullOrEmpty(fileName)) - { - var msgName = _icds[fileName][item]; - if (!string.IsNullOrEmpty(msgName)) - { - _endpoint.Register(item); - _logger.Debug($"{Name}({_driverType}) Registering new message with the endpoint, {item}: {msgName}"); - } - else - { - _logger.Warn($"{Name}({_driverType}) Message with label {item} is not located in file {fileName}"); - } - } - else - { - _logger.Warn($"{Name}({_driverType}) Unable to locate label {item} in any of the XML files registered for COE device"); - } - } - - _cancellationTokenSource = new CancellationTokenSource(); - Task.Run(() => ReadMessages(_cancellationTokenSource.Token)); - - Status = State.Ready; - DetailedStatus = "Opened"; - } - catch (Exception ex) - { - Status = State.CommunicationFailure; - DetailedStatus = "Unable to Open"; - _logger.Error(ex); - throw; - } - } - - /// - /// Close COE endpoint - /// - /// - public void Close() - { - _logger.Trace($"{Name}({_driverType}) Closing ..."); - - Status = State.Uninitialized; - - _cancellationTokenSource?.Cancel(); - - Thread.Sleep(1000); - - if (_messages.Any()) - { - foreach (var queue in _messages) - { - while (queue.Value.TryDequeue(out Tuple throwAway)) - { - _logger.Warn($"Message {throwAway.Item2.Label} ({throwAway.Item2.XmlMessage.Name}) received at {throwAway.Item1:hh.mm.ss.fff} was unclaimed"); - } - } - } - - _messages.Clear(); - - _coe.SetConnected(false); - var status = _driverType == DriverType.TCP ? - _coe.TCP_media_binding_shutdown(_logger) : _driverType == DriverType.UDP ? - _coe.UDP_media_binding_shutdown(_logger) : _coe.SERIAL_media_binding_shutdown(_logger); - - if (status != coe.Status.SUCCESS) - { - _logger.Error($"{_driverType} media binding shutdown failure, status {status}"); - } - else - { - _logger.Debug($"{_driverType} shutdown was successful"); - } - - _endpoint?.Dispose(); - - _cancellationTokenSource?.Dispose(); - _cancellationTokenSource = null; - - DetailedStatus = "Closed"; - } - - /// - /// runs single BIT test request, no waiting for response - /// expecting user to run - /// - /// - /// - /// - /// - /// - public bool RunBIT(string messageId, uint timeoutInMs, IEnumerable> messageParams) - { - _logger.Trace($"{Name}({_driverType}) Running BIT for {messageId} with timeout {timeoutInMs} ..."); - - if (!_coe.IsConnected) - { - _logger.Error("Error sending COE message, COE not connected"); - throw new BitNotConnectedException(); - } - if (Status != State.Ready) - { - _logger.Warn("Exiting RunBIT due to status"); - throw new BitNotConnectedException(); - } - - var label = GetLabelFromMessageId(messageId); - - var path = WhichFileContainsTheLabel(label); - if (string.IsNullOrEmpty(path)) - { - var msg = $"Message Id {messageId} not found in any of the BIT files"; - _logger.Error(msg); - throw new BitParseException(msg); - } - - try - { - var message = GetOeMessageWithParameters(label, messageParams, path); - - _logger.Info("Sending ..."); - message.XmlMessage.SendToLog(EnumerationType.EXPANDED_FIELDS, MessageDirection.Out); - - var status = _endpoint.Send(message); - - if (status != coe.Status.SUCCESS) - { - _logger.Error($"Error sending COE message, error code: {status}"); - } - - return true; - } - catch (Exception ex) - { - _logger.Error(ex); - return false; - } - } - - /// - /// Runs a BIT and expects a result - /// - /// - /// - /// - /// - /// - /// - public BitTestResults RunBITWaitForResults(string messageIdOut, string messageIdIn, uint timeoutInMs, IEnumerable> messageParams) - { - _logger.Trace($"{Name}({_driverType}) Running BIT for {messageIdOut} and waiting for result {messageIdIn} with timeout {timeoutInMs}..."); - - if (!_coe.IsConnected) - { - _logger.Error("Error sending COE message, COE not connected"); - throw new BitNotConnectedException(); - } - - if (Status != State.Ready) - { - _logger.Warn("Exiting RunBITWaitForResults due to status"); - throw new BitNotConnectedException(); - } - - if (RunBIT(messageIdOut, timeoutInMs, messageParams)) - { - if (string.IsNullOrEmpty(messageIdIn)) - { - messageIdIn = "0"; - } - - string[] multipleIds = messageIdIn.Split(','); - - var totalWaitTimeMs = 0; - - BitTestResults results = null; - do - { - foreach (var id in multipleIds) - { - results = GetBITResults(id); - - if (results != null) - { - break; - } - } - - if (results != null || Status != State.Ready) - { - break; - } - else - { - Thread.Sleep(_checkForMessageIntervalMs); - totalWaitTimeMs += _checkForMessageIntervalMs; - } - - } while (results == null && totalWaitTimeMs < timeoutInMs); - - if (results != null) - { - _logger.Debug($"-- Successfully retrieved result message, totalWaitTimeMs = {totalWaitTimeMs}"); - return results; - } - else - throw new BitTimeoutException(); - } - else - { - return null; - } - } - - /// - /// Reads BIT results - /// - /// - /// - /// - public BitTestResults GetBITResults(string messageId) - { - if (!_coe.IsConnected) - { - _logger.Error("Error reading COE message, COE not connected"); - throw new BitNotConnectedException(); - } - - uint label = 0; - // empty string or zero means first available message from the top - if (!string.IsNullOrEmpty(messageId) && messageId != "0") - { - label = GetLabelFromMessageId(messageId); - if (label == 0) - { - _logger.Error($"{Name}({_driverType}) Unable to match message {messageId} with anything in the dictionary. Check your configuration"); - return null; - } - } - - string strLabel = label.ToString(); - - ConcurrentQueue> queue; - - lock (this) - { - queue = label == 0 ? - _messages.Any() ? _messages.FirstOrDefault().Value : null : - _messages.ContainsKey(strLabel) ? _messages[strLabel] : null; - } - - if (queue != null && queue.TryDequeue(out Tuple message)) - { - var oeMessage = message.Item2; - - if (queue.IsEmpty) - { - lock (this) - { - _messages.Remove(oeMessage.Label); - } - } - - // make a copy of the buffer - var xmlMessage = oeMessage.XmlMessage; - if (xmlMessage != null) - { - var results = new BitTestResults - { - Label = oeMessage.Label, - Time = message.Item1, - - // parse message result into list of results - Results = FromXmlToBitTestResults(xmlMessage) - }; - - return results; - } - else - { - var msg = $"Found a message with label {label}, but the Buffer is empty"; - _logger.Error(msg); - throw new BitParseException(msg); - } - } - else - { - // message not found - return null; - } - } - - #endregion - - #region Private Functions - - /// - /// keep reading messages and stash them in _messages dictionary with label and timestamp as a key - /// - /// - /// - private void ReadMessages(CancellationToken cancellationToken) - { - _logger.Debug($"{Name}({_driverType}) Starting to read messages."); - - try - { - while (!cancellationToken.IsCancellationRequested) - { - //_logger.Debug($"{Name}({_driverType}) Checking for messages..."); - var status = _endpoint.Wait(1000); - - if (status == coe.Status.SUCCESS) - { - _logger.Debug("Message Received..."); - - while (_endpoint.Peek(out uint label, out uint size, out int priority) == coe.Status.SUCCESS) - { - var hexLabel = $"0x{label:X}"; - _logger.Debug($"{Name}({_driverType}) Identified message by peeking... {label} ({hexLabel})"); - - var xmlDoc = WhichFileContainsTheLabel(label); - - var message = new OeMessage((int)size + 1) - { - XmlMessage = new Message(_xmlDocs[xmlDoc], label.ToString()) - }; - - status = _endpoint.Receive(message); - - if (status == coe.Status.SUCCESS) - { - _logger.Debug($"{Name}({_driverType}) Successfully read message... Label: {hexLabel} ({message.XmlMessage?.Name})"); - - message.XmlMessage.SendToLog(EnumerationType.EXPANDED_FIELDS, MessageDirection.In); - - ConcurrentQueue> queue; - - lock (this) - { - if (!_messages.ContainsKey(message.Label)) - { - _messages.Add(message.Label, new ConcurrentQueue>()); - } - queue = _messages[message.Label]; - } - - queue.Enqueue(new Tuple(DateTime.Now, message)); - } - else - { - _logger.Error($"{Name}({_driverType}) Endpoint Receive Failed. Status = {status}"); - } - } - } - // If not timeout and no cancellation requested - else if (status != coe.Status.FAILED_TIMEOUT && !cancellationToken.IsCancellationRequested) - { - _logger.Error($"{Name}({_driverType}) Event Flag Wait Failed. Status = {status}"); - } - } - _logger.Debug($"{Name}({_driverType}) Stopping to read messages. Cancellation was requested."); - } - catch (Exception ex) - { - _logger.Error(ex); - } - } - - /// - /// if message id can be converted to uint returns the value - /// otherwise returns the related label from the message id by dictionary lookup - /// - /// - /// - private uint GetLabelFromMessageId(string messageId) - { - uint labelId = FromStringToUint(messageId); - - if (labelId == 0) - { - foreach (var file in _icds) - { - var item = file.Value.FirstOrDefault(l => l.Value == messageId); - if (!string.IsNullOrEmpty(item.Value)) - return item.Key; - } - } - - return labelId; - } - /// - /// return file path for the file that contains the label - /// - /// - /// - private string WhichFileContainsTheLabel(uint label) - { - foreach (var item in _icds) - { - if (item.Value.Keys.Contains(label)) - { - return item.Key; - } - } - return string.Empty; - } - - /// - /// convert from Message to list of BItTestResult fields - /// - /// - /// - private IList FromXmlToBitTestResults(Message message) - { - if (message == null) - return null; - - var result = FromMessageArrayToBitResult(message.MessageDataArray); - - return result; - } - - /// - /// recursive function for getting results out - /// - /// - /// - private IList FromMessageArrayToBitResult(MessageData[] messages) - { - if (messages == null || messages.Length == 0) - return null; - - var result = new List(); - - foreach (var item in messages) - { - result.Add(FromMessageDataToBitTestResult(item)); - - if (item.MessageArray != null && item.MessageArray.Length > 0) - { - var moreResults = FromMessageArrayToBitResult(item.MessageArray); - result.AddRange(moreResults); - } - } - - return result; - } - - /// - /// copy message data fields to BitTestResult - /// - /// - /// - private static BitTestResult FromMessageDataToBitTestResult(MessageData from) - { - if (from == null) - return null; - - return new BitTestResult - { - FieldArrayValue = from.FieldArrayValue, - FieldBitValue = from.FieldBitValue, - FieldDefaultValue = from.FieldDefaultValue, - FieldInstruType = from.FieldInstruType, - FieldMaxValue = from.FieldMaxValue, - FieldMinValue = from.FieldMinValue, - FieldName = from.FieldName, - FieldType = from.FieldType, - FieldValue = from.FieldValue, - Variable = from.Variable, - MaxOffset = from.MaxOffset, - MinOffset = from.MinOffset, - VerifyType = from.VerifyType, - IsSelected = from.isSelected, - IsArray = from.isArray, - IsStructure = from.isStructure, - IsArrayOfStructures = from.isArrayOfStructures, - IsEnum = from.isEnum, - UsesRegister = from.usesRegister, - IsValid = from.isValid, - UseRange = from.useRange, - ArrayLength = from.arrayLength, - ImageWidth = from.imageWidth, - ImageHeight = from.imageHeight, - ImagePixelSize = from.imagePixelSize, - BitMask = from.bitMask, - Expanded = from.expanded, - Depth = from.depth, - ImageBuffer = from.imageBuffer?.ToArray(), - ImageBufferSize = from.imageBufferSize, - }; - } - - /// - /// Build OeMessage from messageId and provided parameters - /// - /// - /// - /// - private OeMessage GetOeMessageWithParameters(uint messageId, IEnumerable> messageParams, string bitFilePath) - { - var messageName = _icds[bitFilePath][messageId]; - var message = new OeMessage(new Message(messageName, new MessageXmlDocument(bitFilePath, _logger))); - - if (messageParams != null) - { - message.XmlMessage.MessageDataArray = PopulateParameters(message.XmlMessage.MessageDataArray, 0, messageParams); - } - - return message; - } - - /// - /// recursive function to populate parameters - /// - /// message data array - /// indicates how deep in the tree we are populating parameters - /// message parameters - /// - internal MessageData[] PopulateParameters(MessageData[] data, int level, IEnumerable> messageParams) - { - // only get parameters from the same level - var levelParams = messageParams.Where(m => m.Key.Where(c => c == '.' || c == ']').Count() == level); - - foreach (var item in data) - { - if (item.FieldName.StartsWith("$")) - continue; - - var messageParam = levelParams.FirstOrDefault(m => m.Key.EndsWith(item.FieldName)); - if (!string.IsNullOrEmpty(messageParam.Key) && !string.IsNullOrEmpty(messageParam.Value)) - { - item.FieldValue = messageParam.Value; - } - // always send defaults means that even if parameter was not provided use the default value to populate field value - else if (_alwaysSendDefaults) - { - item.FieldValue = item.FieldDefaultValue; - } - - // if there are more levels, update recursively - if (item.MessageArray != null && item.MessageArray.Length > 0) - item.MessageArray = PopulateParameters(item.MessageArray, level + 1, messageParams); - } - - return data; - } - - /// - /// reads xml file and extracts all message names with associated labels - /// - /// - /// - private Dictionary ProcessFileForNamesAndLabels(string filePath) - { - var doc = new XPathDocument(filePath); - - XPathNavigator node = doc.CreateNavigator(); - XPathNodeIterator nodeset = node.Select("interface/message"); - - var result = new Dictionary(); - - while (nodeset.MoveNext()) - { - var children = nodeset.Current.SelectChildren(XPathNodeType.Element); - if (children.Count > 0) - { - string strName = string.Empty; - string strLabel = string.Empty; - - while (children.MoveNext()) - { - if (children.Current.Name == "name") - { - strName = children.Current.Value; - if (!string.IsNullOrEmpty(strName)) - strName = strName.Trim(); - } - else if (children.Current.Name == "label") - { - strLabel = children.Current.Value; - if (!string.IsNullOrEmpty(strLabel)) - strLabel = strLabel.Trim(); - } - } - - uint iLabel = FromStringToUint(strLabel); - - if (!string.IsNullOrEmpty(strName) && iLabel > 0) - { - result.Add(iLabel, strName); - } - } - } - return result; - } - - /// - /// converts from string representation of a label to uint value - /// - /// - /// - private uint FromStringToUint(string data) - { - if (!string.IsNullOrEmpty(data)) - { - if (data.StartsWith("0x", StringComparison.CurrentCultureIgnoreCase) || data.StartsWith("&H", StringComparison.CurrentCultureIgnoreCase)) - { - if (uint.TryParse(data.Substring(2), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out uint uiValue)) - return uiValue; - } - else - { - if (uint.TryParse(data, out uint uiValuel)) - return uiValuel; - } - } - return 0; - } - - #endregion - } -} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/ConfigurationHelper.cs b/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/ConfigurationHelper.cs deleted file mode 100644 index 3a82796..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/ConfigurationHelper.cs +++ /dev/null @@ -1,135 +0,0 @@ -// ********************************************************************************************************** -// ConfigurationHelper.cs -// 7/5/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** - -using Raytheon.Common; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Xml.Linq; - -namespace Raytheon.Instruments -{ - /// - /// type conversion utility with a special case for enums - /// - public static class TypeConverter - { - public static T ChangeType(object value) - { - return typeof(T).IsEnum ? (T)Enum.Parse(typeof(T), value.ToString()) : (T)ChangeType(typeof(T), value); - } - - public static object ChangeType(Type t, object value) - { - System.ComponentModel.TypeConverter tc = TypeDescriptor.GetConverter(t); - return tc.ConvertFrom(value); - } - - public static void RegisterTypeConverter() where TC : System.ComponentModel.TypeConverter - { - TypeDescriptor.AddAttributes(typeof(T), new TypeConverterAttribute(typeof(TC))); - } - } - - /// - /// Helper class contains extention fuctions for reading types other than strings from configuration, - /// as well as reading lists of values - /// - public static class ConfigurationHelper - { - /// - /// template function for reading different types from configuration - /// - /// - /// - /// - /// - /// - public static T GetConfigurationValue(this IConfiguration configuration, string section, string key, string defaultValue) - { - var tmpResult = configuration.GetConfigurationValue(section, key, defaultValue); - return !string.IsNullOrEmpty(tmpResult) ? TypeConverter.ChangeType(tmpResult) : default; - } - - /// - /// returns multivalue result (list of T) from configuration - /// - /// - /// - /// - /// - /// - public static List GetConfigurationListValue(this IConfiguration configuration, string section, string key, List defaultValue) - { - var tmpResult = configuration.GetXmlConfiguration(section); - if (string.IsNullOrEmpty(tmpResult)) - { - var xmlStr = new StringBuilder(); - xmlStr.Append($"<{key}s>"); - foreach (var item in defaultValue) - { - xmlStr.Append($"<{key}>"); - xmlStr.Append(item.ToString()); - xmlStr.Append($""); - } - xmlStr.Append($""); - - configuration.SetXmlConfiguration(section, xmlStr.ToString()); - return defaultValue; - } - else - { - var stringRes = BuildElementListFromXml(tmpResult, key); - return new List(stringRes.Select(x => TypeConverter.ChangeType(x))); - } - } - - /// - /// returns values from XML section converted to string list - /// - /// - /// - /// - private static List BuildElementListFromXml(string data, string key) - { - XElement doc = XElement.Parse(data); - IEnumerable xmlMessages = from m - in doc.Elements($"{key}s").Elements(key) - select m; - var messages = xmlMessages.Select(x => x.Value); - return messages?.ToList(); - } - } -} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/COEComm.csproj b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/COEComm.csproj deleted file mode 100644 index e983530..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/COEComm.csproj +++ /dev/null @@ -1,56 +0,0 @@ - - - - - net472 - Raytheon.Instruments.COEComm - C# wrapper for the COE Windows, integrated real-time software operating environment designed for use in embedded systems - - - - 1.0.0 - true - - - - 1701;1702;NU1803 - - - - - - - - $(PrepareForRunDependsOn);CopyFilesTargetName - - - - build\R04.$(Configuration)\x86\coeWindows-shared.dll - build\R04.06.05.02\x86\coeWindows-shared.dll;build\R04.06.05.02\x86\coeWindows-sharedd.dll - - - - - lib\$(TargetFramework) - - PreserveNewest - PreserveNewest - True - - - - - - - - - - - - - - - - - - diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/BytePackingXml.cs b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/BytePackingXml.cs deleted file mode 100644 index cb1520e..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/BytePackingXml.cs +++ /dev/null @@ -1,502 +0,0 @@ -// ********************************************************************************************************** -// BytePackingXml.cs -// 5/18/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** -using System; -using System.Collections.Generic; -using System.Xml; -using System.Xml.XPath; - -namespace Raytheon.Instruments.MessagingUtilities -{ - // Takes an XML ICD and adds in nodes to represent the byte packing - // The padding added will be displayed in the tool as arrays of characters - internal class BytePackingXml : XmlDocument - { - private readonly int m_Packing = 8; - private readonly Dictionary m_ConstMap; - private readonly Dictionary m_SizeMap; - private readonly Dictionary m_PadMap; - - public BytePackingXml(string icdStr) : base() - { - // Create the dictionaries - m_ConstMap = new Dictionary(); - m_PadMap = new Dictionary(); - m_SizeMap = new Dictionary(); - - // Create an XML document from the string - LoadXml(icdStr); - - XPathNavigator node = CreateNavigator(); - //Get the type of packing - XPathNodeIterator nodeset = node.Select("/interface/packing"); - if (nodeset.MoveNext() == true) - { - if (!Parse.Try(nodeset.Current.Value.Trim(), out m_Packing)) - { - switch (nodeset.Current.Value.Trim()) - { - case "char": - case "1": - m_Packing = 1; - break; - case "short": - case "2": - m_Packing = 2; - break; - case "long": - case "4": - m_Packing = 4; - break; - case "double": - case "8": - default: - m_Packing = 8; - break; - } - } - } - - // Handle all of the constants - nodeset = node.Select("/interface/constant"); - while (nodeset.MoveNext()) - { - ProcessConstantNode(nodeset.Current); - } - - nodeset = node.Select("/interface/typedef"); - while (nodeset.MoveNext()) - { - ProcessTypedefNode(nodeset.Current); - } - - nodeset = node.Select("/interface/enum"); - while (nodeset.MoveNext()) - { - ProcessEnumerationNode(nodeset.Current); - } - - nodeset = node.Select("/interface/structure|/interface/message"); - while (nodeset.MoveNext()) - { - ProcessStructureNode(nodeset.Current); - } - - NormalizeIcdLabels(); - } - - // This function takes all of the messages in the ICD - // and converts the labels into decimal, so when we do - // a string lookup, they will all be in the same known format - private void NormalizeIcdLabels() - { - XPathNavigator navigator = CreateNavigator(); - XPathNodeIterator nodeset; - - nodeset = navigator.Select("/interface/message/label"); - while (nodeset.MoveNext()) - { - try - { - double dLabel = GetConstFromString(nodeset.Current.Value); - nodeset.Current.SetValue(((int)dLabel).ToString()); - } - catch - { - throw new Exception("Message Label, " + nodeset.Current.Value + ", can not be converted to an integer"); - } - } - } - - private void ProcessConstantNode(XPathNavigator node) - { - string name = ""; - string constStr = ""; - double constNum = 0; - - if (node.MoveToChild("name", "")) - { - name = node.Value.Trim(); - node.MoveToParent(); - } - if (node.MoveToChild("value", "")) - { - constStr = node.Value.Trim(); - if ((constStr.Length != 0) && (constStr[0] != '\"')) - { - constNum = GetConstFromString(constStr); - } - else - { - constNum = 0; - } - node.MoveToParent(); - } - - // Verify the correctnes of the tag - if ((name != "") && (constStr != "")) - { - AddItemToMap(m_ConstMap, name, constNum); - } - else - { - throw new Exception( - "ERROR: Constant Definition Incorrect - :" + name + - " :" + constStr); - } - } - - private void ProcessTypedefNode(XPathNavigator node) - { - string name = ""; - string type = ""; - int typeSize = 0; // Size of the item - int typePad = 0; //Size of the largest item to pad to - - if (node.MoveToChild("name", "")) - { - name = node.Value.Trim(); - node.MoveToParent(); - } - if (node.MoveToChild("value", "")) - { - type = node.Value.Trim(); - GetSizeFromType(type, out typeSize, out typePad); - node.MoveToParent(); - } - - // Verify the correctnes of the tag - if ((name != "") && (type != "")) - { - AddItemToMap(m_PadMap, name, typePad); - AddItemToMap(m_SizeMap, name, typeSize); - } - else - { - throw new Exception( - "ERROR: Typedef Definition Incorrect - :" + name + - " :" + type); - } - } - - private void ProcessEnumerationNode(XPathNavigator node) - { - string name; - double constNum = 0; - var constStr = string.Empty; - - if (node.MoveToChild("name", "")) - { - name = node.Value.Trim(); - AddItemToMap(m_PadMap, name, 4); - AddItemToMap(m_SizeMap, name, 4); - node.MoveToParent(); - } - else - { - throw new Exception("ERROR: Enumeration Definition Incorrect. No tag present."); - } - - XPathNodeIterator nodeSet = node.Select("item|enum_item"); - while (nodeSet.MoveNext()) - { - name = string.Empty; - - if ((nodeSet.Current.MoveToChild("name", "")) || - (nodeSet.Current.MoveToChild("item_name", ""))) - { - name = nodeSet.Current.Value.Trim(); - nodeSet.Current.MoveToParent(); - } - if (nodeSet.Current.MoveToChild("value", "")) - { - constStr = nodeSet.Current.Value.Trim(); - constNum = GetConstFromString(constStr); - nodeSet.Current.MoveToParent(); - } - - // Verify the correctnes of the tag - if ((name != "") && (constStr != "")) - { - AddItemToMap(m_ConstMap, name, constNum); - } - else - { - throw new Exception($"ERROR: Enumeration Item Definition Incorrect - : {name} : {constStr}"); - } - } - } - - private void ProcessStructureNode(XPathNavigator node) - { - string name; - - if (node.MoveToChild("name", "")) - { - name = node.Value.Trim(); - node.MoveToParent(); - } - else - { - throw new Exception("ERROR: Stucture/Message Definition Incorrect. No tag present."); - } - - int maxSize = 0; - int padCount = 0; - uint bitCount = 0; // Used to see how many bits have been processed. - int lastItemSize = 0; - - var nodeSet = node.Select("item|struct_item|msg_item"); - while (nodeSet.MoveNext()) - { - GetItemSize(nodeSet.Current, out int padSize, out int itemSize, out int reps, out uint bits); - if ((lastItemSize != itemSize) || ((bitCount + bits) > (uint)(itemSize * 8))) - { - bitCount = 0; // Size changed or bit rollover - } - - if (bitCount == 0) - { - padCount += AddPadding(node, nodeSet.Current, padSize, padCount); - - // Set maxSize - if (padSize > maxSize) - { - maxSize = padSize; - } - - // Keep up with the pad count - padCount += (itemSize * reps); - } - - lastItemSize = itemSize; - bitCount += bits; - } - - if (maxSize != 0) - { - // Add final padding - padCount += AddPadding(node, null, maxSize, padCount); - } - - AddItemToMap(m_PadMap, name, maxSize); - AddItemToMap(m_SizeMap, name, padCount); - } - - private void GetItemSize(XPathNavigator node, out int padSize, out int itemSize, out int reps, out uint bits) - { - string name = ""; - - if ((node.MoveToChild("name", "")) || - (node.MoveToChild("item_name", ""))) - { - name = node.Value.Trim(); - node.MoveToParent(); - } - - itemSize = -1; - padSize = -1; - reps = 1; - bits = 0; - - var nodeSet = node.Select("type"); - while (nodeSet.MoveNext()) - { - GetSizeFromType(nodeSet.Current.Value.Trim(), out padSize, out itemSize); - } - - nodeSet = node.Select("bits"); - if (nodeSet.MoveNext()) - { - bits = (uint)GetConstFromString(nodeSet.Current.Value.Trim()); - } - - nodeSet = node.Select("arrayLength|imageWidth|imageHeight"); - while (nodeSet.MoveNext()) - { - try - { - reps *= (int)GetConstFromString(nodeSet.Current.Value.Trim()); - } - catch (Exception e) - { - throw new Exception - (e.Message + " item name = \"" + name + "\", tag = <" + - nodeSet.Current.Name + ">."); - - } - } - - if ((itemSize == -1) || (padSize == -1)) - { - throw new Exception - ("ERROR: Item named " + name + "does not contain a tag."); - } - - if (bits == 0) - bits = (uint)padSize * 8; - } - - private double GetConstFromString(string constStr) - { - if ((constStr.Length > 0) && (constStr[0] == '\'')) - { - byte charData = (byte)constStr[1]; - constStr = charData.ToString(); - } - - if (Parse.Try(constStr, out double data) == false) - { - if (Parse.Try(constStr, out int iData) == false) - { - try - { - data = m_ConstMap[constStr]; - } - catch - { - throw new Exception("ERROR: ConstantValue - \"" + constStr + "\" does not resolve to a number."); - } - } - else - { - data = (double)iData; - } - } - return data; - } - - private void AddItemToMap(Dictionary map, string name, int value) - { - if (map.ContainsKey(name)) - { - throw new Exception("ERROR: Element " + name + " is defined multiple times."); - } - else - { - map.Add(name, value); - } - } - - private void AddItemToMap(Dictionary map, string name, double value) - { - if (map.ContainsKey(name)) - { - throw new Exception("ERROR: Element " + name + " is defined multiple times."); - } - else - { - map.Add(name, value); - } - } - - private void GetSizeFromType(string type, out int typePad, out int typeSize) - { - // Remove all whitespace - type = type.Replace(" ", ""); - - if ((type == "char") || (type == "unsignedchar")) - { - typePad = 1; - typeSize = 1; - } - else if ((type == "short") || (type == "unsignedshort")) - { - typePad = 2; - typeSize = 2; - } - else if ((type == "unsigned") || (type == "unsignedint") || - (type == "int") || (type == "float") || - (type == "boolean") || (type == "address")) - { - typePad = 4; - typeSize = 4; - } - else if ((type == "double") || (type == "longlong") || - (type == "unsignedlonglong")) - { - typePad = 8; - typeSize = 8; - } - else // The type is complex and has already been defined - { - try - { - typePad = m_PadMap[type]; - typeSize = m_SizeMap[type]; - } - catch - { - throw new Exception("ERROR: - " + type + " used without being defined."); - } - } - } - - private int AddPadding(XPathNavigator ParentElement, XPathNavigator CurrentElement, int padSize, int padCount) - { - int padAdd = 0; - int padTo = padSize; - - if (m_Packing < padSize) - { - padTo = m_Packing; - } - - if ((padTo != 0) && (padCount % padTo != 0)) - { - padAdd = padTo - (padCount % padTo); - InsertPaddingNode(ParentElement, CurrentElement, padAdd); - } - - return padAdd; - } - - private void InsertPaddingNode(XPathNavigator ParentElement, XPathNavigator CurrentElement, int padAdd) - { - string pad = "" + - "" + Message.PADDING_ITEM_NAME + "" + - "char" + - "" + padAdd + "" + - "S" + - ""; - if (CurrentElement != null) - { - CurrentElement.InsertBefore(pad); - } - else // End padding - { - ParentElement.AppendChild(pad); - } - } - - } -} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/Message.cs b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/Message.cs deleted file mode 100644 index a2a353c..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/Message.cs +++ /dev/null @@ -1,2234 +0,0 @@ -// ********************************************************************************************************** -// Message.cs -// 5/18/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** -// Ignore Spelling: Instru - -using Raytheon.Instruments.coeCSharp; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Xml; -using System.Xml.XPath; - -namespace Raytheon.Instruments.MessagingUtilities -{ - public class Message : IEnumerable, ICloneable - { - public const string PADDING_ITEM_NAME = "****************"; - - public string Name { get { return _name; } set { _name = value; } } - public string InstruLabel => _instruLabel; - - private string _name; - private string _label; - public string Label { get => _label; } - - private string _hexLabel; - - private string _instruLabel; - private string _adapationStoreLabel; - private coeDataInterchange.FormatPacketType _packet = null; - - //private Logger Log; - private NLog.Logger _logger = NLog.LogManager.GetCurrentClassLogger(); - private XPathNavigator Messages; - - public MessageData[] MessageDataArray; - - private int _packing = 8; - private uint _count = 0; - private readonly int _extraFieldCount = 3; - - private ulong _sendSecond = 0; - private uint _sendFracOfSec = 0; - private string _mDomain = "0"; - - private MessageXmlDocument m_Icd = null; - - //Message Maps to support faster creation. - //We only want to parse the XML once. - private Dictionary m_MsgNameMap = null; - private Dictionary m_MsgLabelMap = null; - - // Used to protect the critical section - private static readonly object m_LockObj = new object(); - - // Default values - public static string IntegerDefault = "0"; - public static string FloatDefault = "0.00"; - public static string HexXDefault = "0x0"; - public static string HexBDefault = "0x0"; - public static string BinaryDefault = "0"; - public static string BitFieldDefault = "0"; - public static string StringDefault = ""; - public static string SubimageDefault = "c:\\image.bmp"; - - // Default Logger object - //public static Logger m_DefaultLog = new Logger(); - - private Message() { } - private Message(MessageXmlDocument MessageDatabase) - { - m_Icd = MessageDatabase; - - // Create the static maps if necessary - if ((m_MsgNameMap == null) || (m_MsgLabelMap == null)) - { - m_MsgNameMap = new Dictionary(); - m_MsgLabelMap = new Dictionary(); - } - } - - public Message(string messageName, MessageXmlDocument messageDatabase) - : this(messageName, messageDatabase, null) { } - - public Message(string messageName, MessageXmlDocument messageDatabase, NLog.Logger logger) - { - m_Icd = messageDatabase; - - // Create the static maps if necessary - if ((m_MsgNameMap == null) || (m_MsgLabelMap == null)) - { - m_MsgNameMap = new Dictionary(); - m_MsgLabelMap = new Dictionary(); - } - - if (m_MsgNameMap.ContainsKey(messageName) == true) - { - RetrieveClone((Message)m_MsgNameMap[messageName]); - } - else - { - string messageSpecificationString = messageDatabase.GetMessage(messageName); - if (messageSpecificationString == null) - { - throw new Exception(messageName + " Message not found in the ICD."); - } - else - { - Messages = messageDatabase.CreateNavigator(); - _name = messageName; - - if(logger != null) - _logger = logger; - - ParseMessageString(messageSpecificationString); - _logger.Log(NLog.LogLevel.Info, "Loading Message Data..."); - - Message clone = (Message)Clone(); - if (m_MsgNameMap.ContainsKey(_name) == false) - { - m_MsgNameMap.Add(_name, clone); - } - else - { - throw new Exception("Message <" + _name + "> is defined multiple times in the ICD."); - } - - if (_label != null) - { - if (m_MsgLabelMap.ContainsKey(_label) == false) - { - m_MsgLabelMap.Add(_label, clone); - } - else - { - m_MsgNameMap.Remove(_name); - throw new Exception("Message <" + _name + "> and Message <" + m_MsgLabelMap[_label]._instruLabel + - "> are both defined with Label " + _label + " in the ICD."); - } - } - } - } - } - - /// - /// This constructor populates the Message based on the Message Label - /// instead of the Message Name - /// - /// - /// - public Message(MessageXmlDocument messageDatabase, string messageLabel) - : this(messageDatabase, null, messageLabel) { } - - public Message(MessageXmlDocument messageDatabase, NLog.Logger logger, string messageLabel) - { - m_Icd = messageDatabase; - - // Create the static maps if necessary - if ((m_MsgNameMap == null) || (m_MsgLabelMap == null)) - { - m_MsgNameMap = new Dictionary(); - m_MsgLabelMap = new Dictionary(); - } - - if (m_MsgLabelMap.ContainsKey(messageLabel) == true) - { - RetrieveClone((Message)m_MsgLabelMap[messageLabel]); - } - else - { - var messageSpecificationString = messageDatabase.GetMessageFromLabel(messageLabel); - if (messageSpecificationString == null) - { - throw new Exception("Message with label " + messageLabel + " not found in ICD"); - } - else - { - Messages = messageDatabase.CreateNavigator(); - - if (logger != null) - _logger = logger; - - ParseMessageString(messageSpecificationString); - _logger.Log(NLog.LogLevel.Info, "Loading Message Data..."); - - Message clone = (Message)Clone(); - if (m_MsgNameMap.ContainsKey(_name) == false) - { - m_MsgNameMap.Add(_name, clone); - } - if (m_MsgLabelMap.ContainsKey(_label) == false) - { - m_MsgLabelMap.Add(_label, clone); - } - } - } - } - - public MessageXmlDocument ICD - { - get { return m_Icd; } - } - - public string SendTime - { - get - { - double frac = _sendFracOfSec; - frac /= 0x100000000; - string time = _sendSecond.ToString() + frac.ToString(".00000000000000"); - return time; - } - } - - public ulong SendSecond - { - get { return _sendSecond; } - set { _sendSecond = value; } - } - - public uint SendSecondFraction - { - get { return _sendFracOfSec; } - set { _sendFracOfSec = value; } - } - - public string Domain - { - get { return _mDomain; } - set { _mDomain = value; } - } - - public static void SetDefaults - ( - string integerDefault, string floatDefault, - string hexXDefault, string hexBDefault, - string binaryDefault, string bitFieldDefault, - string stringDefault, string subimageDefault - ) - { - IntegerDefault = integerDefault; - FloatDefault = floatDefault; - HexXDefault = hexXDefault; - HexBDefault = hexBDefault; - BinaryDefault = binaryDefault; - BitFieldDefault = bitFieldDefault; - StringDefault = stringDefault; - SubimageDefault = subimageDefault; - } - - public void Default() - { - SetEnumerationType(EnumerationType.ALL_NODES); - foreach (MessageData data in this) - { - if ((data.isArray != true) && - (data.isArrayOfStructures != true) && - (data.isStructure != true)) - { - if ((data.FieldDefaultValue != null) && (data.FieldDefaultValue.Trim() != "")) - { - data.FieldValue = data.FieldDefaultValue; - } - else if ((data.FieldMinValue != null) && (data.FieldMinValue.Trim() != "")) - { - data.FieldValue = data.FieldMinValue; - } - else if ((data.FieldMaxValue != null) && (data.FieldMaxValue.Trim() != "")) - { - data.FieldValue = data.FieldMaxValue; - } - else - { - // Get the defaults from the Injection - // pane of the options window - if (data.FieldInstruType == "I") - data.FieldValue = IntegerDefault; - else if (data.FieldInstruType == "F") - data.FieldValue = FloatDefault; - else if (data.FieldInstruType == "X") - data.FieldValue = HexXDefault; - else if (data.FieldInstruType == "B") - data.FieldValue = HexBDefault; - else if (data.FieldInstruType == "N") - data.FieldValue = BinaryDefault; - else if (data.FieldInstruType == "T") - data.FieldValue = BitFieldDefault; - else if (data.FieldInstruType == "S") - data.FieldValue = StringDefault; - else if (data.FieldInstruType == "P") - data.FieldValue = SubimageDefault; - else - data.FieldValue = ""; - } - } - } - } - - public coeDataInterchange.FormatPacketType GetInstruPacket() - { - if (_packet == null) - { - int count = 0; - uint length = 1; - char instru_type; - uint size; - uint ctr = 0; - MessageData lastData = null; - coeDataInterchange.FormatType lastInstru = null; - - coeDataInterchange.FormatType[] format = new coeDataInterchange.FormatType[GetCountForDataInterchange()]; - SetEnumerationType(Message.EnumerationType.FIELDS | - Message.EnumerationType.EXPAND_ARRAYS | - Message.EnumerationType.EXPAND_STRUCTURES); - - foreach (MessageData data in this) - { - if (ctr++ < _extraFieldCount) // Skip $msg_domain, $msg_label and $msg_send_time - continue; - - // When handling bit fields, we do not know if we want to move to the - // next byte (Index) until we examine the next element. - // - // ex. unsigned x:4; unsigned y:8; Both x and y operate on the same - // byte, but we don't know the same byte is being operated on until - // we see the declaration of y. - // - // Therefore, we are going to increase the index by staying one declaration - // ahead of the Index increase. If this declaration is operating on a new - // byte, then add the size of the previous byte. The last declaration - // will then be added on the end to get the appropriate size. - if (lastData != null) - { - if (IncreaseIndex(data)) - { - length = 1; - size = GetTypeSize(lastData.FieldType, lastData.isEnum); - instru_type = lastData.FieldInstruType[0]; - if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) - { - // Strings are handled individually - length = (uint)lastData.arrayLength; - } - if (lastData.FieldInstruType == "P") - { - size = lastData.imagePixelSize; - length = lastData.imageHeight * lastData.imageWidth; - instru_type = 'X'; - } - - format[count] = - new coeDataInterchange.FormatType(lastData.FieldName, - length, - size, - instru_type); - - if (lastData.bitMask != 0) - { - if (lastInstru != null) - { - format[count].m_Repetition = 0; - format[count].m_FormatLength = GetNumBitsInMask(lastData.bitMask); - format[count].m_Format = 't'; - lastInstru.m_Repetition++; - lastInstru = null; - } - else - { - format[count].m_Repetition = 1; - format[count].m_Format = 'T'; - - format[count + 1] = - new coeDataInterchange.FormatType(lastData.FieldName, - 0, - GetNumBitsInMask(lastData.bitMask), - 't'); - count++; - } - } - - count++; - } - else - { - if (lastInstru == null) - { - format[count] = - new coeDataInterchange.FormatType(lastData.FieldName, - 0, - GetTypeSize(lastData.FieldType, lastData.isEnum), - 'T'); - lastInstru = format[count]; - count++; - } - - format[count] = - new coeDataInterchange.FormatType(lastData.FieldName, - 0, - GetNumBitsInMask(lastData.bitMask), - 't'); - lastInstru.m_Repetition++; - count++; - } - } - lastData = data; - } - - if (lastData != null) // The message has 1 or more elements - { - // Add the last element to the size - length = 1; - size = GetTypeSize(lastData.FieldType, lastData.isEnum); - instru_type = lastData.FieldInstruType[0]; - if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) - { - // Strings are handled individually - length = (uint)lastData.arrayLength; - } - if (lastData.FieldInstruType == "P") - { - size = lastData.imagePixelSize; - length = lastData.imageHeight * lastData.imageWidth; - instru_type = 'X'; - } - - if (lastData.bitMask == 0) - { - format[count] = - new coeDataInterchange.FormatType(lastData.FieldName, - length, - size, - instru_type); - } - else // (lastData.bitMask != 0) - { - if (lastInstru == null) - { - format[count] = - new coeDataInterchange.FormatType(lastData.FieldName, - 0, - size, - 'T'); - lastInstru = format[count]; - count++; - } - - format[count] = - new coeDataInterchange.FormatType(lastData.FieldName, - 0, - GetNumBitsInMask(lastData.bitMask), - 't'); - lastInstru.m_Repetition++; - } - _packet = new coeDataInterchange.FormatPacketType(_name, GetMessageSize(), (uint)format.Length, format); - } - else // There are no items in the message - { - _packet = new coeDataInterchange.FormatPacketType(_name, GetMessageSize(), 0, new coeDataInterchange.FormatType[0]); - } - } - - // FOR DEBUG PURPOSES -#if false - Debug.WriteLine(""); - Debug.WriteLine("-------------------------------------------------------------------------"); - Debug.WriteLine("Message Name = " + Packet.m_Name); - Debug.WriteLine(""); - foreach (DataInterchange.FormatType f in Packet.m_Format) - Debug.WriteLine("\"" + f.m_FieldName + - "\", " + f.m_Repetition + - ", " + f.m_FormatLength + - ", \'" + f.m_Format + - "\'"); - Debug.WriteLine("-------------------------------------------------------------------------"); -#endif - - return _packet; - } - - private uint GetNumBitsInMask(ulong mask) - { - uint count = 0; - ulong bit = 1; - for (int i = 0; i < sizeof(ulong) * 8; i++) - { - if ((bit & mask) != 0) - { - count++; - } - - bit <<= 1; - } - - return count; - } - - private void ParseMessageString(string messageSpecificationString) - { - lock (m_LockObj) - { - var messageSpecification = new XmlDocument(); - int index = 0; - - messageSpecification.LoadXml(messageSpecificationString); - var item = messageSpecification.CreateNavigator(); - - //Get the type of packing - var nodeset = item.Select("/packing"); - if (nodeset.MoveNext() == true) - { - if (!Parse.Try(nodeset.Current.Value.Trim(), out _packing)) - { - switch (nodeset.Current.Value.Trim()) - { - case "char": - _packing = 1; - break; - case "short": - _packing = 2; - break; - case "long": - _packing = 4; - break; - case "double": - default: - _packing = 8; - break; - } - } - } - - // Three extra fields will be added to the top of every - // Message in CMIT, $msg_domain, $msg_label, $msg_send_time - nodeset = item.Select("/message/item|/message/msg_item"); - MessageDataArray = new MessageData[nodeset.Count + _extraFieldCount]; - //MessageData.m_BitCounter = 0; // Reset the bit counter for each new message - - item.MoveToChild("message", ""); - if (item.MoveToChild("name", "")) - { - _name = item.Value.Trim(); - item.MoveToParent(); - } - if (item.MoveToChild("label", "")) - { - // Convert the label from whatever format it is in to decimal. - uint msgLabel = 0; - - _label = NormalizeValue(item.Value.Trim()); - - if (Parse.Try(_label, out int temp) == false) - { - throw new Exception("Message Label for " + _name + " could not be evaluated to an integer"); - } - - if (temp < 0) - { - byte[] array = BitConverter.GetBytes(temp); - msgLabel = BitConverter.ToUInt32(array, 0); - } - else - msgLabel = Convert.ToUInt32(temp); - - _label = msgLabel.ToString(); - _hexLabel = msgLabel.ToString("X"); - - item.MoveToParent(); - } - if (item.MoveToChild("instruLabel", "")) - { - _instruLabel = item.Value.Trim(); - item.MoveToParent(); - } - if (item.MoveToChild("adaptationSaveLabel", "")) - { - _adapationStoreLabel = item.Value.Trim(); - item.MoveToParent(); - } - - MessageDataArray[index] = new MessageData("$msg_domain", - "unsigned int", Domain, Domain, m_Icd); - MessageDataArray[index++].FieldInstruType = "X"; - MessageDataArray[index] = new MessageData("$msg_label", - "unsigned int", _label, _label, m_Icd); - MessageDataArray[index++].FieldInstruType = "X"; - MessageDataArray[index] = new MessageData("$msg_send_time", - "double", null, null, m_Icd); - MessageDataArray[index++].FieldInstruType = "F"; - - while (nodeset.MoveNext()) - { - AddToMessageData(nodeset.Current.Clone(), "", MessageDataArray, index++, 0); - } - } - } - - private void ParseMessageString(string messageSpecificationString, - string messageSelectionString, - string namePrefix, - MessageData parentField) - { - var messageSpecification = new XmlDocument(); - int index = 0; - - messageSpecification.LoadXml(messageSpecificationString); - XPathNavigator item = messageSpecification.CreateNavigator(); - - XPathNodeIterator nodeset = item.Select(messageSelectionString); - parentField.SetStructureSize(nodeset.Count); - - while (nodeset.MoveNext()) - { - AddToMessageData(nodeset.Current.Clone(), namePrefix, parentField.MessageArray, index++, parentField.depth + 1); - } - } - - private void AddToMessageData(XPathNavigator item, - string namePrefix, - MessageData[] dataArray, - int arrayIndex, - int depth) - { - - string fieldName = null; - string fieldType = null; - string fieldDefaultValue = null; - XPathNavigator structureDefinition; - bool isEnum = false; - - int arrayLength; - LinkedList length = new LinkedList(); - // - // Extract the name, type, default value, and array length values - // for the field - // - - if (item.MoveToChild("name", "")) - { - fieldName = item.Value.Trim(); - item.MoveToParent(); - } - if (item.MoveToChild("item_name", "")) - { - fieldName = item.Value.Trim(); - item.MoveToParent(); - } - if (item.MoveToChild("type", "")) - { - fieldType = NormalizeType(item.Value, ref isEnum); - item.MoveToParent(); - } - if (item.MoveToChild("default", "")) - { - fieldDefaultValue = NormalizeValue(item.Value); - item.MoveToParent(); - } - else if (item.MoveToChild("minRange", "")) - { - fieldDefaultValue = NormalizeValue(item.Value); - item.MoveToParent(); - } - - // - // Check to see if this field is a structure by locating the structure - // definition. - // - - structureDefinition = Messages.SelectSingleNode("/interface/structure[name='" + fieldType + "']|/interface/message[name='" + fieldType + "']"); - - // - // Create the MessageData object for this field and put it in the array. - // Set max and min range values if they exist. - // - - dataArray[arrayIndex] = new MessageData(namePrefix + fieldName, - fieldType, null, fieldDefaultValue, m_Icd); - //If Type is an enum sent the isEnum field to true - if (isEnum) - { - dataArray[arrayIndex].isEnum = true; - } - - XPathNodeIterator nodeSet = item.Select("arrayLength"); - while (nodeSet.MoveNext()) - { - arrayLength = 0; - Parse.Try(NormalizeValue(nodeSet.Current.Value), out arrayLength); - if (arrayLength != 0) - { - length.AddFirst(arrayLength); - } - } - - if (item.MoveToChild("imageWidth", "")) - { - Parse.Try(NormalizeValue(item.Value), out uint width); - if (width != 0) - { - dataArray[arrayIndex].imageWidth = width; - } - item.MoveToParent(); - } - if (item.MoveToChild("imageHeight", "")) - { - Parse.Try(NormalizeValue(item.Value), out uint height); - if (height != 0) - { - dataArray[arrayIndex].imageHeight = height; - } - item.MoveToParent(); - } - if (item.MoveToChild("imagePixelSize", "")) - { - Parse.Try(NormalizeValue(item.Value), out uint pixelSize); - if (pixelSize != 0) - { - dataArray[arrayIndex].imagePixelSize = pixelSize; - } - item.MoveToParent(); - } - if (item.MoveToChild("maxRange", "")) - { - dataArray[arrayIndex].SetMaxValue(item.Value.Trim()); - item.MoveToParent(); - } - if (item.MoveToChild("minRange", "")) - { - dataArray[arrayIndex].SetMinValue(item.Value.Trim()); - item.MoveToParent(); - } - - if (item.MoveToChild("bits", "")) - { - Parse.Try(NormalizeValue(item.Value), out int bits); - dataArray[arrayIndex].SetBitValue(bits); - item.MoveToParent(); - } - else - { - dataArray[arrayIndex].SetBitValue(0); - } - - if (item.MoveToChild("instruType", "")) - { - dataArray[arrayIndex].SetInstruType(item.Value.Trim()); - if ((dataArray[arrayIndex].FieldInstruType == "S") && (dataArray[arrayIndex].FieldType == "unsigned char")) - { - // In CMIT, all strings are of type char. If the user defines a string of unsigned chars, we - // can still handle them if type is changed to char. - dataArray[arrayIndex].FieldType = "char"; - } - else if ((dataArray[arrayIndex].FieldInstruType == "S") && (dataArray[arrayIndex].FieldType != "char")) - { - // If the type is not char, the CMIT will not handle strings. We will change the instruType - // to X, so these fields are handled properly. - dataArray[arrayIndex].FieldInstruType = "X"; - } - item.MoveToParent(); - } - - // Initialize the image buffer if this is a subimage item - if ((dataArray[arrayIndex].imageWidth != 0) && (dataArray[arrayIndex].imageHeight != 0)) - { - dataArray[arrayIndex].imageBufferSize = - dataArray[arrayIndex].imageWidth * - dataArray[arrayIndex].imageHeight * - GetTypeSize(dataArray[arrayIndex].FieldType, dataArray[arrayIndex].isEnum); - dataArray[arrayIndex].imageBuffer = new byte[dataArray[arrayIndex].imageBufferSize]; - dataArray[arrayIndex].SetInstruType("P"); - dataArray[arrayIndex].SetPixelSize(); - } - else if (dataArray[arrayIndex].FieldInstruType == "P") - { - // If no imageWidth and imageHeight are defined, then - // this item can not have an instruType of "P" - dataArray[arrayIndex].FieldInstruType = "X"; - } - - dataArray[arrayIndex].depth = depth; - // - // If the field is a singleton, we're done. Other combinations - // could be an array, a structure, or an array of structures. - // - - if (length.Count > 0) - { - ParseArray(structureDefinition, - dataArray[arrayIndex], - length); - } - else if (structureDefinition != null) - { - ParseMessageString(structureDefinition.OuterXml, "/structure/item|/message/item|/structure/struct_item|/message/msg_item", dataArray[arrayIndex].FieldName + ".", - dataArray[arrayIndex]); - } - } - - private void ParseArray - ( - XPathNavigator StructureDefinition, - MessageData DataArray, - LinkedList ArrayLength - ) - { - int length = ArrayLength.Last.Value; - ArrayLength.RemoveLast(); - if (length > 0) - { - // If the array type is an enumeration type, need to make it an integer - XPathNavigator navigator = m_Icd.CreateNavigator(); - XPathNavigator position; - try - { - position = navigator.SelectSingleNode("/interface/enum[name='" + DataArray.FieldType + "']"); - if (position != null) - { - DataArray.FieldType = "unsigned int"; - } - } - catch (Exception e) - { - System.Diagnostics.Debug.WriteLine(e.Message); - } - - DataArray.SetArraySize(length); - - if (ArrayLength.Count != 0) - { - for (int index = 0; index < length; index++) - { - ParseArray(StructureDefinition, - DataArray.MessageArray[index], - ArrayLength); - } - } - else - { - if (StructureDefinition != null) - { - ParseMessageString(StructureDefinition.OuterXml, "/structure/item|/message/item|/structure/struct_item|/message/msg_item", - DataArray.MessageArray[0].FieldName + ".", - DataArray.MessageArray[0]); - for (int index = 1; index < length; index++) - { - DataArray.MessageArray[index].isStructure = true; - - DataArray.MessageArray[index].MessageArray = CloneMessageData(DataArray.MessageArray[0].MessageArray); - CorrectClonedArrayIndex(DataArray.MessageArray[index].MessageArray, - DataArray.MessageArray[0].FieldName.Trim(), - DataArray.MessageArray[index].FieldName.Trim()); - } - DataArray.isArrayOfStructures = true; - } - } - } - - ArrayLength.AddFirst(length); - } - - private void CorrectClonedArrayIndex(MessageData[] array, - string old_str, - string new_str) - { - foreach (MessageData data in array) - { - // We want to replace the index in the name of the structure. The "begin" substring - // ensures we only replace the first instance of the string - string begin = data.FieldName.Substring(0, new_str.Length); - begin = begin.Replace(old_str, new_str); - - data.FieldName = begin + data.FieldName.Substring(new_str.Length); - if (data.MessageArray != null) - { - CorrectClonedArrayIndex(data.MessageArray, old_str, new_str); - } - } - } - - internal string NormalizeValue(string value) - { - XPathNavigator messagesItem; - bool iterating; - - value = value.Trim(); - do - { - iterating = false; - if ((value.Length > 0) && (value[0] != '\"') && (value[0] != '\'')) - { - messagesItem = Messages.SelectSingleNode("/interface/constant[name='" + value + "']|/interface/enum/item[name='" + value + "']"); - if (messagesItem == null) - { - messagesItem = Messages.SelectSingleNode("/interface/constant[name='" + value + "']|/interface/enum/enum_item[name='" + value + "']"); - } - if (messagesItem != null) - { - messagesItem.MoveToChild("value", ""); - value = messagesItem.InnerXml; - iterating = true; - } - } - } while (iterating); - - return value; - } - - private string NormalizeType(string value, ref bool isEnum) - { - XPathNavigator MessagesItem; - bool iterating; - - do - { - iterating = false; - MessagesItem = Messages.SelectSingleNode("/interface/typedef[name='" + NormalizeValue(value) + "']"); - if (MessagesItem != null) - { - MessagesItem.MoveToChild("value", ""); - value = MessagesItem.InnerXml; - iterating = true; - } - //Check if Value is an enumeration - MessagesItem = Messages.SelectSingleNode("/interface/enum[name='" + NormalizeValue(value) + "']"); - if (MessagesItem != null) - { - isEnum = true; - } - } while (iterating); - - return value; - } - - public void Reset() - { - SetEnumerationType(EnumerationType.EXPANDED_FIELDS); - foreach (MessageData data in this) - { - data.FieldValue = null; - data.usesRegister = false; - } - } - - public MessageData Set(string field, string value) - { - MessageData LocatedDataItem = null; - - SetEnumerationType(EnumerationType.ALL_NODES); - foreach (MessageData data in this) - { - if (string.Compare(field, data.FieldName) == 0) - { - if (data.isArrayOfStructures) - { - ; // Do nothing in this case - } - if (data.isArray || data.isStructure) - { - data.FieldValue = value; - if (value.StartsWith("$")) - { - data.usesRegister = true; - } - foreach (MessageData ArrayData in data.MessageArray) - { - if (!ArrayData.isArray && !ArrayData.isArrayOfStructures && !ArrayData.isStructure) - { - ArrayData.FieldArrayValue = value; - if (value.StartsWith("$")) - { - ArrayData.usesRegister = true; - } - } - } - } - else - { - data.FieldValue = value; - if (value.StartsWith("$")) - { - data.usesRegister = true; - } - LocatedDataItem = data; - } - break; - } - } - return LocatedDataItem; - } - - public MessageData GetItemFromMsg(string name) - { - // Add each message item to the tree - SetEnumerationType(EnumerationType.ALL_NODES); - foreach (MessageData Data in this) - { - // Find the Item that has been selected in current Message - if (Data.FieldName == name) - { - return Data; - } - } - - return null; - } - - /// - /// logs message with all the fields - /// - /// - /// - public void SendToLog(EnumerationType enumerationType = EnumerationType.EXPANDED_FIELDS, MessageDirection direction = MessageDirection.File) - { - string directionSign = direction == MessageDirection.File ? "_" : direction == MessageDirection.In ? "<<<" : ">>>"; - _logger.Log(NLog.LogLevel.Info, $"{directionSign} Message Name: {_name}; Label: {_label} (0x{_hexLabel})"); - SetEnumerationType(enumerationType); - foreach (MessageData data in this) - { - string displayFieldValue; - if(data.FieldName == "$msg_label") - { - displayFieldValue = $"{data.FieldValue} (0x{_hexLabel})"; - } - else - { - displayFieldValue = data.FieldValue ?? $"{data.FieldDefaultValue} (D)"; - } - var spacer = new string(Enumerable.Repeat(' ', data.depth * 4).ToArray()); - _logger.Log(NLog.LogLevel.Info, $"{spacer}{data.FieldName} ({data.FieldType}) = {displayFieldValue}"); - } - } - - // helps with visual identification in the log of incoming vs outgoing - public enum MessageDirection - { - File, - In, - Out - } - - // This class supplies an enumerator that is capable of iterating over the fields in the - // message with a variety of options. The SetEnumerationType method sets how the enumerator - // will iterate over the fields. The enumeration values can be added to derive various - // combinations of iterations. The values are as follows: - // FIELDS Only non array and structure fields - // ARRAY_NODES The message_data nodes that have isArray set - // STRUCTURE_NODES The message_data nodes that have isStructure set - // ARRAY_PRIMITIVE_NODES Nodes with isArray set that are not arrays of structures - // EXPAND_ARRAYS The array fields linked onto an array node - // EXPAND_STRUCTURES The structure fields linked onto a structure node - // TOP_NODES Top level Fields and array/structure nodes - // EXPANDED_FIELDS All fields, structures and arrays expanded - // ALL_NODES All nodes (the sum of all the above) - // - - public enum EnumerationType - { - FIELDS = 0x01, - ARRAY_NODES = 0x02, - STRUCTURE_NODES = 0x04, - ARRAY_PRIMITIVE_NODES = 0x08, - EXPAND_ARRAYS = 0x10, - EXPAND_STRUCTURES = 0x20, - TOP_NODES = 0x07, - EXPANDED_FIELDS = 0x31, - ALL_NODES = 0xFF - }; - private EnumerationType EnumType = EnumerationType.TOP_NODES; - - public void SetEnumerationType(EnumerationType type) - { - EnumType = type; - } - - public IEnumerator GetEnumerator() - { - return new MessageEnumerator(MessageDataArray, EnumType); - } - - private class MessageEnumerator : IEnumerator - { - - private int CurrentIndex; - private bool doExpandArray; - private readonly EnumerationType enumType = EnumerationType.TOP_NODES; - private readonly MessageData[] RootMessageArray; - private MessageData[] CurrentMessageArray; - private readonly Stack indexStack = new Stack(); - private readonly Stack messageStack = new Stack(); - - private MessageEnumerator() - { - Reset(); - } - - public MessageEnumerator(MessageData[] Root, EnumerationType Type) - { - RootMessageArray = Root; - enumType = Type; - Reset(); - } - - public void Reset() - { - CurrentIndex = -1; - CurrentMessageArray = RootMessageArray; - doExpandArray = false; - indexStack.Clear(); - messageStack.Clear(); - } - - public bool MoveNext() - { - bool Scanning = true; - bool Status = true; - - while (Scanning) - { - CurrentIndex++; - // - // If need to start expanding an array (array or structure), do so - // - if (doExpandArray) - { - doExpandArray = false; - indexStack.Push(CurrentIndex); - messageStack.Push(CurrentMessageArray); - CurrentMessageArray = CurrentMessageArray[CurrentIndex - 1].MessageArray; - CurrentIndex = -1; - } - // - // Else see if this node needs to be returned - // - else - { - // - // If at the end of an array, pop the stacks - // - while (CurrentIndex >= CurrentMessageArray.Length) - { - if (indexStack.Count == 0) - { - return false; // End of iteration - } - else - { - CurrentIndex = indexStack.Pop(); - CurrentMessageArray = messageStack.Pop(); - } - } - if (CurrentMessageArray[CurrentIndex].isStructure) - { - if ((enumType & EnumerationType.STRUCTURE_NODES) != 0) - { - Scanning = false; - } - if ((enumType & EnumerationType.EXPAND_STRUCTURES) != 0) - { - doExpandArray = true; - } - } - else if (CurrentMessageArray[CurrentIndex].isArray) - { - if ((enumType & EnumerationType.ARRAY_NODES) != 0) - { - Scanning = false; - } - if ((enumType & EnumerationType.ARRAY_PRIMITIVE_NODES) != 0) - { - if (!CurrentMessageArray[CurrentIndex].isArrayOfStructures) - { - Scanning = false; - } - } - if ((enumType & EnumerationType.EXPAND_ARRAYS) != 0) - { - doExpandArray = true; - } - } - else - { - if ((enumType & EnumerationType.FIELDS) != 0) - { - Scanning = false; - } - } - } - } - return Status; - } - - public object Current - { - get - { - return CurrentMessageArray[CurrentIndex]; - } - } - - } - - enum TypeSize - { - INT = 4, - UINT = 4, - CHAR = 1, - SHORT = 2, - USHORT = 2, - UNSIGNED_CHAR = 1, - BOOL = 1, - DOUBLE = 8, - LONGLONG = 8, - FLOAT = 4, - ENUM = 4 - } - - public void MsgDataToBuffer(ref byte[] DataBuffer, out uint MessageSize) - { - int Index = 0; - uint pictureSize; - int Offset = 0; - MessageData lastData = null; - byte[] ByteArray; - int ctr = 0; - - // Data buffer was just passed from a fresh "new byte[]" so all values are guaranteed to - // be 0 at the beginning. - // - // For each element in data element in the message, the string representation of - // the data will be passed to the BitFieldGeneric class with its bit mask to - // be converted into a binary value. The BitFieldGeneric value will then be - // Bitwise ORed to buffer, allowing bit fields to be handled properly. This - // ORed value will then be converted into a byte array and placed in the data - // buffer for transfer. - - SetEnumerationType(EnumerationType.FIELDS | - EnumerationType.EXPAND_ARRAYS | - EnumerationType.EXPAND_STRUCTURES); - - foreach (MessageData data in this) - { - //Handle $msg_domain, $msg_label and $msg_send_time appropriately - if (ctr == 0) // handle $msg_domain - { - Domain = data.FieldValue; - ctr++; - continue; - } - else if (ctr == 1) // handle $msg_label - { - // Do we want the user to be able to change the label on the fly - //Label = data.FieldValue; - ctr++; - continue; - } - else if (ctr == 2) // handle $msg_send_time - { - ctr++; - continue; - } - - - // Padding may have FieldValue set to null, change it to "" - if (data.FieldValue == null) - data.FieldValue = ""; - - // This increases the index into the buffer. See GetMessageSize() - // for a detailed explanation of the algorithm - if (lastData != null) - { - if (IncreaseIndex(data)) - { - if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) - { - // Strings are handled individually - Index += (int)TypeSize.CHAR * lastData.arrayLength; - } - else if (lastData.FieldInstruType == "P") - { - pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); - pictureSize *= lastData.imageWidth * lastData.imageHeight; - Index += (int)pictureSize; - } - else - { - Index += (int)GetTypeSize(lastData.FieldType, lastData.isEnum); - } - } - } - lastData = data; - - // Process each message element based on its type - if ((data.FieldInstruType == "P") && (data.imageBuffer != null)) - { - data.imageBuffer.CopyTo(DataBuffer, Index); - } - else - { - switch (data.FieldType) - { - case "int": - BitFieldGeneric iParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); - iParsedValue.BitOR(BitConverter.ToInt32(DataBuffer, Index)); - ByteArray = BitConverter.GetBytes(iParsedValue.ToInt()); - ByteArray.CopyTo(DataBuffer, Index); - break; - - case "char": - decimal ParsedValue; - if (data.FieldInstruType == "S") - { - // If this is a string, copy the entire string - for (int i = 0; i < data.arrayLength; i++) - { - if (i < data.FieldValue.Length) - { - DataBuffer[Index + i] = (byte)data.FieldValue[i]; - } - else - { - DataBuffer[Index + i] = 0; - } - } - } - else // This is not a string - { - if (Parse.Try(data.FieldValue, out ParsedValue)) - { - BitFieldGeneric sbParsedValue = new BitFieldGeneric - (data.FieldValue, data.bitMask); - sbParsedValue.BitOR((sbyte)DataBuffer[Index]); - DataBuffer[Index] = (byte)sbParsedValue.ToSByte(); - } - else if ((data.FieldValue != null) && (data.FieldValue.Length > 0)) - { - DataBuffer[Index] = (byte)data.FieldValue[0]; - } - else - { - DataBuffer[Index] = 0; - } - } - break; - case "short": - BitFieldGeneric sParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); - sParsedValue.BitOR(BitConverter.ToInt16(DataBuffer, Index)); - ByteArray = BitConverter.GetBytes(sParsedValue.ToShort()); - ByteArray.CopyTo(DataBuffer, Index); - break; - case "unsigned char": - case "unsignedchar": - if (Parse.Try(data.FieldValue, out ParsedValue)) - { - BitFieldGeneric sbParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); - sbParsedValue.BitOR(DataBuffer[Index]); - DataBuffer[Index] = (byte)sbParsedValue.ToSByte(); - } - else if ((data.FieldValue != null) && (data.FieldValue.Length > 0)) - { - DataBuffer[Index] = (byte)data.FieldValue[0]; - } - else - { - DataBuffer[Index] = 0; - } - break; - case "unsigned short": - case "unsignedshort": - BitFieldGeneric usParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); - usParsedValue.BitOR(BitConverter.ToUInt16(DataBuffer, Index)); - ByteArray = BitConverter.GetBytes(usParsedValue.ToUShort()); - ByteArray.CopyTo(DataBuffer, Index); - break; - case "unsigned int": - case "unsignedint": - case "unsigned": - case "boolean": - case "address": - BitFieldGeneric uiParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); - uiParsedValue.BitOR(BitConverter.ToUInt32(DataBuffer, Index)); - ByteArray = BitConverter.GetBytes(uiParsedValue.ToUInt()); - ByteArray.CopyTo(DataBuffer, Index + Offset); - break; - case "float": - float FlParsedValue; - if (!Parse.Try(string.IsNullOrEmpty(data.FieldValue) ? "0" : data.FieldValue, out FlParsedValue)) - { - throw new Exception($"Unable to parse value = {data.FieldValue} "); - } - ByteArray = BitConverter.GetBytes(FlParsedValue); - ByteArray.CopyTo(DataBuffer, Index); - break; - case "double": - double DbParsedValue; - if (!Parse.Try(string.IsNullOrEmpty(data.FieldValue) ? "0" : data.FieldValue, out DbParsedValue)) - { - throw new Exception($"Unable to parse value = {data.FieldValue} "); - } - ByteArray = BitConverter.GetBytes(DbParsedValue); - ByteArray.CopyTo(DataBuffer, Index); - break; - case "long long": - case "longlong": - BitFieldGeneric llParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); - llParsedValue.BitOR(BitConverter.ToInt64(DataBuffer, Index)); - ByteArray = BitConverter.GetBytes(llParsedValue.ToLong()); - ByteArray.CopyTo(DataBuffer, Index); - break; - case "unsigned long long": - case "unsignedlonglong": - BitFieldGeneric ullParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); - ullParsedValue.BitOR(BitConverter.ToUInt64(DataBuffer, Index)); - ByteArray = BitConverter.GetBytes(ullParsedValue.ToULong()); - ByteArray.CopyTo(DataBuffer, Index); - break; - default: - if (data.isEnum) - { - data.FieldValue = GetEnumerationValue(data.FieldValue, data.FieldType); - BitFieldGeneric eParsedValue = new BitFieldGeneric(data.FieldValue, data.bitMask); - eParsedValue.BitOR(BitConverter.ToUInt32(DataBuffer, Index)); - ByteArray = BitConverter.GetBytes(eParsedValue.ToUInt()); - ByteArray.CopyTo(DataBuffer, Index); - } - break; - } - } - } - - if (lastData != null) // Ensure the message has items - { - // Add the last element to the size - if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) - { - // Strings are handled individually - Index += (int)TypeSize.CHAR * lastData.arrayLength; - } - else if (lastData.FieldInstruType == "P") - { - pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); - pictureSize *= lastData.imageWidth * lastData.imageHeight; - Index += (int)pictureSize; - } - else - { - Index += (int)GetTypeSize(lastData.FieldType, lastData.isEnum); - } - } - - MessageSize = (uint)Index; - } - - private string GetEnumerationValue(string Value, string Type) - { - uint value; // enum value - string returnValue = ""; - - if (Parse.Try(Value, out value) == false) - { - Dictionary enums = m_Icd.GetEnumerations(Type); - foreach (KeyValuePair pair in enums) - { - if (Value == pair.Key) - { - returnValue = pair.Value; - break; - } - } - } - else - { - returnValue = value.ToString(); - } - - if (returnValue == "") - { - throw new Exception("Unable to parse value = " + Value + ". No valid enumeration exists."); - } - - return returnValue; - } - - public bool BufferToMsgData(byte[] DataBuffer) - { - int index = 0; - MessageData lastData = null; - int ctr = 0; - - SetEnumerationType(EnumerationType.FIELDS | - EnumerationType.EXPAND_ARRAYS | - EnumerationType.EXPAND_STRUCTURES); - foreach (MessageData data in this) - { - if (ctr == 0) // handle $msg_domain - { - data.FieldValue = Domain; - ctr++; - continue; - } - else if (ctr == 1) // handle $msg_label - { - data.FieldValue = _label; - ctr++; - continue; - } - else if (ctr == 2) // handle $msg_send_time - { - data.FieldValue = SendTime; - ctr++; - continue; - } - - // This increases the index into the buffer. See GetMessageSize() - // for a detailed explanation of the algorithm - if (lastData != null) - { - if (IncreaseIndex(data)) - { - if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) - { - // Strings are handled individually - index += (int)TypeSize.CHAR * lastData.arrayLength; - } - else if (lastData.FieldInstruType == "P") - { - uint pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); - pictureSize *= lastData.imageWidth * lastData.imageHeight; - index += (int)pictureSize; - } - else - { - index += (int)GetTypeSize(lastData.FieldType, lastData.isEnum); - } - } - } - lastData = data; - - // Process each message element based on its type - if ((data.FieldInstruType == "P") && (data.imageBuffer != null)) - { - for (int i = 0; i < data.imageBuffer.Length; i++) - { - data.imageBuffer[i] = DataBuffer[index + i]; - } - data.FieldValue = "--- Subimage --- "; - } - else - { - switch (data.FieldType) - { - case "int": - BitFieldGeneric IValue = new BitFieldGeneric - (BitConverter.ToInt32(DataBuffer, index), data.bitMask); - IValue.ToSigned(); - data.FieldValue = IValue.ToString(); - break; - case "char": - if (data.FieldInstruType == "S") - { - // Handle string - data.FieldValue = ""; - for (int i = 0; i < data.arrayLength; i++) - { - if (DataBuffer[index + i] == 0) break; - data.FieldValue += (char)DataBuffer[index + i]; - } - } - else - { - BitFieldGeneric CValue = new BitFieldGeneric - ((sbyte)DataBuffer[index], data.bitMask); - CValue.ToSigned(); - data.FieldValue = CValue.ToString(); - } - break; - case "short": - BitFieldGeneric SValue = new BitFieldGeneric - (BitConverter.ToInt16(DataBuffer, index), data.bitMask); - SValue.ToSigned(); - data.FieldValue = SValue.ToString(); - break; - case "unsigned char": - case "unsignedchar": - BitFieldGeneric SBValue = new BitFieldGeneric - (DataBuffer[index], data.bitMask); - data.FieldValue = SBValue.ToString(); /*ACB*/ - //data.FieldValue = DataBuffer[Index].ToString(); - break; - case "unsigned short": - case "unsignedshort": - BitFieldGeneric USValue = new BitFieldGeneric - (BitConverter.ToUInt16(DataBuffer, index), data.bitMask); - data.FieldValue = USValue.ToString(); - break; - case "unsigned int": - case "unsignedint": - case "unsigned": - case "address": - case "boolean": - BitFieldGeneric UIValue = new BitFieldGeneric - (BitConverter.ToUInt32(DataBuffer, index), data.bitMask); - data.FieldValue = UIValue.ToString(); - break; - case "float": - float FValue = BitConverter.ToSingle(DataBuffer, index); - data.FieldValue = FValue.ToString(); - break; - case "double": - double DValue = BitConverter.ToDouble(DataBuffer, index); - data.FieldValue = DValue.ToString(); - break; - case "long long": - case "longlong": - BitFieldGeneric LLValue = new BitFieldGeneric - (BitConverter.ToInt64(DataBuffer, index), data.bitMask); - LLValue.ToSigned(); - data.FieldValue = LLValue.ToString(); - break; - case "unsigned long long": - case "unsignedlonglong": - BitFieldGeneric ULLValue = new BitFieldGeneric - (BitConverter.ToUInt64(DataBuffer, index), data.bitMask); - data.FieldValue = ULLValue.ToString(); - break; - default: - if (data.isEnum) - { - BitFieldGeneric EnumValue = new BitFieldGeneric - (BitConverter.ToUInt32(DataBuffer, index), data.bitMask); - data.FieldValue = EnumValue.ToString(); - } - break; - } - } - } - - return true; - } - - internal uint GetCountForDataInterchange() - { - uint ctr = 0; - if (_count == 0) - { - MessageData lastData = null; - - SetEnumerationType(Message.EnumerationType.FIELDS | - Message.EnumerationType.EXPAND_ARRAYS | - Message.EnumerationType.EXPAND_STRUCTURES); - - foreach (MessageData data in this) - { - if (ctr++ < _extraFieldCount) // Skip $msg_domain, $msg_label and $msg_send_time - continue; - - // When handling bit fields, we do not know if we want to move to the - // next byte (Index) until we examine the next element. - // - // ex. unsigned x:4; unsigned y:8; Both x and y operate on the same - // byte, but we don't know the same byte is being operated on until - // we see the declaration of y. - // - // Therefore, we are going to increase the index by staying one declaration - // ahead of the Index increase. If this declaration is operating on a new - // byte, then add the size of the previous byte. The last declaration - // will then be added on the end to get the appropriate size. - if (lastData != null) - { - if (IncreaseIndex(data)) - { - _count++; - if (lastData.bitMask != 0) - { - _count++; - } - } - else - { - _count++; - } - } - lastData = data; - } - - // Add the last element to the size - _count++; - if (lastData.bitMask != 0) - { - _count++; - } - } - - return (uint)_count; - } - - public uint GetMessageSize() - { - uint Index = 0; - uint pictureSize; - MessageData lastData = null; - uint ctr = 0; - - SetEnumerationType(Message.EnumerationType.FIELDS | - Message.EnumerationType.EXPAND_ARRAYS | - Message.EnumerationType.EXPAND_STRUCTURES); - - foreach (MessageData data in this) - { - - if (ctr++ < _extraFieldCount) // Skip $msg_domain, $msg_label and $msg_send_time - continue; - // When handling bit fields, we do not know if we want to move to the - // next byte (Index) until we examine the next element. - // - // ex. unsigned x:4; unsigned y:8; Both x and y operate on the same - // byte, but we don't know the same byte is being operated on until - // we see the declaration of y. - // - // Therefore, we are going to increase the index by staying one declaration - // ahead of the Index increase. If this declaration is operating on a new - // byte, then add the size of the previous byte. The last declaration - // will then be added on the end to get the appropriate size. - if (lastData != null) - { - if (IncreaseIndex(data)) - { - if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) - { - // Strings are handled individually - Index += (uint)TypeSize.CHAR * (uint)lastData.arrayLength; - } - else if (lastData.FieldInstruType == "P") - { - pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); - pictureSize *= lastData.imageWidth * lastData.imageHeight; - Index += pictureSize; - } - else - { - Index += GetTypeSize(lastData.FieldType, lastData.isEnum); - } - } - } - lastData = data; - } - - if (lastData != null) // Ensure there are items in the message - { - // Add the last element to the size - if ((lastData.FieldType == "char") && (lastData.FieldInstruType == "S")) - { - // Strings are handled individually - Index += (uint)TypeSize.CHAR * (uint)lastData.arrayLength; - } - else if (lastData.FieldInstruType == "P") - { - pictureSize = GetTypeSize(lastData.FieldType, lastData.isEnum); - pictureSize *= lastData.imageWidth * lastData.imageHeight; - Index += pictureSize; - } - else - { - Index += GetTypeSize(lastData.FieldType, lastData.isEnum); - } - } - - return (uint)Index; - } - - private bool IncreaseIndex(MessageData Data) - { - if ((Data.bitMask == 0) || ((Data.bitMask & 1) == 1)) - { - return true; - } - else - { - return false; - } - } - - static internal uint GetTypeSize(string Type, bool IsEnum) - { - uint size = 4; - - switch (Type) - { - case "char": - case "unsigned char": - case "unsignedchar": - size = (uint)TypeSize.CHAR; - break; - - case "short": - case "unsigned short": - case "unsignedshort": - size = (uint)TypeSize.SHORT; - break; - - case "int": - case "unsigned int": - case "unsignedint": - case "unsigned": - case "address": - case "boolean": - case "float": - size = (uint)TypeSize.INT; - break; - - case "double": - case "long long": - case "longlong": - case "unsigned long long": - case "unsignedlonglong": - size = (uint)TypeSize.LONGLONG; - break; - - default: - if (IsEnum == true) - size = (uint)TypeSize.ENUM; - //else - //throw new Exception("Invalid Type"); - break; - } - - return size; - } - - // - // This function validates that the FieldValue is of the correct type and - // is within the Max and Min values. If all the data is valid this - // function returns true. If the data is invalid the function returns - // false and the inValid MessageData elements will have there isValid - // field set to false. - // - public bool ValidateMsgData() - { - bool DataValid = true; - SetEnumerationType(Message.EnumerationType.FIELDS | - Message.EnumerationType.EXPAND_ARRAYS | - Message.EnumerationType.EXPAND_STRUCTURES); - - foreach (MessageData data in this) - { - data.isValid = true; - switch (data.FieldType) - { - case "int": - int IntParsedValue; - int IMaxValue, IMinValue; - if (!Parse.Try(data.FieldValue, out IntParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out IMinValue) && - Parse.Try(data.FieldMaxValue, out IMaxValue)) - { - if (IntParsedValue < IMinValue || IntParsedValue > IMaxValue) - { - DataValid = false; - data.isValid = false; - } - } - break; - - case "char": - char ChParsedValue; - byte ByteParsedValue; - //If the value can be parsed as a byte assume it is a byte, if not try as char - if (Parse.Try(data.FieldValue, out ByteParsedValue)) - { - //TODO: Validate against Min and Max here - } - else - { - if (Parse.Try(data.FieldValue, out ChParsedValue)) - { - //TODO: Validate against Min and Max here - } - else - { - if (data.FieldValue != null) - { - DataValid = false; - data.isValid = false; - } - } - } - break; - case "short": - short ShParsedValue; - short ShMaxValue, ShMinValue; - if (!Parse.Try(data.FieldValue, out ShParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out ShMinValue) && - Parse.Try(data.FieldMaxValue, out ShMaxValue)) - { - if (ShParsedValue < ShMinValue || ShParsedValue > ShMaxValue) - { - DataValid = false; - data.isValid = false; - } - } - break; - case "unsigned char": - case "unsignedchar": - byte UchParsedValue; - byte UchMaxValue, UchMinValue; - if (!Parse.Try(data.FieldValue, out UchParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out UchMinValue) && - Parse.Try(data.FieldMaxValue, out UchMaxValue)) - { - if (UchParsedValue < UchMinValue || UchParsedValue > UchMaxValue) - { - DataValid = false; - data.isValid = false; - } - } - break; - case "unsigned short": - case "unsignedshort": - ushort UshParsedValue; - ushort UshMaxValue, UshMinValue; - if (!Parse.Try(data.FieldValue, out UshParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out UshMinValue) && - Parse.Try(data.FieldMaxValue, out UshMaxValue)) - { - if (UshParsedValue < UshMinValue || UshParsedValue > UshMaxValue) - { - DataValid = false; - data.isValid = false; - } - } - break; - case "unsigned int": - case "unsignedint": - case "unsigned": - uint UiParsedValue; - uint UiMaxValue, UiMinValue; - if (!Parse.Try(data.FieldValue, out UiParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out UiMinValue) && - Parse.Try(data.FieldMaxValue, out UiMaxValue)) - { - if (UiParsedValue < UiMinValue || UiParsedValue > UiMaxValue) - { - DataValid = false; - data.isValid = false; - } - } - break; - case "float": - float FlParsedValue; - float FlMaxValue, FlMinValue; - if (!Parse.Try(data.FieldValue, out FlParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out FlMinValue) && - Parse.Try(data.FieldMaxValue, out FlMaxValue)) - { - if (FlParsedValue < FlMinValue || FlParsedValue > FlMaxValue) - { - DataValid = false; - data.isValid = false; - } - } - break; - case "double": - double DbParsedValue; - double DbMaxValue, DbMinValue; - if (!Parse.Try(data.FieldValue, out DbParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out DbMinValue) && - Parse.Try(data.FieldMaxValue, out DbMaxValue)) - { - if (DbParsedValue < DbMinValue || DbParsedValue > DbMaxValue) - { - DataValid = false; - data.isValid = false; - } - } - break; - case "long long": - case "longlong": - long LlParsedValue; - long LlMaxValue, LlMinValue; - if (!Parse.Try(data.FieldValue, out LlParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out LlMinValue) && - Parse.Try(data.FieldMaxValue, out LlMaxValue)) - { - if (LlParsedValue < LlMinValue || LlParsedValue > LlMaxValue) - { - DataValid = false; - data.isValid = false; - } - } - break; - case "unsigned long long": - case "unsignedlonglong": - ulong ULlParsedValue; - ulong ULlMaxValue, ULlMinValue; - if (!Parse.Try(data.FieldValue, out ULlParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out ULlMinValue) && - Parse.Try(data.FieldMaxValue, out ULlMaxValue)) - { - if (ULlParsedValue < ULlMinValue || ULlParsedValue > ULlMaxValue) - { - DataValid = false; - data.isValid = false; - } - } - break; - case "boolean": - uint BParsedValue; - if (!Parse.Try(data.FieldValue, out BParsedValue)) - { - DataValid = false; - data.isValid = false; - break; - } - if (Parse.Try(data.FieldMinValue, out UiMinValue) && - Parse.Try(data.FieldMaxValue, out UiMaxValue)) - { - if (BParsedValue < 0 || BParsedValue > 1) - { - DataValid = false; - data.isValid = false; - } - } - break; - case "address": - - break; - default: - //This fn will not validate enumerations - if (!data.isEnum) - { - //Data is invalid because it is of an unknown type - DataValid = false; - data.isValid = false; - } - break; - } - } - return DataValid; - } - - public bool CompareFieldValues(Message Msg) - { - Msg.SetEnumerationType(EnumerationType.EXPANDED_FIELDS); - foreach (MessageData Data in Msg) - { - - foreach (MessageData ThisData in this) - { - if (ThisData.FieldName == Data.FieldName) - { - if (ThisData.FieldValue != Data.FieldValue) - return false; - break; - } - } - } - //If this function has not returned at this point than the Value fields are equal - return true; - } - - #region Serialization/Deserialization for COE send - public byte[] serialize() - { - uint MsgSize = GetMessageSize(); - uint MsgSizeOut = 0; - byte[] buffer = new byte[MsgSize]; - - //Write MessageData to OE Message Buffer - MsgDataToBuffer(ref buffer, out MsgSizeOut); - if (MsgSize != MsgSizeOut) - { - buffer = null; // error - throw new Exception("Message " + _name + ": serialization failed"); - } - return buffer; - } - - public bool deserialize(byte[] stream) - { - return BufferToMsgData(stream); - } - #endregion - - #region ICloneable Members - - public void RetrieveClone(Message clone) - { - _name = clone._name; - _label = clone._label; - Domain = clone.Domain; - _instruLabel = clone._instruLabel; - _packet = clone._packet; - _adapationStoreLabel = clone._adapationStoreLabel; - - //Log = clone.Log; - Messages = clone.Messages; - _packing = clone._packing; - _count = clone._count; - m_Icd = clone.m_Icd; - - if (clone.MessageDataArray == null) - { - MessageDataArray = null; - } - else - { - MessageDataArray = new MessageData[clone.MessageDataArray.Length]; - for (int i = 0; i < clone.MessageDataArray.Length; i++) - { - MessageDataArray[i] = (MessageData)clone.MessageDataArray[i].Clone(); - } - } - } - - /// - /// - /// - /// - public object Clone() - { - Message clone = new Message - { - _name = _name, - _label = _label, - Domain = Domain, - _instruLabel = _instruLabel, - _adapationStoreLabel = _adapationStoreLabel, - _packet = _packet, - /*clone.Log = Log;*/ - Messages = Messages, - _packing = _packing, - _count = _count, - m_Icd = m_Icd, - MessageDataArray = CloneMessageData(MessageDataArray) - }; - return clone; - } - - /// - /// - /// - /// - /// - private MessageData[] CloneMessageData(MessageData[] orig) - { - MessageData[] clone = null; - if (orig != null) - { - clone = new MessageData[orig.Length]; - for (int i = 0; i < orig.Length; i++) - { - clone[i] = (MessageData)orig[i].Clone(); - } - } - - return clone; - } - - #endregion - } -} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/MessageData.cs b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/MessageData.cs deleted file mode 100644 index c294ec5..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/MessageData.cs +++ /dev/null @@ -1,600 +0,0 @@ -// ********************************************************************************************************** -// MessageData.cs -// 5/18/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** -using System; -using System.Collections.Generic; -using System.IO; - -using Raytheon.Instruments.coeCSharp; - -namespace Raytheon.Instruments.MessagingUtilities -{ - public class MessageData : ICloneable - { - public string FieldName; - public string FieldType; - public string FieldValue; - public string FieldArrayValue; - public string FieldDefaultValue; - public string FieldMaxValue; - public string FieldMinValue; - public string FieldBitValue; - public string FieldInstruType; - public string Variable; - public string MaxOffset; - public string MinOffset; - public string VerifyType; - public bool isSelected; - public bool isArray; - public bool isStructure; - public bool isArrayOfStructures; - public bool isEnum; - public bool usesRegister; - public bool isValid; - public bool useRange; - public int arrayLength; - public uint imageWidth; - public uint imageHeight; - public uint imagePixelSize; - public ulong bitMask; - public bool expanded; - public int depth; - public byte[] imageBuffer; - public uint imageBufferSize; - public MessageData[] MessageArray; - - public delegate coe.Status ReadImageDelegate - ( - string filename, - uint columns, - uint rows, - uint pixel_size, - byte[] buffer - ); - - private MessageXmlDocument m_Icd; - - internal int m_BitCounter = 0; // used to calculate the bit mask - - internal static Dictionary m_ReadFunctions = null; - private MessageData() { } - private MessageData(MessageXmlDocument Icd) - { - FieldName = null; - FieldType = null; - FieldValue = null; - FieldArrayValue = null; - FieldDefaultValue = null; - FieldMaxValue = null; - FieldMinValue = null; - FieldBitValue = null; - Variable = null; - MaxOffset = null; - MinOffset = null; - VerifyType = null; - isSelected = false; - isArray = false; - isStructure = false; - isArrayOfStructures = false; - usesRegister = false; - useRange = false; - arrayLength = 0; - imageWidth = 0; - imageHeight = 0; - imagePixelSize = 0; - bitMask = 0; - expanded = false; - depth = 0; - imageBufferSize = 0; - imageBuffer = null; - - m_Icd = Icd; - } - - public MessageData(string fieldname, - string fieldtype, - string fieldvalue, - string fielddefaultvalue, - MessageXmlDocument Icd) : - this(Icd) - { - FieldName = fieldname; - FieldType = fieldtype; - FieldValue = fieldvalue; - - SetInstruType(null); - SetDefaultValue(fielddefaultvalue); - - } - - public MessageData(string fieldname, - string fieldtype, - string fieldvalue, - string fielddefaultvalue, - string fieldmaxvalue, - string fieldminvalue, - MessageXmlDocument Icd) : - this(fieldname, fieldtype, fieldvalue, fielddefaultvalue, Icd) - { - SetMaxValue(fieldmaxvalue); - SetMinValue(fieldminvalue); - } - - public string FormattedValue - { - get { return FormatValue(FieldValue); } - } - public string FormattedMinValue - { - get { return FormatValue(FieldMinValue); } - } - public string FormattedMaxValue - { - get { return FormatValue(FieldMaxValue); } - } - - public static string ImageFileReadTypes - { - get - { - string fileTypes = ""; - if (m_ReadFunctions == null) return null; - foreach (string type in m_ReadFunctions.Keys) - { - if (fileTypes != "") - fileTypes += "|"; - - fileTypes += type.ToUpper() + " files (*." + type.ToLower() + ")|*." + type.ToLower(); - } - - return fileTypes; - } - } - - public void AddReadExtension(string extension, ReadImageDelegate readFunc) - { - if (m_ReadFunctions == null) - m_ReadFunctions = new Dictionary(); - - if (m_ReadFunctions.ContainsKey(extension)) - m_ReadFunctions[extension] = readFunc; - else - m_ReadFunctions.Add(extension, readFunc); - } - - public void UpdateImage() - { - if (FieldInstruType == "P") - { - if (File.Exists(FieldValue)) - { - string extension = FieldValue.Substring(FieldValue.LastIndexOf(".") + 1); - m_ReadFunctions[extension](FieldValue, - imageWidth, - imageHeight, - imagePixelSize, - imageBuffer); - } - else - { - // TODO add error message - //MessageBox.Show("Unable to open file " + FieldValue + - // " to populate " + FieldName, - // "File Read Error", - // MessageBoxButtons.OK, - // MessageBoxIcon.Error); - FieldValue = ""; - for (int i = 0; i < imageBuffer.Length; i++) - { - imageBuffer[i] = 0; - } - } - } - } - - - public void SetDefaultValue(string fieldDefaultValue) - { - // Initialize uninitialized value - if (fieldDefaultValue == null) - { - fieldDefaultValue = ""; - } - - if ((FieldType == "char") && (fieldDefaultValue.Contains("\""))) - { - FieldInstruType = "S"; - } - - FieldDefaultValue = RemoveCharFromString(fieldDefaultValue, '\"'); - } - - public void SetMaxValue(string fieldmaxvalue) - { - if (fieldmaxvalue == null) return; /* Bad argument */ - - if ((FieldType == "char") && (fieldmaxvalue.Contains("\""))) - { - FieldInstruType = "S"; - } - - FieldMaxValue = RemoveCharFromString(fieldmaxvalue, '\"'); - } - - public void SetMinValue(string fieldminvalue) - { - if (fieldminvalue == null) return; /* Bad argument */ - - if ((FieldType == "char") && (fieldminvalue.Contains("\""))) - { - FieldInstruType = "S"; - } - - FieldMinValue = RemoveCharFromString(fieldminvalue, '\"'); - } - - public void SetBitValue(int bits) - { - int size = (int)Message.GetTypeSize(FieldType, isEnum); - - // Determine the bitMask - if (bits == 0) - { - m_BitCounter = 0; - FieldBitValue = null; - } - else - { - FieldBitValue = bits.ToString(); - - // If bits overflow across the type boundary, then - // they start at the next boundary. - // - // MSDN : - // "Note that nYear is 8 bits long and would overflow - // the word boundary of the declared type, unsigned short. - // Therefore, it is begun at the beginning of a - // new unsigned short." - if (m_BitCounter + bits > size * 8) - { - m_BitCounter = 0; - } - - // 2^bits-1 will give a bit mask with bit# of 1's - // ex: bits = 5, bitMask = 11111 - bitMask = (ulong)Math.Pow(2, (double)bits) - 1; - - // We must slide the bitMask left to put it in place - bitMask <<= m_BitCounter; - m_BitCounter += bits; - - // If we have used all the bits in the type that was defined, then - // restart the counter - if (m_BitCounter == size * 8) - m_BitCounter = 0; - } - - if (bitMask == 0xffffff) - { - bitMask = 0; - } - } - - public void SetArraySize(int size) - { - char result; - - arrayLength = size; // Save the size - - if (!isArray && !isStructure) - { - // Don't handle strings as arrays - if ((FieldInstruType != "S") && (FieldInstruType != "P")) - { - isArray = true; - - MessageArray = new MessageData[size]; - // If the field type is char or unsigned char and the default value - // exists and is a string then write one char of the string to - // each element of the array - if ((FieldType == "char" || FieldType == "unsigned char") && - FieldDefaultValue != null && - !Parse.Try(FieldDefaultValue, out result)) - { - for (uint index = 0; index < size; index++) - { - //Only the elements that are required to spell out the string should - //receive default values. - if (index < FieldDefaultValue.Length) - { - MessageArray[index] = new MessageData(FieldName + "[" + index + "]", - FieldType, FieldValue, FieldDefaultValue[(int)index].ToString(), - FieldMaxValue, FieldMinValue, m_Icd); - MessageArray[index].FieldInstruType = FieldInstruType; - } - else - { - MessageArray[index] = new MessageData(FieldName + "[" + index + "]", - FieldType, FieldValue, "0", - FieldMaxValue, FieldMinValue, m_Icd); - MessageArray[index].FieldInstruType = FieldInstruType; - } - MessageArray[index].depth = depth + 1; - } - } - else - { - for (uint index = 0; index < size; index++) - { - MessageArray[index] = new MessageData(FieldName + "[" + index + "]", - FieldType, FieldValue, FieldDefaultValue, FieldMaxValue, - FieldMinValue, m_Icd); - MessageArray[index].FieldInstruType = FieldInstruType; - MessageArray[index].depth = depth + 1; - } - } - - } - } - } - - public void SetStructureSize(int size) - { - if (!isArray && !isStructure) - { - isStructure = true; - MessageArray = new MessageData[size]; - for (uint index = 0; index < size; index++) - { - MessageArray[index] = new MessageData(FieldName + ".", null, null, null, m_Icd); - } - } - } - - internal void SetInstruType(string Type) - { - if (Type != null) - { - FieldInstruType = Type; - - // Ensure 'S' is used properly - if ((Type == "S") && (FieldType != "char")) - { - return; /* << EXIT >> */ - } - } - else - { - if ((FieldType != null) && - ((FieldType.Trim() == "float") || (FieldType.Trim() == "double"))) - { - FieldInstruType = "F"; - } - else - { - FieldInstruType = "I"; - } - } - } - - internal void SetPixelSize() - { - // Only do this if the user did not define a size - if (imagePixelSize == 0) - { - switch (FieldType) - { - case "char": - case "unsigned char": - case "unsignedchar": - imagePixelSize = 1; - break; - - case "short": - case "unsigned short": - case "unsignedshort": - imagePixelSize = 2; - break; - - case "int": - case "unsigned int": - case "unsignedint": - case "unsigned": - case "boolean": - case "address": - case "float": - imagePixelSize = 4; - break; - - case "double": - case "long long": - case "longlong": - case "unsigned long long": - case "unsignedlonglong": - imagePixelSize = 8; - break; - - default: - if (isEnum) - { - imagePixelSize = 4; - } - else // Error case - { - imagePixelSize = 1; - } - break; - } - } - } - - - private string FormatValue(string Value) - { - if ((Value == null) || (Value == "")) - { - return ""; - } - else // Value exists - { - if (isEnum == false) - { - if (FieldInstruType == "I") - { - // This is being represented as a decimal - if (Parse.Try(Value, out long dec) == true) - { - return dec.ToString(); - } - } - else if (FieldInstruType == "F") - { - // This is being represented as floating point - if (Parse.Try(Value, out double flt) == true) - { - return flt.ToString(); - } - } - else if ((FieldInstruType == "X") || - (FieldInstruType == "B") || - (FieldInstruType == "T")) - { - // This is being represented as a hexadecimal value - if (Parse.Try(Value, out long hex) == true) - { - return "0x" + hex.ToString("X"); - } - } - else if (FieldInstruType == "N") - { - // This is being represented as a binary number - if (Parse.Try(Value, out long bin) == true) - { - return Convert.ToString(bin, 2) + "b"; - } - } - // else InstruType == 'S' or 'P' or anything else return the value - } - else // This value is an enumeration - { - Dictionary enums = m_Icd.GetEnumerations(FieldType); - if (enums.ContainsValue(Value) == true) - { - foreach (KeyValuePair pair in enums) - { - if (pair.Value.Trim() == Value.Trim()) - { - return pair.Key; - } - } - } - } - } - - return Value; // If nothing above applies, simply return the value string - } - - private String RemoveCharFromString(String str, char c) - { - if (str == null) return null; // Handle null case - - int index = str.IndexOf(c); - while (index != -1) - { - str = str.Remove(index, 1); - index = str.IndexOf(c); - } - - return str; - } - - #region ICloneable Members - - public object Clone() - { - MessageData clone = new MessageData(); - - clone.FieldName = FieldName; - clone.FieldType = FieldType; - clone.FieldValue = FieldValue; - clone.FieldArrayValue = FieldArrayValue; - clone.FieldDefaultValue = FieldDefaultValue; - clone.FieldMaxValue = FieldMaxValue; - clone.FieldMinValue = FieldMinValue; - clone.FieldBitValue = FieldBitValue; - clone.FieldInstruType = FieldInstruType; - clone.Variable = Variable; - clone.MaxOffset = MaxOffset; - clone.MinOffset = MinOffset; - clone.VerifyType = VerifyType; - clone.isSelected = isSelected; - clone.isArray = isArray; - clone.isStructure = isStructure; - clone.isArrayOfStructures = isArrayOfStructures; - clone.isEnum = isEnum; - clone.usesRegister = usesRegister; - clone.isValid = isValid; - clone.useRange = useRange; - clone.arrayLength = arrayLength; - clone.bitMask = bitMask; - clone.expanded = expanded; - clone.depth = depth; - clone.m_Icd = m_Icd; - clone.imageWidth = imageWidth; - clone.imageHeight = imageHeight; - clone.imagePixelSize = imagePixelSize; - clone.imageBufferSize = imageBufferSize; - if (imageBufferSize > 0) - { - clone.imageBuffer = new byte[imageBufferSize]; - imageBuffer.CopyTo(clone.imageBuffer, 0); - } - - if (MessageArray == null) - { - clone.MessageArray = null; - } - else - { - clone.MessageArray = new MessageData[MessageArray.Length]; - for (int i = 0; i < MessageArray.Length; i++) - { - clone.MessageArray[i] = (MessageData)MessageArray[i].Clone(); - } - } - - return clone; - } - - #endregion - } -} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/MessageXmlDocument.cs b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/MessageXmlDocument.cs deleted file mode 100644 index d2395a2..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/MessagingUtilities/MessageXmlDocument.cs +++ /dev/null @@ -1,426 +0,0 @@ -// ********************************************************************************************************** -// MessageXmlDocument.cs -// 5/18/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.Xml.XPath; - -using System.Diagnostics; -using System.Threading; -using NLog; - -namespace Raytheon.Instruments.MessagingUtilities -{ - public class MessageXmlDocument : XmlDocument - { - private readonly ILogger _logger; - private readonly string _XmlFileName; - private string BuiltXML = ""; - - private uint m_MaxMsgSize = 0; - private readonly List m_IncludeList; - - private MessageXmlDocument() : base() - { - } - - public MessageXmlDocument(string Pathname, - ILogger logger) : - base() - { - _logger = logger; - _XmlFileName = Pathname; - - m_IncludeList = new List(); - RecurseProcessing(Pathname); - - BuiltXML = string.Concat(BuiltXML, ""); - BytePackingXml addPacking = new BytePackingXml(BuiltXML); - LoadXml(addPacking.OuterXml); - } - - public Dictionary GetEnumerations(string Type) - { - Dictionary enumList = new Dictionary(); - - // Get XML nodes to parse the XML ICD document - XPathNavigator Node = CreateNavigator(); - XPathNodeIterator Nodeset = Node.Select("interface/enum/name"); - - while (Nodeset.MoveNext()) - { - // Find the enumeration with the name of the type - if (Nodeset.Current.Value.Trim().Equals(Type.Trim())) - { - // Find all the enumeration items - XPathNavigator enumNode = Nodeset.Current.Clone(); - while (enumNode.MoveToNext()) - { - if (enumNode.Name.Trim().Equals("item") || - enumNode.Name.Trim().Equals("enum_item")) - { - string name = null; - string value = null; - - // Find all name nodes - XPathNavigator childNode = enumNode.Clone(); - childNode.MoveToFirstChild(); - do - { - if (childNode.Name.Trim().Equals("name")) - { - name = childNode.Value.Trim(); - } - else if (childNode.Name.Trim().Equals("item_name")) - { - name = childNode.Value.Trim(); - } - - if (childNode.Name.Trim().Equals("value")) - { - value = childNode.Value.Trim(); - } - - // Once we find the name & value, add it to the list - if ((name != null) && (value != null)) - { - enumList.Add(name, value); - break; - } - } while (childNode.MoveToNext()); - } - } - - break; // We found the enumeration we wanted - } - } - - return enumList; - } - - private void RecurseProcessing(string pathName) - { - string directory; - string IncludePathname; - XPathNodeIterator nodeset; - - // Only process each file once - pathName = pathName.Replace('/', '\\'); - if (m_IncludeList.Contains(pathName)) - { - return; // This file has already been processed - } - else - { - m_IncludeList.Add(pathName); - } - - _logger.Log(LogLevel.Info, $"Loading File: {pathName}"); - XPathDocument document = new XPathDocument(pathName); - XPathNavigator navigator = document.CreateNavigator(); - - // Verify this is a COE XML ICD - nodeset = navigator.Select("/interface"); - if (nodeset.Count == 0) - { - // This is not an XML ICD - throw new Exception($"Invalid COE XML Format. Unable to process {pathName}" + - "\nEnsure this is a properly formatted ICD."); - } - - nodeset = navigator.Select("/interface/include/file"); - while (nodeset.MoveNext()) - { - try - { - directory = DirectoryOf(pathName); - } - catch - { - directory = ".\\"; - } - - IncludePathname = nodeset.Current.Value.Trim(); - if ((!IncludePathname.StartsWith("\\")) && (!IncludePathname.Contains(":"))) - { - while (IncludePathname.StartsWith(".")) - { - if ((IncludePathname.StartsWith("..\\")) || (IncludePathname.StartsWith("../"))) - { - directory = DirectoryOf(directory); - IncludePathname = IncludePathname.Remove(0, 3); - } - else if ((IncludePathname.StartsWith(".\\")) || (IncludePathname.StartsWith("./"))) - { - IncludePathname = IncludePathname.Remove(0, 2); - } - } - IncludePathname = string.Concat(directory, "\\", IncludePathname); - } - RecurseProcessing(IncludePathname); - } - - nodeset = navigator.Select("/interface/packing|/interface/typedef|/interface/constant|interface/enum|/interface/structure|/interface/message"); - while (nodeset.MoveNext()) - { - string item = nodeset.Current.OuterXml; - int index; - while ((index = item.IndexOf("")) != -1) - { - item = item.Remove(index, item.IndexOf("") + 14 - index); - } - while ((index = item.IndexOf("") + 3 - index); - } - while (item.IndexOf("> ") != -1) - { - item = item.Replace("> ", ">"); - } - while (item.IndexOf(" <") != -1) - { - item = item.Replace(" <", "<"); - } - //_logger.Log(LogLevel.Trace, $"Loading Node :\n{item}"); - Thread.Sleep(1); - BuiltXML = string.Concat(BuiltXML, item); - } - } - - private string DirectoryOf(string Pathname) - { - return Pathname.Remove(Pathname.LastIndexOf("\\")); - } - - // - // From the XML document, the definition of a single message can be identified - // from the Message Name and returned as an XML string. - // - public string XmlFileName - { - get - { - return _XmlFileName; - } - } - - public string GetMessage(string messageName) - { - string message; - - messageName = messageName.Trim(); - _logger.Log(LogLevel.Info, $"Searching for message : {messageName}"); - try - { - message = SelectSingleNode($"/interface/message[name='{messageName}']").OuterXml; - message = TranslateValue(message); - _logger.Log(LogLevel.Trace, $"Found by name: {message}"); - } - catch - { - message = null; - _logger.Log(LogLevel.Error, "Message not found"); - } - return message; - } - - // - // From the XML document, the definition of a single message can be identified - // from the Message Label and returned as an XML string. - // - public string GetMessageFromLabel(string messageLabel) - { - string message; - string msgLabel = ""; - - if (Parse.Try(messageLabel, out int label) == true) - { - msgLabel = label.ToString(); - } - - _logger.Log(LogLevel.Info, $"Searching for message: {msgLabel}"); - try - { - // Search by message label - message = SelectSingleNode($"/interface/message[label='{msgLabel}']").OuterXml; - message = TranslateValue(message); - _logger.Log(LogLevel.Trace, $"Found by label: {message}"); - } - catch - { - try - { - // Search by instruLabel - message = SelectSingleNode($"/interface/message[instruLabel='{messageLabel}']").OuterXml; - message = TranslateValue(message); - _logger.Log(LogLevel.Trace, $"Found by instrument Label: {message}"); - } - catch - { - message = null; - _logger.Log(LogLevel.Error, "Message not found"); - } - } - return message; - } - - // - // From the XML document, the definition of a single message can be identified - // from the Message InstruLabel and returned as an XML string. - // - public string GetMessageFromInstruLabel(string messageInstruLabel) - { - string message; - - messageInstruLabel = messageInstruLabel.Trim(); - _logger.Log(LogLevel.Info, $"Searching for message: {messageInstruLabel}"); - try - { - message = SelectSingleNode($"/interface/message[instruLabel='{messageInstruLabel}']").OuterXml; - message = TranslateValue(message); - _logger.Log(LogLevel.Trace, $"Found by instrument label: {message}"); - } - catch - { - message = null; - _logger.Log(LogLevel.Error, "Message not found"); - } - return message; - } - - public uint GetLargestMessageSize() - { - lock (this) - { - // return the max message size if we have already calculated it - if (m_MaxMsgSize != 0) - { - return m_MaxMsgSize; - } - else - { - DateTime t1 = DateTime.Now; - - XPathNavigator navigator = CreateNavigator(); - XPathNodeIterator nodeset = navigator.Select("/interface/message/name"); - - while (nodeset.MoveNext()) - { - Message msg = new Message(nodeset.Current.Value.Trim(), this); - uint msgSize = msg.GetMessageSize(); - if (msgSize > m_MaxMsgSize) - { - m_MaxMsgSize = msgSize; - } - } - - DateTime t2 = DateTime.Now; - TimeSpan duration = t2 - t1; - Debug.WriteLine("Max Msg Size Algorithm Time = " + duration); - } - } - - return m_MaxMsgSize; - } - - public uint GetMessageSize(string MsgName) - { - uint msg_size = 0; - - lock (this) - { - XPathNavigator navigator = CreateNavigator(); - XPathNodeIterator nodeset = navigator.Select("/interface/message/name"); - - while (nodeset.MoveNext()) - { - if (MsgName == nodeset.Current.Value.Trim()) - { - Message msg = new Message(nodeset.Current.Value.Trim(), this); - msg_size = msg.GetMessageSize(); - } - } - } - - return msg_size; - } - - // - // Since the XML message definitions contain the definitions of all the enumerations and constants, - // this object is the only one containing the knowledge to interpret strings using enumerations and/or - // constants. This method will substitute enumerations and constants with their respective base values - // in a specified string. - // - public string TranslateValue(string Value) - { - XPathNavigator navigator = CreateNavigator(); - XPathNavigator position; - string NewValue = Value; - - // - // Substitute enumeration - // - try - { - position = navigator.SelectSingleNode("/interface/enum/item[name='" + NewValue + "']"); - if (position == null) - { - position = navigator.SelectSingleNode("/interface/enum/item[item_name='" + NewValue + "']"); - } - if (position != null) - { - position.MoveToChild("value", ""); - NewValue = position.Value; - } - - // - // Substitute constants - // - position = navigator.SelectSingleNode("/interface/constant[name='" + NewValue + "']"); - if (position != null) - { - NewValue = position.Value; - _logger.Log(LogLevel.Info, "Translating field value : " + Value + " -> " + NewValue); - } - } - catch (Exception e) - { - _logger.Error(e.Message); - } - - return NewValue; - } - - } -} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.05.00.00/x86/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.05.00.00/x86/coeWindows-shared.dll deleted file mode 100644 index a09a534..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.05.00.00/x86/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.00.00/x86/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.00.00/x86/coeWindows-shared.dll deleted file mode 100644 index ee8bdc1..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.00.00/x86/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.02.00/x64/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.02.00/x64/coeWindows-shared.dll deleted file mode 100644 index ef788ac..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.02.00/x64/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.02.00/x86/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.02.00/x86/coeWindows-shared.dll deleted file mode 100644 index 61c2271..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.02.00/x86/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.03.00/x64/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.03.00/x64/coeWindows-shared.dll deleted file mode 100644 index 909cbaf..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.03.00/x64/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.03.00/x86/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.03.00/x86/coeWindows-shared.dll deleted file mode 100644 index 727dae8..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.03.00/x86/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.00/x64/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.00/x64/coeWindows-shared.dll deleted file mode 100644 index 2adb114..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.00/x64/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.00/x86/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.00/x86/coeWindows-shared.dll deleted file mode 100644 index 350e0a8..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.00/x86/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.01/x64/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.01/x64/coeWindows-shared.dll deleted file mode 100644 index 2adb114..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.01/x64/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.01/x86/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.01/x86/coeWindows-shared.dll deleted file mode 100644 index 90806ce..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.01/x86/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.02/x86/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.02/x86/coeWindows-shared.dll deleted file mode 100644 index 90ade81..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.02/x86/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.02/x86/coeWindows-sharedd.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.02/x86/coeWindows-sharedd.dll deleted file mode 100644 index 972f431..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.06.05.02/x86/coeWindows-sharedd.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.08.00.00/x86/coeWindows-shared.dll b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.08.00.00/x86/coeWindows-shared.dll deleted file mode 100644 index c003291..0000000 Binary files a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/build/R04.08.00.00/x86/coeWindows-shared.dll and /dev/null differ diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/coeCSharp/coe.cs b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/coeCSharp/coe.cs deleted file mode 100644 index 795c160..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/coeCSharp/coe.cs +++ /dev/null @@ -1,1361 +0,0 @@ -// ********************************************************************************************************** -// coe.cs -// 6/1/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** -//\\ -//----------------------------------------------------------------------------// -// UNCLASSIFIED // -//----------------------------------------------------------------------------// -//\\<\Unclassified> - -//\\ -//----------------------------------------------------------------------------// -// Copyright %(copyright)s Raytheon Company. // -// This software was developed pursuant to Contract Number %(contractNumber)s // -// with the U.S. government. The U.S. government's rights in and to this // -// copyrighted software are as specified in DFARS 252.227-7014 which was made // -// part of the above contract. // -//----------------------------------------------------------------------------// -//\\<\UnlimitedRights> - -//\\ -//----------------------------------------------------------------------------// -// WARNING - This document contains technical data and / or technology whose // -// export or disclosure to Non-U.S. Persons, wherever located, is restricted // -// by the International Traffic in Arms Regulations (ITAR) (22 C.F.R. // -// Section 120-130) or the Export Administration Regulations (EAR) (15 C.F.R. // -// Section 730-774). This document CANNOT be exported (e.g., provided to a // -// supplier outside of the United States) or disclosed to a Non-U.S. Person, // -// wherever located, until a final jurisdiction and classification // -// determination has been completed and approved by Raytheon, and any // -// required U.S. Government approvals have been obtained. Violations are // -// subject to severe criminal penalties. // -//----------------------------------------------------------------------------// -//\\<\EximUndetermined> - -using NLog; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; - -namespace Raytheon.Instruments.coeCSharp -{ - public class coe - { - public const string coeDLL = "coeWindows-shared.dll"; - - private IntPtr router { get; set; } - public IntPtr Router => router; - public IntPtr Database { get; set; } - public IntPtr Protocol { get; set; } - public bool IsConnected { get; set; } - - public string ProtocolName { get; set; } - public string ProtocolCmitName { get; set; } - - public coeEndpoint _realTimeCtrlEndpoint = null; - - public const int OE_TRUE = 1; - public const int OE_FALSE = 0; - - public const int OE_Do_Not_Wait = 0; - public const int OE_Wait_Forever = -1; - - internal static coeDataInterchangePackets _dataInterchangePackets = new coeDataInterchangePackets(); - - public enum Status : int - { - ERROR = -1, - SUCCESS = 0, - FAILED_INSUFFICIENT_RESOURCES = 1, - FAILED_INTERNAL_ERROR = 2, - FAILED_INVALID_ADDRESS = 3, - FAILED_INVALID_NAME = 4, - FAILED_INVALID_PARAMETER = 5, - FAILED_MESSAGE_NOT_AVAILABLE = 6, - FAILED_MESSAGE_NOT_RETURNABLE = 7, - FAILED_MESSAGE_TOO_LARGE = 8, - FAILED_NAME_NOT_FOUND = 9, - FAILED_OBJECT_DELETED = 10, - FAILED_OBJECT_NOT_FOUND = 11, - FAILED_OBJECT_ALREADY_EXISTS = 12, - FAILED_REQUEST_DENIED = 13, - FAILED_TIMEOUT = 14, - FAILED_INVALID_ASYNCH_ID = 15, - FAILED_OPERATION_IN_PROGRESS = 16, - FAILED_INVALID_ASSOCIATION = 17, - FAILED_INVALID_HOST_FOR_CREATION = 18, - FAILED_INVALID_SCOPE = 19, - FAILED_INVALID_TRIGGER = 20, - FAILED_LOG_OVERFLOW = 21, - FAILED_INVALID_INDEX = 22, - FAILED_INVALID_CLOCK_SOURCE = 23, - FAILED_INVALID_CONVERSION = 24, - FAILED_INVALID_DATE = 25, - FAILED_INVALID_MONOTONIC = 26, - FAILED_INCOMPATIBLE_FORMAT = 27, - FAILED_TIMER_NOT_SET = 28, - FAILED_OBJECT_NOT_TRACEABLE = 29, - FAILED_FILE_ALREADY_EXISTS = 30, - FAILED_FILE_DOES_NOT_EXIST = 31, - FAILED_FILE_OPEN = 32, - FAILED_INVALID_HANDLE = 33, - FAILED_INVALID_MODE = 34, - FAILED_INVALID_OPTIONS = 35, - FAILED_INVALID_PATH = 36, - FAILED_NOT_IMPLEMENTED = 55, - FAILED_NOT_ENABLED = 56, - FAILED_NOT_SUPPORTED = 57, - FAILED_NOT_ENCRYPTED = 58, - FAILED_VERIFY_ERROR = 59, - FAILED_MESSAGE_IS_SIGNED = 60, - FAILED_MESSAGE_IS_ENCRYPTED = 61, - FAILED_PROTOCOL_OPERATION_PENDING = 62, - FAILED_PROTOCOL_NO_MESSAGE_AVAILABLE = 63, - FAILED_PROTOCOL_BUSY = 64 - }; - - public enum ScopeType - { - OE_Local = 0, - OE_Shared = 1, - OE_Networked = 2 - }; - - public enum DatabaseRegistrationType - { - REFERENCE_DATABASE_TRANSMIT_ALL = 0, - REFERENCE_DATABASE_LOCAL_REGISTRATIONS = 1, - REFERENCE_DATABASE_REMOTE_REGISTRATIONS = 2, - }; - - - - public enum MessageTypes : byte - { - PING = 0, - PING_RESPONSE = 1, - REGISTRATION_QUERY = 2, - REGISTRATION_RESPONSE = 3, - REGISTRATION_MESSAGE = 4, - DISCONNECT_MESSAGE = 5, - BINDING_MESSAGE = 6, - LABELED_MESSAGE = 8, - }; - - public enum RegistrationType : byte - { - NONE = 0, - REGISTRATION = 1, - DEREGISTRATION = 2, - }; - - enum ELEMENT_TYPE - { - TYPE_CHAR = 0, - TYPE_SHORT, - TYPE_INT, - TYPE_LONG, - TYPE_LONG_LONG, - TYPE_FLOAT, - TYPE_DOUBLE, - TYPE_STR, - TYPE_NULL_STR - }; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void RealTimeDisplayCallback(string value); - - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate IntPtr CallBackDelegate(uint Label); - - #region DLLImports - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "coe_version_Get_Version")] - private static extern IntPtr coe_version_Get_Version(); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Initialization_Configure")] - private static extern Status OE_Initialization_Configure(uint stacksize, - int priority, - int affinity, - uint systemClockPeriod); - - - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Memory_Tracker_Configure")] - public static extern Status OE_Memory_Tracker_Configure(); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Memory_Tracker_Disable")] - public static extern Status OE_Memory_Tracker_Disable(); - - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Memory_Tracker_Display_Usage")] - public static extern void OE_Memory_Tracker_Display_Usage(); - - - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Router_Database_Query_Open")] - private static extern uint OE_Router_Database_Query_Open(IntPtr db, - IntPtr query_data, - uint queryType, - ref IntPtr handle); - - [StructLayout(LayoutKind.Sequential)] - public struct Destination - { - public uint type; - public IntPtr destination; - public uint label; - public uint domain; - public uint mediaAddress; - public uint flags; - }; - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Router_Database_Query_Next")] - private static extern IntPtr OE_Router_Database_Query_Next(IntPtr handle); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Router_Database_Query_Close")] - private static extern uint OE_Router_Database_Query_Close(IntPtr handle); - - - - - - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "initialize_coe_router")] - private static extern IntPtr initialize_coe_router(); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "shutdown_coe_router")] - private static extern Status shutdown_coe_router(IntPtr router); - - - [StructLayout(LayoutKind.Sequential)] - public unsafe struct PARSE_DATA_SECTION - { - public char* section_name; - public uint list_count; - public uint* list; - public uint* next; - }; - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "add_config_item")] - public static extern int add_config_item(IntPtr sect_list, - string section_name, - string element_name, - string element_value); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "get_element")] - private static extern int get_element(IntPtr sect_list, string section, string element, ELEMENT_TYPE dt, IntPtr data, int param); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "delete_config_database")] - public static extern int delete_config_database(IntPtr sect_list); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "configure_router_params")] - private static extern Status configure_router_params(IntPtr sect_list); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "configure_database_params")] - private static extern Status configure_database_params(IntPtr sect_list); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "configure_tcp_media_binding_params")] - private static extern Status configure_tcp_media_binding_params(IntPtr sect_list); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tcp_media_binding_configure")] - private static extern IntPtr tcp_media_binding_configure(IntPtr router); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tcp_media_binding_shutdown")] - private static extern Status tcp_media_binding_shutdown(); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "configure_udp_buffer_pools_params")] - private static extern Status configure_udp_buffer_pools_params(IntPtr sect_list); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "configure_udp_router_protocol_params")] - private static extern Status configure_udp_router_protocol_params(IntPtr sect_list); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "configure_udp_simple_registration_protocol_params")] - private static extern Status configure_udp_simple_registration_protocol_params(IntPtr sect_list); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "configure_udp_media_binding_params")] - private static extern Status configure_udp_media_binding_params(IntPtr sect_list); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "udp_media_binding_configure")] - private static extern IntPtr udp_media_binding_configure(IntPtr router); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "udp_media_binding_shutdown")] - private static extern Status udp_media_binding_shutdown(); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "configure_serial_media_binding_params")] - private static extern Status configure_serial_media_binding_params(IntPtr sect_list); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "serial_media_binding_configure")] - private static extern IntPtr serial_media_binding_configure(IntPtr router); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "serial_media_binding_shutdown")] - private static extern Status serial_media_binding_shutdown(); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Router_Register_Protocol")] - private static extern Status OE_Router_Register_Protocol(IntPtr router, IntPtr protocol, uint flags); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Router_Deregister_Protocol")] - private static extern Status OE_Router_Deregister_Protocol(IntPtr router, IntPtr protocol); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Initialization_Shutdown")] - private static extern Status OE_Initialization_Shutdown(); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Initialization_Create_Database")] - private static extern uint OE_Initialization_Create_Database(uint stackID, - DatabaseRegistrationType registrationType, - uint numberOfInitialDatabaseObjects, - uint numberOfIncrementalDatabaseObjects, - uint numberOfInitialQueries, - uint numberOfIncrementalQueries, - int doAllLabelsRegistration); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Initialization_Create_Buffers")] - private static extern uint OE_Initialization_Create_Buffers(uint stackID, - uint buffersInitialCount_1, - uint buffersSize_1, - uint buffersInitialCount_2, - uint buffersSize_2, - uint buffersInitialCount_3, - uint buffersSize_3, - uint buffersInitialCount_4, - uint buffersSize_4); - - - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Initialization_UDP_Stack")] - private static extern uint OE_Initialization_UDP_Stack(uint numberOfInitialDatabaseObjects, - uint numberOfIncrementalDatabaseObjects, - int doAllLabelsRegistration, - uint routerID, - uint port, - byte[] serverAddress, - uint maximumPacketSize, - uint registrationPacketSize, - uint buffersInitialCount_1, - uint buffersSize_1, - uint buffersInitialCount_2, - uint buffersSize_2, - uint buffersInitialCount_3, - uint buffersSize_3, - uint buffersInitialCount_4, - uint buffersSize_4, - uint UDPreceiveBufferSize); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Initialization_Get_Router")] - internal static extern IntPtr OE_Initialization_Get_Router(uint stackID); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Initialization_Get_Database")] - internal static extern IntPtr OE_Initialization_Get_Database(uint stackID); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "get_coe_router_database")] - internal static extern IntPtr get_coe_router_database(IntPtr router); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Initialization_Get_Protocol")] - internal static extern IntPtr OE_Initialization_Get_Protocol(uint stackID); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Initialization_Get_Media_Binding")] - internal static extern IntPtr OE_Initialization_Get_Media_Binding(uint stackID); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Router_Protocol_Extended_Routine")] - private static extern Status OE_Router_Protocol_Extended_Routine(IntPtr oeObject, - uint routineIdentifier, - IntPtr routineParameters); - - [DllImport("kernel32.dll", CallingConvention = CallingConvention.Winapi, EntryPoint = "GetModuleHandle")] - private static extern IntPtr GetModuleHandle(byte[] dllName); - - [DllImport("kernel32.dll", CallingConvention = CallingConvention.Winapi, EntryPoint = "GetProcAddress")] - private static extern IntPtr GetProcAddress(IntPtr handle, - byte[] routineName); - - [DllImport("kernel32.dll", CallingConvention = CallingConvention.Winapi, EntryPoint = "ZeroMemory")] - private static extern IntPtr ZeroMemory(IntPtr buffer, int length); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Set_Timestamp_Function")] - private static extern void OE_Set_Timestamp_Function(IntPtr routine); - - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Enable_Logger")] - public static extern Status OE_Enable_Logger(); - - - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Set_Log_Level")] - public static extern void OE_Set_Log_Level(int Level); - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Get_Log_Level")] - public static extern int OE_Get_Log_Level(); - - - [DllImport(coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Set_Log_Callback")] - public static extern Status OE_Set_Log_Callback( - [MarshalAs(UnmanagedType.FunctionPtr)] - RealTimeDisplayCallback callbackPointer - ); - - - [DllImport("kernel32", CharSet = CharSet.None, ExactSpelling = false, SetLastError = true)] - private static extern bool FreeLibrary(IntPtr hModule); - - public static void UnloadImportedDll(string dllName) - { - foreach (ProcessModule module in Process.GetCurrentProcess().Modules) - { - if (module.FileName.EndsWith(dllName)) - { - coe.FreeLibrary(module.BaseAddress); - } - } - } - - #endregion DLLImports - - public static string GetVersion() - { - string versionString = Marshal.PtrToStringAnsi(coe_version_Get_Version()); - return versionString; - } - - public static Status Configure(uint clockPeriod) - { - return OE_Initialization_Configure(4096, 0, 0, clockPeriod); - } - - public static void Destroy() - { - - try - { - OE_Initialization_Shutdown(); - } - catch - { - } - } - - public static Status CreateDatabase(uint stackID, - DatabaseRegistrationType registrationType, - uint numberOfInitialDatabaseObjects, - uint numberOfIncrementalDatabaseObjects, - uint numberOfInitialQueries, - uint numberOfIncrementalQueries, - bool doAllLabelsRegistration) - { - return (Status)OE_Initialization_Create_Database(stackID, registrationType, numberOfInitialDatabaseObjects, numberOfIncrementalDatabaseObjects, - numberOfInitialQueries, numberOfIncrementalQueries, doAllLabelsRegistration == true ? 1 : 0); - } - - public static Status CreateBuffers(uint stackID, - uint buffersInitialCount_1, - uint buffersSize_1, - uint buffersInitialCount_2, - uint buffersSize_2, - uint buffersInitialCount_3, - uint buffersSize_3, - uint buffersInitialCount_4, - uint buffersSize_4) - { - return (Status)OE_Initialization_Create_Buffers(stackID, buffersInitialCount_1, buffersSize_1, buffersInitialCount_2, buffersSize_2, - buffersInitialCount_3, buffersSize_3, buffersInitialCount_4, buffersSize_4); - } - - - - public static Status CreateUdpStack(uint numberOfInitialDatabaseObjects, - uint numberOfIncrementalDatabaseObjects, - bool doAllLabelsRegistration, - uint routerID, - uint port, - string serverAddress, - uint maximumPacketSize, - uint registrationPacketSize, - uint buffersInitialCount_1, - uint buffersSize_1, - uint buffersInitialCount_2, - uint buffersSize_2, - uint buffersInitialCount_3, - uint buffersSize_3, - uint buffersInitialCount_4, - uint buffersSize_4, - uint UDPreceiveBufferSize) - { - byte[] serverString = Encoding.ASCII.GetBytes(serverAddress + 'x'); - serverString[serverString.Length - 1] = 0; - return (Status)OE_Initialization_UDP_Stack(numberOfInitialDatabaseObjects, - numberOfIncrementalDatabaseObjects, - doAllLabelsRegistration == true ? 1 : 0, - routerID, - port, - serverString, - maximumPacketSize, - registrationPacketSize, - buffersInitialCount_1, - buffersSize_1, - buffersInitialCount_2, - buffersSize_2, - buffersInitialCount_3, - buffersSize_3, - buffersInitialCount_4, - buffersSize_4, - UDPreceiveBufferSize); - } - - public static uint OE_Router_Database_Query_Open_(IntPtr db, - IntPtr query_data, - uint queryType, - ref IntPtr handle) - { - return OE_Router_Database_Query_Open(db, query_data, queryType, ref handle); - } - - public static IntPtr OE_Router_Database_Query_Next_(IntPtr handle) - { - return OE_Router_Database_Query_Next(handle); - } - - - public static uint OE_Router_Database_Query_Close_(IntPtr handle) - { - return OE_Router_Database_Query_Close(handle); - } - - - - public void SetConnected(bool state) - { - IsConnected = state; - } - - public Status tcp_media_binding_configure( uint port, //port - char[] serverAddress, //serverAddress - uint maximumPacketSize, //maximumPacketSize - uint UDPtransmitBufferSize,//UDPtransmitBufferSize - uint UDPreceiveBufferSize, //UDPreceiveBufferSize - uint TCPtransmitBufferSize,//TCPtransmitBufferSize - uint TCPreceiveBufferSize, //TCPreceiveBufferSize - uint TCPoptionFlags, //TCPoptionFlags - Dictionary>> options - ) - { - IntPtr plist = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - uint tmp = 32; - - if (Configure(10000) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - ZeroMemory(plist, Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - foreach (KeyValuePair>> s in options) - { - foreach (KeyValuePair v in s.Value) - { - add_config_item(plist, s.Key, v.Key, v.Value); - } - } - - if (configure_router_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - if (configure_database_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - router = initialize_coe_router(); - if (router == (IntPtr)Status.ERROR) - return Status.FAILED_INTERNAL_ERROR; - - Database = get_coe_router_database(router); - if (Database == (IntPtr)Status.ERROR) - return Status.FAILED_INTERNAL_ERROR; - - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "LOCAL_PORT", port.ToString()); - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "NUM_PORTS", tmp.ToString()); - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "NUM_DYNAMIC_NODES", tmp.ToString()); - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "SERVER_ADDRESS", new string(serverAddress)); - - tmp = 0; - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "UDP_TX_BUFFER_SIZE", tmp.ToString()); - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "UDP_RX_BUFFER_SIZE", UDPreceiveBufferSize.ToString()); - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "TCP_TX_BUFFER_SIZE", TCPtransmitBufferSize.ToString()); - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "TCP_RX_BUFFER_SIZE", TCPreceiveBufferSize.ToString()); - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "PACKET_SIZE", maximumPacketSize.ToString()); - - tmp = 1; - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "TCP_SELECT_VALUE", tmp.ToString()); - - tmp = 1; - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "DISABLE_NAG_DELAY", tmp.ToString()); - - tmp = 1000; - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "TIMER_RATE", tmp.ToString()); - - tmp = 1; - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "CONNECT_KA_RATE", tmp.ToString()); - - tmp = 1; - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "", tmp.ToString()); - - tmp = 1; - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "RECV_KA_RATE", tmp.ToString()); - - tmp = 4096; - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_STACK_SIZE", tmp.ToString()); - - tmp = 0; /*port_THREAD_MIDDLE_PRIORITY*/ - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_PRIORITY", tmp.ToString()); - - tmp = 0; /*OE_THREAD_NO_AFFINITY*/ - add_config_item(plist, "TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_AFFINITY", tmp.ToString()); - - if (configure_tcp_media_binding_params(plist) != Status.SUCCESS) - { - delete_config_database(plist); - Marshal.FreeHGlobal(plist); - return Status.FAILED_INTERNAL_ERROR; - } - - delete_config_database(plist); - Marshal.FreeHGlobal(plist); - Protocol = tcp_media_binding_configure(router); - if (Protocol == (IntPtr)Status.ERROR) // protocol API error returns -1 - { - // if media binding start up fails, media binding shutdown is done - // inside coe framework - - if (shutdown_coe_router(router) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - if (OE_Initialization_Shutdown() != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - return Status.FAILED_INTERNAL_ERROR; - } - - ProtocolName = "REMOTE"; - ProtocolCmitName = "" + new string(serverAddress) + ": " + port.ToString(); - - if (OE_Router_Register_Protocol(router, Protocol, 0x02) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - return Status.SUCCESS; - } - - public Status tcp_media_binding_configure(Dictionary>> options, ILogger logger = null) - { - IntPtr plist = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - Status status; - - if ((status = Configure(10000)) != Status.SUCCESS) - { - logger?.Error($"Unable to run OE_Initialization_Configure, status {status}"); - return status; - } - - ZeroMemory(plist, Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - foreach (KeyValuePair>> s in options) - { - foreach (KeyValuePair v in s.Value) - { - add_config_item(plist, s.Key, v.Key, v.Value); - } - } - - if ((status = configure_router_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure router params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - if ((status = configure_database_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure database params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - router = initialize_coe_router(); - if (router == (IntPtr)Status.ERROR) - { - logger?.Error("Unable to initialize coe router"); - return Status.FAILED_INTERNAL_ERROR; - } - - Database = get_coe_router_database(router); - if (Database == (IntPtr)Status.ERROR) - { - logger?.Error("Unable to get coe router database"); - return Status.FAILED_INTERNAL_ERROR; - } - - if ((status = configure_tcp_media_binding_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure TCP media binding params, status {status}"); - - delete_config_database(plist); - Marshal.FreeHGlobal(plist); - return Status.FAILED_INTERNAL_ERROR; - } - - try - { - delete_config_database(plist); - Marshal.FreeHGlobal(plist); - } - catch (Exception ex) - { - logger?.Error(ex, $"Unable delete_config_database and FreeHGlobal"); - } - - Protocol = tcp_media_binding_configure(router); - if (Protocol == (IntPtr)Status.ERROR) // protocol API error returns -1 - { - logger?.Error("Unable to configure TCP media binding"); - - // if media binding start up fails, media binding shutdown is done - // inside coe framework - if ((status = shutdown_coe_router(router)) != Status.SUCCESS) - { - logger?.Error($"Unable shutdown coe router, status {status}"); - } - - if ((status = OE_Initialization_Shutdown()) != Status.SUCCESS) - { - logger?.Error($"OE_Initialization_Shutdown error, status {status}"); - } - - return Status.FAILED_INTERNAL_ERROR; - } - - var tcpParams = options["TCP_MEDIA_BINDING_CONFIG"]; - var serverAddress = tcpParams.FirstOrDefault(l => l.Key == "SERVER_ADDRESS").Value; - var port = tcpParams.FirstOrDefault(l => l.Key == "LOCAL_PORT").Value; - - ProtocolName = "REMOTE"; - ProtocolCmitName = $"{serverAddress}: {port}"; - - if ((status = OE_Router_Register_Protocol(router, Protocol, 0x02)) != Status.SUCCESS) - { - logger?.Error($"Unable to register TCP router protocol, status {status}"); - - // if media binding start up fails, media binding shutdown is done - // inside coe framework - if ((status = shutdown_coe_router(router)) != Status.SUCCESS) - { - logger?.Error($"Unable shutdown coe router, status {status}"); - } - - if ((status = OE_Initialization_Shutdown()) != Status.SUCCESS) - { - logger?.Error($"OE_Initialization_Shutdown error, status {status}"); - } - - return Status.FAILED_INTERNAL_ERROR; - } - - return Status.SUCCESS; - } - - public Status TCP_media_binding_shutdown(ILogger logger = null) - { - Status status; - if ((status = OE_Router_Deregister_Protocol(router, Protocol)) != Status.SUCCESS) - logger?.Error($"TCP OE_Router_Deregister_Protocol error, status {status}"); - - if ((status = tcp_media_binding_shutdown()) != Status.SUCCESS) - logger?.Error($"TCP tcp_media_binding_shutdown error, status {status}"); - - if ((status = shutdown_coe_router(router)) != Status.SUCCESS) - logger?.Error($"TCP shutdown_coe_router error, status {status}"); - - if ((status = OE_Initialization_Shutdown()) != Status.SUCCESS) - logger?.Error($"TCP OE_Initialization_Shutdown error, status {status}"); - - return status; - } - - - public Status udp_media_binding_configure(Dictionary>> options, ILogger logger = null) - { - IntPtr plist = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - Status status; - - if ((status = Configure(10000)) != Status.SUCCESS) - { - logger?.Error($"Unable to run OE_Initialization_Configure, status {status}"); - return status; - } - - ZeroMemory(plist, Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - foreach (KeyValuePair>> s in options) - { - foreach (KeyValuePair v in s.Value) - { - add_config_item(plist, s.Key, v.Key, v.Value); - } - } - - if ((status = configure_router_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure router params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - if ((status = configure_database_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure database params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - router = initialize_coe_router(); - if (router == (IntPtr)Status.ERROR) - { - logger?.Error("Unable to initialize coe router"); - return Status.FAILED_INTERNAL_ERROR; - } - - Database = get_coe_router_database(router); - if (Database == (IntPtr)Status.ERROR) - { - logger?.Error("Unable to get coe router database"); - return Status.FAILED_INTERNAL_ERROR; - } - - if ((status = configure_udp_buffer_pools_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure udp buffer pools params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - if ((status = configure_udp_router_protocol_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure udp router protocol params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - if ((status = configure_udp_simple_registration_protocol_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure udp simple registration protocol params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - if ((status = configure_udp_media_binding_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure UDP media binding params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - try - { - delete_config_database(plist); - Marshal.FreeHGlobal(plist); - } - catch (Exception ex) - { - logger?.Error(ex, $"Unable delete_config_database and FreeHGlobal"); - } - - Protocol = udp_media_binding_configure(router); - if (Protocol == (IntPtr)Status.ERROR) // protocol API error returns -1 - { - logger?.Error("Unable to configure UDP media binding"); - - // if media binding start up fails, media binding shutdown is done - // inside coe framework - if ((status = shutdown_coe_router(router)) != Status.SUCCESS) - { - logger?.Error($"Unable shutdown coe router, status {status}"); - } - - if ((status = OE_Initialization_Shutdown()) != Status.SUCCESS) - { - logger?.Error($"OE_Initialization_Shutdown error, status {status}"); - } - - return Status.FAILED_INTERNAL_ERROR; - } - - var udpParams = options["UDP_MEDIA_BINDING_CONFIG"]; - var remote_address = udpParams.FirstOrDefault(l => l.Key == "REMOTE_IP_ADDRESS").Value; - var r_send_port = udpParams.FirstOrDefault(l => l.Key == "REMOTE_SEND_PORT").Value; - var r_recv_port = udpParams.FirstOrDefault(l => l.Key == "REMOTE_RECV_PORT").Value; - var local_address = udpParams.FirstOrDefault(l => l.Key == "LOCAL_IP_ADDRESS").Value; - var l_send_port = udpParams.FirstOrDefault(l => l.Key == "LOCAL_SEND_PORT").Value; - var l_recv_port = udpParams.FirstOrDefault(l => l.Key == "LOCAL_RECV_PORT").Value; - - ProtocolName = $"{remote_address}:{r_send_port}:{r_recv_port}"; - ProtocolCmitName = $"{local_address}:{l_send_port}:{l_recv_port}"; - - if ((status = OE_Router_Register_Protocol(router, Protocol, 0)) != Status.SUCCESS) - { - logger?.Error($"Unable to register UDP router protocol, status {status}"); - - // if media binding start up fails, media binding shutdown is done - // inside coe framework - if ((status = shutdown_coe_router(router)) != Status.SUCCESS) - { - logger?.Error($"Unable shutdown coe router, status {status}"); - } - - if ((status = OE_Initialization_Shutdown()) != Status.SUCCESS) - { - logger?.Error($"OE_Initialization_Shutdown error, status {status}"); - } - - return Status.FAILED_INTERNAL_ERROR; - } - - return Status.SUCCESS; - } - - public Status udp_media_binding_configure( - char[] local_address, - char[] remote_address, - uint l_send_port, - uint l_recv_port, - uint r_send_port, - uint r_recv_port, - uint recv_timeout, - Dictionary>> options) - { - IntPtr plist = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - if (Configure(10000) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - ZeroMemory(plist, Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - foreach (KeyValuePair>> s in options) - { - foreach (KeyValuePair v in s.Value) - { - add_config_item(plist, s.Key, v.Key, v.Value); - } - } - - if (configure_router_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - if (configure_database_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - router = initialize_coe_router(); - if (router == (IntPtr)Status.ERROR) - return Status.FAILED_INTERNAL_ERROR; - - Database = get_coe_router_database(router); - if (Database == (IntPtr)Status.ERROR) - return Status.FAILED_INTERNAL_ERROR; - - add_config_item(plist, "UDP_MEDIA_BINDING_CONFIG", "LOCAL_IP_ADDRESS", new string(local_address)); - add_config_item(plist, "UDP_MEDIA_BINDING_CONFIG", "REMOTE_IP_ADDRESS", new string(remote_address)); - add_config_item(plist, "UDP_MEDIA_BINDING_CONFIG", "LOCAL_SEND_PORT", l_send_port.ToString()); - add_config_item(plist, "UDP_MEDIA_BINDING_CONFIG", "LOCAL_RECV_PORT", l_recv_port.ToString()); - add_config_item(plist, "UDP_MEDIA_BINDING_CONFIG", "REMOTE_SEND_PORT", r_send_port.ToString()); - add_config_item(plist, "UDP_MEDIA_BINDING_CONFIG", "REMOTE_RECV_PORT", r_recv_port.ToString()); - add_config_item(plist, "UDP_MEDIA_BINDING_CONFIG", "RECV_TIMEOUT", recv_timeout.ToString()); - - configure_udp_buffer_pools_params(plist); - - if (configure_udp_router_protocol_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - if (configure_udp_simple_registration_protocol_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - if (configure_udp_media_binding_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - delete_config_database(plist); - Marshal.FreeHGlobal(plist); - Protocol = udp_media_binding_configure(router); - if (Protocol == (IntPtr)Status.ERROR) // protocol API error returns -1 - { - // if media binding start up fails, media binding shutdown is done - // inside coe framework - - if (shutdown_coe_router(router) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - if (OE_Initialization_Shutdown() != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - return Status.FAILED_INTERNAL_ERROR; - } - - ProtocolName = "" + new string(remote_address) + ": " + r_send_port.ToString() + ":" + r_recv_port.ToString(); - ProtocolCmitName = "" + new string(local_address) + ": " + l_send_port.ToString() + ":" + l_recv_port.ToString(); - - if (OE_Router_Register_Protocol(router, Protocol, 0) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - return Status.SUCCESS; - } - - public Status UDP_media_binding_shutdown(ILogger logger = null) - { - Status status; - - if ((status = OE_Router_Deregister_Protocol(router, Protocol)) != Status.SUCCESS) - logger?.Error($"UDP OE_Router_Deregister_Protocol error, status {status}"); - - if ((status = udp_media_binding_shutdown()) != Status.SUCCESS) - logger?.Error($"UDP udp_media_binding_shutdown error, status {status}"); - - if ((status = shutdown_coe_router(router)) != Status.SUCCESS) - logger?.Error($"UDP shutdown_coe_router error, status {status}"); - - if ((status = OE_Initialization_Shutdown()) != Status.SUCCESS) - logger?.Error($"UDP OE_Initialization_Shutdown error, status {status}"); - - return Status.SUCCESS; - } - - public Status serial_media_binding_configure(Dictionary>> options, ILogger logger = null) - { - IntPtr plist = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - Status status; - - if ((status = Configure(10000)) != Status.SUCCESS) - { - logger?.Error($"Unable to run OE_Initialization_Configure, status {status}"); - return status; - } - - ZeroMemory(plist, Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - foreach (KeyValuePair>> s in options) - { - foreach (KeyValuePair v in s.Value) - { - add_config_item(plist, s.Key, v.Key, v.Value); - } - } - - if ((status = configure_router_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure router params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - if ((status = configure_database_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure database params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - router = initialize_coe_router(); - if (router == (IntPtr)Status.ERROR) - { - logger?.Error("Unable to initialize coe router"); - return Status.FAILED_INTERNAL_ERROR; - } - - Database = get_coe_router_database(router); - if (Database == (IntPtr)Status.ERROR) - { - logger?.Error("Unable to get coe router database"); - return Status.FAILED_INTERNAL_ERROR; - } - - if ((status = configure_serial_media_binding_params(plist)) != Status.SUCCESS) - { - logger?.Error($"Unable to configure serial media binding params, status {status}"); - return Status.FAILED_INTERNAL_ERROR; - } - - try - { - delete_config_database(plist); - Marshal.FreeHGlobal(plist); - } - catch (Exception ex) - { - logger?.Error(ex, $"Unable delete_config_database and FreeHGlobal"); - } - - Protocol = serial_media_binding_configure(router); - if (Protocol == (IntPtr)Status.ERROR) - { - logger?.Error("Unable to configure serial media binding"); - - // if media binding start up fails, media binding shutdown is done - // inside coe framework - if ((status = shutdown_coe_router(router)) != Status.SUCCESS) - { - logger?.Error($"Unable shutdown coe router, status {status}"); - } - - if ((status = OE_Initialization_Shutdown()) != Status.SUCCESS) - { - logger?.Error($"OE_Initialization_Shutdown error, status {status}"); - } - - return Status.FAILED_INTERNAL_ERROR; - } - - var serialParams = options["SERIAL_MEDIA_BINDING_CONFIG"]; - var port = serialParams.FirstOrDefault(l => l.Key == "DEVICE_NAME").Value; - - ProtocolName = "REMOTE"; - ProtocolCmitName = $"CMIT: {port}"; - - if ((status = OE_Router_Register_Protocol(router, Protocol, 0)) != Status.SUCCESS) - { - logger?.Error($"Unable to register router protocol, status {status}"); - - // if media binding start up fails, media binding shutdown is done - // inside coe framework - if ((status = shutdown_coe_router(router)) != Status.SUCCESS) - { - logger?.Error($"Unable shutdown coe router, status {status}"); - } - - if ((status = OE_Initialization_Shutdown()) != Status.SUCCESS) - { - logger?.Error($"OE_Initialization_Shutdown error, status {status}"); - } - - return Status.FAILED_INTERNAL_ERROR; - } - - return Status.SUCCESS; - } - - public Status serial_media_binding_configure(char[] port, - uint baudrate, - uint databits, - uint stopbits, - uint parity, - uint flowcontrol, - uint recv_timeout, - Dictionary>> options) - { - IntPtr plist = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - if (Configure(10000) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - ZeroMemory(plist, Marshal.SizeOf(typeof(PARSE_DATA_SECTION))); - - foreach (KeyValuePair>> s in options) - { - foreach (KeyValuePair v in s.Value) - { - add_config_item(plist, s.Key, v.Key, v.Value); - } - } - - if (configure_router_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - if (configure_database_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - router = initialize_coe_router(); - if (router == (IntPtr)Status.ERROR) - return Status.FAILED_INTERNAL_ERROR; - - Database = get_coe_router_database(router); - if (Database == (IntPtr)Status.ERROR) - return Status.FAILED_INTERNAL_ERROR; - - add_config_item(plist, "SERIAL_MEDIA_BINDING_CONFIG", "DEVICE_NAME", port.ToString()); - add_config_item(plist, "SERIAL_MEDIA_BINDING_CONFIG", "BAUD_RATE", baudrate.ToString()); - add_config_item(plist, "SERIAL_MEDIA_BINDING_CONFIG", "DATA_BITS", databits.ToString()); - add_config_item(plist, "SERIAL_MEDIA_BINDING_CONFIG", "STOP_BITS", stopbits.ToString()); - add_config_item(plist, "SERIAL_MEDIA_BINDING_CONFIG", "PARITY", parity.ToString()); - add_config_item(plist, "SERIAL_MEDIA_BINDING_CONFIG", "FLOW_CONTROL", flowcontrol.ToString()); - add_config_item(plist, "SERIAL_MEDIA_BINDING_CONFIG", "RECV_PROCESSING_DELAY", recv_timeout.ToString()); - - if (configure_serial_media_binding_params(plist) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - delete_config_database(plist); - Marshal.FreeHGlobal(plist); - Protocol = serial_media_binding_configure(router); - if (Protocol == (IntPtr)Status.ERROR) - { - // if media binding start up fails, media binding shutdown is done - // inside coe framework - - if (shutdown_coe_router(router) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - if (OE_Initialization_Shutdown() != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - return Status.FAILED_INTERNAL_ERROR; - } - - ProtocolName = "REMOTE"; - ProtocolCmitName = "CMIT: " + new string(port); - - if (OE_Router_Register_Protocol(router, Protocol, 0) != Status.SUCCESS) - return Status.FAILED_INTERNAL_ERROR; - - return Status.SUCCESS; - } - - public Status SERIAL_media_binding_shutdown(ILogger logger = null) - { - Status status; - if ((status = OE_Router_Deregister_Protocol(router, Protocol)) != Status.SUCCESS) - logger?.Error($"Serial OE_Router_Deregister_Protocol error, status {status}"); - - if ((status = serial_media_binding_shutdown()) != Status.SUCCESS) - logger?.Error($"Serial serial_media_binding_shutdown error, status {status}"); - - if ((status = shutdown_coe_router(router)) != Status.SUCCESS) - logger?.Error($"Serial shutdown_coe_router error, status {status}"); - - if ((status = OE_Initialization_Shutdown()) != Status.SUCCESS) - logger?.Error($"Serial OE_Initialization_Shutdown error, status {status}"); - - return status; - } - - struct AddressParametersStructure - { - internal uint mediaAddress; - internal IntPtr bufferAddress; - internal uint bufferSize; - } - - public static string DiagnosticMediaAddressToString(uint stackID, - uint mediaAddress) - { - if (mediaAddress == 0xFFFFFFFF) - { - string IPString = "ALL"; - return IPString; - } - else - { - IntPtr bufferPointer = Marshal.AllocHGlobal(32); - AddressParametersStructure parameters; - parameters.mediaAddress = mediaAddress; - parameters.bufferSize = 32; - parameters.bufferAddress = bufferPointer; - IntPtr parametersPointer = Marshal.AllocHGlobal(Marshal.SizeOf(parameters)); - - Marshal.StructureToPtr(parameters, parametersPointer, false); - OE_Router_Protocol_Extended_Routine(OE_Initialization_Get_Media_Binding(stackID), 0, parametersPointer); - string IPstring = Marshal.PtrToStringAnsi(bufferPointer); - - Marshal.FreeHGlobal(parametersPointer); - Marshal.FreeHGlobal(bufferPointer); - return IPstring; - } - } - struct ConnectionsParametersStructure - { - internal int numberOfBuffers; - internal IntPtr bufferAddress; - internal int bufferSize; - } - - public static int DiagnosticConnections(uint stackID, - string[] results) - { - IntPtr bufferPointer = Marshal.AllocHGlobal(results.Length * 32); - ConnectionsParametersStructure parameters; - parameters.numberOfBuffers = results.Length; - parameters.bufferSize = 32; - parameters.bufferAddress = bufferPointer; - IntPtr parametersPointer = Marshal.AllocHGlobal(Marshal.SizeOf(parameters)); - - Marshal.StructureToPtr(parameters, parametersPointer, false); - IntPtr mediaBinding = OE_Initialization_Get_Media_Binding(stackID); - OE_Router_Protocol_Extended_Routine(mediaBinding, 1, parametersPointer); - ConnectionsParametersStructure returnValues; - returnValues = (ConnectionsParametersStructure)Marshal.PtrToStructure(parametersPointer, typeof(ConnectionsParametersStructure)); - for (int index = 0; index < returnValues.numberOfBuffers; index++) - { - results[index] = Marshal.PtrToStringAnsi(new IntPtr((bufferPointer.ToInt64() + (index * 32)))); - } - - Marshal.FreeHGlobal(parametersPointer); - Marshal.FreeHGlobal(bufferPointer); - return returnValues.numberOfBuffers; - } - // - // - // - // Time Tagging - // - // - // - public enum TimeTaggingType { NONE, SYSTEM_TIMER_NANOSECONDS, SYSTEM_TIMER_FRACTIONS, LPT }; - public static void setTimeTagging(TimeTaggingType tagType) - { - IntPtr routineAddress = IntPtr.Zero; - byte[] coeDllName = Encoding.ASCII.GetBytes(coeDLL + 'x'); - coeDllName[coeDllName.Length - 1] = 0; - IntPtr dllHandle = GetModuleHandle(coeDllName); - switch (tagType) - { - case TimeTaggingType.NONE: - break; - case TimeTaggingType.SYSTEM_TIMER_NANOSECONDS: - { - byte[] coeRoutineName = Encoding.ASCII.GetBytes("OE_Clock_Handler_Get_System_Time" + 'x'); - coeRoutineName[coeRoutineName.Length - 1] = 0; - routineAddress = GetProcAddress(dllHandle, coeRoutineName); - } - break; - case TimeTaggingType.SYSTEM_TIMER_FRACTIONS: - { - byte[] coeRoutineName = Encoding.ASCII.GetBytes("OE_Clock_Handler_Get_System_Time_With_Fractions" + 'x'); - coeRoutineName[coeRoutineName.Length - 1] = 0; - routineAddress = GetProcAddress(dllHandle, coeRoutineName); - } - break; - case TimeTaggingType.LPT: - { - byte[] coeRoutineName = Encoding.ASCII.GetBytes("Precision_Time_Get_COE_MsgHdr_Timestamp" + 'x'); - coeRoutineName[coeRoutineName.Length - 1] = 0; - routineAddress = GetProcAddress(dllHandle, coeRoutineName); - } - break; - } - OE_Set_Timestamp_Function(routineAddress); - } - } -} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/coeCSharp/coeEndpoint.cs b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/coeCSharp/coeEndpoint.cs deleted file mode 100644 index 0bc4272..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/coeCSharp/coeEndpoint.cs +++ /dev/null @@ -1,309 +0,0 @@ -// ********************************************************************************************************** -// coeEndpoint.cs -// 6/1/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** - -//\\ -//----------------------------------------------------------------------------// -// UNCLASSIFIED // -//----------------------------------------------------------------------------// -//\\<\Unclassified> - -//\\ -//----------------------------------------------------------------------------// -// Copyright %(copyright)s Raytheon Company. // -// This software was developed pursuant to Contract Number %(contractNumber)s // -// with the U.S. government. The U.S. government's rights in and to this // -// copyrighted software are as specified in DFARS 252.227-7014 which was made // -// part of the above contract. // -//----------------------------------------------------------------------------// -//\\<\UnlimitedRights> - -//\\ -//----------------------------------------------------------------------------// -// WARNING - This document contains technical data and / or technology whose // -// export or disclosure to Non-U.S. Persons, wherever located, is restricted // -// by the International Traffic in Arms Regulations (ITAR) (22 C.F.R. // -// Section 120-130) or the Export Administration Regulations (EAR) (15 C.F.R. // -// Section 730-774). This document CANNOT be exported (e.g., provided to a // -// supplier outside of the United States) or disclosed to a Non-U.S. Person, // -// wherever located, until a final jurisdiction and classification // -// determination has been completed and approved by Raytheon, and any // -// required U.S. Government approvals have been obtained. Violations are // -// subject to severe criminal penalties. // -//----------------------------------------------------------------------------// -//\\<\EximUndetermined> - -using System; -using System.Runtime.InteropServices; - -namespace Raytheon.Instruments.coeCSharp -{ - // - // - // - // Endpoint - // - // - // - public class coeEndpoint : IDisposable - { - #region DLLImports - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Create_Dynamic_With_Domain")] - private static extern IntPtr OE_Endpoint_Create_Dynamic_With_Domain(IntPtr Name, - coe.ScopeType Scope, - IntPtr Router, - uint Domain, - uint MaximumTransmitMessages, - uint MaximumReceiveMessages, - uint MaximumTransmitMessageSize, - uint MaximumReceiveMessageSize, - IntPtr ApplicationContext, - out coe.Status Status); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Delete")] - private static extern coe.Status OE_Endpoint_Delete(IntPtr _obj); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Associate")] - private static extern coe.Status OE_Endpoint_Associate(IntPtr _obj, - IntPtr Event, - TriggerType Trigger); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Send_Labeled")] - private static extern coe.Status OE_Endpoint_Send_Labeled(IntPtr _obj, - IntPtr Message, - uint Options, - uint Handling_Policy); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Peek")] - private static extern coe.Status OE_Endpoint_Peek(IntPtr _obj, - out uint Message_Label, - out uint Message_Size, - out int Message_Priority); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Wait")] - private static extern coe.Status OE_Endpoint_Wait(IntPtr _obj, - int Timeout); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Receive")] - private static extern coe.Status OE_Endpoint_Receive(IntPtr _obj, - ref IntPtr Message, - uint Handling_Policy, - int Timeout, - IntPtr Source); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Register_Ex2")] - private static extern coe.Status OE_Endpoint_Register_Ex2(IntPtr _obj, - uint Label, - [MarshalAs(UnmanagedType.FunctionPtr)] - coe.CallBackDelegate callbackD); - - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Deregister")] - private static extern coe.Status OE_Endpoint_Deregister(IntPtr _obj, - uint Label); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Endpoint_Empty")] - private static extern coe.Status OE_Endpoint_Empty(IntPtr _obj); - - #endregion - - public enum TriggerType : int - { - DATA_RECEIVED = 0, - BUFFER_EMPTY = 1, - DATA_DISCARDED = 2 - }; - - private bool _disposed; - private IntPtr _handle; - private readonly coeEvent[] _events; - private const int MaximumNumberOfEvents = 4; - private int _numberOfEvents; - - // Constant to be used for a non-queued endpoint - public const uint NON_QUEUED_SIZE = 0; - - public coeEndpoint(uint maxMessageSize, IntPtr router = default) : this(0, maxMessageSize, 0, router) { } - public coeEndpoint(uint maxMessageSize, uint maxBufferMessages, IntPtr router = default) - : this(0, maxMessageSize, maxBufferMessages, router) { } - public coeEndpoint(uint domain, uint maxMessageSize, uint maxBufferMessages, IntPtr router = default) - { - _handle = OE_Endpoint_Create_Dynamic_With_Domain(IntPtr.Zero, coe.ScopeType.OE_Local, router, domain, - maxBufferMessages, maxBufferMessages, maxMessageSize, maxMessageSize, IntPtr.Zero, out coe.Status oe_status); - if (oe_status != coe.Status.SUCCESS) - { - _handle = IntPtr.Zero; - throw new Exception("Unable to create OE_Endpoint. Error = " + oe_status); - } - else - { - _numberOfEvents = 0; - _events = new coeEvent[MaximumNumberOfEvents]; - } - } - - ~coeEndpoint() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - } - if (_handle != IntPtr.Zero) - { - for (int index = 0; index < _numberOfEvents; index++) - { - _events[index].Disable(); - } - OE_Endpoint_Delete(_handle); - _handle = IntPtr.Zero; - } - _disposed = true; - } - - public IntPtr Handle - { - get { return _handle; } - } - - public coe.Status Register(uint label) - { - coe.Status status = OE_Endpoint_Register_Ex2(_handle, label, null); - return status; - } - - public coe.Status Register(uint label, coeDataInterchange.FormatPacketType packet) - { - - coe._dataInterchangePackets.Add(label, packet); - coe.Status status = OE_Endpoint_Register_Ex2(_handle, label, coe._dataInterchangePackets._delegate); - return status; - } - - public coe.Status Deregister(uint label) - { - coe.Status status = OE_Endpoint_Deregister(_handle, label); - return status; - } - - public coe.Status Send(coeMessage message) - { - return Send(message, 0); - } - - public coe.Status Send(coeMessage message, uint options) - { - message.Serialize(); - return OE_Endpoint_Send_Labeled(_handle, message.Handle, options, 0); - } - - public coe.Status Peek(out uint message_Label, - out uint message_Size, - out int message_Priority) - { - coe.Status status; - status = OE_Endpoint_Peek(_handle, out uint messageLabel, out uint messageSize, out int messagePriority); - message_Label = messageLabel; - message_Size = messageSize; - message_Priority = messagePriority; - return status; - } - - public coe.Status Wait(int timeout) - { - return OE_Endpoint_Wait(_handle, timeout); - } - - public coe.Status Clear() - { - return OE_Endpoint_Empty(_handle); - } - - public coe.Status Receive(coeMessage message, int timeout) - { - coe.Status Status; - IntPtr coeMessageHandle = message != null ? message.Handle : IntPtr.Zero; - Status = OE_Endpoint_Receive(_handle, ref coeMessageHandle, 0, timeout, IntPtr.Zero); - if (Status == coe.Status.SUCCESS) - { - message.Deserialize(); - } - return Status; - } - - public coe.Status Receive(coeMessage message) - { - return Receive(message, coe.OE_Wait_Forever); - } - - public coe.Status Associate(coeEventFlag eventFlag, uint mask, TriggerType trigger) - { - coe.Status status; - - if (_numberOfEvents >= MaximumNumberOfEvents) - { - status = coe.Status.FAILED_INSUFFICIENT_RESOURCES; - } - else - { - _events[_numberOfEvents] = new coeEvent(); - _events[_numberOfEvents].SetNotification(eventFlag, mask); - status = OE_Endpoint_Associate(_handle, _events[_numberOfEvents].Handle, trigger); - if (status == coe.Status.SUCCESS) - { - status = _events[_numberOfEvents].Enable(); - _numberOfEvents++; - } - } - return status; - } - } -} - -//\\ -//----------------------------------------------------------------------------// -// UNCLASSIFIED // -//----------------------------------------------------------------------------// -//\\<\Unclassified> - diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/coeCSharp/coeMessage.cs b/Source/TSRealLib/HAL/Implementations/BIT/COEComm/coeCSharp/coeMessage.cs deleted file mode 100644 index 195f72e..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COEComm/coeCSharp/coeMessage.cs +++ /dev/null @@ -1,392 +0,0 @@ -// ********************************************************************************************************** -// coeMessage.cs -// 6/1/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** - -//\\ -//----------------------------------------------------------------------------// -// UNCLASSIFIED // -//----------------------------------------------------------------------------// -//\\<\Unclassified> - -//\\ -//----------------------------------------------------------------------------// -// Copyright %(copyright)s Raytheon Company. // -// This software was developed pursuant to Contract Number %(contractNumber)s // -// with the U.S. government. The U.S. government's rights in and to this // -// copyrighted software are as specified in DFARS 252.227-7014 which was made // -// part of the above contract. // -//----------------------------------------------------------------------------// -//\\<\UnlimitedRights> - -//\\ -//----------------------------------------------------------------------------// -// WARNING - This document contains technical data and / or technology whose // -// export or disclosure to Non-U.S. Persons, wherever located, is restricted // -// by the International Traffic in Arms Regulations (ITAR) (22 C.F.R. // -// Section 120-130) or the Export Administration Regulations (EAR) (15 C.F.R. // -// Section 730-774). This document CANNOT be exported (e.g., provided to a // -// supplier outside of the United States) or disclosed to a Non-U.S. Person, // -// wherever located, until a final jurisdiction and classification // -// determination has been completed and approved by Raytheon, and any // -// required U.S. Government approvals have been obtained. Violations are // -// subject to severe criminal penalties. // -//----------------------------------------------------------------------------// -//\\<\EximUndetermined> - - -using System; -using System.Runtime.InteropServices; - -namespace Raytheon.Instruments.coeCSharp -{ - /// - /// Message Attributes - /// - [AttributeUsage(AttributeTargets.All)] - public class MessageOffset : Attribute - { - readonly uint _bufferOffset; - public MessageOffset(uint bufferOffset) - { - _bufferOffset = bufferOffset; - } - public uint Offset - { - get { return _bufferOffset; } - } - } - [AttributeUsage(AttributeTargets.All)] - public class MessageSize : Attribute - { - readonly int _bufferSize; - public MessageSize(int bufferSize) - { - _bufferSize = bufferSize; - } - public int Size - { - get { return _bufferSize; } - } - } - - /// - /// Message: base class - /// - public abstract class coeMessage : IDisposable - { - #region DLLImports - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_Create")] - private static extern IntPtr OE_Message_Create(IntPtr Buffer_Address, - uint Size, - int Create_Shared, - IntPtr ApplicationContext, - out coe.Status Status); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_Delete")] - private static extern coe.Status OE_Message_Delete(IntPtr Handle); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_set_Priority")] - private static extern coe.Status OE_Message_set_Priority(IntPtr Handle, - int Priority); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_get_Priority")] - private static extern int OE_Message_get_Priority(IntPtr Handle, - out coe.Status Status); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_set_Domain")] - private static extern coe.Status OE_Message_set_Domain(IntPtr Handle, - uint Domain); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_get_Domain")] - private static extern uint OE_Message_get_Domain(IntPtr Handle, - out coe.Status Status); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_set_Label")] - private static extern coe.Status OE_Message_set_Label(IntPtr Handle, - uint Label); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_get_Label")] - private static extern uint OE_Message_get_Label(IntPtr Handle, - out coe.Status Status); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_set_Data_Size")] - private static extern coe.Status OE_Message_set_Data_Size(IntPtr Handle, - uint Size); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_get_Data_Size")] - private static extern uint OE_Message_get_Data_Size(IntPtr Handle, - out coe.Status Status); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_get_Transmit_Timestamp")] - private static extern coe.Status OE_Message_get_Transmit_Timestamp(IntPtr Handle, - out ulong Seconds, - out uint Fraction_Of_Second); - - [DllImport(coe.coeDLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "OE_Message_get_Receive_Timestamp")] - private static extern coe.Status OE_Message_get_Receive_Timestamp(IntPtr Handle, - out ulong Seconds, - out uint Fraction_Of_Second); - #endregion - - private bool disposed = false; - protected IntPtr m_Handle = IntPtr.Zero; - protected IntPtr m_UnmanagedBuffer = IntPtr.Zero; - protected int m_UnmanagedBufferSize = 0; - protected int m_Size; - protected byte[] m_Buffer; - - // - // The following routines are provided for testing and access purposes - // - public IntPtr GetUnmanagedBuffer() { return m_UnmanagedBuffer; } - public byte[] GetManagedBuffer() { return m_Buffer; } - - protected coeMessage(int size) : this(size, 0) { } - protected coeMessage(int size, uint label) : this(size, label, 0) { } - protected coeMessage(int size, uint label, int priority) - { - if (size == 0) - { - size = getPayloadSize(); - } - if (size > 0) - { - m_Buffer = new byte[size]; - m_UnmanagedBuffer = Marshal.AllocHGlobal((int)size); - m_UnmanagedBufferSize = (int)size; - } - m_Handle = OE_Message_Create(m_UnmanagedBuffer, (uint)size, coe.OE_FALSE, IntPtr.Zero, out coe.Status oe_status); - if (oe_status != coe.Status.SUCCESS) - { - m_Handle = IntPtr.Zero; - throw new Exception("Unable to create OE_Message. Error = " + oe_status); - } - else - { - m_Size = size; - // The message was created successfully - oe_status = OE_Message_set_Priority(m_Handle, priority); - if (oe_status != coe.Status.SUCCESS) - { - throw new Exception("Unable to set message priority to " + priority + ". Error = " + oe_status); - } - - oe_status = OE_Message_set_Label(m_Handle, label); - if (oe_status != coe.Status.SUCCESS) - { - throw new Exception("Unable to set message priority to " + label + ". Error = " + oe_status); - } - } - } - - ~coeMessage() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected void Dispose(bool disposing) - { - if (disposed) return; - - if (disposing) - { - } - if (m_UnmanagedBuffer != IntPtr.Zero) - { - Marshal.FreeHGlobal(m_UnmanagedBuffer); - m_UnmanagedBuffer = IntPtr.Zero; - } - if (m_Handle != IntPtr.Zero) - { - OE_Message_Delete(m_Handle); - m_Handle = IntPtr.Zero; - } - disposed = true; - } - - internal IntPtr Handle - { - get { return m_Handle; } - } - - public uint Domain - { - get - { - return OE_Message_get_Domain(m_Handle, out coe.Status status); - } - set - { - coe.Status status = OE_Message_set_Domain(m_Handle, value); - } - } - - public uint Label - { - get - { - return OE_Message_get_Label(m_Handle, out coe.Status status); - } - set - { - coe.Status status = OE_Message_set_Label(m_Handle, value); - } - } - - public int Priority - { - get - { - return OE_Message_get_Priority(m_Handle, out coe.Status status); - } - set - { - coe.Status status = OE_Message_set_Priority(m_Handle, value); - } - } - - public uint Size - { - get - { - return OE_Message_get_Data_Size(m_Handle, out coe.Status status); - } - set - { - coe.Status status = OE_Message_set_Data_Size(m_Handle, value); - } - } - - public int BufferSize - { - get - { - return m_UnmanagedBufferSize; - } - set - { - if (value > m_UnmanagedBufferSize) - { - uint savedDomain = Domain; - uint savedLabel = Label; - int savedPriority = Priority; - uint savedSize = Size; - - if (m_UnmanagedBuffer != IntPtr.Zero) - { - Marshal.FreeHGlobal(m_UnmanagedBuffer); - m_UnmanagedBuffer = IntPtr.Zero; - } - if (m_Handle != IntPtr.Zero) - { - OE_Message_Delete(m_Handle); - m_Handle = IntPtr.Zero; - } - m_Buffer = new byte[value]; - m_UnmanagedBuffer = Marshal.AllocHGlobal((int)value); - m_UnmanagedBufferSize = (int)value; - m_Handle = OE_Message_Create(m_UnmanagedBuffer, (uint)value, coe.OE_FALSE, IntPtr.Zero, out coe.Status oe_status); - m_Size = value; - - Domain = savedDomain; - Label = savedLabel; - Priority = savedPriority; - Size = savedSize; - } - } - } - - public void GetSendTime(out ulong Seconds, out uint FractionOfSecond) - { - var status = OE_Message_get_Transmit_Timestamp(m_Handle, out ulong seconds, out uint fractionOfSecond); - Seconds = seconds; - FractionOfSecond = fractionOfSecond; - } - - public void GetReceiveTime(out ulong Seconds, out uint FractionOfSecond) - { - var status = OE_Message_get_Receive_Timestamp(m_Handle, out ulong seconds, out uint fractionOfSecond); - Seconds = seconds; - FractionOfSecond = fractionOfSecond; - } - - abstract public void Serialize(); - abstract public void Deserialize(); - - // Serialization/Deserialization support - private void alignIndex(ref int dataBufferIndex, - int alignment) - { - int indexMisalignment = dataBufferIndex % alignment; - if (indexMisalignment > 0) - { - dataBufferIndex += alignment - indexMisalignment; - } - } - - public int getPayloadSize() - { - int size = 0; - return serializationSupport.getPayloadSize(this, GetType(), ref size); - } - - - protected void copyToMessageBuffer(byte[] data) - { - Marshal.Copy(data, 0, m_UnmanagedBuffer, data.Length); - } - - protected byte[] copyFromMessageBuffer() - { - byte[] data = null; - uint dataSize = OE_Message_get_Data_Size(m_Handle, out coe.Status status); - if (dataSize > 0) - { - Marshal.Copy(m_UnmanagedBuffer, m_Buffer, 0, (int)dataSize); - data = m_Buffer; - } - return data; - } - } -} - -//\\ -//----------------------------------------------------------------------------// -// UNCLASSIFIED // -//----------------------------------------------------------------------------// -//\\<\Unclassified> \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/COECommDeviceInstrument.cs b/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/COECommDeviceInstrument.cs deleted file mode 100644 index 98316f2..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/COECommDeviceInstrument.cs +++ /dev/null @@ -1,859 +0,0 @@ -// ********************************************************************************************************** -// COECommDeviceInstrument.cs -// 7/11/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** -using System; -using Raytheon.Instruments.MessagingUtilities; -using System.Xml.XPath; -using System.Collections.Generic; -using System.Threading.Tasks; -using System.Linq; -using System.Threading; -using Raytheon.Common; -using Raytheon.Instruments.coeCSharp; -using System.Xml; -using System.IO; -using System.Reflection; -using System.Globalization; -using NLog; - -namespace Raytheon.Instruments -{ - /// - /// This device supports different ways of communicating with other COE nodes - /// TCP - /// UDP - /// Serial - /// - public enum DriverType - { - Undefined, - TCP, - UDP, - Serial - }; - - public class COECommDeviceInstrument : ICommDevice - { - /// - /// Nlog Logger - /// - readonly ILogger _logger; - - /// - /// Cancellation token to stop reading incoming messages - /// - private CancellationTokenSource _cancellationTokenSource = null; - - /// - /// collection of the messages received - /// - private readonly Dictionary, OeMessage> _messages; - - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - /// - /// UDP, TCP, Serial or Undefined - /// - private DriverType _driverType; - - /// - /// dictionary of options when initializing COE endpoint and router - /// - private readonly Dictionary>> _options = new Dictionary>>(); - - /// - /// reference to the main wrapper class for Common Operating Environment - /// - private readonly coe _coe; - - /// - /// COE endpoint - /// - private coeEndpoint _endpoint; - - /// - /// used for initialization of the endpoint - /// - private uint _maxMessageSize; - private uint _epQueueDepth; - - /// - /// collection of all labels with message names per every XML file - /// - private readonly Dictionary> _icds = new Dictionary>(); - - /// - /// timeout can be set for the reader in a separate call - /// - private uint _receiverTimeout; - - /// - /// Number of milliseconds to wake up and check the message when receiving - /// - private int _checkForMessageIntervalMs; - - /// - /// collection of response labels or messages that COE endpoint should be registered for - /// - private List _responseLabels = new List(); - - /// - /// collection of message XML documents (processed XML files) used in COE communications - /// - private readonly Dictionary _xmlDocs = new Dictionary(); - - /// - /// instrument constructor - /// - public COECommDeviceInstrument(string name, IConfigurationManager configurationManager, DriverType driverType = DriverType.Undefined, ILogger logger = null) - { - Info = new InstrumentMetadata - { - ModelNumber = "COECommDevice" - }; - - if(logger == null) - logger = LogManager.GetCurrentClassLogger(); - _logger = logger; - - Status = State.Uninitialized; - DetailedStatus = "COE Uninitialized"; - - Name = name; - - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } - - if (configurationManager == null) - { - _logger.Error($"Cannot create {Name} without a configuration manager"); - return; - } - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _messages = new Dictionary, OeMessage>(); - - _driverType = driverType; - - _coe = new coe(); - } - - public string DetailedStatus { get; protected set; } - - public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } - - public InstrumentMetadata Info { get; set; } - - public string Name { get; protected set; } - - public SelfTestResult SelfTestResult => PerformSelfTest(); - - public State Status { get; set; } - - public bool ClearErrors() - { - return true; - } - - /// - /// Initializes COE instrument - /// - public void Initialize() - { - _logger.Trace($"{Name}({_driverType}) Initializing..."); - - if (_driverType == DriverType.Undefined) - _driverType = _configuration.GetConfigurationValue("Parameters", "DriverType", "TCP"); - - _options.Clear(); - _options.Add("ROUTER_CONFIG", new List> - { - { new KeyValuePair("NODE_ID", _configuration.GetConfigurationValue("ROUTER_CONFIG", "NODE_ID", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_STATE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_STATE", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_LABEL_MESSAGE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_LABEL_MESSAGE", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_BRIDGE_REGISTRATION", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_BRIDGE_REGISTRATION", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_ROUTER_DATABASE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_ROUTER_DATABASE", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - { new KeyValuePair("BUFFER_SIZE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "BUFFER_SIZE", "256")) }, - { new KeyValuePair("ENABLE_REGISTRATION_MESSAGES", _configuration.GetConfigurationValue("ROUTER_CONFIG", "ENABLE_REGISTRATION_MESSAGES", "1")) }, - { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "THREAD_STACK_SIZE", "16384")) }, - }); - - _options.Add("ROUTER_PROTOCOL_CONFIG", new List> - { - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("ROUTER_PROTOCOL_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("ROUTER_PROTOCOL_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("ROUTER_PROTOCOL_CONFIG", "THREAD_STACK_SIZE", "16384")) }, - }); - - var poolEntry = _configuration.GetConfigurationValue("ROUTER_BUFFER_POOLS", "POOL_ENTRY", "100,32|50,128|100,384|150,1536|10,65535"); - if (!string.IsNullOrEmpty(poolEntry)) - { - var poolEntries = poolEntry.Split('|'); - if (poolEntries.Any()) - { - var entries = new List>(); - foreach (var entry in poolEntries) - { - entries.Add(new KeyValuePair("POOL_ENTRY", entry)); - } - _options.Add("ROUTER_BUFFER_POOLS", entries); - } - } - - _options.Add("BASIC_REGISTRATION_CONFIG", new List> - { - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND_BUFFER", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_SEND_BUFFER", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV_BUFFER", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_RECV_BUFFER", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_STATE", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_STATE", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_PING_SEND", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_PING_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_PING_RECV", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_PING_RECV", "0")) }, - { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "THREAD_STACK_SIZE", "16384")) }, - }); - - switch (_driverType) - { - case DriverType.UDP: - _options.Add("UDP_MEDIA_BINDING_CONFIG", new List> - { - { new KeyValuePair("LOCAL_IP_ADDRESS", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "LOCAL_IP_ADDRESS", "127.0.0.1")) }, - { new KeyValuePair("REMOTE_IP_ADDRESS", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "REMOTE_IP_ADDRESS", "127.0.0.1")) }, - { new KeyValuePair("LOCAL_SEND_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "LOCAL_SEND_PORT", "32010")) }, - { new KeyValuePair("LOCAL_RECV_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "LOCAL_RECV_PORT", "32020")) }, - { new KeyValuePair("REMOTE_SEND_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "REMOTE_SEND_PORT", "32011")) }, - { new KeyValuePair("REMOTE_RECV_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "REMOTE_RECV_PORT", "32021")) }, - { new KeyValuePair("RECV_TIMEOUT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "RECV_TIMEOUT", "200")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - { new KeyValuePair("MTU_SIZE", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "MTU_SIZE", "1472")) }, - { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "THREAD_STACK_SIZE", "16384")) }, - { new KeyValuePair("THREAD_NAME", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "THREAD_NAME", "UDP_MB_RCV")) }, - }); - break; - - case DriverType.TCP: - _options.Add("TCP_MEDIA_BINDING_CONFIG", new List> - { - { new KeyValuePair("LOCAL_PORT", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "LOCAL_PORT", "9990")) }, - { new KeyValuePair("NUM_PORTS", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "NUM_PORTS", "32")) }, - { new KeyValuePair("NUM_DYNAMIC_NODES", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "NUM_DYNAMIC_NODES", "32")) }, - { new KeyValuePair("SERVER_ADDRESS", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "SERVER_ADDRESS", "127.0.0.1:9990")) }, - { new KeyValuePair("UDP_TX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "UDP_TX_BUFFER_SIZE", "5000")) }, - { new KeyValuePair("UDP_RX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "UDP_RX_BUFFER_SIZE", "32768")) }, - { new KeyValuePair("TCP_TX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TCP_TX_BUFFER_SIZE", "5000")) }, - { new KeyValuePair("TCP_RX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TCP_RX_BUFFER_SIZE", "4096")) }, - { new KeyValuePair("PACKET_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "PACKET_SIZE", "5128")) }, - { new KeyValuePair("TCP_SELECT_VALUE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TCP_SELECT_VALUE", "1")) }, - { new KeyValuePair("DISABLE_NAG_DELAY", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISABLE_NAG_DELAY", "1")) }, - { new KeyValuePair("TIMER_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TIMER_RATE", "1000")) }, - { new KeyValuePair("CONNECT_KA_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "CONNECT_KA_RATE", "1")) }, - { new KeyValuePair("RECV_KA_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_KA_RATE", "1")) }, - { new KeyValuePair("SERVER_CONNECT_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "SERVER_CONNECT_RATE", "1")) }, - { new KeyValuePair("RECV_THREAD_STACK_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_STACK_SIZE", "4096")) }, - { new KeyValuePair("RECV_THREAD_PRIORITY", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_PRIORITY", "0")) }, - { new KeyValuePair("RECV_THREAD_AFFINITY", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_AFFINITY", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND_BUFFER", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_UDP_RECV", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_UDP_RECV", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_UDP_RECV_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_UDP_RECV_BUFFER", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_TCP_RECV", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_TCP_RECV", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_TCP_RECV_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_TCP_RECV_BUFFER", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV", "1")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV_BUFFER", "1")) }, - }); - break; - - case DriverType.Serial: - _options.Add("SERIAL_MEDIA_BINDING_CONFIG", new List> - { - { new KeyValuePair("DEVICE_NAME", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DEVICE_NAME", "\\\\.\\COM1")) }, - { new KeyValuePair("BAUD_RATE", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "BAUD_RATE", "9600")) }, - { new KeyValuePair("DATA_BITS", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DATA_BITS", "8")) }, - { new KeyValuePair("STOP_BITS", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "STOP_BITS", "1")) }, - { new KeyValuePair("PARITY", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "PARITY", "0")) }, - { new KeyValuePair("FLOW_CONTROL", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "FLOW_CONTROL", "0")) }, - { new KeyValuePair("MTU_SIZE", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "MTU_SIZE", "256")) }, - { new KeyValuePair("RECV_PROCESSING_DELAY", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "RECV_PROCESSING_DELAY", "100")) }, - { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, - { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, - }); - break; - - default: - _logger.Error($"{Name}({_driverType}) Configured driver type not valid"); - break; - } - - _maxMessageSize = _configuration.GetConfigurationValue("Parameters", "MaxMessageSize", "5000"); - _epQueueDepth = _configuration.GetConfigurationValue("Parameters", "EPQueueDepth", "5000"); - _checkForMessageIntervalMs = _configuration.GetConfigurationValue("Parameters", "CheckForMessageIntervalMs", "100"); - - var responseLabels = _configuration.GetConfigurationListValue("ResponseMessageIds", "ResponseLabel", new List { "1", "2" }); - - var bitFilePaths = _configuration.GetConfigurationListValue("BitFilePaths", "FilePath", new List { "File1", "File2" }); - - _xmlDocs.Clear(); - foreach (var path in bitFilePaths) - { - _xmlDocs.Add(path, new MessageXmlDocument(path, _logger)); - } - - _icds.Clear(); - foreach (var path in bitFilePaths) - { - _icds.Add(path, ProcessFileForNamesAndLabels(path)); - } - - foreach (var strLabel in responseLabels) - { - uint label = GetLabelFromMessageId(strLabel); - if(label > 0) - _responseLabels.Add(label); - } - - DetailedStatus = "COE Initialized"; - Status = State.Ready; - } - - /// - /// performs self-test - /// - /// - public SelfTestResult PerformSelfTest() - { - _logger.Trace($"{Name}({_driverType}) Performing Self Test..."); - - // TODO implement method - return SelfTestResult.Pass; - } - - /// - /// Resets COE device comms - /// - /// - public void Reset() - { - _logger.Trace($"{Name}({_driverType}) Resetting..."); - - Close(); - - Open(); - } - - /// - /// Shuts down COE device - /// - public void Shutdown() - { - _logger.Trace($"{Name}({_driverType}) Shutting Down..."); - - try - { - Close(); - - //coe.UnloadImportedDll("coeWindows-shared.dll"); - } - catch (Exception ex) - { - _logger.Error(ex, $"{Name}({_driverType}) Error while closing"); - } - } - - #region ICommDevice functions - /// - /// Opens COE connection - /// - /// - public void Open() - { - _logger.Trace($"{Name}({_driverType}) Opening..."); - - try - { - switch (_driverType) - { - case DriverType.TCP: - - if (_coe.tcp_media_binding_configure(_options, _logger) != coe.Status.SUCCESS) - { - _logger.Error($"{Name}({_driverType}) COE TCP media binding initialization failure.\nTry checking your connection configuration.\nYou could have a port collision."); - Status = State.CommunicationFailure; - throw new Exception($"{Name}({_driverType}) COE TCP media binding initialization failure"); - } - _logger.Trace($"{Name}({_driverType}) COE TCP media binding initialization, {_coe.ProtocolCmitName}"); - break; - case DriverType.UDP: - if (_coe.udp_media_binding_configure(_options, _logger) != coe.Status.SUCCESS) - { - _logger.Error($"{Name}({_driverType}) COE UDP media binding initialization failure.\nTry checking your connection configuration.\nYou could have a port collision."); - Status = State.CommunicationFailure; - throw new Exception($"{Name}({_driverType}) COE UDP media binding initialization failure"); - } - _logger.Trace($"{Name}({_driverType}) COE UDP media binding initialization, Local: {_coe.ProtocolCmitName} Remote: {_coe.ProtocolName}"); - break; - case DriverType.Serial: - if (_coe.serial_media_binding_configure(_options, _logger) != coe.Status.SUCCESS) - { - _logger.Error($"{Name}({_driverType}) COE Serial media binding initialization failure.\nTry checking your connection configuration.\nYou could have a port collision."); - Status = State.CommunicationFailure; - throw new Exception($"{Name}({_driverType}) COE Serial media binding initialization failure"); - } - _logger.Trace($"{Name}({_driverType}) COE Serial media binding initialization, {_coe.ProtocolCmitName}"); - break; - default: - _logger.Error($"{Name}({_driverType}) Configured driver type not valid"); - throw new Exception($"{Name}({_driverType}) Configured driver type not valid"); - } - - foreach (var item in _options) - { - _logger.Trace($"{item.Key}:"); - foreach (var pair in item.Value) - { - _logger.Trace(string.Format("{0,-50} {1, -40}", pair.Key, pair.Value)); - } - } - - } - catch (Exception ex) - { - _logger.Error(ex); - Status = State.CommunicationFailure; - DetailedStatus = "Unable to Open"; - throw; - } - - try - { - _coe.SetConnected(true); - - //_endpoint = new coeEndpoint(_maxMessageSize, _epQueueDepth, coe.Router); - _endpoint = new coeEndpoint(_maxMessageSize, _epQueueDepth); - - _logger.Info($"{Name}({_driverType}) Endpoint Created, Max Message Size: {_maxMessageSize}, Queue Depth: {_epQueueDepth}"); - - foreach (var item in _responseLabels) - { - var fileName = WhichFileContainsTheLabel(item); - if (!string.IsNullOrEmpty(fileName)) - { - var msgName = _icds[fileName][item]; - if (!string.IsNullOrEmpty(msgName)) - { - _endpoint.Register(item); - _logger.Debug($"{Name}({_driverType}) Registering new message with the endpoint, {item}: {msgName}"); - } - else - { - _logger.Warn($"{Name}({_driverType}) Message with label {item} is not located in file {fileName}"); - } - } - else - { - _logger.Warn($"{Name}({_driverType}) Unable to locate label {item} in any of the XML files registered for COE device"); - } - } - - _cancellationTokenSource = new CancellationTokenSource(); - Task.Run(() => ReadMessages(_cancellationTokenSource.Token)); - - DetailedStatus = "Opened"; - } - catch (Exception ex) - { - Status = State.CommunicationFailure; - DetailedStatus = "Unable to Open"; - _logger.Error(ex); - throw; - } - } - - /// - /// Close COE endpoint - /// - /// - public void Close() - { - _logger.Trace($"{Name}({_driverType}) Closing ..."); - - _cancellationTokenSource?.Cancel(); - - Thread.Sleep(1000); - - lock (this) - { - _messages.Clear(); - } - - _coe.SetConnected(false); - var status = _driverType == DriverType.TCP ? - _coe.TCP_media_binding_shutdown(_logger) : _driverType == DriverType.UDP ? - _coe.UDP_media_binding_shutdown(_logger) : _coe.SERIAL_media_binding_shutdown(_logger); - - if (status != coe.Status.SUCCESS) - { - _logger.Error($"{_driverType} media binding shutdown failure, status {status}"); - } - else - { - _logger.Debug($"{_driverType} shutdown was successful"); - } - - _endpoint?.Dispose(); - - _cancellationTokenSource?.Dispose(); - _cancellationTokenSource = null; - - Status = State.Uninitialized; - DetailedStatus = "COE Closed"; - } - - /// - /// sets the timeout value for COE reading operation - /// - /// - /// - public void SetReadTimeout(uint timeout) - { - _logger.Trace($"{Name}({_driverType}) Setting read timeout {timeout} ms ..."); - - _receiverTimeout = timeout; - } - - /// - /// reads COE message either based on the label or just top message - /// - /// - /// might contain a COE label - /// - /// - public uint Read(ref byte[] dataRead) - { - _logger.Trace($"{Name}({_driverType}) Reading ..."); - - if (!_coe.IsConnected) - { - _logger.Error("Error reading COE message, COE not connected"); - return 0; - } - - // if the label was provided in the byte array use it to locate the first message with that name - // else just fetch the top message - var label = FromByteArrayToXml(dataRead); - KeyValuePair, OeMessage> message; - - lock (this) - { - message = string.IsNullOrEmpty(label) ? _messages.FirstOrDefault() : _messages.FirstOrDefault(m => m.Key.Item1 == label); - } - - if (message.Value != null) - { - // make a copy of the buffer - var buffer = message.Value.GetManagedBuffer(); - if(buffer != null) - { - Array.Copy(buffer, 0, dataRead, 0, buffer.Length); - - lock (this) - { - if (!_messages.Remove(message.Key)) - _logger.Warn($"{Name}({_driverType}) Unable to remove a message from the dictionary, label = {message.Key}"); - } - } - else - { - _logger.Error($"{Name}({_driverType}) Found a message with label {label}, but the Buffer is empty"); - return 0; - } - } - else - { - _logger.Error(string.IsNullOrEmpty(label) ? $"{Name}({_driverType}) No messages available to read at this time" : $"{Name}({_driverType}) Unable to find message with label {label}"); - return 0; - } - - return (uint)dataRead.Length; - } - - /// - /// keep reading messages and stash them in _messages dictionary with label and timestamp as a key - /// - /// - /// - private void ReadMessages(CancellationToken cancellationToken) - { - _logger.Debug($"{Name}({_driverType}) Starting to read messages."); - - try - { - while (!cancellationToken.IsCancellationRequested) - { - _logger.Debug($"{Name}({_driverType}) Checking for messages..."); - var status = _endpoint.Wait(1000); - - if (status == coe.Status.SUCCESS) - { - _logger.Debug($"{Name}({_driverType}) Message Received..."); - - while (_endpoint.Peek(out uint label, out uint size, out int priority) == coe.Status.SUCCESS) - { - _logger.Debug($"{Name}({_driverType}) Identified message by peeking..."); - - var xmlDoc = WhichFileContainsTheLabel(label); - - var message = new OeMessage((int)size + 1) - { - XmlMessage = new Message(_xmlDocs[xmlDoc], label.ToString()) - }; - - status = _endpoint.Receive(message); - - if (status == coe.Status.SUCCESS) - { - _logger.Debug($"{Name}({_driverType}) Successfully read message..."); - lock (this) - { - _messages.Add(new Tuple(message.Label, DateTime.Now), message); - } - } - else - { - _logger.Error($"{Name}({_driverType}) Endpoint Receive Failed. Status = {status}"); - } - } - } - // If not timeout and no cancellation requested - else if (status != coe.Status.FAILED_TIMEOUT && !cancellationToken.IsCancellationRequested) - { - _logger.Error($"{Name}({_driverType}) Event Flag Wait Failed. Status = {status}"); - } - } - _logger.Debug($"{Name}({_driverType}) Stopping to read messages. Cancellation was requested."); - } - catch (Exception ex) - { - _logger.Error(ex); - } - } - - /// - /// Writes COE message - /// - /// - /// - /// - public uint Write(byte[] data, uint numBytesToWrite) - { - _logger.Debug($"{Name}({_driverType}) Starting to write messages."); - - if (!_coe.IsConnected) - { - _logger.Error($"{Name}({_driverType}) Error sending COE message, COE not connected"); - return (uint)coe.Status.FAILED_NOT_ENABLED; - } - - try - { - var xmlData = FromByteArrayToXml(data); - var messageName = GetMessageNameFromXml(xmlData); - var message = new OeMessage(new Message(messageName, new MessageXmlDocument(xmlData, _logger))); - - //var status = _endpoint.Send(message, (uint)(_driverType == DriverType.TCP ? 0x01 : 0)); - var status = _endpoint.Send(message); - - if (status != coe.Status.SUCCESS) - { - _logger.Error($"{Name}({_driverType}) Error sending COE message, error code: {status}"); - } - - return status == coe.Status.ERROR ? (uint)coe.Status.FAILED_INTERNAL_ERROR : (uint)status; - } - catch (Exception ex) - { - _logger.Error(ex, $"{Name}({_driverType}) Error while writing a message"); - return (uint)coe.Status.FAILED_INTERNAL_ERROR; - } - } - #endregion - - /// - /// if byte array contains byte representation of XML then returns XML string - /// else returns empty string - /// - /// - /// - private static string FromByteArrayToXml(byte[] data) => System.Text.Encoding.Default.GetString(data); - private static byte[] FromStringToByteArray(string data) => System.Text.Encoding.UTF8.GetBytes(data); - - /// - /// Extract message node from XML for the OeMessage class - /// - /// - /// - private string GetMessageNameFromXml(string xmlData) - { - var doc = new XPathDocument(xmlData); - XPathNavigator navigator = doc.CreateNavigator(); - - var nodeset = navigator.Select("//@Message"); - - nodeset.MoveNext(); - - return nodeset.Current.InnerXml; - } - - /// - /// if message id can be converted to uint returns the value - /// otherwise returns the related label from the message id by dictionary lookup - /// - /// - /// - private uint GetLabelFromMessageId(string messageId) - { - uint labelId = FromStringToUint(messageId); - - if (labelId == 0) - { - foreach (var file in _icds) - { - var item = file.Value.FirstOrDefault(l => l.Value == messageId); - if (!string.IsNullOrEmpty(item.Value)) - return item.Key; - } - } - - return labelId; - } - /// - /// return file path for the file that contains the label - /// - /// - /// - private string WhichFileContainsTheLabel(uint label) - { - foreach (var item in _icds) - { - if (item.Value.Keys.Contains(label)) - { - return item.Key; - } - } - return string.Empty; - } - - /// - /// reads xml file and extracts all message names with associated labels - /// - /// - /// - private Dictionary ProcessFileForNamesAndLabels(string filePath) - { - var doc = new XPathDocument(filePath); - - XPathNavigator node = doc.CreateNavigator(); - XPathNodeIterator nodeset = node.Select("interface/message"); - - var result = new Dictionary(); - - while (nodeset.MoveNext()) - { - var children = nodeset.Current.SelectChildren(XPathNodeType.Element); - if (children.Count > 0) - { - string strName = string.Empty; - string strLabel = string.Empty; - - while (children.MoveNext()) - { - if (children.Current.Name == "name") - { - strName = children.Current.Value; - if (!string.IsNullOrEmpty(strName)) - strName = strName.Trim(); - } - else if (children.Current.Name == "label") - { - strLabel = children.Current.Value; - if (!string.IsNullOrEmpty(strLabel)) - strLabel = strLabel.Trim(); - } - } - - uint iLabel = FromStringToUint(strLabel); - - if (!string.IsNullOrEmpty(strName) && iLabel > 0) - { - result.Add(iLabel, strName); - } - } - } - return result; - } - - /// - /// converts from string representation of a label to uint value - /// - /// - /// - private uint FromStringToUint(string data) - { - if(!string.IsNullOrEmpty(data)) - { - if (data.StartsWith("0x", StringComparison.CurrentCultureIgnoreCase) || data.StartsWith("&H", StringComparison.CurrentCultureIgnoreCase)) - { - if (uint.TryParse(data.Substring(2), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out uint uiValue)) - return uiValue; - } - else - { - if (uint.TryParse(data, out uint uiValuel)) - return uiValuel; - } - } - return 0; - } - } -} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/ConfigurationHelper.cs b/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/ConfigurationHelper.cs deleted file mode 100644 index b18c884..0000000 --- a/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/ConfigurationHelper.cs +++ /dev/null @@ -1,135 +0,0 @@ -// ********************************************************************************************************** -// ConfigurationHelper.cs -// 7/5/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** - -using Raytheon.Common; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Xml.Linq; - -namespace Raytheon.Instruments -{ - /// - /// type conversion utility with a special case for enums - /// - public static class TypeConverter - { - public static T ChangeType(object value) - { - return typeof(T).IsEnum ? (T)Enum.Parse(typeof(T), value.ToString()) : (T)ChangeType(typeof(T), value); - } - - public static object ChangeType(Type t, object value) - { - System.ComponentModel.TypeConverter tc = TypeDescriptor.GetConverter(t); - return tc.ConvertFrom(value); - } - - public static void RegisterTypeConverter() where TC : System.ComponentModel.TypeConverter - { - TypeDescriptor.AddAttributes(typeof(T), new TypeConverterAttribute(typeof(TC))); - } - } - - /// - /// Helper class contains extension fictions for reading types other than strings from configuration, - /// as well as reading lists of values - /// - public static class ConfigurationHelper - { - /// - /// template function for reading different types from configuration - /// - /// - /// - /// - /// - /// - public static T GetConfigurationValue(this IConfiguration configuration, string section, string key, string defaultValue) - { - var tmpResult = configuration.GetConfigurationValue(section, key, defaultValue); - return !string.IsNullOrEmpty(tmpResult) ? TypeConverter.ChangeType(tmpResult) : default; - } - - /// - /// returns multi-value result (list of T) from configuration - /// - /// - /// - /// - /// - /// - public static List GetConfigurationListValue(this IConfiguration configuration, string section, string key, List defaultValue) - { - var tmpResult = configuration.GetXmlConfiguration(section); - if (string.IsNullOrEmpty(tmpResult)) - { - var xmlStr = new StringBuilder(); - xmlStr.Append($"<{key}s>"); - foreach (var item in defaultValue) - { - xmlStr.Append($"<{key}>"); - xmlStr.Append(item.ToString()); - xmlStr.Append($""); - } - xmlStr.Append($""); - - configuration.SetXmlConfiguration(section, xmlStr.ToString()); - return defaultValue; - } - else - { - var stringRes = BuildElementListFromXml(tmpResult, key); - return new List(stringRes.Select(x => TypeConverter.ChangeType(x))); - } - } - - /// - /// returns values from XML section converted to string list - /// - /// - /// - /// - private static List BuildElementListFromXml(string data, string key) - { - XElement doc = XElement.Parse(data); - IEnumerable xmlMessages = from m - in doc.Elements($"{key}s").Elements(key) - select m; - var messages = xmlMessages.Select(x => x.Value); - return messages?.ToList(); - } - } -} diff --git a/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/CoeCommDevice.cs b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/CoeCommDevice.cs new file mode 100644 index 0000000..24732f7 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/CoeCommDevice.cs @@ -0,0 +1,1247 @@ +// ********************************************************************************************************** +// BITCOEDeviceInstrument.cs +// 6/21/2022 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using System.Xml.Linq; +using System.Xml.XPath; +using NLog; +using Raytheon.Common; +using Raytheon.Common.Coe; +using Raytheon.Instruments.Exceptions; +using static Raytheon.Common.Coe.Message; + +namespace Raytheon.Instruments +{ + /// + /// This device supports different ways of communicating with other COE nodes + /// TCP + /// UDP + /// Serial + /// + public enum CoeDriverType + { + Undefined, + TCP, + UDP, + Serial + }; + + /// + /// Implementation of the IBit interface + /// + public class CoeCommDevice : CoeComm + { + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + /// + /// reference to the main wrapper class for Common Operating Environment + /// + private readonly coe _coe; + + /// + /// COE endpoint + /// + private coeEndpoint _endpoint; + + /// + /// cancellation token for stopping reading thread + /// + private CancellationTokenSource _cancellationTokenSource = null; + + /// + /// collection of the messages received + /// + private Dictionary>> _messages; + + // Record the time of when a message was logged, so we can slow down logging + // For high-rate message, if we don't slow down logging, it will starve other threads from logging + // and therefore lose logging data + private Dictionary _messageLogTime = new Dictionary(); + // Keep track of the log interval in seconds for each message + private Dictionary _messageLogIntervalInSec = new Dictionary(); + // Keep track whether or not to log for each message + private Dictionary _messageLogging = new Dictionary(); + + // Record the time of when "Message Received" was logged + private DateTime? _messageReceivedLogTime = null; + // Keep track of the log interval in seconds for "Message Received" notification + private int _messageReceivedLogIntervalInSec = 0; + + /// + /// UDP, TCP, Serial or Undefined + /// + private CoeDriverType _driverType; + + /// + /// dictionary of options when initializing COE endpoint and router + /// + private readonly Dictionary>> _options = new Dictionary>>(); + + /// + /// used for initialization of the endpoint + /// + private uint _maxMessageSize; + private uint _epQueueDepth; + + /// + /// Number of milliseconds to wake up and check the message when receiving + /// + private int _checkForMessageIntervalMs; + + /// + /// collection of all labels with message names per every XML file + /// + private readonly Dictionary> _icds = new Dictionary>(); + + /// + /// collection of response labels or messages that COE endpoint should be registered for + /// + private readonly List _responseLabels = new List(); + + /// + /// collection of message XML documents (processed XML files) used in COE communications + /// + private readonly Dictionary _xmlDocs = new Dictionary(); + + /// + /// when set to true the instrument will check every value and if empty + /// will populate it with the default value + /// + private bool _alwaysSendDefaults; + + private int _maxQueueSizeForEachMessage = 100; + + /// + /// instrument constructor + /// + public CoeCommDevice(string deviceName, IConfigurationManager configurationManager) + { + Info = new InstrumentMetadata + { + ModelNumber = "COECommDevice" + }; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + Status = State.Uninitialized; + DetailedStatus = "COE Uninitialized"; + + Name = deviceName; + + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + if (configurationManager == null) + { + _logger.Error($"Cannot create {Name} without a configuration manager"); + return; + } + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _messages = new Dictionary>>(); + + _coe = new coe(); + } + + ~CoeCommDevice() + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); + } + + public string DetailedStatus { get; protected set; } + + public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } + + public InstrumentMetadata Info { get; set; } + + public string Name { get; protected set; } + + public SelfTestResult SelfTestResult => PerformSelfTest(); + + public State Status { get; set; } + + public bool ClearErrors() + { + return true; + } + + /// + /// Initializes COE instrument + /// + public void Initialize() + { + _driverType = _configuration.GetConfigurationValue("Parameters", "DriverType"); + + _logger.Debug($"{Name}({_driverType}) Initializing..."); + + _alwaysSendDefaults = _configuration.GetConfigurationValue("Parameters", "AlwaysSendDefaults"); + + _options.Clear(); + _options.Add("ROUTER_CONFIG", new List> + { + { new KeyValuePair("NODE_ID", _configuration.GetConfigurationValue("ROUTER_CONFIG", "NODE_ID", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_STATE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_STATE", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_LABEL_MESSAGE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_LABEL_MESSAGE", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_BRIDGE_REGISTRATION", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_BRIDGE_REGISTRATION", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_ROUTER_DATABASE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_ROUTER_DATABASE", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("ROUTER_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, + { new KeyValuePair("BUFFER_SIZE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "BUFFER_SIZE", "256")) }, + { new KeyValuePair("ENABLE_REGISTRATION_MESSAGES", _configuration.GetConfigurationValue("ROUTER_CONFIG", "ENABLE_REGISTRATION_MESSAGES", "1")) }, + { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("ROUTER_CONFIG", "THREAD_STACK_SIZE", "16384")) }, + { new KeyValuePair("TRANSMIT_OPTIONS", _configuration.GetConfigurationValue("ROUTER_CONFIG", "TRANSMIT_OPTIONS", "0")) }, + }); + + _options.Add("ROUTER_PROTOCOL_CONFIG", new List> + { + { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("ROUTER_PROTOCOL_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("ROUTER_PROTOCOL_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, + { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("ROUTER_PROTOCOL_CONFIG", "THREAD_STACK_SIZE", "16384")) }, + }); + + var poolEntry = _configuration.GetConfigurationValue("ROUTER_BUFFER_POOLS", "POOL_ENTRY", "100,32|50,128|100,384|150,1536|10,65535"); + if (!string.IsNullOrEmpty(poolEntry)) + { + var poolEntries = poolEntry.Split('|'); + if (poolEntries.Any()) + { + var entries = new List>(); + foreach (var entry in poolEntries) + { + entries.Add(new KeyValuePair("POOL_ENTRY", entry)); + } + _options.Add("ROUTER_BUFFER_POOLS", entries); + } + } + + _options.Add("BASIC_REGISTRATION_CONFIG", new List> + { + { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_SEND_BUFFER", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_SEND_BUFFER", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_RECV_BUFFER", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_RECV_BUFFER", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_STATE", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_STATE", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_PING_SEND", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_PING_SEND", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_PING_RECV", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "DISPLAY_DEBUG_PING_RECV", "0")) }, + { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("BASIC_REGISTRATION_CONFIG", "THREAD_STACK_SIZE", "16384")) }, + }); + + switch (_driverType) + { + case CoeDriverType.UDP: + _options.Add("UDP_MEDIA_BINDING_CONFIG", new List> + { + { new KeyValuePair("LOCAL_IP_ADDRESS", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "LOCAL_IP_ADDRESS", "127.0.0.1")) }, + { new KeyValuePair("REMOTE_IP_ADDRESS", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "REMOTE_IP_ADDRESS", "127.0.0.1")) }, + { new KeyValuePair("LOCAL_SEND_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "LOCAL_SEND_PORT", "32010")) }, + { new KeyValuePair("LOCAL_RECV_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "LOCAL_RECV_PORT", "32020")) }, + { new KeyValuePair("REMOTE_SEND_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "REMOTE_SEND_PORT", "32011")) }, + { new KeyValuePair("REMOTE_RECV_PORT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "REMOTE_RECV_PORT", "32021")) }, + { new KeyValuePair("RECV_TIMEOUT", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "RECV_TIMEOUT", "200")) }, + { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, + { new KeyValuePair("MTU_SIZE", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "MTU_SIZE", "1472")) }, + { new KeyValuePair("THREAD_STACK_SIZE", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "THREAD_STACK_SIZE", "16384")) }, + { new KeyValuePair("THREAD_NAME", _configuration.GetConfigurationValue("UDP_MEDIA_BINDING_CONFIG", "THREAD_NAME", "UDP_MB_RCV")) }, + }); + break; + + case CoeDriverType.TCP: + _options.Add("TCP_MEDIA_BINDING_CONFIG", new List> + { + { new KeyValuePair("LOCAL_PORT", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "LOCAL_PORT", "9990")) }, + { new KeyValuePair("NUM_PORTS", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "NUM_PORTS", "32")) }, + { new KeyValuePair("NUM_DYNAMIC_NODES", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "NUM_DYNAMIC_NODES", "32")) }, + { new KeyValuePair("SERVER_ADDRESS", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "SERVER_ADDRESS", "127.0.0.1:9990")) }, + { new KeyValuePair("UDP_TX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "UDP_TX_BUFFER_SIZE", "5000")) }, + { new KeyValuePair("UDP_RX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "UDP_RX_BUFFER_SIZE", "32768")) }, + { new KeyValuePair("TCP_TX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TCP_TX_BUFFER_SIZE", "5000")) }, + { new KeyValuePair("TCP_RX_BUFFER_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TCP_RX_BUFFER_SIZE", "4096")) }, + { new KeyValuePair("PACKET_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "PACKET_SIZE", "5128")) }, + { new KeyValuePair("TCP_SELECT_VALUE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TCP_SELECT_VALUE", "1")) }, + { new KeyValuePair("DISABLE_NAG_DELAY", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISABLE_NAG_DELAY", "1")) }, + { new KeyValuePair("TIMER_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "TIMER_RATE", "1000")) }, + { new KeyValuePair("CONNECT_KA_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "CONNECT_KA_RATE", "1")) }, + { new KeyValuePair("RECV_KA_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_KA_RATE", "1")) }, + { new KeyValuePair("SERVER_CONNECT_RATE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "SERVER_CONNECT_RATE", "1")) }, + { new KeyValuePair("RECV_THREAD_STACK_SIZE", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_STACK_SIZE", "4096")) }, + { new KeyValuePair("RECV_THREAD_PRIORITY", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_PRIORITY", "0")) }, + { new KeyValuePair("RECV_THREAD_AFFINITY", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "RECV_THREAD_AFFINITY", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND", "1")) }, + { new KeyValuePair("DISPLAY_DEBUG_SEND_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND_BUFFER", "1")) }, + { new KeyValuePair("DISPLAY_DEBUG_UDP_RECV", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_UDP_RECV", "1")) }, + { new KeyValuePair("DISPLAY_DEBUG_UDP_RECV_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_UDP_RECV_BUFFER", "1")) }, + { new KeyValuePair("DISPLAY_DEBUG_TCP_RECV", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_TCP_RECV", "1")) }, + { new KeyValuePair("DISPLAY_DEBUG_TCP_RECV_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_TCP_RECV_BUFFER", "1")) }, + { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV", "1")) }, + { new KeyValuePair("DISPLAY_DEBUG_RECV_BUFFER", _configuration.GetConfigurationValue("TCP_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV_BUFFER", "1")) }, + }); + break; + + case CoeDriverType.Serial: + _options.Add("SERIAL_MEDIA_BINDING_CONFIG", new List> + { + { new KeyValuePair("DEVICE_NAME", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DEVICE_NAME", "\\\\.\\COM1")) }, + { new KeyValuePair("BAUD_RATE", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "BAUD_RATE", "9600")) }, + { new KeyValuePair("DATA_BITS", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DATA_BITS", "8")) }, + { new KeyValuePair("STOP_BITS", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "STOP_BITS", "1")) }, + { new KeyValuePair("PARITY", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "PARITY", "0")) }, + { new KeyValuePair("FLOW_CONTROL", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "FLOW_CONTROL", "0")) }, + { new KeyValuePair("MTU_SIZE", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "MTU_SIZE", "256")) }, + { new KeyValuePair("RECV_PROCESSING_DELAY", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "RECV_PROCESSING_DELAY", "100")) }, + { new KeyValuePair("DISPLAY_DEBUG_SEND", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_SEND", "0")) }, + { new KeyValuePair("DISPLAY_DEBUG_RECV", _configuration.GetConfigurationValue("SERIAL_MEDIA_BINDING_CONFIG", "DISPLAY_DEBUG_RECV", "0")) }, + }); + break; + + default: + _logger.Error($"{Name}({_driverType}) Configured driver type not valid"); + break; + } + + _maxMessageSize = _configuration.GetConfigurationValue("Parameters", "MaxMessageSize"); + _epQueueDepth = _configuration.GetConfigurationValue("Parameters", "EPQueueDepth"); + _checkForMessageIntervalMs = _configuration.GetConfigurationValue("Parameters", "CheckForMessageIntervalMs"); + + RaytheonXmlConfigurationWrapper rayConfigWrapper; + + rayConfigWrapper = new RaytheonXmlConfigurationWrapper(_configuration.GetXmlConfiguration("MaxQueueSizePerResponseMsg")); + int.TryParse(rayConfigWrapper.GetValue("/"), out _maxQueueSizeForEachMessage); + + rayConfigWrapper = new RaytheonXmlConfigurationWrapper(_configuration.GetXmlConfiguration("IncomingMessageNotificationIntervalInSec")); + int.TryParse(rayConfigWrapper.GetValue("/"), out _messageReceivedLogIntervalInSec); + + var responseLabels = _configuration.GetConfigurationListValue("ResponseMessageIds", "ResponseLabel", new List { "1", "2" }); + + var coeXmlFiles = _configuration.GetConfigurationListValue("CoeXmlFiles", "FilePath", new List { "File1", "File2" }); + + _xmlDocs.Clear(); + foreach (var file in coeXmlFiles) + { + string fileFullPath = Path.Combine(_configurationManager.ConfigurationStoragePath, file); + fileFullPath = Path.GetFullPath(fileFullPath); + + _xmlDocs.Add(fileFullPath, new MessageXmlDocument(fileFullPath)); + } + + _icds.Clear(); + foreach (var file in coeXmlFiles) + { + string fileFullPath = Path.Combine(_configurationManager.ConfigurationStoragePath, file); + fileFullPath = Path.GetFullPath(fileFullPath); + + _icds.Add(fileFullPath, ProcessFileForNamesAndLabels(fileFullPath)); + } + + foreach (var strLabel in responseLabels) + { + uint label = GetLabelFromMessageId(strLabel); + if (label > 0) + _responseLabels.Add(label); + } + + rayConfigWrapper = new RaytheonXmlConfigurationWrapper(_configuration.GetXmlConfiguration("MessageLogOptions")); + XNode xNode = rayConfigWrapper.GetXElement("/Message/"); + while (xNode != null) + { + if (xNode.NodeType != System.Xml.XmlNodeType.Element) + { + xNode = xNode.NextNode; + continue; + } + + string attrName = "LogIntervalInSec"; + uint label = GetLabelFromMessageId(((XElement)xNode).Value); + if (((XElement)xNode).Attribute(attrName) != null) + { + if (int.TryParse(((XElement)xNode).Attribute(attrName).Value, out int numSecs)) + { + if (!_messageLogTime.ContainsKey(label.ToString())) + { + _messageLogTime[label.ToString()] = null; + _messageLogIntervalInSec[label.ToString()] = numSecs; + } + } + } + + attrName = "Log"; + if (((XElement)xNode).Attribute(attrName) != null) + { + if (bool.TryParse(((XElement)xNode).Attribute(attrName).Value, out bool logMessage)) + { + if (!_messageLogging.ContainsKey(label.ToString())) + _messageLogging[label.ToString()] = logMessage; + } + } + + xNode = xNode.NextNode; + } + + DetailedStatus = "COE Initialized"; + Status = State.Ready; + } + + /// + /// performs self-test + /// + /// + public SelfTestResult PerformSelfTest() + { + _logger.Trace($"{Name}({_driverType}) Performing Self Test..."); + + // TODO implement method + return SelfTestResult.Pass; + } + + /// + /// Resets COE device comms + /// + /// + public void Reset() + { + _logger.Trace($"{Name}({_driverType}) Resetting..."); + + Close(); + + Open(); + } + + /// + /// Shuts down COE device + /// + public void Shutdown() + { + _logger.Debug($"{Name}({_driverType}) Shutting Down..."); + try + { + Close(); + //coe.UnloadImportedDll("coeWindows-shared.dll"); + } + catch (Exception ex) + { + _logger.Error(ex, $"{Name}({_driverType}) Error while closing"); + } + } + + /// + /// Opens COE connection + /// + /// + public void Open() + { + _logger.Debug($"{Name}({_driverType}) Opening..."); + + try + { + switch (_driverType) + { + case CoeDriverType.TCP: + + if (_coe.tcp_media_binding_configure(_options, _logger) != coe.Status.SUCCESS) + { + Status = State.CommunicationFailure; + throw new CoeNotConnectedException($"{Name}({_driverType}) COE TCP media binding initialization failure. Try checking your connection configuration. You could have a port collision."); + } + _logger.Info($"{Name}({_driverType}) COE TCP media binding initialization, {_coe.ProtocolCmitName}"); + break; + case CoeDriverType.UDP: + if (_coe.udp_media_binding_configure(_options, _logger) != coe.Status.SUCCESS) + { + Status = State.CommunicationFailure; + throw new CoeNotConnectedException($"{Name}({_driverType}) COE UDP media binding initialization failure. Try checking your connection configuration. You could have a port collision."); + } + _logger.Info($"{Name}({_driverType}) COE UDP media binding initialization, Local: {_coe.ProtocolCmitName} Remote: {_coe.ProtocolName}"); + break; + case CoeDriverType.Serial: + if (_coe.serial_media_binding_configure(_options, _logger) != coe.Status.SUCCESS) + { + Status = State.CommunicationFailure; + throw new CoeNotConnectedException($"{Name}({_driverType}) COE Serial media binding initialization failure. Try checking your connection configuration. You could have a port collision."); + } + _logger.Info($"{Name}({_driverType}) COE Serial media binding initialization, {_coe.ProtocolCmitName}"); + break; + default: + throw new CoeNotConnectedException($"{Name}({_driverType}) Configured driver type not valid"); + } + + foreach (var item in _options) + { + int keyMaxCharLength = 40; + foreach (var pair in item.Value) + { + int keyCharPadding = keyMaxCharLength - pair.Key.Length; + string keyStr = pair.Key; + if (keyCharPadding > 0) + { + for (int i = 0; i < keyCharPadding; i++) + { + keyStr += "_"; + } + } + + _logger.Info($"{keyStr}{pair.Value}"); + } + } + + } + catch (Exception) + { + Status = State.CommunicationFailure; + DetailedStatus = "Unable to Open"; + throw; + } + + try + { + _coe.SetConnected(true); + + //_endpoint = new coeEndpoint(_maxMessageSize, _epQueueDepth, _coe.Router); + _endpoint = new coeEndpoint(_maxMessageSize, _epQueueDepth); + + _logger.Info($"{Name}({_driverType}) Endpoint Created, Max Message Size: {_maxMessageSize}, Queue Depth: {_epQueueDepth}"); + + foreach (var item in _responseLabels) + { + var fileName = WhichFileContainsTheLabel(item); + if (!string.IsNullOrEmpty(fileName)) + { + var msgName = _icds[fileName][item]; + if (!string.IsNullOrEmpty(msgName)) + { + _endpoint.Register(item); + _logger.Info($"{Name}({_driverType}) Registering new message with the endpoint, {item}: {msgName}"); + } + else + { + _logger.Warn($"{Name}({_driverType}) Message with label {item} is not located in file {fileName}"); + } + } + else + { + _logger.Warn($"{Name}({_driverType}) Unable to locate label {item} in any of the XML files registered for COE device"); + } + } + + _cancellationTokenSource = new CancellationTokenSource(); + Task.Run(() => ReadMessages(_cancellationTokenSource.Token)); + + Status = State.Ready; + DetailedStatus = "Opened"; + } + catch (Exception) + { + Status = State.CommunicationFailure; + DetailedStatus = "Unable to Open"; + throw; + } + } + + /// + /// Close COE endpoint + /// + /// + public void Close() + { + _logger.Debug($"{Name}({_driverType}) Closing ..."); + + Status = State.Uninitialized; + + _cancellationTokenSource?.Cancel(); + + Thread.Sleep(1000); + + _messages.Clear(); + + _coe.SetConnected(false); + var status = _driverType == CoeDriverType.TCP ? + _coe.TCP_media_binding_shutdown(_logger) : _driverType == CoeDriverType.UDP ? + _coe.UDP_media_binding_shutdown(_logger) : _coe.SERIAL_media_binding_shutdown(_logger); + + if (status != coe.Status.SUCCESS) + { + _logger.Error($"{_driverType} media binding shutdown failure, status {status}"); + } + else + { + _logger.Debug($"{_driverType} shutdown was successful"); + } + + _endpoint?.Dispose(); + + _cancellationTokenSource?.Dispose(); + _cancellationTokenSource = null; + + DetailedStatus = "Closed"; + } + + /// + /// Send a message + /// + /// + /// + /// + /// + /// + public bool SendMessage(string messageId, IEnumerable> messageParams) + { + if (!_coe.IsConnected) + { + throw new CoeNotConnectedException(); + } + + if (Status != State.Ready) + { + throw new Exception("COE is not initialized"); + } + + var label = GetLabelFromMessageId(messageId); + + var coeXmlFile = WhichFileContainsTheLabel(label); + if (string.IsNullOrEmpty(coeXmlFile)) + { + var msg = $"Message Id {messageId} not found in any of the COE XML files"; + throw new CoeParseException(msg); + } + + try + { + bool logData = true; + if (_messageLogging.ContainsKey(label.ToString())) + { + if (!_messageLogging[label.ToString()]) + { + logData = false; + } + } + + if (logData && _messageLogTime.ContainsKey(label.ToString())) + { + if (_messageLogTime[label.ToString()] != null) + { + logData = false; + + double elapsedSecs = DateTime.Now.Subtract((DateTime)_messageLogTime[label.ToString()]).TotalSeconds; + + if (elapsedSecs >= (double)_messageLogIntervalInSec[label.ToString()]) + { + logData = true; + + _messageLogTime[label.ToString()] = DateTime.Now; + } + } + else + _messageLogTime[label.ToString()] = DateTime.Now; + } + + var message = GetOeMessageWithParameters(label, messageParams, coeXmlFile, logData); + + if (logData) + { + _logger.Info("Sending ..."); + message.XmlMessage.SendToLog(EnumerationType.EXPANDED_FIELDS, MessageDirection.Out); + } + + var status = _endpoint.Send(message); + + if (status != coe.Status.SUCCESS) + { + _logger.Error($"Error sending COE message, error code: {status}"); + } + + return true; + } + catch (Exception) + { + throw; + } + } + + /// + /// Get next response in FIFO Queue, meaning we are getting the oldest response + /// + /// + /// + /// + public CoeResponseMsgData GetNextResponseInQueue(string messageId) + { + if (!_coe.IsConnected) + { + throw new CoeNotConnectedException(); + } + + uint label = 0; + // empty string or zero means first available message from the top + if (!string.IsNullOrEmpty(messageId) && messageId != "0") + { + label = GetLabelFromMessageId(messageId); + if (label == 0) + { + throw new Exception($"{Name}({_driverType}) Unable to match message {messageId} with anything in the dictionary. Check your configuration"); + } + } + + string strLabel = label.ToString(); + + Tuple message = null; + lock (this) + { + ConcurrentQueue> queue; + queue = label == 0 ? + _messages.Any() ? _messages.FirstOrDefault().Value : null : + _messages.ContainsKey(strLabel) ? _messages[strLabel] : null; + + if (queue != null) + { + queue.TryDequeue(out message); + } + } + + if (message != null) + { + OeMessage oeMessage = message.Item2; + // make a copy of the buffer + var xmlMessage = oeMessage.XmlMessage; + if (xmlMessage != null) + { + var results = new CoeResponseMsgData + { + Label = oeMessage.Label, + Time = message.Item1, + Name = xmlMessage.Name, + + // parse message result into list of results + FieldDataList = FromXmlToBitTestResults(xmlMessage) + }; + + return results; + } + else + { + var msg = $"Found a message with label {label}, but the Buffer is empty"; + throw new CoeParseException(msg); + } + } + else + { + // message not found + return null; + } + } + + /// + /// Clear the queue for a particular response message. + /// This is useful if we have a large size queue and we don't want to dequeue each item to get + /// to the newest item. So we clear the queue first, before trying to get the newest item in the queue + /// + public void ClearResponseMessageQueue(string messageId) + { + if (!_coe.IsConnected) + { + throw new CoeNotConnectedException(); + } + + uint label = 0; + // empty string or zero means first available message from the top + if (!string.IsNullOrEmpty(messageId) && messageId != "0") + { + label = GetLabelFromMessageId(messageId); + if (label == 0) + { + throw new Exception($"{Name}({_driverType}) Unable to match message {messageId} with anything in the dictionary. Check your configuration"); + } + } + + string strLabel = label.ToString(); + + lock (this) + { + if (_messages.ContainsKey(strLabel)) + { + _messages.Remove(strLabel); + } + } + } + + /// + /// Get XML Docs + /// + /// + public object GetXmlDocs() + { + return _xmlDocs; + } + + #region Private Functions + + /// + /// keep reading messages and stash them in _messages dictionary with label and timestamp as a key + /// + /// + /// + private void ReadMessages(CancellationToken cancellationToken) + { + _logger.Info($"{Name}({_driverType}) Starting to read messages."); + + try + { + while (!cancellationToken.IsCancellationRequested) + { + //_logger.Debug($"{Name}({_driverType}) Checking for messages..."); + var status = _endpoint.Wait(1000); + + if (status == coe.Status.SUCCESS) + { + bool logMessageReceived = true; + if (_messageReceivedLogTime != null) + { + logMessageReceived = false; + + double elapsedSecs = DateTime.Now.Subtract((DateTime)_messageReceivedLogTime).TotalSeconds; + + if (elapsedSecs >= (double)_messageReceivedLogIntervalInSec) + { + logMessageReceived = true; + + _messageReceivedLogTime = DateTime.Now; + } + } + else + _messageReceivedLogTime = DateTime.Now; + + if (logMessageReceived) + _logger.Debug("Message Received..."); + + bool logData = true; + while (_endpoint.Peek(out uint label, out uint size, out int priority) == coe.Status.SUCCESS) + { + logData = true; + var hexLabel = $"0x{label:X}"; + + if (_messageLogging.ContainsKey(label.ToString())) + { + if (!_messageLogging[label.ToString()]) + { + logData = false; + } + } + + if (logData && _messageLogTime.ContainsKey(label.ToString())) + { + if (_messageLogTime[label.ToString()] != null) + { + logData = false; + + double elapsedSecs = DateTime.Now.Subtract((DateTime)_messageLogTime[label.ToString()]).TotalSeconds; + + if (elapsedSecs >= (double)_messageLogIntervalInSec[label.ToString()]) + { + logData = true; + + _messageLogTime[label.ToString()] = DateTime.Now; + } + } + else + _messageLogTime[label.ToString()] = DateTime.Now; + } + + if (logData) + _logger.Debug($"{Name}({_driverType}) Identified message by peeking... {label} ({hexLabel})"); + + var xmlDoc = WhichFileContainsTheLabel(label); + + bool prevLogData = _xmlDocs[xmlDoc].LogData; + _xmlDocs[xmlDoc].LogData = logData; + var message = new OeMessage((int)size) + { + XmlMessage = new Message(_xmlDocs[xmlDoc], label.ToString(), logData) + }; + _xmlDocs[xmlDoc].LogData = prevLogData; + + status = _endpoint.Receive(message); + + if (status == coe.Status.SUCCESS) + { + if (logData) + { + _logger.Debug($"{Name}({_driverType}) Successfully read message... Label: {hexLabel} ({message.XmlMessage?.Name})"); + + message.XmlMessage.SendToLog(EnumerationType.EXPANDED_FIELDS, MessageDirection.In); + } + + lock (this) + { + if (!_messages.ContainsKey(message.Label)) + { + _messages.Add(message.Label, new ConcurrentQueue>()); + } + + if (_messages[message.Label].Count >= _maxQueueSizeForEachMessage) + { + _messages[message.Label].TryDequeue(out _); + } + + _messages[message.Label].Enqueue(new Tuple(DateTime.Now, message)); + } + } + else + { + _logger.Error($"{Name}({_driverType}) Endpoint Receive Failed. Status = {status}"); + } + } + } + // If not timeout and no cancellation requested + else if (status != coe.Status.FAILED_TIMEOUT && !cancellationToken.IsCancellationRequested) + { + _logger.Error($"{Name}({_driverType}) Event Flag Wait Failed. Status = {status}"); + } + } + _logger.Debug($"{Name}({_driverType}) Stopping to read messages. Cancellation was requested."); + } + catch (Exception ex) + { + _logger.Error(ex.Message + "\r\n" + ex.StackTrace); + } + } + + /// + /// Determine if we should log this message + /// + /// + /// + public bool ShallLogMessage(string messageName) + { + bool logData = true; + + uint label = GetLabelFromMessageId(messageName); + + if (_messageLogging.ContainsKey(label.ToString())) + { + if (!_messageLogging[label.ToString()]) + { + logData = false; + } + } + + if (logData && _messageLogTime.ContainsKey(label.ToString())) + { + if (_messageLogTime[label.ToString()] != null) + { + logData = false; + + double elapsedSecs = DateTime.Now.Subtract((DateTime)_messageLogTime[label.ToString()]).TotalSeconds; + + if (elapsedSecs >= (double)_messageLogIntervalInSec[label.ToString()]) + { + logData = true; + + _messageLogTime[label.ToString()] = DateTime.Now; + } + } + else + _messageLogTime[label.ToString()] = DateTime.Now; + } + + return logData; + } + + /// + /// if message id can be converted to uint returns the value + /// otherwise returns the related label from the message id by dictionary lookup + /// + /// + /// + private uint GetLabelFromMessageId(string messageId) + { + uint labelId = FromStringToUint(messageId); + + if (labelId == 0) + { + foreach (var file in _icds) + { + var item = file.Value.FirstOrDefault(l => l.Value == messageId); + if (!string.IsNullOrEmpty(item.Value)) + return item.Key; + } + } + + return labelId; + } + /// + /// return file path for the file that contains the label + /// + /// + /// + private string WhichFileContainsTheLabel(uint label) + { + foreach (var item in _icds) + { + if (item.Value.Keys.Contains(label)) + { + return item.Key; + } + } + return string.Empty; + } + + /// + /// convert from Message to list of BItTestResult fields + /// + /// + /// + private IList FromXmlToBitTestResults(Message message) + { + if (message == null) + return null; + + var result = FromMessageArrayToBitResult(message.MessageDataArray); + + return result; + } + + /// + /// recursive function for getting results out + /// + /// + /// + private IList FromMessageArrayToBitResult(MessageData[] messages) + { + if (messages == null || messages.Length == 0) + return null; + + var result = new List(); + + foreach (var item in messages) + { + result.Add(FromMessageDataToBitTestResult(item)); + + if (item.MessageArray != null && item.MessageArray.Length > 0) + { + var moreResults = FromMessageArrayToBitResult(item.MessageArray); + result.AddRange(moreResults); + } + } + + return result; + } + + /// + /// copy message data fields to BitTestResult + /// + /// + /// + private static CoeFieldData FromMessageDataToBitTestResult(MessageData from) + { + if (from == null) + return null; + + return new CoeFieldData + { + FieldArrayValue = from.FieldArrayValue, + FieldBitValue = from.FieldBitValue, + FieldDefaultValue = from.FieldDefaultValue, + FieldInstruType = from.FieldInstruType, + FieldMaxValue = from.FieldMaxValue, + FieldMinValue = from.FieldMinValue, + FieldName = from.FieldName, + FieldType = from.FieldType, + FieldValue = from.FieldValue, + Variable = from.Variable, + MaxOffset = from.MaxOffset, + MinOffset = from.MinOffset, + VerifyType = from.VerifyType, + IsSelected = from.isSelected, + IsArray = from.isArray, + IsStructure = from.isStructure, + IsArrayOfStructures = from.isArrayOfStructures, + IsEnum = from.isEnum, + UsesRegister = from.usesRegister, + IsValid = from.isValid, + UseRange = from.useRange, + ArrayLength = from.arrayLength, + ImageWidth = from.imageWidth, + ImageHeight = from.imageHeight, + ImagePixelSize = from.imagePixelSize, + BitMask = from.bitMask, + Expanded = from.expanded, + Depth = from.depth, + ImageBuffer = from.imageBuffer?.ToArray(), + ImageBufferSize = from.imageBufferSize, + }; + } + + /// + /// Build OeMessage from messageId and provided parameters + /// + /// + /// + /// + private OeMessage GetOeMessageWithParameters(uint messageId, IEnumerable> messageParams, string bitFilePath, bool logData = true) + { + var messageName = _icds[bitFilePath][messageId]; + var message = new OeMessage(new Message(messageName, new MessageXmlDocument(bitFilePath, logData), logData)); + + if (messageParams != null) + { + message.XmlMessage.MessageDataArray = PopulateParameters(message.XmlMessage.MessageDataArray, 0, messageParams); + } + + return message; + } + + /// + /// recursive function to populate parameters + /// + /// message data array + /// indicates how deep in the tree we are populating parameters + /// message parameters + /// + internal MessageData[] PopulateParameters(MessageData[] data, int level, IEnumerable> messageParams) + { + // only get parameters from the same level + var levelParams = messageParams.Where(m => m.Key.Where(c => c == '.' || c == ']').Count() == level); + + foreach (var item in data) + { + if (item.FieldName.StartsWith("$")) + continue; + + var messageParam = levelParams.FirstOrDefault(m => m.Key.EndsWith(item.FieldName)); + if (!string.IsNullOrEmpty(messageParam.Key) && !string.IsNullOrEmpty(messageParam.Value)) + { + item.FieldValue = messageParam.Value; + } + // always send defaults means that even if parameter was not provided use the default value to populate field value + else if (_alwaysSendDefaults) + { + item.FieldValue = item.FieldDefaultValue; + } + + // if there are more levels, update recursively + if (item.MessageArray != null && item.MessageArray.Length > 0) + item.MessageArray = PopulateParameters(item.MessageArray, level + 1, messageParams); + } + + return data; + } + + /// + /// reads xml file and extracts all message names with associated labels + /// + /// + /// + private Dictionary ProcessFileForNamesAndLabels(string filePath) + { + var doc = new XPathDocument(filePath); + + XPathNavigator node = doc.CreateNavigator(); + XPathNodeIterator nodeset = node.Select("interface/message|interface/namespace/message"); + + var result = new Dictionary(); + + while (nodeset.MoveNext()) + { + var children = nodeset.Current.SelectChildren(XPathNodeType.Element); + if (children.Count > 0) + { + string strName = string.Empty; + string strLabel = string.Empty; + + while (children.MoveNext()) + { + if (children.Current.Name == "name") + { + strName = children.Current.Value; + if (!string.IsNullOrEmpty(strName)) + strName = strName.Trim(); + } + else if (children.Current.Name == "label") + { + strLabel = children.Current.Value; + if (!string.IsNullOrEmpty(strLabel)) + strLabel = strLabel.Trim(); + } + } + + uint iLabel = FromStringToUint(strLabel); + + if (!string.IsNullOrEmpty(strName) && iLabel > 0) + { + result.Add(iLabel, strName); + } + } + } + return result; + } + + /// + /// converts from string representation of a label to uint value + /// + /// + /// + private uint FromStringToUint(string data) + { + if (!string.IsNullOrEmpty(data)) + { + if (data.StartsWith("0x", StringComparison.CurrentCultureIgnoreCase) || data.StartsWith("&H", StringComparison.CurrentCultureIgnoreCase)) + { + if (uint.TryParse(data.Substring(2), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out uint uiValue)) + return uiValue; + } + else + { + if (uint.TryParse(data, out uint uiValuel)) + return uiValuel; + } + } + return 0; + } + + #endregion + } +} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/BITCOEDeviceNode.csproj b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/CoeCommDevice.csproj similarity index 65% rename from Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/BITCOEDeviceNode.csproj rename to Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/CoeCommDevice.csproj index 1650624..7e4be4d 100644 --- a/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/BITCOEDeviceNode.csproj +++ b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/CoeCommDevice.csproj @@ -3,8 +3,8 @@ net472 - Raytheon.Instruments.BITCOEDeviceNode - Specialized instrument implementation of IBit interface for running real time Build In Tests via COE + Raytheon.Instruments.CoeCommDevice + Instrument implementation of GenSoft COE (Common Operating Environment) @@ -12,18 +12,10 @@ true - - False - - - - - - - + diff --git a/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/BITCOEDeviceInstrumentFactory.cs b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/CoeCommDeviceFactory.cs similarity index 76% rename from Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/BITCOEDeviceInstrumentFactory.cs rename to Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/CoeCommDeviceFactory.cs index b06fd25..3faf86c 100644 --- a/Source/TSRealLib/HAL/Implementations/BIT/BITCOEDeviceNode/BITCOEDeviceInstrumentFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/CoeCommDeviceFactory.cs @@ -30,47 +30,35 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "BITCOEDeviceInstrumentFactory")] - public class BITCOEDeviceInstrumentFactory : IInstrumentFactory + [ExportInstrumentFactory(ModelNumber = "CoeCommDeviceFactory")] + public class CoeCommDeviceFactory : IInstrumentFactory { - /// - /// - /// - private ILogger _logger; - /// - /// The supported interfaces - /// private readonly List _supportedInterfaces = new List(); private readonly IConfigurationManager _configurationManager; private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; private static string DefaultPath; - private readonly DriverType _driverType; - public BITCOEDeviceInstrumentFactory(string defaultConfigPath = DefaultConfigPath) + public CoeCommDeviceFactory(string defaultConfigPath = DefaultConfigPath) : this(null, defaultConfigPath) { } /// - /// COECommDeviceInstrumentFactory injection constructor + /// CoeCommDeviceFactory injection constructor /// - /// - /// - /// [ImportingConstructor] - public BITCOEDeviceInstrumentFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null, - [Import(AllowDefault = true)] DriverType driverType = DriverType.TCP) + public CoeCommDeviceFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) { DefaultPath = defaultConfigPath; @@ -81,8 +69,7 @@ namespace Raytheon.Instruments } _configurationManager = configManager ?? GetConfigurationManager(); - _driverType = driverType; - _supportedInterfaces.Add(typeof(IBit)); + _supportedInterfaces.Add(typeof(CoeComm)); } /// /// @@ -93,8 +80,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - return new BITCOEDeviceInstrument(name, _configurationManager, _driverType, _logger); + return new CoeCommDevice(name, _configurationManager); } catch (Exception) { @@ -111,9 +97,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new BITCOEDeviceInstrument(name, _configurationManager, _driverType, _logger); + return new CoeCommDevice(name, _configurationManager); } catch (Exception) { diff --git a/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/ConfigurationHelper.cs b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/ConfigurationHelper.cs new file mode 100644 index 0000000..bfa71d8 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/ConfigurationHelper.cs @@ -0,0 +1,124 @@ +// ********************************************************************************************************** +// ConfigurationHelper.cs +// 7/5/2022 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** + +using Raytheon.Common; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace Raytheon.Instruments +{ + /// + /// type conversion utility with a special case for enums + /// + public static class TypeConverter + { + public static T ChangeType(object value) + { + return typeof(T).IsEnum ? (T)Enum.Parse(typeof(T), value.ToString()) : (T)ChangeType(typeof(T), value); + } + + public static object ChangeType(Type t, object value) + { + System.ComponentModel.TypeConverter tc = TypeDescriptor.GetConverter(t); + return tc.ConvertFrom(value); + } + + public static void RegisterTypeConverter() where TC : System.ComponentModel.TypeConverter + { + TypeDescriptor.AddAttributes(typeof(T), new TypeConverterAttribute(typeof(TC))); + } + } + + /// + /// Helper class contains extention fuctions for reading types other than strings from configuration, + /// as well as reading lists of values + /// + public static class ConfigurationHelper + { + /// + /// template function for reading different types from configuration + /// + /// + /// + /// + /// + /// + public static T GetConfigurationValue(this IConfiguration configuration, string section, string key) + { + var tmpResult = configuration.GetConfigurationValue(section, key); + return !string.IsNullOrEmpty(tmpResult) ? TypeConverter.ChangeType(tmpResult) : default; + } + + /// + /// returns multivalue result (list of T) from configuration + /// + /// + /// + /// + /// + /// + public static List GetConfigurationListValue(this IConfiguration configuration, string section, string key, List defaultValue) + { + var tmpResult = configuration.GetXmlConfiguration(section); + if (string.IsNullOrEmpty(tmpResult)) + { + return new List(); + } + else + { + var stringRes = BuildElementListFromXml(tmpResult, key); + return new List(stringRes.Select(x => TypeConverter.ChangeType(x))); + } + } + + /// + /// returns values from XML section converted to string list + /// + /// + /// + /// + private static List BuildElementListFromXml(string data, string key) + { + XElement doc = XElement.Parse(data); + IEnumerable xmlMessages = from m + in doc.Elements($"{key}s").Elements(key) + select m; + var messages = xmlMessages.Select(x => x.Value); + return messages?.ToList(); + } + } +} diff --git a/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/Documentation/COE_40_Arch.pdf b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/Documentation/COE_40_Arch.pdf new file mode 100644 index 0000000..ef26b73 Binary files /dev/null and b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/Documentation/COE_40_Arch.pdf differ diff --git a/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/Documentation/COE_TCP_Sequence_Diagram.png b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/Documentation/COE_TCP_Sequence_Diagram.png new file mode 100644 index 0000000..b7de4b2 Binary files /dev/null and b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/Documentation/COE_TCP_Sequence_Diagram.png differ diff --git a/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/Documentation/readme.txt b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/Documentation/readme.txt new file mode 100644 index 0000000..5949e6d --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/COE/CoeCommDevice/Documentation/readme.txt @@ -0,0 +1,5 @@ +To test this COECommDevice, use the CMIT tool in this folder to send/received COE messages. Both nodes must be using the same COE XML files to send/receive COE messages. + +Configure CMIT tool as server since COECommDevice will configure itself as client by default(whether using TCP or UDP) + +This COE instrument also calls into lower level COE code from Raytheon.Common library. Read the COE code from there if interested to know how it works. \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/Chiller/ChillerFTS/ChillerFTS.cs b/Source/TSRealLib/HAL/Implementations/Chiller/ChillerFTS/ChillerFTS.cs index 80d1248..fdcd29b 100644 --- a/Source/TSRealLib/HAL/Implementations/Chiller/ChillerFTS/ChillerFTS.cs +++ b/Source/TSRealLib/HAL/Implementations/Chiller/ChillerFTS/ChillerFTS.cs @@ -15,380 +15,347 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; using System; using System.IO.Ports; using System.Net.Sockets; using System.Text; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// Chiller class used to interact with the FTS chiller. - /// - public class ChillerFTS : IChiller, IDisposable - { - #region PrivateMembers - private enum DEGREES - { - Celsius = 0, - Fahrenheit = 1, - Kevin = 2 - } + /// + /// Chiller class used to interact with the FTS chiller. + /// + public class ChillerFTS : IChiller, IDisposable + { + #region PrivateMembers + private enum DEGREES + { + Celsius = 0, + Fahrenheit = 1, + Kevin = 2 + } - private static object m_sync = new object(); + private static object m_sync = new object(); - private const string _CARRIAGE_RETURN = "\r"; - private const string _FLOWDISABLE = "STOP"; - private const string _FLOWENABLE = "START"; - private const string _TEMPREAD = "PT?"; - private const string _TEMPREADSETPOINT = "SP?"; - private const string _TEMPSET = "SP="; - private const string _DEGREES = "DEGREES="; - private const string _SUCCESS = "OK"; - private const string _EXC_POINT = "!"; + private const string _CARRIAGE_RETURN = "\r"; + private const string _FLOWDISABLE = "STOP"; + private const string _FLOWENABLE = "START"; + private const string _TEMPREAD = "PT?"; + private const string _TEMPREADSETPOINT = "SP?"; + private const string _TEMPSET = "SP="; + private const string _DEGREES = "DEGREES="; + private const string _SUCCESS = "OK"; + private const string _EXC_POINT = "!"; - private readonly string _ipAddr; - private readonly int _port; - private const int _READ_BUFFER_SIZE = 128; - private const int _READ_TIMEOUT = 5000; - private byte[] _readBuffer; - private NetworkStream _tcpStream; + private readonly string _ipAddr; + private readonly int _port; + private const int _READ_BUFFER_SIZE = 128; + private const int _READ_TIMEOUT = 5000; + private byte[] _readBuffer; + private NetworkStream _tcpStream; - public string DetailedStatus { get; protected set; } + public string DetailedStatus { get; protected set; } - public bool DisplayEnabled { get; set; } - public bool FrontPanelEnabled { get; set; } + public bool DisplayEnabled { get; set; } + public bool FrontPanelEnabled { get; set; } - public InstrumentMetadata Info { get; set; } + public InstrumentMetadata Info { get; set; } - public string Name { get; protected set; } + public string Name { get; protected set; } - public SelfTestResult SelfTestResult => PerformSelfTest(); + public SelfTestResult SelfTestResult => PerformSelfTest(); - public State Status { get; set; } + public State Status { get; set; } - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions - /// - /// Destructor - /// - ~ChillerFTS() - { - Dispose(false); - } + #endregion - /// - /// Open socket to the chiller - /// - private void ConnectEthernet() - { - Initialize(); - } + #region PrivateFunctions + /// + /// Destructor + /// + ~ChillerFTS() + { + Dispose(false); + } - public void Initialize() - { - //Create and open a socket to chiller cart server - TcpClient chillerSocket = new TcpClient(_ipAddr, _port); - _tcpStream = chillerSocket.GetStream(); - _tcpStream.ReadTimeout = _READ_TIMEOUT; - } + /// + /// Open socket to the chiller + /// + private void ConnectEthernet() + { + Initialize(); + } - /// - /// Dispose of the object's resources. - /// - /// Currently disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - //Close Connection (if available) - _tcpStream?.Close(); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + public void Initialize() + { + //Create and open a socket to chiller cart server + TcpClient chillerSocket = new TcpClient(_ipAddr, _port); + _tcpStream = chillerSocket.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; + } - /// - /// Send a command to the chiller and request a response - /// - /// Command to send. - /// Response from the chiller. - private string SendMessageGetResponse(string cmd) - { - lock (m_sync) - { - //Format the command before sending - string commandString = cmd + _CARRIAGE_RETURN; + /// + /// Dispose of the object's resources. + /// + /// Currently disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + //Close Connection (if available) + _tcpStream?.Close(); + } + } - //convert to byte array for sending - byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); + /// + /// Send a command to the chiller and request a response + /// + /// Command to send. + /// Response from the chiller. + private string SendMessageGetResponse(string cmd) + { + lock (m_sync) + { + //Format the command before sending + string commandString = cmd + _CARRIAGE_RETURN; - //send the data - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + //convert to byte array for sending + byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); - //clear the buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + //send the data + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - //read from the response buffer - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + //clear the buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); - //convert response to a string - string rspStr = Encoding.ASCII.GetString(_readBuffer); + //read from the response buffer + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - //Check Response - if (rspStr.Contains(_SUCCESS)) - { - //Remove ! - rspStr = rspStr.Replace(_EXC_POINT, ""); + //convert response to a string + string rspStr = Encoding.ASCII.GetString(_readBuffer); - //Parse string ("/r") - char[] delimit = { '\r' }; - string[] parsed = rspStr.Split(delimit, StringSplitOptions.RemoveEmptyEntries); + //Check Response + if (rspStr.Contains(_SUCCESS)) + { + //Remove ! + rspStr = rspStr.Replace(_EXC_POINT, ""); - //Return parsed message - return parsed[1]; - } - else - { - throw new Exception("SendMessageGetResponse::SendMessageGetResponse() - Command message not successful"); - } - } - } - /// - /// Change the units of measurement for the chiller. - /// - /// Celsius/Fahrenheit - private void SetDegreesUnits(DEGREES units) - { - lock (m_sync) - { - //Set the units of measurement to Celsius - string rsp = SendMessageGetResponse(_DEGREES + units.ToString()); - } - } + //Parse string ("/r") + char[] delimit = { '\r' }; + string[] parsed = rspStr.Split(delimit, StringSplitOptions.RemoveEmptyEntries); - #endregion + //Return parsed message + return parsed[1]; + } + else + { + throw new Exception("SendMessageGetResponse::SendMessageGetResponse() - Command message not successful"); + } + } + } + /// + /// Change the units of measurement for the chiller. + /// + /// Celsius/Fahrenheit + private void SetDegreesUnits(DEGREES units) + { + lock (m_sync) + { + //Set the units of measurement to Celsius + string rsp = SendMessageGetResponse(_DEGREES + units.ToString()); + } + } + + #endregion - /// - /// ChillerFTS factory constructor - /// - /// - /// - public ChillerFTS(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// ChillerFTS factory constructor + /// + /// + /// + public ChillerFTS(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - - _ipAddr = _configuration.GetConfigurationValue("ChillerFTS", "IpAddr", ""); - _port = _configuration.GetConfigurationValue("ChillerFTS", "Port", 0); - _readBuffer = new byte[_READ_BUFFER_SIZE]; + _ipAddr = _configuration.GetConfigurationValue("ChillerFTS", "IpAddr", ""); + _port = _configuration.GetConfigurationValue("ChillerFTS", "Port", 0); - //Connect to device - ConnectEthernet(); - } + _readBuffer = new byte[_READ_BUFFER_SIZE]; - /// - /// Constructor for the chiller. It makes a socket connection to the chiller and sets the degrees to Celsius - /// - /// The name - /// IP Address of the equipment - /// Port of the equipment - public ChillerFTS(string name, string ipAddress, int port) - { - Name = name; - _ipAddr = ipAddress; - _port = port; - _logger = LogManager.GetCurrentClassLogger(); + //Connect to device + ConnectEthernet(); + } - _readBuffer = new byte[_READ_BUFFER_SIZE]; + /// + /// Constructor for the chiller. It makes a socket connection to the chiller and sets the degrees to Celsius + /// + /// The name + /// IP Address of the equipment + /// Port of the equipment + public ChillerFTS(string deviceName, string ipAddress, int port) + { + Name = deviceName; + _ipAddr = ipAddress; + _port = port; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - //Connect to device - ConnectEthernet(); - } + _readBuffer = new byte[_READ_BUFFER_SIZE]; - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public ChillerFTS(string name, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) - { - throw new NotImplementedException(); - } + //Connect to device + ConnectEthernet(); + } - /// - /// Stop the chiller pump. - /// - public void DisableFlow() - { - lock (m_sync) - { - //Send the command to stop coolant flow - string rsp = SendMessageGetResponse(_FLOWDISABLE); - } - } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public ChillerFTS(string name, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) + { + throw new NotImplementedException(); + } - /// - /// Dispose of this objects resources - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] - public void Dispose() - { - try - { - Dispose(true); + /// + /// Stop the chiller pump. + /// + public void DisableFlow() + { + lock (m_sync) + { + //Send the command to stop coolant flow + string rsp = SendMessageGetResponse(_FLOWDISABLE); + } + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of this objects resources + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] + public void Dispose() + { + Dispose(true); - /// - /// Start the chiller pump. - /// - public void EnableFlow() - { - lock (m_sync) - { - //Send the command to start coolant flow - string rsp = SendMessageGetResponse(_FLOWENABLE); - } - } + GC.SuppressFinalize(this); + } - /// - /// Query the current setting for the coolant. - /// - /// The current coolant setting. - public double GetCoolantSetpoint() - { - lock (m_sync) - { - //Name of the function - const string SETPOINT_RESPONSE = "F057="; + /// + /// Start the chiller pump. + /// + public void EnableFlow() + { + lock (m_sync) + { + //Send the command to start coolant flow + string rsp = SendMessageGetResponse(_FLOWENABLE); + } + } - //Request the setpoint - string results = SendMessageGetResponse(_TEMPREADSETPOINT); + /// + /// Query the current setting for the coolant. + /// + /// The current coolant setting. + public double GetCoolantSetpoint() + { + lock (m_sync) + { + //Name of the function + const string SETPOINT_RESPONSE = "F057="; - //Not connected. No results - if (results == "") - { - return double.MaxValue; - } + //Request the setpoint + string results = SendMessageGetResponse(_TEMPREADSETPOINT); - //Remove function header - results = results.Replace(SETPOINT_RESPONSE, ""); + //Not connected. No results + if (results == "") + { + return double.MaxValue; + } - return double.Parse(results); - } - } + //Remove function header + results = results.Replace(SETPOINT_RESPONSE, ""); - /// - /// Query the temperature of the coolant reservoir. - /// - /// The temperature of the coolant. - public double GetCoolantTemperature() - { - lock (m_sync) - { - //Name of the function - const string TEMP_RESPONSE = "F043="; + return double.Parse(results); + } + } - //Request the temperature - string results = SendMessageGetResponse(_TEMPREAD); + /// + /// Query the temperature of the coolant reservoir. + /// + /// The temperature of the coolant. + public double GetCoolantTemperature() + { + lock (m_sync) + { + //Name of the function + const string TEMP_RESPONSE = "F043="; - //Not connected. No results - if (results == "") - { - return double.MaxValue; - } + //Request the temperature + string results = SendMessageGetResponse(_TEMPREAD); - //Remove function header - results = results.Replace(TEMP_RESPONSE, ""); + //Not connected. No results + if (results == "") + { + return double.MaxValue; + } - return double.Parse(results); - } - } + //Remove function header + results = results.Replace(TEMP_RESPONSE, ""); - /// - /// Set the coolant temperature to a desired setpoint. - /// - /// The desired coolant temperature. - public void SetCoolantTemperature(double temp) - { - lock (m_sync) - { - //Set the coolant temperature - string rsp = SendMessageGetResponse(_TEMPSET + temp.ToString()); - } - } + return double.Parse(results); + } + } - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// Set the coolant temperature to a desired setpoint. + /// + /// The desired coolant temperature. + public void SetCoolantTemperature(double temp) + { + lock (m_sync) + { + //Set the coolant temperature + string rsp = SendMessageGetResponse(_TEMPSET + temp.ToString()); + } + } - public SelfTestResult PerformSelfTest() - { - return SelfTestResult.Unknown; - } + public bool ClearErrors() + { + throw new NotImplementedException(); + } - public void Reset() - { - Shutdown(); + public SelfTestResult PerformSelfTest() + { + return SelfTestResult.Unknown; + } - Initialize(); - } + public void Reset() + { + Shutdown(); - public void Shutdown() - { - Dispose(); - } - } + Initialize(); + } + + public void Shutdown() + { + Dispose(); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Chiller/ChillerFTS/ChillerFTSFactory.cs b/Source/TSRealLib/HAL/Implementations/Chiller/ChillerFTS/ChillerFTSFactory.cs index 6e42fe7..f54393a 100644 --- a/Source/TSRealLib/HAL/Implementations/Chiller/ChillerFTS/ChillerFTSFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Chiller/ChillerFTS/ChillerFTSFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "ChillerFTSFactory")] - public class ChillerFTSFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "ChillerFTSFactory")] + public class ChillerFTSFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public ChillerFTSFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public ChillerFTSFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public ChillerFTSFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// ChillerFTSFactory injection constructor + /// + [ImportingConstructor] + public ChillerFTSFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IChiller)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new ChillerFTS(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IChiller)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new ChillerFTS(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new ChillerSim(name, _configurationManager, _logger); + return new ChillerSim(name, _configurationManager); else - return new ChillerFTS(name, _configurationManager, _logger); + return new ChillerFTS(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Chiller/ChillerSim/ChillerSim.cs b/Source/TSRealLib/HAL/Implementations/Chiller/ChillerSim/ChillerSim.cs index 2f9ed27..57ca337 100644 --- a/Source/TSRealLib/HAL/Implementations/Chiller/ChillerSim/ChillerSim.cs +++ b/Source/TSRealLib/HAL/Implementations/Chiller/ChillerSim/ChillerSim.cs @@ -15,210 +15,175 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; using System; using System.Threading; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A simulated chiller - /// - public class ChillerSim : IChiller, IDisposable - { - #region PrivateMembers - private double _setPoint; - private static object _sync = new object(); + /// + /// A simulated chiller + /// + public class ChillerSim : IChiller, IDisposable + { + #region PrivateMembers + private double _setPoint; + private static object _sync = new object(); - public string DetailedStatus { get; protected set; } + public string DetailedStatus { get; protected set; } - public bool DisplayEnabled { get; set; } - public bool FrontPanelEnabled { get; set; } + public bool DisplayEnabled { get; set; } + public bool FrontPanelEnabled { get; set; } - public InstrumentMetadata Info { get; set; } + public InstrumentMetadata Info { get; set; } - public string Name { get; protected set; } + public string Name { get; protected set; } - public SelfTestResult SelfTestResult => PerformSelfTest(); + public SelfTestResult SelfTestResult => PerformSelfTest(); - public State Status { get; set; } + public State Status { get; set; } - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions - ~ChillerSim() - { - Dispose(false); - } - /// - /// Dispose of the object's resources. - /// - /// Currently disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + #endregion - #region PublicFunctions + #region PrivateFunctions + ~ChillerSim() + { + Dispose(false); + } + /// + /// Dispose of the object's resources. + /// + /// Currently disposing. + protected virtual void Dispose(bool disposing) + { - /// - /// ChillerFTS factory constructor - /// - /// - /// - public ChillerSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + } + #endregion - _logger = logger; + #region PublicFunctions - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - } + /// + /// ChillerFTS factory constructor + /// + /// + /// + public ChillerSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - /// - /// The constructor - /// - /// - public ChillerSim(string name) - { - Name = name; - _setPoint = 20.0; - _logger = LogManager.GetCurrentClassLogger(); - } + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + } + + /// + /// The constructor + /// + /// + public ChillerSim(string deviceName) + { + Name = deviceName; + _setPoint = 20.0; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + } - /// - /// Stop the chiller pump. - /// - public void DisableFlow() - { - } + /// + /// Stop the chiller pump. + /// + public void DisableFlow() + { + } - /// - /// Dispose of this objects resources - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this objects resources + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// Start the chiller pump. - /// - public void EnableFlow() - { - } + /// + /// Start the chiller pump. + /// + public void EnableFlow() + { + } - /// - /// Query the current setting for the coolant. - /// - /// The current coolant setting. - public double GetCoolantSetpoint() - { - return _setPoint; - } + /// + /// Query the current setting for the coolant. + /// + /// The current coolant setting. + public double GetCoolantSetpoint() + { + return _setPoint; + } - /// - /// Query the temperature of the coolant reservoir. - /// - /// The temperature of the coolant. - public double GetCoolantTemperature() - { - double max = _setPoint + 5; + /// + /// Query the temperature of the coolant reservoir. + /// + /// The temperature of the coolant. + public double GetCoolantTemperature() + { + double max = _setPoint + 5; - double min = _setPoint - 5; + double min = _setPoint - 5; - Random rnd = new Random(); + Random rnd = new Random(); - double seed = rnd.NextDouble(); + double seed = rnd.NextDouble(); - double dataToReturn = (seed * (max - min)) + min; + double dataToReturn = (seed * (max - min)) + min; - Thread.Sleep(100); + Thread.Sleep(100); - return dataToReturn; - } + return dataToReturn; + } - /// - /// Set the coolant temperature to a desired setpoint. - /// - /// The desired coolant temperature. - public void SetCoolantTemperature(double temp) - { - _setPoint = temp; - } + /// + /// Set the coolant temperature to a desired setpoint. + /// + /// The desired coolant temperature. + public void SetCoolantTemperature(double temp) + { + _setPoint = temp; + } - public bool ClearErrors() - { - throw new NotImplementedException(); - } + public bool ClearErrors() + { + throw new NotImplementedException(); + } - public void Initialize() - { - throw new NotImplementedException(); - } + public void Initialize() + { + throw new NotImplementedException(); + } - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - public void Reset() - { - throw new NotImplementedException(); - } + public void Reset() + { + throw new NotImplementedException(); + } - public void Shutdown() - { - throw new NotImplementedException(); - } + public void Shutdown() + { + throw new NotImplementedException(); + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Chiller/ChillerSim/ChillerSimFactory.cs b/Source/TSRealLib/HAL/Implementations/Chiller/ChillerSim/ChillerSimFactory.cs index 961d7ca..b906e0a 100644 --- a/Source/TSRealLib/HAL/Implementations/Chiller/ChillerSim/ChillerSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Chiller/ChillerSim/ChillerSimFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "ChillerSimFactory")] - public class ChillerSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "ChillerSimFactory")] + public class ChillerSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public ChillerSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public ChillerSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public ChillerSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// ChillerSimFactory injection constructor + /// + [ImportingConstructor] + public ChillerSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IChiller)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new ChillerSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IChiller)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new ChillerSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +98,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new ChillerSim(name, _configurationManager, _logger); + return new ChillerSim(name, _configurationManager); } catch (Exception) { @@ -120,17 +111,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceGeuSdlc/CommDeviceGeuSdlc.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceGeuSdlc/CommDeviceGeuSdlc.cs index 6c3cde0..6b893d9 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceGeuSdlc/CommDeviceGeuSdlc.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceGeuSdlc/CommDeviceGeuSdlc.cs @@ -1,360 +1,348 @@ // Ignore Spelling: Geu Sdlc using System; -using Raytheon.GuidedElectronicsUnit; using System.Threading; -using Raytheon.Common; using NLog; +using Raytheon.Common; +using Raytheon.GuidedElectronicsUnit; namespace Raytheon.Instruments { - public class CommDeviceGeuSdlc : ICommDevice, IDisposable - { - #region PrivateClassMembers + public class CommDeviceGeuSdlc : ICommDevice, IDisposable + { + #region PrivateClassMembers - private GuidedElectronicsUnit.GuidedElectronicsUnit _guidanceElectronicsUnit; - private readonly bool _idQuery = false; - private readonly bool _reset = false; - private readonly SelfTestResult _selfTestResult; - private State _state; - private readonly string _instrumentDriverSetup; - private readonly int _pollingRate; - private readonly string _resourceName; - private static readonly object _syncObj = new object(); + private GuidedElectronicsUnit.GuidedElectronicsUnit _guidanceElectronicsUnit; + private readonly bool _idQuery = false; + private readonly bool _reset = false; + private readonly SelfTestResult _selfTestResult; + private State _state; + private readonly string _instrumentDriverSetup; + private readonly int _pollingRate; + private static readonly object _syncObj = new object(); - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivatelassFunctions + #endregion - /// - /// The Finalizer - /// - ~CommDeviceGeuSdlc() - { - Dispose(false); - } + #region PrivatelassFunctions - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // close resources - try - { - if (_state == State.Ready) - { - _guidanceElectronicsUnit.Close(); - _guidanceElectronicsUnit.Dispose(); - _state = State.Uninitialized; - } - } - catch (Exception) - { - try - { - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + /// + /// The Finalizer + /// + ~CommDeviceGeuSdlc() + { + Dispose(false); + } - /// - /// Some HSS corrections - /// - /// - /// - private static unsafe void PerformHssSwirl(ref byte[] data, uint numDWords) - { - fixed (byte* pBytePtr = &data[0]) - { - for (int i = 0; i < numDWords; i++) - { - // swap the first word - ushort* pWord1 = (ushort*)pBytePtr + (i * 2); - *pWord1 = Util.Swap(*pWord1); - - //swap the second word - ushort* pWord2 = (ushort*)pBytePtr + ((i * 2) + 1); - *pWord2 = Util.Swap(*pWord2); - - // now swap the dword - uint* pDWord = (uint*)pBytePtr + i; - *pDWord = Util.SwapHighAndLowBytes(*pDWord); - } - } - } - - #endregion - - #region PublicClassFunctions - - bool IInstrument.DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - bool IInstrument.FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - InstrumentMetadata IInstrument.Info => throw new NotImplementedException(); - - /// - /// CommDevice factory constructor - /// - /// - /// - public CommDeviceGeuSdlc(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - _resourceName = deviceName; - _guidanceElectronicsUnit = null; - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _idQuery = _configuration.GetConfigurationValue("CommDeviceGeuSdlc", "IdQuery", true); - _reset = _configuration.GetConfigurationValue("CommDeviceGeuSdlc", "Reset", true); - _instrumentDriverSetup = _configuration.GetConfigurationValue("CommDeviceGeuSdlc", "InstrumentDriverSetup", ""); - _pollingRate = _configuration.GetConfigurationValue("CommDeviceGeuSdlc", "PollingRate", 10); - } - - /// - /// The constructor. Does not initialize anything. Use Initialize() to create the handle to the hardware - /// - /// - /// - /// - public CommDeviceGeuSdlc(string resourceName, bool idQuery, bool reset, string instrumentDriverSetup = "", int pollingRate = 10) - { - _resourceName = resourceName; - _idQuery = idQuery; - _reset = reset; - _guidanceElectronicsUnit = null; - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - _instrumentDriverSetup = instrumentDriverSetup; - _pollingRate = pollingRate; - _logger = LogManager.GetCurrentClassLogger(); - } - - /// - /// - /// - /// - bool IInstrument.ClearErrors() - { - throw new NotImplementedException(); - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a HSS GEU SDLC Device called " + _resourceName; - } - } - - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception err) - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - } - - /// - /// Create a handle to the hardware - /// - public void Initialize() - { - const uint AUTO_FWDING_ADDR = 0x00080100; - const uint WRITE_OFFSET = 0x00200000; - const uint ENABLE_AUTO_FWDING = 0b0000_0001; - const uint ENABLE_TLP_HDR = 0b0000_0010; - //const uint INSERT_MSG_CNT = 0b0000_0100; - - _guidanceElectronicsUnit = new GuidedElectronicsUnit.GuidedElectronicsUnit(_resourceName, _idQuery, _reset, - $"QueryInstrStatus=true, Simulate=false, DriverSetup= {_instrumentDriverSetup}, PollingInterval={_pollingRate}"); - - _guidanceElectronicsUnit.LowLevel.HSSub9100.EnableIO = ControlState.Enabled; - - _guidanceElectronicsUnit.LowLevel.HSSub9100.WriteRegister(AUTO_FWDING_ADDR + WRITE_OFFSET, ENABLE_AUTO_FWDING | ENABLE_TLP_HDR); - - _state = State.Ready; - } - - /// - /// - /// - public string Name - { - get - { - return _resourceName; - } - } - - /// - /// - /// - /// - SelfTestResult IInstrument.PerformSelfTest() - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - /// - uint ICommDevice.Read(ref byte[] dataRead) - { - - if (_guidanceElectronicsUnit == null) - { - return 0; - } - - byte[] sdlcMsgs = new byte[0]; - lock (_syncObj) - { - // read all of the data that is available - sdlcMsgs = _guidanceElectronicsUnit.GsKwSyncronousDataLinkControl.FetchMessageData(); - } - - if (sdlcMsgs.Length > dataRead.Length) + /// + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + // close resources + try { - throw new Exception("The data buffer that the host provided is: " + dataRead.Length + " bytes, there are: " + sdlcMsgs.Length + " bytes of SDLC data. Need to increase the host buffer size"); + if (_state == State.Ready) + { + _guidanceElectronicsUnit.Close(); + _guidanceElectronicsUnit.Dispose(); + _state = State.Uninitialized; + } } - - Buffer.BlockCopy(sdlcMsgs, 0, dataRead, 0, sdlcMsgs.Length); + catch (Exception) + { + try + { + } + catch (Exception) + { + //Do not rethrow. Exception from error logger that has already been garbage collected + } + } + } + } - return (uint)sdlcMsgs.Length; - } + /// + /// Some HSS corrections + /// + /// + /// + private static unsafe void PerformHssSwirl(ref byte[] data, uint numDWords) + { + fixed (byte* pBytePtr = &data[0]) + { + for (int i = 0; i < numDWords; i++) + { + // swap the first word + ushort* pWord1 = (ushort*)pBytePtr + (i * 2); + *pWord1 = Util.Swap(*pWord1); - /// - /// - /// - void IInstrument.Reset() - { - lock (_syncObj) - { - _guidanceElectronicsUnit.Close(); - _state = State.Uninitialized; - Thread.Sleep(500); - Initialize(); - } - } + //swap the second word + ushort* pWord2 = (ushort*)pBytePtr + ((i * 2) + 1); + *pWord2 = Util.Swap(*pWord2); - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + // now swap the dword + uint* pDWord = (uint*)pBytePtr + i; + *pDWord = Util.SwapHighAndLowBytes(*pDWord); + } + } + } - /// - /// - /// - /// - void ICommDevice.SetReadTimeout(uint timeoutMs) - { - throw new NotImplementedException(); - } + #endregion - /// - /// - /// - void IInstrument.Shutdown() - { - lock (_syncObj) - { - if (_guidanceElectronicsUnit != null) - { - _guidanceElectronicsUnit.LowLevel.HSSub9100.EnableIO = ControlState.Disabled; + #region PublicClassFunctions - _guidanceElectronicsUnit.Close(); - _guidanceElectronicsUnit.Dispose(); - _state = State.Uninitialized; - } - } - } + bool IInstrument.DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + bool IInstrument.FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + InstrumentMetadata IInstrument.Info => throw new NotImplementedException(); - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// CommDevice factory constructor + /// + /// + /// + public CommDeviceGeuSdlc(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + _guidanceElectronicsUnit = null; + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; - /// - /// - /// - /// - /// - /// - uint ICommDevice.Write(byte[] data, uint numBytesToWrite) - { - lock (_syncObj) - { - if (numBytesToWrite % 4 != 0) - { - throw new Exception("Data is not dword aligned"); - } + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - // do all of the HSS Tx only byte order corrections - PerformHssSwirl(ref data, numBytesToWrite / 4); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - var tempArr = new uint[data.Length / 4]; - Buffer.BlockCopy(data, 0, tempArr, 0, (int)numBytesToWrite); - _guidanceElectronicsUnit.GsKwSyncronousDataLinkControl.SendMessage(tempArr); - } - return numBytesToWrite; - } + _idQuery = _configuration.GetConfigurationValue("CommDeviceGeuSdlc", "IdQuery", true); + _reset = _configuration.GetConfigurationValue("CommDeviceGeuSdlc", "Reset", true); + _instrumentDriverSetup = _configuration.GetConfigurationValue("CommDeviceGeuSdlc", "InstrumentDriverSetup", ""); + _pollingRate = _configuration.GetConfigurationValue("CommDeviceGeuSdlc", "PollingRate", 10); + } - public void Close() - { - } + /// + /// The constructor. Does not initialize anything. Use Initialize() to create the handle to the hardware + /// + /// + /// + /// + public CommDeviceGeuSdlc(string deviceName, bool idQuery, bool reset, string instrumentDriverSetup = "", int pollingRate = 10) + { + Name = deviceName; + _idQuery = idQuery; + _reset = reset; + _guidanceElectronicsUnit = null; + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + _instrumentDriverSetup = instrumentDriverSetup; + _pollingRate = pollingRate; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + } - public void Open() - { - } + /// + /// + /// + /// + bool IInstrument.ClearErrors() + { + throw new NotImplementedException(); + } - #endregion - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a HSS GEU SDLC Device called " + Name; + } + } + + /// + /// Dispose of the resources contained by this object + /// + public void Dispose() + { + try + { + Dispose(true); + + GC.SuppressFinalize(this); + } + catch (Exception err) + { + _logger.Error(err.Message + "\r\n" + err.StackTrace); + } + } + + /// + /// Create a handle to the hardware + /// + public void Initialize() + { + const uint AUTO_FWDING_ADDR = 0x00080100; + const uint WRITE_OFFSET = 0x00200000; + const uint ENABLE_AUTO_FWDING = 0b0000_0001; + const uint ENABLE_TLP_HDR = 0b0000_0010; + //const uint INSERT_MSG_CNT = 0b0000_0100; + + _guidanceElectronicsUnit = new GuidedElectronicsUnit.GuidedElectronicsUnit(Name, _idQuery, _reset, + $"QueryInstrStatus=true, Simulate=false, DriverSetup= {_instrumentDriverSetup}, PollingInterval={_pollingRate}"); + + _guidanceElectronicsUnit.LowLevel.HSSub9100.EnableIO = ControlState.Enabled; + + _guidanceElectronicsUnit.LowLevel.HSSub9100.WriteRegister(AUTO_FWDING_ADDR + WRITE_OFFSET, ENABLE_AUTO_FWDING | ENABLE_TLP_HDR); + + _state = State.Ready; + } + + /// + /// + /// + public string Name { get; protected set; } + + /// + /// + /// + /// + SelfTestResult IInstrument.PerformSelfTest() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + uint ICommDevice.Read(ref byte[] dataRead) + { + + if (_guidanceElectronicsUnit == null) + { + return 0; + } + + byte[] sdlcMsgs = new byte[0]; + lock (_syncObj) + { + // read all of the data that is available + sdlcMsgs = _guidanceElectronicsUnit.GsKwSyncronousDataLinkControl.FetchMessageData(); + } + + if (sdlcMsgs.Length > dataRead.Length) + { + throw new Exception("The data buffer that the host provided is: " + dataRead.Length + " bytes, there are: " + sdlcMsgs.Length + " bytes of SDLC data. Need to increase the host buffer size"); + } + + Buffer.BlockCopy(sdlcMsgs, 0, dataRead, 0, sdlcMsgs.Length); + + return (uint)sdlcMsgs.Length; + } + + /// + /// + /// + void IInstrument.Reset() + { + lock (_syncObj) + { + _guidanceElectronicsUnit.Close(); + _state = State.Uninitialized; + Thread.Sleep(500); + Initialize(); + } + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + /// + void ICommDevice.SetReadTimeout(uint timeoutMs) + { + throw new NotImplementedException(); + } + + /// + /// + /// + void IInstrument.Shutdown() + { + lock (_syncObj) + { + if (_guidanceElectronicsUnit != null) + { + _guidanceElectronicsUnit.LowLevel.HSSub9100.EnableIO = ControlState.Disabled; + + _guidanceElectronicsUnit.Close(); + _guidanceElectronicsUnit.Dispose(); + _state = State.Uninitialized; + } + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + /// + /// + /// + uint ICommDevice.Write(byte[] data, uint numBytesToWrite) + { + lock (_syncObj) + { + if (numBytesToWrite % 4 != 0) + { + throw new Exception("Data is not dword aligned"); + } + + // do all of the HSS Tx only byte order corrections + PerformHssSwirl(ref data, numBytesToWrite / 4); + + var tempArr = new uint[data.Length / 4]; + Buffer.BlockCopy(data, 0, tempArr, 0, (int)numBytesToWrite); + _guidanceElectronicsUnit.GsKwSyncronousDataLinkControl.SendMessage(tempArr); + } + return numBytesToWrite; + } + + public void Close() + { + } + + public void Open() + { + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceGeuSdlc/CommDeviceGeuSdlcFactory.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceGeuSdlc/CommDeviceGeuSdlcFactory.cs index 93dc8ae..6525bfe 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceGeuSdlc/CommDeviceGeuSdlcFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceGeuSdlc/CommDeviceGeuSdlcFactory.cs @@ -32,71 +32,64 @@ // ********************************************************************************************************** // Ignore Spelling: Sdlc Geu -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommDeviceGeuSdlcFactory")] - public class CommDeviceGeuSdlcFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommDeviceGeuSdlcFactory")] + public class CommDeviceGeuSdlcFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommDeviceGeuSdlcFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommDeviceGeuSdlcFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null ) - { - DefaultPath = defaultConfigPath; + public CommDeviceGeuSdlcFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommDeviceGeuSdlcFactory injection constructor + /// + [ImportingConstructor] + public CommDeviceGeuSdlcFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ICommDevice)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommDeviceGeuSdlc(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ICommDevice)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommDeviceGeuSdlc(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -107,12 +100,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommDeviceSim(name, _configurationManager, _logger); + return new CommDeviceSim(name, _configurationManager); else - return new CommDeviceGeuSdlc(name, _configurationManager, _logger); + return new CommDeviceGeuSdlc(name, _configurationManager); } catch (Exception) { @@ -125,17 +116,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerial/CommDeviceSerial.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerial/CommDeviceSerial.cs new file mode 100644 index 0000000..d600286 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerial/CommDeviceSerial.cs @@ -0,0 +1,194 @@ +// ********************************************************************************************************** +// CommDeviceSerialAsync.cs +// 4/3/2024 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** +using System; +using System.IO.Ports; +using NLog; +using Raytheon.Common; + +namespace Raytheon.Instruments +{ + /// + /// A sim communication device + /// + public class CommDeviceSerial : ICommDevice + { + #region PrivateClassMembers + + private int _defaultReadTimeout; + private int _defaultReadBufferSize; + private object _syncObj = new object(); + + private SerialPort _serialPort; + + private string _comPortName; + private int _baudRate; + private Parity _parity; + private int _dataBits; + private StopBits _stopBits; + + private readonly string _name; + private State _state; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + public bool ClearErrors() => false; + public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } + public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } + public string DetailedStatus => $"This is a TCP/IP Device called {_name}"; + public InstrumentMetadata Info => throw new NotImplementedException(); + public State Status => _state; + public string Name => _name; + public SelfTestResult PerformSelfTest() => SelfTestResult; + public SelfTestResult SelfTestResult => SelfTestResult.Unknown; + + public void Close() => Shutdown(); + public void Reset() + { + Close(); + Open(); + } + + #region Public Functions + + /// + /// CommDevice factory constructor + /// + /// + /// + public CommDeviceSerial(string deviceName, IConfigurationManager configurationManager) + { + _name = deviceName; + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(deviceName); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _comPortName = _configuration.GetConfigurationValue(_name, "COMPortName"); + int.TryParse(_configuration.GetConfigurationValue(_name, "BaudRate"), out _baudRate); + Enum.TryParse(_configuration.GetConfigurationValue(_name, "Parity"), true, out _parity); + int.TryParse(_configuration.GetConfigurationValue(_name, "DataBits"), out _dataBits); + Enum.TryParse(_configuration.GetConfigurationValue(_name, "StopBits"), true, out _stopBits); + + int.TryParse(_configuration.GetConfigurationValue(_name, "ReadTimeout"), out _defaultReadTimeout); + int.TryParse(_configuration.GetConfigurationValue(_name, "BufferSize"), out _defaultReadBufferSize); + + _state = State.Uninitialized; + } + + /// + /// Destructor + /// + ~CommDeviceSerial() + { + Shutdown(); + } + + /// + /// initialize instrument + /// + public void Initialize() + { + Open(); + } + + /// + /// Opens COM serial port for communications + /// + public void Open() + { + if (_state == State.Uninitialized) + { + _serialPort = new SerialPort(_comPortName, _baudRate, _parity, _dataBits, _stopBits); + _serialPort.Open(); + _serialPort.ReadTimeout = _defaultReadTimeout; + _state = State.Ready; + } + } + + /// + /// shuts down the device + /// + public void Shutdown() + { + if (_serialPort != null) + _serialPort.Close(); + + _state = State.Uninitialized; + } + + /// + /// Read data from the device asynchronously. + /// + /// The buffer to put the data in + /// The number of bytes read + public uint Read(ref byte[] dataRead) + { + if (dataRead == null) + dataRead = new byte[_defaultReadBufferSize]; + + var bytesRead = _serialPort.Read(dataRead, 0, dataRead.Length); + return (uint)bytesRead; + } + + /// + /// Sets the read timeout + /// + /// + public void SetReadTimeout(uint timeoutMs) + { + if (timeoutMs > 0) + _serialPort.ReadTimeout = (int)timeoutMs; + else + _serialPort.ReadTimeout = _defaultReadTimeout; + } + + /// + /// Write data to the device asynchronously + /// + /// + /// + /// + public uint Write(byte[] dataToSend, uint numBytesToWrite) + { + _serialPort.Write(dataToSend, 0, (int)numBytesToWrite); + + return 0; + } + + #endregion + } +} diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/COECommDevice.csproj b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerial/CommDeviceSerial.csproj similarity index 72% rename from Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/COECommDevice.csproj rename to Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerial/CommDeviceSerial.csproj index cea9768..edeb0c2 100644 --- a/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/COECommDevice.csproj +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerial/CommDeviceSerial.csproj @@ -3,25 +3,24 @@ net472 - Raytheon.Instruments.COECommDevice - Specialized instrument for running real time Build In Tests via COE implementing ICommDevice interface - + Raytheon.Instruments.CommDeviceSerial + CommDevice Serial implementation + CommDevice Serial COM implementation + Library 1.0.0 - true - - + diff --git a/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/COECommDeviceInstrumentFactory.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerial/CommDeviceSerialFactory.cs similarity index 71% rename from Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/COECommDeviceInstrumentFactory.cs rename to Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerial/CommDeviceSerialFactory.cs index b0b1cdb..cae9ad8 100644 --- a/Source/TSRealLib/HAL/Implementations/BIT/COECommDevice/COECommDeviceInstrumentFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerial/CommDeviceSerialFactory.cs @@ -1,6 +1,6 @@ // ********************************************************************************************************** -// COECommDeviceInstrumentFactory.cs -// 5/18/2022 +// CommDeviceSerialAsyncFactory.cs +// 4/3/2024 // NGI - Next Generation Interceptor // // Contract No. HQ0856-21-C-0003/1022000209 @@ -30,47 +30,35 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "COECommDeviceInstrumentFactory")] - public class COECommDeviceInstrumentFactory : IInstrumentFactory + [ExportInstrumentFactory(ModelNumber = "CommDeviceSerialFactory")] + public class CommDeviceSerialFactory : IInstrumentFactory { - /// - /// - /// - private ILogger _logger; - /// - /// The supported interfaces - /// private readonly List _supportedInterfaces = new List(); private readonly IConfigurationManager _configurationManager; private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; private static string DefaultPath; - private readonly DriverType _driverType; - public COECommDeviceInstrumentFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) + public CommDeviceSerialFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) { } /// - /// COECommDeviceInstrumentFactory injection constructor + /// CommDeviceSerialFactory injection constructor /// - /// - /// - /// [ImportingConstructor] - public COECommDeviceInstrumentFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null, - [Import(AllowDefault = true)] DriverType driverType = DriverType.TCP) + public CommDeviceSerialFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) { DefaultPath = defaultConfigPath; @@ -81,11 +69,10 @@ namespace Raytheon.Instruments } _configurationManager = configManager ?? GetConfigurationManager(); - _driverType = driverType; _supportedInterfaces.Add(typeof(ICommDevice)); } /// - /// + /// Gets the instrument /// /// /// @@ -93,13 +80,11 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - return new COECommDeviceInstrument(name, _configurationManager, _driverType); + return new CommDeviceSerial(name, _configurationManager); } - catch (Exception ex) + catch (Exception) { - _logger.Error(ex, $"Unable to construct {name} instrument instance"); - return null; + throw; } } @@ -112,9 +97,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new COECommDeviceInstrument(name, _configurationManager, _driverType, _logger); + if (simulateHw) + return new CommDeviceSim(name, _configurationManager); + else + return new CommDeviceSerial(name, _configurationManager); } catch (Exception) { @@ -123,7 +109,7 @@ namespace Raytheon.Instruments } /// - /// + /// Gets supported interfaces /// /// public ICollection GetSupportedInterfaces() @@ -132,13 +118,12 @@ namespace Raytheon.Instruments } /// - /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService /// /// private static IConfigurationManager GetConfigurationManager() { return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); } - } -} +} \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerialAsync/CommDeviceSerialAsync.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerialAsync/CommDeviceSerialAsync.cs index c78f736..6e17952 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerialAsync/CommDeviceSerialAsync.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerialAsync/CommDeviceSerialAsync.cs @@ -30,387 +30,314 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** +using System; +using System.IO.Ports; +using System.Threading; +using System.Threading.Tasks; using NLog; using Raytheon.Common; -using System; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; -using System.Threading; -using System.Reflection; -using System.IO.Ports; namespace Raytheon.Instruments { - /// - /// A sim communication device - /// - public class CommDeviceSerialAsync : ICommAsync - { - #region PrivateClassMembers + /// + /// A sim communication device + /// + public class CommDeviceSerialAsync : ICommAsync + { + #region PrivateClassMembers - private uint _defaultReadTimeout; - private uint _defaultSendTimeout; - private uint _defaultReadBufferSize; - private static readonly object _syncObj = new object(); + private uint _defaultReadTimeout; + private uint _defaultSendTimeout; + private uint _defaultReadBufferSize; + private object _syncObj = new object(); - private SerialPort _serialPort; + private SerialPort _serialPort; - private readonly string _comPortName; - private readonly int _baudRate; - private readonly Parity _parity; - private readonly int _dataBits; - private readonly StopBits _stopBits; + private string _comPortName; + private int _baudRate; + private Parity _parity; + private int _dataBits; + private StopBits _stopBits; - private readonly string _name; - private State _state; + private readonly string _name; + private State _state; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - public bool ClearErrors() => false; - public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } - public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } - public string DetailedStatus => $"This is a TCP/IP Device called {_name}"; - public InstrumentMetadata Info => throw new NotImplementedException(); - public State Status => _state; - public string Name => _name; - public SelfTestResult PerformSelfTest() => SelfTestResult; - public SelfTestResult SelfTestResult => SelfTestResult.Unknown; + #endregion - public void Close() => Shutdown(); - public void Reset() - { - Close(); - Open(); - } + public bool ClearErrors() => false; + public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } + public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } + public string DetailedStatus => $"This is a TCP/IP Device called {_name}"; + public InstrumentMetadata Info => throw new NotImplementedException(); + public State Status => _state; + public string Name => _name; + public SelfTestResult PerformSelfTest() => SelfTestResult; + public SelfTestResult SelfTestResult => SelfTestResult.Unknown; - #region Private Functions - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - try - { - lock (_syncObj) - { - Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception err) - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - } + public void Close() => Shutdown(); + public void Reset() + { + Close(); + Open(); + } - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // close the socket - try - { - Shutdown(); - } - catch (Exception err) - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - } - } + #region Public Functions - #endregion + /// + /// CommDevice factory constructor + /// + /// + /// + public CommDeviceSerialAsync(string deviceName, IConfigurationManager configurationManager) + { + _name = deviceName; + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(deviceName); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - #region Public Functions + _comPortName = _configuration.GetConfigurationValue(_name, "COMPortName"); + int.TryParse(_configuration.GetConfigurationValue(_name, "BaudRate"), out _baudRate); + Enum.TryParse(_configuration.GetConfigurationValue(_name, "Parity"), true, out _parity); + int.TryParse(_configuration.GetConfigurationValue(_name, "DataBits"), out _dataBits); + Enum.TryParse(_configuration.GetConfigurationValue(_name, "StopBits"), true, out _stopBits); - /// - /// CommDevice factory constructor - /// - /// - /// - public CommDeviceSerialAsync(string name, IConfigurationManager configurationManager, ILogger logger) - { - _name = name; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(name); - _logger = logger; + uint.TryParse(_configuration.GetConfigurationValue(_name, "ReadTimeout"), out _defaultReadTimeout); + uint.TryParse(_configuration.GetConfigurationValue(_name, "SendTimeout"), out _defaultSendTimeout); + uint.TryParse(_configuration.GetConfigurationValue(_name, "BufferSize"), out _defaultReadBufferSize); - _comPortName = _configuration.GetConfigurationValue("CommDeviceSerialAsync", "COMPortName", "COM15"); - _baudRate = _configuration.GetConfigurationValue("CommDeviceSerialAsync", "BaudRate", 115200); - _parity = _configuration.GetConfigurationValue("CommDeviceSerialAsync", "Parity", Parity.None); - _dataBits = _configuration.GetConfigurationValue("CommDeviceSerialAsync", "DataBits", 8); - _stopBits = _configuration.GetConfigurationValue("CommDeviceSerialAsync", "StopBits", StopBits.One); + _state = State.Uninitialized; + } - _defaultReadTimeout = _configuration.GetConfigurationValue("CommDeviceSerialAsync", "ReadTimeout", 25); - _defaultSendTimeout = _configuration.GetConfigurationValue("CommDeviceSerialAsync", "SendTimeout", 5000); - _defaultReadBufferSize = _configuration.GetConfigurationValue("CommDeviceSerialAsync", "BufferSize", 1024); + /// + /// Destructor + /// + ~CommDeviceSerialAsync() + { + Shutdown(); + } - _state = State.Uninitialized; - } + /// + /// initialize instrument + /// + public void Initialize() + { + Open(); + } - /// - /// initialize instrument - /// - public void Initialize() - { - if (_state != State.Uninitialized) - { - _logger.Warn("Reinitialization of existing Serial Async Connection. Attempting to call Shutdown."); - Shutdown(); - } + /// + /// Opens COM serial port for communications + /// + public void Open() + { + if (_state == State.Uninitialized) + { + _serialPort = new SerialPort(_comPortName, _baudRate, _parity, _dataBits, _stopBits); + _serialPort.Open(); + _state = State.Ready; + } + } - _serialPort = new SerialPort(_comPortName, _baudRate, _parity, _dataBits, _stopBits); + /// + /// shuts down the device + /// + public void Shutdown() + { + if (_serialPort != null) + _serialPort.Close(); - Open(); - } + _state = State.Uninitialized; + } - /// - /// Opens COM serial port for communications - /// - public void Open() - { - try - { - _serialPort.Open(); - _state = State.Ready; - } - catch (Exception ex) - { - _logger.Error(ex, ex.Message); - throw; - } - } + /// + /// Read data from the device asynchronously. + /// + /// The buffer to put the data in + /// The number of bytes read + public async Task ReadAsync(byte[] dataRead, CancellationToken token = default) + { + var bytesRead = await _serialPort.BaseStream.ReadAsync(dataRead, 0, dataRead.Length, token); + return (uint)bytesRead; + } - /// - /// shuts down the device - /// - public void Shutdown() - { - _logger.Debug("Shutting down"); + /// + /// Read string from the device asynchronously. + /// + /// The buffer to put the data in + /// The number of bytes read + public async Task ReadAsync(CancellationToken token = default) + { + var data = await ReadLineAsync(token); + return data; + } - _serialPort.Close(); + /// + /// Sets the read timeout + /// + /// + public void SetReadTimeout(uint timeoutMs) + { + if (_serialPort == null) + return; - _state = State.Uninitialized; - } + _serialPort.ReadTimeout = (int)timeoutMs; + } - /// - /// Read data from the device asynchronously. - /// - /// The buffer to put the data in - /// The number of bytes read - public async Task ReadAsync(byte[] dataRead, CancellationToken token = default) - { - var bytesRead = await _serialPort.BaseStream.ReadAsync(dataRead, 0, dataRead.Length, token); - return (uint)bytesRead; - } + /// + /// Write data to the device asynchronously + /// + /// + /// + /// + public async Task WriteAsync(byte[] dataToSend, uint numBytesToWrite, CancellationToken token = default) + { + if (_serialPort == null || !_serialPort.IsOpen) + return 0; - /// - /// Read string from the device asynchronously. - /// - /// The buffer to put the data in - /// The number of bytes read - public async Task ReadAsync(CancellationToken token = default) - { - var data = await ReadLineAsync(token); - return data; - } + await _serialPort.BaseStream.WriteAsync(dataToSend, 0, (int)numBytesToWrite, token); + return numBytesToWrite; + } - /// - /// Sets the read timeout - /// - /// - public void SetReadTimeout(uint timeoutMs) - { - if (_serialPort == null) - return; + /// + /// Write string data to the device asynchronously + /// + /// + /// + public async Task WriteAsync(string message, CancellationToken token = default) + { + if (_serialPort == null || !_serialPort.IsOpen) + return; - _logger.Trace($"Setting Reader Timeout: {timeoutMs} Ms"); - _serialPort.ReadTimeout = (int)timeoutMs; - } + await WriteLineAsync(message, token); + } - /// - /// Write data to the device asynchronously - /// - /// - /// - /// - public async Task WriteAsync(byte[] dataToSend, uint numBytesToWrite, CancellationToken token = default) - { - if (_serialPort == null || !_serialPort.IsOpen) - return 0; + /// + /// Send Command and Get Response asynchronously + /// + /// + /// + /// + public async Task SendCommandGetResponseAsync(string message, CancellationToken cancellationToken = default, int timeoutInMs = 5000) + { + if (_serialPort == null || !_serialPort.IsOpen) + return null; - _logger.Trace($"Writing message to ({_comPortName}), bytes: {dataToSend?.Length}"); + using (var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) + { + if (cancellationToken == default) + { + cancellationToken = cts.Token; + } + await WriteAsync(message, cancellationToken); + string readResponse = await ReadAsync(cancellationToken); + return readResponse; + } + } - await _serialPort.BaseStream.WriteAsync(dataToSend, 0, (int)numBytesToWrite, token); - return numBytesToWrite; - } + /// + /// Send Command and Get Response asynchronously + /// + /// + /// + /// + public async Task SendCommandGetResponseAsync(byte[] data, CancellationToken token = default, int timeoutInMs = 5000) + { + if (_serialPort == null || !_serialPort.IsOpen) + return null; - /// - /// Write string data to the device asynchronously - /// - /// - /// - public async Task WriteAsync(string message, CancellationToken token = default) - { - if (_serialPort == null || !_serialPort.IsOpen) - return; + await WriteAsync(data, (uint)data.Length, token); + _serialPort.ReadTimeout = timeoutInMs; + var response = new byte[data.Length]; + await ReadAsync(response, token); + return response; + } - _logger.Trace($"Writing message to ({_comPortName}), message: {message}"); - await WriteLineAsync(message, token); - } + /// + /// keeps reading until canceled via token, + /// received messages sent to dataReceived function + /// + /// + /// + /// + public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) + { + if (_serialPort == null || !_serialPort.IsOpen) + return; - /// - /// Send Command and Get Response asynchronously - /// - /// - /// - /// - public async Task SendCommandGetResponseAsync(string message, CancellationToken cancellationToken = default, int timeoutInMs = 5000) - { - if (_serialPort == null || !_serialPort.IsOpen) - return null; + while (!cancellationToken.IsCancellationRequested) + { + var data = await ReadAsync(cancellationToken); + dataReceived?.Invoke(data); + } + } - _logger.Trace($"Sending command waiting for response from ({_comPortName}), message: {message}"); + /// + /// keeps reading until canceled via token, + /// received messages sent to dataReceived function + /// + /// + /// + /// + public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) + { + if (_serialPort == null || !_serialPort.IsOpen) + return; - using (var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) - { - if (cancellationToken == default) - { - cancellationToken = cts.Token; - } - await WriteAsync(message, cancellationToken); - string readResponse = await ReadAsync(cancellationToken); - _logger.Trace($"Received response: {readResponse}"); - return readResponse; - } - } + while (!cancellationToken.IsCancellationRequested) + { + var data = new byte[_defaultReadBufferSize]; // Adjust buffer size as needed + var bytesRead = await ReadAsync(data, cancellationToken); + Array.Resize(ref data, (int)bytesRead); + dataReceived?.Invoke(data); + } + } - /// - /// Send Command and Get Response asynchronously - /// - /// - /// - /// - public async Task SendCommandGetResponseAsync(byte[] data, CancellationToken token = default, int timeoutInMs = 5000) - { - if (_serialPort == null || !_serialPort.IsOpen) - return null; + #endregion - _logger.Trace($"Sending command waiting for response from ({_comPortName}), message: {data}"); + #region private functions + /// + /// reads line async + /// + /// + /// + private async Task ReadLineAsync(CancellationToken cancellationToken = default) + { + try + { + cancellationToken.ThrowIfCancellationRequested(); + var line = await Task.Run(() => _serialPort.ReadLine(), cancellationToken); + return line; + } + catch (OperationCanceledException ex) + { + _logger.Error(ex, ex.Message); + return null; + } + } - await WriteAsync(data, (uint)data.Length, token); - _serialPort.ReadTimeout = timeoutInMs; - var response = new byte[data.Length]; - await ReadAsync(response, token); - return response; - } + /// + /// writes line async + /// + /// + /// + /// + private async Task WriteLineAsync(string message, CancellationToken cancellationToken = default) + { + try + { + cancellationToken.ThrowIfCancellationRequested(); + await Task.Run(() => _serialPort.WriteLine(message), cancellationToken); + } + catch (OperationCanceledException ex) + { + _logger.Error(ex, ex.Message); + } + } - /// - /// keeps reading until canceled via token, - /// received messages sent to dataReceived function - /// - /// - /// - /// - public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) - { - if (_serialPort == null || !_serialPort.IsOpen) - return; - - _logger.Debug($"Starting continuous reading from {_comPortName} ..."); - - while (!cancellationToken.IsCancellationRequested) - { - var data = await ReadAsync(cancellationToken); - dataReceived?.Invoke(data); - } - - _logger.Debug($"Finished continuous reading from {_comPortName} ..."); - } - - /// - /// keeps reading until canceled via token, - /// received messages sent to dataReceived function - /// - /// - /// - /// - public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) - { - if (_serialPort == null || !_serialPort.IsOpen) - return; - - _logger.Debug($"Starting continuous reading from {_comPortName} ..."); - - while (!cancellationToken.IsCancellationRequested) - { - var data = new byte[_defaultReadBufferSize]; // Adjust buffer size as needed - var bytesRead = await ReadAsync(data, cancellationToken); - Array.Resize(ref data, (int)bytesRead); - dataReceived?.Invoke(data); - } - - _logger.Debug($"Finished continuous reading from {_comPortName} ..."); - } - - #endregion - - #region private functions - /// - /// reads line async - /// - /// - /// - private async Task ReadLineAsync(CancellationToken cancellationToken = default) - { - try - { - cancellationToken.ThrowIfCancellationRequested(); - var line = await Task.Run(() => _serialPort.ReadLine(), cancellationToken); - return line; - } - catch (OperationCanceledException ex) - { - _logger.Error(ex, ex.Message); - return null; - } - } - - /// - /// writes line async - /// - /// - /// - /// - private async Task WriteLineAsync(string message, CancellationToken cancellationToken = default) - { - try - { - cancellationToken.ThrowIfCancellationRequested(); - await Task.Run(() => _serialPort.WriteLine(message), cancellationToken); - } - catch (OperationCanceledException ex) - { - _logger.Error(ex, ex.Message); - } - } - - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerialAsync/CommDeviceSerialAsyncFactory.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerialAsync/CommDeviceSerialAsyncFactory.cs index 66c6d78..f0fbc7e 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerialAsync/CommDeviceSerialAsyncFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSerialAsync/CommDeviceSerialAsyncFactory.cs @@ -30,71 +30,63 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommDeviceSerialAsyncFactory")] - public class CommDeviceSerialAsyncFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommDeviceSerialAsyncFactory")] + public class CommDeviceSerialAsyncFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - public CommDeviceSerialAsyncFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + public CommDeviceSerialAsyncFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommDeviceSerialAsyncFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + /// + /// CommDeviceSerialAsyncFactory injection constructor + /// + [ImportingConstructor] + public CommDeviceSerialAsyncFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ICommAsync)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommDeviceSerialAsync(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ICommAsync)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommDeviceSerialAsync(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +97,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new CommDeviceSerialAsync(name, _configurationManager, _logger); + return new CommDeviceSerialAsync(name, _configurationManager); } catch (Exception) { @@ -120,17 +110,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSim/CommDeviceSim.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSim/CommDeviceSim.cs index ab720a4..7bdf88a 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSim/CommDeviceSim.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSim/CommDeviceSim.cs @@ -15,301 +15,296 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; using NLog; using Raytheon.Common; -using System; namespace Raytheon.Instruments { - /// - /// A sim communication device - /// - public class CommDeviceSim : ICommDevice - { - #region PrivateClassMembers - private static object _syncObj = new Object(); - private readonly string _name; - private SelfTestResult _selfTestResult; - private State _state; + /// + /// A sim communication device + /// + public class CommDeviceSim : ICommDevice + { + #region PrivateClassMembers + private static object _syncObj = new Object(); + private readonly string _name; + private SelfTestResult _selfTestResult; + private State _state; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions - /// - /// The Finalizer - /// - ~CommDeviceSim() - { - Dispose(false); - } + #endregion - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - } + #region PrivateFunctions + /// + /// The Finalizer + /// + ~CommDeviceSim() + { + Dispose(false); + } - #endregion + /// + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + } - #region PublicFuctions + #endregion - /// - /// CommDevice factory constructor - /// - /// - /// - public CommDeviceSim(string name, IConfigurationManager configurationManager, ILogger logger) - { - _name = name; - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; + #region PublicFuctions - _logger = logger; + /// + /// CommDevice factory constructor + /// + /// + /// + public CommDeviceSim(string deviceName, IConfigurationManager configurationManager) + { + _name = deviceName; + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - } + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + } - /// - /// - /// - /// - public CommDeviceSim(string name) - { - _name = name; - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - _logger = LogManager.GetCurrentClassLogger(); - } + /// + /// + /// + /// + public CommDeviceSim(string deviceName) + { + _name = deviceName; + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Comm Device Sim called " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Comm Device Sim called " + _name; + } + } - /// - /// Dispose of the resources - /// - public void Dispose() - { - Dispose(true); + /// + /// Dispose of the resources + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on device " + _name); - } - } - } + /// + /// + /// + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on device " + _name); + } + } + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + } - /// - /// - /// - /*public void Open() + /// + /// + /// + /*public void Open() { lock (_syncObj) { } }*/ - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - lock (_syncObj) - { - _selfTestResult = SelfTestResult.Pass; - return _selfTestResult; - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + _selfTestResult = SelfTestResult.Pass; + return _selfTestResult; + } + } - /// - /// Read data from the device. - /// - /// The buffer to put the data in - /// The number of bytes read - public uint Read(ref byte[] dataRead) - { - lock (_syncObj) - { - return (uint)dataRead.Length; - } - } + /// + /// Read data from the device. + /// + /// The buffer to put the data in + /// The number of bytes read + public uint Read(ref byte[] dataRead) + { + lock (_syncObj) + { + return (uint)dataRead.Length; + } + } - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { - } - } + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + } + } - /// - /// Sets the read timeout - /// - /// - public void SetReadTimeout(uint timeout) - { - lock (_syncObj) - { - } - } + /// + /// Sets the read timeout + /// + /// + public void SetReadTimeout(uint timeout) + { + lock (_syncObj) + { + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Shutdown() - { - lock (_syncObj) - { - _state = State.Uninitialized; - } - } + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + _state = State.Uninitialized; + } + } - /// - /// Write data to the device - /// - /// The data to write - /// The number of bytes to write - /// THe number of bytes that were written - public uint Write(byte[] dataToSend, uint numBytesToWrite) - { - lock (_syncObj) - { - return numBytesToWrite; - } - } + /// + /// Write data to the device + /// + /// The data to write + /// The number of bytes to write + /// THe number of bytes that were written + public uint Write(byte[] dataToSend, uint numBytesToWrite) + { + lock (_syncObj) + { + return numBytesToWrite; + } + } - public void Close() - { - throw new NotImplementedException(); - } + public void Close() + { + throw new NotImplementedException(); + } - public void Open() - { - throw new NotImplementedException(); - } - #endregion - } + public void Open() + { + throw new NotImplementedException(); + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSim/CommDeviceSimFactory.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSim/CommDeviceSimFactory.cs index 95b3a6c..946b8c9 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSim/CommDeviceSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSim/CommDeviceSimFactory.cs @@ -1,68 +1,61 @@ -using NLog; -using Raytheon.Common; -using System; +using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommDeviceSimFactory")] - public class CommDeviceSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommDeviceSimFactory")] + public class CommDeviceSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommDeviceSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommDeviceSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommDeviceSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// COECommDeviceInstrumentFactory injection constructor + /// + [ImportingConstructor] + public CommDeviceSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ICommDevice)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommDeviceSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ICommDevice)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommDeviceSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -73,9 +66,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new CommDeviceSim(name, _configurationManager, _logger); + return new CommDeviceSim(name, _configurationManager); } catch (Exception) { @@ -88,17 +79,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSuperFscc422/CommDeviceSuperFscc422.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSuperFscc422/CommDeviceSuperFscc422.cs index 5075693..b8c446c 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSuperFscc422/CommDeviceSuperFscc422.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSuperFscc422/CommDeviceSuperFscc422.cs @@ -15,503 +15,497 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; using NLog; using Raytheon.Common; -using System; namespace Raytheon.Instruments { - /// - /// Class for controlling a Commtech SUPERFSCC/4-PCIE-11 - /// - public class CommDeviceSuperFscc422 : ICommDevice, IDisposable - { - #region PrivateClassMembers + /// + /// Class for controlling a Commtech SUPERFSCC/4-PCIE-11 + /// + public class CommDeviceSuperFscc422 : ICommDevice, IDisposable + { + #region PrivateClassMembers - private const uint _DEFAULT_READ_TIMEOUT = 10; - private const uint _RX_FIFO_BUFFER_SIZE = 8192; - private const uint _TX_FIFO_BUFFER_SIZE = 4096; - // The Super FSCC can DMA can stream data at 50 Mbits/sec - // The driver automatically transfers data from the FIFO into the MemoryCap which has a configurable size. Default to ~GB + private const uint _DEFAULT_READ_TIMEOUT = 10; + private const uint _RX_FIFO_BUFFER_SIZE = 8192; + private const uint _TX_FIFO_BUFFER_SIZE = 4096; + // The Super FSCC can DMA can stream data at 50 Mbits/sec + // The driver automatically transfers data from the FIFO into the MemoryCap which has a configurable size. Default to ~GB - private uint _readTimeout; - private Fscc.Port _fscc; - private static object _syncObj = new Object(); - private readonly string _name; - private SelfTestResult _selfTestResult; - private State _state; - private readonly uint _portNum; - private readonly uint _clockFreq; - private readonly bool _shallWeReceiveMultiple; - private readonly bool _shallWeAppendStatus; - private readonly uint _bgrRegister; - private readonly uint _ccr0Register; - private readonly uint _ccr0SofResetValue; - private readonly uint _ccr1Register; - private readonly uint _ccr2Register; - private readonly uint _dpllrRegister; - private readonly uint _fcrRegister; - private readonly uint _fifotRegister; - private readonly uint _imrRegister; - private readonly uint _pprRegister; - private readonly uint _ramrRegister; - private readonly uint _rarRegister; - private readonly uint _smrRegister; - private readonly uint _ssrRegister; - private readonly uint _tcrRegister; - private readonly uint _tmrRegister; - private readonly uint _tsrRegister; + private uint _readTimeout; + private Fscc.Port _fscc; + private static object _syncObj = new Object(); + private readonly string _name; + private SelfTestResult _selfTestResult; + private State _state; + private readonly uint _portNum; + private readonly uint _clockFreq; + private readonly bool _shallWeReceiveMultiple; + private readonly bool _shallWeAppendStatus; + private readonly uint _bgrRegister; + private readonly uint _ccr0Register; + private readonly uint _ccr0SofResetValue; + private readonly uint _ccr1Register; + private readonly uint _ccr2Register; + private readonly uint _dpllrRegister; + private readonly uint _fcrRegister; + private readonly uint _fifotRegister; + private readonly uint _imrRegister; + private readonly uint _pprRegister; + private readonly uint _ramrRegister; + private readonly uint _rarRegister; + private readonly uint _smrRegister; + private readonly uint _ssrRegister; + private readonly uint _tcrRegister; + private readonly uint _tmrRegister; + private readonly uint _tsrRegister; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFuctions + + /// + /// The Finalizer + /// + ~CommDeviceSuperFscc422() + { + Dispose(false); + } + + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + try + { + if (disposing) + { + if (_state == State.Ready) + { + _fscc.Dispose(); + + _state = State.Uninitialized; + } + } + } + catch (Exception err) + { + try + { + _logger.Error(err.Message + "\r\n" + err.StackTrace); + } + catch (Exception) + { + //Do not rethrow. Exception from error logger that has already been garbage collected + } + } + } + + #endregion + + #region PublicFuctions + + /// + /// CommDevice factory constructor + /// + /// + /// + public CommDeviceSuperFscc422(string deviceName, IConfigurationManager configurationManager) + { + _name = deviceName; + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _portNum = _configuration.GetConfigurationValue("SuperFscc422", "PortNum", 0); + _clockFreq = _configuration.GetConfigurationValue("SuperFscc422", "ClockFreq", 0); + _shallWeReceiveMultiple = _configuration.GetConfigurationValue("SuperFscc422", "ShallWeReceiveMultiple", false); + _shallWeAppendStatus = _configuration.GetConfigurationValue("SuperFscc422", "ShallWeAppendStatus", false); + _bgrRegister = _configuration.GetConfigurationValue("SuperFscc422", "BgrRegister", 0); + _ccr0Register = _configuration.GetConfigurationValue("SuperFscc422", "Ccr0Register", 0); + _ccr0SofResetValue = _configuration.GetConfigurationValue("SuperFscc422", "Ccr0SofResetValue", 0); + _ccr1Register = _configuration.GetConfigurationValue("SuperFscc422", "Ccr1Register", 0); + _ccr2Register = _configuration.GetConfigurationValue("SuperFscc422", "Ccr2Register", 0); + _dpllrRegister = _configuration.GetConfigurationValue("SuperFscc422", "DpllrRegister", 0); + _fcrRegister = _configuration.GetConfigurationValue("SuperFscc422", "FcrRegister", 0); + _fifotRegister = _configuration.GetConfigurationValue("SuperFscc422", "FifotRegister", 0); + _imrRegister = _configuration.GetConfigurationValue("SuperFscc422", "ImrRegister", 0); + _pprRegister = _configuration.GetConfigurationValue("SuperFscc422", "PprRegister", 0); + _ramrRegister = _configuration.GetConfigurationValue("SuperFscc422", "RamrRegister", 0); + _rarRegister = _configuration.GetConfigurationValue("SuperFscc422", "RarRegister", 0); + _smrRegister = _configuration.GetConfigurationValue("SuperFscc422", "SmrRegister", 0); + _ssrRegister = _configuration.GetConfigurationValue("SuperFscc422", "SsrRegister", 0); + _tcrRegister = _configuration.GetConfigurationValue("SuperFscc422", "TcrRegister", 0); + _tmrRegister = _configuration.GetConfigurationValue("SuperFscc422", "TmrRegister", 0); + _tsrRegister = _configuration.GetConfigurationValue("SuperFscc422", "TsrRegister", 0); + + _readTimeout = _DEFAULT_READ_TIMEOUT; + + // created in Initialize() + _fscc = null; + } - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + /// + /// Opens the port and initializes the registers + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public CommDeviceSuperFscc422(string deviceName, uint portNum, uint clockFreq, bool shallWeReceiveMultiple, bool shallWeAppendStatus, uint bgrRegister, uint ccr0Register, + uint ccr0SofResetValue, uint ccr1Register, uint ccr2Register, uint dpllrRegister, uint fcrRegister, uint fifotRegister, + uint imrRegister, uint pprRegister, uint ramrRegister, uint rarRegister, uint smrRegister, uint ssrRegister, uint tcrRegister, uint tmrRegister, uint tsrRegister) + { + _name = deviceName; + _portNum = portNum; + _clockFreq = clockFreq; + _shallWeReceiveMultiple = shallWeReceiveMultiple; + _shallWeAppendStatus = shallWeAppendStatus; + _bgrRegister = bgrRegister; + _ccr0Register = ccr0Register; + _ccr0SofResetValue = ccr0SofResetValue; + _ccr1Register = ccr1Register; + _ccr2Register = ccr2Register; + _dpllrRegister = dpllrRegister; + _fcrRegister = fcrRegister; + _fifotRegister = fifotRegister; + _imrRegister = imrRegister; + _pprRegister = pprRegister; + _ramrRegister = ramrRegister; + _rarRegister = rarRegister; + _smrRegister = smrRegister; + _ssrRegister = ssrRegister; + _tcrRegister = tcrRegister; + _tmrRegister = tmrRegister; + _tsrRegister = tsrRegister; - #endregion + _readTimeout = _DEFAULT_READ_TIMEOUT; - #region PrivateFuctions + // created in Initialize() + _fscc = null; - /// - /// The Finalizer - /// - ~CommDeviceSuperFscc422() - { - Dispose(false); - } + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _fscc.Dispose(); + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } - _state = State.Uninitialized; - } - } - } - catch (Exception err) - { - try - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - #endregion + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - #region PublicFuctions + set + { + throw new NotImplementedException(); + } + } - /// - /// CommDevice factory constructor - /// - /// - /// - public CommDeviceSuperFscc422(string name, IConfigurationManager configurationManager, ILogger logger) - { - _name = name; - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a FSCC 422 Device called " + _name; + } + } - _logger = logger; + /// + /// Dispose of the resources contained by this object + /// + public void Dispose() + { + lock (_syncObj) + { + try + { + Dispose(true); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + GC.SuppressFinalize(this); + } + catch (Exception err) + { + try + { + _logger.Error(err.Message + "\r\n" + err.StackTrace); + } + catch (Exception) + { + //Do not rethrow. Exception from error logger that has already been garbage collected + } + } + } + } - _portNum = _configuration.GetConfigurationValue("SuperFscc422", "PortNum", 0); - _clockFreq = _configuration.GetConfigurationValue("SuperFscc422", "ClockFreq", 0); - _shallWeReceiveMultiple = _configuration.GetConfigurationValue("SuperFscc422", "ShallWeReceiveMultiple", false); - _shallWeAppendStatus = _configuration.GetConfigurationValue("SuperFscc422", "ShallWeAppendStatus", false); - _bgrRegister = _configuration.GetConfigurationValue("SuperFscc422", "BgrRegister", 0); - _ccr0Register = _configuration.GetConfigurationValue("SuperFscc422", "Ccr0Register", 0); - _ccr0SofResetValue = _configuration.GetConfigurationValue("SuperFscc422", "Ccr0SofResetValue", 0); - _ccr1Register = _configuration.GetConfigurationValue("SuperFscc422", "Ccr1Register", 0); - _ccr2Register = _configuration.GetConfigurationValue("SuperFscc422", "Ccr2Register", 0); - _dpllrRegister = _configuration.GetConfigurationValue("SuperFscc422", "DpllrRegister", 0); - _fcrRegister = _configuration.GetConfigurationValue("SuperFscc422", "FcrRegister", 0); - _fifotRegister = _configuration.GetConfigurationValue("SuperFscc422", "FifotRegister", 0); - _imrRegister = _configuration.GetConfigurationValue("SuperFscc422", "ImrRegister", 0); - _pprRegister = _configuration.GetConfigurationValue("SuperFscc422", "PprRegister", 0); - _ramrRegister = _configuration.GetConfigurationValue("SuperFscc422", "RamrRegister", 0); - _rarRegister = _configuration.GetConfigurationValue("SuperFscc422", "RarRegister", 0); - _smrRegister = _configuration.GetConfigurationValue("SuperFscc422", "SmrRegister", 0); - _ssrRegister = _configuration.GetConfigurationValue("SuperFscc422", "SsrRegister", 0); - _tcrRegister = _configuration.GetConfigurationValue("SuperFscc422", "TcrRegister", 0); - _tmrRegister = _configuration.GetConfigurationValue("SuperFscc422", "TmrRegister", 0); - _tsrRegister = _configuration.GetConfigurationValue("SuperFscc422", "TsrRegister", 0); + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - _readTimeout = _DEFAULT_READ_TIMEOUT; + set + { + throw new NotImplementedException(); + } + } - // created in Initialize() - _fscc = null; - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + /// + /// + /// + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + _fscc = new Fscc.Port(_portNum); - /// - /// Opens the port and initializes the registers - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public CommDeviceSuperFscc422(string name, uint portNum, uint clockFreq, bool shallWeReceiveMultiple, bool shallWeAppendStatus, uint bgrRegister, uint ccr0Register, - uint ccr0SofResetValue, uint ccr1Register, uint ccr2Register, uint dpllrRegister, uint fcrRegister, uint fifotRegister, - uint imrRegister, uint pprRegister, uint ramrRegister, uint rarRegister, uint smrRegister, uint ssrRegister, uint tcrRegister, uint tmrRegister, uint tsrRegister) - { - _name = name; - _portNum = portNum; - _clockFreq = clockFreq; - _shallWeReceiveMultiple = shallWeReceiveMultiple; - _shallWeAppendStatus = shallWeAppendStatus; - _bgrRegister = bgrRegister; - _ccr0Register = ccr0Register; - _ccr0SofResetValue = ccr0SofResetValue; - _ccr1Register = ccr1Register; - _ccr2Register = ccr2Register; - _dpllrRegister = dpllrRegister; - _fcrRegister = fcrRegister; - _fifotRegister = fifotRegister; - _imrRegister = imrRegister; - _pprRegister = pprRegister; - _ramrRegister = ramrRegister; - _rarRegister = rarRegister; - _smrRegister = smrRegister; - _ssrRegister = ssrRegister; - _tcrRegister = tcrRegister; - _tmrRegister = tmrRegister; - _tsrRegister = tsrRegister; + // false means that each read will return a single sdlc packet + // true means that each read will return everything in the buffer (multiple packets) + _fscc.RxMultiple = _shallWeReceiveMultiple; - _readTimeout = _DEFAULT_READ_TIMEOUT; + // if this to true...extra 2 bytes arrive at the end of every frame (first two bytes of STAR) + // The class processing the data needs to be aware of the extra two bytes + _fscc.AppendStatus = _shallWeAppendStatus; - // created in Initialize() - _fscc = null; + // ignore timeouts + _fscc.IgnoreTimeout = true; - _logger = LogManager.GetCurrentClassLogger(); + // purge the port + _fscc.Purge(true, true); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + // set the registers + _fscc.Registers.BGR = _bgrRegister; + _fscc.Registers.CCR0 = _ccr0Register; + _fscc.Registers.CCR1 = _ccr1Register; + _fscc.Registers.CCR2 = _ccr2Register; + _fscc.Registers.DPLLR = _dpllrRegister; + _fscc.Registers.FCR = _fcrRegister; + _fscc.Registers.FIFOT = _fifotRegister; + _fscc.Registers.IMR = _imrRegister; + _fscc.Registers.PPR = _pprRegister; + _fscc.Registers.RAMR = _ramrRegister; + _fscc.Registers.RAR = _rarRegister; + _fscc.Registers.SMR = _smrRegister; + _fscc.Registers.SSR = _ssrRegister; + _fscc.Registers.TCR = _tcrRegister; + _fscc.Registers.TMR = _tmrRegister; + _fscc.Registers.TSR = _tsrRegister; - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + // false means that each read will return a single sdlc packet + // true means that each read will return everything in the buffer (multiple packets) + _fscc.RxMultiple = _shallWeReceiveMultiple; - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + _fscc.ClockFrequency = _clockFreq; - set - { - throw new NotImplementedException(); - } - } + // if this to true...extra 2 bytes arrive at the end of every frame (first two bytes of STAR) + // The class processing the data needs to be aware of the extra two bytes + _fscc.AppendStatus = _shallWeAppendStatus; - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a FSCC 422 Device called " + _name; - } - } + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on device " + _name); + } + } + } - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - lock (_syncObj) - { - try - { - Dispose(true); + /// + /// + /// + public string Name + { + get + { + return _name; + } + } - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// Read data from the device. + /// + /// The buffer to put the data in + /// The number of bytes read + public uint Read(ref byte[] dataRead) + { + lock (_syncObj) + { + uint numBytesRead = _fscc.Read(dataRead, (uint)dataRead.Length, _readTimeout); - set - { - throw new NotImplementedException(); - } - } + return numBytesRead; + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// Soft reset procedure as suggested by the vendor + /// + public void Reset() + { + lock (_syncObj) + { + _fscc.Registers.CCR0 = _ccr0SofResetValue; - /// - /// - /// - public void Initialize() - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - _fscc = new Fscc.Port(_portNum); + _fscc.Purge(true, true); - // false means that each read will return a single sdlc packet - // true means that each read will return everything in the buffer (multiple packets) - _fscc.RxMultiple = _shallWeReceiveMultiple; + _fscc.Registers.CCR0 = _ccr0Register; + } + } - // if this to true...extra 2 bytes arrive at the end of every frame (first two bytes of STAR) - // The class processing the data needs to be aware of the extra two bytes - _fscc.AppendStatus = _shallWeAppendStatus; + /// + /// + /// + /// + public void SetReadTimeout(uint timeoutMs) + { + lock (_syncObj) + { + _readTimeout = timeoutMs; + } + } - // ignore timeouts - _fscc.IgnoreTimeout = true; + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - // purge the port - _fscc.Purge(true, true); + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - // set the registers - _fscc.Registers.BGR = _bgrRegister; - _fscc.Registers.CCR0 = _ccr0Register; - _fscc.Registers.CCR1 = _ccr1Register; - _fscc.Registers.CCR2 = _ccr2Register; - _fscc.Registers.DPLLR = _dpllrRegister; - _fscc.Registers.FCR = _fcrRegister; - _fscc.Registers.FIFOT = _fifotRegister; - _fscc.Registers.IMR = _imrRegister; - _fscc.Registers.PPR = _pprRegister; - _fscc.Registers.RAMR = _ramrRegister; - _fscc.Registers.RAR = _rarRegister; - _fscc.Registers.SMR = _smrRegister; - _fscc.Registers.SSR = _ssrRegister; - _fscc.Registers.TCR = _tcrRegister; - _fscc.Registers.TMR = _tmrRegister; - _fscc.Registers.TSR = _tsrRegister; + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + if (_state == State.Ready) + { + _fscc.Dispose(); - // false means that each read will return a single sdlc packet - // true means that each read will return everything in the buffer (multiple packets) - _fscc.RxMultiple = _shallWeReceiveMultiple; + _state = State.Uninitialized; + } + } + } - _fscc.ClockFrequency = _clockFreq; + /// + /// Write data to the device + /// + /// The data to write + /// The number of bytes to write + /// THe number of bytes that were written + public uint Write(byte[] dataToSend, uint numBytesToWrite) + { + lock (_syncObj) + { + uint numWritten = _fscc.Write(dataToSend, numBytesToWrite); - // if this to true...extra 2 bytes arrive at the end of every frame (first two bytes of STAR) - // The class processing the data needs to be aware of the extra two bytes - _fscc.AppendStatus = _shallWeAppendStatus; + if (numWritten != numBytesToWrite) + { + throw new Exception("num written " + numWritten + " not as expected: " + numBytesToWrite); + } - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on device " + _name); - } - } - } + return numWritten; + } + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - } + public void Close() + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - lock (_syncObj) - { - throw new NotImplementedException(); - } - } + public void Open() + { + throw new NotImplementedException(); + } - /// - /// Read data from the device. - /// - /// The buffer to put the data in - /// The number of bytes read - public uint Read(ref byte[] dataRead) - { - lock (_syncObj) - { - uint numBytesRead = _fscc.Read(dataRead, (uint)dataRead.Length, _readTimeout); - - return numBytesRead; - } - } - - /// - /// Soft reset procedure as suggested by the vendor - /// - public void Reset() - { - lock (_syncObj) - { - _fscc.Registers.CCR0 = _ccr0SofResetValue; - - _fscc.Purge(true, true); - - _fscc.Registers.CCR0 = _ccr0Register; - } - } - - /// - /// - /// - /// - public void SetReadTimeout(uint timeoutMs) - { - lock (_syncObj) - { - _readTimeout = timeoutMs; - } - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// - /// - public void Shutdown() - { - lock (_syncObj) - { - if (_state == State.Ready) - { - _fscc.Dispose(); - - _state = State.Uninitialized; - } - } - } - - /// - /// Write data to the device - /// - /// The data to write - /// The number of bytes to write - /// THe number of bytes that were written - public uint Write(byte[] dataToSend, uint numBytesToWrite) - { - lock (_syncObj) - { - uint numWritten = _fscc.Write(dataToSend, numBytesToWrite); - - if (numWritten != numBytesToWrite) - { - throw new Exception("num written " + numWritten + " not as expected: " + numBytesToWrite); - } - - return numWritten; - } - } - - public void Close() - { - throw new NotImplementedException(); - } - - public void Open() - { - throw new NotImplementedException(); - } - - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSuperFscc422/CommDeviceSuperFscc422Factory.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSuperFscc422/CommDeviceSuperFscc422Factory.cs index e51ed03..7c9c979 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSuperFscc422/CommDeviceSuperFscc422Factory.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceSuperFscc422/CommDeviceSuperFscc422Factory.cs @@ -1,68 +1,60 @@ -using NLog; -using Raytheon.Common; -using System; +using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommDeviceSuperFscc422Factory")] - public class CommDeviceSuperFscc422Factory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommDeviceSuperFscc422Factory")] + public class CommDeviceSuperFscc422Factory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - public CommDeviceSuperFscc422Factory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + public CommDeviceSuperFscc422Factory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommDeviceSuperFscc422Factory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + /// + /// CommDeviceSuperFscc422Factory injection constructor + /// + [ImportingConstructor] + public CommDeviceSuperFscc422Factory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ICommDevice)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommDeviceSuperFscc422(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ICommDevice)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommDeviceSuperFscc422(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -73,12 +65,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommDeviceSim(name, _configurationManager, _logger); + return new CommDeviceSim(name, _configurationManager); else - return new CommDeviceSuperFscc422(name, _configurationManager, _logger); + return new CommDeviceSuperFscc422(name, _configurationManager); } catch (Exception) { @@ -91,71 +81,71 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } - /// - /// - /// - /// - /// - /// - /// - public static ICommDevice CreateFastCommDevice(string instrumentDefFile, string iniSectionName, bool isThereHardware) - { - const string FAST_COMM_FSCC = "FAST_COMM_FSCC"; + /// + /// + /// + /// + /// + /// + /// + public static ICommDevice CreateFastCommDevice(string instrumentDefFile, string iniSectionName, bool isThereHardware) + { + const string FAST_COMM_FSCC = "FAST_COMM_FSCC"; - IniFile iniReader = new IniFile(instrumentDefFile); + IniFile iniReader = new IniFile(instrumentDefFile); - bool shallWeDebug = Convert.ToBoolean(iniReader.ReadValue(FAST_COMM_FSCC, "SHALL_WE_DEBUG")); - uint port = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "PORT")); - uint clock = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CLOCK_FREQUENCY"), 16); - uint bgr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "BGR_REGISTER"), 16); - uint ccr0 = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CCR0_REGISTER"), 16); - uint ccr0Reset = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CCR0_SOF_RESET_VALUE"), 16); - uint ccr1 = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CCR1_REGISTER"), 16); - uint ccr2 = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CCR2_REGISTER"), 16); - uint dpllr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "DPLLR_REGISTER"), 16); - uint fcr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "FCR_REGISTER"), 16); - uint fifot = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "FIFO_T_REGISTER"), 16); - uint imr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "IMR_REGISTER"), 16); - uint ppr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "PPR_REGISTER"), 16); - uint ramr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "RAMR_REGISTER"), 16); - uint rar = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "RAR_REGISTER"), 16); - uint smr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "SMR_REGISTER"), 16); - uint ssr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "SSR_REGISTER"), 16); - uint tcr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "TCR_REGISTER"), 16); - uint tmr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "TMR_REGISTER"), 16); - uint tsr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "TSR_REGISTER"), 16); + bool shallWeDebug = Convert.ToBoolean(iniReader.ReadValue(FAST_COMM_FSCC, "SHALL_WE_DEBUG")); + uint port = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "PORT")); + uint clock = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CLOCK_FREQUENCY"), 16); + uint bgr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "BGR_REGISTER"), 16); + uint ccr0 = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CCR0_REGISTER"), 16); + uint ccr0Reset = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CCR0_SOF_RESET_VALUE"), 16); + uint ccr1 = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CCR1_REGISTER"), 16); + uint ccr2 = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "CCR2_REGISTER"), 16); + uint dpllr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "DPLLR_REGISTER"), 16); + uint fcr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "FCR_REGISTER"), 16); + uint fifot = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "FIFO_T_REGISTER"), 16); + uint imr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "IMR_REGISTER"), 16); + uint ppr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "PPR_REGISTER"), 16); + uint ramr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "RAMR_REGISTER"), 16); + uint rar = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "RAR_REGISTER"), 16); + uint smr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "SMR_REGISTER"), 16); + uint ssr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "SSR_REGISTER"), 16); + uint tcr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "TCR_REGISTER"), 16); + uint tmr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "TMR_REGISTER"), 16); + uint tsr = Convert.ToUInt32(iniReader.ReadValue(FAST_COMM_FSCC, "TSR_REGISTER"), 16); - bool shallWeReceiveMultiple = true; - bool shallWeAppendStatus = false; + bool shallWeReceiveMultiple = true; + bool shallWeAppendStatus = false; - if (shallWeDebug == true) - { - shallWeReceiveMultiple = false; - shallWeAppendStatus = true; - } + if (shallWeDebug == true) + { + shallWeReceiveMultiple = false; + shallWeAppendStatus = true; + } - if (isThereHardware == true) - { - return new CommDeviceSuperFscc422(iniSectionName, port, clock, shallWeReceiveMultiple, shallWeAppendStatus, bgr, ccr0, ccr0Reset, ccr1, ccr2, dpllr, fcr, fifot, imr, ppr, ramr, rar, smr, ssr, tcr, tmr, tsr); - } - else - { - return new CommDeviceSim(iniSectionName); - } - } + if (isThereHardware == true) + { + return new CommDeviceSuperFscc422(iniSectionName, port, clock, shallWeReceiveMultiple, shallWeAppendStatus, bgr, ccr0, ccr0Reset, ccr1, ccr2, dpllr, fcr, fifot, imr, ppr, ramr, rar, smr, ssr, tcr, tmr, tsr); + } + else + { + return new CommDeviceSim(iniSectionName); + } + } - } + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpAsync/CommDeviceTcpAsync.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpAsync/CommDeviceTcpAsync.cs index 0990645..7d5710e 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpAsync/CommDeviceTcpAsync.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpAsync/CommDeviceTcpAsync.cs @@ -30,436 +30,431 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Net; using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; -using System.Threading; using System.Reflection; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A sim communication device - /// - public class CommDeviceTcpAsync : ICommAsync - { - #region PrivateClassMembers - - private uint _defaultReadTimeout; - private uint _defaultSendTimeout; - private uint _defaultReadBufferSize; - private static readonly object _syncObj = new object(); - private TcpClient _tcpClient; - private TcpListener _tcpListener; - private NetworkStream _tcpIpStream; - private int _port; - private string _remoteAddress; - private int _remotePort; - private readonly string _name; - private State _state; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - public bool ClearErrors() => false; - public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } - public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } - public string DetailedStatus => $"This is a TCP/IP Device called {_name}"; - public InstrumentMetadata Info => throw new NotImplementedException(); - public State Status => _state; - public string Name => _name; - public SelfTestResult PerformSelfTest() => SelfTestResult; - public SelfTestResult SelfTestResult => SelfTestResult.Unknown; - public void Open() => Initialize(); - public void Close() => Shutdown(); - public void Reset() - { - Close(); - Open(); - } - - #region Private Functions - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - try - { - lock (_syncObj) - { - Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception err) - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - } - - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // close the socket - try - { - Shutdown(); - } - catch (Exception err) - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - } - } - - #endregion - - #region Public Functions - - /// - /// CommDevice factory constructor - /// - /// - /// - public CommDeviceTcpAsync(string name, IConfigurationManager configurationManager, ILogger logger) - { - _name = name; - - // _tcpClient is created in Initialize() - _tcpClient = null; - _tcpIpStream = null; - - _state = State.Uninitialized; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - } - - /// - /// initialize instrument - /// - public void Initialize() - { - if (_state != State.Uninitialized) - { - _logger.Warn("Reinitialization of existing TCP Async Connection. Attempting to call Shutdown."); - Shutdown(); - } - - _defaultReadTimeout = _configuration.GetConfigurationValue("TcpClient", "ReadTimeout", 25); - _defaultSendTimeout = _configuration.GetConfigurationValue("TcpClient", "SendTimeout", 5000); - _defaultReadBufferSize = _configuration.GetConfigurationValue("TcpClient", "BufferSize", 1024); - - _remoteAddress = _configuration.GetConfigurationValue("TcpClient", "RemoteAddress", "127.0.0.1"); - _port = _configuration.GetConfigurationValue("TcpClient", "Port", 0); - - if (string.IsNullOrEmpty(_remoteAddress)) - { - _tcpListener = new TcpListener(IPAddress.Any, _port); - _tcpListener.Start(); - - _logger.Debug($"{MethodBase.GetCurrentMethod().Name} Started Listening on Port: {_port}"); - - Task.Run(async () => await _tcpListener.AcceptTcpClientAsync()).ContinueWith(t => - { - _tcpClient = t.Result; - - _remoteAddress = ((IPEndPoint)_tcpClient.Client.RemoteEndPoint).Address.ToString(); - _remotePort = ((IPEndPoint)_tcpClient.Client.RemoteEndPoint).Port; - - _logger.Debug($"{MethodBase.GetCurrentMethod().Name} Connection Established from Remote Address: {_remoteAddress}:{_remotePort}"); - - // set timeouts - _tcpClient.Client.SendTimeout = (int)_defaultSendTimeout; - _tcpClient.Client.ReceiveTimeout = (int)_defaultReadTimeout; - - // get the stream - _tcpIpStream = _tcpClient.GetStream(); - - _state = State.Ready; - }); - } - else - { - _remotePort = _port; - _tcpClient = new TcpClient(_remoteAddress, _remotePort); - - _logger.Debug($"{MethodBase.GetCurrentMethod().Name} Connected to Remote Address {_remoteAddress}:{_remotePort}"); - - // set timeouts - _tcpClient.Client.SendTimeout = (int)_defaultSendTimeout; - _tcpClient.Client.ReceiveTimeout = (int)_defaultReadTimeout; - - // get the stream - _tcpIpStream = _tcpClient.GetStream(); - - _state = State.Ready; - } - } - - /// - /// shuts down the device - /// - public void Shutdown() - { - _logger.Debug("Shutting down"); - _tcpClient?.Dispose(); - _tcpClient = null; - - _tcpListener?.Stop(); - _tcpListener = null; - - _tcpIpStream?.Dispose(); - _tcpIpStream = null; - - _state = State.Uninitialized; - } - - /// - /// Read data from the device asynchronously. - /// - /// The buffer to put the data in - /// The number of bytes read - public async Task ReadAsync(byte[] dataRead, CancellationToken token = default) - { - if (_tcpIpStream == null) - return 0; - - if (_tcpIpStream.DataAvailable == true) - { - _state = State.Busy; - var bytesRead = await _tcpIpStream.ReadAsync(dataRead, 0, dataRead.Length, token); - - _logger.Trace($"Reading Data, bytes received: {bytesRead}"); - - _state = State.Ready; - return (uint)bytesRead; - } - else - { - return 0; - } - } - - /// - /// Read string from the device asynchronously. - /// - /// The buffer to put the data in - /// The number of bytes read - public async Task ReadAsync(CancellationToken token = default) - { - if (_tcpIpStream == null) - return null; - - if (_tcpIpStream.DataAvailable == true) - { - _state = State.Busy; - var buffer = new byte[_defaultReadBufferSize]; - var bytesRead = await _tcpIpStream.ReadAsync(buffer, 0, buffer.Length, token); - _state = State.Ready; - - var message = Encoding.UTF8.GetString(buffer, 0, bytesRead); - - _logger.Trace($"Reading Data, message received: {message}"); - - return message; - } - else - { - return null; - } - } - - /// - /// Sets the read timeout - /// - /// - public void SetReadTimeout(uint timeoutMs) - { - _logger.Trace($"Setting Reader Timeout: {timeoutMs} Ms"); - - _tcpClient.Client.ReceiveTimeout = (int)timeoutMs; - } - - /// - /// Write data to the device asynchronously - /// - /// - /// - /// - public async Task WriteAsync(byte[] dataToSend, uint numBytesToWrite, CancellationToken token = default) - { - if (_tcpIpStream == null) - return 0; - - _logger.Trace($"Writing message to ({_remoteAddress}:{_remotePort}), bytes: {dataToSend?.Length}"); - - _state = State.Busy; - await _tcpIpStream.WriteAsync(dataToSend, 0, (int)numBytesToWrite, token); - _state = State.Ready; - return numBytesToWrite; - } - - /// - /// Write string data to the device asynchronously - /// - /// - /// - public async Task WriteAsync(string message, CancellationToken token = default) - { - if (_tcpIpStream == null) - return; - - _logger.Trace($"Writing message to ({_remoteAddress}:{_remotePort}), message: {message}"); - - _state = State.Busy; - var buffer = Encoding.UTF8.GetBytes(message); - await _tcpIpStream.WriteAsync(buffer, 0, buffer.Length, token); - _state = State.Ready; - } - - /// - /// Send Command and Get Response asynchronously - /// - /// - /// - /// - public async Task SendCommandGetResponseAsync(string message, CancellationToken cancellationToken = default, int timeoutInMs = 5000) - { - if (_tcpIpStream == null) - return null; - - _logger.Trace($"Sending command waiting for response from ({_remoteAddress}:{_remotePort}), message: {message}"); - - using (var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) - { - if (cancellationToken == default) - { - cancellationToken = cts.Token; - } - await WriteAsync(message, cancellationToken); - string readResponse = await ReadAsync(cancellationToken); - _logger.Trace($"Received response: {readResponse}"); - return readResponse; - } - } - - /// - /// Send Command and Get Response asynchronously - /// - /// - /// - /// - public async Task SendCommandGetResponseAsync(byte[] data, CancellationToken cancellationToken = default, int timeoutInMs = 5000) - { - if (_tcpIpStream == null) - return null; - - _logger.Trace($"Sending command waiting for response from ({_remoteAddress}:{_remotePort}), message: {data}"); - - using (var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) - { - if (cancellationToken == default) - { - cancellationToken = cts.Token; - } - await WriteAsync(data, (uint)data.Length, cancellationToken); - byte[] buffer = new byte[_defaultReadBufferSize]; - uint bytesRead = await ReadAsync(buffer, cancellationToken); - _logger.Trace($"Received response of size: {bytesRead}"); - - return buffer; - } - } - - /// - /// keeps reading until canceled via token, - /// received messages sent to dataReceived function - /// - /// - /// - /// - public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) - { - _logger.Debug($"Starting continuous reading from {_remoteAddress}:{_remotePort} ..."); - - byte[] buffer = new byte[_defaultReadBufferSize]; - while (!cancellationToken.IsCancellationRequested) - { - if (_tcpIpStream == null) - { - continue; - } - - uint bytesRead = await ReadAsync(buffer, cancellationToken); - if (bytesRead > 0) - { - string data = Encoding.UTF8.GetString(buffer, 0, (int)bytesRead); - - _logger.Trace($"Message received from {_remoteAddress}:{_remotePort}: {data}"); - - dataReceived(data); - Array.Clear(buffer, 0, (int)bytesRead); - } - } - - _logger.Debug($"Finished continuous reading from {_remoteAddress}:{_remotePort} ..."); - } - - /// - /// keeps reading until canceled via token, - /// received messages sent to dataReceived function - /// - /// - /// - /// - public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) - { - _logger.Debug($"Starting continuous reading from {_remoteAddress}:{_remotePort} ..."); - - byte[] buffer = new byte[_defaultReadBufferSize]; - while (!cancellationToken.IsCancellationRequested) - { - if (_tcpIpStream == null) - { - continue; - } - - uint bytesRead = await ReadAsync(buffer, cancellationToken); - if (bytesRead > 0) - { - _logger.Trace($"Message received from {_remoteAddress}:{_remotePort}: size {bytesRead}"); - byte[] bufferCopy = new byte[bytesRead]; - Array.Copy(buffer, bufferCopy, bytesRead); - dataReceived(bufferCopy); - Array.Clear(buffer, 0, (int)bytesRead); - } - } - - _logger.Debug($"Finished continuous reading from {_remoteAddress}:{_remotePort} ..."); - } - - #endregion - } + /// + /// A sim communication device + /// + public class CommDeviceTcpAsync : ICommAsync + { + #region PrivateClassMembers + + private uint _defaultReadTimeout; + private uint _defaultSendTimeout; + private uint _defaultReadBufferSize; + private static readonly object _syncObj = new object(); + private TcpClient _tcpClient; + private TcpListener _tcpListener; + private NetworkStream _tcpIpStream; + private int _port; + private string _remoteAddress; + private int _remotePort; + private readonly string _name; + private State _state; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + public bool ClearErrors() => false; + public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } + public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } + public string DetailedStatus => $"This is a TCP/IP Device called {_name}"; + public InstrumentMetadata Info => throw new NotImplementedException(); + public State Status => _state; + public string Name => _name; + public SelfTestResult PerformSelfTest() => SelfTestResult; + public SelfTestResult SelfTestResult => SelfTestResult.Unknown; + public void Open() => Initialize(); + public void Close() => Shutdown(); + public void Reset() + { + Close(); + Open(); + } + + #region Private Functions + /// + /// Dispose of the resources contained by this object + /// + public void Dispose() + { + try + { + lock (_syncObj) + { + Dispose(true); + GC.SuppressFinalize(this); + } + } + catch (Exception err) + { + _logger.Error(err.Message + "\r\n" + err.StackTrace); + } + } + + /// + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + // close the socket + try + { + Shutdown(); + } + catch (Exception err) + { + _logger.Error(err.Message + "\r\n" + err.StackTrace); + } + } + } + + #endregion + + #region Public Functions + + /// + /// CommDevice factory constructor + /// + /// + /// + public CommDeviceTcpAsync(string deviceName, IConfigurationManager configurationManager) + { + _name = deviceName; + + // _tcpClient is created in Initialize() + _tcpClient = null; + _tcpIpStream = null; + + _state = State.Uninitialized; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + } + + /// + /// initialize instrument + /// + public void Initialize() + { + if (_state != State.Uninitialized) + { + _logger.Warn("Reinitialization of existing TCP Async Connection. Attempting to call Shutdown."); + Shutdown(); + } + + _defaultReadTimeout = _configuration.GetConfigurationValue("TcpClient", "ReadTimeout", 25); + _defaultSendTimeout = _configuration.GetConfigurationValue("TcpClient", "SendTimeout", 5000); + _defaultReadBufferSize = _configuration.GetConfigurationValue("TcpClient", "BufferSize", 1024); + + _remoteAddress = _configuration.GetConfigurationValue("TcpClient", "RemoteAddress", "127.0.0.1"); + _port = _configuration.GetConfigurationValue("TcpClient", "Port", 0); + + if (string.IsNullOrEmpty(_remoteAddress)) + { + _tcpListener = new TcpListener(IPAddress.Any, _port); + _tcpListener.Start(); + + _logger.Debug($"{MethodBase.GetCurrentMethod().Name} Started Listening on Port: {_port}"); + + Task.Run(async () => await _tcpListener.AcceptTcpClientAsync()).ContinueWith(t => + { + _tcpClient = t.Result; + + _remoteAddress = ((IPEndPoint)_tcpClient.Client.RemoteEndPoint).Address.ToString(); + _remotePort = ((IPEndPoint)_tcpClient.Client.RemoteEndPoint).Port; + + _logger.Debug($"{MethodBase.GetCurrentMethod().Name} Connection Established from Remote Address: {_remoteAddress}:{_remotePort}"); + + // set timeouts + _tcpClient.Client.SendTimeout = (int)_defaultSendTimeout; + _tcpClient.Client.ReceiveTimeout = (int)_defaultReadTimeout; + + // get the stream + _tcpIpStream = _tcpClient.GetStream(); + + _state = State.Ready; + }); + } + else + { + _remotePort = _port; + _tcpClient = new TcpClient(_remoteAddress, _remotePort); + + _logger.Debug($"{MethodBase.GetCurrentMethod().Name} Connected to Remote Address {_remoteAddress}:{_remotePort}"); + + // set timeouts + _tcpClient.Client.SendTimeout = (int)_defaultSendTimeout; + _tcpClient.Client.ReceiveTimeout = (int)_defaultReadTimeout; + + // get the stream + _tcpIpStream = _tcpClient.GetStream(); + + _state = State.Ready; + } + } + + /// + /// shuts down the device + /// + public void Shutdown() + { + _logger.Debug("Shutting down"); + _tcpClient?.Dispose(); + _tcpClient = null; + + _tcpListener?.Stop(); + _tcpListener = null; + + _tcpIpStream?.Dispose(); + _tcpIpStream = null; + + _state = State.Uninitialized; + } + + /// + /// Read data from the device asynchronously. + /// + /// The buffer to put the data in + /// The number of bytes read + public async Task ReadAsync(byte[] dataRead, CancellationToken token = default) + { + if (_tcpIpStream == null) + return 0; + + if (_tcpIpStream.DataAvailable == true) + { + _state = State.Busy; + var bytesRead = await _tcpIpStream.ReadAsync(dataRead, 0, dataRead.Length, token); + + _logger.Trace($"Reading Data, bytes received: {bytesRead}"); + + _state = State.Ready; + return (uint)bytesRead; + } + else + { + return 0; + } + } + + /// + /// Read string from the device asynchronously. + /// + /// The buffer to put the data in + /// The number of bytes read + public async Task ReadAsync(CancellationToken token = default) + { + if (_tcpIpStream == null) + return null; + + if (_tcpIpStream.DataAvailable == true) + { + _state = State.Busy; + var buffer = new byte[_defaultReadBufferSize]; + var bytesRead = await _tcpIpStream.ReadAsync(buffer, 0, buffer.Length, token); + _state = State.Ready; + + var message = Encoding.UTF8.GetString(buffer, 0, bytesRead); + + _logger.Trace($"Reading Data, message received: {message}"); + + return message; + } + else + { + return null; + } + } + + /// + /// Sets the read timeout + /// + /// + public void SetReadTimeout(uint timeoutMs) + { + _logger.Trace($"Setting Reader Timeout: {timeoutMs} Ms"); + + _tcpClient.Client.ReceiveTimeout = (int)timeoutMs; + } + + /// + /// Write data to the device asynchronously + /// + /// + /// + /// + public async Task WriteAsync(byte[] dataToSend, uint numBytesToWrite, CancellationToken token = default) + { + if (_tcpIpStream == null) + return 0; + + _logger.Trace($"Writing message to ({_remoteAddress}:{_remotePort}), bytes: {dataToSend?.Length}"); + + _state = State.Busy; + await _tcpIpStream.WriteAsync(dataToSend, 0, (int)numBytesToWrite, token); + _state = State.Ready; + return numBytesToWrite; + } + + /// + /// Write string data to the device asynchronously + /// + /// + /// + public async Task WriteAsync(string message, CancellationToken token = default) + { + if (_tcpIpStream == null) + return; + + _logger.Trace($"Writing message to ({_remoteAddress}:{_remotePort}), message: {message}"); + + _state = State.Busy; + var buffer = Encoding.UTF8.GetBytes(message); + await _tcpIpStream.WriteAsync(buffer, 0, buffer.Length, token); + _state = State.Ready; + } + + /// + /// Send Command and Get Response asynchronously + /// + /// + /// + /// + public async Task SendCommandGetResponseAsync(string message, CancellationToken cancellationToken = default, int timeoutInMs = 5000) + { + if (_tcpIpStream == null) + return null; + + _logger.Trace($"Sending command waiting for response from ({_remoteAddress}:{_remotePort}), message: {message}"); + + using (var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) + { + if (cancellationToken == default) + { + cancellationToken = cts.Token; + } + await WriteAsync(message, cancellationToken); + string readResponse = await ReadAsync(cancellationToken); + _logger.Trace($"Received response: {readResponse}"); + return readResponse; + } + } + + /// + /// Send Command and Get Response asynchronously + /// + /// + /// + /// + public async Task SendCommandGetResponseAsync(byte[] data, CancellationToken cancellationToken = default, int timeoutInMs = 5000) + { + if (_tcpIpStream == null) + return null; + + _logger.Trace($"Sending command waiting for response from ({_remoteAddress}:{_remotePort}), message: {data}"); + + using (var cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) + { + if (cancellationToken == default) + { + cancellationToken = cts.Token; + } + await WriteAsync(data, (uint)data.Length, cancellationToken); + byte[] buffer = new byte[_defaultReadBufferSize]; + uint bytesRead = await ReadAsync(buffer, cancellationToken); + _logger.Trace($"Received response of size: {bytesRead}"); + + return buffer; + } + } + + /// + /// keeps reading until canceled via token, + /// received messages sent to dataReceived function + /// + /// + /// + /// + public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) + { + _logger.Debug($"Starting continuous reading from {_remoteAddress}:{_remotePort} ..."); + + byte[] buffer = new byte[_defaultReadBufferSize]; + while (!cancellationToken.IsCancellationRequested) + { + if (_tcpIpStream == null) + { + continue; + } + + uint bytesRead = await ReadAsync(buffer, cancellationToken); + if (bytesRead > 0) + { + string data = Encoding.UTF8.GetString(buffer, 0, (int)bytesRead); + + _logger.Trace($"Message received from {_remoteAddress}:{_remotePort}: {data}"); + + dataReceived(data); + Array.Clear(buffer, 0, (int)bytesRead); + } + } + + _logger.Debug($"Finished continuous reading from {_remoteAddress}:{_remotePort} ..."); + } + + /// + /// keeps reading until canceled via token, + /// received messages sent to dataReceived function + /// + /// + /// + /// + public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) + { + _logger.Debug($"Starting continuous reading from {_remoteAddress}:{_remotePort} ..."); + + byte[] buffer = new byte[_defaultReadBufferSize]; + while (!cancellationToken.IsCancellationRequested) + { + if (_tcpIpStream == null) + { + continue; + } + + uint bytesRead = await ReadAsync(buffer, cancellationToken); + if (bytesRead > 0) + { + _logger.Trace($"Message received from {_remoteAddress}:{_remotePort}: size {bytesRead}"); + byte[] bufferCopy = new byte[bytesRead]; + Array.Copy(buffer, bufferCopy, bytesRead); + dataReceived(bufferCopy); + Array.Clear(buffer, 0, (int)bytesRead); + } + } + + _logger.Debug($"Finished continuous reading from {_remoteAddress}:{_remotePort} ..."); + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpAsync/CommDeviceTcpAsyncFactory.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpAsync/CommDeviceTcpAsyncFactory.cs index 62eec1d..db2b795 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpAsync/CommDeviceTcpAsyncFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpAsync/CommDeviceTcpAsyncFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommDeviceTcpAsyncFactory")] - public class CommDeviceTcpAsyncFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommDeviceTcpAsyncFactory")] + public class CommDeviceTcpAsyncFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommDeviceTcpAsyncFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommDeviceTcpAsyncFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommDeviceTcpAsyncFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommDeviceTcpAsyncFactory injection constructor + /// + [ImportingConstructor] + public CommDeviceTcpAsyncFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ICommAsync)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommDeviceTcpAsync(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ICommAsync)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommDeviceTcpAsync(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +98,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new CommDeviceTcpAsync(name, _configurationManager, _logger); + return new CommDeviceTcpAsync(name, _configurationManager); } catch (Exception) { @@ -120,17 +111,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpClient/CommDeviceTcpClient.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpClient/CommDeviceTcpClient.cs index 01d4419..50c7929 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpClient/CommDeviceTcpClient.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpClient/CommDeviceTcpClient.cs @@ -15,375 +15,370 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; using System; using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// Class for controlling a TCP client communication device - /// - public class CommDeviceTcpClient : ICommDevice, IDisposable - { - #region PrivateClassMembers - private const uint _DEFAULT_READ_TIMEOUT = 25; - private const uint _DEFAULT_SEND_TIMEOUT = 5000; - private const uint _DEFAULT_READ_BUFFER_SIZE = 1024; - private static object _syncObj = new object(); - private TcpClient _tcpClient; - private NetworkStream _tcpIpStream; - private readonly int _remotePort; - private readonly string _remoteAddress; - private readonly string _name; - private State _state; + /// + /// Class for controlling a TCP client communication device + /// + public class CommDeviceTcpClient : ICommDevice, IDisposable + { + #region PrivateClassMembers + private const uint _DEFAULT_READ_TIMEOUT = 25; + private const uint _DEFAULT_SEND_TIMEOUT = 5000; + private const uint _DEFAULT_READ_BUFFER_SIZE = 1024; + private static object _syncObj = new object(); + private TcpClient _tcpClient; + private NetworkStream _tcpIpStream; + private readonly int _remotePort; + private readonly string _remoteAddress; + private readonly string _name; + private State _state; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - public bool ClearErrors() => false; - public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } - public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } - public string DetailedStatus => $"This is a TCP/IP Device called {_name}"; - public InstrumentMetadata Info => throw new NotImplementedException(); - public State Status => _state; - public string Name => _name; - public SelfTestResult PerformSelfTest() => SelfTestResult; - public SelfTestResult SelfTestResult => SelfTestResult.Unknown; - public void Open() => Initialize(); - public void Close() => Shutdown(); - public void Reset() - { - Close(); - Open(); - } + #endregion - #region Private Functions - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - try - { - lock (_syncObj) - { - Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception err) - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - } + public bool ClearErrors() => false; + public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } + public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } + public string DetailedStatus => $"This is a TCP/IP Device called {_name}"; + public InstrumentMetadata Info => throw new NotImplementedException(); + public State Status => _state; + public string Name => _name; + public SelfTestResult PerformSelfTest() => SelfTestResult; + public SelfTestResult SelfTestResult => SelfTestResult.Unknown; + public void Open() => Initialize(); + public void Close() => Shutdown(); + public void Reset() + { + Close(); + Open(); + } - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // close the socket - try - { - Shutdown(); - } - catch (Exception err) - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - } - } + #region Private Functions + /// + /// Dispose of the resources contained by this object + /// + public void Dispose() + { + try + { + lock (_syncObj) + { + Dispose(true); + GC.SuppressFinalize(this); + } + } + catch (Exception err) + { + _logger.Error(err.Message + "\r\n" + err.StackTrace); + } + } - #endregion + /// + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + // close the socket + try + { + Shutdown(); + } + catch (Exception err) + { + _logger.Error(err.Message + "\r\n" + err.StackTrace); + } + } + } - #region Public Functions + #endregion - /// - /// CommDevice factory constructor - /// - /// - /// - public CommDeviceTcpClient(string name, IConfigurationManager configurationManager, ILogger logger, string remoteAddress = "", int remotePort = 0) - { - _name = name; + #region Public Functions - // _tcpClient is created in Initialize() - _tcpClient = null; - _tcpIpStream = null; + /// + /// CommDevice factory constructor + /// + /// + /// + public CommDeviceTcpClient(string deviceName, IConfigurationManager configurationManager, string remoteAddress = "", int remotePort = 0) + { + _name = deviceName; - _state = State.Uninitialized; + // _tcpClient is created in Initialize() + _tcpClient = null; + _tcpIpStream = null; - _logger = logger; + _state = State.Uninitialized; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - if(string.IsNullOrEmpty(remoteAddress)) - { - _remoteAddress = _configuration.GetConfigurationValue("TcpClient", "RemoteAddress", "127.0.0.1"); - } - else - { - _remoteAddress = remoteAddress; - } - - if(remotePort == 0) - { - _remotePort = _configuration.GetConfigurationValue("TcpClient", "RemotePort", 0); - } - else - { - _remotePort = remotePort; - } - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - /// - /// legacy constructor - /// - /// The name of this device - /// The address of the server - /// The port that the server is listening on - public CommDeviceTcpClient(string name, string remoteAddress, int remotePort) - { - _name = name; - _remotePort = remotePort; - _remoteAddress = remoteAddress; + if (string.IsNullOrEmpty(remoteAddress)) + { + _remoteAddress = _configuration.GetConfigurationValue("TcpClient", "RemoteAddress", "127.0.0.1"); + } + else + { + _remoteAddress = remoteAddress; + } - // _tcpClient is created in Initialize() - _tcpClient = null; - _tcpIpStream = null; + if (remotePort == 0) + { + _remotePort = _configuration.GetConfigurationValue("TcpClient", "RemotePort", 0); + } + else + { + _remotePort = remotePort; + } + } - _logger = LogManager.GetCurrentClassLogger(); + /// + /// legacy constructor + /// + /// The name of this device + /// The address of the server + /// The port that the server is listening on + public CommDeviceTcpClient(string deviceName, string remoteAddress, int remotePort) + { + _name = deviceName; + _remotePort = remotePort; + _remoteAddress = remoteAddress; - _state = State.Uninitialized; - } + // _tcpClient is created in Initialize() + _tcpClient = null; + _tcpIpStream = null; - /// - /// initialize instrument - /// - public void Initialize() - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - _tcpClient = new TcpClient(_remoteAddress, _remotePort); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - // set timeouts - _tcpClient.Client.SendTimeout = (int)_DEFAULT_SEND_TIMEOUT; - _tcpClient.Client.ReceiveTimeout = (int)_DEFAULT_READ_TIMEOUT; + _state = State.Uninitialized; + } - // get the stream - _tcpIpStream = _tcpClient.GetStream(); + /// + /// initialize instrument + /// + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + _tcpClient = new TcpClient(_remoteAddress, _remotePort); - _state = State.Ready; - } - else - { - throw new Exception($"expected the state to be Uninitialized, state was: {_state} on device {_name}"); - } - } - } + // set timeouts + _tcpClient.Client.SendTimeout = (int)_DEFAULT_SEND_TIMEOUT; + _tcpClient.Client.ReceiveTimeout = (int)_DEFAULT_READ_TIMEOUT; - /// - /// shuts down the device - /// - public void Shutdown() - { - lock (_syncObj) - { - if (_state == State.Ready) - { - _tcpIpStream.Dispose(); - _tcpClient.Dispose(); - _state = State.Uninitialized; - } - } - } + // get the stream + _tcpIpStream = _tcpClient.GetStream(); - /// - /// Read data from the device. - /// - /// The buffer to put the data in - /// The number of bytes read - public uint Read(ref byte[] dataRead) - { - lock (_syncObj) - { - if (_tcpIpStream.DataAvailable == true) - { - _state = State.Busy; - uint numBytesRead = (uint)(_tcpIpStream.Read(dataRead, 0, dataRead.Length)); - _state = State.Ready; - return numBytesRead; - } - else - { - return 0; - } - } - } + _state = State.Ready; + } + else + { + throw new Exception($"expected the state to be Uninitialized, state was: {_state} on device {_name}"); + } + } + } - /// - /// Read data from the device asynchronously. - /// - /// The buffer to put the data in - /// The number of bytes read - public async Task ReadAsync(byte[] dataRead) - { - if (_tcpIpStream.DataAvailable == true) - { - _state = State.Busy; - var bytesRead = await _tcpIpStream.ReadAsync(dataRead, 0, dataRead.Length); - _state = State.Ready; - return (uint)bytesRead; - } - else - { - return 0; - } - } + /// + /// shuts down the device + /// + public void Shutdown() + { + lock (_syncObj) + { + if (_state == State.Ready) + { + _tcpIpStream.Dispose(); + _tcpClient.Dispose(); + _state = State.Uninitialized; + } + } + } - /// - /// Read string from the device asynchronously. - /// - /// The buffer to put the data in - /// The number of bytes read - public async Task ReadAsync(CancellationToken token = default) - { - if (_tcpIpStream.DataAvailable == true) - { - _state = State.Busy; - var buffer = new byte[_DEFAULT_READ_BUFFER_SIZE]; - var bytesRead = await _tcpIpStream.ReadAsync(buffer, 0, buffer.Length, token); - _state = State.Ready; - return Encoding.UTF8.GetString(buffer, 0, bytesRead); - } - else - { - return null; - } - } + /// + /// Read data from the device. + /// + /// The buffer to put the data in + /// The number of bytes read + public uint Read(ref byte[] dataRead) + { + lock (_syncObj) + { + if (_tcpIpStream.DataAvailable == true) + { + _state = State.Busy; + uint numBytesRead = (uint)(_tcpIpStream.Read(dataRead, 0, dataRead.Length)); + _state = State.Ready; + return numBytesRead; + } + else + { + return 0; + } + } + } + + /// + /// Read data from the device asynchronously. + /// + /// The buffer to put the data in + /// The number of bytes read + public async Task ReadAsync(byte[] dataRead) + { + if (_tcpIpStream.DataAvailable == true) + { + _state = State.Busy; + var bytesRead = await _tcpIpStream.ReadAsync(dataRead, 0, dataRead.Length); + _state = State.Ready; + return (uint)bytesRead; + } + else + { + return 0; + } + } + + /// + /// Read string from the device asynchronously. + /// + /// The buffer to put the data in + /// The number of bytes read + public async Task ReadAsync(CancellationToken token = default) + { + if (_tcpIpStream.DataAvailable == true) + { + _state = State.Busy; + var buffer = new byte[_DEFAULT_READ_BUFFER_SIZE]; + var bytesRead = await _tcpIpStream.ReadAsync(buffer, 0, buffer.Length, token); + _state = State.Ready; + return Encoding.UTF8.GetString(buffer, 0, bytesRead); + } + else + { + return null; + } + } - /// - /// Sets the read timeout - /// - /// - public void SetReadTimeout(uint timeoutMs) - { - _tcpClient.Client.ReceiveTimeout = (int)timeoutMs; - } + /// + /// Sets the read timeout + /// + /// + public void SetReadTimeout(uint timeoutMs) + { + _tcpClient.Client.ReceiveTimeout = (int)timeoutMs; + } - /// - /// Write data to the device - /// - /// The data to write - /// The number of bytes to write - /// The number of bytes that were written - public uint Write(byte[] dataToSend, uint numBytesToWrite) - { - lock (_syncObj) - { - _state = State.Busy; - _tcpIpStream.Write(dataToSend, 0, (int)numBytesToWrite); - _state = State.Ready; - return numBytesToWrite; - } - } + /// + /// Write data to the device + /// + /// The data to write + /// The number of bytes to write + /// The number of bytes that were written + public uint Write(byte[] dataToSend, uint numBytesToWrite) + { + lock (_syncObj) + { + _state = State.Busy; + _tcpIpStream.Write(dataToSend, 0, (int)numBytesToWrite); + _state = State.Ready; + return numBytesToWrite; + } + } - /// - /// Write data to the device asynchronously - /// - /// - /// - /// - public async Task WriteAsync(byte[] dataToSend, uint numBytesToWrite) - { - _state = State.Busy; - await _tcpIpStream.WriteAsync(dataToSend, 0, (int)numBytesToWrite); - _state = State.Ready; - return numBytesToWrite; - } + /// + /// Write data to the device asynchronously + /// + /// + /// + /// + public async Task WriteAsync(byte[] dataToSend, uint numBytesToWrite) + { + _state = State.Busy; + await _tcpIpStream.WriteAsync(dataToSend, 0, (int)numBytesToWrite); + _state = State.Ready; + return numBytesToWrite; + } - /// - /// Write string data to the device asynchronously - /// - /// - /// - public async Task WriteAsync(string message) - { - _state = State.Busy; - var buffer = Encoding.UTF8.GetBytes(message); - await _tcpIpStream.WriteAsync(buffer, 0, buffer.Length); - _state = State.Ready; - } + /// + /// Write string data to the device asynchronously + /// + /// + /// + public async Task WriteAsync(string message) + { + _state = State.Busy; + var buffer = Encoding.UTF8.GetBytes(message); + await _tcpIpStream.WriteAsync(buffer, 0, buffer.Length); + _state = State.Ready; + } - /// - /// Send Command and Get Response asynchronously - /// - /// - /// - /// - public async Task SendCommandGetResponseAsync(string message, int timeoutInMs = 5000) - { - _logger.Info($"Sending command waiting for response ({_remoteAddress}:{_remotePort}), message: {message}"); + /// + /// Send Command and Get Response asynchronously + /// + /// + /// + /// + public async Task SendCommandGetResponseAsync(string message, int timeoutInMs = 5000) + { + _logger.Info($"Sending command waiting for response ({_remoteAddress}:{_remotePort}), message: {message}"); - await WriteAsync(message); + await WriteAsync(message); - CancellationTokenSource tokenSource = new CancellationTokenSource(new TimeSpan(0, 0, 0, 0, milliseconds:timeoutInMs)); + CancellationTokenSource tokenSource = new CancellationTokenSource(new TimeSpan(0, 0, 0, 0, milliseconds: timeoutInMs)); - string readResponse = await ReadAsync(tokenSource.Token); + string readResponse = await ReadAsync(tokenSource.Token); - _logger.Info($"Received response: {readResponse}"); + _logger.Info($"Received response: {readResponse}"); - return readResponse; - } + return readResponse; + } - /// - /// keeps reading until canceled via token, - /// received messages sent to dataReceived function - /// - /// - /// - /// - public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) - { - _logger.Info($"About to start continuous reading from {_remoteAddress}:{_remotePort} ..."); + /// + /// keeps reading until canceled via token, + /// received messages sent to dataReceived function + /// + /// + /// + /// + public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) + { + _logger.Info($"About to start continuous reading from {_remoteAddress}:{_remotePort} ..."); - byte[] buffer = new byte[_DEFAULT_READ_BUFFER_SIZE]; - while (!cancellationToken.IsCancellationRequested) - { - int bytesRead = await _tcpIpStream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); - if (bytesRead > 0) - { - string data = Encoding.UTF8.GetString(buffer, 0, bytesRead); + byte[] buffer = new byte[_DEFAULT_READ_BUFFER_SIZE]; + while (!cancellationToken.IsCancellationRequested) + { + int bytesRead = await _tcpIpStream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); + if (bytesRead > 0) + { + string data = Encoding.UTF8.GetString(buffer, 0, bytesRead); - _logger.Info($"Message received from {_remoteAddress}:{_remotePort}: {data}"); + _logger.Info($"Message received from {_remoteAddress}:{_remotePort}: {data}"); - dataReceived(data); - Array.Clear(buffer, 0, bytesRead); - } - } - } + dataReceived(data); + Array.Clear(buffer, 0, bytesRead); + } + } + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpClient/CommDeviceTcpClientFactory.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpClient/CommDeviceTcpClientFactory.cs index c9463ed..a658fed 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpClient/CommDeviceTcpClientFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceTcpClient/CommDeviceTcpClientFactory.cs @@ -1,68 +1,61 @@ -using NLog; -using Raytheon.Common; -using System; +using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommDeviceTcpClientFactory")] - public class CommDeviceTcpClientFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommDeviceTcpClientFactory")] + public class CommDeviceTcpClientFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommDeviceTcpClientFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommDeviceTcpClientFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommDeviceTcpClientFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommDeviceTcpClientFactory injection constructor + /// + [ImportingConstructor] + public CommDeviceTcpClientFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ICommDevice)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommDeviceTcpClient(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ICommDevice)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommDeviceTcpClient(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -73,9 +66,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new CommDeviceTcpClient(name, _configurationManager, _logger); + return new CommDeviceTcpClient(name, _configurationManager); } catch (Exception) { @@ -88,17 +79,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdp/CommDeviceUdp.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdp/CommDeviceUdp.cs index 84a9fef..7451ce3 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdp/CommDeviceUdp.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdp/CommDeviceUdp.cs @@ -15,421 +15,402 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; using System; using System.Net; using System.Net.Sockets; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// Class for controlling a UDP communication device - /// - public class CommDeviceUdp : ICommDevice, IDisposable - { - #region PrivateClassMembers - private const uint _DEFAULT_SEND_TIMEOUT = 5000; + /// + /// Class for controlling a UDP communication device + /// + public class CommDeviceUdp : ICommDevice, IDisposable + { + #region PrivateClassMembers + private const uint _DEFAULT_SEND_TIMEOUT = 5000; - private static readonly object _syncObj = new Object(); - private UdpClient _udpClient; - private readonly int _localPort; - private readonly int _remotePort; - private readonly string _remoteAddress; - private IPEndPoint _remoteIPEndPoint; - private string _name; - private readonly SelfTestResult _selfTestResult; - private State _state; + private static readonly object _syncObj = new Object(); + private UdpClient _udpClient; + private readonly int _localPort; + private readonly int _remotePort; + private readonly string _remoteAddress; + private IPEndPoint _remoteIPEndPoint; + private string _name; + private readonly SelfTestResult _selfTestResult; + private State _state; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions - /// - /// The Finalizer - /// - ~CommDeviceUdp() - { - Dispose(false); - } + #endregion - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // close the socket and threads - try - { - if (_state == State.Ready) - { - _udpClient.Close(); + #region PrivateFunctions + /// + /// The Finalizer + /// + ~CommDeviceUdp() + { + Dispose(false); + } - _udpClient.Dispose(); + /// + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + // close the socket and threads + try + { + if (_state == State.Ready) + { + _udpClient.Close(); - _state = State.Uninitialized; - } - } - catch (Exception) - { - try - { - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + _udpClient.Dispose(); - #endregion + _state = State.Uninitialized; + } + } + catch (Exception) + { + try + { + } + catch (Exception) + { + //Do not rethrow. Exception from error logger that has already been garbage collected + } + } + } + } - #region PublicFuctions + #endregion - /// - /// CommDevice factory constructor - /// - /// - /// - public CommDeviceUdp(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFuctions - _logger = logger; + /// + /// CommDevice factory constructor + /// + /// + /// + public CommDeviceUdp(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _localPort = _configuration.GetConfigurationValue("CommDeviceUdp", "LocalPort", 0); - _remotePort = _configuration.GetConfigurationValue("CommDeviceUdp", "RemotePort", 0); - _remoteAddress = _configuration.GetConfigurationValue("CommDeviceUdp", "RemoteAddress", "127.0.0.1"); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - // created in Initialize() - _udpClient = null; + _localPort = _configuration.GetConfigurationValue("CommDeviceUdp", "LocalPort", 0); + _remotePort = _configuration.GetConfigurationValue("CommDeviceUdp", "RemotePort", 0); + _remoteAddress = _configuration.GetConfigurationValue("CommDeviceUdp", "RemoteAddress", "127.0.0.1"); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + // created in Initialize() + _udpClient = null; + + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } - /// - /// - /// - /// The name of this instance - /// the port on the local computer to use - /// the port on the remote computer to send to - /// the address to send to - public CommDeviceUdp(string name, int localPort, int remotePort, string remoteAddress) - { - _name = name; - _localPort = localPort; - _remotePort = remotePort; - _remoteAddress = remoteAddress; + /// + /// + /// + /// The name of this instance + /// the port on the local computer to use + /// the port on the remote computer to send to + /// the address to send to + public CommDeviceUdp(string deviceName, int localPort, int remotePort, string remoteAddress) + { + _name = deviceName; + _localPort = localPort; + _remotePort = remotePort; + _remoteAddress = remoteAddress; - // created in Initialize() - _udpClient = null; + // created in Initialize() + _udpClient = null; - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - _logger = LogManager.GetCurrentClassLogger(); - } + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a UDP Device called " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a UDP Device called " + _name; + } + } - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of the resources contained by this object + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - _udpClient = new UdpClient(_localPort); + /// + /// + /// + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + _udpClient = new UdpClient(_localPort); - _udpClient.Client.ReceiveBufferSize = int.MaxValue; - _udpClient.Client.SendBufferSize = int.MaxValue; + _udpClient.Client.ReceiveBufferSize = int.MaxValue; + _udpClient.Client.SendBufferSize = int.MaxValue; - _udpClient.Client.SendTimeout = (int)_DEFAULT_SEND_TIMEOUT; + _udpClient.Client.SendTimeout = (int)_DEFAULT_SEND_TIMEOUT; - // set an arbitrary short receive timeout. Don't want the read call to block - _udpClient.Client.ReceiveTimeout = 5; + // set an arbitrary short receive timeout. Don't want the read call to block + _udpClient.Client.ReceiveTimeout = 5; - IPAddress remoteAddy = IPAddress.Parse(_remoteAddress); - _remoteIPEndPoint = new IPEndPoint(remoteAddy, _remotePort); + IPAddress remoteAddy = IPAddress.Parse(_remoteAddress); + _remoteIPEndPoint = new IPEndPoint(remoteAddy, _remotePort); - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on device " + _name); - } - } - } + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on device " + _name); + } + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - lock (_syncObj) - { - throw new NotImplementedException(); - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + throw new NotImplementedException(); + } + } - /// - /// Read data from the device. - /// - /// The buffer to put the data in - /// The number of bytes read - public uint Read(ref byte[] dataRead) - { - lock (_syncObj) - { - try - { - dataRead = _udpClient.Receive(ref _remoteIPEndPoint); + /// + /// Read data from the device. + /// + /// The buffer to put the data in + /// The number of bytes read + public uint Read(ref byte[] dataRead) + { + lock (_syncObj) + { + try + { + dataRead = _udpClient.Receive(ref _remoteIPEndPoint); - uint numBytesRead = (uint)(dataRead.Length); + uint numBytesRead = (uint)(dataRead.Length); - return numBytesRead; - } - catch (SocketException e) - { - if (e.SocketErrorCode == SocketError.TimedOut) - { - // expected, do nothing - return 0; - } - else - { - throw; - } - } - } - } + return numBytesRead; + } + catch (SocketException e) + { + if (e.SocketErrorCode == SocketError.TimedOut) + { + // expected, do nothing + return 0; + } + else + { + throw; + } + } + } + } - /// - /// - public void Reset() - { - lock (_syncObj) - { - } - } + /// + /// + public void Reset() + { + lock (_syncObj) + { + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - public void SetReadTimeout(uint timeoutMs) - { - lock (_syncObj) - { - _udpClient.Client.ReceiveTimeout = (int)timeoutMs; - } - } + /// + /// + /// + /// + public void SetReadTimeout(uint timeoutMs) + { + lock (_syncObj) + { + _udpClient.Client.ReceiveTimeout = (int)timeoutMs; + } + } - /// - /// - /// - public void Shutdown() - { - lock (_syncObj) - { - if (_state == State.Ready) - { - _udpClient.Close(); + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + if (_state == State.Ready) + { + _udpClient.Close(); - _udpClient.Dispose(); + _udpClient.Dispose(); - _state = State.Uninitialized; - } - } - } + _state = State.Uninitialized; + } + } + } - /// - /// Write data to the device - /// - /// The data to write - /// The number of bytes to write - /// THe number of bytes that were written - public uint Write(byte[] dataToSend, uint numBytesToWrite) - { - lock (_syncObj) - { - const uint MAX_BYTES_PER_PACKET = 65400; + /// + /// Write data to the device + /// + /// The data to write + /// The number of bytes to write + /// THe number of bytes that were written + public uint Write(byte[] dataToSend, uint numBytesToWrite) + { + lock (_syncObj) + { + const uint MAX_BYTES_PER_PACKET = 65400; - uint index = 0; + uint index = 0; - if (numBytesToWrite > MAX_BYTES_PER_PACKET) - { - uint numPacketsToSend = numBytesToWrite / MAX_BYTES_PER_PACKET; - int packetsSent = 0; + if (numBytesToWrite > MAX_BYTES_PER_PACKET) + { + uint numPacketsToSend = numBytesToWrite / MAX_BYTES_PER_PACKET; + int packetsSent = 0; - while (packetsSent < numPacketsToSend) - { - Byte[] segment1 = new Byte[MAX_BYTES_PER_PACKET]; - Array.Copy(dataToSend, index, segment1, 0, MAX_BYTES_PER_PACKET); - uint count = (uint)(_udpClient.Send(segment1, (int)MAX_BYTES_PER_PACKET, _remoteIPEndPoint)); - index += count; - packetsSent++; - } + while (packetsSent < numPacketsToSend) + { + Byte[] segment1 = new Byte[MAX_BYTES_PER_PACKET]; + Array.Copy(dataToSend, index, segment1, 0, MAX_BYTES_PER_PACKET); + uint count = (uint)(_udpClient.Send(segment1, (int)MAX_BYTES_PER_PACKET, _remoteIPEndPoint)); + index += count; + packetsSent++; + } - Byte[] segment = new Byte[MAX_BYTES_PER_PACKET]; - uint numBytesRemaining = numBytesToWrite - index; - Array.Copy(dataToSend, index, segment, 0, numBytesRemaining); - index += (uint)(_udpClient.Send(segment, (int)numBytesRemaining, _remoteIPEndPoint)); - } - else - { - index = (uint)(_udpClient.Send(dataToSend, (int)numBytesToWrite, _remoteIPEndPoint)); - } + Byte[] segment = new Byte[MAX_BYTES_PER_PACKET]; + uint numBytesRemaining = numBytesToWrite - index; + Array.Copy(dataToSend, index, segment, 0, numBytesRemaining); + index += (uint)(_udpClient.Send(segment, (int)numBytesRemaining, _remoteIPEndPoint)); + } + else + { + index = (uint)(_udpClient.Send(dataToSend, (int)numBytesToWrite, _remoteIPEndPoint)); + } - return index; - } - } + return index; + } + } - public void Close() - { - //throw new NotImplementedException(); - } + public void Close() + { + //throw new NotImplementedException(); + } - public void Open() - { - //throw new NotImplementedException(); - } - #endregion - } + public void Open() + { + //throw new NotImplementedException(); + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdp/CommDeviceUdpFactory.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdp/CommDeviceUdpFactory.cs index 43b316c..a25da4f 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdp/CommDeviceUdpFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdp/CommDeviceUdpFactory.cs @@ -1,68 +1,61 @@ -using NLog; -using Raytheon.Common; -using System; +using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommDeviceUdpFactory")] - public class CommDeviceUdpFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommDeviceUdpFactory")] + public class CommDeviceUdpFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommDeviceUdpFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommDeviceUdpFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommDeviceUdpFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommDeviceUdpFactory injection constructor + /// + [ImportingConstructor] + public CommDeviceUdpFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ICommDevice)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommDeviceUdp(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ICommDevice)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommDeviceUdp(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -73,9 +66,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new CommDeviceUdp(name, _configurationManager, _logger); + return new CommDeviceUdp(name, _configurationManager); } catch (Exception) { @@ -88,17 +79,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdpAsync/CommDeviceUdpAsync.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdpAsync/CommDeviceUdpAsync.cs index ff97028..f6b1608 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdpAsync/CommDeviceUdpAsync.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdpAsync/CommDeviceUdpAsync.cs @@ -30,439 +30,434 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; +using System.Net; using System.Net.Sockets; using System.Text; -using System.Threading.Tasks; using System.Threading; -using System.Net; +using System.Threading.Tasks; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A sim communication device - /// - public class CommDeviceUdpAsync : ICommAsync - { - #region PrivateClassMembers - private uint _defaultReadTimeout; - private uint _defaultSendTimeout; - private uint _defaultReadBufferSize; - private static readonly object _syncObj = new object(); - - private UdpClient _udpClient; - private IPEndPoint _remoteEndPoint; - - private int _localPort; - private int _remotePort; - private string _remoteAddress; - private readonly string _name; - private State _state; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - public bool ClearErrors() => false; - public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } - public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } - public string DetailedStatus => $"This is a TCP/IP Device called {_name}"; - public InstrumentMetadata Info => throw new NotImplementedException(); - public State Status => _state; - public string Name => _name; - public SelfTestResult PerformSelfTest() => SelfTestResult; - public SelfTestResult SelfTestResult => SelfTestResult.Unknown; - public void Open() => Initialize(); - public void Close() => Shutdown(); - public void Reset() - { - Close(); - Open(); - } - - #region Private Functions - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - try - { - lock (_syncObj) - { - Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception err) - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - } - - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // close the socket - try - { - Shutdown(); - } - catch (Exception err) - { - _logger.Error(err.Message + "\r\n" + err.StackTrace); - } - } - } - - #endregion - - #region Public Functions - - /// - /// CommDevice factory constructor - /// - /// - /// - public CommDeviceUdpAsync(string name, IConfigurationManager configurationManager, ILogger logger) - { - _name = name; - - _state = State.Uninitialized; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - } - - /// - /// initialize instrument - /// - public void Initialize() - { - if (_state != State.Uninitialized) - { - _logger.Warn("Reinitialization of existing UDP Async Connection. Attempting to call Shutdown."); - Shutdown(); - } - - _defaultReadTimeout = _configuration.GetConfigurationValue("UdpClient", "ReadTimeout", 25); - _defaultSendTimeout = _configuration.GetConfigurationValue("UdpClient", "SendTimeout", 5000); - _defaultReadBufferSize = _configuration.GetConfigurationValue("UdpClient", "BufferSize", 1024); - - _localPort = _configuration.GetConfigurationValue("UdpClient", "LocalPort", 0); - - _remoteAddress = _configuration.GetConfigurationValue("UdpClient", "RemoteAddress", "127.0.0.1"); - _remotePort = _configuration.GetConfigurationValue("UdpClient", "RemotePort", 0); - - _udpClient = new UdpClient(); - - if (string.IsNullOrEmpty(_remoteAddress)) - { - _logger.Debug($"Initializing as UDP Server. Listening on port: {_localPort}"); - _udpClient.Client.Bind(new IPEndPoint(IPAddress.Any, _localPort)); - } - else - { - _logger.Debug($"Initializing as UDP Client. Ready to Talk to: {_remoteAddress}:{_remotePort}"); - // get the remote endpoint - _remoteEndPoint = new IPEndPoint(IPAddress.Parse(_remoteAddress), _remotePort); - } - - // set timeouts - _udpClient.Client.SendTimeout = (int)_defaultSendTimeout; - _udpClient.Client.ReceiveTimeout = (int)_defaultReadTimeout; - - _state = State.Ready; - } - - /// - /// shuts down the device - /// - public void Shutdown() - { - _logger.Debug("Shutting Down..."); - _state = State.Uninitialized; - _udpClient?.Dispose(); - _udpClient = null; - } - - /// - /// Read data from the device asynchronously. - /// - /// The buffer to put the data in - /// The number of bytes read - public async Task ReadAsync(byte[] dataRead, CancellationToken token = default) - { - if (_udpClient == null) - return 0; - - var received = await _udpClient.ReceiveAsync(); - Array.Copy(received.Buffer, dataRead, Math.Min(dataRead.Length, received.Buffer.Length)); - - UpdateRemoteAddressAndPort(received.RemoteEndPoint); - - _logger.Trace($"Reading Data, bytes received: {received.Buffer?.Length}"); - - return (uint)received.Buffer.Length; - } - - /// - /// Read string from the device asynchronously. - /// - /// The buffer to put the data in - /// The number of bytes read - public async Task ReadAsync(CancellationToken token = default) - { - if (_udpClient == null) - return null; - - var received = await _udpClient.ReceiveAsync(); - - UpdateRemoteAddressAndPort(received.RemoteEndPoint); - - var data = Encoding.UTF8.GetString(received.Buffer); - - _logger.Trace($"Reading Data, message received: {data}"); - - return data; - } - - /// - /// Sets the read timeout - /// - /// - public void SetReadTimeout(uint timeoutMs) - { - if (_udpClient == null) - return; - - _logger.Trace($"Setting Reader Timeout: {timeoutMs} Ms"); - - _udpClient.Client.ReceiveTimeout = (int)timeoutMs; - } - - /// - /// Write data to the device asynchronously - /// - /// - /// - /// - public async Task WriteAsync(byte[] dataToSend, uint numBytesToWrite, CancellationToken token = default) - { - if (_udpClient == null || _remoteEndPoint == null) - return 0; - - _logger.Trace($"Writing message to ({_remoteAddress}:{_remotePort}), bytes: {dataToSend?.Length}"); - - _state = State.Busy; - await _udpClient.SendAsync(dataToSend, (int)numBytesToWrite, _remoteEndPoint); - _state = State.Ready; - return numBytesToWrite; - } - - /// - /// Write string data to the device asynchronously - /// - /// - /// - /// - public async Task WriteAsync(string message, CancellationToken token = default) - { - if (_udpClient == null || _remoteEndPoint == null) - return; - - _logger.Trace($"Writing message to ({_remoteAddress}:{_remotePort}), message: {message}"); - - _state = State.Busy; - var dataToSend = Encoding.UTF8.GetBytes(message); - await _udpClient.SendAsync(dataToSend, dataToSend.Length, _remoteEndPoint); - _state = State.Ready; - } - - /// - /// Send Command and Get Response asynchronously - /// - /// - /// - /// - /// - public async Task SendCommandGetResponseAsync(string message, CancellationToken cancellationToken = default, int timeoutInMs = 5000) - { - if (_udpClient == null) - return null; - - _logger.Trace($"Sending command waiting for response from ({_remoteAddress}:{_remotePort}), message: {message}"); - - using (CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) - { - if (cancellationToken == default) - { - cancellationToken = cts.Token; - } - await WriteAsync(message, cancellationToken); - string readResponse = await ReadAsync(cancellationToken); - _logger.Trace($"Received response: {readResponse}"); - - return readResponse; - } - } - - /// - /// Send Command and Get Response asynchronously - /// - /// - /// - /// - /// - public async Task SendCommandGetResponseAsync(byte[] data, CancellationToken cancellationToken = default, int timeoutInMs = 5000) - { - if (_udpClient == null) - return null; - - _logger.Trace($"Sending command waiting for response from ({_remoteAddress}:{_remotePort}), message length: {data.Length}"); - - using (CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) - { - if (cancellationToken == default) - { - cancellationToken = cts.Token; - } - await WriteAsync(data, (uint)data.Length, cancellationToken); - byte[] buffer = new byte[_defaultReadBufferSize]; - uint bytesRead = await ReadAsync(buffer, cancellationToken); - _logger.Trace($"Received response of size: {bytesRead}"); - - return buffer; - } - } - - /// - /// keeps reading until canceled via token, - /// received messages sent to dataReceived function - /// - /// - /// - /// - public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) - { - if (_udpClient == null) - return; - - _logger.Debug($"Starting continuous reading from port: {_localPort} ..."); - - while (!cancellationToken.IsCancellationRequested) - { - if (_udpClient == null) - break; - - var received = await ReceiveAsync(_udpClient, cancellationToken); - - if (received != null && received.Buffer != null) - { - UpdateRemoteAddressAndPort(received.RemoteEndPoint); - _logger.Trace($"Incoming Data from {_remoteAddress}:{_remotePort}: size {received.Buffer.Length}"); - string data = Encoding.UTF8.GetString(received.Buffer, 0, received.Buffer.Length); - dataReceived(data); - } - } - - _logger.Debug($"Finished continuous reading from {_remoteAddress}:{_remotePort} ..."); - } - - /// - /// keeps reading until canceled via token, - /// received messages sent to dataReceived function - /// - /// - /// - /// - public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) - { - if (_udpClient == null) - return; - - _logger.Debug($"Starting continuous reading from port: {_localPort} ..."); - - while (!cancellationToken.IsCancellationRequested) - { - if (_udpClient == null) - break; - - var received = await ReceiveAsync(_udpClient, cancellationToken); - if (received != null && received.Buffer != null) - { - UpdateRemoteAddressAndPort(received.RemoteEndPoint); - _logger.Trace($"Incoming Data from {_remoteAddress}:{_remotePort}: size {received.Buffer.Length}"); - dataReceived(received.Buffer); - } - } - - _logger.Debug($"Finished continuous reading from {_remoteAddress}:{_remotePort} ..."); - } - - #endregion - - #region Private Functions - /// - /// Update client information for logging - /// - /// - private void UpdateRemoteAddressAndPort(IPEndPoint remoteEndPoint) - { - if (remoteEndPoint == null) - return; - - if (_remotePort == 0 || string.IsNullOrEmpty(_remoteAddress)) - { - _remotePort = remoteEndPoint.Port; - _remoteAddress = remoteEndPoint.Address.ToString(); - } - - if(_remoteEndPoint == null || _remoteEndPoint.Port != remoteEndPoint.Port ) - { - // get the remote endpoint - _remoteEndPoint = remoteEndPoint; - - _logger.Debug($"Starting to receive data from {_remoteAddress}:{_remotePort}"); - } - } - - /// - /// ReceiveAsyc with cancellation token implementation - /// - /// - /// - /// - private Task ReceiveAsync(UdpClient client, CancellationToken breakToken) => breakToken.IsCancellationRequested - ? Task.Run(() => new UdpReceiveResult()) - : Task.Factory.FromAsync - ((callback, state) => client.BeginReceive(callback, state), (ar) => - { - if (breakToken.IsCancellationRequested) - return new UdpReceiveResult(); - - IPEndPoint remoteEP = null; - var buffer = client.EndReceive(ar, ref remoteEP); - return new UdpReceiveResult(buffer, remoteEP); - },null); - - #endregion - } + /// + /// A sim communication device + /// + public class CommDeviceUdpAsync : ICommAsync + { + #region PrivateClassMembers + private uint _defaultReadTimeout; + private uint _defaultSendTimeout; + private uint _defaultReadBufferSize; + private static readonly object _syncObj = new object(); + + private UdpClient _udpClient; + private IPEndPoint _remoteEndPoint; + + private int _localPort; + private int _remotePort; + private string _remoteAddress; + private readonly string _name; + private State _state; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + public bool ClearErrors() => false; + public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } + public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } + public string DetailedStatus => $"This is a TCP/IP Device called {_name}"; + public InstrumentMetadata Info => throw new NotImplementedException(); + public State Status => _state; + public string Name => _name; + public SelfTestResult PerformSelfTest() => SelfTestResult; + public SelfTestResult SelfTestResult => SelfTestResult.Unknown; + public void Open() => Initialize(); + public void Close() => Shutdown(); + public void Reset() + { + Close(); + Open(); + } + + #region Private Functions + /// + /// Dispose of the resources contained by this object + /// + public void Dispose() + { + try + { + lock (_syncObj) + { + Dispose(true); + GC.SuppressFinalize(this); + } + } + catch (Exception err) + { + _logger.Error(err.Message + "\r\n" + err.StackTrace); + } + } + + /// + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + // close the socket + try + { + Shutdown(); + } + catch (Exception err) + { + _logger.Error(err.Message + "\r\n" + err.StackTrace); + } + } + } + + #endregion + + #region Public Functions + + /// + /// CommDevice factory constructor + /// + /// + /// + public CommDeviceUdpAsync(string deviceName, IConfigurationManager configurationManager) + { + _name = deviceName; + + _state = State.Uninitialized; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + } + + /// + /// initialize instrument + /// + public void Initialize() + { + if (_state != State.Uninitialized) + { + _logger.Warn("Reinitialization of existing UDP Async Connection. Attempting to call Shutdown."); + Shutdown(); + } + + _defaultReadTimeout = _configuration.GetConfigurationValue("UdpClient", "ReadTimeout", 25); + _defaultSendTimeout = _configuration.GetConfigurationValue("UdpClient", "SendTimeout", 5000); + _defaultReadBufferSize = _configuration.GetConfigurationValue("UdpClient", "BufferSize", 1024); + + _localPort = _configuration.GetConfigurationValue("UdpClient", "LocalPort", 0); + + _remoteAddress = _configuration.GetConfigurationValue("UdpClient", "RemoteAddress", "127.0.0.1"); + _remotePort = _configuration.GetConfigurationValue("UdpClient", "RemotePort", 0); + + _udpClient = new UdpClient(); + + if (string.IsNullOrEmpty(_remoteAddress)) + { + _logger.Debug($"Initializing as UDP Server. Listening on port: {_localPort}"); + _udpClient.Client.Bind(new IPEndPoint(IPAddress.Any, _localPort)); + } + else + { + _logger.Debug($"Initializing as UDP Client. Ready to Talk to: {_remoteAddress}:{_remotePort}"); + // get the remote endpoint + _remoteEndPoint = new IPEndPoint(IPAddress.Parse(_remoteAddress), _remotePort); + } + + // set timeouts + _udpClient.Client.SendTimeout = (int)_defaultSendTimeout; + _udpClient.Client.ReceiveTimeout = (int)_defaultReadTimeout; + + _state = State.Ready; + } + + /// + /// shuts down the device + /// + public void Shutdown() + { + _logger.Debug("Shutting Down..."); + _state = State.Uninitialized; + _udpClient?.Dispose(); + _udpClient = null; + } + + /// + /// Read data from the device asynchronously. + /// + /// The buffer to put the data in + /// The number of bytes read + public async Task ReadAsync(byte[] dataRead, CancellationToken token = default) + { + if (_udpClient == null) + return 0; + + var received = await _udpClient.ReceiveAsync(); + Array.Copy(received.Buffer, dataRead, Math.Min(dataRead.Length, received.Buffer.Length)); + + UpdateRemoteAddressAndPort(received.RemoteEndPoint); + + _logger.Trace($"Reading Data, bytes received: {received.Buffer?.Length}"); + + return (uint)received.Buffer.Length; + } + + /// + /// Read string from the device asynchronously. + /// + /// The buffer to put the data in + /// The number of bytes read + public async Task ReadAsync(CancellationToken token = default) + { + if (_udpClient == null) + return null; + + var received = await _udpClient.ReceiveAsync(); + + UpdateRemoteAddressAndPort(received.RemoteEndPoint); + + var data = Encoding.UTF8.GetString(received.Buffer); + + _logger.Trace($"Reading Data, message received: {data}"); + + return data; + } + + /// + /// Sets the read timeout + /// + /// + public void SetReadTimeout(uint timeoutMs) + { + if (_udpClient == null) + return; + + _logger.Trace($"Setting Reader Timeout: {timeoutMs} Ms"); + + _udpClient.Client.ReceiveTimeout = (int)timeoutMs; + } + + /// + /// Write data to the device asynchronously + /// + /// + /// + /// + public async Task WriteAsync(byte[] dataToSend, uint numBytesToWrite, CancellationToken token = default) + { + if (_udpClient == null || _remoteEndPoint == null) + return 0; + + _logger.Trace($"Writing message to ({_remoteAddress}:{_remotePort}), bytes: {dataToSend?.Length}"); + + _state = State.Busy; + await _udpClient.SendAsync(dataToSend, (int)numBytesToWrite, _remoteEndPoint); + _state = State.Ready; + return numBytesToWrite; + } + + /// + /// Write string data to the device asynchronously + /// + /// + /// + /// + public async Task WriteAsync(string message, CancellationToken token = default) + { + if (_udpClient == null || _remoteEndPoint == null) + return; + + _logger.Trace($"Writing message to ({_remoteAddress}:{_remotePort}), message: {message}"); + + _state = State.Busy; + var dataToSend = Encoding.UTF8.GetBytes(message); + await _udpClient.SendAsync(dataToSend, dataToSend.Length, _remoteEndPoint); + _state = State.Ready; + } + + /// + /// Send Command and Get Response asynchronously + /// + /// + /// + /// + /// + public async Task SendCommandGetResponseAsync(string message, CancellationToken cancellationToken = default, int timeoutInMs = 5000) + { + if (_udpClient == null) + return null; + + _logger.Trace($"Sending command waiting for response from ({_remoteAddress}:{_remotePort}), message: {message}"); + + using (CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) + { + if (cancellationToken == default) + { + cancellationToken = cts.Token; + } + await WriteAsync(message, cancellationToken); + string readResponse = await ReadAsync(cancellationToken); + _logger.Trace($"Received response: {readResponse}"); + + return readResponse; + } + } + + /// + /// Send Command and Get Response asynchronously + /// + /// + /// + /// + /// + public async Task SendCommandGetResponseAsync(byte[] data, CancellationToken cancellationToken = default, int timeoutInMs = 5000) + { + if (_udpClient == null) + return null; + + _logger.Trace($"Sending command waiting for response from ({_remoteAddress}:{_remotePort}), message length: {data.Length}"); + + using (CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(timeoutInMs))) + { + if (cancellationToken == default) + { + cancellationToken = cts.Token; + } + await WriteAsync(data, (uint)data.Length, cancellationToken); + byte[] buffer = new byte[_defaultReadBufferSize]; + uint bytesRead = await ReadAsync(buffer, cancellationToken); + _logger.Trace($"Received response of size: {bytesRead}"); + + return buffer; + } + } + + /// + /// keeps reading until canceled via token, + /// received messages sent to dataReceived function + /// + /// + /// + /// + public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) + { + if (_udpClient == null) + return; + + _logger.Debug($"Starting continuous reading from port: {_localPort} ..."); + + while (!cancellationToken.IsCancellationRequested) + { + if (_udpClient == null) + break; + + var received = await ReceiveAsync(_udpClient, cancellationToken); + + if (received != null && received.Buffer != null) + { + UpdateRemoteAddressAndPort(received.RemoteEndPoint); + _logger.Trace($"Incoming Data from {_remoteAddress}:{_remotePort}: size {received.Buffer.Length}"); + string data = Encoding.UTF8.GetString(received.Buffer, 0, received.Buffer.Length); + dataReceived(data); + } + } + + _logger.Debug($"Finished continuous reading from {_remoteAddress}:{_remotePort} ..."); + } + + /// + /// keeps reading until canceled via token, + /// received messages sent to dataReceived function + /// + /// + /// + /// + public async Task KeepReadingAsync(CancellationToken cancellationToken, Action dataReceived) + { + if (_udpClient == null) + return; + + _logger.Debug($"Starting continuous reading from port: {_localPort} ..."); + + while (!cancellationToken.IsCancellationRequested) + { + if (_udpClient == null) + break; + + var received = await ReceiveAsync(_udpClient, cancellationToken); + if (received != null && received.Buffer != null) + { + UpdateRemoteAddressAndPort(received.RemoteEndPoint); + _logger.Trace($"Incoming Data from {_remoteAddress}:{_remotePort}: size {received.Buffer.Length}"); + dataReceived(received.Buffer); + } + } + + _logger.Debug($"Finished continuous reading from {_remoteAddress}:{_remotePort} ..."); + } + + #endregion + + #region Private Functions + /// + /// Update client information for logging + /// + /// + private void UpdateRemoteAddressAndPort(IPEndPoint remoteEndPoint) + { + if (remoteEndPoint == null) + return; + + if (_remotePort == 0 || string.IsNullOrEmpty(_remoteAddress)) + { + _remotePort = remoteEndPoint.Port; + _remoteAddress = remoteEndPoint.Address.ToString(); + } + + if (_remoteEndPoint == null || _remoteEndPoint.Port != remoteEndPoint.Port) + { + // get the remote endpoint + _remoteEndPoint = remoteEndPoint; + + _logger.Debug($"Starting to receive data from {_remoteAddress}:{_remotePort}"); + } + } + + /// + /// ReceiveAsyc with cancellation token implementation + /// + /// + /// + /// + private Task ReceiveAsync(UdpClient client, CancellationToken breakToken) => breakToken.IsCancellationRequested + ? Task.Run(() => new UdpReceiveResult()) + : Task.Factory.FromAsync + ((callback, state) => client.BeginReceive(callback, state), (ar) => + { + if (breakToken.IsCancellationRequested) + return new UdpReceiveResult(); + + IPEndPoint remoteEP = null; + var buffer = client.EndReceive(ar, ref remoteEP); + return new UdpReceiveResult(buffer, remoteEP); + }, null); + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdpAsync/CommDeviceUdpAsyncFactory.cs b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdpAsync/CommDeviceUdpAsyncFactory.cs index e670c85..4bbdadb 100644 --- a/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdpAsync/CommDeviceUdpAsyncFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/CommDevice/CommDeviceUdpAsync/CommDeviceUdpAsyncFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommDeviceUdpAsyncFactory")] - public class CommDeviceUdpAsyncFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommDeviceUdpAsyncFactory")] + public class CommDeviceUdpAsyncFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommDeviceUdpAsyncFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// CommDeviceUdpAsyncFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommDeviceUdpAsyncFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommDeviceUdpAsyncFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommDeviceUdpAsyncFactory injection constructor + /// + [ImportingConstructor] + public CommDeviceUdpAsyncFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ICommAsync)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommDeviceUdpAsync(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ICommAsync)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommDeviceUdpAsync(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +98,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new CommDeviceUdpAsync(name, _configurationManager, _logger); + return new CommDeviceUdpAsync(name, _configurationManager); } catch (Exception) { @@ -120,17 +111,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/Common/COTS/Pickering/Pickering.Pilfg.Interop.dll b/Source/TSRealLib/HAL/Implementations/Common/COTS/Pickering/Pickering.Pilfg.Interop.dll new file mode 100644 index 0000000..4111a17 Binary files /dev/null and b/Source/TSRealLib/HAL/Implementations/Common/COTS/Pickering/Pickering.Pilfg.Interop.dll differ diff --git a/Source/TSRealLib/HAL/Implementations/Common/COTS/Pickering/Pickering.Pilpxi.Interop.dll b/Source/TSRealLib/HAL/Implementations/Common/COTS/Pickering/Pickering.Pilpxi.Interop.dll new file mode 100644 index 0000000..871c913 Binary files /dev/null and b/Source/TSRealLib/HAL/Implementations/Common/COTS/Pickering/Pickering.Pilpxi.Interop.dll differ diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOAdvantech/DIOAdvantech.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOAdvantech/DIOAdvantech.cs index e388393..9ec1f57 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOAdvantech/DIOAdvantech.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOAdvantech/DIOAdvantech.cs @@ -16,30 +16,30 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using Raytheon.Instruments.GeneralIO; using System.Collections.Generic; +using System.IO; +using System.Reflection; using Automation.BDaq; using NLog; using Raytheon.Common; -using System.IO; -using System.Reflection; +using Raytheon.Instruments.GeneralIO; namespace Raytheon.Instruments { - /// - /// A class that implements a Context DIO card - /// - public class DIOAdvantech : IGeneralIO, IDisposable - { - #region PrivateClassMembers - private InstantDiCtrl _inputCtrl; - private InstantDoCtrl _outputCtrl; - private string _name; - private readonly int _deviceNum; - private readonly SelfTestResult _selfTestResult; - private State _state; - private object _syncObj = new Object(); - private ErrorCode errorCode = ErrorCode.Success; + /// + /// A class that implements a Context DIO card + /// + public class DIOAdvantech : IGeneralIO, IDisposable + { + #region PrivateClassMembers + private InstantDiCtrl _inputCtrl; + private InstantDoCtrl _outputCtrl; + private string _name; + private readonly int _deviceNum; + private readonly SelfTestResult _selfTestResult; + private State _state; + private object _syncObj = new Object(); + private ErrorCode errorCode = ErrorCode.Success; private int _numChannelPerPort = 8; private int _channelStartIndex = 0; @@ -47,60 +47,41 @@ namespace Raytheon.Instruments private int _numOutputChannels; private bool _shallWeInitializeOutput = false; - private Dictionary _signalNameToChannelMap = new Dictionary(); + private Dictionary _signalNameToChannelInfoMap = new Dictionary(); - /// - /// NLog logger - /// private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateClassFunctions - ~DIOAdvantech() - { - Dispose(false); - } + #endregion - private static bool BioFailed(ErrorCode err) - { - return err < ErrorCode.Success && err >= ErrorCode.ErrorHandleNotValid; - } - /// - /// Dispose the object's resources - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Shutdown(); + #region PrivateClassFunctions + ~DIOAdvantech() + { + Dispose(false); + } - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } - } + private static bool BioFailed(ErrorCode err) + { + return err < ErrorCode.Success && err >= ErrorCode.ErrorHandleNotValid; + } + /// + /// Dispose the object's resources + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Shutdown(); + + _state = State.Uninitialized; + } + } + } /// /// Because the user has to define each channel number in the config file, some people will use 0 or 1 start their starting channel number @@ -111,65 +92,65 @@ namespace Raytheon.Instruments /// bitIndex will range from 0..M /// private void GetPortIndexAndBitIndex(string signalName, out int portIndex, out int bitIndex) - { - portIndex = (int)(Math.Ceiling((double)((int)_signalNameToChannelMap[signalName].channelNumber + Math.Abs(_channelStartIndex - 1)) / (double)_numChannelPerPort) - 1.0); + { + portIndex = (int)(Math.Ceiling((double)((int)_signalNameToChannelInfoMap[signalName].channelNumber + Math.Abs(_channelStartIndex - 1)) / (double)_numChannelPerPort) - 1.0); - int multiplier = ((int)_signalNameToChannelMap[signalName].channelNumber + _numChannelPerPort) / _numChannelPerPort; - bitIndex = (((int)_signalNameToChannelMap[signalName].channelNumber + _numChannelPerPort) - (_numChannelPerPort * multiplier)) - _channelStartIndex; + int multiplier = ((int)_signalNameToChannelInfoMap[signalName].channelNumber + _numChannelPerPort) / _numChannelPerPort; + bitIndex = (((int)_signalNameToChannelInfoMap[signalName].channelNumber + _numChannelPerPort) - (_numChannelPerPort * multiplier)) - _channelStartIndex; if (bitIndex < 0) { bitIndex = _numChannelPerPort - 1; } } - /// - /// Invert Contec DIO bits. - /// - private byte InvertBit(byte bitValue) - { - if (bitValue == 0) - { - return 1; - } - else if (bitValue == 1) - { - return 0; - } - else - { - throw new Exception("Unexpected input value: " + bitValue.ToString()); - } - } - private void ReadBit(int port, int bitNum, out byte data) - { - _inputCtrl.ReadBit(port, bitNum, out data); - } - private void WriteBit(int port, int bitNum, byte bitState) - { - errorCode = _outputCtrl.WriteBit(port, bitNum, bitState); + /// + /// Invert Contec DIO bits. + /// + private byte InvertBit(byte bitValue) + { + if (bitValue == 0) + { + return 1; + } + else if (bitValue == 1) + { + return 0; + } + else + { + throw new Exception("Unexpected input value: " + bitValue.ToString()); + } + } + private void ReadBit(int port, int bitNum, out byte data) + { + _inputCtrl.ReadBit(port, bitNum, out data); + } + private void WriteBit(int port, int bitNum, byte bitState) + { + errorCode = _outputCtrl.WriteBit(port, bitNum, bitState); - if (BioFailed(errorCode)) - { - throw new Exception("call to WriteBit returned error: " + errorCode.ToString() + " on card: " + _name); ; - } - } - #endregion + if (BioFailed(errorCode)) + { + throw new Exception("call to WriteBit returned error: " + errorCode.ToString() + " on card: " + _name); ; + } + } + #endregion - #region PublicClassFunctions + #region PublicClassFunctions - /// - /// DIOAdvantech factory constructor - /// - /// - /// - public DIOAdvantech(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// DIOAdvantech factory constructor + /// + /// + /// + public DIOAdvantech(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string dioModuleDefPath = _configuration.GetConfigurationValue(deviceName, ConfigXml.DIO_MODULE_DEF_FILEPATH.ToString()); @@ -189,10 +170,10 @@ namespace Raytheon.Instruments Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.NUM_CHANNELS_PER_PORT.ToString()), out _numChannelPerPort); Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.CHANNEL_START_INDEX.ToString()), out _channelStartIndex); - if (!(_channelStartIndex == 0 || _channelStartIndex == 1)) - { - throw new Exception($"The value for key {ConfigIni.CHANNEL_START_INDEX.ToString()} in section {Name} must be 0 or 1 in {dioModuleDefPath}"); - } + if (!(_channelStartIndex == 0 || _channelStartIndex == 1)) + { + throw new Exception($"The value for key {ConfigIni.CHANNEL_START_INDEX.ToString()} in section {Name} must be 0 or 1 in {dioModuleDefPath}"); + } List outputSignalNames = dioModuleConfig.ReadAllKeys($"{Name}.{ConfigIni.OUTPUT_SIGNALS}"); List intputSignalNames = dioModuleConfig.ReadAllKeys($"{Name}.{ConfigIni.INPUT_SIGNALS}"); @@ -200,7 +181,7 @@ namespace Raytheon.Instruments IODatatypes.DIOChannelInfo info; foreach (string signalName in outputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.OUTPUT_SIGNALS}", signalName); @@ -211,115 +192,103 @@ namespace Raytheon.Instruments } info.channelNumber = Convert.ToUInt32(infoTokens[0]); + info.ioType = IODatatypes.IOType.DigitalOutput; info.initialValue = Convert.ToInt32(infoTokens[1]); - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } foreach (string signalName in intputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.INPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.INPUT_SIGNALS}", signalName); info.channelNumber = Convert.ToUInt32(iniLine); + info.ioType = IODatatypes.IOType.DigitalInput; info.initialValue = -1; - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - public DIOAdvantech(string deviceName, int deviceNum) - { - _deviceNum = deviceNum; - _name = deviceName; + /// + /// + /// + public DIOAdvantech(string deviceName, int deviceNum) + { + _deviceNum = deviceNum; + _name = deviceName; - _logger = LogManager.GetCurrentClassLogger(); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - public bool ClearErrors() - { - throw new NotImplementedException(); - } + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - //_outputCtrl.SelectedDevice; Need to see what the card returns for this - return "This is a Advantech DIO Card " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + //_outputCtrl.SelectedDevice; Need to see what the card returns for this + return "This is a Advantech DIO Card " + _name; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } - /// - /// Dispose of this object. - /// - public void Dispose() - { - lock (_syncObj) - { - try - { - Dispose(true); + set + { + throw new NotImplementedException(); + } + } + /// + /// Dispose of this object. + /// + public void Dispose() + { + lock (_syncObj) + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } - } - } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + GC.SuppressFinalize(this); + } + } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } /// /// @@ -327,50 +296,50 @@ namespace Raytheon.Instruments /// /// public IODatatypes.BitState GetBitState(string signalName) - { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The input channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels+_channelStartIndex} on card " + _name); + throw new Exception($"The input channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); } GetPortIndexAndBitIndex(signalName, out int portIndex, out int bitIndex); - ReadBit(portIndex, bitIndex, out byte data); + ReadBit(portIndex, bitIndex, out byte data); return (IODatatypes.BitState)(data); } - } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - public void Initialize() - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - //@@@ do we need both of these? DO can read and write. Read may be for internal read back - _inputCtrl = new InstantDiCtrl(); - _outputCtrl = new InstantDoCtrl(); + } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + //@@@ do we need both of these? DO can read and write. Read may be for internal read back + _inputCtrl = new InstantDiCtrl(); + _outputCtrl = new InstantDoCtrl(); - _inputCtrl.SelectedDevice = new DeviceInformation(_deviceNum); - _outputCtrl.SelectedDevice = new DeviceInformation(_deviceNum); + _inputCtrl.SelectedDevice = new DeviceInformation(_deviceNum); + _outputCtrl.SelectedDevice = new DeviceInformation(_deviceNum); if (_shallWeInitializeOutput) { - foreach (KeyValuePair item in _signalNameToChannelMap) + foreach (KeyValuePair item in _signalNameToChannelInfoMap) { if (item.Value.initialValue != -1) { @@ -380,73 +349,73 @@ namespace Raytheon.Instruments } _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } /// - /// Return list of signal names + /// Return map of all signals /// - public List GetSignalNames() + public Dictionary GetAllSignals() { - return new List(_signalNameToChannelMap.Keys); + return _signalNameToChannelInfoMap; } /// /// /// public string Name - { - get { return _name; } - set { _name = value; } - } + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public uint NumberOfInputBits - { - get - { - return (uint)_numInputChannels; - } - } + /// + /// + /// + public uint NumberOfInputBits + { + get + { + return (uint)_numInputChannels; + } + } - /// - /// - /// - public uint NumberOfOutputBits - { - get - { - return (uint)_numOutputChannels; - } - } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - lock (_syncObj) - { - // card does not support self test - //throw new NotImplementedException("card does not support self test" + " on card " + _name); - throw new NotImplementedException(); - } - } - public void Reset() - { - lock (_syncObj) - { - Shutdown(); - Initialize(); - } - } + /// + /// + /// + public uint NumberOfOutputBits + { + get + { + return (uint)_numOutputChannels; + } + } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + // card does not support self test + //throw new NotImplementedException("card does not support self test" + " on card " + _name); + throw new NotImplementedException(); + } + } + public void Reset() + { + lock (_syncObj) + { + Shutdown(); + Initialize(); + } + } /// /// @@ -455,58 +424,58 @@ namespace Raytheon.Instruments /// high(open) or low(closed) /// public void SetBit(string signalName, IODatatypes.BitState state) - { + { lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The output channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels +_channelStartIndex} on card " + _name); + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); } - GetPortIndexAndBitIndex(signalName, out int portIndex, out int bitIndex); + GetPortIndexAndBitIndex(signalName, out int portIndex, out int bitIndex); WriteBit(portIndex, bitIndex, (byte)state); - } - } - public void SetTristate(string signalName) - { - throw new NotImplementedException(); - } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - public void Shutdown() - { - lock (_syncObj) - { - if (_state == State.Ready) - { - _outputCtrl.Dispose(); - _inputCtrl.Dispose(); - _state = State.Uninitialized; - } - } - } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - #endregion - } + } + } + public void SetTristate(string signalName) + { + throw new NotImplementedException(); + } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + public void Shutdown() + { + lock (_syncObj) + { + if (_state == State.Ready) + { + _outputCtrl.Dispose(); + _inputCtrl.Dispose(); + _state = State.Uninitialized; + } + } + } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOAdvantech/DIOAdvantechFactory.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOAdvantech/DIOAdvantechFactory.cs index adf2d8b..1fef075 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOAdvantech/DIOAdvantechFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOAdvantech/DIOAdvantechFactory.cs @@ -30,71 +30,65 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DIOAdvantechFactory")] - public class DIOAdvantechFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DIOAdvantechFactory")] + public class DIOAdvantechFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DIOAdvantechFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DIOAdvantechFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DIOAdvantechFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DIOAdvantechFactory injection constructor + /// + [ImportingConstructor] + public DIOAdvantechFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IGeneralIO)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DIOAdvantech(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IGeneralIO)); + } + + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DIOAdvantech(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DIOSim(name, _configurationManager, _logger); + return new DIOSim(name, _configurationManager); else - return new DIOAdvantech(name, _configurationManager, _logger); + return new DIOAdvantech(name, _configurationManager); } catch (Exception) { @@ -123,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOContec/DIOContec.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOContec/DIOContec.cs index 49267b8..f6fefa3 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOContec/DIOContec.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOContec/DIOContec.cs @@ -16,14 +16,13 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using CdioCs; -using Raytheon.Instruments.GeneralIO; using System.Collections.Generic; -using NLog; -using Raytheon.Common; -using System.ComponentModel.Composition.Primitives; using System.IO; using System.Reflection; +using CdioCs; +using NLog; +using Raytheon.Common; +using Raytheon.Instruments.GeneralIO; namespace Raytheon.Instruments { @@ -47,15 +46,10 @@ namespace Raytheon.Instruments private int _numOutputChannels; private bool _shallWeInitializeOutput = false; - private Dictionary _signalNameToChannelMap = new Dictionary(); + private Dictionary _signalNameToChannelInfoMap = new Dictionary(); - /// - /// NLog logger - /// private readonly ILogger _logger; - /// - /// Raytheon configuration - /// + private readonly IConfigurationManager _configurationManager; private readonly IConfiguration _configuration; @@ -69,29 +63,15 @@ namespace Raytheon.Instruments /// True = currently disposing, False = not disposing. protected virtual void Dispose(bool disposing) { - try + if (disposing) { - if (disposing) + if (_state == State.Ready) { - if (_state == State.Ready) - { - Reset(); + Reset(); - _dio.Exit(_id); + _dio.Exit(_id); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. + _state = State.Uninitialized; } } } @@ -124,11 +104,11 @@ namespace Raytheon.Instruments /// /// /// - public DIOContec(string deviceName, IConfigurationManager configurationManager, ILogger logger) + public DIOContec(string deviceName, IConfigurationManager configurationManager) { Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); _configurationManager = configurationManager; _configuration = _configurationManager.GetConfiguration(Name); @@ -164,7 +144,7 @@ namespace Raytheon.Instruments IODatatypes.DIOChannelInfo info; foreach (string signalName in outputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.OUTPUT_SIGNALS}", signalName); @@ -175,22 +155,24 @@ namespace Raytheon.Instruments } info.channelNumber = Convert.ToUInt32(infoTokens[0]); + info.ioType = IODatatypes.IOType.DigitalOutput; info.initialValue = Convert.ToInt32(infoTokens[1]); - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } foreach (string signalName in intputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.INPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.INPUT_SIGNALS}", signalName); info.channelNumber = Convert.ToUInt32(iniLine); + info.ioType = IODatatypes.IOType.DigitalInput; info.initialValue = -1; - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } _selfTestResult = SelfTestResult.Unknown; @@ -207,13 +189,13 @@ namespace Raytheon.Instruments /// Note that all signals on the Contec DIO card are inverted. /// This class masks the inversion so that the caller does not have to deal with it. /// - public DIOContec(string name, string address, List inputPins, List outputPins) + public DIOContec(string deviceName, string address, List inputPins, List outputPins) { - _name = name; + _name = deviceName; _address = address; - _logger = LogManager.GetCurrentClassLogger(); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); _selfTestResult = SelfTestResult.Unknown; @@ -275,23 +257,9 @@ namespace Raytheon.Instruments { lock (_syncObj) { - try - { - Dispose(true); + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } + GC.SuppressFinalize(this); } } @@ -320,15 +288,15 @@ namespace Raytheon.Instruments { lock (_syncObj) { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The input channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The input channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; byte dioData = 0; @@ -417,7 +385,7 @@ namespace Raytheon.Instruments if (_shallWeInitializeOutput) { - foreach (KeyValuePair item in _signalNameToChannelMap) + foreach (KeyValuePair item in _signalNameToChannelInfoMap) { if (item.Value.initialValue != -1) { @@ -436,11 +404,11 @@ namespace Raytheon.Instruments } /// - /// Return list of signal names + /// Return map of all signals /// - public List GetSignalNames() + public Dictionary GetAllSignals() { - return new List(_signalNameToChannelMap.Keys); + return _signalNameToChannelInfoMap; } /// @@ -525,15 +493,15 @@ namespace Raytheon.Instruments { lock (_syncObj) { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The output channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; int ret = _dio.OutBit(_id, (short)bitIndex, InvertBit((byte)state)); diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOContec/DIOContecFactory.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOContec/DIOContecFactory.cs index 4a2365f..115a74b 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOContec/DIOContecFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOContec/DIOContecFactory.cs @@ -32,71 +32,64 @@ // ********************************************************************************************************** // Ignore Spelling: Contec -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DIOContecFactory")] - public class DIOContecFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DIOContecFactory")] + public class DIOContecFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DIOContecFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DIOContecFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DIOContecFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DIOContecFactory injection constructor + /// + [ImportingConstructor] + public DIOContecFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IGeneralIO)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DIOContec(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IGeneralIO)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DIOContec(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -107,12 +100,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DIOSim(name, _configurationManager, _logger); + return new DIOSim(name, _configurationManager); else - return new DIOContec(name, _configurationManager, _logger); + return new DIOContec(name, _configurationManager); } catch (Exception) { @@ -125,17 +116,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003.Datatypes.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003.Datatypes.cs new file mode 100644 index 0000000..92ff65c --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003.Datatypes.cs @@ -0,0 +1,66 @@ +// ******************************************************************************// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +// PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +// AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +// UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +// RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +// CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +// OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +// COMPANY. +// +// THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. GOVERNMENT +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// WARNING: THIS DOCUMENT CONTAINS TECHNICAL DATA AND / OR TECHNOLOGY WHOSE +// EXPORT OR DISCLOSURE TO NON-U.S. PERSONS, WHEREVER LOCATED, IS RESTRICTED +// BY THE INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) (22 C.F.R. SECTION +// 120-130) OR THE EXPORT ADMINISTRATION REGULATIONS (EAR) (15 C.F.R. SECTION +// 730-774). THIS DOCUMENT CANNOT BE EXPORTED (E.G., PROVIDED TO A SUPPLIER +// OUTSIDE OF THE UNITED STATES) OR DISCLOSED TO A NON-U.S. PERSON, WHEREVER +// LOCATED, UNTIL A FINAL JURISDICTION AND CLASSIFICATION DETERMINATION HAS +// BEEN COMPLETED AND APPROVED BY RAYTHEON, AND ANY REQUIRED U.S. GOVERNMENT +// APPROVALS HAVE BEEN OBTAINED. VIOLATIONS ARE SUBJECT TO SEVERE CRIMINAL +// PENALTIES. +// +// DOD 5220.22-M, INDUSTRIAL SECURITY MANUAL, CHAPTER 5, SECTION 1 THROUGH 9 : +// FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN OR DOD 5200.1-R, +// INFORMATION SECURITY PROGRAM, CHAPTER 6. FOR UNCLASSIFIED, LIMITED DOCUMENTS +// DESTROY BY ANY METHOD THAT WILL PREVENT DISCLOSURE OF CONTENTS OR +// RECONSTRUCTION OF THE DOCUMENT. +// ****************************************************************************// + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Raytheon.Instruments +{ + internal enum BitDirection + { + Input, + Output + } + + internal struct PortDirections + { + public BitDirection _PortOne; + public BitDirection _PortTwo; + public BitDirection _PortThree; + public BitDirection _PortFour; + public BitDirection _PortFive; + + public PortDirections( BitDirection PortOne, BitDirection PortTwo, BitDirection PortThree, + BitDirection PortFour, BitDirection PortFive ) + { + _PortOne = PortOne; + _PortTwo = PortTwo; + _PortThree = PortThree; + _PortFour = PortFour; + _PortFive = PortFive; + } + + } +} diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003.cs new file mode 100644 index 0000000..79fac58 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003.cs @@ -0,0 +1,635 @@ +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.Sockets; +using System.Text; +using System.Threading; +using NLog; +using Raytheon.Common; +using Raytheon.Instruments.GeneralIO; + +namespace Raytheon.Instruments +{ + /// + /// A class that implements a Pickering DIO card + /// + public class DIOIcs8003 : IGeneralIO + { + #region PrivateClassMembers + private string _name; + private string _ipAddress; + private int _ipPort; + private SelfTestResult _selfTestResult; + private State _state; + private object _syncObj = new Object(); + private int _numChannelPerPort = 8; + private int _channelStartIndex = 0; + private int _numInputChannels; + private int _numOutputChannels; + private bool _shallWeInitializeOutput = false; + private NetworkStream _dioStream; + private PortDirections _portDirections; + + private const int _READ_BUFFER_SIZE = 128; + private const int _READ_TIMEOUT = 5000; + private const int _BUFFER_OFFSET = 0; + private byte[] _dataBuffer; + + // Carriage return for string + private const string _CARRIAGE_RETURN = "\n"; + + // Reset Device + private const String _RestDevice = "*RST"; + + // Execute Self-Test + private const String _CommandSelfTest = "*TST?"; + + private Dictionary _signalNameToChannelInfoMap = new Dictionary(); + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PublicClassFunctions + + /// + /// DIOIcs8003 factory constructor + /// + /// + /// + public DIOIcs8003(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _dataBuffer = new byte[_READ_BUFFER_SIZE]; + + _portDirections = new PortDirections(BitDirection.Input, BitDirection.Input, BitDirection.Input, BitDirection.Input, BitDirection.Input); + + string dioModuleDefPath = _configuration.GetConfigurationValue(deviceName, ConfigXml.DIO_MODULE_DEF_FILEPATH.ToString()); + + if (!Path.IsPathRooted(dioModuleDefPath)) + dioModuleDefPath = Path.GetFullPath(Path.Combine(_configurationManager.ConfigurationStoragePath, dioModuleDefPath)); + + IConfigurationFile dioModuleConfig = new ConfigurationFile(dioModuleDefPath); + + _ipAddress = dioModuleConfig.ReadValue(Name, ConfigIni.DIO_ADDRESS.ToString()); + Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.DIO_PORT.ToString()), out _ipPort); + + Boolean.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.SHALL_WE_DRIVE_OUTPUT_UPON_INITIALIZATION.ToString()), out _shallWeInitializeOutput); + + List outputSignalNames = dioModuleConfig.ReadAllKeys($"{Name}.{ConfigIni.OUTPUT_SIGNALS}"); + List intputSignalNames = dioModuleConfig.ReadAllKeys($"{Name}.{ConfigIni.INPUT_SIGNALS}"); + + Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.NUM_CHANNELS_PER_PORT.ToString()), out _numChannelPerPort); + Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.NUM_OUTPUT_CHANNELS.ToString()), out _numOutputChannels); + Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.NUM_INPUT_CHANNELS.ToString()), out _numInputChannels); + Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.CHANNEL_START_INDEX.ToString()), out _channelStartIndex); + + if (!(_channelStartIndex == 0 || _channelStartIndex == 1)) + { + throw new Exception($"The value for key {ConfigIni.CHANNEL_START_INDEX.ToString()} in section {Name} must be 0 or 1 in {dioModuleDefPath}"); + } + + IODatatypes.DIOChannelInfo info; + foreach (string signalName in outputSignalNames) + { + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) + throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} conflicts with the same key defined in another section."); + + string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.OUTPUT_SIGNALS}", signalName); + string[] infoTokens = iniLine.Split('|'); + if (infoTokens.Length != 2) + { + throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} does not contain 2 tokens"); + } + + info.channelNumber = Convert.ToUInt32(infoTokens[0]); + info.ioType = IODatatypes.IOType.DigitalOutput; + info.initialValue = Convert.ToInt32(infoTokens[1]); + + _signalNameToChannelInfoMap[signalName] = info; + } + + foreach (string signalName in intputSignalNames) + { + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) + throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.INPUT_SIGNALS} conflicts with the same key defined in another section."); + + string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.INPUT_SIGNALS}", signalName); + + info.channelNumber = Convert.ToUInt32(iniLine); + info.ioType = IODatatypes.IOType.DigitalInput; + info.initialValue = -1; + + _signalNameToChannelInfoMap[signalName] = info; + } + + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } + + ~DIOIcs8003() + { + + } + + /// + /// Initialize the card + /// + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + //Create and open a socket to the dio card + TcpClient dioSocket = new TcpClient(_ipAddress, _ipPort); + _dioStream = dioSocket.GetStream(); + + // Set the timeout (read) + _dioStream.ReadTimeout = _READ_TIMEOUT; + + Thread.Sleep(1000); + + // Flush the buffer + if (_dioStream.DataAvailable) + { + Thread.Sleep(1000); + Read(); + } + + // Send command to reset device + Write(_RestDevice); + + _state = State.Ready; + } + else + { + throw new Exception("Expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } + + /// + /// Return map of all signals + /// + public Dictionary GetAllSignals() + { + return _signalNameToChannelInfoMap; + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a ICS8003 DIO Card " + _name; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + /// + /// + public void SetBit(string signalName, IODatatypes.BitState state) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) + throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); + + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) + { + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); + } + + uint bit = _signalNameToChannelInfoMap[signalName].channelNumber; + String msg; + if (state == IODatatypes.BitState.High) + { + msg = "Route:Close "; + } + else + { + msg = "Route:Open "; + } + + uint conversion = ConvertChannelToBit(bit); + + // Byte 1 + if (bit <= 8) + { + if (_portDirections._PortOne == BitDirection.Input) + { + InitializeOutputsLow(1); + + _portDirections._PortOne = BitDirection.Output; + } + + msg = msg + "1,"; + } + // Byte 2 + else if (bit > 8 && bit <= 16) + { + if (_portDirections._PortTwo == BitDirection.Input) + { + InitializeOutputsLow(2); + + _portDirections._PortTwo = BitDirection.Output; + } + + msg = msg + "2,"; + } + // Byte 3 + else if (bit > 16 && bit <= 24) + { + if (_portDirections._PortThree == BitDirection.Input) + { + InitializeOutputsLow(3); + + _portDirections._PortThree = BitDirection.Output; + } + + msg = msg + "3,"; + } + // Byte 4 + else if (bit > 24 && bit <= 32) + { + if (_portDirections._PortFour == BitDirection.Input) + { + InitializeOutputsLow(4); + + _portDirections._PortFour = BitDirection.Output; + } + + msg = msg + "4,"; + } + // Byte 5 + else if (bit > 32 && bit <= 40) + { + if (_portDirections._PortFive == BitDirection.Input) + { + InitializeOutputsLow(5); + + _portDirections._PortFive = BitDirection.Output; + } + + msg = msg + "5,"; + } + + // Set the bit + msg = msg + conversion.ToString(); + + // Send msg + Write(msg); + } + } + + /// + /// + /// + /// + /// + public IODatatypes.BitState GetBitState(string signalName) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) + throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); + + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) + { + throw new Exception($"The input channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); + } + + uint bit = _signalNameToChannelInfoMap[signalName].channelNumber; + uint conversion = ConvertChannelToBit(bit); + + String msg = "Sense:Bit? "; + // Byte 1 + if (bit <= 8) + { + msg = msg + "1,"; + } + // Byte 2 + else if (bit > 8 && bit <= 16) + { + msg = msg + "2,"; + } + // Byte 3 + else if (bit > 16 && bit <= 24) + { + msg = msg + "3,"; + } + // Byte 4 + else if (bit > 24 && bit <= 32) + { + msg = msg + "4,"; + } + // Byte 5 + else if (bit > 32 && bit <= 40) + { + msg = msg + "5,"; + } + + msg = msg + conversion.ToString(); + + String result = Query(msg); + if (result == "1") + { + return IODatatypes.BitState.High; + } + else + { + return IODatatypes.BitState.Low; + } + } + } + + private uint ConvertChannelToBit(uint bit) + { + uint conversion = (bit % 8); + if (conversion == 0) + { + conversion = 7; + } + else + { + conversion -= 1; + } + + return conversion; + } + + private String Query(String msg) + { + lock (_syncObj) + { + // Send message + Write(msg); + + // Wait + Thread.Sleep(100); + + // Get response (and parse) + String rsp = Parse(Read()); + + return rsp; + } + } + + private String Read() + { + lock (_syncObj) + { + String rsp = ""; + + // Flush + FlushReadBuffer(ref _dataBuffer); + + // Get response + _dioStream.Read(_dataBuffer, _BUFFER_OFFSET, _dataBuffer.Length); + + rsp = Encoding.ASCII.GetString(_dataBuffer); + + return rsp; + } + } + + + private void Write(String msg) + { + lock (_syncObj) + { + // Check for connect + + string commandString = msg + _CARRIAGE_RETURN; + + byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); + + // Send message + _dioStream.Write(commandBuffer, _BUFFER_OFFSET, commandBuffer.Length); + } + } + + private void FlushReadBuffer(ref byte[] buffer) + { + // Clear the buffer + Array.Clear(buffer, _BUFFER_OFFSET, buffer.Length); + } + + // Initialize a port to be an output in a known (low) state + private void InitializeOutputsLow(int port) + { + // Initialize port as an output (initialize to low) + String msg = "Source:Data:Port" + port.ToString() + " 0"; + + Write(msg); + } + + private String Parse(String msg) + { + String Result = ""; + + // Parse the message by line endings (\n) + String[] Temp = msg.Split('\n'); + + // Result in first line + Result = Temp[0]; + return Result; + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + /// + /// + /// + public uint NumberOfInputBits + { + get + { + return (uint)_numInputChannels; + } + } + + /// + /// + /// + public uint NumberOfOutputBits + { + get + { + return (uint)_numOutputChannels; + } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + // Send command to perform self-test (might be empty string) + String results = Query(_CommandSelfTest); + if (results == "0") + { + _selfTestResult = SelfTestResult.Pass; + } + else + { + _selfTestResult = SelfTestResult.Fail; + } + + return _selfTestResult; + } + } + + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + Shutdown(); + Initialize(); + } + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + /// + public void SetTristate(string signalName) + { + throw new NotImplementedException(); + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + if (_dioStream != null) + { + _dioStream.Close(); + } + _state = State.Uninitialized; + } + } + #endregion + } +} diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003.csproj b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003.csproj new file mode 100644 index 0000000..fba1853 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003.csproj @@ -0,0 +1,36 @@ + + + + + net472 + Raytheon.Instruments.DIOIcs8003 + DIO ICS8003 implementation + DIO ICS8003 implementation + Library + + + + 1.0.0 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003Factory.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003Factory.cs new file mode 100644 index 0000000..8abc045 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/DIOIcs8003Factory.cs @@ -0,0 +1,130 @@ +// ********************************************************************************************************** +// DIOPickering40xFactory.cs +// 2/20/2023 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Reflection; +using NLog; +using Raytheon.Common; + +namespace Raytheon.Instruments +{ + [ExportInstrumentFactory(ModelNumber = "DIOIcs8003Factory")] + public class DIOIcs8003Factory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); + + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; + + public DIOIcs8003Factory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } + + /// + /// DIOIcs8003Factory injection constructor + /// + [ImportingConstructor] + public DIOIcs8003Factory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; + + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IGeneralIO)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DIOIcs8003(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } + + /// + /// Gets the instrument + /// + /// + /// + public object GetInstrument(string name, bool simulateHw) + { + try + { + if (simulateHw) + return new DIOSim(name, _configurationManager); + else + return new DIOIcs8003(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } + + /// + /// Gets supported interfaces + /// + /// + public ICollection GetSupportedInterfaces() + { + return _supportedInterfaces.ToArray(); + } + + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } +} diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/Documentation/8003_13_manual.pdf b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/Documentation/8003_13_manual.pdf new file mode 100644 index 0000000..62b2e55 Binary files /dev/null and b/Source/TSRealLib/HAL/Implementations/DIO/DIOIcs8003/Documentation/8003_13_manual.pdf differ diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40x.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40x.cs index 485e0f5..8459d90 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40x.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40x.cs @@ -16,115 +16,73 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using Raytheon.Instruments.GeneralIO; using System.Collections.Generic; -using Raytheon.Common; -using NLog; -using Pickering.Lxi.Communication; -using Pickering.Lxi.Piplx; -using Pickering.Lxi; using System.IO; -using System.Reflection; +using NLog; +using Pickering.Lxi.Piplx; +using Raytheon.Common; +using Raytheon.Instruments.GeneralIO; namespace Raytheon.Instruments { /// /// A class that implements a Pickering DIO card /// - public class DIOPickering40x : IGeneralIO, IDisposable + public class DIOPickering40x : IGeneralIO { #region PrivateClassMembers private string _name; - private readonly int _pxiCardSlotIndex; - private SelfTestResult _selfTestResult; - private State _state; - private object _syncObj = new Object(); - private PiplxCard _dioCard; + private string _lxiIpAddress; + private int _deviceNum; + private int _busNum; + private SelfTestResult _selfTestResult; + private State _state; + private object _syncObj = new Object(); + private PiplxCard _dioCard; private int _numChannelPerPort = 8; private int _channelStartIndex = 0; private int _numInputChannels; private int _numOutputChannels; - private bool _shallWeInitializeOutput = false; + private bool _shallWeInitializeOutput = false; + PiplxManager _piplxManager; - private Dictionary _signalNameToChannelMap = new Dictionary(); + private Dictionary _signalNameToChannelInfoMap = new Dictionary(); + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PublicClassFunctions /// - /// NLog logger + /// DIOPickering40x factory constructor /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + /// + /// + public DIOPickering40x(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - #endregion + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - #region PrivateClassFunctions + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - /// - /// The finalizer. - /// - ~DIOPickering40x() - { - Dispose(false); - } - - /// - /// Dispose of this object. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - // nothing to do here - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - #endregion - - #region PublicClassFunctions - - /// - /// DIOPickering40x factory constructor - /// - /// - /// - public DIOPickering40x(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string dioModuleDefPath = _configuration.GetConfigurationValue(deviceName, ConfigXml.DIO_MODULE_DEF_FILEPATH.ToString()); if (!Path.IsPathRooted(dioModuleDefPath)) - dioModuleDefPath = Path.GetFullPath(Path.Combine(assemblyFolder, dioModuleDefPath)); + dioModuleDefPath = Path.GetFullPath(Path.Combine(_configurationManager.ConfigurationStoragePath, dioModuleDefPath)); IConfigurationFile dioModuleConfig = new ConfigurationFile(dioModuleDefPath); - Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.PXI_CARD_SLOT_INDEX.ToString()), out _pxiCardSlotIndex); + _lxiIpAddress = dioModuleConfig.ReadValue(Name, ConfigIni.LXI_IP_ADDRESS.ToString()); + Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.BUS_NUMBER.ToString()), out _busNum); + Int32.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.DEVICE_NUMBER.ToString()), out _deviceNum); - Boolean.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.SHALL_WE_DRIVE_OUTPUT_UPON_INITIALIZATION.ToString()), out _shallWeInitializeOutput); + Boolean.TryParse(dioModuleConfig.ReadValue(Name, ConfigIni.SHALL_WE_DRIVE_OUTPUT_UPON_INITIALIZATION.ToString()), out _shallWeInitializeOutput); List outputSignalNames = dioModuleConfig.ReadAllKeys($"{Name}.{ConfigIni.OUTPUT_SIGNALS}"); List intputSignalNames = dioModuleConfig.ReadAllKeys($"{Name}.{ConfigIni.INPUT_SIGNALS}"); @@ -139,39 +97,50 @@ namespace Raytheon.Instruments IODatatypes.DIOChannelInfo info; foreach (string signalName in outputSignalNames) - { - if (_signalNameToChannelMap.ContainsKey(signalName)) + { + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.OUTPUT_SIGNALS}", signalName); - string[] infoTokens = iniLine.Split('|'); - if (infoTokens.Length != 2) - { - throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} does not contain 2 tokens"); - } + string[] infoTokens = iniLine.Split('|'); + if (infoTokens.Length != 2) + { + throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} does not contain 2 tokens"); + } info.channelNumber = Convert.ToUInt32(infoTokens[0]); + info.ioType = IODatatypes.IOType.DigitalOutput; info.initialValue = Convert.ToInt32(infoTokens[1]); - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } foreach (string signalName in intputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.INPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.INPUT_SIGNALS}", signalName); info.channelNumber = Convert.ToUInt32(iniLine); - info.initialValue = -1; + info.ioType = IODatatypes.IOType.DigitalInput; + info.initialValue = -1; - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } + + ~DIOPickering40x() + { + if (_dioCard != null) + { + _dioCard.Close(); + _piplxManager.Disconnect(); + } + } /// /// Initialize the card @@ -182,27 +151,39 @@ namespace Raytheon.Instruments { if (_state == State.Uninitialized) { - PiplxManager manager = new PiplxManager(""); + _piplxManager = new PiplxManager(_lxiIpAddress); - _dioCard = (PiplxCard)manager.Cards[_pxiCardSlotIndex]; + foreach (PiplxCard card in _piplxManager.Cards) + { + PiplxCardInfo info = (PiplxCardInfo)card.Info; - PiplxCardInfo info = (PiplxCardInfo)_dioCard.Info; + if (info.Device == _deviceNum && info.Bus == _busNum) + { + _dioCard = card; + _numInputChannels = info.InputSubunitsCount * _numChannelPerPort; + _numOutputChannels = info.OutputSubunitsCount * _numChannelPerPort; - _numInputChannels = info.InputSubunitsCount * _numChannelPerPort; - _numOutputChannels = info.OutputSubunitsCount * _numChannelPerPort; + _dioCard.Open(); - _dioCard.Open(); + break; + } + } - if (_shallWeInitializeOutput) - { - foreach (KeyValuePair item in _signalNameToChannelMap) - { - if (item.Value.initialValue != -1) - { - SetBit(item.Key, (IODatatypes.BitState)item.Value.initialValue); - } - } - } + if (_dioCard == null) + { + throw new Exception($"No DIO card exists in LXI chassis with DEVICE_NUMBER={_deviceNum} and BUS_NUMBER={_busNum}"); + } + + if (_shallWeInitializeOutput) + { + foreach (KeyValuePair item in _signalNameToChannelInfoMap) + { + if (item.Value.initialValue != -1) + { + SetBit(item.Key, (IODatatypes.BitState)item.Value.initialValue); + } + } + } _state = State.Ready; } @@ -214,11 +195,11 @@ namespace Raytheon.Instruments } /// - /// Return list of signal names + /// Return map of all signals /// - public List GetSignalNames() - { - return new List(_signalNameToChannelMap.Keys); + public Dictionary GetAllSignals() + { + return _signalNameToChannelInfoMap; } /// @@ -226,79 +207,52 @@ namespace Raytheon.Instruments /// /// public bool ClearErrors() - { - throw new NotImplementedException(); - } + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Pickering DIO Card " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Pickering DIO Card " + _name; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - lock (_syncObj) - { - try - { - Dispose(true); + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } /// /// @@ -309,19 +263,19 @@ namespace Raytheon.Instruments { lock (_syncObj) { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The input channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels +_channelStartIndex} on card " + _name); + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); } GetPortIndexAndBitIndex(signalName, out int portIndex, out int bitIndex); DigitalInputOutputSubunit subunit = (DigitalInputOutputSubunit)_dioCard.OutputSubunits[portIndex]; - subunit[bitIndex+1] = state != 0; + subunit[bitIndex + 1] = state != 0; } } @@ -331,24 +285,24 @@ namespace Raytheon.Instruments /// /// public IODatatypes.BitState GetBitState(string signalName) - { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The input channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels+_channelStartIndex} on card " + _name); + throw new Exception($"The input channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); } GetPortIndexAndBitIndex(signalName, out int portIndex, out int bitIndex); DigitalInputOutputSubunit subunit = (DigitalInputOutputSubunit)_dioCard.InputSubunits[portIndex]; - return (IODatatypes.BitState)(subunit[bitIndex+1] ? 1:0); + return (IODatatypes.BitState)(subunit[bitIndex + 1] ? 1 : 0); } - } + } /// /// Because the user has to define each channel number in the config file, some people will use 0 or 1 start their starting channel number @@ -360,10 +314,10 @@ namespace Raytheon.Instruments /// private void GetPortIndexAndBitIndex(string signalName, out int portIndex, out int bitIndex) { - portIndex = (int)(Math.Ceiling((double)((int)_signalNameToChannelMap[signalName].channelNumber + Math.Abs(_channelStartIndex - 1)) / (double)_numChannelPerPort) - 1.0); + portIndex = (int)(Math.Ceiling((double)((int)_signalNameToChannelInfoMap[signalName].channelNumber + Math.Abs(_channelStartIndex - 1)) / (double)_numChannelPerPort) - 1.0); - int multiplier = ((int)_signalNameToChannelMap[signalName].channelNumber + _numChannelPerPort) / _numChannelPerPort; - bitIndex = (((int)_signalNameToChannelMap[signalName].channelNumber + _numChannelPerPort) - (_numChannelPerPort * multiplier)) - _channelStartIndex; + int multiplier = ((int)_signalNameToChannelInfoMap[signalName].channelNumber + _numChannelPerPort) / _numChannelPerPort; + bitIndex = (((int)_signalNameToChannelInfoMap[signalName].channelNumber + _numChannelPerPort) - (_numChannelPerPort * multiplier)) - _channelStartIndex; if (bitIndex < 0) { bitIndex = _numChannelPerPort - 1; @@ -374,109 +328,109 @@ namespace Raytheon.Instruments /// /// public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } - - /// - /// - /// - public uint NumberOfInputBits - { - get - { - return (uint)_numInputChannels; - } - } - - /// - /// - /// - public uint NumberOfOutputBits - { - get - { - return (uint)_numOutputChannels; - } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - lock (_syncObj) - { + { + get + { throw new NotImplementedException(); } - } + } - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + /// + /// + /// + public uint NumberOfInputBits + { + get + { + return (uint)_numInputChannels; + } + } + + /// + /// + /// + public uint NumberOfOutputBits + { + get + { + return (uint)_numOutputChannels; + } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { Shutdown(); Initialize(); } - } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - /// - public void SetTristate(string signalName) - { + /// + /// + /// + /// + public void SetTristate(string signalName) + { throw new NotImplementedException(); } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Shutdown() - { - lock (_syncObj) - { - _state = State.Uninitialized; - } - } - #endregion - } + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + _state = State.Uninitialized; + } + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40x.csproj b/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40x.csproj index d49f915..e938cff 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40x.csproj +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40x.csproj @@ -4,8 +4,8 @@ net472 Raytheon.Instruments.DIOPickering40x - DIO Sim implementation - DIO Sim implementation + DIO Pickering 40x implementation + DIO Pickering 40x implementation Library diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40xFactory.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40xFactory.cs index 6f660be..6e56d49 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40xFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/DIOPickering40xFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DIOPickering40xFactory")] - public class DIOPickering40xFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DIOPickering40xFactory")] + public class DIOPickering40xFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DIOPickering40xFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DIOPickering40xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DIOPickering40xFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DIOPickering40xFactory injection constructor + /// + [ImportingConstructor] + public DIOPickering40xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IGeneralIO)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DIOPickering40x(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IGeneralIO)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DIOPickering40x(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DIOSim(name, _configurationManager, _logger); + return new DIOSim(name, _configurationManager); else - return new DIOPickering40x(name, _configurationManager, _logger); + return new DIOPickering40x(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/Documentation/Supported_Devices.txt b/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/Documentation/Supported_Devices.txt new file mode 100644 index 0000000..7794c32 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOPickering40x/Documentation/Supported_Devices.txt @@ -0,0 +1 @@ +Pickering 40-419-003 \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/DIOSiCp210x.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/DIOSiCp210x.cs index a14b832..96a2d04 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/DIOSiCp210x.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/DIOSiCp210x.cs @@ -16,30 +16,30 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using Raytheon.Instruments.GeneralIO; using System.Collections.Generic; +using System.IO; +using System.Reflection; using CP210xRuntime_DLL; using NLog; using Raytheon.Common; -using System.IO; -using System.Reflection; +using Raytheon.Instruments.GeneralIO; namespace Raytheon.Instruments { - /// - /// Class for controlling a Silicon Labs CP2108 UART GPIO device - /// - public class DIOSiCp210x : IGeneralIO, IDisposable - { + /// + /// Class for controlling a Silicon Labs CP2108 UART GPIO device + /// + public class DIOSiCp210x : IGeneralIO, IDisposable + { - #region PrivateClassMembers - protected IntPtr _handle; - protected uint _deviceNum; - protected State _state; - protected string _name; - protected IConfigurationFile _dioModuleConfig; + #region PrivateClassMembers + protected IntPtr _handle; + protected uint _deviceNum; + protected State _state; + protected string _name; + protected IConfigurationFile _dioModuleConfig; protected SelfTestResult _selfTestResult; - protected object _syncObj = new Object(); + protected object _syncObj = new Object(); protected int _numChannelPerPort = 8; protected int _channelStartIndex = 0; @@ -47,190 +47,168 @@ namespace Raytheon.Instruments protected int _numOutputChannels; protected bool _shallWeInitializeOutput = false; - protected Dictionary _signalNameToChannelMap = new Dictionary(); + protected Dictionary _signalNameToChannelInfoMap = new Dictionary(); protected const ushort CP210x_GPIO_0 = 0x0001; - protected const ushort CP210x_GPIO_1 = 0x0002; - protected const ushort CP210x_GPIO_2 = 0x0004; - protected const ushort CP210x_GPIO_3 = 0x0008; - protected const ushort CP210x_GPIO_4 = 0x0010; - protected const ushort CP210x_GPIO_5 = 0x0020; - protected const ushort CP210x_GPIO_6 = 0x0040; - protected const ushort CP210x_GPIO_7 = 0x0080; - protected const ushort CP210x_GPIO_8 = 0x0100; - protected const ushort CP210x_GPIO_9 = 0x0200; - protected const ushort CP210x_GPIO_10 = 0x0400; - protected const ushort CP210x_GPIO_11 = 0x0800; - protected const ushort CP210x_GPIO_12 = 0x1000; - protected const ushort CP210x_GPIO_13 = 0x2000; - protected const ushort CP210x_GPIO_14 = 0x4000; - protected const ushort CP210x_GPIO_15 = 0x8000; + protected const ushort CP210x_GPIO_1 = 0x0002; + protected const ushort CP210x_GPIO_2 = 0x0004; + protected const ushort CP210x_GPIO_3 = 0x0008; + protected const ushort CP210x_GPIO_4 = 0x0010; + protected const ushort CP210x_GPIO_5 = 0x0020; + protected const ushort CP210x_GPIO_6 = 0x0040; + protected const ushort CP210x_GPIO_7 = 0x0080; + protected const ushort CP210x_GPIO_8 = 0x0100; + protected const ushort CP210x_GPIO_9 = 0x0200; + protected const ushort CP210x_GPIO_10 = 0x0400; + protected const ushort CP210x_GPIO_11 = 0x0800; + protected const ushort CP210x_GPIO_12 = 0x1000; + protected const ushort CP210x_GPIO_13 = 0x2000; + protected const ushort CP210x_GPIO_14 = 0x4000; + protected const ushort CP210x_GPIO_15 = 0x8000; - // Return codes - public const byte SI_SUCCESS = 0x00; - public const byte SI_DEVICE_NOT_FOUND = 0xFF; - public const byte SI_INVALID_HANDLE = 0x01; - public const byte SI_READ_ERROR = 0x02; - public const byte SI_RX_QUEUE_NOT_READY = 0x03; - public const byte SI_WRITE_ERROR = 0x04; - public const byte SI_RESET_ERROR = 0x05; - public const byte SI_INVALID_PARAMETER = 0x06; - public const byte SI_INVALID_REQUEST_LENGTH = 0x07; - public const byte SI_DEVICE_IO_FAILED = 0x08; - public const byte SI_INVALID_BAUDRATE = 0x09; - public const byte SI_FUNCTION_NOT_SUPPORTED = 0x0a; - public const byte SI_GLOBAL_DATA_ERROR = 0x0b; - public const byte SI_SYSTEM_ERROR_CODE = 0x0c; - public const byte SI_READ_TIMED_OUT = 0x0d; - public const byte SI_WRITE_TIMED_OUT = 0x0e; - public const byte SI_IO_PENDING = 0x0f; - public const byte SI_NOTHING_TO_CANCEL = 0xa0; + // Return codes + public const byte SI_SUCCESS = 0x00; + public const byte SI_DEVICE_NOT_FOUND = 0xFF; + public const byte SI_INVALID_HANDLE = 0x01; + public const byte SI_READ_ERROR = 0x02; + public const byte SI_RX_QUEUE_NOT_READY = 0x03; + public const byte SI_WRITE_ERROR = 0x04; + public const byte SI_RESET_ERROR = 0x05; + public const byte SI_INVALID_PARAMETER = 0x06; + public const byte SI_INVALID_REQUEST_LENGTH = 0x07; + public const byte SI_DEVICE_IO_FAILED = 0x08; + public const byte SI_INVALID_BAUDRATE = 0x09; + public const byte SI_FUNCTION_NOT_SUPPORTED = 0x0a; + public const byte SI_GLOBAL_DATA_ERROR = 0x0b; + public const byte SI_SYSTEM_ERROR_CODE = 0x0c; + public const byte SI_READ_TIMED_OUT = 0x0d; + public const byte SI_WRITE_TIMED_OUT = 0x0e; + public const byte SI_IO_PENDING = 0x0f; + public const byte SI_NOTHING_TO_CANCEL = 0xa0; - /// - /// NLog logger - /// - protected ILogger _logger; - /// - /// Raytheon configuration - /// - protected readonly IConfigurationManager _configurationManager; - protected readonly IConfiguration _configuration; + protected ILogger _logger; - #endregion + protected readonly IConfigurationManager _configurationManager; + protected readonly IConfiguration _configuration; - #region PrivateClassFunctions - ~DIOSiCp210x() - { - Dispose(false); - } + #endregion - /// - /// - /// - protected void Close() - { - int ret = CP210xRuntime.CP210xRT_Close(_handle); + #region PrivateClassFunctions + ~DIOSiCp210x() + { + Dispose(false); + } - if (ret != SI_SUCCESS) - { - throw new Exception("call to close returned error: " + ret.ToString() + " on card: " + _name); - } - } + /// + /// + /// + protected void Close() + { + int ret = CP210xRuntime.CP210xRT_Close(_handle); - /// - /// Dispose the object's resources - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Close(); + if (ret != SI_SUCCESS) + { + throw new Exception("call to close returned error: " + ret.ToString() + " on card: " + _name); + } + } - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } - } + /// + /// Dispose the object's resources + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Close(); - /// - /// - /// - /// - /// - /// - protected void GetDeviceProductString(ref byte[] product, ref byte length, bool convertToAscii) - { - int ret = CP210xRuntime.CP210xRT_GetDeviceProductString(_handle, product, ref length, convertToAscii); - if (ret != SI_SUCCESS) - { - throw new Exception("call returned error: " + ret.ToString() + " on card: " + _name); - } - } + _state = State.Uninitialized; + } + } + } - /// - /// - /// - protected void GetNumDevices(ref uint numDevices) - { - int ret = CP210xRuntime.CP210xRT_GetNumDevices(ref numDevices); - if (ret != SI_SUCCESS) - { - throw new Exception("call returned error: " + ret.ToString() + " on card: " + _name); - } - } + /// + /// + /// + protected void GetDeviceProductString(ref byte[] product, ref byte length, bool convertToAscii) + { + int ret = CP210xRuntime.CP210xRT_GetDeviceProductString(_handle, product, ref length, convertToAscii); + if (ret != SI_SUCCESS) + { + throw new Exception("call returned error: " + ret.ToString() + " on card: " + _name); + } + } - /// - /// - /// - /// - protected void GetPartNumber(ref byte partNumber) - { - int ret = CP210xRuntime.CP210xRT_GetPartNumber(_handle, ref partNumber); - if (ret != SI_SUCCESS) - { - throw new Exception("call returned error: " + ret.ToString() + " on card: " + _name); - } - } + /// + /// + /// + protected void GetNumDevices(ref uint numDevices) + { + int ret = CP210xRuntime.CP210xRT_GetNumDevices(ref numDevices); + if (ret != SI_SUCCESS) + { + throw new Exception("call returned error: " + ret.ToString() + " on card: " + _name); + } + } - /// - /// - /// - protected void Open() - { - int ret = CP210xRuntime.CP210xRT_Open(_deviceNum, ref _handle); + /// + /// + /// + /// + protected void GetPartNumber(ref byte partNumber) + { + int ret = CP210xRuntime.CP210xRT_GetPartNumber(_handle, ref partNumber); + if (ret != SI_SUCCESS) + { + throw new Exception("call returned error: " + ret.ToString() + " on card: " + _name); + } + } - if (ret != SI_SUCCESS) - { - throw new Exception("call to open returned error: " + ret.ToString() + " on card: " + _name); - } - } + /// + /// + /// + protected void Open() + { + int ret = CP210xRuntime.CP210xRT_Open(_deviceNum, ref _handle); - /// - /// - /// - /// - /// - protected virtual void ReadLatch(ref ushort latch) - { - int ret = CP210xRuntime.CP210xRT_ReadLatch(_handle, ref latch); + if (ret != SI_SUCCESS) + { + throw new Exception("call to open returned error: " + ret.ToString() + " on card: " + _name); + } + } - if (ret != SI_SUCCESS) - { - throw new Exception("call to read latch returned error: " + ret.ToString() + " on card: " + _name); - } - } + /// + /// + /// + /// + /// + protected virtual void ReadLatch(ref ushort latch) + { + int ret = CP210xRuntime.CP210xRT_ReadLatch(_handle, ref latch); - /// - /// - /// - /// - /// - /// - protected virtual void WriteLatch(ushort mask, ushort latch) - { - int ret = CP210xRuntime.CP210xRT_WriteLatch(_handle, mask, latch); + if (ret != SI_SUCCESS) + { + throw new Exception("call to read latch returned error: " + ret.ToString() + " on card: " + _name); + } + } - if (ret != SI_SUCCESS) - { - throw new Exception("call to write latch returned error: " + ret.ToString() + " on card: " + _name); - } - } + /// + /// + /// + /// + /// + /// + protected virtual void WriteLatch(ushort mask, ushort latch) + { + int ret = CP210xRuntime.CP210xRT_WriteLatch(_handle, mask, latch); + + if (ret != SI_SUCCESS) + { + throw new Exception("call to write latch returned error: " + ret.ToString() + " on card: " + _name); + } + } #endregion @@ -241,14 +219,14 @@ namespace Raytheon.Instruments /// /// /// - public DIOSiCp210x(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + public DIOSiCp210x(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string dioModuleDefPath = _configuration.GetConfigurationValue(deviceName, ConfigXml.DIO_MODULE_DEF_FILEPATH.ToString()); @@ -279,7 +257,7 @@ namespace Raytheon.Instruments IODatatypes.DIOChannelInfo info; foreach (string signalName in outputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = _dioModuleConfig.ReadValue($"{Name}.{ConfigIni.OUTPUT_SIGNALS}", signalName); @@ -290,137 +268,125 @@ namespace Raytheon.Instruments } info.channelNumber = Convert.ToUInt32(infoTokens[0]); + info.ioType = IODatatypes.IOType.DigitalOutput; info.initialValue = Convert.ToInt32(infoTokens[1]); - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } foreach (string signalName in intputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.INPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = _dioModuleConfig.ReadValue($"{Name}.{ConfigIni.INPUT_SIGNALS}", signalName); info.channelNumber = Convert.ToUInt32(iniLine); + info.ioType = IODatatypes.IOType.DigitalInput; info.initialValue = -1; - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } _handle = IntPtr.Zero; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - /// - /// - /// - public DIOSiCp210x(string deviceName, uint deviceNum) - { - _deviceNum = deviceNum; - _name = deviceName; - _handle = IntPtr.Zero; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; + /// + /// + /// + /// + /// + /// + /// + public DIOSiCp210x(string deviceName, uint deviceNum) + { + _deviceNum = deviceNum; + _name = deviceName; + _handle = IntPtr.Zero; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; - _logger = LogManager.GetCurrentClassLogger(); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - //for(int i = 0; i < inputPins.Count; i++) - //{ - // inputPins[i] = Convert.ToUInt32(Math.Pow(2, Convert.ToDouble(inputPins[i]))); - //} + //for(int i = 0; i < inputPins.Count; i++) + //{ + // inputPins[i] = Convert.ToUInt32(Math.Pow(2, Convert.ToDouble(inputPins[i]))); + //} - //@@@ Do we need to pass in more args to configure the DIO (Baud?) - } + //@@@ Do we need to pass in more args to configure the DIO (Baud?) + } - /// - /// - /// - /// - public bool ClearErrors() - { - //could use this to cancel IO and flush the buffers - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + //could use this to cancel IO and flush the buffers + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - byte arrSize = 255; - byte[] deviceStringArray = new byte[arrSize]; - GetDeviceProductString(ref deviceStringArray, ref arrSize, true); - return "This is a Silicon Labs CP2108 device: " + deviceStringArray.ToString(); - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + byte arrSize = 255; + byte[] deviceStringArray = new byte[arrSize]; + GetDeviceProductString(ref deviceStringArray, ref arrSize, true); + return "This is a Silicon Labs CP2108 device: " + deviceStringArray.ToString(); + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - lock (_syncObj) - { - try - { - Dispose(true); + /// + /// Dispose of this object. + /// + public void Dispose() + { + lock (_syncObj) + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } - } - } + GC.SuppressFinalize(this); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } /// /// @@ -429,54 +395,54 @@ namespace Raytheon.Instruments /// public virtual IODatatypes.BitState GetBitState(string signalName) { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The input channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The input channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; ushort latchValue = 0; - ushort mask = (ushort)(0x1 << (int)bitIndex); + ushort mask = (ushort)(0x1 << (int)bitIndex); - ReadLatch(ref latchValue); + ReadLatch(ref latchValue); - return (IODatatypes.BitState)(latchValue & mask); + return (IODatatypes.BitState)(latchValue & mask); } - } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - //@@@ call the other setup functions..Baud? Flow? Timeout? Others? - Open(); + /// + /// + /// + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + //@@@ call the other setup functions..Baud? Flow? Timeout? Others? + Open(); if (_shallWeInitializeOutput) { - foreach (KeyValuePair item in _signalNameToChannelMap) + foreach (KeyValuePair item in _signalNameToChannelInfoMap) { if (item.Value.initialValue != -1) { @@ -486,89 +452,89 @@ namespace Raytheon.Instruments } _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } /// - /// Return list of signal names + /// Return map of all signals /// - public List GetSignalNames() + public Dictionary GetAllSignals() { - return new List(_signalNameToChannelMap.Keys); + return _signalNameToChannelInfoMap; } /// /// /// public string Name - { - get { return _name; } - set { _name = value; } - } + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public uint NumberOfInputBits - { - get - { - return (uint)_numInputChannels; - } - } + /// + /// + /// + public uint NumberOfInputBits + { + get + { + return (uint)_numInputChannels; + } + } - /// - /// - /// - public uint NumberOfOutputBits - { - get - { - return (uint)_numOutputChannels; - } - } + /// + /// + /// + public uint NumberOfOutputBits + { + get + { + return (uint)_numOutputChannels; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - lock (_syncObj) - { - // card does not support self test - //throw new NotImplementedException("card does not support self test" + " on card " + _name); - throw new NotImplementedException(); - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + // card does not support self test + //throw new NotImplementedException("card does not support self test" + " on card " + _name); + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { - Close(); - Open(); - } - } + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + Close(); + Open(); + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } /// /// @@ -578,87 +544,87 @@ namespace Raytheon.Instruments /// public virtual void SetBit(string signalName, IODatatypes.BitState state) { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The output channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; ushort mask = (ushort)(0x1 << (int)bitIndex); - if (state == IODatatypes.BitState.High) - { - WriteLatch(mask, mask); - } - else - { - WriteLatch(mask, 0); - } - } - } + if (state == IODatatypes.BitState.High) + { + WriteLatch(mask, mask); + } + else + { + WriteLatch(mask, 0); + } + } + } - /// - /// - /// - /// - public void SetTristate(string signalName) - { - lock (_syncObj) - { - //@@@@ Is there a way to do this? - } - } + /// + /// + /// + /// + public void SetTristate(string signalName) + { + lock (_syncObj) + { + //@@@@ Is there a way to do this? + } + } - /// - /// - /// - public void Shutdown() - { - lock (_syncObj) - { - if (_state == State.Ready) - { - Close(); - _state = State.Uninitialized; - } - } - } + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + if (_state == State.Ready) + { + Close(); + _state = State.Uninitialized; + } + } + } - /// - /// - /// - /// - /// - /// - public void StartClock(uint bit, double frequencyInHz, double dutyCylePercentage) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + /// + /// + public void StartClock(uint bit, double frequencyInHz, double dutyCylePercentage) + { + throw new NotImplementedException(); + } - /// - /// - /// - public void StopClock(uint bit) - { - throw new NotImplementedException(); - } + /// + /// + /// + public void StopClock(uint bit) + { + throw new NotImplementedException(); + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - #endregion - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/DIOSiCp210xFactory.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/DIOSiCp210xFactory.cs index ec3353d..00162bb 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/DIOSiCp210xFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/DIOSiCp210xFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DIOSiCp210xFactory")] - public class DIOSiCp210xFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DIOSiCp210xFactory")] + public class DIOSiCp210xFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DIOSiCp210xFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DIOSiCp210xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DIOSiCp210xFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DIOSiCp210xFactory injection constructor + /// + [ImportingConstructor] + public DIOSiCp210xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IGeneralIO)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DIOSiCp210x(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IGeneralIO)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DIOSiCp210x(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DIOSim(name, _configurationManager, _logger); + return new DIOSim(name, _configurationManager); else - return new DIOSiCp210x(name, _configurationManager, _logger); + return new DIOSiCp210x(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/ECPDIOSiCp210x.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/ECPDIOSiCp210x.cs index 7e33194..deaa6da 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/ECPDIOSiCp210x.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/ECPDIOSiCp210x.cs @@ -1,134 +1,132 @@ using System; -using System.Collections.Generic; -using Win_API; -using Raytheon.Instruments.GeneralIO; using CP210xRuntime_DLL; -using NLog; using Raytheon.Common; +using Raytheon.Instruments.GeneralIO; +using Win_API; namespace Raytheon.Instruments { - /// - /// - /// - public class ECPDIOSiCp210x : DIOSiCp210x - { - private string _comPort = string.Empty; + /// + /// + /// + public class ECPDIOSiCp210x : DIOSiCp210x + { + private string _comPort = string.Empty; - /// - /// ECPDIOSiCp210x factory constructor - /// - /// - /// - public ECPDIOSiCp210x(string deviceName, IConfigurationManager configurationManager, ILogger logger) - : base(deviceName, configurationManager, logger) - { - _comPort = _dioModuleConfig.ReadValue(Name, ConfigIni.COM_PORT.ToString()); - } + /// + /// ECPDIOSiCp210x factory constructor + /// + /// + /// + public ECPDIOSiCp210x(string deviceName, IConfigurationManager configurationManager) + : base(deviceName, configurationManager) + { + _comPort = _dioModuleConfig.ReadValue(Name, ConfigIni.COM_PORT.ToString()); + } - /// - /// - /// - /// - /// - /// - /// - public ECPDIOSiCp210x(string deviceName, uint deviceNum) - : base(deviceName, deviceNum) - { } + /// + /// + /// + /// + /// + /// + /// + public ECPDIOSiCp210x(string deviceName, uint deviceNum) + : base(deviceName, deviceNum) + { } - /// - /// - /// - /// - /// - /// - /// - public ECPDIOSiCp210x(string deviceName, string comPort) - : base(deviceName, 0) - { - _comPort = comPort; - } + /// + /// + /// + /// + /// + /// + /// + public ECPDIOSiCp210x(string deviceName, string comPort) + : base(deviceName, 0) + { + _comPort = comPort; + } - /// - /// - /// - /// - public void SetComPort(string comPort) - { - _comPort = comPort; - } + /// + /// + /// + /// + public void SetComPort(string comPort) + { + _comPort = comPort; + } - /// - /// - /// - /// - private IntPtr GetHandle() - { - var comString = $"\\\\.\\{_comPort}"; - var securityAttbs = NativeMethods.InitWithDefaultAttributes(); + /// + /// + /// + /// + private IntPtr GetHandle() + { + var comString = $"\\\\.\\{_comPort}"; + var securityAttbs = NativeMethods.InitWithDefaultAttributes(); - //Open a handle the device specified - IntPtr hDevice = NativeMethods.CreateFileA(comString, + //Open a handle the device specified + IntPtr hDevice = NativeMethods.CreateFileA(comString, NativeMethods.GENERIC_READ | NativeMethods.GENERIC_WRITE, - 0, - ref securityAttbs, - 3, - NativeMethods.FILE_ATTRIBUTE_NORMAL | NativeMethods.FILE_FLAG_OVERLAPPED, - IntPtr.Zero); + 0, + ref securityAttbs, + 3, + NativeMethods.FILE_ATTRIBUTE_NORMAL | NativeMethods.FILE_FLAG_OVERLAPPED, + IntPtr.Zero); - if (hDevice != NativeMethods.INVALID_HANDLE_VALUE) - { - return hDevice; - } - else - { - throw new Exception($"Unable to get a valid handle using COM port {_comPort}"); - } - } + if (hDevice != NativeMethods.INVALID_HANDLE_VALUE) + { + return hDevice; + } + else + { + throw new Exception($"Unable to get a valid handle using COM port {_comPort}"); + } + } - /// - /// - /// - /// - public ushort ReadLatch() - { - var handle = GetHandle(); - ushort latch = 0; + /// + /// + /// + /// + public ushort ReadLatch() + { + var handle = GetHandle(); + ushort latch = 0; - var errCode = CP210xRuntime.CP210xRT_ReadLatch(handle, ref latch); + var errCode = CP210xRuntime.CP210xRT_ReadLatch(handle, ref latch); NativeMethods.CloseHandle(handle); - if (errCode == SI_SUCCESS) - { - return latch; - } - else - { - throw new Exception($"Error when reading CP210X latch. Error code returned: {errCode}"); - } - } + if (errCode == SI_SUCCESS) + { + return latch; + } + else + { + throw new Exception($"Error when reading CP210X latch. Error code returned: {errCode}"); + } + } - /// - /// - /// - /// - /// - public override IODatatypes.BitState GetBitState(string signalName) - { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + /// + /// + /// + /// + /// + public override IODatatypes.BitState GetBitState(string signalName) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The input channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The input channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; ushort mask = (ushort)(0x1 << (int)bitIndex); @@ -136,59 +134,59 @@ namespace Raytheon.Instruments return (IODatatypes.BitState)(latch & mask); } - } + } - /// - /// - /// - /// - /// - public override void SetBit(string signalName, IODatatypes.BitState state) - { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + /// + /// + /// + /// + /// + public override void SetBit(string signalName, IODatatypes.BitState state) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The output channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; ushort mask = (ushort)(0x1 << (int)bitIndex); - if (state == IODatatypes.BitState.High) - { - WriteLatch(mask, mask); - } - else - { - WriteLatch(mask, 0); - } - } - } + if (state == IODatatypes.BitState.High) + { + WriteLatch(mask, mask); + } + else + { + WriteLatch(mask, 0); + } + } + } - /// - /// - /// - /// - /// - /// - protected override void WriteLatch(ushort mask, ushort latch) - { - var handle = GetHandle(); + /// + /// + /// + /// + /// + /// + protected override void WriteLatch(ushort mask, ushort latch) + { + var handle = GetHandle(); - int ret = CP210xRuntime.CP210xRT_WriteLatch(handle, mask, latch); + int ret = CP210xRuntime.CP210xRT_WriteLatch(handle, mask, latch); - NativeMethods.CloseHandle(handle); + NativeMethods.CloseHandle(handle); - if (ret != SI_SUCCESS) - { - throw new Exception("call to write latch returned error: " + ret.ToString() + " on card: " + _name); - } - } + if (ret != SI_SUCCESS) + { + throw new Exception("call to write latch returned error: " + ret.ToString() + " on card: " + _name); + } + } - } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/ECPDIOSiCp210xFactory.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/ECPDIOSiCp210xFactory.cs index 8a57b22..7207125 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/ECPDIOSiCp210xFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiCp210x/ECPDIOSiCp210xFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "ECPDIOSiCp210xFactory")] - public class ECPDIOSiCp210xFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "ECPDIOSiCp210xFactory")] + public class ECPDIOSiCp210xFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public ECPDIOSiCp210xFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public ECPDIOSiCp210xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public ECPDIOSiCp210xFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// ECPDIOSiCp210xFactory injection constructor + /// + [ImportingConstructor] + public ECPDIOSiCp210xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IGeneralIO)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new ECPDIOSiCp210x(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IGeneralIO)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new ECPDIOSiCp210x(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DIOSim(name, _configurationManager, _logger); + return new DIOSim(name, _configurationManager); else - return new ECPDIOSiCp210x(name, _configurationManager, _logger); + return new ECPDIOSiCp210x(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiUSBXp/DIOSiUSBXp.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiUSBXp/DIOSiUSBXp.cs index 5960036..7c64338 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiUSBXp/DIOSiUSBXp.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiUSBXp/DIOSiUSBXp.cs @@ -16,14 +16,14 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using Raytheon.Instruments.GeneralIO; using System.Collections.Generic; -using SIUSBXP_DLL; using System.Collections.Specialized; -using NLog; -using Raytheon.Common; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; +using Raytheon.Instruments.GeneralIO; +using SIUSBXP_DLL; namespace Raytheon.Instruments { @@ -49,15 +49,10 @@ namespace Raytheon.Instruments private int _numOutputChannels; private bool _shallWeInitializeOutput = false; - private Dictionary _signalNameToChannelMap = new Dictionary(); + private Dictionary _signalNameToChannelInfoMap = new Dictionary(); - /// - /// NLog logger - /// private readonly ILogger _logger; - /// - /// Raytheon configuration - /// + private readonly IConfigurationManager _configurationManager; private readonly IConfiguration _configuration; @@ -149,27 +144,13 @@ namespace Raytheon.Instruments /// protected virtual void Dispose(bool disposing) { - try + if (disposing) { - if (disposing) + if (_state == State.Ready) { - if (_state == State.Ready) - { - Close(); + Close(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. + _state = State.Uninitialized; } } } @@ -523,11 +504,11 @@ namespace Raytheon.Instruments /// /// /// - public DIOSiUSBXp(string deviceName, IConfigurationManager configurationManager, ILogger logger) + public DIOSiUSBXp(string deviceName, IConfigurationManager configurationManager) { Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); _configurationManager = configurationManager; _configuration = _configurationManager.GetConfiguration(Name); @@ -561,7 +542,7 @@ namespace Raytheon.Instruments IODatatypes.DIOChannelInfo info; foreach (string signalName in outputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.OUTPUT_SIGNALS}", signalName); @@ -572,22 +553,24 @@ namespace Raytheon.Instruments } info.channelNumber = Convert.ToUInt32(infoTokens[0]); + info.ioType = IODatatypes.IOType.DigitalOutput; info.initialValue = Convert.ToInt32(infoTokens[1]); - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } foreach (string signalName in intputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.INPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.INPUT_SIGNALS}", signalName); info.channelNumber = Convert.ToUInt32(iniLine); + info.ioType = IODatatypes.IOType.DigitalInput; info.initialValue = -1; - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } _handle = IntPtr.Zero; @@ -609,7 +592,7 @@ namespace Raytheon.Instruments _handle = IntPtr.Zero; _state = State.Uninitialized; _selfTestResult = SelfTestResult.Unknown; - _logger = LogManager.GetCurrentClassLogger(); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); //@@@ Do we need to pass in more args to configure the DIO (Baud?) } @@ -661,23 +644,9 @@ namespace Raytheon.Instruments { lock (_syncObj) { - try - { - Dispose(true); + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } + GC.SuppressFinalize(this); } } @@ -706,15 +675,15 @@ namespace Raytheon.Instruments { lock (_syncObj) { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The output channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; byte latchValue = 0; @@ -758,11 +727,11 @@ namespace Raytheon.Instruments } /// - /// Return list of signal names + /// Return map of all signals /// - public List GetSignalNames() + public Dictionary GetAllSignals() { - return new List(_signalNameToChannelMap.Keys); + return _signalNameToChannelInfoMap; } /// @@ -843,15 +812,15 @@ namespace Raytheon.Instruments { lock (_syncObj) { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The output channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; byte mask = (byte)bitIndex; diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiUSBXp/DIOSiUSBXpFactory.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiUSBXp/DIOSiUSBXpFactory.cs index b4e2bf5..2900d02 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOSiUSBXp/DIOSiUSBXpFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOSiUSBXp/DIOSiUSBXpFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DIOSiUSBXpFactory")] - public class DIOSiUSBXpFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DIOSiUSBXpFactory")] + public class DIOSiUSBXpFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DIOSiUSBXpFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DIOSiUSBXpFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DIOSiUSBXpFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DIOSiUSBXpFactory injection constructor + /// + [ImportingConstructor] + public DIOSiUSBXpFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IGeneralIO)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DIOSiUSBXp(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IGeneralIO)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DIOSiUSBXp(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DIOSim(name, _configurationManager, _logger); + return new DIOSim(name, _configurationManager); else - return new DIOSiUSBXp(name, _configurationManager, _logger); + return new DIOSiUSBXp(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOSim/DIOSim.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOSim/DIOSim.cs index 6124747..304330a 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOSim/DIOSim.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOSim/DIOSim.cs @@ -16,41 +16,39 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using Raytheon.Instruments.GeneralIO; using System.Collections.Generic; -using Raytheon.Common; -using NLog; using System.IO; -using System.Reflection; -using System.Runtime.Remoting; +using NLog; +using Raytheon.Common; +using Raytheon.Instruments.GeneralIO; namespace Raytheon.Instruments { - /// - /// A Simulated DIO class - /// - public class DIOSim : IGeneralIO - { - #region PrivateClassMembers - private string _name; - private SelfTestResult _selfTestResult; - private State _state; - private object _syncObj = new Object(); - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + /// + /// A Simulated DIO class + /// + public class DIOSim : IGeneralIO + { + #region PrivateClassMembers + private string _name; + private SelfTestResult _selfTestResult; + private State _state; + private object _syncObj = new Object(); + /// + /// NLog logger + /// + private readonly ILogger _logger; + /// + /// Raytheon configuration + /// + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; private const int _channelStartIndex = 0; private int _numInputChannels; private int _numOutputChannels; - private Dictionary _signalNameToChannelMap = new Dictionary(); + private Dictionary _signalNameToChannelInfoMap = new Dictionary(); #endregion @@ -60,59 +58,40 @@ namespace Raytheon.Instruments /// The finalizer. /// ~DIOSim() - { - Dispose(false); - } + { + Dispose(false); + } - /// - /// Dispose of this object. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - // nothing to do here - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of this object. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + } - #endregion + #endregion - #region PublicClassFunctions + #region PublicClassFunctions - /// - /// DIOSim factory constructor - /// - /// - /// - public DIOSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// DIOSim factory constructor + /// + /// + /// + public DIOSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string dioModuleDefPath = _configuration.GetConfigurationValue(deviceName, ConfigXml.DIO_MODULE_DEF_FILEPATH.ToString()); if (!Path.IsPathRooted(dioModuleDefPath)) - dioModuleDefPath = Path.GetFullPath(Path.Combine(assemblyFolder, dioModuleDefPath)); + dioModuleDefPath = Path.GetFullPath(Path.Combine(_configurationManager.ConfigurationStoragePath, dioModuleDefPath)); IConfigurationFile dioModuleConfig = new ConfigurationFile(dioModuleDefPath); @@ -125,7 +104,7 @@ namespace Raytheon.Instruments IODatatypes.DIOChannelInfo info; foreach (string signalName in outputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.OUTPUT_SIGNALS}", signalName); @@ -136,48 +115,50 @@ namespace Raytheon.Instruments } info.channelNumber = Convert.ToUInt32(infoTokens[0]); + info.ioType = IODatatypes.IOType.DigitalOutput; info.initialValue = Convert.ToInt32(infoTokens[1]); - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } foreach (string signalName in intputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.INPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.INPUT_SIGNALS}", signalName); info.channelNumber = Convert.ToUInt32(iniLine); + info.ioType = IODatatypes.IOType.DigitalInput; info.initialValue = -1; - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } - - /// - /// Constructor for DIO simulation. - /// - /// - /// - /// - public DIOSim(string name) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } /// - /// Return list of signal names + /// Constructor for DIO simulation. /// - public List GetSignalNames() + /// + /// + /// + public DIOSim(string deviceName) { - return new List(_signalNameToChannelMap.Keys); + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } + + /// + /// Return map of all signals + /// + public Dictionary GetAllSignals() + { + return _signalNameToChannelInfoMap; } /// @@ -185,194 +166,180 @@ namespace Raytheon.Instruments /// /// public bool ClearErrors() - { - throw new NotImplementedException(); - } + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a DIO Sim called " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a DIO Sim called " + _name; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - lock (_syncObj) - { - try - { - Dispose(true); + /// + /// Dispose of this object. + /// + public void Dispose() + { + lock (_syncObj) + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } - } - } + GC.SuppressFinalize(this); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - /// - public IODatatypes.BitState GetBitState(string signalName) - { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) - throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); + /// + /// + /// + /// + /// + public IODatatypes.BitState GetBitState(string signalName) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) + throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The input channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels} on card " + _name); + throw new Exception($"The input channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels} on card " + _name); } return IODatatypes.BitState.Low; - } - } + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - _state = State.Ready; - } - else - { - throw new Exception("DIOSim::Initialize() - expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } + /// + /// + /// + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + } + else + { + throw new Exception("DIOSim::Initialize() - expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public uint NumberOfInputBits - { - get - { - return (uint)_numInputChannels; - } - } + /// + /// + /// + public uint NumberOfInputBits + { + get + { + return (uint)_numInputChannels; + } + } - /// - /// - /// - public uint NumberOfOutputBits - { - get - { - return (uint)_numOutputChannels; - } - } + /// + /// + /// + public uint NumberOfOutputBits + { + get + { + return (uint)_numOutputChannels; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - lock (_syncObj) - { - _selfTestResult = SelfTestResult.Pass; - return _selfTestResult; - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + _selfTestResult = SelfTestResult.Pass; + return _selfTestResult; + } + } - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { - } - } + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } /// /// @@ -380,49 +347,49 @@ namespace Raytheon.Instruments /// /// public void SetBit(string signalName, IODatatypes.BitState state) - { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The input channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels} on card " + _name); + throw new Exception($"The input channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels} on card " + _name); } } - } + } - /// - /// - /// - /// - public void SetTristate(string signalName) - { + /// + /// + /// + /// + public void SetTristate(string signalName) + { - } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Shutdown() - { - lock (_syncObj) - { - _state = State.Uninitialized; - } - } - #endregion - } + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + _state = State.Uninitialized; + } + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOSim/DIOSimFactory.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOSim/DIOSimFactory.cs index fad80d0..1d2f22c 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOSim/DIOSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOSim/DIOSimFactory.cs @@ -30,71 +30,67 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DIOSimFactory")] - public class DIOSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DIOSimFactory")] + public class DIOSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DIOSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DIOSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DIOSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DIOSimFactory injection constructor + /// + /// + /// + /// + [ImportingConstructor] + public DIOSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IGeneralIO)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DIOSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IGeneralIO)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DIOSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,8 +101,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - return new DIOSim(name, _configurationManager, _logger); + return new DIOSim(name, _configurationManager); } catch (Exception) { @@ -119,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOTeradyneEDigital6020A/DIOTeradyneEDigital6020A.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOTeradyneEDigital6020A/DIOTeradyneEDigital6020A.cs index 1323979..143c1f6 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOTeradyneEDigital6020A/DIOTeradyneEDigital6020A.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOTeradyneEDigital6020A/DIOTeradyneEDigital6020A.cs @@ -34,33 +34,32 @@ This starts applying the patterns under the pattern controller sequence instruct This is called dynamic pattern set execution or a dynamic burst.During the burst, another memory element is used to capture and record the pattern to pattern pass fail information as well as what pin have failed.There are API functions to retrieve this information.*/ -using Ivi.Driver; using System; +using System.Collections.Generic; using System.IO; using System.Reflection; -using System.Collections.Generic; -using Teradyne.eDigital; -using Raytheon.Instruments.GeneralIO; +using Ivi.Driver; using NLog; using Raytheon.Common; -using System.Xml.Linq; +using Raytheon.Instruments.GeneralIO; +using Teradyne.eDigital; namespace Raytheon.Instruments { - /// - /// The EDigital 6020A 1_3_11 card - /// - public class DIOTeradyneEDigital6020A : IGeneralIO, IDisposable - { - #region PrivateClassMembers - private eDigital _dio; - private string _name; - private readonly string _dioAddress; - private Raytheon.Instruments.SelfTestResult _selfTestResult; - private State _state; - private readonly string _options; - private Dictionary _clocks; - private object _syncObj = new Object(); + /// + /// The EDigital 6020A 1_3_11 card + /// + public class DIOTeradyneEDigital6020A : IGeneralIO, IDisposable + { + #region PrivateClassMembers + private eDigital _dio; + private string _name; + private readonly string _dioAddress; + private Raytheon.Instruments.SelfTestResult _selfTestResult; + private State _state; + private readonly string _options; + private Dictionary _clocks; + private object _syncObj = new Object(); private int _numChannelPerPort = 8; private int _channelStartIndex = 0; @@ -68,80 +67,61 @@ namespace Raytheon.Instruments private int _numOutputChannels; private bool _shallWeInitializeOutput = false; - private Dictionary _signalNameToChannelMap = new Dictionary(); + private Dictionary _signalNameToChannelInfoMap = new Dictionary(); + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateClassFunctions + /// + /// The finalizer. + /// + ~DIOTeradyneEDigital6020A() + { + Dispose(false); + } /// - /// NLog logger + /// Dispose of this object. /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _dio.Utility.Reset(); - #endregion + _dio.Close(); - #region PrivateClassFunctions - /// - /// The finalizer. - /// - ~DIOTeradyneEDigital6020A() - { - Dispose(false); - } + _dio.Dispose(); - /// - /// Dispose of this object. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _dio.Utility.Reset(); + _state = State.Uninitialized; + } + } + } + #endregion - _dio.Close(); + #region PublicClassFunctions - _dio.Dispose(); + /// + /// DIOTeradyneEDigital6020A factory constructor + /// + /// + /// + public DIOTeradyneEDigital6020A(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - #region PublicClassFunctions - - /// - /// DIOTeradyneEDigital6020A factory constructor - /// - /// - /// - public DIOTeradyneEDigital6020A(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string dioModuleDefPath = _configuration.GetConfigurationValue(deviceName, ConfigXml.DIO_MODULE_DEF_FILEPATH.ToString()); @@ -173,7 +153,7 @@ namespace Raytheon.Instruments IODatatypes.DIOChannelInfo info; foreach (string signalName in outputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.OUTPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.OUTPUT_SIGNALS}", signalName); @@ -184,170 +164,158 @@ namespace Raytheon.Instruments } info.channelNumber = Convert.ToUInt32(infoTokens[0]); + info.ioType = IODatatypes.IOType.DigitalOutput; info.initialValue = Convert.ToInt32(infoTokens[1]); - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } foreach (string signalName in intputSignalNames) { - if (_signalNameToChannelMap.ContainsKey(signalName)) + if (_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Key {signalName} in section {Name}.{ConfigIni.INPUT_SIGNALS} conflicts with the same key defined in another section."); string iniLine = dioModuleConfig.ReadValue($"{Name}.{ConfigIni.INPUT_SIGNALS}", signalName); info.channelNumber = Convert.ToUInt32(iniLine); + info.ioType = IODatatypes.IOType.DigitalInput; info.initialValue = -1; - _signalNameToChannelMap[signalName] = info; + _signalNameToChannelInfoMap[signalName] = info; } _selfTestResult = Raytheon.Instruments.SelfTestResult.Unknown; - _state = State.Uninitialized; - _clocks = new Dictionary(); + _state = State.Uninitialized; + _clocks = new Dictionary(); - // set in Initialize() - _dio = null; - } + // set in Initialize() + _dio = null; + } - /// - /// - /// - /// - /// - /// - /// - /// - public DIOTeradyneEDigital6020A(string dioName, string dioAddress, string options) - { - _name = dioName; - _dioAddress = dioAddress; - _options = options; - _selfTestResult = Raytheon.Instruments.SelfTestResult.Unknown; - _state = State.Uninitialized; - _clocks = new Dictionary(); - _logger = LogManager.GetCurrentClassLogger(); + /// + /// + /// + /// + /// + /// + /// + /// + public DIOTeradyneEDigital6020A(string deviceName, string dioAddress, string options) + { + _name = deviceName; + _dioAddress = dioAddress; + _options = options; + _selfTestResult = Raytheon.Instruments.SelfTestResult.Unknown; + _state = State.Uninitialized; + _clocks = new Dictionary(); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - // set in Initialize() - _dio = null; - } + // set in Initialize() + _dio = null; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is " + _name + " an EDigital 6020A static IO driver"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is " + _name + " an EDigital 6020A static IO driver"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - lock (_syncObj) - { - try - { - Dispose(true); + /// + /// Dispose of this object. + /// + public void Dispose() + { + lock (_syncObj) + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } - } - } + GC.SuppressFinalize(this); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - /// - public IODatatypes.BitState GetBitState(string signalName) - { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + /// + /// + /// + /// + /// + public IODatatypes.BitState GetBitState(string signalName) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numInputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The input channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The input channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numInputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; int mappedChannal = _dio.Pinmap.Find("CH" + bitIndex); - _dio.Pin.SetChannelMode(ChannelMode.Static, mappedChannal); + _dio.Pin.SetChannelMode(ChannelMode.Static, mappedChannal); - IStaticPattern pattern = _dio.Static.Pattern.SetPinOpcode(PinOpcode.IOX, mappedChannal); + IStaticPattern pattern = _dio.Static.Pattern.SetPinOpcode(PinOpcode.IOX, mappedChannal); - pattern.Run(); + pattern.Run(); - return (IODatatypes.BitState)_dio.Static.FetchCapturedData(mappedChannal); - } - } + return (IODatatypes.BitState)_dio.Static.FetchCapturedData(mappedChannal); + } + } - /// - /// - /// - /// - /// - /*public DioMeasurementInstruments.SignalState GetOutputSignalState(uint channelNo) + /// + /// + /// + /// + /// + /*public DioMeasurementInstruments.SignalState GetOutputSignalState(uint channelNo) { lock (_syncObj) { @@ -368,7 +336,7 @@ namespace Raytheon.Instruments }*/ - /*var testResult = _dio.Static.FetchResult(); + /*var testResult = _dio.Static.FetchResult(); if (testResult == Result.Pass) { return DioMeasurementInstruments.SignalState.LOW; @@ -380,64 +348,64 @@ namespace Raytheon.Instruments } }*/ - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - _dio = new eDigital(_dioAddress, false, true, _options); + /// + /// + /// + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + _dio = new eDigital(_dioAddress, false, true, _options); - // these probably are not needed - _dio.Utility.Reset(); - _dio.Pinmap.Reset(); + // these probably are not needed + _dio.Utility.Reset(); + _dio.Pinmap.Reset(); - // enable the system - _dio.Instrument.SystemEnable = true; - _dio.Static.Delay = PrecisionTimeSpan.FromMicroseconds(100); + // enable the system + _dio.Instrument.SystemEnable = true; + _dio.Static.Delay = PrecisionTimeSpan.FromMicroseconds(100); - // set the channel modes - for (int channel= _channelStartIndex; channel < (_numInputChannels + _channelStartIndex); channel++) - { - int mappedChannal = _dio.Pinmap.Find("CH" + channel); - if (mappedChannal == -1) - { - throw new Exception("input channel " + channel.ToString() + " is not valid"); - } + // set the channel modes + for (int channel = _channelStartIndex; channel < (_numInputChannels + _channelStartIndex); channel++) + { + int mappedChannal = _dio.Pinmap.Find("CH" + channel); + if (mappedChannal == -1) + { + throw new Exception("input channel " + channel.ToString() + " is not valid"); + } - _dio.Pin.SetChannelMode(ChannelMode.Static, mappedChannal); - } + _dio.Pin.SetChannelMode(ChannelMode.Static, mappedChannal); + } // set the channel modes for (int channel = _channelStartIndex; channel < (_numOutputChannels + _channelStartIndex); channel++) { - //tbd if this is needed - int mappedChannal = _dio.Pinmap.Find("CH" + channel); - if (mappedChannal == -1) - { - throw new Exception("output channel " + channel.ToString() + " is not valid"); - } + //tbd if this is needed + int mappedChannal = _dio.Pinmap.Find("CH" + channel); + if (mappedChannal == -1) + { + throw new Exception("output channel " + channel.ToString() + " is not valid"); + } - _dio.Pin.SetChannelMode(ChannelMode.Static, mappedChannal); - } + _dio.Pin.SetChannelMode(ChannelMode.Static, mappedChannal); + } if (_shallWeInitializeOutput) { - foreach (KeyValuePair item in _signalNameToChannelMap) + foreach (KeyValuePair item in _signalNameToChannelInfoMap) { if (item.Value.initialValue != -1) { @@ -447,114 +415,114 @@ namespace Raytheon.Instruments } _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } /// - /// Return list of signal names + /// Return map of all signals /// - public List GetSignalNames() + public Dictionary GetAllSignals() { - return new List(_signalNameToChannelMap.Keys); + return _signalNameToChannelInfoMap; } /// /// /// public string Name - { - get { return _name; } - set { _name = value; } - } + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public uint NumberOfInputBits - { - get - { - return (uint)_numInputChannels; - } - } + /// + /// + /// + public uint NumberOfInputBits + { + get + { + return (uint)_numInputChannels; + } + } - /// - /// - /// - public uint NumberOfOutputBits - { - get - { - return (uint)_numOutputChannels; - } - } + /// + /// + /// + public uint NumberOfOutputBits + { + get + { + return (uint)_numOutputChannels; + } + } - /// - /// - /// - /// - public Raytheon.Instruments.SelfTestResult PerformSelfTest() - { - lock (_syncObj) - { - Ivi.Driver.SelfTestResult res = _dio.Utility.SelfTest(); + /// + /// + /// + /// + public Raytheon.Instruments.SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + Ivi.Driver.SelfTestResult res = _dio.Utility.SelfTest(); - if (res.Code != 0) - { - _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; - throw new Exception("self test returned: " + res.Code + "," + res.Message + " on card " + _name); - } + if (res.Code != 0) + { + _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; + throw new Exception("self test returned: " + res.Code + "," + res.Message + " on card " + _name); + } - _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; + _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; - return _selfTestResult; - } - } + return _selfTestResult; + } + } - /// - /// - /// - public Raytheon.Instruments.SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public Raytheon.Instruments.SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } /// /// /// /// public void SetTristate(string signalName) - { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + Name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The output channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; int mappedChannal = _dio.Pinmap.Find("CH" + bitIndex); - IStaticPattern pattern = _dio.Static.Pattern.SetPinOpcode(PinOpcode.IOX, mappedChannal); - Result res = _dio.Static.Pattern.Run(); - //teradyne example does not check return value, we wont either - /*if (res != Result.Pass) + IStaticPattern pattern = _dio.Static.Pattern.SetPinOpcode(PinOpcode.IOX, mappedChannal); + Result res = _dio.Static.Pattern.Run(); + //teradyne example does not check return value, we wont either + /*if (res != Result.Pass) { throw new Exception("SetPinOpcode for channel: " + channelNo + " to state " + state.ToString() + " failed with result: " + res.ToString()); }*/ - } - } + } + } /// /// @@ -562,158 +530,158 @@ namespace Raytheon.Instruments /// /// public void SetBit(string signalName, IODatatypes.BitState state) - { - lock (_syncObj) - { - if (!_signalNameToChannelMap.ContainsKey(signalName)) + { + lock (_syncObj) + { + if (!_signalNameToChannelInfoMap.ContainsKey(signalName)) throw new Exception($"Signal name {signalName} doesn't exist for card: " + _name); - if (_signalNameToChannelMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelMap[signalName].channelNumber < _channelStartIndex) + if (_signalNameToChannelInfoMap[signalName].channelNumber >= _numOutputChannels || _signalNameToChannelInfoMap[signalName].channelNumber < _channelStartIndex) { - throw new Exception($"The output channel number {_signalNameToChannelMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); + throw new Exception($"The output channel number {_signalNameToChannelInfoMap[signalName].channelNumber} specified must be >= {_channelStartIndex} and < {_numOutputChannels + _channelStartIndex} on card " + _name); } - int bitIndex = (int)_signalNameToChannelMap[signalName].channelNumber - _channelStartIndex; + int bitIndex = (int)_signalNameToChannelInfoMap[signalName].channelNumber - _channelStartIndex; int mappedChannal = _dio.Pinmap.Find("CH" + bitIndex); - IStaticPattern pattern = _dio.Static.Pattern.SetPinOpcode((PinOpcode)((int)state+1), mappedChannal); + IStaticPattern pattern = _dio.Static.Pattern.SetPinOpcode((PinOpcode)((int)state + 1), mappedChannal); _dio.Static.Pattern.Run(); - } - } + } + } - /// - /// Generate a free run clock - /// - /// The channel index - /// The frequency in Hz - /// ex: .5 for 50% duty cycle - public void StartClock(uint bit, double frequencyInHz, double dutyCylePercentage) - { - lock (_syncObj) - { - if (_clocks.ContainsKey(bit) == true) - { - throw new Exception("DIO " + _name + " already has a clock running on channel " + bit + ", must stop it first starting a new one"); - } + /// + /// Generate a free run clock + /// + /// The channel index + /// The frequency in Hz + /// ex: .5 for 50% duty cycle + public void StartClock(uint bit, double frequencyInHz, double dutyCylePercentage) + { + lock (_syncObj) + { + if (_clocks.ContainsKey(bit) == true) + { + throw new Exception("DIO " + _name + " already has a clock running on channel " + bit + ", must stop it first starting a new one"); + } - int mappedChannal = _dio.Pinmap.Find("CH" + bit); + int mappedChannal = _dio.Pinmap.Find("CH" + bit); - //set the pin to free run clock - double period = 1.0e6 / frequencyInHz; //period in Microsecond + //set the pin to free run clock + double period = 1.0e6 / frequencyInHz; //period in Microsecond - Teradyne.eDigital.ITiming timing = _dio.Timing; - Teradyne.eDigital.IPin pin = _dio.Pin; - Teradyne.eDigital.IDynamic dynamic = _dio.Dynamic; - pin.SetDigitalConnect(RelayState.Closed, mappedChannal); + Teradyne.eDigital.ITiming timing = _dio.Timing; + Teradyne.eDigital.IPin pin = _dio.Pin; + Teradyne.eDigital.IDynamic dynamic = _dio.Dynamic; + pin.SetDigitalConnect(RelayState.Closed, mappedChannal); - // Configure the channel attributes - pin.SetChannelMode(ChannelMode.Dynamic, mappedChannal); - pin.SetFormat(Format.ReturnToOne, mappedChannal); - pin.SetFreerun(true, mappedChannal); + // Configure the channel attributes + pin.SetChannelMode(ChannelMode.Dynamic, mappedChannal); + pin.SetFormat(Format.ReturnToOne, mappedChannal); + pin.SetFreerun(true, mappedChannal); - //create tset and edgeset - timing.ConfigureClockReference(ClockReference.Internal, ClockEdgeSelect.Rising); - int edgeSet1 = timing.CreateEdgeSet(); - var tset0 = timing.GetTimingSet(0); - tset0.ClockPeriod = PrecisionTimeSpan.FromMicroseconds(period); - tset0.SetDriveTiming(edgeSet1, PrecisionTimeSpan.FromMicroseconds(period * 0.25), PrecisionTimeSpan.FromMicroseconds(period * 0.75)); - tset0.SetDetectStrobe(edgeSet1, PrecisionTimeSpan.FromMicroseconds(period * 0.5)); + //create tset and edgeset + timing.ConfigureClockReference(ClockReference.Internal, ClockEdgeSelect.Rising); + int edgeSet1 = timing.CreateEdgeSet(); + var tset0 = timing.GetTimingSet(0); + tset0.ClockPeriod = PrecisionTimeSpan.FromMicroseconds(period); + tset0.SetDriveTiming(edgeSet1, PrecisionTimeSpan.FromMicroseconds(period * 0.25), PrecisionTimeSpan.FromMicroseconds(period * 0.75)); + tset0.SetDetectStrobe(edgeSet1, PrecisionTimeSpan.FromMicroseconds(period * 0.5)); - //assign phase to pin - pin.SetEdgeSet(edgeSet1, mappedChannal); + //assign phase to pin + pin.SetEdgeSet(edgeSet1, mappedChannal); - // Start of pattern - dynamic.BeginLoad(true); + // Start of pattern + dynamic.BeginLoad(true); - // Pattern: 0 - dynamic.Pattern.SetPinOpcode(PinOpcode.MH, mappedChannal) - .Modifiers.SetTimingSet(0) - .Modifiers.SetResultsCapture(false) - .End(TestInstruction.None); + // Pattern: 0 + dynamic.Pattern.SetPinOpcode(PinOpcode.MH, mappedChannal) + .Modifiers.SetTimingSet(0) + .Modifiers.SetResultsCapture(false) + .End(TestInstruction.None); - // Drive low to start clock Repeat for 1000000 times - dynamic.Pattern.SetPinOpcode(PinOpcode.ML, mappedChannal) - .Modifiers.SetResultsCapture(false) - .End(TestInstruction.PassFail); + // Drive low to start clock Repeat for 1000000 times + dynamic.Pattern.SetPinOpcode(PinOpcode.ML, mappedChannal) + .Modifiers.SetResultsCapture(false) + .End(TestInstruction.PassFail); - // End pattern - dynamic.Pattern.End(TestInstruction.PassFail); - dynamic.Pattern.Control.Halt().End(TestInstruction.PassFail); - dynamic.EndLoad(); - dynamic.Timeout = PrecisionTimeSpan.MaxValue; - dynamic.ExpandLoops = true; + // End pattern + dynamic.Pattern.End(TestInstruction.PassFail); + dynamic.Pattern.Control.Halt().End(TestInstruction.PassFail); + dynamic.EndLoad(); + dynamic.Timeout = PrecisionTimeSpan.MaxValue; + dynamic.ExpandLoops = true; - var testResult = dynamic.Run(); + var testResult = dynamic.Run(); - // hang onto the clock so we can stop it - _clocks[bit] = dynamic; + // hang onto the clock so we can stop it + _clocks[bit] = dynamic; - System.Threading.Thread.Sleep(10); - } - } + System.Threading.Thread.Sleep(10); + } + } - /// - /// - /// - /// - public void StopClock(uint bit) - { - lock (_syncObj) - { - if (_clocks.ContainsKey(bit) == false) - { - throw new Exception("DIO " + _name + " trying to stop clock on channel " + bit + ", that doesn't exist"); - } + /// + /// + /// + /// + public void StopClock(uint bit) + { + lock (_syncObj) + { + if (_clocks.ContainsKey(bit) == false) + { + throw new Exception("DIO " + _name + " trying to stop clock on channel " + bit + ", that doesn't exist"); + } - _clocks[bit].Execution.Stop(); + _clocks[bit].Execution.Stop(); - _clocks.Remove(bit); - } - } + _clocks.Remove(bit); + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { - _dio.Utility.Reset(); + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + _dio.Utility.Reset(); - _dio.Instrument.SystemEnable = true; - } - } + _dio.Instrument.SystemEnable = true; + } + } - /// - /// - /// - public void Shutdown() - { - lock (_syncObj) - { - if (_state == State.Ready) - { - _dio.Utility.Reset(); + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + if (_state == State.Ready) + { + _dio.Utility.Reset(); - _dio.Close(); + _dio.Close(); - _state = State.Uninitialized; - } - } - } + _state = State.Uninitialized; + } + } + } - #endregion - } + #endregion + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/DIO/DIOTeradyneEDigital6020A/DIOTeradyneEDigital6020AFactory.cs b/Source/TSRealLib/HAL/Implementations/DIO/DIOTeradyneEDigital6020A/DIOTeradyneEDigital6020AFactory.cs index e438420..dac7246 100644 --- a/Source/TSRealLib/HAL/Implementations/DIO/DIOTeradyneEDigital6020A/DIOTeradyneEDigital6020AFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DIO/DIOTeradyneEDigital6020A/DIOTeradyneEDigital6020AFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DIOTeradyneEDigital6020AFactory")] - public class DIOTeradyneEDigital6020AFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DIOTeradyneEDigital6020AFactory")] + public class DIOTeradyneEDigital6020AFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DIOTeradyneEDigital6020AFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DIOTeradyneEDigital6020AFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DIOTeradyneEDigital6020AFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// COECommDeviceInstrumentFactory injection constructor + /// + [ImportingConstructor] + public DIOTeradyneEDigital6020AFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IGeneralIO)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DIOTeradyneEDigital6020A(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IGeneralIO)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DIOTeradyneEDigital6020A(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DIOSim(name, _configurationManager, _logger); + return new DIOSim(name, _configurationManager); else - return new DIOTeradyneEDigital6020A(name, _configurationManager, _logger); + return new DIOTeradyneEDigital6020A(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightM9183/DMMKeysightM9183.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightM9183/DMMKeysightM9183.cs index 6aca172..fd8b5da 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightM9183/DMMKeysightM9183.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightM9183/DMMKeysightM9183.cs @@ -15,627 +15,592 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Instruments; using System; -using Raytheon.Instruments.Dmm; -using Raytheon.Units; using Agilent.AgM918x.Interop; using NLog; using Raytheon.Common; -using System.IO.Ports; +using Raytheon.Instruments.Dmm; +using Raytheon.Units; namespace Raytheon.Instruments { - /// - /// A keysight implementation of the DMM interface - /// - public class DMMKeysightM9183 : IDmm - { - #region PrivateMemberVariables - - private AgM918x _dmm; - private string _name; - private readonly string _address; - private readonly string _options; - private MeasurementFunction _lastType; - private double _lastRange; - private double _lastResolution; - private State _state; - private SelfTestResult _selfTestResult; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFunctions - - /// - /// Dispose of this objects resources - /// - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_34461A")] - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _dmm.Utility.Reset(); - - _dmm.Close(); - - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - /// - /// - /// - /// - private double ReadCurrent(double range, double resolution, MeasurementFunction currentType) - { - bool shallWeUseAutoRange = false; - - if (range < 0) - { - shallWeUseAutoRange = true; - // set the starting range for auto range to 2 micro amps - range = 0.000002; - } - - if (currentType == MeasurementFunction.ACCurrent) - { - return _dmm.ACCurrent.Measure(range, resolution, shallWeUseAutoRange); - } - else if (currentType == MeasurementFunction.DCCurrent) - { - return _dmm.DCCurrent.Measure(range, resolution, shallWeUseAutoRange); - } - else - { - throw new Exception("only ac or dc current is acceptable for param type: " + currentType.ToString()); - } - } - - /// - /// Reads frequency from the dmm - /// - /// The range to use on the DMM - /// The resolution to use on the DMM - /// The voltage range for the measurement - /// The number of reads to make - /// The frequency or average of frequencies read - private double ReadFrequency(double range, double resolution, double voltRange, double numReads) - { - bool shallWeUseAutoRange = false; - - if (range < 0) - { - shallWeUseAutoRange = true; - // set the starting range for auto range to 10 - range = 10; - } - - return _dmm.Frequency.Measure(range, shallWeUseAutoRange, voltRange); - } - - /// - /// Reads resistance - /// - /// The range to use on the DMM - /// The resolution to use on the DMM\ - /// - /// The resistance - private double ReadResistance(double range, double resolution, MeasurementFunction resistanceType) - { - bool shallWeUseAutoRange = false; - - if (range < 0) - { - shallWeUseAutoRange = true; - // set the starting range for auto range to 10 - range = 10; - } - - if (resistanceType == MeasurementFunction.FourWireResistance) - { - return _dmm.Resistance4Wire.Measure(range, resolution, shallWeUseAutoRange); - } - else if (resistanceType == MeasurementFunction.TwoWireResistance) - { - return _dmm.Resistance.Measure(range, resolution, shallWeUseAutoRange); - } - else - { - throw new Exception("only 4 or 2 write resistance is acceptable for param type: " + resistanceType.ToString()); - } - } - - /// - /// Reads voltage - /// - /// The range to use on the DMM - /// The resolution to use on the DMM - /// - private double ReadVoltage(double range, double resolution, MeasurementFunction voltageType) - { - bool shallWeUseAutoRange = false; - - if (range < 0) - { - shallWeUseAutoRange = true; - // set the starting range for auto range to 10 - range = 10; - } - - if (voltageType == MeasurementFunction.ACVolts) - { - return _dmm.ACVoltage.Measure(range, resolution, shallWeUseAutoRange); - } - else if (voltageType == MeasurementFunction.DCVolts) - { - return _dmm.DCVoltage.Measure(range, resolution, shallWeUseAutoRange); - } - else - { - throw new Exception("only ac or dc volt is acceptable for param type: " + voltageType.ToString()); - } - } - - /// - /// Convert scpi data to string - /// - /// - /// - private string ConvertToString(ref byte[] data) - { - string rsp = System.Text.Encoding.ASCII.GetString(data); - return rsp; - } - - /// - /// - /// - /// - /// - private double GetFrequencyAvg(string numbers) - { - string[] numArr = numbers.Split(','); - double retVal = 0; - - foreach (string val in numArr) - { - retVal += Util.ConvertStringToDouble(val); - } - - retVal = retVal / numArr.Length; - - return retVal; - } - - #endregion - - #region PublicFunctions - - /// - /// DMMKeysightM9183 factory constructor - /// - /// - /// - public DMMKeysightM9183(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _address = _configuration.GetConfigurationValue("DMMKeysightM9183", "Address", ""); - _options = _configuration.GetConfigurationValue("DMMKeysightM9183", "Options", ""); - - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; - - //created in Initialize() - _dmm = null; - - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// The constructor which opens the handle to the DMM and performs a self test on the instrument - /// - /// The name of this dmm - /// The address of the DMM - public DMMKeysightM9183(string name, string address, string options) - { - _name = name; - _address = address; - _options = options.Trim(); - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; - - //created in Initialize() - _dmm = null; - _logger = LogManager.GetCurrentClassLogger(); - - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// The Finalizer which will release resources if required - /// - ~DMMKeysightM9183() - { - Dispose(false); - } - - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - /// - /// - public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) - { - if (type != MeasurementFunction.ACCurrent && type != MeasurementFunction.DCCurrent) - { - throw new Exception("only AC or DC Current types are acceptable for param type: " + _lastType.ToString()); - } - - _lastType = type; - _lastRange = range.Amps; - _lastResolution = resolution.Amps; - } - - /// - /// - /// - /// - /// - /// - public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) - { - if (type != MeasurementFunction.Frequency) - { - throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); - } - - _lastType = type; - _lastRange = range.Hertz; - _lastResolution = resolution.Hertz; - } - - /// - /// - /// - /// - /// - /// - public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) - { - if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } - - _lastType = type; - _lastRange = range.Ohms; - _lastResolution = resolution.Ohms; - } - - /// - /// - /// - /// - /// - /// - public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) - { - if (type != MeasurementFunction.DCVolts && type != MeasurementFunction.ACVolts) - { - throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); - } - - _lastType = type; - _lastRange = range.Volts; - _lastResolution = resolution.Volts; - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Keysight Dmm"; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - _dmm = new AgM918x(); - - if (_options != "" && _options.ToUpper() != "NONE") - { - _dmm.Initialize(_address, false, true, _options); - } - else - { - _dmm.Initialize(_address, false, true); - } - - //_selfTestResult = PerformSelfTest(); - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } - - /// - /// - /// - public MeasurementFunction MeasurementType - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - /// - /// - public Current MeasureCurrent(int timeout) - { - if (_lastType != MeasurementFunction.DCCurrent && _lastType != MeasurementFunction.ACCurrent) - { - throw new Exception("only DC or AC Current is acceptable for param type: " + _lastType.ToString()); - } - - return Current.FromAmps(ReadCurrent(_lastRange, _lastResolution, _lastType)); - } - - /// - /// - /// - /// - /// - public Frequency MeasureFrequency(int timeout) - { - if (_lastType != MeasurementFunction.Frequency) - { - throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); - } - - return Frequency.FromHertz(ReadFrequency(_lastRange, _lastResolution, _lastRange, 1)); - } - - /// - /// - /// - /// - /// - public Resistance MeasureResistance(int timeout) - { - if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } - - return Resistance.FromOhms(ReadResistance(_lastRange, _lastResolution, _lastType)); - } - - /// - /// - /// - /// - /// - public Voltage MeasureVoltage(int timeout) - { - if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) - { - throw new Exception("only ac or dc volt is acceptable for param type: " + _lastType.ToString()); - } - - return Voltage.FromVolts(ReadVoltage(_lastRange, _lastResolution, _lastType)); - } - - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - int testResult = 0; - string result = ""; - _dmm.Utility.SelfTest(ref testResult, ref result); - - // Set measurement input to backplane after performing self test. Default is front panel. - // _dmm.Measurement.In = VTEXDmmInputSelectEnum.VTEXDmmInputSelectInternal; - - if (testResult > 0) - { - _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; - throw new Exception("self test failed with an Error Code: " + testResult + " and Error Message: " + result); - } - - _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; - - return _selfTestResult; - } - - /// - /// - /// - public void Reset() - { - _dmm.Utility.Reset(); - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - _dmm.Utility.Reset(); - - _dmm.Close(); - - _state = State.Uninitialized; - } - } - - #endregion - } + /// + /// A keysight implementation of the DMM interface + /// + public class DMMKeysightM9183 : IDmm + { + #region PrivateMemberVariables + + private AgM918x _dmm; + private string _name; + private readonly string _address; + private readonly string _options; + private MeasurementFunction _lastType; + private double _lastRange; + private double _lastResolution; + private State _state; + private SelfTestResult _selfTestResult; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFunctions + + /// + /// Dispose of this objects resources + /// + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_34461A")] + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _dmm.Utility.Reset(); + + _dmm.Close(); + + _state = State.Uninitialized; + } + } + } + + /// + /// + /// + /// + /// + /// + /// + private double ReadCurrent(double range, double resolution, MeasurementFunction currentType) + { + bool shallWeUseAutoRange = false; + + if (range < 0) + { + shallWeUseAutoRange = true; + // set the starting range for auto range to 2 micro amps + range = 0.000002; + } + + if (currentType == MeasurementFunction.ACCurrent) + { + return _dmm.ACCurrent.Measure(range, resolution, shallWeUseAutoRange); + } + else if (currentType == MeasurementFunction.DCCurrent) + { + return _dmm.DCCurrent.Measure(range, resolution, shallWeUseAutoRange); + } + else + { + throw new Exception("only ac or dc current is acceptable for param type: " + currentType.ToString()); + } + } + + /// + /// Reads frequency from the dmm + /// + /// The range to use on the DMM + /// The resolution to use on the DMM + /// The voltage range for the measurement + /// The number of reads to make + /// The frequency or average of frequencies read + private double ReadFrequency(double range, double resolution, double voltRange, double numReads) + { + bool shallWeUseAutoRange = false; + + if (range < 0) + { + shallWeUseAutoRange = true; + // set the starting range for auto range to 10 + range = 10; + } + + return _dmm.Frequency.Measure(range, shallWeUseAutoRange, voltRange); + } + + /// + /// Reads resistance + /// + /// The range to use on the DMM + /// The resolution to use on the DMM\ + /// + /// The resistance + private double ReadResistance(double range, double resolution, MeasurementFunction resistanceType) + { + bool shallWeUseAutoRange = false; + + if (range < 0) + { + shallWeUseAutoRange = true; + // set the starting range for auto range to 10 + range = 10; + } + + if (resistanceType == MeasurementFunction.FourWireResistance) + { + return _dmm.Resistance4Wire.Measure(range, resolution, shallWeUseAutoRange); + } + else if (resistanceType == MeasurementFunction.TwoWireResistance) + { + return _dmm.Resistance.Measure(range, resolution, shallWeUseAutoRange); + } + else + { + throw new Exception("only 4 or 2 write resistance is acceptable for param type: " + resistanceType.ToString()); + } + } + + /// + /// Reads voltage + /// + /// The range to use on the DMM + /// The resolution to use on the DMM + /// + private double ReadVoltage(double range, double resolution, MeasurementFunction voltageType) + { + bool shallWeUseAutoRange = false; + + if (range < 0) + { + shallWeUseAutoRange = true; + // set the starting range for auto range to 10 + range = 10; + } + + if (voltageType == MeasurementFunction.ACVolts) + { + return _dmm.ACVoltage.Measure(range, resolution, shallWeUseAutoRange); + } + else if (voltageType == MeasurementFunction.DCVolts) + { + return _dmm.DCVoltage.Measure(range, resolution, shallWeUseAutoRange); + } + else + { + throw new Exception("only ac or dc volt is acceptable for param type: " + voltageType.ToString()); + } + } + + /// + /// Convert scpi data to string + /// + /// + /// + private string ConvertToString(ref byte[] data) + { + string rsp = System.Text.Encoding.ASCII.GetString(data); + return rsp; + } + + /// + /// + /// + /// + /// + private double GetFrequencyAvg(string numbers) + { + string[] numArr = numbers.Split(','); + double retVal = 0; + + foreach (string val in numArr) + { + retVal += Util.ConvertStringToDouble(val); + } + + retVal = retVal / numArr.Length; + + return retVal; + } + + #endregion + + #region PublicFunctions + + /// + /// DMMKeysightM9183 factory constructor + /// + /// + /// + public DMMKeysightM9183(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _address = _configuration.GetConfigurationValue("DMMKeysightM9183", "Address", ""); + _options = _configuration.GetConfigurationValue("DMMKeysightM9183", "Options", ""); + + _lastType = 0; + _lastRange = 0; + _lastResolution = 0; + + //created in Initialize() + _dmm = null; + + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// The constructor which opens the handle to the DMM and performs a self test on the instrument + /// + /// The name of this dmm + /// The address of the DMM + public DMMKeysightM9183(string deviceName, string address, string options) + { + _name = deviceName; + _address = address; + _options = options.Trim(); + _lastType = 0; + _lastRange = 0; + _lastResolution = 0; + + //created in Initialize() + _dmm = null; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// The Finalizer which will release resources if required + /// + ~DMMKeysightM9183() + { + Dispose(false); + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) + { + if (type != MeasurementFunction.ACCurrent && type != MeasurementFunction.DCCurrent) + { + throw new Exception("only AC or DC Current types are acceptable for param type: " + _lastType.ToString()); + } + + _lastType = type; + _lastRange = range.Amps; + _lastResolution = resolution.Amps; + } + + /// + /// + /// + /// + /// + /// + public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) + { + if (type != MeasurementFunction.Frequency) + { + throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); + } + + _lastType = type; + _lastRange = range.Hertz; + _lastResolution = resolution.Hertz; + } + + /// + /// + /// + /// + /// + /// + public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) + { + if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } + + _lastType = type; + _lastRange = range.Ohms; + _lastResolution = resolution.Ohms; + } + + /// + /// + /// + /// + /// + /// + public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) + { + if (type != MeasurementFunction.DCVolts && type != MeasurementFunction.ACVolts) + { + throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); + } + + _lastType = type; + _lastRange = range.Volts; + _lastResolution = resolution.Volts; + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Keysight Dmm"; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _dmm = new AgM918x(); + + if (_options != "" && _options.ToUpper() != "NONE") + { + _dmm.Initialize(_address, false, true, _options); + } + else + { + _dmm.Initialize(_address, false, true); + } + + //_selfTestResult = PerformSelfTest(); + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } + + /// + /// + /// + public MeasurementFunction MeasurementType + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + /// + /// + public Current MeasureCurrent(int timeout) + { + if (_lastType != MeasurementFunction.DCCurrent && _lastType != MeasurementFunction.ACCurrent) + { + throw new Exception("only DC or AC Current is acceptable for param type: " + _lastType.ToString()); + } + + return Current.FromAmps(ReadCurrent(_lastRange, _lastResolution, _lastType)); + } + + /// + /// + /// + /// + /// + public Frequency MeasureFrequency(int timeout) + { + if (_lastType != MeasurementFunction.Frequency) + { + throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); + } + + return Frequency.FromHertz(ReadFrequency(_lastRange, _lastResolution, _lastRange, 1)); + } + + /// + /// + /// + /// + /// + public Resistance MeasureResistance(int timeout) + { + if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } + + return Resistance.FromOhms(ReadResistance(_lastRange, _lastResolution, _lastType)); + } + + /// + /// + /// + /// + /// + public Voltage MeasureVoltage(int timeout) + { + if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) + { + throw new Exception("only ac or dc volt is acceptable for param type: " + _lastType.ToString()); + } + + return Voltage.FromVolts(ReadVoltage(_lastRange, _lastResolution, _lastType)); + } + + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + int testResult = 0; + string result = ""; + _dmm.Utility.SelfTest(ref testResult, ref result); + + // Set measurement input to backplane after performing self test. Default is front panel. + // _dmm.Measurement.In = VTEXDmmInputSelectEnum.VTEXDmmInputSelectInternal; + + if (testResult > 0) + { + _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; + throw new Exception("self test failed with an Error Code: " + testResult + " and Error Message: " + result); + } + + _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; + + return _selfTestResult; + } + + /// + /// + /// + public void Reset() + { + _dmm.Utility.Reset(); + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + _dmm.Utility.Reset(); + + _dmm.Close(); + + _state = State.Uninitialized; + } + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightM9183/DMMKeysightM9183Factory.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightM9183/DMMKeysightM9183Factory.cs index 937d937..e497fc9 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightM9183/DMMKeysightM9183Factory.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightM9183/DMMKeysightM9183Factory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DMMKeysightM9183Factory")] - public class DMMKeysightM9183Factory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DMMKeysightM9183Factory")] + public class DMMKeysightM9183Factory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DMMKeysightM9183Factory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DMMKeysightM9183Factory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DMMKeysightM9183Factory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DMMKeysightM9183Factory injection constructor + /// + [ImportingConstructor] + public DMMKeysightM9183Factory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IDmm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DMMKeysightM9183(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IDmm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DMMKeysightM9183(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DMMSim(name, _configurationManager, _logger); + return new DMMSim(name, _configurationManager); else - return new DMMKeysightM9183(name, _configurationManager, _logger); + return new DMMKeysightM9183(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightScpi/DMMKeysightScpi.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightScpi/DMMKeysightScpi.cs index 9e525e8..a484387 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightScpi/DMMKeysightScpi.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightScpi/DMMKeysightScpi.cs @@ -15,771 +15,736 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Instruments; using System; using System.Net.Sockets; using System.Text; -using Raytheon.Instruments.Dmm; -using Raytheon.Units; -using System.Threading; using NLog; using Raytheon.Common; +using Raytheon.Instruments.Dmm; +using Raytheon.Units; namespace Raytheon.Instruments { - /// - /// A keysight implementation of the DMM interface - /// - public class DMMKeysightScpi : IDmm - { - #region PrivateMemberVariables - - private const string READ_ERROR_STATUS_CMD = "SYST:ERR?"; - private const string _SELFTESTCMD = "*TST?"; - private const string _RESETCMD = "*RST"; - private const string _MEASUREFRES = "MEAS:FRES? "; //Resistance 4-wire - private const string _MEASURERES = "MEAS:RES? "; //Resistance 2-wire - private const string _MEASUREDCVOLT = "MEAS:VOLT:DC? "; - private const string _MEASUREACVOLT = "MEAS:VOLT:AC? "; - - //Frequency - private const string _FREQ_SETUP1 = "CONF:FREQ "; - private const string _FREQ_SETUP2 = "SENS:FREQ:VOLT:RANGE:AUTO OFF"; - private const string _FREQ_SETUP3 = "FREQ:VOLT:RANG "; - private const string _FREQ_SETUP4 = "SAMPLE:COUNT "; - private const string _MEASUREFREQ = "READ? "; - - private const string _AUTO = "AUTO"; - private const string _DEFAULT = "DEF"; - - private const int _PORT = 5025; - private const int _READ_TIMEOUT = 5000; - private byte[] _readBuffer; - private NetworkStream _tcpStream; - private string _name; - private readonly string _address; - private MeasurementFunction _lastType; - private double _lastRange; - private double _lastResolution; - private State _state; - private SelfTestResult _selfTestResult; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFunctions - - /// - /// Dispose of this objects resources - /// - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_34461A")] - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); - - _tcpStream.Dispose(); - - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// Reads frequency from the dmm - /// - /// The range to use on the DMM - /// The resolution to use on the DMM - /// The voltage range for the measurement - /// The number of reads to make - /// The frequency or average of frequencies read - private double ReadFrequency(double range, double resolution, double voltRange, double numReads) - { - //Setup the frequency measurement - string command = _FREQ_SETUP1; - - if (range == -1) - { - command += _DEFAULT + ", " + _DEFAULT; - } - else - { - command += range + ", " + resolution; - } - - command += ";:" + _FREQ_SETUP2 + ";:" + _FREQ_SETUP3 + voltRange; - - //want to read frequency more than once - if (numReads > 1) - { - command += ";:" + _FREQ_SETUP4 + "\n"; - } - else - { - command += "\n"; - } - - // send the command - IOWrite(command); - - //read the frequency - command = _MEASUREFREQ + "\n"; - string rspStr = IOQuery(command); - - double frequency = 0.0; - - if (rspStr.IndexOf(',') > -1) - { - frequency = GetFrequencyAvg(rspStr); - } - else - { - frequency = Util.ConvertStringToDouble(rspStr); - } - - return frequency; - } - - /// - /// Reads resistance - /// - /// The range to use on the DMM - /// The resolution to use on the DMM\ - /// - /// The resistance - private double ReadResistance(double range, double resolution, MeasurementFunction resistanceType) - { - string command = ""; - - if (resistanceType == MeasurementFunction.FourWireResistance) - { - command = _MEASUREFRES; - } - else if (resistanceType == MeasurementFunction.TwoWireResistance) - { - command = _MEASURERES; - } - else - { - throw new Exception("only 4 or 2 write resistance is acceptable for param type: " + resistanceType.ToString()); - } - - if (range == -1) - { - command += _AUTO + ", " + _DEFAULT; - } - else - { - command += range + ", " + resolution; - } - - command += "\n"; - - string rspStr = IOQuery(command); - - double resistance = Util.ConvertStringToDouble(rspStr); - - return resistance; - } - - /// - /// Reads voltage - /// - /// The range to use on the DMM - /// The resolution to use on the DMM - /// - private double ReadVoltage(double range, double resolution, MeasurementFunction voltageType) - { - string command = ""; - - if (voltageType == MeasurementFunction.ACVolts) - { - command = _MEASUREACVOLT; - } - else if (voltageType == MeasurementFunction.DCVolts) - { - command = _MEASUREDCVOLT; - } - else - { - throw new Exception("only ac or dc volt is acceptable for param type: " + voltageType.ToString()); - } - - if (range == -1) - { - command += _AUTO + ", " + _DEFAULT; - } - else - { - command += range + ", " + resolution; - } - - command += "\n"; - string rspStr = IOQuery(command); - - double dcVoltage = Util.ConvertStringToDouble(rspStr); - return dcVoltage; - } - - /// - /// Convert scpi data to string - /// - /// - /// - private string ConvertToString(ref byte[] data) - { - string rsp = System.Text.Encoding.ASCII.GetString(data); - return rsp; - } - - /// - /// - /// - /// - /// - private double GetFrequencyAvg(string numbers) - { - string[] numArr = numbers.Split(','); - double retVal = 0; - - foreach (string val in numArr) - { - retVal += Util.ConvertStringToDouble(val); - } - - retVal = retVal / numArr.Length; - - return retVal; - } - - - /// - /// Get the error code. - /// - /// The error code (number). - private int GetErrorCode() - { - // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query - - string command = READ_ERROR_STATUS_CMD + "\n"; - - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); - - // read the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - - // convert to a string - string rspStr = ConvertToString(ref _readBuffer); - - // parse the response - string[] tokens = rspStr.Split(','); - - int ret = Util.ConvertStringToInt32(tokens[0]); - - return ret; - } - - /// - /// Send a command to the DMM and get the response - /// - /// The command to send - /// The DMM response - private string IOQuery(string commandString) - { - // send the command - IOWrite(commandString, false); - - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); - - // read from the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - - if (numBytesRead == 0) - { - throw new Exception($"DMMKeysightScpi:IOQuery() - Number of bytes read from stream was {numBytesRead}"); - } - - // convert response to a string - string rspStr = ConvertToString(ref _readBuffer); - - // check for errors - int err = GetErrorCode(); - if (err != 0) - { - throw new Exception("DMMKeysightScpi:IOQuery() - returned error code: " + err.ToString()); - } - - return rspStr; - } - - /// - /// Sends a SCPI Command to the instrument. - /// - /// The SCPI Command to be sent to the instrument. - private void IOWrite(string commandString, bool checkForError = true) - { - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); - - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - - if (checkForError) - { - // check for errors - int err = GetErrorCode(); - if (err != 0) - { - throw new Exception("DMMKeysightScpi:IOWrite() - returned error code: " + err.ToString()); - } - } - } - - #endregion - - #region PublicFunctions - - /// - /// DMMKeysightScpi factory constructor - /// - /// - /// - public DMMKeysightScpi(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _address = _configuration.GetConfigurationValue("DMMKeysightScpi", "Address", ""); - - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; - - const int READ_BUFFER_SIZE = 512; - _readBuffer = new byte[READ_BUFFER_SIZE]; - - // created in initialize - _tcpStream = null; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// The constructor which opens the handle to the DMM and performs a self test on the instrument - /// - /// The name of this dmm - /// The address of the DMM - public DMMKeysightScpi(string name, string address) - { - const int READ_BUFFER_SIZE = 512; - - _name = name; - _address = address; - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; - - _readBuffer = new byte[READ_BUFFER_SIZE]; - - _logger = LogManager.GetCurrentClassLogger(); - - // created in initialize - _tcpStream = null; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// The Finalizer which will release resources if required - /// - ~DMMKeysightScpi() - { - Dispose(false); - } - - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - /// - /// - public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) - { - throw new NotImplementedException(); - /*_lastType = type; + /// + /// A keysight implementation of the DMM interface + /// + public class DMMKeysightScpi : IDmm + { + #region PrivateMemberVariables + + private const string READ_ERROR_STATUS_CMD = "SYST:ERR?"; + private const string _SELFTESTCMD = "*TST?"; + private const string _RESETCMD = "*RST"; + private const string _MEASUREFRES = "MEAS:FRES? "; //Resistance 4-wire + private const string _MEASURERES = "MEAS:RES? "; //Resistance 2-wire + private const string _MEASUREDCVOLT = "MEAS:VOLT:DC? "; + private const string _MEASUREACVOLT = "MEAS:VOLT:AC? "; + + //Frequency + private const string _FREQ_SETUP1 = "CONF:FREQ "; + private const string _FREQ_SETUP2 = "SENS:FREQ:VOLT:RANGE:AUTO OFF"; + private const string _FREQ_SETUP3 = "FREQ:VOLT:RANG "; + private const string _FREQ_SETUP4 = "SAMPLE:COUNT "; + private const string _MEASUREFREQ = "READ? "; + + private const string _AUTO = "AUTO"; + private const string _DEFAULT = "DEF"; + + private const int _PORT = 5025; + private const int _READ_TIMEOUT = 5000; + private byte[] _readBuffer; + private NetworkStream _tcpStream; + private string _name; + private readonly string _address; + private MeasurementFunction _lastType; + private double _lastRange; + private double _lastResolution; + private State _state; + private SelfTestResult _selfTestResult; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFunctions + + /// + /// Dispose of this objects resources + /// + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_34461A")] + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); + + _tcpStream.Dispose(); + + _state = State.Uninitialized; + } + } + } + + /// + /// Reads frequency from the dmm + /// + /// The range to use on the DMM + /// The resolution to use on the DMM + /// The voltage range for the measurement + /// The number of reads to make + /// The frequency or average of frequencies read + private double ReadFrequency(double range, double resolution, double voltRange, double numReads) + { + //Setup the frequency measurement + string command = _FREQ_SETUP1; + + if (range == -1) + { + command += _DEFAULT + ", " + _DEFAULT; + } + else + { + command += range + ", " + resolution; + } + + command += ";:" + _FREQ_SETUP2 + ";:" + _FREQ_SETUP3 + voltRange; + + //want to read frequency more than once + if (numReads > 1) + { + command += ";:" + _FREQ_SETUP4 + "\n"; + } + else + { + command += "\n"; + } + + // send the command + IOWrite(command); + + //read the frequency + command = _MEASUREFREQ + "\n"; + string rspStr = IOQuery(command); + + double frequency = 0.0; + + if (rspStr.IndexOf(',') > -1) + { + frequency = GetFrequencyAvg(rspStr); + } + else + { + frequency = Util.ConvertStringToDouble(rspStr); + } + + return frequency; + } + + /// + /// Reads resistance + /// + /// The range to use on the DMM + /// The resolution to use on the DMM\ + /// + /// The resistance + private double ReadResistance(double range, double resolution, MeasurementFunction resistanceType) + { + string command = ""; + + if (resistanceType == MeasurementFunction.FourWireResistance) + { + command = _MEASUREFRES; + } + else if (resistanceType == MeasurementFunction.TwoWireResistance) + { + command = _MEASURERES; + } + else + { + throw new Exception("only 4 or 2 write resistance is acceptable for param type: " + resistanceType.ToString()); + } + + if (range == -1) + { + command += _AUTO + ", " + _DEFAULT; + } + else + { + command += range + ", " + resolution; + } + + command += "\n"; + + string rspStr = IOQuery(command); + + double resistance = Util.ConvertStringToDouble(rspStr); + + return resistance; + } + + /// + /// Reads voltage + /// + /// The range to use on the DMM + /// The resolution to use on the DMM + /// + private double ReadVoltage(double range, double resolution, MeasurementFunction voltageType) + { + string command = ""; + + if (voltageType == MeasurementFunction.ACVolts) + { + command = _MEASUREACVOLT; + } + else if (voltageType == MeasurementFunction.DCVolts) + { + command = _MEASUREDCVOLT; + } + else + { + throw new Exception("only ac or dc volt is acceptable for param type: " + voltageType.ToString()); + } + + if (range == -1) + { + command += _AUTO + ", " + _DEFAULT; + } + else + { + command += range + ", " + resolution; + } + + command += "\n"; + string rspStr = IOQuery(command); + + double dcVoltage = Util.ConvertStringToDouble(rspStr); + return dcVoltage; + } + + /// + /// Convert scpi data to string + /// + /// + /// + private string ConvertToString(ref byte[] data) + { + string rsp = System.Text.Encoding.ASCII.GetString(data); + return rsp; + } + + /// + /// + /// + /// + /// + private double GetFrequencyAvg(string numbers) + { + string[] numArr = numbers.Split(','); + double retVal = 0; + + foreach (string val in numArr) + { + retVal += Util.ConvertStringToDouble(val); + } + + retVal = retVal / numArr.Length; + + return retVal; + } + + + /// + /// Get the error code. + /// + /// The error code (number). + private int GetErrorCode() + { + // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query + + string command = READ_ERROR_STATUS_CMD + "\n"; + + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); + + // read the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + + // convert to a string + string rspStr = ConvertToString(ref _readBuffer); + + // parse the response + string[] tokens = rspStr.Split(','); + + int ret = Util.ConvertStringToInt32(tokens[0]); + + return ret; + } + + /// + /// Send a command to the DMM and get the response + /// + /// The command to send + /// The DMM response + private string IOQuery(string commandString) + { + // send the command + IOWrite(commandString, false); + + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); + + // read from the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + + if (numBytesRead == 0) + { + throw new Exception($"DMMKeysightScpi:IOQuery() - Number of bytes read from stream was {numBytesRead}"); + } + + // convert response to a string + string rspStr = ConvertToString(ref _readBuffer); + + // check for errors + int err = GetErrorCode(); + if (err != 0) + { + throw new Exception("DMMKeysightScpi:IOQuery() - returned error code: " + err.ToString()); + } + + return rspStr; + } + + /// + /// Sends a SCPI Command to the instrument. + /// + /// The SCPI Command to be sent to the instrument. + private void IOWrite(string commandString, bool checkForError = true) + { + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); + + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + + if (checkForError) + { + // check for errors + int err = GetErrorCode(); + if (err != 0) + { + throw new Exception("DMMKeysightScpi:IOWrite() - returned error code: " + err.ToString()); + } + } + } + + #endregion + + #region PublicFunctions + + /// + /// DMMKeysightScpi factory constructor + /// + /// + /// + public DMMKeysightScpi(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _address = _configuration.GetConfigurationValue(Name, Dmm.ConfigXml.IP_ADDRESS.ToString()); + + _lastType = 0; + _lastRange = 0; + _lastResolution = 0; + + const int READ_BUFFER_SIZE = 512; + _readBuffer = new byte[READ_BUFFER_SIZE]; + + // created in initialize + _tcpStream = null; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// The constructor which opens the handle to the DMM and performs a self test on the instrument + /// + /// The name of this dmm + /// The address of the DMM + public DMMKeysightScpi(string deviceName, string address) + { + const int READ_BUFFER_SIZE = 512; + + _name = deviceName; + _address = address; + _lastType = 0; + _lastRange = 0; + _lastResolution = 0; + + _readBuffer = new byte[READ_BUFFER_SIZE]; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + // created in initialize + _tcpStream = null; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// The Finalizer which will release resources if required + /// + ~DMMKeysightScpi() + { + Dispose(false); + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) + { + throw new NotImplementedException(); + /*_lastType = type; _lastRange = range.Amps; _lastResolution = resolution.Amps;*/ - } + } - /// - /// - /// - /// - /// - /// - public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) - { - if (type != MeasurementFunction.DCVolts && type != MeasurementFunction.ACVolts) - { - throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); - } + /// + /// + /// + /// + /// + /// + public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) + { + if (type != MeasurementFunction.DCVolts && type != MeasurementFunction.ACVolts) + { + throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); + } - _lastType = type; - _lastRange = range.Volts; - _lastResolution = resolution.Volts; - } + _lastType = type; + _lastRange = range.Volts; + _lastResolution = resolution.Volts; + } - /// - /// - /// - /// - /// - /// - public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) - { - if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + /// + public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) + { + if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } - _lastType = type; - _lastRange = range.Ohms; - _lastResolution = resolution.Ohms; - } + _lastType = type; + _lastRange = range.Ohms; + _lastResolution = resolution.Ohms; + } - /// - /// - /// - /// - /// - /// - public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) - { - if (type != MeasurementFunction.Frequency) - { - throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + /// + public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) + { + if (type != MeasurementFunction.Frequency) + { + throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); + } - _lastType = type; - _lastRange = range.Hertz; - _lastResolution = resolution.Hertz; - } + _lastType = type; + _lastRange = range.Hertz; + _lastResolution = resolution.Hertz; + } - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Keysight Dmm"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Keysight Dmm"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - TcpClient dmmSocketConn = new TcpClient(_address, _PORT); - _tcpStream = dmmSocketConn.GetStream(); - _tcpStream.ReadTimeout = _READ_TIMEOUT; - _selfTestResult = PerformSelfTest(); - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + TcpClient dmmSocketConn = new TcpClient(_address, _PORT); + _tcpStream = dmmSocketConn.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; + _selfTestResult = PerformSelfTest(); + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - public MeasurementFunction MeasurementType - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public MeasurementFunction MeasurementType + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - /// - public Current MeasureCurrent(int timeout) - { - throw new NotImplementedException(); + /// + /// + /// + /// + /// + public Current MeasureCurrent(int timeout) + { + throw new NotImplementedException(); - /* + /* if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) { throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); } return Current.FromAmps(ReadCurrent();*/ - } + } - /// - /// - /// - /// - /// - public Frequency MeasureFrequency(int timeout) - { - if (_lastType != MeasurementFunction.Frequency) - { - throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + public Frequency MeasureFrequency(int timeout) + { + if (_lastType != MeasurementFunction.Frequency) + { + throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); + } - return Frequency.FromHertz(ReadFrequency(_lastRange, _lastResolution, _lastRange, 1)); - } + return Frequency.FromHertz(ReadFrequency(_lastRange, _lastResolution, _lastRange, 1)); + } - /// - /// - /// - /// - /// - public Resistance MeasureResistance(int timeout) - { - if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + public Resistance MeasureResistance(int timeout) + { + if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } - return Resistance.FromOhms(ReadResistance(_lastRange, _lastResolution, _lastType)); - } + return Resistance.FromOhms(ReadResistance(_lastRange, _lastResolution, _lastType)); + } - /// - /// - /// - /// - /// - public Voltage MeasureVoltage(int timeout) - { - if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) - { - throw new Exception("only ac or dc volt is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + public Voltage MeasureVoltage(int timeout) + { + if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) + { + throw new Exception("only ac or dc volt is acceptable for param type: " + _lastType.ToString()); + } - return Voltage.FromVolts(ReadVoltage(_lastRange, _lastResolution, _lastType)); - } + return Voltage.FromVolts(ReadVoltage(_lastRange, _lastResolution, _lastType)); + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - try - { - // change the timeout to account for the long self test - _tcpStream.ReadTimeout = 30000; + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + try + { + // change the timeout to account for the long self test + _tcpStream.ReadTimeout = 30000; - // send the command and get the response - string command = _SELFTESTCMD + "\n"; - string rspStr = IOQuery(command); + // send the command and get the response + string command = _SELFTESTCMD + "\n"; + string rspStr = IOQuery(command); - // parse the response - string[] tokens = rspStr.Split('\n'); + // parse the response + string[] tokens = rspStr.Split('\n'); - int rsp = Util.ConvertStringToInt32(tokens[0].Replace("+", "").Split(',')[0]); + int rsp = Util.ConvertStringToInt32(tokens[0].Replace("+", "").Split(',')[0]); - if (rsp != 0) - { - string errorMsg = "returned an error: " + rspStr; - _selfTestResult = SelfTestResult.Fail; - throw new Exception(errorMsg); - } - _selfTestResult = SelfTestResult.Pass; - } - catch (Exception) - { - throw; - } - finally - { - // restore the timeout - _tcpStream.ReadTimeout = _READ_TIMEOUT; - } + if (rsp != 0) + { + string errorMsg = "returned an error: " + rspStr; + _selfTestResult = SelfTestResult.Fail; + throw new Exception(errorMsg); + } + _selfTestResult = SelfTestResult.Pass; + } + catch (Exception) + { + throw; + } + finally + { + // restore the timeout + _tcpStream.ReadTimeout = _READ_TIMEOUT; + } - return SelfTestResult; - } + return SelfTestResult; + } - /// - /// - /// - public void Reset() - { - IOWrite(_RESETCMD + "\n"); - } + /// + /// + /// + public void Reset() + { + IOWrite(_RESETCMD + "\n"); + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - Reset(); + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + Reset(); - _tcpStream.Dispose(); + _tcpStream.Dispose(); - _state = State.Uninitialized; - } - } + _state = State.Uninitialized; + } + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightScpi/DMMKeysightScpiFactory.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightScpi/DMMKeysightScpiFactory.cs index 71f05ad..3803f5c 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightScpi/DMMKeysightScpiFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMKeysightScpi/DMMKeysightScpiFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DMMKeysightScpiFactory")] - public class DMMKeysightScpiFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DMMKeysightScpiFactory")] + public class DMMKeysightScpiFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DMMKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DMMKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DMMKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DMMKeysightScpiFactory injection constructor + /// + [ImportingConstructor] + public DMMKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IDmm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DMMKeysightScpi(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IDmm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DMMKeysightScpi(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DMMSim(name, _configurationManager, _logger); + return new DMMSim(name, _configurationManager); else - return new DMMKeysightScpi(name, _configurationManager, _logger); + return new DMMKeysightScpi(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMNiPxi/DMMNiPxi.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMNiPxi/DMMNiPxi.cs index 0a631ce..89ad703 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMNiPxi/DMMNiPxi.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMNiPxi/DMMNiPxi.cs @@ -24,537 +24,504 @@ using Raytheon.Units; namespace Raytheon.Instruments { - /// - /// A simulation implementation of the DMM interface. - /// This class basically just absorbs function calls and returns dummy data. - /// - public class DMMNiPxi : IDmm, IDisposable - { - #region PrivateMemberVariables + /// + /// A simulation implementation of the DMM interface. + /// This class basically just absorbs function calls and returns dummy data. + /// + public class DMMNiPxi : IDmm, IDisposable + { + #region PrivateMemberVariables - private NIDmm _niDmm; - private string _name; - private readonly string _address; - //private readonly string _options; - private double _lastRange; - private double _lastResolution; - private MeasurementFunction _lastType; - private State _state; - private SelfTestResult _selfTestResult; + private NIDmm _niDmm; + private string _name; + private readonly string _address; + //private readonly string _options; + private double _lastRange; + private double _lastResolution; + private MeasurementFunction _lastType; + private State _state; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// The Finalizer. - /// - ~DMMNiPxi() - { - Dispose(false); - } + #region PrivateFunctions - /// - /// - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _niDmm.DriverUtility.Reset(); + /// + /// The Finalizer. + /// + ~DMMNiPxi() + { + Dispose(false); + } - _niDmm.Close(); + /// + /// + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _niDmm.DriverUtility.Reset(); - _niDmm.Dispose(); + _niDmm.Close(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + _niDmm.Dispose(); - #region PublicFunctions + _state = State.Uninitialized; + } + } + } + #endregion - /// - /// DMMNiPxi factory constructor - /// - /// - /// - public DMMNiPxi(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions - _logger = logger; + /// + /// DMMNiPxi factory constructor + /// + /// + /// + public DMMNiPxi(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _address = _configuration.GetConfigurationValue("DMMNiPxi", "Address", ""); - //_options = _configuration.GetConfigurationValue("DMMNiPxi", "Options", ""); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; + _address = _configuration.GetConfigurationValue("DMMNiPxi", "Address", ""); + //_options = _configuration.GetConfigurationValue("DMMNiPxi", "Options", ""); - //created in Initialize() - _niDmm = null; + _lastType = 0; + _lastRange = 0; + _lastResolution = 0; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + //created in Initialize() + _niDmm = null; - /// - /// - /// - /// - /// - /// - public DMMNiPxi(string name, string address)//, string options) - { - _name = name; - _address = address; - //_options = options; - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - // set in Initialize() - _niDmm = null; - _logger = LogManager.GetCurrentClassLogger(); + /// + /// + /// + /// + /// + /// + public DMMNiPxi(string deviceName, string address)//, string options) + { + _name = deviceName; + _address = address; + //_options = options; + _lastType = 0; + _lastRange = 0; + _lastResolution = 0; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + // set in Initialize() + _niDmm = null; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - /// - /// - public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) - { - throw new NotImplementedException(); - /*_lastType = type; + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) + { + throw new NotImplementedException(); + /*_lastType = type; _lastRange = range.Amps; _lastResolution = resolution.Amps;*/ - } + } - /// - /// - /// - /// - /// - /// - public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) - { - if (type != MeasurementFunction.Frequency) - { - throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + /// + public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) + { + if (type != MeasurementFunction.Frequency) + { + throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); + } - _lastType = type; - _lastRange = range.Hertz; - _lastResolution = resolution.Hertz; - } + _lastType = type; + _lastRange = range.Hertz; + _lastResolution = resolution.Hertz; + } - /// - /// - /// - /// - /// - /// - public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) - { - if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + /// + public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) + { + if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } - _lastType = type; - _lastRange = range.Ohms; - _lastResolution = resolution.Ohms; - } + _lastType = type; + _lastRange = range.Ohms; + _lastResolution = resolution.Ohms; + } - /// - /// - /// - /// - /// - /// - public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) - { - if (type != MeasurementFunction.DCVolts && type != MeasurementFunction.ACVolts) - { - throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); - } + /// + /// + /// + /// + /// + /// + public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) + { + if (type != MeasurementFunction.DCVolts && type != MeasurementFunction.ACVolts) + { + throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); + } - _lastType = type; - _lastRange = range.Volts; - _lastResolution = resolution.Volts; - } + _lastType = type; + _lastRange = range.Volts; + _lastResolution = resolution.Volts; + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a NI Dmm"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a NI Dmm"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - _niDmm = new NIDmm(_address, false, true);// _options); - _selfTestResult = PerformSelfTest(); - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _niDmm = new NIDmm(_address, false, true);// _options); + _selfTestResult = PerformSelfTest(); + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - public MeasurementFunction MeasurementType - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public MeasurementFunction MeasurementType + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - /// - public Current MeasureCurrent(int timeout) - { - throw new NotImplementedException(); + /// + /// + /// + /// + /// + public Current MeasureCurrent(int timeout) + { + throw new NotImplementedException(); - /* + /* if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) { throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); } return Current.FromAmps(ReadCurrent();*/ - } + } - /// - /// - /// - /// - /// - public Frequency MeasureFrequency(int timeout) - { - if (_lastType != MeasurementFunction.Frequency) - { - throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + public Frequency MeasureFrequency(int timeout) + { + if (_lastType != MeasurementFunction.Frequency) + { + throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); + } - DmmAuto auto = DmmAuto.Off; + DmmAuto auto = DmmAuto.Off; - if (_lastRange < 0) - { - auto = DmmAuto.On; - // set the starting range for auto range to 10 - _lastRange = 10; - } + if (_lastRange < 0) + { + auto = DmmAuto.On; + // set the starting range for auto range to 10 + _lastRange = 10; + } - _niDmm.MeasurementFunction = DmmMeasurementFunction.Frequency; + _niDmm.MeasurementFunction = DmmMeasurementFunction.Frequency; - _niDmm.Range = _lastRange; + _niDmm.Range = _lastRange; - _niDmm.Resolution = _lastResolution; + _niDmm.Resolution = _lastResolution; - _niDmm.AutoRange = auto; + _niDmm.AutoRange = auto; - double frequency = _niDmm.Measurement.Read(); + double frequency = _niDmm.Measurement.Read(); - return Frequency.FromHertz(frequency); - } + return Frequency.FromHertz(frequency); + } - /// - /// - /// - /// - /// - public Resistance MeasureResistance(int timeout) - { - if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + public Resistance MeasureResistance(int timeout) + { + if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } - if (_lastType == MeasurementFunction.FourWireResistance) - { - _niDmm.MeasurementFunction = DmmMeasurementFunction.FourWireResistance; - } - else - { - _niDmm.MeasurementFunction = DmmMeasurementFunction.TwoWireResistance; - } + if (_lastType == MeasurementFunction.FourWireResistance) + { + _niDmm.MeasurementFunction = DmmMeasurementFunction.FourWireResistance; + } + else + { + _niDmm.MeasurementFunction = DmmMeasurementFunction.TwoWireResistance; + } - DmmAuto auto = DmmAuto.Off; + DmmAuto auto = DmmAuto.Off; - if (_lastRange < 0) - { - auto = DmmAuto.On; - // set the starting range for auto range to 10 - _lastRange = 10; - } + if (_lastRange < 0) + { + auto = DmmAuto.On; + // set the starting range for auto range to 10 + _lastRange = 10; + } - _niDmm.Range = _lastRange; + _niDmm.Range = _lastRange; - _niDmm.Resolution = _lastResolution; + _niDmm.Resolution = _lastResolution; - _niDmm.AutoRange = auto; + _niDmm.AutoRange = auto; - double resistance = _niDmm.Measurement.Read(); + double resistance = _niDmm.Measurement.Read(); - if (double.IsNaN(resistance)) - { - resistance = double.MaxValue; - } + if (double.IsNaN(resistance)) + { + resistance = double.MaxValue; + } - return Resistance.FromOhms(resistance); - } + return Resistance.FromOhms(resistance); + } - /// - /// - /// - /// - /// - public Voltage MeasureVoltage(int timeout) - { - if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) - { - throw new Exception("only ac or dc volt is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + public Voltage MeasureVoltage(int timeout) + { + if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) + { + throw new Exception("only ac or dc volt is acceptable for param type: " + _lastType.ToString()); + } - if (_lastType == MeasurementFunction.ACVolts) - { - _niDmm.MeasurementFunction = DmmMeasurementFunction.ACVolts; - } - else - { - _niDmm.MeasurementFunction = DmmMeasurementFunction.DCVolts; - } + if (_lastType == MeasurementFunction.ACVolts) + { + _niDmm.MeasurementFunction = DmmMeasurementFunction.ACVolts; + } + else + { + _niDmm.MeasurementFunction = DmmMeasurementFunction.DCVolts; + } - DmmAuto auto = DmmAuto.Off; + DmmAuto auto = DmmAuto.Off; - if (_lastRange < 0) - { - auto = DmmAuto.On; - // set the starting range for auto range to 10 - _lastRange = 10; - } + if (_lastRange < 0) + { + auto = DmmAuto.On; + // set the starting range for auto range to 10 + _lastRange = 10; + } - _niDmm.Range = _lastRange; + _niDmm.Range = _lastRange; - _niDmm.Resolution = _lastResolution; + _niDmm.Resolution = _lastResolution; - _niDmm.AutoRange = auto; + _niDmm.AutoRange = auto; - double volts = _niDmm.Measurement.Read(); + double volts = _niDmm.Measurement.Read(); - if (double.IsNaN(volts)) - { - volts = double.MaxValue; - } + if (double.IsNaN(volts)) + { + volts = double.MaxValue; + } - return Voltage.FromVolts(volts); - } + return Voltage.FromVolts(volts); + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - DmmSelfTestResult res = _niDmm.DriverUtility.SelfTest(); + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + DmmSelfTestResult res = _niDmm.DriverUtility.SelfTest(); - if (res.Code != 0) - { - _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; - throw new Exception("self test returned: " + res.Code + "," + res.Message + " on card " + _name); - } + if (res.Code != 0) + { + _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; + throw new Exception("self test returned: " + res.Code + "," + res.Message + " on card " + _name); + } - _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; + _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; - return _selfTestResult; - } + return _selfTestResult; + } - /// - /// - /// - public void Reset() - { - _niDmm.DriverUtility.Reset(); - } + /// + /// + /// + public void Reset() + { + _niDmm.DriverUtility.Reset(); + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - _niDmm.DriverUtility.Reset(); + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + _niDmm.DriverUtility.Reset(); - _niDmm.Close(); + _niDmm.Close(); - _niDmm.Dispose(); + _niDmm.Dispose(); - _state = State.Uninitialized; - } - } + _state = State.Uninitialized; + } + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMNiPxi/DMMNiPxiFactory.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMNiPxi/DMMNiPxiFactory.cs index df3bc0b..9f627dd 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMNiPxi/DMMNiPxiFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMNiPxi/DMMNiPxiFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DMMNiPxiFactory")] - public class DMMNiPxiFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DMMNiPxiFactory")] + public class DMMNiPxiFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DMMNiPxiFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DMMNiPxiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DMMNiPxiFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DMMNiPxiFactory injection constructor + /// + [ImportingConstructor] + public DMMNiPxiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IDmm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DMMNiPxi(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IDmm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DMMNiPxi(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DMMSim(name, _configurationManager, _logger); + return new DMMSim(name, _configurationManager); else - return new DMMNiPxi(name, _configurationManager, _logger); + return new DMMNiPxi(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMSim/DMMSim.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMSim/DMMSim.cs index c25ff10..08114f6 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMSim/DMMSim.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMSim/DMMSim.cs @@ -24,412 +24,375 @@ using Raytheon.Units; namespace Raytheon.Instruments { - /// - /// A simulation implementation of the DMM interface. - /// This class basically just absorbs function calls and returns dummy data. - /// - public class DMMSim : IDmm - { - #region PrivateMemberVariables - - private string _name; - private double _lastRange; - private State _state; - private SelfTestResult _selfTestResult; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFunctions - - /// - /// The Finalizer. - /// - ~DMMSim() - { - Dispose(false); - } - - /// - /// - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - // nothing to clean up - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion - - #region PublicFunctions - - /// - /// DMMSim factory constructor - /// - /// - /// - public DMMSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _lastRange = 0; - - _state = State.Uninitialized; - - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// - /// - /// - public DMMSim(string name) - { - _name = name; - - _lastRange = 0; - - _logger = LogManager.GetCurrentClassLogger(); - - _state = State.Uninitialized; - - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - /// - /// - public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) - { - _lastRange = range.Amps; - } - - /// - /// - /// - /// - /// - /// - public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) - { - _lastRange = range.Hertz; - } - - /// - /// - /// - /// - /// - /// - public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) - { - _lastRange = range.Ohms; - } - - /// - /// - /// - /// - /// - /// - public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) - { - _lastRange = range.Volts; - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Sim Dmm"; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - _selfTestResult = PerformSelfTest(); - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } - - /// - /// - /// - /// - /// - public Current MeasureCurrent(int timeout) - { - double max = _lastRange; - - double min = 1.0; - - Random rnd = new Random(); - - double seed = rnd.NextDouble(); - - double dataToReturn = (seed * (max - min)) + min; - - Thread.Sleep(200); - - return Current.FromAmps(dataToReturn); - } - - /// - /// - /// - /// - /// - public Frequency MeasureFrequency(int timeout) - { - double max = _lastRange; - - double min = 1.0; - - Random rnd = new Random(); - - double seed = rnd.NextDouble(); - - double dataToReturn = (seed * (max - min)) + min; - - Thread.Sleep(200); - - return Frequency.FromHertz(dataToReturn); - } - - /// - /// - /// - /// - /// - public Resistance MeasureResistance(int timeout) - { - double max = _lastRange; - - double min = 1.0; - - Random rnd = new Random(); - - double seed = rnd.NextDouble(); - - double dataToReturn = (seed * (max - min)) + min; - - Thread.Sleep(200); - - return Resistance.FromOhms(dataToReturn); - } - - /// - /// - /// - /// - /// - public Voltage MeasureVoltage(int timeout) - { - double max = _lastRange; - - double min = 1.0; - - Random rnd = new Random(); - - double seed = rnd.NextDouble(); - - double dataToReturn = (seed * (max - min)) + min; - - Thread.Sleep(200); - - return Voltage.FromVolts(dataToReturn); - } - - - /// - /// - /// - public MeasurementFunction MeasurementType - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Pass; - return _selfTestResult; - } - - /// - /// - /// - public void Reset() - { - throw new NotImplementedException(); - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// - /// - public void Shutdown() - { - _state = State.Uninitialized; - } - - #endregion - } + /// + /// A simulation implementation of the DMM interface. + /// This class basically just absorbs function calls and returns dummy data. + /// + public class DMMSim : IDmm + { + #region PrivateMemberVariables + + private string _name; + private double _lastRange; + private State _state; + private SelfTestResult _selfTestResult; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFunctions + + /// + /// The Finalizer. + /// + ~DMMSim() + { + Dispose(false); + } + + /// + /// + /// + /// + protected virtual void Dispose(bool disposing) + { + } + #endregion + + #region PublicFunctions + + /// + /// DMMSim factory constructor + /// + /// + /// + public DMMSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _lastRange = 0; + + _state = State.Uninitialized; + + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// + /// + /// + public DMMSim(string deviceName) + { + _name = deviceName; + + _lastRange = 0; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _state = State.Uninitialized; + + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) + { + _lastRange = range.Amps; + } + + /// + /// + /// + /// + /// + /// + public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) + { + _lastRange = range.Hertz; + } + + /// + /// + /// + /// + /// + /// + public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) + { + _lastRange = range.Ohms; + } + + /// + /// + /// + /// + /// + /// + public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) + { + _lastRange = range.Volts; + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Sim Dmm"; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _selfTestResult = PerformSelfTest(); + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } + + /// + /// + /// + /// + /// + public Current MeasureCurrent(int timeout) + { + double max = _lastRange; + + double min = 1.0; + + Random rnd = new Random(); + + double seed = rnd.NextDouble(); + + double dataToReturn = (seed * (max - min)) + min; + + Thread.Sleep(200); + + return Current.FromAmps(dataToReturn); + } + + /// + /// + /// + /// + /// + public Frequency MeasureFrequency(int timeout) + { + double max = _lastRange; + + double min = 1.0; + + Random rnd = new Random(); + + double seed = rnd.NextDouble(); + + double dataToReturn = (seed * (max - min)) + min; + + Thread.Sleep(200); + + return Frequency.FromHertz(dataToReturn); + } + + /// + /// + /// + /// + /// + public Resistance MeasureResistance(int timeout) + { + double max = _lastRange; + + double min = 1.0; + + Random rnd = new Random(); + + double seed = rnd.NextDouble(); + + double dataToReturn = (seed * (max - min)) + min; + + Thread.Sleep(200); + + return Resistance.FromOhms(dataToReturn); + } + + /// + /// + /// + /// + /// + public Voltage MeasureVoltage(int timeout) + { + double max = _lastRange; + + double min = 1.0; + + Random rnd = new Random(); + + double seed = rnd.NextDouble(); + + double dataToReturn = (seed * (max - min)) + min; + + Thread.Sleep(200); + + return Voltage.FromVolts(dataToReturn); + } + + + /// + /// + /// + public MeasurementFunction MeasurementType + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Pass; + return _selfTestResult; + } + + /// + /// + /// + public void Reset() + { + throw new NotImplementedException(); + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + public void Shutdown() + { + _state = State.Uninitialized; + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMSim/DMMSimFactory.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMSim/DMMSimFactory.cs index 4728dd2..972e762 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMSim/DMMSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMSim/DMMSimFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DMMSimFactory")] - public class DMMSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DMMSimFactory")] + public class DMMSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DMMSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DMMSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DMMSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DMMSimFactory injection constructor + /// + [ImportingConstructor] + public DMMSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IDmm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DMMSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IDmm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DMMSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,9 +99,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new DMMSim(name, _configurationManager, _logger); + return new DMMSim(name, _configurationManager); } catch (Exception) { @@ -121,17 +112,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAK.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAK.cs index ebe8cde..4612568 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAK.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAK.cs @@ -16,526 +16,753 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using Raytheon.Instruments.Dmm; -using Raytheon.Units; +using System.Collections.Generic; +using System.IO; using System.IO.Ports; +using System.Threading; using NLog; using Raytheon.Common; +using Raytheon.Instruments.Dmm; +using Raytheon.Units; +using static Raytheon.Instruments.IODatatypes; namespace Raytheon.Instruments { - /// - /// A Space Electronics (Squib meter) of the DMM interface - /// - public class DMMSquibMeter101SQBRAK : IDmm, IDisposable - { - #region PrivateMemberVariables - - private string _name; - private readonly string _address; - private readonly SerialPort _serialPort; - private MeasurementFunction _lastType; - private double _lastRange; - private double _lastResolution; - private State _state; - private SelfTestResult _selfTestResult; - private byte[] _readBuffer; - private string versionInfo; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFunctions - - /// - /// Dispose of this objects resources - /// - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "_34461A")] - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - IOWrite("RST"); // send reset command - IOWrite("LM"); // sets squib meter to local mode (it is set to remote in initilize) - - _serialPort.Close(); - - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - /// - /// - private string ConvertToString(ref byte[] data) - { - string rsp = System.Text.Encoding.ASCII.GetString(data); - return rsp; - } - - /// - /// Send a command to the squib meter and get the response. - /// - /// The command to send. - /// The squib meter response as string. - - private string IOQuery(string commandString) - { - // Flush squib meter buffer - _serialPort.Write("FS"); - - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); - - // send the data out - _serialPort.Write(commandString); - - // read from the response - int numBytesRead = _serialPort.Read(_readBuffer, 0, _readBuffer.Length); - - // convert response to a string - string rspStr = ConvertToString(ref _readBuffer); - - // split out the command responce from the return data (divided by carriage return) - string[] result = rspStr.Split(new string[] { "\n", "\r\n", "" }, StringSplitOptions.None); - - // Check command responce (0 = OK) - if (result[0] == "1") - { - throw new Exception("Unknown Command"); - } - if (result[0] == "2") - { - throw new Exception("Command now allowed in present mode"); - } - - return result[1]; - } - - /// - /// Sends a serial Command to the instrument. - /// - /// The serial Command to be sent to the instrument. - private void IOWrite(string commandString) - { - // note each command sent has different return data/status/error formatting, IOWrite is just a direct write - // IOQuery will do a read, and return all the data - - // send command to serial port - _serialPort.Write(commandString); - } - - - #endregion - - #region PublicFunctions - - /// - /// DMMSquibMeter101SQBRAK factory constructor - /// - /// - /// - public DMMSquibMeter101SQBRAK(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - string comPortName = _configuration.GetConfigurationValue("DMMSquibMeter101SQBRAK", "ComPortName", "COM1"); - _address = comPortName; - int baudRate = _configuration.GetConfigurationValue("DMMSquibMeter101SQBRAK", "BaudRate", 9600); - Parity parity = _configuration.GetConfigurationValue("DMMSquibMeter101SQBRAK", "Parity", Parity.None); - int dataBits = _configuration.GetConfigurationValue("DMMSquibMeter101SQBRAK", "DataBits", 8); - StopBits stopBits = _configuration.GetConfigurationValue("DMMSquibMeter101SQBRAK", "StopBits", StopBits.One); - - _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; - _readBuffer = new byte[1000]; - - //created in Initialize() - - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// The constructor which opens the handle to the DMM and performs a self test on the instrument - /// - /// The name of this dmm - /// The address of the DMM - public DMMSquibMeter101SQBRAK(string name, string comPortName, int baudRate = 9600, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) - { - _name = name; - _address = comPortName; - _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; - _readBuffer = new byte[1000]; - _logger = LogManager.GetCurrentClassLogger(); - - //created in Initialize() - - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - - /// - /// The Finalizer which will release resources if required - /// - ~DMMSquibMeter101SQBRAK() - { - Dispose(false); - } - - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is - } - - /// - /// - /// - /// - /// - /// - public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) - { - throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is - } - - /// - /// - /// - /// - /// - /// - public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) - { - throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is - } - - /// - /// - /// - /// - /// - /// - public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) - { - if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } - - _lastType = type; - _lastRange = range.Ohms; - _lastResolution = resolution.Ohms; - } - - /// - /// - /// - /// - /// - /// - public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) - { - throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is - } - - /// - /// - /// - public string DetailedStatus - { - get - { - versionInfo = IOQuery("VR"); - return "Squib Meter version Information (Cage Code | Model Number | Serial Number | Firmware Version | Calibration Date): " + versionInfo; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - // Open the port - _serialPort.Open(); - - // set the squib meter to remote state - IOQuery("RM"); - - // Ensure continuous reading is off - IOQuery("COFF"); - - // Flush FIFO buffer - IOQuery("FS"); - - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } - - /// - /// - /// - public MeasurementFunction MeasurementType - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - /// - /// - public Current MeasureCurrent(int timeout) - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - /// - public Frequency MeasureFrequency(int timeout) - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - /// - public Resistance MeasureResistance(int timeout) - { - if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } - - IOQuery("SR"); //todo need to add in range values - - // send serial command to send & read response - // set range - // set resolution - // any other settings that need to be sent (write) before taking measurement - - string response = IOQuery("RV"); - - // parse the response //TODO Parse the return data (0= command ok, 1= unknown command, 2= command not allowed in present mode | reading | over range state | wiring error state | calibration state (ok or bad) | hardware state (ok or bad)) - double rsp = Util.ConvertStringToDouble(response); //if string is only number this is ok, if there are any other char must strip them off - - return Resistance.FromOhms(rsp); - } - - /// - /// - /// - /// - /// - public Voltage MeasureVoltage(int timeout) - { - throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is - } - - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - int testResult = 0; - const string BatteryState = "LOW"; - string result = IOQuery("RV"); - - // Set measurement input to backplane after performing self test. Default is front panel. - // _dmm.Measurement.In = VTEXDmmInputSelectEnum.VTEXDmmInputSelectInternal; - - if (result == BatteryState) - { - _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; - throw new Exception("Battery state: " + testResult + " Battery State Message: " + result); - } - - _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; - - return _selfTestResult; - } - - /// - /// - /// - public void Reset() - { - IOWrite("RST"); - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - IOWrite("RST"); // send reset command - IOWrite("LM"); // sets squib meter to local mode (it is set to remote in initilize) - - _serialPort.Close(); - - _state = State.Uninitialized; - } - } - - #endregion - } + /// + /// A Space Electronics (Squib meter) of the DMM interface + /// + public class DMMSquibMeter101SQBRAK : IDmm + { + #region PrivateMemberVariables + + private string _name; + private SerialPort _serialPort; + private MeasurementFunction _lastType; + private double _lastRange; + private double _lastResolution; + private State _state; + private SelfTestResult _selfTestResult; + private byte[] _readBuffer; + private string versionInfo; + + private string _comPortName; + private int _baudRate; + private Parity _parity; + private int _dataBits; + private StopBits _stopBits; + + private int _rangeChangeDelayMilliseconds; + private int _startDelayMilliseconds; + private bool _returnLimitOnOverRange; + private bool _shortAutoRange; + private bool _autoRange; + private int _retryLimit; + private int _retryCount; + + // DIO device to turn on/off squib meter battery + private IGeneralIO _dioDev; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + private const string SQUIB_BATT = "SQUIB_BATT"; + private const string SQUIB_PWR = "SQUIB_PWR"; + private const string SQUIB_BATT_STATUS = "SQUIB_BATT_STATUS"; + private const string SQUIB_BATT_SELECT = "SQUIB_BATT_SELECT"; + private const string SQUIB_CHRG_A_STATUS = "SQUIB_CHRG_A_STATUS"; + private const string SQUIB_CHRG_B_STATUS = "SQUIB_CHRG_B_STATUS"; + + private enum BATTERY_NAMES + { + BATTERY_A, + BATTERY_B + } + + private Dictionary _batteryToBitStateDict = new Dictionary() { { BATTERY_NAMES.BATTERY_A, BitState.Low }, { BATTERY_NAMES.BATTERY_B, BitState.High } }; + + #endregion + + #region PrivateFunctions + + /// + /// + /// + /// + /// + private string ConvertToString(ref byte[] data) + { + string rsp = System.Text.Encoding.ASCII.GetString(data); + return rsp; + } + + /// + /// Send a command to the squib meter and get the response. + /// + /// The command to send. + /// The squib meter response as string. + + private string IOQuery(string commandString) + { + _serialPort.RtsEnable = true; + Thread.Sleep(25); + + // send the data out + _serialPort.WriteLine(commandString); + + // read from the response. + string rspStr = _serialPort.ReadLine(); + + // split out the command responce from the return data (divided by carriage return) + string[] results = rspStr.Split(new string[] { "\n", "\r\n", "" }, StringSplitOptions.None); + + // Check command responce (0 = OK) + if (results[0] == "1") + { + throw new Exception($"{Name}: Unknown Command {commandString}"); + } + if (results[0] == "2") + { + throw new Exception($"{Name}: Command now allowed in present mode ({commandString})"); + } + + if (results.Length > 1 && (results[1].Length > results[0].Length)) + { + rspStr = results[1]; + } + else + { + rspStr = results[0]; + } + + _serialPort.RtsEnable = false; + Thread.Sleep(25); + + return rspStr; + } + + /// + /// Sends a serial Command to the instrument. + /// + /// The serial Command to be sent to the instrument. + private void IOWrite(string commandString) + { + // note each command sent has different return data/status/error formatting, IOWrite is just a direct write + // IOQuery will do a read, and return all the data + + // send command to serial port + _serialPort.Write(commandString); + } + + + #endregion + + #region PublicFunctions + + /// + /// DMMSquibMeter101SQBRAK factory constructor + /// + /// + /// + public DMMSquibMeter101SQBRAK(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(_name); + + _comPortName = _configuration.GetConfigurationValue(_name, "ComPortName"); + int.TryParse(_configuration.GetConfigurationValue(_name, "BaudRate"), out _baudRate); + Enum.TryParse(_configuration.GetConfigurationValue(_name, "Parity"), true, out _parity); + int.TryParse(_configuration.GetConfigurationValue(_name, "DataBits"), out _dataBits); + Enum.TryParse(_configuration.GetConfigurationValue(_name, "StopBits"), true, out _stopBits); + + _startDelayMilliseconds = _configuration.GetConfigurationValue(_name, "StartDelayMilliseconds", 2000); + _rangeChangeDelayMilliseconds = _configuration.GetConfigurationValue(_name, "RangeChangeDelayMilliseconds", 3000); + _autoRange = _configuration.GetConfigurationValue(_name, "AutoRange", false); + _shortAutoRange = _configuration.GetConfigurationValue(_name, "ShortAutoRange", false); + _returnLimitOnOverRange = _configuration.GetConfigurationValue(_name, "ReturnLimitOnOverRange", false); + + _lastType = 0; + _lastRange = 0; + _lastResolution = 0; + _readBuffer = new byte[1000]; + _retryLimit = 2; + _retryCount = 0; + + + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// The Finalizer which will release resources if required + /// + ~DMMSquibMeter101SQBRAK() + { + + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is + } + + /// + /// + /// + /// + /// + /// + public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) + { + throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is + } + + /// + /// + /// + /// + /// + /// + public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) + { + throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is + } + + /// + /// + /// + /// + /// + /// + public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) + { + List allowedRanges = new List() { "0", "1", "2", "3", "4", "5", "6", "7" }; + double ohms = range.Ohms; + string deviceRange = ohms.ToString(); + + /* Space Electronics 101-SQB-RAK resolution is fixed according to range + Device Ranges + + 0 No Range + 1 DIODE Range + 2 20 Ohm + 3 200 Ohm + 4 2K Ohm + 5 20K Ohm + 6 200K Ohm + 7 2M Ohm + */ + + if (!allowedRanges.Contains(deviceRange)) + { + throw new Exception($"{Name} - Error setting device range"); + } + + if (_lastRange != ohms) + { + const string SETRANGE = "SR"; + IOQuery($"{SETRANGE}{deviceRange}"); + Thread.Sleep(_rangeChangeDelayMilliseconds); + } + + if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } + + _lastRange = ohms; + _lastType = type; + _lastResolution = resolution.Ohms; + } + + /// + /// + /// + /// + /// + /// + public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) + { + throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is + } + + /// + /// + /// + public string DetailedStatus + { + get + { + versionInfo = IOQuery("VR"); + return "Squib Meter version Information (Cage Code | Model Number | Serial Number | Firmware Version | Calibration Date): " + versionInfo; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _serialPort = new SerialPort(_comPortName, _baudRate, _parity, _dataBits, _stopBits) + { + NewLine = "\r", + Handshake = Handshake.None, + DiscardNull = true, + Encoding = System.Text.Encoding.ASCII, + }; + + // Open the port + _serialPort.Open(); + _serialPort.DtrEnable = true; + Thread.Sleep(_startDelayMilliseconds); + + // set the squib meter to remote state + IOQuery("RM"); + + // Flush FIFO buffer + IOQuery("FS"); + + string res; + do + { + res = string.Empty; + _serialPort.ReadTimeout = 50; + res = IOQuery("ST"); + } + while (res != "0|RM|SR0"); + + _serialPort.ReadTimeout = SerialPort.InfiniteTimeout; + _state = State.Ready; + } + else + { + throw new Exception($"{Name}: expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } + + /// + /// + /// + public void Initialize(IGeneralIO dioDev, string squibMeterBatteryConfigFilePath) + { + if (dioDev == null) + throw new ArgumentNullException(); + + if (_state == State.Uninitialized) + { + _dioDev = dioDev; + + PowerOnSquibMeterBattery(squibMeterBatteryConfigFilePath); + + _serialPort = new SerialPort(_comPortName, _baudRate, _parity, _dataBits, _stopBits) + { + NewLine = "\r", + Handshake = Handshake.None, + DiscardNull = true, + Encoding = System.Text.Encoding.ASCII, + }; + + // Open the port + _serialPort.Open(); + _serialPort.DtrEnable = true; + Thread.Sleep(_startDelayMilliseconds); + + // set the squib meter to remote state + IOQuery("RM"); + + // Flush FIFO buffer + IOQuery("FS"); + + string res; + do + { + res = string.Empty; + _serialPort.ReadTimeout = 50; + res = IOQuery("ST"); + } + while (res != "0|RM|SR0"); + + _serialPort.ReadTimeout = SerialPort.InfiniteTimeout; + _state = State.Ready; + } + else + { + throw new Exception($"{Name}: expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } + + private void PowerOnSquibMeterBattery(string squibMeterBatteryConfigFilePath) + { + if (!File.Exists(squibMeterBatteryConfigFilePath)) + { + StreamWriter writeSquibMeterBatteryFile = new StreamWriter(squibMeterBatteryConfigFilePath); + writeSquibMeterBatteryFile.WriteLine("[BatteryInfo]"); + writeSquibMeterBatteryFile.WriteLine("SwitchBatteries = True"); + writeSquibMeterBatteryFile.WriteLine("; If SwitchBatteries is False, then PreferredBattery will always be used"); + writeSquibMeterBatteryFile.WriteLine("PreferredBattery = BATTERY_A"); + writeSquibMeterBatteryFile.WriteLine("; This is used if SwitchBatteries is True"); + writeSquibMeterBatteryFile.WriteLine("BatteryLastUsed = BATTERY_B"); + writeSquibMeterBatteryFile.WriteLine("; This is informational only, not used by anything"); + writeSquibMeterBatteryFile.WriteLine("BatteryLastTimeUsed = 09/22/25 @ 11:13:36"); + writeSquibMeterBatteryFile.Close(); + } + + ConfigurationFile squibBatteryInfoConfig = new ConfigurationFile(squibMeterBatteryConfigFilePath); + BATTERY_NAMES batteryToBePoweredOn = BATTERY_NAMES.BATTERY_A; + bool switchBatteries = bool.Parse(squibBatteryInfoConfig.ReadValue("BatteryInfo", "SwitchBatteries")); + + if (switchBatteries == false) + { + string preferedBattery = squibBatteryInfoConfig.ReadValue("BatteryInfo", "PreferredBattery"); + if (preferedBattery == BATTERY_NAMES.BATTERY_B.ToString()) + { + batteryToBePoweredOn = BATTERY_NAMES.BATTERY_B; + } + } + else + { + string lastBatteryUsed = squibBatteryInfoConfig.ReadValue("BatteryInfo", "BatteryLastUsed"); + + if (String.IsNullOrEmpty(lastBatteryUsed)) + { + throw new Exception($"No value for Battery in {squibMeterBatteryConfigFilePath}"); + } + if (lastBatteryUsed != BATTERY_NAMES.BATTERY_A.ToString() && lastBatteryUsed != BATTERY_NAMES.BATTERY_B.ToString()) + { + throw new Exception($"Unexpected value for Battery in {squibMeterBatteryConfigFilePath}"); + } + if (lastBatteryUsed == BATTERY_NAMES.BATTERY_A.ToString()) + { + batteryToBePoweredOn = BATTERY_NAMES.BATTERY_B; + } + } + + // select a battery + _dioDev.SetBit(SQUIB_BATT, _batteryToBitStateDict[batteryToBePoweredOn]); + // power on selected battery + _dioDev.SetBit(SQUIB_PWR, BitState.High); + + squibBatteryInfoConfig.WriteValue("BatteryInfo", "BatteryLastUsed", batteryToBePoweredOn.ToString()); + squibBatteryInfoConfig.WriteValue("BatteryInfo", "BatteryLastTimeUsed", DateTime.Now.ToString("MM/dd/yy @ HH:mm:ss")); + } + + public void PowerOffSquibMeterBattery() + { + int batteryInUse = 0; + + // if the SquibMeter DIO idles for too long, it closes its connection + // so we have to reconnect to it + for (int i = 1; i <= 2; i++) + { + try + { + batteryInUse = (int)_dioDev.GetBitState(SQUIB_BATT_SELECT); + break; + } + catch + { + if (i == 2) + break; + _dioDev.Reset(); + } + } + + BATTERY_NAMES batteryToBePoweredOff = BATTERY_NAMES.BATTERY_A; + + if (batteryInUse == (int)BATTERY_NAMES.BATTERY_B) + { + batteryToBePoweredOff = BATTERY_NAMES.BATTERY_B; + } + + // select a battery + _dioDev.SetBit(SQUIB_BATT, _batteryToBitStateDict[batteryToBePoweredOff]); + // power off the battery + _dioDev.SetBit(SQUIB_PWR, BitState.Low); + } + + /// + /// + /// + public MeasurementFunction MeasurementType + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + /// + /// + public Current MeasureCurrent(int timeout) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public Frequency MeasureFrequency(int timeout) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public Resistance MeasureResistance(int timeout) + { + if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } + + string rsp = IOQuery("RV"); + + // 0|1.2345|OK|OK|OK|OK + const char DELIMITER = '|'; + string[] results = rsp.Split(DELIMITER); + + /* + 0 Indicates Command OK + 1 Reading + 2 Over Range State [OVER|OK] + 3 Wiring Error State [ERROR|OK] + 4 Calibration State [BAD|OK] + 5 Hardware State [BAD|OK] + */ + + const string OK = "OK"; + const string OVER = "OVER"; + + if (results.Length != 6) + { + _logger.Error($"{Name} - Squib Meter responded with {rsp}, expected 6 items go {results.Length}"); + if (_retryCount < _retryLimit && results.Length == 3 && results[0] == "0" && results[1] == "RM" && results[2].Contains("SR")) + { + _logger.Warn($"{Name} - retrying due to probably unflushed buffer"); + _retryCount++; + return MeasureResistance(timeout); + } + throw new Exception($"{Name} - Squib Meter returned {rsp}, was expecting in the format '0|1.2345|OK|OK|OK|OK'"); + } + if (results[0] != "0") + { + throw new Exception($"{Name} - Squib Meter returned command status {results[0]}, was expecting '0'"); + } + if (results[2] != OK) + { + if (results[2] != OVER) + { + throw new Exception($"{Name} - Squib Meter returned 'Over Range State {results[2]}', was expecting '{OK}'"); + } + if (_lastRange == 1) + { + _logger.Warn($"{Name} - Squib Meter returned Over range '{results[2]}' on Diode test, returning 1.15 volts"); + return Resistance.FromOhms(1.15); // magic number from existing MOTS SquibMeter.cpp const + } + if (_autoRange && _lastRange < 7) + { + double newRange = _lastRange == 0 ? 2 : _lastRange + 1; + if (_shortAutoRange) + { + if (_lastRange == 3) + { + newRange = 6; + } + if (_lastRange == 6) + { + newRange = 7; + } + } + _logger.Trace($"{Name} - AutoRange enabled, went from range: {_lastRange} to: {newRange}"); + ConfigureResistanceMeasurement(MeasurementFunction.FourWireResistance, Resistance.FromOhms(newRange), null); + return MeasureResistance(timeout); + } + if (_returnLimitOnOverRange) + { + _logger.Warn($"{Name} - Squib Meter returned Over range"); + switch (_lastRange) + { + case 2: return Resistance.FromOhms(20); + case 3: return Resistance.FromOhms(200); + case 4: return Resistance.FromOhms(2_000); + case 5: return Resistance.FromOhms(20_000); + case 6: return Resistance.FromOhms(200_000); + case 7: return Resistance.FromOhms(2_000_000); + } + } + } + if (results[3] != OK) + { + _logger.Warn($"{Name} - Squib Meter returned Wiring Error '{results[3]}' expected 'OK'"); + return Resistance.FromOhms(-9999.8888); // magic number from existing MOTS SquibMeter.cpp const + } + if (results[4] != OK) + { + throw new Exception($"{Name} - Squib Meter returned 'Calibration State {results[4]}', was expecting '{OK}'"); + } + if (results[5] != OK) + { + throw new Exception($"{Name} - Squib Meter returned 'Hardware State {results[5]}', was expecting '{OK}'"); + } + + double value = double.Parse(results[1]); + + return Resistance.FromOhms(value); + } + + /// + /// + /// + /// + /// + public Voltage MeasureVoltage(int timeout) + { + throw new NotImplementedException(); // if serial command for clearing errors add here, if not leave as is + } + + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + string rsp = IOQuery("RB"); + + // Parse 0|4.600|OK + const char DELIMITER = '|'; + string[] result = rsp.Split(DELIMITER); + + const string BatteryStateLow = "LOW"; + if (result[2] == BatteryStateLow) + { + _selfTestResult = SelfTestResult.Fail; + throw new Exception($"{Name}::PerformSelfTest() - Battery state: {result[2]}, Battery State Message {rsp}"); + } + _selfTestResult = SelfTestResult.Pass; + + return SelfTestResult; + } + + /// + /// + /// + public void Reset() + { + IOWrite("RST"); + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + if (_dioDev != null) + { + _serialPort.Close(); + Thread.Sleep(1000); + PowerOffSquibMeterBattery(); + _dioDev.Shutdown(); + } + + _state = State.Uninitialized; + } + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAK.csproj b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAK.csproj index 6a1d7b0..f36d748 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAK.csproj +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAK.csproj @@ -17,6 +17,7 @@ + diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAKFactory.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAKFactory.cs index 96516b7..f341d68 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAKFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/DMMSquibMeter101SQBRAKFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DMMSquibMeter101SQBRAKFactory")] - public class DMMSquibMeter101SQBRAKFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DMMSquibMeter101SQBRAKFactory")] + public class DMMSquibMeter101SQBRAKFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DMMSquibMeter101SQBRAKFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DMMSquibMeter101SQBRAKFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DMMSquibMeter101SQBRAKFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DMMSquibMeter101SQBRAKFactory injection constructor + /// + [ImportingConstructor] + public DMMSquibMeter101SQBRAKFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IDmm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DMMSquibMeter101SQBRAK(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IDmm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DMMSquibMeter101SQBRAK(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DMMSim(name, _configurationManager, _logger); + return new DMMSim(name, _configurationManager); else - return new DMMSquibMeter101SQBRAK(name, _configurationManager, _logger); + return new DMMSquibMeter101SQBRAK(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/Documentation/101-SQB-RAK Meter Customer Command Set Verion 1.0.8.pdf b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/Documentation/101-SQB-RAK Meter Customer Command Set Verion 1.0.8.pdf new file mode 100644 index 0000000..5151936 Binary files /dev/null and b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/Documentation/101-SQB-RAK Meter Customer Command Set Verion 1.0.8.pdf differ diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/Documentation/SE90262 Install Manual Version 1.0.pdf b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/Documentation/SE90262 Install Manual Version 1.0.pdf new file mode 100644 index 0000000..a53bacf Binary files /dev/null and b/Source/TSRealLib/HAL/Implementations/DMM/DMMSquibMeter101SQBRAK/Documentation/SE90262 Install Manual Version 1.0.pdf differ diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMVTI/DMMVTI.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMVTI/DMMVTI.cs index a1e9b59..01f601a 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMVTI/DMMVTI.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMVTI/DMMVTI.cs @@ -16,518 +16,485 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using VTI.VTEXDmm.Interop; -using Raytheon.Instruments.Dmm; -using Raytheon.Units; using NLog; using Raytheon.Common; +using Raytheon.Instruments.Dmm; +using Raytheon.Units; +using VTI.VTEXDmm.Interop; namespace Raytheon.Instruments { - /// - /// A VTI Dmm - /// - public class DMMVTI : IDmm - { - #region PrivateMemberVariables - private readonly string _address; - private VTEXDmm _dmm; - private State _state; - private SelfTestResult _selfTestResult; - private readonly string _options; - private const int _READ_TIMEOUT = 1000; - private string _name; - private MeasurementFunction _lastType; - private double _lastRange; - private double _lastResolution; + /// + /// A VTI Dmm + /// + public class DMMVTI : IDmm + { + #region PrivateMemberVariables + private readonly string _address; + private VTEXDmm _dmm; + private State _state; + private SelfTestResult _selfTestResult; + private readonly string _options; + private const int _READ_TIMEOUT = 1000; + private string _name; + private MeasurementFunction _lastType; + private double _lastRange; + private double _lastResolution; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions - /// - /// Dispose of this object - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _dmm.Utility.Reset(); + #endregion - _dmm.Close(); + #region PrivateFunctions + /// + /// Dispose of this object + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _dmm.Utility.Reset(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _dmm.Close(); - #endregion + _state = State.Uninitialized; + } + } + } - #region PublicFunctions + #endregion - /// - /// DMMVTI factory constructor - /// - /// - /// - public DMMVTI(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions - _logger = logger; + /// + /// DMMVTI factory constructor + /// + /// + /// + public DMMVTI(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _address = _configuration.GetConfigurationValue("DMMVTI", "Address", ""); - _options = _configuration.GetConfigurationValue("DMMVTI", "Options", ""); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; + _address = _configuration.GetConfigurationValue("DMMVTI", "Address", ""); + _options = _configuration.GetConfigurationValue("DMMVTI", "Options", ""); - //created in Initialize() - _dmm = null; + _lastType = 0; + _lastRange = 0; + _lastResolution = 0; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + //created in Initialize() + _dmm = null; - /// - /// The constructor which opens the handle to the DMM instrument. - /// - /// The address of the DMM. - /// The options used for setting up the instrument. - public DMMVTI(string name, string address, string options) - { - _name = name; - _address = address; - _options = options; - _lastType = 0; - _lastRange = 0; - _lastResolution = 0; - _logger = LogManager.GetCurrentClassLogger(); + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - // create in Initialize() - _dmm = null; + /// + /// The constructor which opens the handle to the DMM instrument. + /// + /// The address of the DMM. + /// The options used for setting up the instrument. + public DMMVTI(string deviceName, string address, string options) + { + _name = deviceName; + _address = address; + _options = options; + _lastType = 0; + _lastRange = 0; + _lastResolution = 0; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + // create in Initialize() + _dmm = null; - /// - /// The Finalizer. - /// - ~DMMVTI() - { - Dispose(false); - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// The Finalizer. + /// + ~DMMVTI() + { + Dispose(false); + } - /// - /// - /// - /// - /// - /// - public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) - { - throw new NotImplementedException(); - /*_lastType = type; + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + public void ConfigureCurrentMeasurement(MeasurementFunction type, Current range, Current resolution) + { + throw new NotImplementedException(); + /*_lastType = type; _lastRange = range.Amps; _lastResolution = resolution.Amps;*/ - } + } - /// - /// - /// - /// - /// - /// - public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) - { - if (type != MeasurementFunction.DCVolts && type != MeasurementFunction.ACVolts) - { - throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); - } + /// + /// + /// + /// + /// + /// + public void ConfigureVoltageMeasurement(MeasurementFunction type, Voltage range, Voltage resolution) + { + if (type != MeasurementFunction.DCVolts && type != MeasurementFunction.ACVolts) + { + throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); + } - _lastType = type; - _lastRange = range.Volts; - _lastResolution = resolution.Volts; - } + _lastType = type; + _lastRange = range.Volts; + _lastResolution = resolution.Volts; + } - /// - /// - /// - /// - /// - /// - public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) - { - if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + /// + public void ConfigureResistanceMeasurement(MeasurementFunction type, Resistance range, Resistance resolution) + { + if (type != MeasurementFunction.FourWireResistance && type != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } - _lastType = type; - _lastRange = range.Ohms; - _lastResolution = resolution.Ohms; - } + _lastType = type; + _lastRange = range.Ohms; + _lastResolution = resolution.Ohms; + } - /// - /// - /// - /// - /// - /// - public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) - { - if (type != MeasurementFunction.Frequency) - { - throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + /// + public void ConfigureFrequencyMeasurement(MeasurementFunction type, Frequency range, Frequency resolution) + { + if (type != MeasurementFunction.Frequency) + { + throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); + } - _lastType = type; - _lastRange = range.Hertz; - _lastResolution = resolution.Hertz; - } + _lastType = type; + _lastRange = range.Hertz; + _lastResolution = resolution.Hertz; + } - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a VTI Dmm"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a VTI Dmm"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotSupportedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotSupportedException(); + } - set - { - throw new NotSupportedException(); - } - } + set + { + throw new NotSupportedException(); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotSupportedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotSupportedException(); + } - set - { - throw new NotSupportedException(); - } - } + set + { + throw new NotSupportedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotSupportedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotSupportedException(); + } + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - _dmm = new VTEXDmm(); + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _dmm = new VTEXDmm(); - _dmm.Initialize(_address, true, true, _options); + _dmm.Initialize(_address, true, true, _options); - // Set measurement input to backplane after performing init(). Default is front panel. - _dmm.Measurement.Input = VTEXDmmInputSelectEnum.VTEXDmmInputSelectInternal; + // Set measurement input to backplane after performing init(). Default is front panel. + _dmm.Measurement.Input = VTEXDmmInputSelectEnum.VTEXDmmInputSelectInternal; - _selfTestResult = PerformSelfTest(); - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + _selfTestResult = PerformSelfTest(); + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - public MeasurementFunction MeasurementType - { - get - { - throw new NotSupportedException(); - } - } + /// + /// + /// + public MeasurementFunction MeasurementType + { + get + { + throw new NotSupportedException(); + } + } - /// - /// - /// - /// - /// - public Current MeasureCurrent(int timeout) - { - throw new NotImplementedException(); + /// + /// + /// + /// + /// + public Current MeasureCurrent(int timeout) + { + throw new NotImplementedException(); - /* + /* if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) { throw new Exception("only ac or dc volt is acceptable for param type: " + type.ToString()); } return Current.FromAmps(ReadCurrent();*/ - } + } - /// - /// - /// - /// - /// - public Frequency MeasureFrequency(int timeout) - { - if (_lastType != MeasurementFunction.Frequency) - { - throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + public Frequency MeasureFrequency(int timeout) + { + if (_lastType != MeasurementFunction.Frequency) + { + throw new Exception("only frequency is acceptable for param type: " + _lastType.ToString()); + } - double frequency = 0.0; + double frequency = 0.0; - _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunctionFreq; + _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunctionFreq; - _dmm.Range = _lastRange; + _dmm.Range = _lastRange; - _dmm.Resolution = _lastResolution; + _dmm.Resolution = _lastResolution; - _dmm.Measurement.Read(_READ_TIMEOUT, ref frequency); + _dmm.Measurement.Read(_READ_TIMEOUT, ref frequency); - return Frequency.FromHertz(frequency); - } + return Frequency.FromHertz(frequency); + } - /// - /// - /// - /// - /// - public Resistance MeasureResistance(int timeout) - { - if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) - { - throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + public Resistance MeasureResistance(int timeout) + { + if (_lastType != MeasurementFunction.FourWireResistance && _lastType != MeasurementFunction.TwoWireResistance) + { + throw new Exception("only FourWireResistance or TwoWireResistance is acceptable for param type: " + _lastType.ToString()); + } - if (_lastType == MeasurementFunction.FourWireResistance) - { - _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunction4WireRes; - } - else - { - _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunction2WireRes; - } + if (_lastType == MeasurementFunction.FourWireResistance) + { + _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunction4WireRes; + } + else + { + _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunction2WireRes; + } - double resistance = 0.0; + double resistance = 0.0; - _dmm.Range = _lastRange; + _dmm.Range = _lastRange; - _dmm.Resolution = _lastResolution; + _dmm.Resolution = _lastResolution; - _dmm.Measurement.Read(_READ_TIMEOUT, ref resistance); + _dmm.Measurement.Read(_READ_TIMEOUT, ref resistance); - if (double.IsNaN(resistance)) - { - resistance = double.MaxValue; - } + if (double.IsNaN(resistance)) + { + resistance = double.MaxValue; + } - return Resistance.FromOhms(resistance); - } + return Resistance.FromOhms(resistance); + } - /// - /// - /// - /// - /// - public Voltage MeasureVoltage(int timeout) - { - if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) - { - throw new Exception("only ac or dc volt is acceptable for param type: " + _lastType.ToString()); - } + /// + /// + /// + /// + /// + public Voltage MeasureVoltage(int timeout) + { + if (_lastType != MeasurementFunction.DCVolts && _lastType != MeasurementFunction.ACVolts) + { + throw new Exception("only ac or dc volt is acceptable for param type: " + _lastType.ToString()); + } - if (_lastType == MeasurementFunction.ACVolts) - { - _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunctionACVolts; - } - else - { - _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunctionDCVolts; - } + if (_lastType == MeasurementFunction.ACVolts) + { + _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunctionACVolts; + } + else + { + _dmm.Function = VTEXDmmFunctionEnum.VTEXDmmFunctionDCVolts; + } - double dcVoltage = 0.0; + double dcVoltage = 0.0; - _dmm.Measurement.Read(_READ_TIMEOUT, ref dcVoltage); + _dmm.Measurement.Read(_READ_TIMEOUT, ref dcVoltage); - if (double.IsNaN(dcVoltage)) - { - dcVoltage = double.MaxValue; - } + if (double.IsNaN(dcVoltage)) + { + dcVoltage = double.MaxValue; + } - return Voltage.FromVolts(dcVoltage); - } + return Voltage.FromVolts(dcVoltage); + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - int testResult = 0; - string result = ""; - _dmm.Utility.SelfTest(ref testResult, ref result); + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + int testResult = 0; + string result = ""; + _dmm.Utility.SelfTest(ref testResult, ref result); - // Set measurement input to backplane after performing self test. Default is front panel. - _dmm.Measurement.Input = VTEXDmmInputSelectEnum.VTEXDmmInputSelectInternal; + // Set measurement input to backplane after performing self test. Default is front panel. + _dmm.Measurement.Input = VTEXDmmInputSelectEnum.VTEXDmmInputSelectInternal; - if (testResult > 0) - { - _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; - throw new Exception("self test failed with an Error Code: " + testResult + " and Error Message: " + result); - } + if (testResult > 0) + { + _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; + throw new Exception("self test failed with an Error Code: " + testResult + " and Error Message: " + result); + } - _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; + _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; - return _selfTestResult; - } + return _selfTestResult; + } - /// - /// - /// - public void Reset() - { - _dmm.Utility.Reset(); - } + /// + /// + /// + public void Reset() + { + _dmm.Utility.Reset(); + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - _dmm.Utility.Reset(); + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + _dmm.Utility.Reset(); - _dmm.Close(); + _dmm.Close(); - _state = State.Uninitialized; - } - } + _state = State.Uninitialized; + } + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/DMM/DMMVTI/DMMVTIFactory.cs b/Source/TSRealLib/HAL/Implementations/DMM/DMMVTI/DMMVTIFactory.cs index ae1684d..c5dee22 100644 --- a/Source/TSRealLib/HAL/Implementations/DMM/DMMVTI/DMMVTIFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/DMM/DMMVTI/DMMVTIFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "DMMVTIFactory")] - public class DMMVTIFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "DMMVTIFactory")] + public class DMMVTIFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public DMMVTIFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public DMMVTIFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public DMMVTIFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// DMMVTIFactory injection constructor + /// + [ImportingConstructor] + public DMMVTIFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IDmm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new DMMVTI(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IDmm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new DMMVTI(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new DMMSim(name, _configurationManager, _logger); + return new DMMSim(name, _configurationManager); else - return new DMMVTI(name, _configurationManager, _logger); + return new DMMVTI(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/ELoad/ELoadScpiKeysight/ELoadScpiKeysight.cs b/Source/TSRealLib/HAL/Implementations/ELoad/ELoadScpiKeysight/ELoadScpiKeysight.cs index 26b0aee..8afd472 100644 --- a/Source/TSRealLib/HAL/Implementations/ELoad/ELoadScpiKeysight/ELoadScpiKeysight.cs +++ b/Source/TSRealLib/HAL/Implementations/ELoad/ELoadScpiKeysight/ELoadScpiKeysight.cs @@ -15,753 +15,720 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NationalInstruments.NI4882; using System; using System.IO.Ports; +using NationalInstruments.NI4882; using NLog; using Raytheon.Common; using Raytheon.Units; namespace Raytheon.Instruments { - /// - /// A class that provides an interface for controlling Eloads. - /// - public class ELoadScpiKeysight : IEload - { - #region PrivateClassMembers - - // General Commands - private const string _CHAN = "CHAN "; - private const string _INPUTON = "INP ON"; - private const string _INPUTOFF = "INP OFF"; - - // Resistance Commands - private const string _RESISTANCE = "RESistance "; - private const string _RESISTANCE_MODE = "MODE RESistance"; - private const string _RESISTANCE_MODE_FIXED = "RESistance:MODE FIXED "; - private const string _RESISTANCE_RANGE = "RESistance:RANGe "; - - // Current Commands - private const string _CURRENT = "CURRent "; - private const string _CURRENT_MODE = "MODE CURRent "; - private const string _CURRENT_MODE_FIXED = "CURRent:MODE FIXED "; - private const string _CURRENT_PROTECTION = "CURR:PROTection "; - private const string _CURRENT_PROTECTION_ENABLE = "CURRent:PROTection:STATe ON"; - private const string _CURRENT_RANGE = "CURRent:RANGe "; - - //voltage commands - private const string _VOLTAGE_PROTECTION = "VOLT:PROTection "; - private const string _VOLTAGE_PROTECTION_ENABLE = "VOLT:PROTection:STATe ON"; - - // read commands - private const string _CURRENT_SETPOINT_QUERY = "CURR?"; - private const string _CURRENT_QUERY = "MEAS:CURR?"; - private const string _READVOLTAGEQUERY = "MEAS:VOLT?"; - private const string _MODE_QUERY = "MODE? "; - private const string _INPUTONQUERY = "INP?"; - private const string _READRESISTANCEQUERY = "RESistance?"; - private const string _ERRORCODE_QUERY = "SYST:ERR?"; - private const string _CURRENT_PROTECTION_QUERY = "CURR:PROTection?"; - private const string _VOLTAGE_PROTECTION_QUERY = "VOLT:PROTection?"; - private const string _PROTECTION_STATUS_QUERY = "STATus:CHANnel:CONDition?"; - - private readonly int _channelNumber; - private EloadModuleMode _mode; - private EloadModuleMode _ini_mode; - private double _setpointVal; - private double _ini_setpointVal; - private double _overCurrentProtection; - private double _overVoltageProtection; - private SerialPort _serialPort; - private Device _gpibDevice; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - public string DetailedStatus { get; protected set; } - - public bool DisplayEnabled { get; set; } - public bool FrontPanelEnabled { get; set; } - - public InstrumentMetadata Info { get; set; } - - public string Name { get; protected set; } - - public SelfTestResult SelfTestResult => PerformSelfTest(); - - public State Status { get; set; } - #endregion - - #region PrivateFuctions - - /// - /// Dispose of this object's resources. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - Disable(); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// Querys the Eload module for an error code. - /// - /// The error code. - private string GetErrorCode(out int errorCode) - { - // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query - SetChannel(); - - string rsp = ""; - - if (_serialPort != null) - { - _serialPort.WriteLine(_ERRORCODE_QUERY); - rsp = _serialPort.ReadLine(); - } - else - { - _gpibDevice.Write(_ERRORCODE_QUERY); - rsp = _gpibDevice.ReadString(); - } - - rsp = rsp.Replace("\r", ""); - - string[] tokens = rsp.Split(','); - - errorCode = Util.ConvertStringToInt32(tokens[0]); - - // it should always be 2 - if (tokens.Length >= 2) - { - return tokens[1]; - } - else - { - return ""; - } - } - - /// - /// Send the set channel command to the Eload module. - /// - private void SetChannel() - { - // not calling IOWrite so IOWrite can call this function each time - // no need to check for errors here since they are checked in IOWrite()/IOQuery() - - string channelCommand = _CHAN + _channelNumber.ToString(); - - if (_serialPort != null) - { - _serialPort.WriteLine(channelCommand); - } - else - { - _gpibDevice.Write(channelCommand); - } - } - - /// - /// Set the overcurrent protection value and verifies setting. - /// - /// The overcurrent value. - private void SetAndConfirmOverCurrentProtection(double overCurrentProtection) - { - string currentProtectionCommand = _CURRENT_PROTECTION + _overCurrentProtection.ToString(); - IOWrite(currentProtectionCommand); - - string currentProtectionEnableCommand = _CURRENT_PROTECTION_ENABLE; - IOWrite(currentProtectionEnableCommand); - - var programmedOcp = ReadOverCurrentProtection().Amps; - - if (programmedOcp != overCurrentProtection) - { - throw new Exception("Tried to set OCP to: " + overCurrentProtection.ToString() + ", but eload reports: " + programmedOcp.ToString()); - } - } - - /// - /// Set the overvoltage protection value and verifies setting. - /// - /// The overvoltage value. - private void SetAndConfirmOverVoltageProtection(double overVoltageProtection) - { - string voltageProtectionCommand = _VOLTAGE_PROTECTION + overVoltageProtection.ToString(); - IOWrite(voltageProtectionCommand); - - string voltageProtectionEnableCommand = _VOLTAGE_PROTECTION_ENABLE; - IOWrite(voltageProtectionEnableCommand); - - var programmedOvp = ReadOverVoltageProtection().Volts; - - if (programmedOvp != overVoltageProtection) - { - throw new Exception("Tried to set OVP to: " + overVoltageProtection.ToString() + ", but eload reports: " + programmedOvp.ToString()); - } - } - #endregion - - #region PublicFuctions - - /// - /// ELoadScpiKeysight factory constructor - /// - /// - /// - public ELoadScpiKeysight(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _gpibDevice = null; - _serialPort = _configuration.GetConfigurationValue("ELoadScpiKeysight", "SerialPort", new SerialPort()); - _channelNumber = _configuration.GetConfigurationValue("ELoadScpiKeysight", "ChannelNumber", 0); - _mode = _configuration.GetConfigurationValue("ELoadScpiKeysight", "Mode", EloadModuleMode.CURRENT); - _ini_mode = _configuration.GetConfigurationValue("ELoadScpiKeysight", "IniMode", EloadModuleMode.CURRENT); - _setpointVal = _configuration.GetConfigurationValue("ELoadScpiKeysight", "SetpointVal", 0.0); - _ini_setpointVal = _configuration.GetConfigurationValue("ELoadScpiKeysight", "IniSetpointVal", 0.0); - _overCurrentProtection = _configuration.GetConfigurationValue("ELoadScpiKeysight", "OverCurrentProtection", 0.0); - _overVoltageProtection = _configuration.GetConfigurationValue("ELoadScpiKeysight", "OverVoltageProtection", 0.0); - - // make sure it is off - Disable(); - - // set mode - SetMode(_mode); - - // set the setpoint - SetSetpoint(_setpointVal, _mode); - - //set OCP - SetAndConfirmOverCurrentProtection(_overCurrentProtection); - } - - - /// - /// The constructor for an Eload. - /// - /// The interface to the Eload instrument. - /// The channel number for the Eload module. - /// The operating mode of this Eload module. - /// The setpoint value of the Eload module. Depends on operation mode. - /// The overcurrent protection value. - public ELoadScpiKeysight(SerialPort serialPort, int channelNumber, EloadModuleMode mode, double setpointVal, double overCurrentProtection, double overVoltageProtection) - { - _gpibDevice = null; - _serialPort = serialPort; - _channelNumber = channelNumber; - _mode = mode; - _ini_mode = mode; - _setpointVal = setpointVal; - _ini_setpointVal = setpointVal; - _overCurrentProtection = overCurrentProtection; - _overVoltageProtection = overVoltageProtection; - _logger = LogManager.GetCurrentClassLogger(); - - // make sure it is off - Disable(); - - // set mode - SetMode(mode); - - // set the setpoint - SetSetpoint(setpointVal, mode); - - //set OCP - SetAndConfirmOverCurrentProtection(_overCurrentProtection); - } - - /// - /// - /// - /// - /// - /// - /// - /// - /// - public ELoadScpiKeysight(Device gpibDevice, int channelNumber, EloadModuleMode mode, double setpointVal, double overCurrentProtection, double overVoltageProtection) - { - _serialPort = null; - _gpibDevice = gpibDevice; - _channelNumber = channelNumber; - _mode = mode; - _ini_mode = mode; - _setpointVal = setpointVal; - _ini_setpointVal = setpointVal; - _overCurrentProtection = overCurrentProtection; - _overVoltageProtection = overVoltageProtection; - - // make sure it is off - Disable(); - - // set mode - SetMode(mode); - - // set the setpoint - SetSetpoint(setpointVal, mode); - - //set OCP - SetAndConfirmOverCurrentProtection(_overCurrentProtection); - } - - - /// - /// The finalizer. - /// - ~ELoadScpiKeysight() - { - Dispose(false); - } - - /// - /// Dispose of this object's resources. - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// Query if the Eload module input is on. - /// - /// Status of Eload. True = On, False = Off. - public bool IsInputOn() - { - string readCommand = _INPUTONQUERY; - - string rsp = IOQuery(readCommand); - - if (rsp == "0") - { - return false; - } - else - { - return true; - } - } - - /// - /// Send a SCPI Command to the instrument and get a response. - /// - /// The command to send. - /// THe instrument response. - public string IOQuery(string commandString) - { - // not calling IOWrite() so IOWrite() can check for errors after each write - - SetChannel(); - - string rsp = ""; - - if (_serialPort != null) - { - _serialPort.WriteLine(commandString); - rsp = _serialPort.ReadLine(); - } - else - { - _gpibDevice.Write(commandString); - rsp = _gpibDevice.ReadString(); - } - - rsp = rsp.Replace("\r", ""); - - // check for errors - int err = 0; - string errorMsg = GetErrorCode(out err); - if (err != 0) - { - throw new Exception(errorMsg); - } - - return rsp; - } - - /// - /// Send a SCPI Command to the instrument. - /// - /// The command to be send. - public void IOWrite(string commandString) - { - SetChannel(); - - if (_serialPort != null) - { - _serialPort.WriteLine(commandString); - } - else - { - _gpibDevice.Write(commandString); - } - - // check for errors - int err = 0; - string errorMsg = GetErrorCode(out err); - if (err != 0) - { - throw new Exception(errorMsg); - } - } - - /// - /// Turn off the Eload module. - /// - public void Disable() - { - IOWrite(_INPUTOFF); - } - - /// - /// Turn on the Eload module. - /// - public void Enable() - { - IOWrite(_INPUTON); - } - - /// - /// Reads the current of the Eload module. - /// - /// The current (Amps) - public Current ReadCurrent() - { - string readCommand = _CURRENT_QUERY; - - string rsp = IOQuery(readCommand); - - double ret = Util.ConvertStringToDouble(rsp); - - return Current.FromAmps(ret); - } - - /// - /// Reads the mode of the Eload module. - /// - /// The mode. - public EloadModuleMode ReadMode() - { - string readCommand = _MODE_QUERY; - string ret = Convert.ToString(IOQuery(readCommand)); - var mode = EloadModuleMode.RESISTANCE; - - // will ger RES, CURR, or VOLT(tbd) - if (EloadModuleMode.CURRENT.ToString().Contains(ret) == true) - { - mode = EloadModuleMode.CURRENT; - } - else if (EloadModuleMode.RESISTANCE.ToString().Contains(ret) == true) - { - mode = EloadModuleMode.RESISTANCE; - } - else if (EloadModuleMode.VOLTAGE.ToString().Contains(ret) == true) - { - mode = EloadModuleMode.VOLTAGE; - } - else - { - throw new Exception("Unknown return from load: " + ret); - } - - return mode; - } - - /// - /// Reads the overcurrent setting from an Eload module. - /// - /// The current (Amps). - public Current ReadOverCurrentProtection() - { - string currentProtectionCommand = _CURRENT_PROTECTION_QUERY; - - string rsp = IOQuery(currentProtectionCommand); - - double ret = Util.ConvertStringToDouble(rsp); - - return Current.FromAmps(ret); - } - - /// - /// Reads the overvoltage setting from an Eload module. - /// - /// The voltage (Volts). - public Voltage ReadOverVoltageProtection() - { - string voltageProtectionCommand = _VOLTAGE_PROTECTION_QUERY; - - string rsp = IOQuery(voltageProtectionCommand); - - double ret = Util.ConvertStringToDouble(rsp); - - return Voltage.FromVolts(ret); - } - - /// - /// Query the Eload module for the resistance. - /// - /// The resistance (Ohms). - public Resistance ReadResistance() - { - string readCommand = _READRESISTANCEQUERY; - - string rsp = IOQuery(readCommand); - - double ret = Util.ConvertStringToDouble(rsp); - - return Resistance.FromOhms(ret); - } - - /// - /// Queries the Eload module for the setpoint value. Depends on operation mode. - /// - /// The setpoint value. - public double ReadSetpoint() - { - string readCommand = ""; - - if (_mode == EloadModuleMode.CURRENT) - { - readCommand = _CURRENT_SETPOINT_QUERY; - } - else if (_mode == EloadModuleMode.RESISTANCE) - { - readCommand = _READRESISTANCEQUERY; - } - else if (_mode == EloadModuleMode.VOLTAGE) - { - throw new Exception("voltage mode not supported"); - } - else - { - throw new Exception("Unknown mode: " + _mode.ToString()); - } - - string rsp = IOQuery(readCommand); - - double ret = Util.ConvertStringToDouble(rsp); - - return ret; - } - - /// - /// Query the Eload module for the voltage. - /// - /// The voltage (Volts). - public Voltage ReadVoltage() - { - string readCommand = _READVOLTAGEQUERY; - - string rsp = IOQuery(readCommand); - - double ret = Util.ConvertStringToDouble(rsp); - - return Voltage.FromVolts(ret); - } - - /// - /// Reads the overvoltage setting from an Eload module. - /// - /// The voltage (Volts). - public ushort ReadProtectionStatus() - { - string ProtectionStatusCommand = _PROTECTION_STATUS_QUERY; - - string rsp = IOQuery(ProtectionStatusCommand); - - ushort ret = Util.ConvertStringToUInt16(rsp); - - return ret; - } - - /// - /// Resets the eload setpoint and mode to config file values - /// - public void SetInitialSetting() - { - SetMode(_ini_mode); - SetSetpoint(_ini_setpointVal, _ini_mode); - } - - /// - /// Change the mode for the Eload module. - /// - /// The desired Eload module mode. - public void SetMode(EloadModuleMode mode) - { - //make sure it is off - Disable(); - - string command = ""; - string fixedCommand = ""; - - if (mode == EloadModuleMode.CURRENT) - { - command = _CURRENT_MODE; - fixedCommand = _CURRENT_MODE_FIXED; - } - else if (mode == EloadModuleMode.RESISTANCE) - { - command = _RESISTANCE_MODE; - fixedCommand = _RESISTANCE_MODE_FIXED; - } - else if (mode == EloadModuleMode.VOLTAGE) - { - throw new Exception("Voltage mode is not yet supported"); - } - else - { - throw new Exception("unsupported mode: " + mode.ToString()); - } - - IOWrite(command); - - IOWrite(fixedCommand); - - _mode = mode; - } - - /// - /// Change the setpoint and operation mode of the Eload module. - /// - /// The new setpoint. - /// The new mode. - public void SetSetpoint(double newSetpoint, EloadModuleMode mode) - { - if (mode != _mode) - { - throw new Exception("the current mode and the specified mode do not match. Current Mode: " + _mode.ToString() + ", specified mode: " + mode.ToString()); - } - - string rangeCommand = ""; - string command = ""; - - if (_mode == EloadModuleMode.CURRENT) - { - if (newSetpoint > _overCurrentProtection) - { - throw new Exception("the setpoint " + newSetpoint + "is outside the limit"); - } - - rangeCommand = _CURRENT_RANGE + newSetpoint.ToString(); - command = _CURRENT + newSetpoint.ToString(); - } - else if (_mode == EloadModuleMode.RESISTANCE) - { - if (newSetpoint <= 0) - { - throw new Exception("Invalid resistance: " + newSetpoint.ToString()); - } - - //i = v/r - double tempVoltage = ReadVoltage().Volts; - - // if voltage is not 0, we will confirm that resulting current is within range. - // Having Abs() to ensure to cover both +/- voltage cases if there is any. - if (Math.Abs(tempVoltage) > 1) - { - //calculate the resulting current - double tempCurrent = Math.Abs(tempVoltage) / newSetpoint; - - if (tempCurrent > _overCurrentProtection) - { - throw new Exception("the setpoint " + newSetpoint + "is outside the limit"); - } - } - - rangeCommand = _RESISTANCE_RANGE + newSetpoint.ToString(); - command = _RESISTANCE + newSetpoint.ToString(); - } - else if (_mode == EloadModuleMode.VOLTAGE) - { - throw new Exception("voltage mode not supported"); - } - else - { - throw new Exception("Unknown mode: " + _mode.ToString()); - } - - IOWrite(rangeCommand); - - IOWrite(command); - - // update our member now that everything checks out - _setpointVal = newSetpoint; - } - - public bool ClearErrors() - { - return true; - } - - public void Initialize() - { - } - - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } - - public void Reset() - { - Disable(); - - Enable(); - } - - public void Shutdown() - { - Dispose(); - } - - #endregion - } + /// + /// A class that provides an interface for controlling Eloads. + /// + public class ELoadScpiKeysight : IEload + { + #region PrivateClassMembers + + // General Commands + private const string _CHAN = "CHAN "; + private const string _INPUTON = "INP ON"; + private const string _INPUTOFF = "INP OFF"; + + // Resistance Commands + private const string _RESISTANCE = "RESistance "; + private const string _RESISTANCE_MODE = "MODE RESistance"; + private const string _RESISTANCE_MODE_FIXED = "RESistance:MODE FIXED "; + private const string _RESISTANCE_RANGE = "RESistance:RANGe "; + + // Current Commands + private const string _CURRENT = "CURRent "; + private const string _CURRENT_MODE = "MODE CURRent "; + private const string _CURRENT_MODE_FIXED = "CURRent:MODE FIXED "; + private const string _CURRENT_PROTECTION = "CURR:PROTection "; + private const string _CURRENT_PROTECTION_ENABLE = "CURRent:PROTection:STATe ON"; + private const string _CURRENT_RANGE = "CURRent:RANGe "; + + //voltage commands + private const string _VOLTAGE_PROTECTION = "VOLT:PROTection "; + private const string _VOLTAGE_PROTECTION_ENABLE = "VOLT:PROTection:STATe ON"; + + // read commands + private const string _CURRENT_SETPOINT_QUERY = "CURR?"; + private const string _CURRENT_QUERY = "MEAS:CURR?"; + private const string _READVOLTAGEQUERY = "MEAS:VOLT?"; + private const string _MODE_QUERY = "MODE? "; + private const string _INPUTONQUERY = "INP?"; + private const string _READRESISTANCEQUERY = "RESistance?"; + private const string _ERRORCODE_QUERY = "SYST:ERR?"; + private const string _CURRENT_PROTECTION_QUERY = "CURR:PROTection?"; + private const string _VOLTAGE_PROTECTION_QUERY = "VOLT:PROTection?"; + private const string _PROTECTION_STATUS_QUERY = "STATus:CHANnel:CONDition?"; + + private readonly int _channelNumber; + private EloadModuleMode _mode; + private EloadModuleMode _ini_mode; + private double _setpointVal; + private double _ini_setpointVal; + private double _overCurrentProtection; + private double _overVoltageProtection; + private SerialPort _serialPort; + private Device _gpibDevice; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + public string DetailedStatus { get; protected set; } + + public bool DisplayEnabled { get; set; } + public bool FrontPanelEnabled { get; set; } + + public InstrumentMetadata Info { get; set; } + + public string Name { get; protected set; } + + public SelfTestResult SelfTestResult => PerformSelfTest(); + + public State Status { get; set; } + #endregion + + #region PrivateFuctions + + /// + /// Dispose of this object's resources. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + Disable(); + } + } + + /// + /// Querys the Eload module for an error code. + /// + /// The error code. + private string GetErrorCode(out int errorCode) + { + // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query + SetChannel(); + + string rsp = ""; + + if (_serialPort != null) + { + _serialPort.WriteLine(_ERRORCODE_QUERY); + rsp = _serialPort.ReadLine(); + } + else + { + _gpibDevice.Write(_ERRORCODE_QUERY); + rsp = _gpibDevice.ReadString(); + } + + rsp = rsp.Replace("\r", ""); + + string[] tokens = rsp.Split(','); + + errorCode = Util.ConvertStringToInt32(tokens[0]); + + // it should always be 2 + if (tokens.Length >= 2) + { + return tokens[1]; + } + else + { + return ""; + } + } + + /// + /// Send the set channel command to the Eload module. + /// + private void SetChannel() + { + // not calling IOWrite so IOWrite can call this function each time + // no need to check for errors here since they are checked in IOWrite()/IOQuery() + + string channelCommand = _CHAN + _channelNumber.ToString(); + + if (_serialPort != null) + { + _serialPort.WriteLine(channelCommand); + } + else + { + _gpibDevice.Write(channelCommand); + } + } + + /// + /// Set the overcurrent protection value and verifies setting. + /// + /// The overcurrent value. + private void SetAndConfirmOverCurrentProtection(double overCurrentProtection) + { + string currentProtectionCommand = _CURRENT_PROTECTION + _overCurrentProtection.ToString(); + IOWrite(currentProtectionCommand); + + string currentProtectionEnableCommand = _CURRENT_PROTECTION_ENABLE; + IOWrite(currentProtectionEnableCommand); + + var programmedOcp = ReadOverCurrentProtection().Amps; + + if (programmedOcp != overCurrentProtection) + { + throw new Exception("Tried to set OCP to: " + overCurrentProtection.ToString() + ", but eload reports: " + programmedOcp.ToString()); + } + } + + /// + /// Set the overvoltage protection value and verifies setting. + /// + /// The overvoltage value. + private void SetAndConfirmOverVoltageProtection(double overVoltageProtection) + { + string voltageProtectionCommand = _VOLTAGE_PROTECTION + overVoltageProtection.ToString(); + IOWrite(voltageProtectionCommand); + + string voltageProtectionEnableCommand = _VOLTAGE_PROTECTION_ENABLE; + IOWrite(voltageProtectionEnableCommand); + + var programmedOvp = ReadOverVoltageProtection().Volts; + + if (programmedOvp != overVoltageProtection) + { + throw new Exception("Tried to set OVP to: " + overVoltageProtection.ToString() + ", but eload reports: " + programmedOvp.ToString()); + } + } + #endregion + + #region PublicFuctions + + /// + /// ELoadScpiKeysight factory constructor + /// + /// + /// + public ELoadScpiKeysight(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _gpibDevice = null; + _serialPort = _configuration.GetConfigurationValue("ELoadScpiKeysight", "SerialPort", new SerialPort()); + _channelNumber = _configuration.GetConfigurationValue("ELoadScpiKeysight", "ChannelNumber", 0); + _mode = _configuration.GetConfigurationValue("ELoadScpiKeysight", "Mode", EloadModuleMode.CURRENT); + _ini_mode = _configuration.GetConfigurationValue("ELoadScpiKeysight", "IniMode", EloadModuleMode.CURRENT); + _setpointVal = _configuration.GetConfigurationValue("ELoadScpiKeysight", "SetpointVal", 0.0); + _ini_setpointVal = _configuration.GetConfigurationValue("ELoadScpiKeysight", "IniSetpointVal", 0.0); + _overCurrentProtection = _configuration.GetConfigurationValue("ELoadScpiKeysight", "OverCurrentProtection", 0.0); + _overVoltageProtection = _configuration.GetConfigurationValue("ELoadScpiKeysight", "OverVoltageProtection", 0.0); + + // make sure it is off + Disable(); + + // set mode + SetMode(_mode); + + // set the setpoint + SetSetpoint(_setpointVal, _mode); + + //set OCP + SetAndConfirmOverCurrentProtection(_overCurrentProtection); + } + + + /// + /// The constructor for an Eload. + /// + /// The interface to the Eload instrument. + /// The channel number for the Eload module. + /// The operating mode of this Eload module. + /// The setpoint value of the Eload module. Depends on operation mode. + /// The overcurrent protection value. + public ELoadScpiKeysight(SerialPort serialPort, int channelNumber, EloadModuleMode mode, double setpointVal, double overCurrentProtection, double overVoltageProtection) + { + _gpibDevice = null; + _serialPort = serialPort; + _channelNumber = channelNumber; + _mode = mode; + _ini_mode = mode; + _setpointVal = setpointVal; + _ini_setpointVal = setpointVal; + _overCurrentProtection = overCurrentProtection; + _overVoltageProtection = overVoltageProtection; + _logger = LogManager.GetCurrentClassLogger(); + + // make sure it is off + Disable(); + + // set mode + SetMode(mode); + + // set the setpoint + SetSetpoint(setpointVal, mode); + + //set OCP + SetAndConfirmOverCurrentProtection(_overCurrentProtection); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public ELoadScpiKeysight(Device gpibDevice, int channelNumber, EloadModuleMode mode, double setpointVal, double overCurrentProtection, double overVoltageProtection) + { + _serialPort = null; + _gpibDevice = gpibDevice; + _channelNumber = channelNumber; + _mode = mode; + _ini_mode = mode; + _setpointVal = setpointVal; + _ini_setpointVal = setpointVal; + _overCurrentProtection = overCurrentProtection; + _overVoltageProtection = overVoltageProtection; + + // make sure it is off + Disable(); + + // set mode + SetMode(mode); + + // set the setpoint + SetSetpoint(setpointVal, mode); + + //set OCP + SetAndConfirmOverCurrentProtection(_overCurrentProtection); + } + + + /// + /// The finalizer. + /// + ~ELoadScpiKeysight() + { + Dispose(false); + } + + /// + /// Dispose of this object's resources. + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// Query if the Eload module input is on. + /// + /// Status of Eload. True = On, False = Off. + public bool IsInputOn() + { + string readCommand = _INPUTONQUERY; + + string rsp = IOQuery(readCommand); + + if (rsp == "0") + { + return false; + } + else + { + return true; + } + } + + /// + /// Send a SCPI Command to the instrument and get a response. + /// + /// The command to send. + /// THe instrument response. + public string IOQuery(string commandString) + { + // not calling IOWrite() so IOWrite() can check for errors after each write + + SetChannel(); + + string rsp = ""; + + if (_serialPort != null) + { + _serialPort.WriteLine(commandString); + rsp = _serialPort.ReadLine(); + } + else + { + _gpibDevice.Write(commandString); + rsp = _gpibDevice.ReadString(); + } + + rsp = rsp.Replace("\r", ""); + + // check for errors + int err = 0; + string errorMsg = GetErrorCode(out err); + if (err != 0) + { + throw new Exception(errorMsg); + } + + return rsp; + } + + /// + /// Send a SCPI Command to the instrument. + /// + /// The command to be send. + public void IOWrite(string commandString) + { + SetChannel(); + + if (_serialPort != null) + { + _serialPort.WriteLine(commandString); + } + else + { + _gpibDevice.Write(commandString); + } + + // check for errors + int err = 0; + string errorMsg = GetErrorCode(out err); + if (err != 0) + { + throw new Exception(errorMsg); + } + } + + /// + /// Turn off the Eload module. + /// + public void Disable() + { + IOWrite(_INPUTOFF); + } + + /// + /// Turn on the Eload module. + /// + public void Enable() + { + IOWrite(_INPUTON); + } + + /// + /// Reads the current of the Eload module. + /// + /// The current (Amps) + public Current ReadCurrent() + { + string readCommand = _CURRENT_QUERY; + + string rsp = IOQuery(readCommand); + + double ret = Util.ConvertStringToDouble(rsp); + + return Current.FromAmps(ret); + } + + /// + /// Reads the mode of the Eload module. + /// + /// The mode. + public EloadModuleMode ReadMode() + { + string readCommand = _MODE_QUERY; + string ret = Convert.ToString(IOQuery(readCommand)); + var mode = EloadModuleMode.RESISTANCE; + + // will ger RES, CURR, or VOLT(tbd) + if (EloadModuleMode.CURRENT.ToString().Contains(ret) == true) + { + mode = EloadModuleMode.CURRENT; + } + else if (EloadModuleMode.RESISTANCE.ToString().Contains(ret) == true) + { + mode = EloadModuleMode.RESISTANCE; + } + else if (EloadModuleMode.VOLTAGE.ToString().Contains(ret) == true) + { + mode = EloadModuleMode.VOLTAGE; + } + else + { + throw new Exception("Unknown return from load: " + ret); + } + + return mode; + } + + /// + /// Reads the overcurrent setting from an Eload module. + /// + /// The current (Amps). + public Current ReadOverCurrentProtection() + { + string currentProtectionCommand = _CURRENT_PROTECTION_QUERY; + + string rsp = IOQuery(currentProtectionCommand); + + double ret = Util.ConvertStringToDouble(rsp); + + return Current.FromAmps(ret); + } + + /// + /// Reads the overvoltage setting from an Eload module. + /// + /// The voltage (Volts). + public Voltage ReadOverVoltageProtection() + { + string voltageProtectionCommand = _VOLTAGE_PROTECTION_QUERY; + + string rsp = IOQuery(voltageProtectionCommand); + + double ret = Util.ConvertStringToDouble(rsp); + + return Voltage.FromVolts(ret); + } + + /// + /// Query the Eload module for the resistance. + /// + /// The resistance (Ohms). + public Resistance ReadResistance() + { + string readCommand = _READRESISTANCEQUERY; + + string rsp = IOQuery(readCommand); + + double ret = Util.ConvertStringToDouble(rsp); + + return Resistance.FromOhms(ret); + } + + /// + /// Queries the Eload module for the setpoint value. Depends on operation mode. + /// + /// The setpoint value. + public double ReadSetpoint() + { + string readCommand = ""; + + if (_mode == EloadModuleMode.CURRENT) + { + readCommand = _CURRENT_SETPOINT_QUERY; + } + else if (_mode == EloadModuleMode.RESISTANCE) + { + readCommand = _READRESISTANCEQUERY; + } + else if (_mode == EloadModuleMode.VOLTAGE) + { + throw new Exception("voltage mode not supported"); + } + else + { + throw new Exception("Unknown mode: " + _mode.ToString()); + } + + string rsp = IOQuery(readCommand); + + double ret = Util.ConvertStringToDouble(rsp); + + return ret; + } + + /// + /// Query the Eload module for the voltage. + /// + /// The voltage (Volts). + public Voltage ReadVoltage() + { + string readCommand = _READVOLTAGEQUERY; + + string rsp = IOQuery(readCommand); + + double ret = Util.ConvertStringToDouble(rsp); + + return Voltage.FromVolts(ret); + } + + /// + /// Reads the overvoltage setting from an Eload module. + /// + /// The voltage (Volts). + public ushort ReadProtectionStatus() + { + string ProtectionStatusCommand = _PROTECTION_STATUS_QUERY; + + string rsp = IOQuery(ProtectionStatusCommand); + + ushort ret = Util.ConvertStringToUInt16(rsp); + + return ret; + } + + /// + /// Resets the eload setpoint and mode to config file values + /// + public void SetInitialSetting() + { + SetMode(_ini_mode); + SetSetpoint(_ini_setpointVal, _ini_mode); + } + + /// + /// Change the mode for the Eload module. + /// + /// The desired Eload module mode. + public void SetMode(EloadModuleMode mode) + { + //make sure it is off + Disable(); + + string command = ""; + string fixedCommand = ""; + + if (mode == EloadModuleMode.CURRENT) + { + command = _CURRENT_MODE; + fixedCommand = _CURRENT_MODE_FIXED; + } + else if (mode == EloadModuleMode.RESISTANCE) + { + command = _RESISTANCE_MODE; + fixedCommand = _RESISTANCE_MODE_FIXED; + } + else if (mode == EloadModuleMode.VOLTAGE) + { + throw new Exception("Voltage mode is not yet supported"); + } + else + { + throw new Exception("unsupported mode: " + mode.ToString()); + } + + IOWrite(command); + + IOWrite(fixedCommand); + + _mode = mode; + } + + /// + /// Change the setpoint and operation mode of the Eload module. + /// + /// The new setpoint. + /// The new mode. + public void SetSetpoint(double newSetpoint, EloadModuleMode mode) + { + if (mode != _mode) + { + throw new Exception("the current mode and the specified mode do not match. Current Mode: " + _mode.ToString() + ", specified mode: " + mode.ToString()); + } + + string rangeCommand = ""; + string command = ""; + + if (_mode == EloadModuleMode.CURRENT) + { + if (newSetpoint > _overCurrentProtection) + { + throw new Exception("the setpoint " + newSetpoint + "is outside the limit"); + } + + rangeCommand = _CURRENT_RANGE + newSetpoint.ToString(); + command = _CURRENT + newSetpoint.ToString(); + } + else if (_mode == EloadModuleMode.RESISTANCE) + { + if (newSetpoint <= 0) + { + throw new Exception("Invalid resistance: " + newSetpoint.ToString()); + } + + //i = v/r + double tempVoltage = ReadVoltage().Volts; + + // if voltage is not 0, we will confirm that resulting current is within range. + // Having Abs() to ensure to cover both +/- voltage cases if there is any. + if (Math.Abs(tempVoltage) > 1) + { + //calculate the resulting current + double tempCurrent = Math.Abs(tempVoltage) / newSetpoint; + + if (tempCurrent > _overCurrentProtection) + { + throw new Exception("the setpoint " + newSetpoint + "is outside the limit"); + } + } + + rangeCommand = _RESISTANCE_RANGE + newSetpoint.ToString(); + command = _RESISTANCE + newSetpoint.ToString(); + } + else if (_mode == EloadModuleMode.VOLTAGE) + { + throw new Exception("voltage mode not supported"); + } + else + { + throw new Exception("Unknown mode: " + _mode.ToString()); + } + + IOWrite(rangeCommand); + + IOWrite(command); + + // update our member now that everything checks out + _setpointVal = newSetpoint; + } + + public bool ClearErrors() + { + return true; + } + + public void Initialize() + { + } + + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } + + public void Reset() + { + Disable(); + + Enable(); + } + + public void Shutdown() + { + Dispose(); + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/ELoad/ELoadScpiKeysight/ELoadScpiKeysightFactory.cs b/Source/TSRealLib/HAL/Implementations/ELoad/ELoadScpiKeysight/ELoadScpiKeysightFactory.cs index df1eebb..7f00ffd 100644 --- a/Source/TSRealLib/HAL/Implementations/ELoad/ELoadScpiKeysight/ELoadScpiKeysightFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/ELoad/ELoadScpiKeysight/ELoadScpiKeysightFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "ELoadScpiKeysightFactory")] - public class ELoadScpiKeysightFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "ELoadScpiKeysightFactory")] + public class ELoadScpiKeysightFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public ELoadScpiKeysightFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public ELoadScpiKeysightFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public ELoadScpiKeysightFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// ELoadScpiKeysightFactory injection constructor + /// + [ImportingConstructor] + public ELoadScpiKeysightFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IEload)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new ELoadScpiKeysight(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IEload)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new ELoadScpiKeysight(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new EloadSim(name, _configurationManager, _logger); + return new EloadSim(name, _configurationManager); else - return new ELoadScpiKeysight(name, _configurationManager, _logger); + return new ELoadScpiKeysight(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/ELoad/ELoadSim/ELoadSim.cs b/Source/TSRealLib/HAL/Implementations/ELoad/ELoadSim/ELoadSim.cs index 67c3840..db816c0 100644 --- a/Source/TSRealLib/HAL/Implementations/ELoad/ELoadSim/ELoadSim.cs +++ b/Source/TSRealLib/HAL/Implementations/ELoad/ELoadSim/ELoadSim.cs @@ -23,366 +23,361 @@ using Raytheon.Units; namespace Raytheon.Instruments { - /// - /// A simulated eload - /// - public class EloadSim : IEload - { - #region PrivateClassMembers - private readonly double _overCurrentProtection; - private readonly double _overVoltageProtection; - private double _setpointVal; - private double _ini_setpointval; - private double _voltage; - private readonly int _channelNumber; - private bool _isOn; - private EloadModuleMode _mode; - private EloadModuleMode _originalMode; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - public string DetailedStatus { get; protected set; } - - public bool DisplayEnabled { get; set; } - public bool FrontPanelEnabled { get; set; } - - public InstrumentMetadata Info { get; set; } - - public string Name { get; protected set; } - - public SelfTestResult SelfTestResult => PerformSelfTest(); - - public State Status { get; set; } - #endregion - - #region PublicFuctions - - /// - /// FlowMeterOmegaDPF20 factory constructor - /// - /// - /// - public EloadSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - const double SETPOINT_VOLTAGE = 28.0; - - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _channelNumber = _configuration.GetConfigurationValue("EloadSim", "ChannelNumber", 0); - _mode = _configuration.GetConfigurationValue("EloadSim", "Mode", EloadModuleMode.CURRENT); - _setpointVal = _configuration.GetConfigurationValue("EloadSim", "SetpointVal", 0.0); - _ini_setpointval = _configuration.GetConfigurationValue("EloadSim", "IniSetpointVal", 0.0); - _overCurrentProtection = _configuration.GetConfigurationValue("EloadSim", "OverCurrentProtection", 0.0); - _overVoltageProtection = _configuration.GetConfigurationValue("EloadSim", "OverVoltageProtection", 0.0); - _voltage = SETPOINT_VOLTAGE; - _originalMode = _mode; - // make sure it is off - Disable(); - } - - /// - /// The constructor for an Eload (Simulation). - /// - /// The channel number for the Eload. - /// The operation mode of the channel. Modes: Resistance, Voltage, Current. - /// The operation point of the load. This can be a voltage, current, or resistance. - /// Overcurrent setpoint that will turn off the channel if exceeded. - /// Overvoltage setpoint that will turn off channel if exceeded (double check). - public EloadSim(int channelNumber, EloadModuleMode mode, double setpointVal, double overCurrentProtection, double overVoltageProtection) - { - const double SETPOINT_VOLTAGE = 28.0; - _logger = LogManager.GetCurrentClassLogger(); - - _channelNumber = channelNumber; - _setpointVal = setpointVal; - _ini_setpointval = setpointVal; - _overCurrentProtection = overCurrentProtection; - _overVoltageProtection = overVoltageProtection; - _voltage = SETPOINT_VOLTAGE; - _mode = mode; - _originalMode = mode; - Disable(); - } - - /// - /// The finalizer. - /// - ~EloadSim() - { - Dispose(false); - } - - /// - /// Dispose of this object's resources. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Send a SCPI Command to the instrument and get a response. - /// - /// The command to send. - /// THe instrument response. - public string IOQuery(string commandString) - { - // just to provide a small delay 10ms for the sim - Thread.Sleep(10); - return "IOQuery Sim Response"; - } - - /// - /// Send a SCPI Command to the instrument. - /// - /// The command to be send. - public void IOWrite(string commandString) - { - // just to provide a small delay 10ms for the sim - Thread.Sleep(10); - } - - /// - /// Query if the Eload input is on (simulated). - /// - /// Status of Eload (simulated). True = On, False = Off. - public bool IsInputOn() - { - return _isOn; - } - - /// - /// Turns the Eload off (simulated). - /// - public void Enable() - { - _isOn = false; - } - - /// - /// Turns the Eload on (simulated). - /// - public void Disable() - { - _isOn = true; - } - - /// - /// Reads the current of the Eload. - /// - /// The current (simulated). - public Current ReadCurrent() - { - const double MIN_CURRENT = 1.0; - - // just to provide a small delay 10ms for the sim - Thread.Sleep(10); - - double currentToReturn = 0.0; - - if (_isOn) - { - double maxCurrent = _overCurrentProtection; - - Random rnd = new Random(); - - double seed = rnd.NextDouble(); - - currentToReturn = (seed * (maxCurrent - MIN_CURRENT)) + MIN_CURRENT; - } - - return Current.FromAmps(currentToReturn); - } - - /// - /// Reads the mode of the Eload. - /// - /// The mode (simulated). - public EloadModuleMode ReadMode() - { - return _mode; - } - - /// - /// Reads the overcurrent setting from an Eload. - /// - /// Overcurrent setting (simulated). - public Current ReadOverCurrentProtection() - { - // just to provide a small delay 10ms for the sim - Thread.Sleep(10); - - return Current.FromAmps(_overCurrentProtection); - } - - /// - /// Reads the overvoltage setting from an Eload. - /// - /// Overvoltage setting (simulated). - public Voltage ReadOverVoltageProtection() - { - // just to provide a small delay 10ms for the sim - Thread.Sleep(10); - - return Voltage.FromVolts(_overVoltageProtection); - } - - /// - /// Reads the resistance of the Eload. - /// - /// The resistance (simulated). - public Resistance ReadResistance() - { - // just to provide a small delay 10ms for the sim - Thread.Sleep(10); - - double resistanceToReturn = 0.0; - - if (_isOn) - { - double maxCurrent = _setpointVal + 1; - double minCurrent = _setpointVal - 1; - - Random rnd = new Random(); - - double seed = rnd.NextDouble(); - - resistanceToReturn = (seed * (maxCurrent - minCurrent)) + minCurrent; - } - - return Resistance.FromOhms(resistanceToReturn); - } - - /// - /// Reads the setpoint of the Eload. - /// - /// The setpoint (simulated). - public double ReadSetpoint() - { - return _setpointVal; - } - - /// - /// Reads the voltage of the Eload. - /// - /// The voltage (simulated). - public Voltage ReadVoltage() - { - // just to provide a small delay 10ms for the sim - Thread.Sleep(10); - - double voltageToReturn = 0.0; - - if (_isOn) - { - double maxVoltage = _voltage + 1; - double minVoltage = _voltage - 1; - - Random rnd = new Random(); - - double seed = rnd.NextDouble(); - - voltageToReturn = (seed * (maxVoltage - minVoltage)) + minVoltage; - } - - return Voltage.FromVolts(voltageToReturn); - } - - /// - /// Reads the protection status from an Eload. - /// - /// Protection status (simulated). - public ushort ReadProtectionStatus() - { - // just to provide a small delay 10ms for the sim - Thread.Sleep(10); - - // The sim never triggers the protection status - return 0; - } - - /// - /// Sets Initial Settings - /// - public void SetInitialSetting() - { - _mode = _originalMode; - _setpointVal = _ini_setpointval; - } - - /// - /// Change the operation mode of the Eload. - /// - /// The desired Eload mode. - public void SetMode(EloadModuleMode mode) - { - _mode = mode; - } - - /// - /// Change the setpoint of the Eload. - /// - /// The desired setpoint of the Eload. - public void SetSetpoint(double newSetpoint, EloadModuleMode mode) - { - if (mode != _mode) - { - throw new Exception("the current mode and the specified mode do not match. Current Mode: " + _mode.ToString() + ", specified mode: " + mode.ToString()); - } - - _setpointVal = newSetpoint; - } - - /// - /// Dispose of this object's resources. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - } - - public bool ClearErrors() - { - return true; - } - - public void Initialize() - { - SetInitialSetting(); - } - - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } - - public void Reset() - { - Disable(); - - Enable(); - } - - public void Shutdown() - { - Dispose(); - } - - #endregion - - } + /// + /// A simulated eload + /// + public class EloadSim : IEload + { + #region PrivateClassMembers + private readonly double _overCurrentProtection; + private readonly double _overVoltageProtection; + private double _setpointVal; + private double _ini_setpointval; + private double _voltage; + private readonly int _channelNumber; + private bool _isOn; + private EloadModuleMode _mode; + private EloadModuleMode _originalMode; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + public string DetailedStatus { get; protected set; } + + public bool DisplayEnabled { get; set; } + public bool FrontPanelEnabled { get; set; } + + public InstrumentMetadata Info { get; set; } + + public string Name { get; protected set; } + + public SelfTestResult SelfTestResult => PerformSelfTest(); + + public State Status { get; set; } + #endregion + + #region PublicFuctions + + /// + /// FlowMeterOmegaDPF20 factory constructor + /// + /// + /// + public EloadSim(string deviceName, IConfigurationManager configurationManager) + { + const double SETPOINT_VOLTAGE = 28.0; + + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _channelNumber = _configuration.GetConfigurationValue("EloadSim", "ChannelNumber", 0); + _mode = _configuration.GetConfigurationValue("EloadSim", "Mode", EloadModuleMode.CURRENT); + _setpointVal = _configuration.GetConfigurationValue("EloadSim", "SetpointVal", 0.0); + _ini_setpointval = _configuration.GetConfigurationValue("EloadSim", "IniSetpointVal", 0.0); + _overCurrentProtection = _configuration.GetConfigurationValue("EloadSim", "OverCurrentProtection", 0.0); + _overVoltageProtection = _configuration.GetConfigurationValue("EloadSim", "OverVoltageProtection", 0.0); + _voltage = SETPOINT_VOLTAGE; + _originalMode = _mode; + // make sure it is off + Disable(); + } + + /// + /// The constructor for an Eload (Simulation). + /// + /// The channel number for the Eload. + /// The operation mode of the channel. Modes: Resistance, Voltage, Current. + /// The operation point of the load. This can be a voltage, current, or resistance. + /// Overcurrent setpoint that will turn off the channel if exceeded. + /// Overvoltage setpoint that will turn off channel if exceeded (double check). + public EloadSim(int channelNumber, EloadModuleMode mode, double setpointVal, double overCurrentProtection, double overVoltageProtection) + { + const double SETPOINT_VOLTAGE = 28.0; + _logger = LogManager.GetCurrentClassLogger(); + + _channelNumber = channelNumber; + _setpointVal = setpointVal; + _ini_setpointval = setpointVal; + _overCurrentProtection = overCurrentProtection; + _overVoltageProtection = overVoltageProtection; + _voltage = SETPOINT_VOLTAGE; + _mode = mode; + _originalMode = mode; + Disable(); + } + + /// + /// The finalizer. + /// + ~EloadSim() + { + Dispose(false); + } + + /// + /// Dispose of this object's resources. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Send a SCPI Command to the instrument and get a response. + /// + /// The command to send. + /// THe instrument response. + public string IOQuery(string commandString) + { + // just to provide a small delay 10ms for the sim + Thread.Sleep(10); + return "IOQuery Sim Response"; + } + + /// + /// Send a SCPI Command to the instrument. + /// + /// The command to be send. + public void IOWrite(string commandString) + { + // just to provide a small delay 10ms for the sim + Thread.Sleep(10); + } + + /// + /// Query if the Eload input is on (simulated). + /// + /// Status of Eload (simulated). True = On, False = Off. + public bool IsInputOn() + { + return _isOn; + } + + /// + /// Turns the Eload off (simulated). + /// + public void Enable() + { + _isOn = false; + } + + /// + /// Turns the Eload on (simulated). + /// + public void Disable() + { + _isOn = true; + } + + /// + /// Reads the current of the Eload. + /// + /// The current (simulated). + public Current ReadCurrent() + { + const double MIN_CURRENT = 1.0; + + // just to provide a small delay 10ms for the sim + Thread.Sleep(10); + + double currentToReturn = 0.0; + + if (_isOn) + { + double maxCurrent = _overCurrentProtection; + + Random rnd = new Random(); + + double seed = rnd.NextDouble(); + + currentToReturn = (seed * (maxCurrent - MIN_CURRENT)) + MIN_CURRENT; + } + + return Current.FromAmps(currentToReturn); + } + + /// + /// Reads the mode of the Eload. + /// + /// The mode (simulated). + public EloadModuleMode ReadMode() + { + return _mode; + } + + /// + /// Reads the overcurrent setting from an Eload. + /// + /// Overcurrent setting (simulated). + public Current ReadOverCurrentProtection() + { + // just to provide a small delay 10ms for the sim + Thread.Sleep(10); + + return Current.FromAmps(_overCurrentProtection); + } + + /// + /// Reads the overvoltage setting from an Eload. + /// + /// Overvoltage setting (simulated). + public Voltage ReadOverVoltageProtection() + { + // just to provide a small delay 10ms for the sim + Thread.Sleep(10); + + return Voltage.FromVolts(_overVoltageProtection); + } + + /// + /// Reads the resistance of the Eload. + /// + /// The resistance (simulated). + public Resistance ReadResistance() + { + // just to provide a small delay 10ms for the sim + Thread.Sleep(10); + + double resistanceToReturn = 0.0; + + if (_isOn) + { + double maxCurrent = _setpointVal + 1; + double minCurrent = _setpointVal - 1; + + Random rnd = new Random(); + + double seed = rnd.NextDouble(); + + resistanceToReturn = (seed * (maxCurrent - minCurrent)) + minCurrent; + } + + return Resistance.FromOhms(resistanceToReturn); + } + + /// + /// Reads the setpoint of the Eload. + /// + /// The setpoint (simulated). + public double ReadSetpoint() + { + return _setpointVal; + } + + /// + /// Reads the voltage of the Eload. + /// + /// The voltage (simulated). + public Voltage ReadVoltage() + { + // just to provide a small delay 10ms for the sim + Thread.Sleep(10); + + double voltageToReturn = 0.0; + + if (_isOn) + { + double maxVoltage = _voltage + 1; + double minVoltage = _voltage - 1; + + Random rnd = new Random(); + + double seed = rnd.NextDouble(); + + voltageToReturn = (seed * (maxVoltage - minVoltage)) + minVoltage; + } + + return Voltage.FromVolts(voltageToReturn); + } + + /// + /// Reads the protection status from an Eload. + /// + /// Protection status (simulated). + public ushort ReadProtectionStatus() + { + // just to provide a small delay 10ms for the sim + Thread.Sleep(10); + + // The sim never triggers the protection status + return 0; + } + + /// + /// Sets Initial Settings + /// + public void SetInitialSetting() + { + _mode = _originalMode; + _setpointVal = _ini_setpointval; + } + + /// + /// Change the operation mode of the Eload. + /// + /// The desired Eload mode. + public void SetMode(EloadModuleMode mode) + { + _mode = mode; + } + + /// + /// Change the setpoint of the Eload. + /// + /// The desired setpoint of the Eload. + public void SetSetpoint(double newSetpoint, EloadModuleMode mode) + { + if (mode != _mode) + { + throw new Exception("the current mode and the specified mode do not match. Current Mode: " + _mode.ToString() + ", specified mode: " + mode.ToString()); + } + + _setpointVal = newSetpoint; + } + + /// + /// Dispose of this object's resources. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + } + + public bool ClearErrors() + { + return true; + } + + public void Initialize() + { + SetInitialSetting(); + } + + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } + + public void Reset() + { + Disable(); + + Enable(); + } + + public void Shutdown() + { + Dispose(); + } + + #endregion + + } } diff --git a/Source/TSRealLib/HAL/Implementations/ELoad/ELoadSim/ELoadSimFactory.cs b/Source/TSRealLib/HAL/Implementations/ELoad/ELoadSim/ELoadSimFactory.cs index daf6f59..5110bc2 100644 --- a/Source/TSRealLib/HAL/Implementations/ELoad/ELoadSim/ELoadSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/ELoad/ELoadSim/ELoadSimFactory.cs @@ -30,71 +30,67 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "ELoadSimFactory")] - public class ELoadSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "ELoadSimFactory")] + public class ELoadSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public ELoadSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public ELoadSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public ELoadSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// ELoadSimFactory injection constructor + /// + /// + /// + /// + [ImportingConstructor] + public ELoadSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IEload)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new EloadSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IEload)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new EloadSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +101,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new EloadSim(name, _configurationManager, _logger); + return new EloadSim(name, _configurationManager); } catch (Exception) { @@ -120,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/ELoad/EloadSystemScpiKeysight/EloadSystemScpiKeysight.cs b/Source/TSRealLib/HAL/Implementations/ELoad/EloadSystemScpiKeysight/EloadSystemScpiKeysight.cs index 08f8520..def2a1b 100644 --- a/Source/TSRealLib/HAL/Implementations/ELoad/EloadSystemScpiKeysight/EloadSystemScpiKeysight.cs +++ b/Source/TSRealLib/HAL/Implementations/ELoad/EloadSystemScpiKeysight/EloadSystemScpiKeysight.cs @@ -15,959 +15,927 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO.Ports; using NationalInstruments.NI4882; using NLog; using Raytheon.Common; using Raytheon.Units; -using System; -using System.Collections.Generic; -using System.IO.Ports; namespace Raytheon.Instruments { - /// - /// This class interfaces to a Keysight N3300 Eload system - /// - public class EloadSystemScpiKeysight : IELoadSystem - { - - #region PrivateClassMembers - - private enum ControlInterface - { - COM_PORT, - GPIB - } - - // system commands - private const string _CLEAREVENTREG = "*CLS"; - private const string _CLEARSERVICEREQUEST = "*SRE 0"; - private const string _CLEAREVENTSTATUSENABLEREGISTER = "*ESE 0"; - private const string _ERRORCODE = "SYST:ERR?"; - private const string _RESET = "*RST"; - private const string _SELFTEST = "*TST?"; - - private string _systemName; - private SerialPort _serialPort; - private Device _gpibDevice; - private ControlInterface _interface; - private readonly SortedDictionary _eloadChannelMap; - private readonly bool _isThereHardware; - private static object _syncObj = new Object(); - // default the timeout for responses to 5 seconds - private const int _READ_TIMEOUT = 5000; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - public string DetailedStatus { get; protected set; } - - public bool DisplayEnabled { get; set; } - public bool FrontPanelEnabled { get; set; } - - public InstrumentMetadata Info { get; set; } - - public string Name { get; protected set; } - - public SelfTestResult SelfTestResult => PerformSelfTest(); - - public State Status { get; set; } - - #endregion - - #region PrivateFuctions - - /// - /// Send a SCPI Command to the instrument and get a response. - /// - /// The command to send. - /// The instrument response. - private string IOQuery(string commandString) - { - // not calling IOWrite() so IOWrite() can check for errors after each write - - string rsp = ""; - - if (_interface == ControlInterface.COM_PORT) - { - _serialPort.WriteLine(commandString); - rsp = _serialPort.ReadLine(); - } - else if (_interface == ControlInterface.GPIB) - { - _gpibDevice.Write(commandString); - rsp = _gpibDevice.ReadString(); - } - else - { - throw new Exception("unknown interface type: " + _interface.ToString()); - } - - rsp = rsp.Replace("\r", ""); - - // check for errors - int err = 0; - string errorMsg = GetErrorCode(out err); - if (err != 0) - { - throw new Exception(errorMsg); - } - - return rsp; - } - - /// - /// Sends a SCPI Command to the instrument. - /// - /// The command to send. - private void IOWrite(string commandString) - { - if (_interface == ControlInterface.COM_PORT) - { - _serialPort.WriteLine(commandString); - } - else if (_interface == ControlInterface.GPIB) - { - _gpibDevice.Write(commandString); - } - else - { - throw new Exception("unknown interface type: " + _interface.ToString()); - } - - int err = 0; - string errorMsg = GetErrorCode(out err); - if (err != 0) - { - throw new Exception(errorMsg); - } - } - - /// - /// Resets the instrument and clears event registers, error queue, - /// service request enable register, and event status enable register. - /// - private void Reset() - { - IOWrite(_RESET); - - IOWrite(_CLEAREVENTREG); - - IOWrite(_CLEARSERVICEREQUEST); - - IOWrite(_CLEAREVENTSTATUSENABLEREGISTER); - } - - #endregion - - #region PublicFuctions - - /// - /// FlowMeterOmegaDPF20 factory constructor - /// - /// - /// - public EloadSystemScpiKeysight(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _gpibDevice = null; - _serialPort = _configuration.GetConfigurationValue("ELoadScpiKeysight", "SerialPort", new SerialPort()); - var flowControl = _configuration.GetConfigurationValue("ELoadScpiKeysight", "FlowControl", Handshake.None); - - try - { - _interface = ControlInterface.COM_PORT; - - _systemName = Name; - - _serialPort.Open(); - - _serialPort.ReadTimeout = _READ_TIMEOUT; - _serialPort.Handshake = flowControl; - - Reset(); - - _eloadChannelMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); - } - catch (Exception) - { - if (_serialPort.IsOpen == true) - { - _serialPort.Close(); - } - - throw; - } - - } - - - /// - /// The constructor for com port interface which open up the comm port, resets the system and waits for additional commands - /// - /// The COM port name as it exists in windows device manager. - /// The bit rate of the host computer COM port. - /// The parity setting of the host computer. 0 = None, 1 = Odd, 2 = Even, 3 = Mark, 4 = Space. - /// The number of bits of data sent per transfer. - /// The number of stop bits used by host computer. - /// Handshake method. 0 = None, 1 = XonXoff, 2 = RTS, 3 = RTSXonXoff. - /// Software operation mode. True = Hardware available, False = Simulation Only. - public EloadSystemScpiKeysight(string systemName, string comPortName, int baudRate, Parity parity, int dataBits, StopBits stopBits, Handshake flowControl, bool isThereHardware) - { - try - { - _logger = LogManager.GetCurrentClassLogger(); - - _interface = ControlInterface.COM_PORT; - - _systemName = systemName; - - _isThereHardware = isThereHardware; - - _serialPort = null; - _gpibDevice = null; - - if (_isThereHardware == true) - { - _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); - - _serialPort.Open(); - - _serialPort.ReadTimeout = _READ_TIMEOUT; - _serialPort.Handshake = flowControl; - - Reset(); - } - - _eloadChannelMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); - } - catch (Exception ex) - { - if (_serialPort.IsOpen == true) - { - _serialPort.Close(); - } - _logger.Error(ex.Message); - throw; - } - } - - /// - /// The constructor for gpib interface which open up the comm port, resets the system and waits for additional commands - /// - /// - /// - /// - /// - public EloadSystemScpiKeysight(string systemName, int boardNumber, byte primaryAddress, bool isThereHardware) - { - try - { - _interface = ControlInterface.GPIB; - - _systemName = systemName; - - _isThereHardware = isThereHardware; - - _serialPort = null; - _gpibDevice = null; - - if (_isThereHardware == true) - { - _gpibDevice = new Device(boardNumber, primaryAddress); - - //@@@ TBD if this make the newline go out after each write - _gpibDevice.EndOfStringCharacter = 0xa; - - _gpibDevice.IOTimeout = TimeoutValue.T3s; - - Reset(); - } - - _eloadChannelMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); - } - catch (Exception) - { - if (_gpibDevice != null) - { - _gpibDevice.Dispose(); - _gpibDevice = null; - } - - throw; - } - } - - /// - /// The finalizer - /// - ~EloadSystemScpiKeysight() - { - Dispose(false); - } - - /// - /// Add an Eload to the system. - /// - /// The name of the channel (module) for reference. - /// The channel number for the Eload.. - /// The operation mode of the channel. Modes: Resistance, Voltage, Current. - /// The operation point of the load. This can be a voltage, current, or resistance - /// Overcurrent setpoint that will turn off the channel if exceeded. - /// Overvoltage setpoint that will turn off channel if exceeded (double check). - public void AddEloadChannel(string name, int channelNumber, EloadModuleMode mode, double setpoint, Current overCurrentProtection, Voltage overVoltageProtection) - { - try - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(name.ToUpper()) == true) - { - throw new Exception("system already contains a module named: " + name.ToUpper()); - } - - IEload eload; - - if (_isThereHardware) - { - if (_interface == ControlInterface.COM_PORT) - { - eload = new ELoadScpiKeysight(_serialPort, channelNumber, mode, setpoint, overCurrentProtection.Amps, overVoltageProtection.Volts); - } - else if (_interface == ControlInterface.GPIB) - { - eload = new ELoadScpiKeysight(_gpibDevice, channelNumber, mode, setpoint, overCurrentProtection.Amps, overVoltageProtection.Volts); - } - else - { - throw new Exception("unknown interface: " + _interface.ToString()); - } - } - else - { - eload = new EloadSim(channelNumber, mode, setpoint, overCurrentProtection.Amps, overVoltageProtection.Volts); - } - - _eloadChannelMap.Add(name.ToUpper(), eload); - } - } - catch (Exception) - { - if (_interface == ControlInterface.COM_PORT) - { - _serialPort.Close(); - } - else if (_interface == ControlInterface.GPIB) - { - _gpibDevice.Dispose(); - _gpibDevice = null; - } - - throw; - } - } - - /// - /// Dispose of this object's resources. - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// Get the error code. - /// - /// The error code. - public string GetErrorCode(out int errorCode) - { - lock (_syncObj) - { - if (_isThereHardware == true) - { - // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query - - string rsp = ""; - - if (_interface == ControlInterface.COM_PORT) - { - _serialPort.WriteLine(_ERRORCODE); - rsp = _serialPort.ReadLine(); - } - else if (_interface == ControlInterface.GPIB) - { - _gpibDevice.Write(_ERRORCODE); - rsp = _gpibDevice.ReadString(); - } - else - { - throw new Exception("unknown interface type: " + _interface.ToString()); - } - - rsp = rsp.Replace("\r", ""); - - string[] tokens = rsp.Split(','); - - errorCode = Util.ConvertStringToInt32(tokens[0]); - - // it should always be 2 - if (tokens.Length >= 2) - { - return tokens[1]; - } - else - { - return ""; - } - } - else - { - errorCode = 0; - - return ""; - } - } - } - - /// - /// - /// - /// - public List GetModuleNames() - { - lock (_syncObj) - { - List moduleNames = new List(); - - foreach (KeyValuePair modules in _eloadChannelMap) - { - moduleNames.Add(modules.Key); - } - - return moduleNames; - } - } - - /// - /// - /// - /// - public string GetSystemName() - { - lock (_syncObj) - { - return _systemName; - } - } - - /// - /// Query if the Eload input is on. - /// - /// The name of the Eload. - /// Status of Eload. True = On, False = Off. - public bool IsInputOn(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - bool status = _eloadChannelMap[channelName.ToUpper()].IsInputOn(); - - return status; - } - } - - /// - /// Turn off the Eload input. - /// - /// The name of the Eload. - public void Disable(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - _eloadChannelMap[channelName.ToUpper()].Disable(); - } - } - - /// - /// Turn on the Eload input. - /// - /// The name of the Eload. - public void Enable(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - _eloadChannelMap[channelName.ToUpper()].Enable(); - } - } - - /// - /// - /// - /// - /// - /// - public string IOQuery(string channelName, string command) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - return _eloadChannelMap[channelName.ToUpper()].IOQuery(command); - } - } - - /// - /// - /// - /// - /// - public void IOWrite(string channelName, string command) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - _eloadChannelMap[channelName.ToUpper()].IOWrite(command); - } - } - - - /// - /// Reads the current of the Eload. - /// - /// The name of the Eload. - /// Measured current (Amps). - public Current ReadCurrent(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - var value = _eloadChannelMap[channelName.ToUpper()].ReadCurrent(); - - return value; - } - } - - /// - /// Reads all Eload data (voltage, current, resistance, setpoint, input state, mode). - /// - /// The name of the Eload. - /// The measured voltage (Volts). - /// The measured current (Amps). - /// The measured resistance (Ohms). - /// The setpoint of the Eload. Depends on mode of operation. - /// The state of the Eload. - /// The mode of the Eload. - public void ReadData(string channelName, out Voltage voltage, out Current current, out Resistance resistance, out double setpoint, out bool isInputOn, out EloadModuleMode mode, out ushort status) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - voltage = _eloadChannelMap[channelName.ToUpper()].ReadVoltage(); - - current = _eloadChannelMap[channelName.ToUpper()].ReadCurrent(); - - resistance = _eloadChannelMap[channelName.ToUpper()].ReadResistance(); - - setpoint = _eloadChannelMap[channelName.ToUpper()].ReadSetpoint(); - - isInputOn = _eloadChannelMap[channelName.ToUpper()].IsInputOn(); - - mode = _eloadChannelMap[channelName.ToUpper()].ReadMode(); - - status = _eloadChannelMap[channelName.ToUpper()].ReadProtectionStatus(); - } - } - - /// - /// Reads the mode of the Eload - /// - /// The name of the Eload. - /// The mode - public EloadModuleMode ReadMode(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - EloadModuleMode value = _eloadChannelMap[channelName.ToUpper()].ReadMode(); - - return value; - } - } - - /// - /// Reads the overcurrent setting from an Eload. - /// - /// The name of the Eload. - /// Overcurrent setting (Amps). - public Current ReadOverCurrentProtection(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - var value = _eloadChannelMap[channelName.ToUpper()].ReadOverCurrentProtection(); - - return value; - } - } - - /// - /// Reads the overvoltage setting from an Eload. - /// - /// The name of the Eload. - /// Overvoltage setting (Volts). - public Voltage ReadOverVoltageProtection(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - var value = _eloadChannelMap[channelName.ToUpper()].ReadOverVoltageProtection(); - - return value; - } - } - - /// - /// Read the resistance. - /// - /// The name of the Eload. - /// The resistance (Ohms). - public Resistance ReadResistance(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - var value = _eloadChannelMap[channelName.ToUpper()].ReadResistance(); - - return value; - } - } - - /// - /// Reads the setpoint of the Eload. - /// - /// The name of the Eload. - /// The setpoint. Depends on mode. - public double ReadSetpoint(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - return _eloadChannelMap[channelName.ToUpper()].ReadSetpoint(); - } - } - - /// - /// Reads the voltage of the Eload. - /// - /// The name of the Eload. - /// The voltage (Volts) - public Voltage ReadVoltage(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - var value = _eloadChannelMap[channelName.ToUpper()].ReadVoltage(); - - return value; - } - } - - /// - /// Reads the protection status from an Eload. - /// - /// The name of the Eload. - /// Protection status register. - public ushort ReadProtectionStatus(string channelName) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - ushort value = _eloadChannelMap[channelName.ToUpper()].ReadProtectionStatus(); - - return value; - } - } - - /// - /// Run a self-test. - /// - public void Selftest() - { - try - { - // change the timeout to account for the long self test to 30 seconds - if (_interface == ControlInterface.COM_PORT) - { - //@@@ is this the right time? - _serialPort.ReadTimeout = 30000; - } - else if (_interface == ControlInterface.GPIB) - { - //@@@ TBD - } - else - { - throw new Exception("unknown interface type: " + _interface.ToString()); - } - - // send the command - string rspStr = IOQuery(_SELFTEST); - - // parse the response - string[] tokens = rspStr.Split('\n'); - - int rsp = Util.ConvertStringToInt32(tokens[0]); - - if (rsp != 0) - { - string errorMsg = "returned an error: " + rsp.ToString(); - throw new Exception(errorMsg); - } - } - catch (Exception) - { - throw; - } - finally - { - // restore the timeout - if (_interface == ControlInterface.COM_PORT) - { - _serialPort.ReadTimeout = _READ_TIMEOUT; - } - else if (_interface == ControlInterface.GPIB) - { - //@@@ TBD - } - else - { - throw new Exception("unknown interface type: " + _interface.ToString()); - } - } - } - - /// - /// Resets all channels to config file values - /// - public void SetInitialSetting(string module) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(module.ToUpper()) == false) - { - throw new Exception("could not find load: " + module.ToUpper()); - } - - _eloadChannelMap[module.ToUpper()].SetInitialSetting(); - } - } - - /// - /// Resets all channels to config file values - /// - public void SetInitialSettingAll() - { - lock (_syncObj) - { - foreach (KeyValuePair eload in _eloadChannelMap) - { - _eloadChannelMap[eload.Key].SetInitialSetting(); - } - } - } - - /// - /// Change the operation mode of the Eload. - /// - /// The name of the Eload. - /// The desired Eload mode. - public void SetMode(string channelName, EloadModuleMode mode) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - _eloadChannelMap[channelName.ToUpper()].SetMode(mode); - } - } - - /// - /// Change the setpoint and operation mode of the Eload. - /// - /// The name of the Eload. - /// The desired setpoint of the Eload. - /// The desired Eload mode. - public void SetSetpoint(string channelName, double newSetpoint, EloadModuleMode mode) - { - lock (_syncObj) - { - if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) - { - throw new Exception("could not find module: " + channelName.ToUpper()); - } - - _eloadChannelMap[channelName.ToUpper()].SetSetpoint(newSetpoint, mode); - } - } - - /// - /// Dispose of this objects resources - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - lock (_syncObj) - { - if (disposing) - { - foreach (KeyValuePair entry in _eloadChannelMap) - { - entry.Value.Shutdown(); - } - - if (_serialPort != null) - { - Reset(); - _serialPort.Dispose(); - _serialPort = null; - } - - if (_gpibDevice != null) - { - Reset(); - _gpibDevice.Dispose(); - _gpibDevice = null; - } - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - public bool ClearErrors() - { - throw new NotImplementedException(); - } - - public void Initialize() - { - throw new NotImplementedException(); - } - - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } - - void IInstrument.Reset() - { - throw new NotImplementedException(); - } - - public void Shutdown() - { - throw new NotImplementedException(); - } - #endregion - } + /// + /// This class interfaces to a Keysight N3300 Eload system + /// + public class EloadSystemScpiKeysight : IELoadSystem + { + + #region PrivateClassMembers + + private enum ControlInterface + { + COM_PORT, + GPIB + } + + // system commands + private const string _CLEAREVENTREG = "*CLS"; + private const string _CLEARSERVICEREQUEST = "*SRE 0"; + private const string _CLEAREVENTSTATUSENABLEREGISTER = "*ESE 0"; + private const string _ERRORCODE = "SYST:ERR?"; + private const string _RESET = "*RST"; + private const string _SELFTEST = "*TST?"; + + private string _systemName; + private SerialPort _serialPort; + private Device _gpibDevice; + private ControlInterface _interface; + private readonly SortedDictionary _eloadChannelMap; + private readonly bool _isThereHardware; + private static object _syncObj = new Object(); + // default the timeout for responses to 5 seconds + private const int _READ_TIMEOUT = 5000; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + public string DetailedStatus { get; protected set; } + + public bool DisplayEnabled { get; set; } + public bool FrontPanelEnabled { get; set; } + + public InstrumentMetadata Info { get; set; } + + public string Name { get; protected set; } + + public SelfTestResult SelfTestResult => PerformSelfTest(); + + public State Status { get; set; } + + #endregion + + #region PrivateFuctions + + /// + /// Send a SCPI Command to the instrument and get a response. + /// + /// The command to send. + /// The instrument response. + private string IOQuery(string commandString) + { + // not calling IOWrite() so IOWrite() can check for errors after each write + + string rsp = ""; + + if (_interface == ControlInterface.COM_PORT) + { + _serialPort.WriteLine(commandString); + rsp = _serialPort.ReadLine(); + } + else if (_interface == ControlInterface.GPIB) + { + _gpibDevice.Write(commandString); + rsp = _gpibDevice.ReadString(); + } + else + { + throw new Exception("unknown interface type: " + _interface.ToString()); + } + + rsp = rsp.Replace("\r", ""); + + // check for errors + int err = 0; + string errorMsg = GetErrorCode(out err); + if (err != 0) + { + throw new Exception(errorMsg); + } + + return rsp; + } + + /// + /// Sends a SCPI Command to the instrument. + /// + /// The command to send. + private void IOWrite(string commandString) + { + if (_interface == ControlInterface.COM_PORT) + { + _serialPort.WriteLine(commandString); + } + else if (_interface == ControlInterface.GPIB) + { + _gpibDevice.Write(commandString); + } + else + { + throw new Exception("unknown interface type: " + _interface.ToString()); + } + + int err = 0; + string errorMsg = GetErrorCode(out err); + if (err != 0) + { + throw new Exception(errorMsg); + } + } + + /// + /// Resets the instrument and clears event registers, error queue, + /// service request enable register, and event status enable register. + /// + private void Reset() + { + IOWrite(_RESET); + + IOWrite(_CLEAREVENTREG); + + IOWrite(_CLEARSERVICEREQUEST); + + IOWrite(_CLEAREVENTSTATUSENABLEREGISTER); + } + + #endregion + + #region PublicFuctions + + /// + /// FlowMeterOmegaDPF20 factory constructor + /// + /// + /// + public EloadSystemScpiKeysight(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _gpibDevice = null; + _serialPort = _configuration.GetConfigurationValue("ELoadScpiKeysight", "SerialPort", new SerialPort()); + var flowControl = _configuration.GetConfigurationValue("ELoadScpiKeysight", "FlowControl", Handshake.None); + + try + { + _interface = ControlInterface.COM_PORT; + + _systemName = Name; + + _serialPort.Open(); + + _serialPort.ReadTimeout = _READ_TIMEOUT; + _serialPort.Handshake = flowControl; + + Reset(); + + _eloadChannelMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); + } + catch (Exception) + { + if (_serialPort.IsOpen == true) + { + _serialPort.Close(); + } + + throw; + } + + } + + + /// + /// The constructor for com port interface which open up the comm port, resets the system and waits for additional commands + /// + /// The COM port name as it exists in windows device manager. + /// The bit rate of the host computer COM port. + /// The parity setting of the host computer. 0 = None, 1 = Odd, 2 = Even, 3 = Mark, 4 = Space. + /// The number of bits of data sent per transfer. + /// The number of stop bits used by host computer. + /// Handshake method. 0 = None, 1 = XonXoff, 2 = RTS, 3 = RTSXonXoff. + /// Software operation mode. True = Hardware available, False = Simulation Only. + public EloadSystemScpiKeysight(string systemName, string comPortName, int baudRate, Parity parity, int dataBits, StopBits stopBits, Handshake flowControl, bool isThereHardware) + { + try + { + _logger = LogManager.GetCurrentClassLogger(); + + _interface = ControlInterface.COM_PORT; + + _systemName = systemName; + + _isThereHardware = isThereHardware; + + _serialPort = null; + _gpibDevice = null; + + if (_isThereHardware == true) + { + _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); + + _serialPort.Open(); + + _serialPort.ReadTimeout = _READ_TIMEOUT; + _serialPort.Handshake = flowControl; + + Reset(); + } + + _eloadChannelMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); + } + catch (Exception ex) + { + if (_serialPort.IsOpen == true) + { + _serialPort.Close(); + } + _logger.Error(ex.Message); + throw; + } + } + + /// + /// The constructor for gpib interface which open up the comm port, resets the system and waits for additional commands + /// + /// + /// + /// + /// + public EloadSystemScpiKeysight(string systemName, int boardNumber, byte primaryAddress, bool isThereHardware) + { + try + { + _interface = ControlInterface.GPIB; + + _systemName = systemName; + + _isThereHardware = isThereHardware; + + _serialPort = null; + _gpibDevice = null; + + if (_isThereHardware == true) + { + _gpibDevice = new Device(boardNumber, primaryAddress); + + //@@@ TBD if this make the newline go out after each write + _gpibDevice.EndOfStringCharacter = 0xa; + + _gpibDevice.IOTimeout = TimeoutValue.T3s; + + Reset(); + } + + _eloadChannelMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); + } + catch (Exception) + { + if (_gpibDevice != null) + { + _gpibDevice.Dispose(); + _gpibDevice = null; + } + + throw; + } + } + + /// + /// The finalizer + /// + ~EloadSystemScpiKeysight() + { + Dispose(false); + } + + /// + /// Add an Eload to the system. + /// + /// The name of the channel (module) for reference. + /// The channel number for the Eload.. + /// The operation mode of the channel. Modes: Resistance, Voltage, Current. + /// The operation point of the load. This can be a voltage, current, or resistance + /// Overcurrent setpoint that will turn off the channel if exceeded. + /// Overvoltage setpoint that will turn off channel if exceeded (double check). + public void AddEloadChannel(string name, int channelNumber, EloadModuleMode mode, double setpoint, Current overCurrentProtection, Voltage overVoltageProtection) + { + try + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(name.ToUpper()) == true) + { + throw new Exception("system already contains a module named: " + name.ToUpper()); + } + + IEload eload; + + if (_isThereHardware) + { + if (_interface == ControlInterface.COM_PORT) + { + eload = new ELoadScpiKeysight(_serialPort, channelNumber, mode, setpoint, overCurrentProtection.Amps, overVoltageProtection.Volts); + } + else if (_interface == ControlInterface.GPIB) + { + eload = new ELoadScpiKeysight(_gpibDevice, channelNumber, mode, setpoint, overCurrentProtection.Amps, overVoltageProtection.Volts); + } + else + { + throw new Exception("unknown interface: " + _interface.ToString()); + } + } + else + { + eload = new EloadSim(channelNumber, mode, setpoint, overCurrentProtection.Amps, overVoltageProtection.Volts); + } + + _eloadChannelMap.Add(name.ToUpper(), eload); + } + } + catch (Exception) + { + if (_interface == ControlInterface.COM_PORT) + { + _serialPort.Close(); + } + else if (_interface == ControlInterface.GPIB) + { + _gpibDevice.Dispose(); + _gpibDevice = null; + } + + throw; + } + } + + /// + /// Dispose of this object's resources. + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// Get the error code. + /// + /// The error code. + public string GetErrorCode(out int errorCode) + { + lock (_syncObj) + { + if (_isThereHardware == true) + { + // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query + + string rsp = ""; + + if (_interface == ControlInterface.COM_PORT) + { + _serialPort.WriteLine(_ERRORCODE); + rsp = _serialPort.ReadLine(); + } + else if (_interface == ControlInterface.GPIB) + { + _gpibDevice.Write(_ERRORCODE); + rsp = _gpibDevice.ReadString(); + } + else + { + throw new Exception("unknown interface type: " + _interface.ToString()); + } + + rsp = rsp.Replace("\r", ""); + + string[] tokens = rsp.Split(','); + + errorCode = Util.ConvertStringToInt32(tokens[0]); + + // it should always be 2 + if (tokens.Length >= 2) + { + return tokens[1]; + } + else + { + return ""; + } + } + else + { + errorCode = 0; + + return ""; + } + } + } + + /// + /// + /// + /// + public List GetModuleNames() + { + lock (_syncObj) + { + List moduleNames = new List(); + + foreach (KeyValuePair modules in _eloadChannelMap) + { + moduleNames.Add(modules.Key); + } + + return moduleNames; + } + } + + /// + /// + /// + /// + public string GetSystemName() + { + lock (_syncObj) + { + return _systemName; + } + } + + /// + /// Query if the Eload input is on. + /// + /// The name of the Eload. + /// Status of Eload. True = On, False = Off. + public bool IsInputOn(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + bool status = _eloadChannelMap[channelName.ToUpper()].IsInputOn(); + + return status; + } + } + + /// + /// Turn off the Eload input. + /// + /// The name of the Eload. + public void Disable(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + _eloadChannelMap[channelName.ToUpper()].Disable(); + } + } + + /// + /// Turn on the Eload input. + /// + /// The name of the Eload. + public void Enable(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + _eloadChannelMap[channelName.ToUpper()].Enable(); + } + } + + /// + /// + /// + /// + /// + /// + public string IOQuery(string channelName, string command) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + return _eloadChannelMap[channelName.ToUpper()].IOQuery(command); + } + } + + /// + /// + /// + /// + /// + public void IOWrite(string channelName, string command) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + _eloadChannelMap[channelName.ToUpper()].IOWrite(command); + } + } + + + /// + /// Reads the current of the Eload. + /// + /// The name of the Eload. + /// Measured current (Amps). + public Current ReadCurrent(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + var value = _eloadChannelMap[channelName.ToUpper()].ReadCurrent(); + + return value; + } + } + + /// + /// Reads all Eload data (voltage, current, resistance, setpoint, input state, mode). + /// + /// The name of the Eload. + /// The measured voltage (Volts). + /// The measured current (Amps). + /// The measured resistance (Ohms). + /// The setpoint of the Eload. Depends on mode of operation. + /// The state of the Eload. + /// The mode of the Eload. + public void ReadData(string channelName, out Voltage voltage, out Current current, out Resistance resistance, out double setpoint, out bool isInputOn, out EloadModuleMode mode, out ushort status) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + voltage = _eloadChannelMap[channelName.ToUpper()].ReadVoltage(); + + current = _eloadChannelMap[channelName.ToUpper()].ReadCurrent(); + + resistance = _eloadChannelMap[channelName.ToUpper()].ReadResistance(); + + setpoint = _eloadChannelMap[channelName.ToUpper()].ReadSetpoint(); + + isInputOn = _eloadChannelMap[channelName.ToUpper()].IsInputOn(); + + mode = _eloadChannelMap[channelName.ToUpper()].ReadMode(); + + status = _eloadChannelMap[channelName.ToUpper()].ReadProtectionStatus(); + } + } + + /// + /// Reads the mode of the Eload + /// + /// The name of the Eload. + /// The mode + public EloadModuleMode ReadMode(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + EloadModuleMode value = _eloadChannelMap[channelName.ToUpper()].ReadMode(); + + return value; + } + } + + /// + /// Reads the overcurrent setting from an Eload. + /// + /// The name of the Eload. + /// Overcurrent setting (Amps). + public Current ReadOverCurrentProtection(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + var value = _eloadChannelMap[channelName.ToUpper()].ReadOverCurrentProtection(); + + return value; + } + } + + /// + /// Reads the overvoltage setting from an Eload. + /// + /// The name of the Eload. + /// Overvoltage setting (Volts). + public Voltage ReadOverVoltageProtection(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + var value = _eloadChannelMap[channelName.ToUpper()].ReadOverVoltageProtection(); + + return value; + } + } + + /// + /// Read the resistance. + /// + /// The name of the Eload. + /// The resistance (Ohms). + public Resistance ReadResistance(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + var value = _eloadChannelMap[channelName.ToUpper()].ReadResistance(); + + return value; + } + } + + /// + /// Reads the setpoint of the Eload. + /// + /// The name of the Eload. + /// The setpoint. Depends on mode. + public double ReadSetpoint(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + return _eloadChannelMap[channelName.ToUpper()].ReadSetpoint(); + } + } + + /// + /// Reads the voltage of the Eload. + /// + /// The name of the Eload. + /// The voltage (Volts) + public Voltage ReadVoltage(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + var value = _eloadChannelMap[channelName.ToUpper()].ReadVoltage(); + + return value; + } + } + + /// + /// Reads the protection status from an Eload. + /// + /// The name of the Eload. + /// Protection status register. + public ushort ReadProtectionStatus(string channelName) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + ushort value = _eloadChannelMap[channelName.ToUpper()].ReadProtectionStatus(); + + return value; + } + } + + /// + /// Run a self-test. + /// + public void Selftest() + { + try + { + // change the timeout to account for the long self test to 30 seconds + if (_interface == ControlInterface.COM_PORT) + { + //@@@ is this the right time? + _serialPort.ReadTimeout = 30000; + } + else if (_interface == ControlInterface.GPIB) + { + //@@@ TBD + } + else + { + throw new Exception("unknown interface type: " + _interface.ToString()); + } + + // send the command + string rspStr = IOQuery(_SELFTEST); + + // parse the response + string[] tokens = rspStr.Split('\n'); + + int rsp = Util.ConvertStringToInt32(tokens[0]); + + if (rsp != 0) + { + string errorMsg = "returned an error: " + rsp.ToString(); + throw new Exception(errorMsg); + } + } + catch (Exception) + { + throw; + } + finally + { + // restore the timeout + if (_interface == ControlInterface.COM_PORT) + { + _serialPort.ReadTimeout = _READ_TIMEOUT; + } + else if (_interface == ControlInterface.GPIB) + { + //@@@ TBD + } + else + { + throw new Exception("unknown interface type: " + _interface.ToString()); + } + } + } + + /// + /// Resets all channels to config file values + /// + public void SetInitialSetting(string module) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(module.ToUpper()) == false) + { + throw new Exception("could not find load: " + module.ToUpper()); + } + + _eloadChannelMap[module.ToUpper()].SetInitialSetting(); + } + } + + /// + /// Resets all channels to config file values + /// + public void SetInitialSettingAll() + { + lock (_syncObj) + { + foreach (KeyValuePair eload in _eloadChannelMap) + { + _eloadChannelMap[eload.Key].SetInitialSetting(); + } + } + } + + /// + /// Change the operation mode of the Eload. + /// + /// The name of the Eload. + /// The desired Eload mode. + public void SetMode(string channelName, EloadModuleMode mode) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + _eloadChannelMap[channelName.ToUpper()].SetMode(mode); + } + } + + /// + /// Change the setpoint and operation mode of the Eload. + /// + /// The name of the Eload. + /// The desired setpoint of the Eload. + /// The desired Eload mode. + public void SetSetpoint(string channelName, double newSetpoint, EloadModuleMode mode) + { + lock (_syncObj) + { + if (_eloadChannelMap.ContainsKey(channelName.ToUpper()) == false) + { + throw new Exception("could not find module: " + channelName.ToUpper()); + } + + _eloadChannelMap[channelName.ToUpper()].SetSetpoint(newSetpoint, mode); + } + } + + /// + /// Dispose of this objects resources + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + lock (_syncObj) + { + if (disposing) + { + foreach (KeyValuePair entry in _eloadChannelMap) + { + entry.Value.Shutdown(); + } + + if (_serialPort != null) + { + Reset(); + _serialPort.Dispose(); + _serialPort = null; + } + + if (_gpibDevice != null) + { + Reset(); + _gpibDevice.Dispose(); + _gpibDevice = null; + } + } + } + } + + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + public void Initialize() + { + throw new NotImplementedException(); + } + + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } + + void IInstrument.Reset() + { + throw new NotImplementedException(); + } + + public void Shutdown() + { + throw new NotImplementedException(); + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/ELoad/EloadSystemScpiKeysight/EloadSystemScpiKeysightFactory.cs b/Source/TSRealLib/HAL/Implementations/ELoad/EloadSystemScpiKeysight/EloadSystemScpiKeysightFactory.cs index ac33cc5..6701ff8 100644 --- a/Source/TSRealLib/HAL/Implementations/ELoad/EloadSystemScpiKeysight/EloadSystemScpiKeysightFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/ELoad/EloadSystemScpiKeysight/EloadSystemScpiKeysightFactory.cs @@ -30,73 +30,66 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; -using Raytheon.Units; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.IO.Ports; using System.Reflection; +using NLog; +using Raytheon.Common; +using Raytheon.Units; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "EloadSystemScpiKeysightFactory")] - public class EloadSystemScpiKeysightFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "EloadSystemScpiKeysightFactory")] + public class EloadSystemScpiKeysightFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public EloadSystemScpiKeysightFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public EloadSystemScpiKeysightFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public EloadSystemScpiKeysightFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// EloadSystemScpiKeysightFactory injection constructor + /// + [ImportingConstructor] + public EloadSystemScpiKeysightFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IEload)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new EloadSystemScpiKeysight(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IEload)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new EloadSystemScpiKeysight(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -107,9 +100,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new EloadSystemScpiKeysight(name, _configurationManager, _logger); + return new EloadSystemScpiKeysight(name, _configurationManager); } catch (Exception) { @@ -122,156 +113,156 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } - #region PrivateFuctions - /// - /// Parses the power controller ini file. - /// This ini file defines the number of power systems/modules that this controller will manage. - /// Upon parsing the file, this function populates this class members with the ini file information - /// - private static IELoadSystem CreateEloadSystemInstrument(string instrumentDefFile, string iniSectionName, bool isThereHardware) - { - const char COMMA_DELIM = ','; + #region PrivateFuctions + /// + /// Parses the power controller ini file. + /// This ini file defines the number of power systems/modules that this controller will manage. + /// Upon parsing the file, this function populates this class members with the ini file information + /// + private static IELoadSystem CreateEloadSystemInstrument(string instrumentDefFile, string iniSectionName, bool isThereHardware) + { + const char COMMA_DELIM = ','; - // interface types - const string GPIB = "GPIB"; - const string RS232 = "232"; + // interface types + const string GPIB = "GPIB"; + const string RS232 = "232"; - // system - const string BOARD_NUMBER_KEY = "BOARD_NUMBER"; - const string INTERFACE_KEY = "INTERFACE"; - const string ADDRESS_KEY = "ADDRESS"; - const string BAUD_RATE = "BAUD_RATE"; - const string PARITY = "PARITY"; - const string DATA_BITS = "DATA_BITS"; - const string STOP_BITS = "STOP_BITS"; - const string FLOW_CONTROL = "FLOW_CONTROL"; - const string MODULE_DEFINITION_KEY = "MODULE_DEFINITION"; + // system + const string BOARD_NUMBER_KEY = "BOARD_NUMBER"; + const string INTERFACE_KEY = "INTERFACE"; + const string ADDRESS_KEY = "ADDRESS"; + const string BAUD_RATE = "BAUD_RATE"; + const string PARITY = "PARITY"; + const string DATA_BITS = "DATA_BITS"; + const string STOP_BITS = "STOP_BITS"; + const string FLOW_CONTROL = "FLOW_CONTROL"; + const string MODULE_DEFINITION_KEY = "MODULE_DEFINITION"; - // modules - const string MODE = "MODE"; - const string CHANNEL_NUM = "CHANNEL_NUM"; - const string SETPOINT_VALUE = "SETPOINT_VALUE"; - const string OCP = "OVER_CURRENT_PROTECTION"; - const string OVP = "OVER_VOLTAGE_PROTECTION"; + // modules + const string MODE = "MODE"; + const string CHANNEL_NUM = "CHANNEL_NUM"; + const string SETPOINT_VALUE = "SETPOINT_VALUE"; + const string OCP = "OVER_CURRENT_PROTECTION"; + const string OVP = "OVER_VOLTAGE_PROTECTION"; - IniFile iniReader = new IniFile(instrumentDefFile); + IniFile iniReader = new IniFile(instrumentDefFile); - // pull out the address and the list of definitions - string interfaceType = iniReader.ReadValue(iniSectionName, INTERFACE_KEY); - string[] moduleDefinitionList = null; - IELoadSystem loadSystem = null; - if (interfaceType.ToUpper() == GPIB) - { - int gpibBoardNumber = Convert.ToInt32(iniReader.ReadValue(iniSectionName, BOARD_NUMBER_KEY)); - byte gpibAddress = Convert.ToByte(iniReader.ReadValue(iniSectionName, ADDRESS_KEY)); - string moduleDefinitionSections = iniReader.ReadValue(iniSectionName, MODULE_DEFINITION_KEY); - moduleDefinitionList = moduleDefinitionSections.Split(COMMA_DELIM); + // pull out the address and the list of definitions + string interfaceType = iniReader.ReadValue(iniSectionName, INTERFACE_KEY); + string[] moduleDefinitionList = null; + IELoadSystem loadSystem = null; + if (interfaceType.ToUpper() == GPIB) + { + int gpibBoardNumber = Convert.ToInt32(iniReader.ReadValue(iniSectionName, BOARD_NUMBER_KEY)); + byte gpibAddress = Convert.ToByte(iniReader.ReadValue(iniSectionName, ADDRESS_KEY)); + string moduleDefinitionSections = iniReader.ReadValue(iniSectionName, MODULE_DEFINITION_KEY); + moduleDefinitionList = moduleDefinitionSections.Split(COMMA_DELIM); - loadSystem = new EloadSystemScpiKeysight(iniSectionName, gpibBoardNumber, gpibAddress, isThereHardware); + loadSystem = new EloadSystemScpiKeysight(iniSectionName, gpibBoardNumber, gpibAddress, isThereHardware); - } - else if (interfaceType.ToUpper() == RS232) - { - string eloadSystemComAddress = iniReader.ReadValue(iniSectionName, ADDRESS_KEY); - int eloadSystemComBaudRate = Convert.ToInt32(iniReader.ReadValue(iniSectionName, BAUD_RATE)); - Parity eloadSystemComParity = (Parity)Enum.Parse(typeof(Parity), iniReader.ReadValue(iniSectionName, PARITY)); - int eloadSystemComDataBits = Convert.ToInt32(iniReader.ReadValue(iniSectionName, DATA_BITS)); - Handshake flowControl = (Handshake)Enum.Parse(typeof(Handshake), iniReader.ReadValue(iniSectionName, FLOW_CONTROL)); - StopBits eloadSystemComStopBits = (StopBits)Enum.Parse(typeof(StopBits), iniReader.ReadValue(iniSectionName, STOP_BITS)); + } + else if (interfaceType.ToUpper() == RS232) + { + string eloadSystemComAddress = iniReader.ReadValue(iniSectionName, ADDRESS_KEY); + int eloadSystemComBaudRate = Convert.ToInt32(iniReader.ReadValue(iniSectionName, BAUD_RATE)); + Parity eloadSystemComParity = (Parity)Enum.Parse(typeof(Parity), iniReader.ReadValue(iniSectionName, PARITY)); + int eloadSystemComDataBits = Convert.ToInt32(iniReader.ReadValue(iniSectionName, DATA_BITS)); + Handshake flowControl = (Handshake)Enum.Parse(typeof(Handshake), iniReader.ReadValue(iniSectionName, FLOW_CONTROL)); + StopBits eloadSystemComStopBits = (StopBits)Enum.Parse(typeof(StopBits), iniReader.ReadValue(iniSectionName, STOP_BITS)); - string moduleDefinitionSections = iniReader.ReadValue(iniSectionName, MODULE_DEFINITION_KEY); - moduleDefinitionList = moduleDefinitionSections.Split(COMMA_DELIM); + string moduleDefinitionSections = iniReader.ReadValue(iniSectionName, MODULE_DEFINITION_KEY); + moduleDefinitionList = moduleDefinitionSections.Split(COMMA_DELIM); - loadSystem = new EloadSystemScpiKeysight(iniSectionName, eloadSystemComAddress, eloadSystemComBaudRate, eloadSystemComParity, eloadSystemComDataBits, eloadSystemComStopBits, flowControl, isThereHardware); - } - else - { - throw new Exception("EloadMeasurementInstruments::CreateEloadSystemInstrument() - Invalid Interface type in ini file. Ini file contained: " + interfaceType + ", supported types are: " + GPIB + "," + RS232); - } + loadSystem = new EloadSystemScpiKeysight(iniSectionName, eloadSystemComAddress, eloadSystemComBaudRate, eloadSystemComParity, eloadSystemComDataBits, eloadSystemComStopBits, flowControl, isThereHardware); + } + else + { + throw new Exception("EloadMeasurementInstruments::CreateEloadSystemInstrument() - Invalid Interface type in ini file. Ini file contained: " + interfaceType + ", supported types are: " + GPIB + "," + RS232); + } - foreach (string module in moduleDefinitionList) - { - string trimmedModuleName = module.TrimStart(' '); - trimmedModuleName = trimmedModuleName.TrimEnd(' '); + foreach (string module in moduleDefinitionList) + { + string trimmedModuleName = module.TrimStart(' '); + trimmedModuleName = trimmedModuleName.TrimEnd(' '); - int modeTemp = Convert.ToInt32(iniReader.ReadValue(trimmedModuleName, MODE)); - int channelNumber = Convert.ToInt32(iniReader.ReadValue(trimmedModuleName, CHANNEL_NUM)); - double setpoint = Convert.ToDouble(iniReader.ReadValue(trimmedModuleName, SETPOINT_VALUE)); - double ocp = Convert.ToDouble(iniReader.ReadValue(trimmedModuleName, OCP)); - double ovp = Convert.ToDouble(iniReader.ReadValue(trimmedModuleName, OVP)); + int modeTemp = Convert.ToInt32(iniReader.ReadValue(trimmedModuleName, MODE)); + int channelNumber = Convert.ToInt32(iniReader.ReadValue(trimmedModuleName, CHANNEL_NUM)); + double setpoint = Convert.ToDouble(iniReader.ReadValue(trimmedModuleName, SETPOINT_VALUE)); + double ocp = Convert.ToDouble(iniReader.ReadValue(trimmedModuleName, OCP)); + double ovp = Convert.ToDouble(iniReader.ReadValue(trimmedModuleName, OVP)); - EloadModuleMode mode; + EloadModuleMode mode; - if (modeTemp == 0) - { - mode = EloadModuleMode.RESISTANCE; - } - else if (modeTemp == 1) - { - mode = EloadModuleMode.VOLTAGE; - } - else if (modeTemp == 2) - { - mode = EloadModuleMode.CURRENT; - } - else - { - throw new Exception("EloadMeasurementInstruments::CreateEloadSystemInstrument() - Invalid mode input: " + modeTemp.ToString()); - } + if (modeTemp == 0) + { + mode = EloadModuleMode.RESISTANCE; + } + else if (modeTemp == 1) + { + mode = EloadModuleMode.VOLTAGE; + } + else if (modeTemp == 2) + { + mode = EloadModuleMode.CURRENT; + } + else + { + throw new Exception("EloadMeasurementInstruments::CreateEloadSystemInstrument() - Invalid mode input: " + modeTemp.ToString()); + } - loadSystem.AddEloadChannel(trimmedModuleName.ToUpper(), channelNumber, mode, setpoint, Current.FromAmps(ocp), Voltage.FromVolts(ovp)); - } + loadSystem.AddEloadChannel(trimmedModuleName.ToUpper(), channelNumber, mode, setpoint, Current.FromAmps(ocp), Voltage.FromVolts(ovp)); + } - return loadSystem; - } - #endregion + return loadSystem; + } + #endregion - #region PublicFuctions - public static List CreateEloadSystemInstrument(string instrumentDefFile, bool isThereHardware) - { - const string KEYSIGHT_ELOAD_SCPI = "KEYSIGHT_SCPI_ELOAD_SYSTEM"; + #region PublicFuctions + public static List CreateEloadSystemInstrument(string instrumentDefFile, bool isThereHardware) + { + const string KEYSIGHT_ELOAD_SCPI = "KEYSIGHT_SCPI_ELOAD_SYSTEM"; - List loadSystemsToReturn = new List(); + List loadSystemsToReturn = new List(); - IniFile iniReader = new IniFile(instrumentDefFile); + IniFile iniReader = new IniFile(instrumentDefFile); - List loadSystemsToCreateKeys = iniReader.ReadAllKeys("ELOAD_SYSTEMS_TO_CREATE"); + List loadSystemsToCreateKeys = iniReader.ReadAllKeys("ELOAD_SYSTEMS_TO_CREATE"); - foreach (string loadSystemName in loadSystemsToCreateKeys) - { - string loadSystemType = iniReader.ReadValue("ELOAD_SYSTEMS_TO_CREATE", loadSystemName); + foreach (string loadSystemName in loadSystemsToCreateKeys) + { + string loadSystemType = iniReader.ReadValue("ELOAD_SYSTEMS_TO_CREATE", loadSystemName); - if (loadSystemType.ToUpper() == KEYSIGHT_ELOAD_SCPI.ToUpper()) - { - IELoadSystem loadSystem = CreateEloadSystemInstrument(instrumentDefFile, loadSystemName, isThereHardware); + if (loadSystemType.ToUpper() == KEYSIGHT_ELOAD_SCPI.ToUpper()) + { + IELoadSystem loadSystem = CreateEloadSystemInstrument(instrumentDefFile, loadSystemName, isThereHardware); - loadSystemsToReturn.Add(loadSystem); - } - else - { - string errorMsg = "EloadMeasurementInstruments::CreateEloadSystemInstrument() - Unsupported ELoad instrument: " + loadSystemName + "\n"; - errorMsg += "Supported instrument are: " + KEYSIGHT_ELOAD_SCPI; - throw new Exception(errorMsg); - } - } + loadSystemsToReturn.Add(loadSystem); + } + else + { + string errorMsg = "EloadMeasurementInstruments::CreateEloadSystemInstrument() - Unsupported ELoad instrument: " + loadSystemName + "\n"; + errorMsg += "Supported instrument are: " + KEYSIGHT_ELOAD_SCPI; + throw new Exception(errorMsg); + } + } - return loadSystemsToReturn; - } - #endregion + return loadSystemsToReturn; + } + #endregion - } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/CustomAsciiSerial/CommFpgaCustomAsciiSerial.cs b/Source/TSRealLib/HAL/Implementations/FPGA/CustomAsciiSerial/CommFpgaCustomAsciiSerial.cs index acfdbb5..1260bf0 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/CustomAsciiSerial/CommFpgaCustomAsciiSerial.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/CustomAsciiSerial/CommFpgaCustomAsciiSerial.cs @@ -24,542 +24,509 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A class the provides an interface for read/write to registers on an FPGA that implement a custom ascii serial interface - /// - public class CommFpgaCustomAsciiSerial : IFpgaComm, IDisposable - { - #region PrivateClassMembers - private SerialPort _serialPort; - private byte[] _readBuf; - private static object _syncObj = new Object(); - private uint _delayBeforeReadMs; - private string _readFormat; - private string _writeFormat; - private SelfTestResult _selfTestResult; - private State _state; - private string _name; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFuctions - - /// - /// The Finalizer - /// - ~CommFpgaCustomAsciiSerial() - { - Dispose(false); - } - - - /// - /// Reads the serial port until it is empty - /// - private void ClearBuffer() - { - lock (_syncObj) - { - bool isClearComplete = false; - - while (isClearComplete == false) - { - try - { - int numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); - - if (numBytesRead < _readBuf.Length) - { - isClearComplete = true; - } - } - catch (Exception) - { - //expected if buffer is already cleared - isClearComplete = true; - } - } - } - } - - - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _serialPort.Dispose(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - #endregion - - #region PublicFuctions - - /// - /// ELoadScpiKeysight factory constructor - /// - /// - /// - public CommFpgaCustomAsciiSerial(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - const int READ_BUF_SIZE = 1024; - - try - { - _selfTestResult = SelfTestResult.Unknown; - - _state = State.Uninitialized; - - string comPortName = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "ComPortName", "COM1"); - int baudRate = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "BaudRate", 9600); - Parity parity = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "Parity", Parity.None); - int dataBits = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "DataBits", 8); - StopBits stopBits = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "StopBits", StopBits.None); - - _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); - _readFormat = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "ReadFormat", ""); - _writeFormat = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "WriteFormat", ""); - _serialPort.ReadTimeout = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "ReadTimeout", 100); - _delayBeforeReadMs = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "DelayBeforeReadMs", 0); - - _readBuf = new byte[READ_BUF_SIZE]; - - //check format of readFormat and writeFormat - if (!_readFormat.Contains("
")) - { - throw new Exception("the read format input for card " + _name + " does not contain the
tag"); - } - - if (!_writeFormat.Contains("
")) - { - throw new Exception("the write format input for card " + _name + " does not contain the
tag"); - } - - if (!_writeFormat.Contains("")) - { - throw new Exception("the write format input for card " + _name + " does not contain the tag"); - } - } - catch (Exception ex) - { - _logger.Error(ex); - - if (_serialPort.IsOpen == true) - { - _serialPort.Close(); - } - - throw; - } - } - - /// - /// The constructor which opens up a serial port - /// - /// The port name. "Com1' for example - /// The num of ms to wait before a read - /// The baud rate - /// The parity - /// Number of data bits - /// Number of Stop Bits - public CommFpgaCustomAsciiSerial(string name, string comPortName, uint delayBeforeReadMs, string readFormat, string writeFormat, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) - { - const int READ_BUF_SIZE = 1024; - - try - { - _name = name; - - _selfTestResult = SelfTestResult.Unknown; - - _state = State.Uninitialized; - - _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); - - _readFormat = readFormat; - - _writeFormat = writeFormat; - - _serialPort.ReadTimeout = 100; - - _delayBeforeReadMs = delayBeforeReadMs; - - _readBuf = new byte[READ_BUF_SIZE]; - - Array.Clear(_readBuf, 0, _readBuf.Length); - - _logger = LogManager.GetCurrentClassLogger(); - - //check format of readFormat and writeFormat - if (readFormat.Contains("
") == false) - { - throw new Exception("the read format input for card " + _name + " does not contain the
tag"); - } - - if (writeFormat.Contains("
") == false) - { - throw new Exception("the write format input for card " + _name + " does not contain the
tag"); - } - - if (writeFormat.Contains("") == false) - { - throw new Exception("the write format input for card " + _name + " does not contain the tag"); - } - } - catch (Exception ex) - { - _logger.Error(ex); - - if (_serialPort.IsOpen == true) - { - _serialPort.Close(); - } - - throw; - } - } - - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a FPGA Custom Ascii called " + _name; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } - - /// - /// Dispose of this object - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - Initialize(string.Empty); - } - - /// - /// - /// - /// - public void Initialize(string fpga) - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - if (_serialPort.IsOpen == false) - { - _serialPort.Open(); - } - - //ClearBuffer(); - - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } - - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Unknown; - return _selfTestResult; - } - - /// - /// - /// - /// - /// - /// - public uint Read(string fpga, uint address) - { - // lock up the FPGA resource - lock (_syncObj) - { - - string hexAddress = "0x" + address.ToString("X8"); - - string commandToSend = _readFormat.Replace("
", hexAddress); - - commandToSend = commandToSend.Trim(); - - _serialPort.Write(commandToSend); - - Thread.Sleep((int)_delayBeforeReadMs); - - int numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); - - string data = Encoding.UTF8.GetString(_readBuf, 0, _readBuf.Length); - - // get rid of new lines - data = data.Replace("\r", " "); - data = data.Replace("\n", " "); - data = data.Trim(); - - uint dataToReturn = Convert.ToUInt32(data, 16); - - return dataToReturn; - } - } - - /// - /// - /// - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - // lock up the FPGA resource - lock (_syncObj) - { - Thread.Sleep((int)_delayBeforeReadMs); - - int bytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); - - int bytesToCopy = Math.Min(bytesRead, dataRead.Length); - - Array.Copy(_readBuf, dataRead, bytesToCopy); - - Array.Clear(_readBuf, 0, _readBuf.Length); - } - } - - /// - /// - /// - public void Reset() - { - Shutdown(); - - Initialize(); - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// - /// - public void Shutdown() - { - // lock up the FPGA resource - lock (_syncObj) - { - if (_state == State.Ready) - { - _serialPort.Dispose(); - _state = State.Uninitialized; - } - } - } - - /// - /// - /// - /// - /// - /// - public void Write(string fpga, uint address, uint data) - { - // lock up the FPGA resource - lock (_syncObj) - { - string hexAddress = "0x" + address.ToString("X8"); - - string hexData = "0x" + data.ToString("X8"); - - string commandToSend = _writeFormat.Replace("
", hexAddress); - - commandToSend = commandToSend.Replace("", hexData); - - commandToSend = commandToSend.Trim(); - - _serialPort.Write(commandToSend); - } - } - - /// - /// - /// - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - // lock up the FPGA resource - lock (_syncObj) - { - throw new Exception("Not Implemented"); - } - } - - /// - /// Loads firmware - /// - /// - public void LoadFirmware(string fpgaName) - { - Initialize(fpgaName); - } - - #endregion - } + /// + /// A class the provides an interface for read/write to registers on an FPGA that implement a custom ascii serial interface + /// + public class CommFpgaCustomAsciiSerial : IFpgaComm, IDisposable + { + #region PrivateClassMembers + private SerialPort _serialPort; + private byte[] _readBuf; + private static object _syncObj = new Object(); + private uint _delayBeforeReadMs; + private string _readFormat; + private string _writeFormat; + private SelfTestResult _selfTestResult; + private State _state; + private string _name; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFuctions + + /// + /// The Finalizer + /// + ~CommFpgaCustomAsciiSerial() + { + Dispose(false); + } + + + /// + /// Reads the serial port until it is empty + /// + private void ClearBuffer() + { + lock (_syncObj) + { + bool isClearComplete = false; + + while (isClearComplete == false) + { + try + { + int numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); + + if (numBytesRead < _readBuf.Length) + { + isClearComplete = true; + } + } + catch (Exception) + { + //expected if buffer is already cleared + isClearComplete = true; + } + } + } + } + + + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _serialPort.Dispose(); + _state = State.Uninitialized; + } + } + } + + #endregion + + #region PublicFuctions + + /// + /// ELoadScpiKeysight factory constructor + /// + /// + /// + public CommFpgaCustomAsciiSerial(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + const int READ_BUF_SIZE = 1024; + + try + { + _selfTestResult = SelfTestResult.Unknown; + + _state = State.Uninitialized; + + string comPortName = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "ComPortName", "COM1"); + int baudRate = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "BaudRate", 9600); + Parity parity = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "Parity", Parity.None); + int dataBits = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "DataBits", 8); + StopBits stopBits = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "StopBits", StopBits.None); + + _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); + _readFormat = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "ReadFormat", ""); + _writeFormat = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "WriteFormat", ""); + _serialPort.ReadTimeout = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "ReadTimeout", 100); + _delayBeforeReadMs = _configuration.GetConfigurationValue("CommFpgaCustomAsciiSerial", "DelayBeforeReadMs", 0); + + _readBuf = new byte[READ_BUF_SIZE]; + + //check format of readFormat and writeFormat + if (!_readFormat.Contains("
")) + { + throw new Exception("the read format input for card " + _name + " does not contain the
tag"); + } + + if (!_writeFormat.Contains("
")) + { + throw new Exception("the write format input for card " + _name + " does not contain the
tag"); + } + + if (!_writeFormat.Contains("")) + { + throw new Exception("the write format input for card " + _name + " does not contain the tag"); + } + } + catch (Exception ex) + { + _logger.Error(ex); + + if (_serialPort.IsOpen == true) + { + _serialPort.Close(); + } + + throw; + } + } + + /// + /// The constructor which opens up a serial port + /// + /// The port name. "Com1' for example + /// The num of ms to wait before a read + /// The baud rate + /// The parity + /// Number of data bits + /// Number of Stop Bits + public CommFpgaCustomAsciiSerial(string deviceName, string comPortName, uint delayBeforeReadMs, string readFormat, string writeFormat, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) + { + const int READ_BUF_SIZE = 1024; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + try + { + _name = deviceName; + + _selfTestResult = SelfTestResult.Unknown; + + _state = State.Uninitialized; + + _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); + + _readFormat = readFormat; + + _writeFormat = writeFormat; + + _serialPort.ReadTimeout = 100; + + _delayBeforeReadMs = delayBeforeReadMs; + + _readBuf = new byte[READ_BUF_SIZE]; + + Array.Clear(_readBuf, 0, _readBuf.Length); + + //check format of readFormat and writeFormat + if (readFormat.Contains("
") == false) + { + throw new Exception("the read format input for card " + _name + " does not contain the
tag"); + } + + if (writeFormat.Contains("
") == false) + { + throw new Exception("the write format input for card " + _name + " does not contain the
tag"); + } + + if (writeFormat.Contains("") == false) + { + throw new Exception("the write format input for card " + _name + " does not contain the tag"); + } + } + catch (Exception ex) + { + _logger.Error(ex); + + if (_serialPort.IsOpen == true) + { + _serialPort.Close(); + } + + throw; + } + } + + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a FPGA Custom Ascii called " + _name; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } + + /// + /// Dispose of this object + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + Initialize(string.Empty); + } + + /// + /// + /// + /// + public void Initialize(string fpga) + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + if (_serialPort.IsOpen == false) + { + _serialPort.Open(); + } + + //ClearBuffer(); + + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } + + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Unknown; + return _selfTestResult; + } + + /// + /// + /// + /// + /// + /// + public uint Read(string fpga, uint address) + { + // lock up the FPGA resource + lock (_syncObj) + { + + string hexAddress = "0x" + address.ToString("X8"); + + string commandToSend = _readFormat.Replace("
", hexAddress); + + commandToSend = commandToSend.Trim(); + + _serialPort.Write(commandToSend); + + Thread.Sleep((int)_delayBeforeReadMs); + + int numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); + + string data = Encoding.UTF8.GetString(_readBuf, 0, _readBuf.Length); + + // get rid of new lines + data = data.Replace("\r", " "); + data = data.Replace("\n", " "); + data = data.Trim(); + + uint dataToReturn = Convert.ToUInt32(data, 16); + + return dataToReturn; + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + // lock up the FPGA resource + lock (_syncObj) + { + Thread.Sleep((int)_delayBeforeReadMs); + + int bytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); + + int bytesToCopy = Math.Min(bytesRead, dataRead.Length); + + Array.Copy(_readBuf, dataRead, bytesToCopy); + + Array.Clear(_readBuf, 0, _readBuf.Length); + } + } + + /// + /// + /// + public void Reset() + { + Shutdown(); + + Initialize(); + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + public void Shutdown() + { + // lock up the FPGA resource + lock (_syncObj) + { + if (_state == State.Ready) + { + _serialPort.Dispose(); + _state = State.Uninitialized; + } + } + } + + /// + /// + /// + /// + /// + /// + public void Write(string fpga, uint address, uint data) + { + // lock up the FPGA resource + lock (_syncObj) + { + string hexAddress = "0x" + address.ToString("X8"); + + string hexData = "0x" + data.ToString("X8"); + + string commandToSend = _writeFormat.Replace("
", hexAddress); + + commandToSend = commandToSend.Replace("", hexData); + + commandToSend = commandToSend.Trim(); + + _serialPort.Write(commandToSend); + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + // lock up the FPGA resource + lock (_syncObj) + { + throw new Exception("Not Implemented"); + } + } + + /// + /// Loads firmware + /// + /// + public void LoadFirmware(string fpgaName) + { + Initialize(fpgaName); + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/CustomAsciiSerial/CommFpgaCustomAsciiSerialFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/CustomAsciiSerial/CommFpgaCustomAsciiSerialFactory.cs index e81468a..f8d7cbb 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/CustomAsciiSerial/CommFpgaCustomAsciiSerialFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/CustomAsciiSerial/CommFpgaCustomAsciiSerialFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaCustomAsciiSerialFactory")] - public class CommFpgaCustomAsciiSerialFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaCustomAsciiSerialFactory")] + public class CommFpgaCustomAsciiSerialFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommFpgaCustomAsciiSerialFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaCustomAsciiSerialFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommFpgaCustomAsciiSerialFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommFpgaCustomAsciiSerialFactory injection constructor + /// + [ImportingConstructor] + public CommFpgaCustomAsciiSerialFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaCustomAsciiSerial(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommFpgaCustomAsciiSerial(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); else - return new CommFpgaCustomAsciiSerial(name, _configurationManager, _logger); + return new CommFpgaCustomAsciiSerial(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/CommFpgaEthernet.cs b/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/CommFpgaEthernet.cs index 9d4d463..fbedf8e 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/CommFpgaEthernet.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/CommFpgaEthernet.cs @@ -15,579 +15,546 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using FpgaMeasurementInstrumentsLib; -using NLog; -using Raytheon.Common; using System; using System.Net; using System.Net.Sockets; using System.Runtime.InteropServices; +using FpgaMeasurementInstrumentsLib; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// This class serves as an interface to FPGAs that implement a UDP interface. - /// It allows for the ability to read and write to registers. - /// - public class CommFpgaEthernet : IFpgaComm, IDisposable - { - #region PrivateClassMembers - private UdpClient _udpClient; - private readonly int _localPort; - private readonly int _remotePort; - private readonly string _remoteAddress; - private static object _syncObj = new Object(); - private SelfTestResult _selfTestResult; - private State _state; - private string _name; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFuctions - - /// - /// The Finalizer - /// - ~CommFpgaEthernet() - { - Dispose(false); - } - - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _udpClient.Close(); - - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// Read data off of the socket - /// - /// The data that was read - /// The number of bytes read - private int ReadData(ref byte[] dataRead) - { - IPEndPoint remoteIPEndPoint = new IPEndPoint(IPAddress.Any, _localPort); - - dataRead = _udpClient.Receive(ref remoteIPEndPoint); - - int numBytesRead = dataRead.Length; - - return numBytesRead; - } - - /// - /// Send a command message and get a response message - /// - /// The message to send - /// The response - private void SendCommandGetResponse(FPGACmdMessage commandMsg, ref FPGARspMessage rspMsg) - { - uint rxBufferSize = rspMsg.GetEntireMsgLength(); - uint rxNumBytesExpected = rxBufferSize; - - uint dataToSendNumBytes = commandMsg.GetEntireMsgLength(); - - // send the command - byte[] dataToSend = new byte[dataToSendNumBytes]; - - // get a pointer to the data - GCHandle sendPinnedArray = GCHandle.Alloc(dataToSend, GCHandleType.Pinned); - IntPtr pByte = sendPinnedArray.AddrOfPinnedObject(); - commandMsg.Format(pByte); - sendPinnedArray.Free(); - - // send the data - int numBytesSent = SendData(dataToSend); - - if (dataToSendNumBytes != numBytesSent) - { - throw new Exception("wanted to send: " + dataToSendNumBytes.ToString() + " bytes, SendData() reported that it sent: " + numBytesSent.ToString()); - } - - // read the response - byte[] rspBuffer = new byte[rxBufferSize]; - int numBytesRead = ReadData(ref rspBuffer); - - if (numBytesRead != rxNumBytesExpected) - { - throw new Exception("received " + numBytesRead.ToString() + " bytes, expected " + rxNumBytesExpected.ToString()); - } - - // populate the rspMsg object - GCHandle rxPinnedArray = GCHandle.Alloc(rspBuffer, GCHandleType.Pinned); - IntPtr pBytePtr = rxPinnedArray.AddrOfPinnedObject(); - rspMsg.Parse(pBytePtr); - rxPinnedArray.Free(); - } - - /// - /// Send data out of the socket - /// - /// The data to send - /// The number of bytes sent - private int SendData(byte[] dataToSend) - { - IPAddress addy = IPAddress.Parse(_remoteAddress); - - IPEndPoint ipEndPoint = new IPEndPoint(addy, _remotePort); - - int numBytesSent = _udpClient.Send(dataToSend, dataToSend.Length, ipEndPoint); - - return numBytesSent; - } - #endregion - - #region PublicFuctions - - /// - /// CommFpgaEthernet factory constructor - /// - /// - /// - public CommFpgaEthernet(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - - _localPort = _configuration.GetConfigurationValue("CommFpgaEthernet", "LocalPort", 0); - _remotePort = _configuration.GetConfigurationValue("CommFpgaEthernet", "RemotePort", 0); - _remoteAddress = _configuration.GetConfigurationValue("CommFpgaEthernet", "RemoteAddress", "127.0.0.1"); - } - - - /// - /// - /// - /// - /// The port on the local computer - /// The port that the FPGA is using - /// The address that the FPGA is using - public CommFpgaEthernet(string name, int localPort, int remotePort, string remoteAddress) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - - _localPort = localPort; - _remotePort = remotePort; - _remoteAddress = remoteAddress; - } - - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a FPGA Ethernet called " + _name; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } - - /// - /// Dispose of this object - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - Initialize(string.Empty); - } - - /// - /// - /// - /// - public void Initialize(string fpga) - { - //5 second timeout - const int TIMEOUT = 5000; - - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - _udpClient = new UdpClient(_localPort); - - _udpClient.Client.ReceiveBufferSize = int.MaxValue; - - _udpClient.Client.SendBufferSize = int.MaxValue; - - _udpClient.Client.SendTimeout = TIMEOUT; - - _udpClient.Client.ReceiveTimeout = TIMEOUT; - - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } - - /// - /// - /// - public string Name - { - get - { - return _name; - } - set - { - _name = value; - } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Unknown; - return _selfTestResult; - } - - /// - /// Reads a single register - /// - /// The page of the register to read from - /// The register address to read from - /// The data at the address - public uint Read(string fpgaName, uint address) - { - // lock up the FPGA resource - lock (_syncObj) - { - FPGACmdMessage cmd = new FPGAReadRegisterCmdMessage((FPGACmdMessage.Page)0, address); - - // this get populated in SendCommandGetResponse() - FPGARspMessage rsp = new FPGAReadRegisterRspMessage(0, 0); - - SendCommandGetResponse(cmd, ref rsp); - - return rsp.GetData(); - } - } - - /// - /// - /// - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - // lock up the FPGA resource - lock (_syncObj) - { - if (shallWeIncrementAddress) - { - FPGACmdMessage cmd = new FPGAReadRegisterCmdBlockIncrMessage((FPGACmdMessage.Page)0, address, numberOfWordsToRead, false); - - // this get populated in SendCommandGetResponse() - FPGARspMessage rsp = new FPGAReadRegisterBlockIncrRspMessage(0, ref dataRead); - - SendCommandGetResponse(cmd, ref rsp); - } - else - { - throw new Exception("Not Implemented"); - } - } - } - - /// - /// - /// - public void Reset() - { - Shutdown(); - - Initialize(); - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - public void Shutdown() - { - // lock up the FPGA resource - lock (_syncObj) - { - if (_state == State.Ready) - { - _udpClient.Close(); - - _state = State.Uninitialized; - } - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// Write to a single register - /// - /// The page of the register to read from - /// The address to write to - /// The data to write - public void Write(string fpgaName, uint address, uint value) - { - // lock up the FPGA resource - lock (_syncObj) - { - FPGACmdMessage cmd = new FPGAWriteRegisterCmdMessage((FPGACmdMessage.Page)0, address, value); - - // this get populated in SendCommandGetResponse() - FPGARspMessage rsp = new FPGAWriteRegisterRspMessage(0, 0); - - SendCommandGetResponse(cmd, ref rsp); - - if (rsp.GetAddress() != address) - { - throw new Exception("Command write on address: " + address.ToString("X8") + ", received address: " + rsp.GetAddress().ToString("X8")); - } - else if (rsp.GetData() != 0xace0beef) - { - throw new Exception("Command write on address: " + address.ToString("X8") + " returned value: " + rsp.GetData().ToString("X8")); - } - } - } - - /// - /// - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - // lock up the FPGA resource - lock (_syncObj) - { - FPGACmdMessage cmd = null; - - if (shallWeIncrementAddress) - { - cmd = new FPGAWriteRegisterCmdBlockIncrMessage((FPGACmdMessage.Page)0, address, data, false); - } - else - { - cmd = new FPGAWriteRegisterCmdBlockMessage((FPGACmdMessage.Page)0, address, data, false); - } - - // this get populated in SendCommandGetResponse() - FPGARspMessage rsp = new FPGAWriteRegisterRspMessage(0, 0); - - SendCommandGetResponse(cmd, ref rsp); - - if (rsp.GetAddress() != address) - { - throw new Exception("Command write on address: " + address.ToString("X8") + ", received address: " + rsp.GetAddress().ToString("X8")); - } - else if (rsp.GetData() != 0xace0beef) - { - throw new Exception("Command write on address: " + address.ToString("X8") + " returned value: " + rsp.GetData().ToString("X8")); - } - } - } - - /// - /// - /// - /// - /// - /// - /// - /// - public void WriteRegister(uint page, uint address, uint[] data, bool incrementAddress = true, bool byteSwap = true) - { - // lock up the FPGA resource - lock (_syncObj) - { - if (page > (uint)FPGACmdMessage.Page.PAGE3) - { - throw new Exception("input parameter 'page' is out of range: " + page.ToString()); - } - - FPGACmdMessage cmd; - - if (incrementAddress) - { - cmd = new FPGAWriteRegisterCmdBlockIncrMessage((FPGACmdMessage.Page)page, address, data, byteSwap); - } - else - { - cmd = new FPGAWriteRegisterCmdBlockMessage((FPGACmdMessage.Page)page, address, data, byteSwap); - } - - - // this get populated in SendCommandGetResponse() - FPGARspMessage rsp = new FPGAWriteRegisterRspMessage(0, 0); - - SendCommandGetResponse(cmd, ref rsp); - - if (rsp.GetAddress() != address) - { - throw new Exception("Command write on address: " + address.ToString("X8") + ", received address: " + rsp.GetAddress().ToString("X8")); - } - else if (rsp.GetData() != 0xace0beef) - { - throw new Exception("Command write on address: " + address.ToString("X8") + " returned value: " + rsp.GetData().ToString("X8")); - } - } - } - - /// - /// Loads firmware - /// - /// - public void LoadFirmware(string fpgaName) - { - Initialize(fpgaName); - } - #endregion - } + /// + /// This class serves as an interface to FPGAs that implement a UDP interface. + /// It allows for the ability to read and write to registers. + /// + public class CommFpgaEthernet : IFpgaComm, IDisposable + { + #region PrivateClassMembers + private UdpClient _udpClient; + private readonly int _localPort; + private readonly int _remotePort; + private readonly string _remoteAddress; + private static object _syncObj = new Object(); + private SelfTestResult _selfTestResult; + private State _state; + private string _name; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFuctions + + /// + /// The Finalizer + /// + ~CommFpgaEthernet() + { + Dispose(false); + } + + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _udpClient.Close(); + + _state = State.Uninitialized; + } + } + } + + /// + /// Read data off of the socket + /// + /// The data that was read + /// The number of bytes read + private int ReadData(ref byte[] dataRead) + { + IPEndPoint remoteIPEndPoint = new IPEndPoint(IPAddress.Any, _localPort); + + dataRead = _udpClient.Receive(ref remoteIPEndPoint); + + int numBytesRead = dataRead.Length; + + return numBytesRead; + } + + /// + /// Send a command message and get a response message + /// + /// The message to send + /// The response + private void SendCommandGetResponse(FPGACmdMessage commandMsg, ref FPGARspMessage rspMsg) + { + uint rxBufferSize = rspMsg.GetEntireMsgLength(); + uint rxNumBytesExpected = rxBufferSize; + + uint dataToSendNumBytes = commandMsg.GetEntireMsgLength(); + + // send the command + byte[] dataToSend = new byte[dataToSendNumBytes]; + + // get a pointer to the data + GCHandle sendPinnedArray = GCHandle.Alloc(dataToSend, GCHandleType.Pinned); + IntPtr pByte = sendPinnedArray.AddrOfPinnedObject(); + commandMsg.Format(pByte); + sendPinnedArray.Free(); + + // send the data + int numBytesSent = SendData(dataToSend); + + if (dataToSendNumBytes != numBytesSent) + { + throw new Exception("wanted to send: " + dataToSendNumBytes.ToString() + " bytes, SendData() reported that it sent: " + numBytesSent.ToString()); + } + + // read the response + byte[] rspBuffer = new byte[rxBufferSize]; + int numBytesRead = ReadData(ref rspBuffer); + + if (numBytesRead != rxNumBytesExpected) + { + throw new Exception("received " + numBytesRead.ToString() + " bytes, expected " + rxNumBytesExpected.ToString()); + } + + // populate the rspMsg object + GCHandle rxPinnedArray = GCHandle.Alloc(rspBuffer, GCHandleType.Pinned); + IntPtr pBytePtr = rxPinnedArray.AddrOfPinnedObject(); + rspMsg.Parse(pBytePtr); + rxPinnedArray.Free(); + } + + /// + /// Send data out of the socket + /// + /// The data to send + /// The number of bytes sent + private int SendData(byte[] dataToSend) + { + IPAddress addy = IPAddress.Parse(_remoteAddress); + + IPEndPoint ipEndPoint = new IPEndPoint(addy, _remotePort); + + int numBytesSent = _udpClient.Send(dataToSend, dataToSend.Length, ipEndPoint); + + return numBytesSent; + } + #endregion + + #region PublicFuctions + + /// + /// CommFpgaEthernet factory constructor + /// + /// + /// + public CommFpgaEthernet(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + + _localPort = _configuration.GetConfigurationValue("CommFpgaEthernet", "LocalPort", 0); + _remotePort = _configuration.GetConfigurationValue("CommFpgaEthernet", "RemotePort", 0); + _remoteAddress = _configuration.GetConfigurationValue("CommFpgaEthernet", "RemoteAddress", "127.0.0.1"); + } + + + /// + /// + /// + /// + /// The port on the local computer + /// The port that the FPGA is using + /// The address that the FPGA is using + public CommFpgaEthernet(string deviceName, int localPort, int remotePort, string remoteAddress) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + + _localPort = localPort; + _remotePort = remotePort; + _remoteAddress = remoteAddress; + } + + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a FPGA Ethernet called " + _name; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } + + /// + /// Dispose of this object + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + Initialize(string.Empty); + } + + /// + /// + /// + /// + public void Initialize(string fpga) + { + //5 second timeout + const int TIMEOUT = 5000; + + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + _udpClient = new UdpClient(_localPort); + + _udpClient.Client.ReceiveBufferSize = int.MaxValue; + + _udpClient.Client.SendBufferSize = int.MaxValue; + + _udpClient.Client.SendTimeout = TIMEOUT; + + _udpClient.Client.ReceiveTimeout = TIMEOUT; + + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } + + /// + /// + /// + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Unknown; + return _selfTestResult; + } + + /// + /// Reads a single register + /// + /// The page of the register to read from + /// The register address to read from + /// The data at the address + public uint Read(string fpgaName, uint address) + { + // lock up the FPGA resource + lock (_syncObj) + { + FPGACmdMessage cmd = new FPGAReadRegisterCmdMessage((FPGACmdMessage.Page)0, address); + + // this get populated in SendCommandGetResponse() + FPGARspMessage rsp = new FPGAReadRegisterRspMessage(0, 0); + + SendCommandGetResponse(cmd, ref rsp); + + return rsp.GetData(); + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + // lock up the FPGA resource + lock (_syncObj) + { + if (shallWeIncrementAddress) + { + FPGACmdMessage cmd = new FPGAReadRegisterCmdBlockIncrMessage((FPGACmdMessage.Page)0, address, numberOfWordsToRead, false); + + // this get populated in SendCommandGetResponse() + FPGARspMessage rsp = new FPGAReadRegisterBlockIncrRspMessage(0, ref dataRead); + + SendCommandGetResponse(cmd, ref rsp); + } + else + { + throw new Exception("Not Implemented"); + } + } + } + + /// + /// + /// + public void Reset() + { + Shutdown(); + + Initialize(); + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public void Shutdown() + { + // lock up the FPGA resource + lock (_syncObj) + { + if (_state == State.Ready) + { + _udpClient.Close(); + + _state = State.Uninitialized; + } + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// Write to a single register + /// + /// The page of the register to read from + /// The address to write to + /// The data to write + public void Write(string fpgaName, uint address, uint value) + { + // lock up the FPGA resource + lock (_syncObj) + { + FPGACmdMessage cmd = new FPGAWriteRegisterCmdMessage((FPGACmdMessage.Page)0, address, value); + + // this get populated in SendCommandGetResponse() + FPGARspMessage rsp = new FPGAWriteRegisterRspMessage(0, 0); + + SendCommandGetResponse(cmd, ref rsp); + + if (rsp.GetAddress() != address) + { + throw new Exception("Command write on address: " + address.ToString("X8") + ", received address: " + rsp.GetAddress().ToString("X8")); + } + else if (rsp.GetData() != 0xace0beef) + { + throw new Exception("Command write on address: " + address.ToString("X8") + " returned value: " + rsp.GetData().ToString("X8")); + } + } + } + + /// + /// + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + // lock up the FPGA resource + lock (_syncObj) + { + FPGACmdMessage cmd = null; + + if (shallWeIncrementAddress) + { + cmd = new FPGAWriteRegisterCmdBlockIncrMessage((FPGACmdMessage.Page)0, address, data, false); + } + else + { + cmd = new FPGAWriteRegisterCmdBlockMessage((FPGACmdMessage.Page)0, address, data, false); + } + + // this get populated in SendCommandGetResponse() + FPGARspMessage rsp = new FPGAWriteRegisterRspMessage(0, 0); + + SendCommandGetResponse(cmd, ref rsp); + + if (rsp.GetAddress() != address) + { + throw new Exception("Command write on address: " + address.ToString("X8") + ", received address: " + rsp.GetAddress().ToString("X8")); + } + else if (rsp.GetData() != 0xace0beef) + { + throw new Exception("Command write on address: " + address.ToString("X8") + " returned value: " + rsp.GetData().ToString("X8")); + } + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void WriteRegister(uint page, uint address, uint[] data, bool incrementAddress = true, bool byteSwap = true) + { + // lock up the FPGA resource + lock (_syncObj) + { + if (page > (uint)FPGACmdMessage.Page.PAGE3) + { + throw new Exception("input parameter 'page' is out of range: " + page.ToString()); + } + + FPGACmdMessage cmd; + + if (incrementAddress) + { + cmd = new FPGAWriteRegisterCmdBlockIncrMessage((FPGACmdMessage.Page)page, address, data, byteSwap); + } + else + { + cmd = new FPGAWriteRegisterCmdBlockMessage((FPGACmdMessage.Page)page, address, data, byteSwap); + } + + + // this get populated in SendCommandGetResponse() + FPGARspMessage rsp = new FPGAWriteRegisterRspMessage(0, 0); + + SendCommandGetResponse(cmd, ref rsp); + + if (rsp.GetAddress() != address) + { + throw new Exception("Command write on address: " + address.ToString("X8") + ", received address: " + rsp.GetAddress().ToString("X8")); + } + else if (rsp.GetData() != 0xace0beef) + { + throw new Exception("Command write on address: " + address.ToString("X8") + " returned value: " + rsp.GetData().ToString("X8")); + } + } + } + + /// + /// Loads firmware + /// + /// + public void LoadFirmware(string fpgaName) + { + Initialize(fpgaName); + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/CommFpgaEthernetFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/CommFpgaEthernetFactory.cs index 12a4678..d30d934 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/CommFpgaEthernetFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/CommFpgaEthernetFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaEthernetFactory")] - public class CommFpgaEthernetFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaEthernetFactory")] + public class CommFpgaEthernetFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommFpgaEthernetFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaEthernetFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommFpgaEthernetFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommFpgaEthernetFactory injection constructor + /// + [ImportingConstructor] + public CommFpgaEthernetFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaEthernet(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommFpgaEthernet(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); else - return new CommFpgaEthernet(name, _configurationManager, _logger); + return new CommFpgaEthernet(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/Ethernet.csproj b/Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/FpgaEthernet.csproj similarity index 100% rename from Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/Ethernet.csproj rename to Source/TSRealLib/HAL/Implementations/FPGA/Ethernet/FpgaEthernet.csproj diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisSs/CommFpgaHssubChassisSs.cs b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisSs/CommFpgaHssubChassisSs.cs index 5ecf14e..7918a7e 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisSs/CommFpgaHssubChassisSs.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisSs/CommFpgaHssubChassisSs.cs @@ -15,100 +15,95 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A class that implements the Teradyne HSS Sub System Chassis - /// - public unsafe class CommFpgaHssubChassisSs : IFpgaComm - { - #region PrivateClassMembers + /// + /// A class that implements the Teradyne HSS Sub System Chassis + /// + public unsafe class CommFpgaHssubChassisSs : IFpgaComm + { + #region PrivateClassMembers #pragma warning disable CS0649 - public struct CardInfo - { - internal string cardName; - internal string cardAddress; - internal int startingOffset; - internal string cardFirmwareFile; - internal string memMap; - } + public struct CardInfo + { + internal string cardName; + internal string cardAddress; + internal int startingOffset; + internal string cardFirmwareFile; + internal string memMap; + } #pragma warning restore - private static object _syncObj = new Object(); + private object _syncObj = new Object(); - private SortedDictionary _hssCardNameMap; - private List _cardList; - private SelfTestResult _selfTestResult; - private State _state; - private string _name; + private SortedDictionary _hssCardNameMap; + private List _cardList; + private SelfTestResult _selfTestResult; + private State _state; + private string _name; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFuctions + #endregion - /// - /// The finalizer. - /// - ~CommFpgaHssubChassisSs() - { - Dispose(false); - } + #region PrivateFuctions - /// - /// - /// - /// - /// - /// - /// - private void CreateCard(string cardName, string cardAddress, int startingOffset, string cardFirmwareFile, string memMap) - { - lock (_syncObj) - { - // create the card - CommFpgaHssubCardSs card = new CommFpgaHssubCardSs(cardName, cardAddress, startingOffset, cardFirmwareFile, memMap); + /// + /// The finalizer. + /// + ~CommFpgaHssubChassisSs() + { + Dispose(false); + } - // hold onto the card - _hssCardNameMap[cardName] = card; - } - } + /// + /// + /// + /// + /// + /// + /// + private void CreateCard(string cardName, string cardAddress, int startingOffset, string cardFirmwareFile, string memMap) + { + lock (_syncObj) + { + // create the card + CommFpgaHssubCardSs card = new CommFpgaHssubCardSs(cardName, cardAddress, startingOffset, cardFirmwareFile, memMap); - /// - /// - /// - /// - public void LoadFirmware(string fpgaName) - { - // lock up the FPGA resource - lock (_syncObj) - { - _hssCardNameMap[fpgaName].LoadFirmware(); - } - } + // hold onto the card + _hssCardNameMap[cardName] = card; + } + } - /// - /// - /// - private void SelfTest() - { - // loop through each card and command self test + /// + /// + /// + /// + public void LoadFirmware(string fpgaName) + { + // lock up the FPGA resource + lock (_syncObj) + { + _hssCardNameMap[fpgaName].LoadFirmware(); + } + } - /*short testResults = -1; + /// + /// + /// + private void SelfTest() + { + // loop through each card and command self test + + /*short testResults = -1; StringBuilder errorStrTemp = new StringBuilder(512); @@ -124,376 +119,348 @@ namespace Raytheon.Instruments { throw new Exception("HSSub Self Test returned an error: " + testResults.ToString() + ": " + errorStrTemp.ToString()); }*/ - } + } - /// - /// Dispose of this object's resources. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - lock (_syncObj) - { - if (_state == State.Ready) - { - foreach (KeyValuePair entry in _hssCardNameMap) - { - entry.Value.Dispose(); - } + /// + /// Dispose of this object's resources. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + lock (_syncObj) + { + if (_state == State.Ready) + { + foreach (KeyValuePair entry in _hssCardNameMap) + { + entry.Value.Dispose(); + } - _state = State.Uninitialized; - } - } - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + _state = State.Uninitialized; + } + } + } + } + #endregion - #region PublicFuctions + #region PublicFuctions - /// - /// CommFpgaHssubChassisSs factory constructor - /// - /// - /// - public CommFpgaHssubChassisSs(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// CommFpgaHssubChassisSs factory constructor + /// + /// + /// + public CommFpgaHssubChassisSs(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _cardList = new List(); + _cardList = new List(); - // hold onto the card objects - _hssCardNameMap = new SortedDictionary(); + // hold onto the card objects + _hssCardNameMap = new SortedDictionary(); - _selfTestResult = SelfTestResult.Unknown; + _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - /// - /// - /// - /// - public CommFpgaHssubChassisSs(string name) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _cardList = new List(); + /// + /// + /// + /// + public CommFpgaHssubChassisSs(string deviceName) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _cardList = new List(); - // hold onto the card objects - _hssCardNameMap = new SortedDictionary(); + // hold onto the card objects + _hssCardNameMap = new SortedDictionary(); - _selfTestResult = SelfTestResult.Unknown; + _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - /// - /// - /// - /// - public void AddCard(CardInfo cardInfo) - { - _cardList.Add(cardInfo); - } + /// + /// + /// + /// + public void AddCard(CardInfo cardInfo) + { + _cardList.Add(cardInfo); + } - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a FPGA HSS Chassis SS " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a FPGA HSS Chassis SS " + _name; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this object's resources. - /// - public void Dispose() - { - // lock up the FPGA resource - lock (_syncObj) - { - try - { - Dispose(true); + /// + /// Dispose of this object's resources. + /// + public void Dispose() + { + // lock up the FPGA resource + lock (_syncObj) + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + GC.SuppressFinalize(this); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - /// - public string GetMemMap(string fpga) - { - // lock up the FPGA resource - lock (_syncObj) - { - return _hssCardNameMap[fpga].GetMemMap(); - } - } + /// + /// + /// + /// + /// + public string GetMemMap(string fpga) + { + // lock up the FPGA resource + lock (_syncObj) + { + return _hssCardNameMap[fpga].GetMemMap(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - Initialize(string.Empty); - } + /// + /// + /// + public void Initialize() + { + Initialize(string.Empty); + } - /// - /// - /// - /// - public void Initialize(string fpga) - { - // lock up the FPGA resource - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - // init each card - for (int i = 0; i < _cardList.Count; i++) - { - CreateCard(_cardList[i].cardName, _cardList[i].cardAddress, _cardList[i].startingOffset, _cardList[i].cardFirmwareFile, _cardList[i].memMap); - } + /// + /// + /// + /// + public void Initialize(string fpga) + { + // lock up the FPGA resource + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + // init each card + for (int i = 0; i < _cardList.Count; i++) + { + CreateCard(_cardList[i].cardName, _cardList[i].cardAddress, _cardList[i].startingOffset, _cardList[i].cardFirmwareFile, _cardList[i].memMap); + } - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Unknown; - return _selfTestResult; - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Unknown; + return _selfTestResult; + } - /// - /// - /// - /// - /// - /// - public uint Read(string fpgaName, uint address) - { - // lock up the FPGA resource - lock (_syncObj) - { - return _hssCardNameMap[fpgaName].Read(fpgaName, address); - } - } + /// + /// + /// + /// + /// + /// + public uint Read(string fpgaName, uint address) + { + // lock up the FPGA resource + lock (_syncObj) + { + return _hssCardNameMap[fpgaName].Read(fpgaName, address); + } + } - /// - /// - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - // lock up the FPGA resource - lock (_syncObj) - { - _hssCardNameMap[fpgaName].ReadBlock(fpgaName, address, numberOfWordsToRead, shallWeIncrementAddress, ref dataRead); - } - } + /// + /// + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + // lock up the FPGA resource + lock (_syncObj) + { + _hssCardNameMap[fpgaName].ReadBlock(fpgaName, address, numberOfWordsToRead, shallWeIncrementAddress, ref dataRead); + } + } - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public void Shutdown() - { - // lock up the FPGA resource - lock (_syncObj) - { - if (_state == State.Ready) - { - foreach (KeyValuePair entry in _hssCardNameMap) - { - entry.Value.Dispose(); - } + /// + /// + /// + public void Shutdown() + { + // lock up the FPGA resource + lock (_syncObj) + { + if (_state == State.Ready) + { + foreach (KeyValuePair entry in _hssCardNameMap) + { + entry.Value.Dispose(); + } - _state = State.Uninitialized; - } - } - } + _state = State.Uninitialized; + } + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - /// - /// - public void Write(string fpgaName, uint address, uint value) - { - // lock up the FPGA resource - lock (_syncObj) - { - _hssCardNameMap[fpgaName].Write(fpgaName, address, value); - } - } + /// + /// + /// + /// + /// + /// + public void Write(string fpgaName, uint address, uint value) + { + // lock up the FPGA resource + lock (_syncObj) + { + _hssCardNameMap[fpgaName].Write(fpgaName, address, value); + } + } - /// - /// - /// - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - // lock up the FPGA resource - lock (_syncObj) - { - _hssCardNameMap[fpgaName].WriteBlock(fpgaName, address, numberOfWordsToWrite, data, shallWeIncrementAddress); - } - } + /// + /// + /// + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + // lock up the FPGA resource + lock (_syncObj) + { + _hssCardNameMap[fpgaName].WriteBlock(fpgaName, address, numberOfWordsToWrite, data, shallWeIncrementAddress); + } + } - #endregion + #endregion - } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisSs/CommFpgaHssubChassisSsFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisSs/CommFpgaHssubChassisSsFactory.cs index 2525aec..67f9b4e 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisSs/CommFpgaHssubChassisSsFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisSs/CommFpgaHssubChassisSsFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubChassisSsFactory")] - public class CommFpgaHssubChassisSsFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubChassisSsFactory")] + public class CommFpgaHssubChassisSsFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommFpgaHssubChassisSsFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaHssubChassisSsFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommFpgaHssubChassisSsFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommFpgaHssubChassisSsFactory injection constructor + /// + [ImportingConstructor] + public CommFpgaHssubChassisSsFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaHssubChassisSs(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommFpgaHssubChassisSs(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); else - return new CommFpgaHssubChassisSs(name, _configurationManager, _logger); + return new CommFpgaHssubChassisSs(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisTs/CommFpgaHssubChassisTs.cs b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisTs/CommFpgaHssubChassisTs.cs index 21c056c..2918db5 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisTs/CommFpgaHssubChassisTs.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisTs/CommFpgaHssubChassisTs.cs @@ -15,703 +15,660 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using FpgaMeasurementInstrumentsLib; -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; +using FpgaMeasurementInstrumentsLib; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A class that implements the Teradyne HSS Test Station Chassis - /// - public unsafe class CommFpgaHssubChassisTs : IFpgaComm - { - #region PrivateClassMembers - public struct LocalBusParams - { - public int cardHandle; - public int address; - public int data; - } + /// + /// A class that implements the Teradyne HSS Test Station Chassis + /// + public unsafe class CommFpgaHssubChassisTs : IFpgaComm + { + #region PrivateClassMembers + public struct LocalBusParams + { + public int cardHandle; + public int address; + public int data; + } - public struct CardInfo - { - public string cardName; - public string cardAddress; - public int startingOffset; - public string cardFirmwareFile; - public string memMap; - } + public struct CardInfo + { + public string cardName; + public string cardAddress; + public int startingOffset; + public string cardFirmwareFile; + public string memMap; + } - private static object _syncObj = new Object(); + private static object _syncObj = new Object(); - private SortedDictionary _hssCardNameMap; - private SortedDictionary _hssCardHandleMap; + private SortedDictionary _hssCardNameMap; + private SortedDictionary _hssCardHandleMap; - private readonly string _chassisAddress; - private readonly string _killHandlerAppName; - private readonly string _msgHandlerAppName; - private uint _chassisHandle; - private int _hssubAppInit; - private int _hssubSubSystemApp; - private int _hssubSubSystemAppSync; - private int _hssubCloseAppSync; - private int _hssubKillApp; - private int _hsiHandle; - private List _cardList; - private SelfTestResult _selfTestResult; - private State _state; - private string _name; + private readonly string _chassisAddress; + private readonly string _killHandlerAppName; + private readonly string _msgHandlerAppName; + private uint _chassisHandle; + private int _hssubAppInit; + private int _hssubSubSystemApp; + private int _hssubSubSystemAppSync; + private int _hssubCloseAppSync; + private int _hssubKillApp; + private int _hsiHandle; + private List _cardList; + private SelfTestResult _selfTestResult; + private State _state; + private string _name; - private HssubNativeMethods.MessageCallbackDelagate _callBack; + private HssubNativeMethods.MessageCallbackDelagate _callBack; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + /// + /// NLog logger + /// + private readonly ILogger _logger; + /// + /// Raytheon configuration + /// + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #endregion + #endregion - #region PrivateFuctions + #region PrivateFuctions - /// - /// The finalizer. - /// - ~CommFpgaHssubChassisTs() - { - Dispose(false); - } + /// + /// The finalizer. + /// + ~CommFpgaHssubChassisTs() + { + Dispose(false); + } - /// - /// - /// - /// - /// - /// - /// - private void CreateCard(string cardName, string cardAddress, int startingOffset, string cardFirmwareFile, string memMap) - { - lock (_syncObj) - { - // create the card - CommFpgaHssubCardTs card = new CommFpgaHssubCardTs(cardName, cardAddress, startingOffset, cardFirmwareFile, _chassisHandle, _hssubSubSystemApp, _hssubSubSystemAppSync, memMap); + /// + /// + /// + /// + /// + /// + /// + private void CreateCard(string cardName, string cardAddress, int startingOffset, string cardFirmwareFile, string memMap) + { + lock (_syncObj) + { + // create the card + CommFpgaHssubCardTs card = new CommFpgaHssubCardTs(cardName, cardAddress, startingOffset, cardFirmwareFile, _chassisHandle, _hssubSubSystemApp, _hssubSubSystemAppSync, memMap); - // wait for the chassis to respond - HssUtilTs.WaitForSync(_chassisHandle, _hssubSubSystemAppSync, _name); + // wait for the chassis to respond + HssUtilTs.WaitForSync(_chassisHandle, _hssubSubSystemAppSync, _name); - // make sure the chassis gave us a good card handle - if (_hsiHandle == 0) - { - throw new Exception("_hsiHandle is 0"); - } + // make sure the chassis gave us a good card handle + if (_hsiHandle == 0) + { + throw new Exception("_hsiHandle is 0"); + } - // give the card its handle - card.SetHandle(_hsiHandle); + // give the card its handle + card.SetHandle(_hsiHandle); - // hold onto the card - _hssCardNameMap[cardName] = card; - _hssCardHandleMap[_hsiHandle] = card; + // hold onto the card + _hssCardNameMap[cardName] = card; + _hssCardHandleMap[_hsiHandle] = card; - // set the _hsiHandle back to zero for the next card - _hsiHandle = 0; - } - } + // set the _hsiHandle back to zero for the next card + _hsiHandle = 0; + } + } - /// - /// Dispose of this object's resources. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - lock (_syncObj) - { - if (_state == State.Ready) - { - int ret = HssubNativeMethods.terHss_close(_chassisHandle); + /// + /// Dispose of this object's resources. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + lock (_syncObj) + { + if (_state == State.Ready) + { + int ret = HssubNativeMethods.terHss_close(_chassisHandle); - _state = State.Uninitialized; - } - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _state = State.Uninitialized; + } + } + } + } - /// - /// - /// - private void InitChassis() - { - //0 is VI_FALSE, 1 is VI_TRUE - int ret = HssubNativeMethods.terHss_init(_chassisAddress, 0, 1, ref _chassisHandle); + /// + /// + /// + private void InitChassis() + { + //0 is VI_FALSE, 1 is VI_TRUE + int ret = HssubNativeMethods.terHss_init(_chassisAddress, 0, 1, ref _chassisHandle); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_init returned returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_init returned returned an error(" + ret + ")" + ": " + errorStr); + } - // start the message application - LoadMessageApp(); - } + // start the message application + LoadMessageApp(); + } - /// - /// - /// - private void LoadMessageApp() - { - int ret = HssubNativeMethods.terHss_Application_CreateSyncObject(_chassisHandle, "AppInit", ref _hssubAppInit); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + /// + /// + /// + private void LoadMessageApp() + { + int ret = HssubNativeMethods.terHss_Application_CreateSyncObject(_chassisHandle, "AppInit", ref _hssubAppInit); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_Application_CreateSyncObject(AppInit) returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_Application_CreateSyncObject(AppInit) returned an error(" + ret + ")" + ": " + errorStr); + } - ret = HssubNativeMethods.terHss_Application_CreateSyncObject(_chassisHandle, "AppSync", ref _hssubSubSystemAppSync); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + ret = HssubNativeMethods.terHss_Application_CreateSyncObject(_chassisHandle, "AppSync", ref _hssubSubSystemAppSync); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_Application_CreateSyncObject(AppSync) returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_Application_CreateSyncObject(AppSync) returned an error(" + ret + ")" + ": " + errorStr); + } - ret = HssubNativeMethods.terHss_Application_CreateSyncObject(_chassisHandle, "SubAppQuit", ref _hssubCloseAppSync); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + ret = HssubNativeMethods.terHss_Application_CreateSyncObject(_chassisHandle, "SubAppQuit", ref _hssubCloseAppSync); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_Application_CreateSyncObject(SubAppQuit) returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_Application_CreateSyncObject(SubAppQuit) returned an error(" + ret + ")" + ": " + errorStr); + } - ret = HssubNativeMethods.terHss_Application_RegisterMessageCallback(_chassisHandle, _callBack); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + ret = HssubNativeMethods.terHss_Application_RegisterMessageCallback(_chassisHandle, _callBack); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_Application_RegisterMessageCallback() returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_Application_RegisterMessageCallback() returned an error(" + ret + ")" + ": " + errorStr); + } - ret = HssubNativeMethods.terHss_Subsystem_SendFile(_chassisHandle, _killHandlerAppName, "c:\\temp\\killhndlr.bat", HssubNativeMethods.TERHSS_OPTION_ALLOW_OVERWRITE); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + ret = HssubNativeMethods.terHss_Subsystem_SendFile(_chassisHandle, _killHandlerAppName, "c:\\temp\\killhndlr.bat", HssubNativeMethods.TERHSS_OPTION_ALLOW_OVERWRITE); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_SubSyste_SendFile(Killer App) returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_SubSyste_SendFile(Killer App) returned an error(" + ret + ")" + ": " + errorStr); + } - ret = HssubNativeMethods.terHss_Application_Load(_chassisHandle, "Killer App", "c:\\temp\\killhndlr.bat", ref _hssubKillApp); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + ret = HssubNativeMethods.terHss_Application_Load(_chassisHandle, "Killer App", "c:\\temp\\killhndlr.bat", ref _hssubKillApp); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_Application_Load(Killer App) returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_Application_Load(Killer App) returned an error(" + ret + ")" + ": " + errorStr); + } - ret = HssubNativeMethods.terHss_Application_Start(_chassisHandle, _hssubKillApp, "", 1); - /*if (ret != 0) + ret = HssubNativeMethods.terHss_Application_Start(_chassisHandle, _hssubKillApp, "", 1); + /*if (ret != 0) { string errorStr = HssUtil.BuildErrorString(_chassisHandle, ret, _chassisLogicalName); throw new Exception("terHss_Application_Start(Killer App) returned an error(" + ret + ")" + ": " + errorStr); }*/ - ret = HssubNativeMethods.terHss_Subsystem_SendFile(_chassisHandle, _msgHandlerAppName, "c:\\temp\\hndlr.exe", HssubNativeMethods.TERHSS_OPTION_ALLOW_OVERWRITE); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + ret = HssubNativeMethods.terHss_Subsystem_SendFile(_chassisHandle, _msgHandlerAppName, "c:\\temp\\hndlr.exe", HssubNativeMethods.TERHSS_OPTION_ALLOW_OVERWRITE); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_SubSyste_SendFile(Msg Handler App) returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_SubSyste_SendFile(Msg Handler App) returned an error(" + ret + ")" + ": " + errorStr); + } - ret = HssubNativeMethods.terHss_Application_Load(_chassisHandle, "Subsystem App", "c:\\temp\\hndlr.exe", ref _hssubSubSystemApp); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + ret = HssubNativeMethods.terHss_Application_Load(_chassisHandle, "Subsystem App", "c:\\temp\\hndlr.exe", ref _hssubSubSystemApp); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_Application_Load(Msg Handler App) returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_Application_Load(Msg Handler App) returned an error(" + ret + ")" + ": " + errorStr); + } - ret = HssubNativeMethods.terHss_Application_Start(_chassisHandle, _hssubSubSystemApp, "", HssubNativeMethods.TERHSS_TIMEOUT_60SEC); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + ret = HssubNativeMethods.terHss_Application_Start(_chassisHandle, _hssubSubSystemApp, "", HssubNativeMethods.TERHSS_TIMEOUT_60SEC); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - throw new Exception("terHss_Application_Start(Msg Handler App) returned an error(" + ret + ")" + ": " + errorStr); - } + throw new Exception("terHss_Application_Start(Msg Handler App) returned an error(" + ret + ")" + ": " + errorStr); + } - // wait for the chassis to respond - HssUtilTs.WaitForSync(_chassisHandle, _hssubAppInit, _name); - } + // wait for the chassis to respond + HssUtilTs.WaitForSync(_chassisHandle, _hssubAppInit, _name); + } - /// - /// - /// - /// - /// - /// - /// - /// - private void MessageCallback(uint sessionHandle, int applicationHandle, int messageContext, uint messageSize, byte* pMessage) - { - try - { - //ErrorLogger.Instance().Write("received message ID: " + messageContext.ToString(), ErrorLogger.LogLevel.INFO); + /// + /// + /// + /// + /// + /// + /// + /// + private void MessageCallback(uint sessionHandle, int applicationHandle, int messageContext, uint messageSize, byte* pMessage) + { + try + { + if (messageContext == HssubNativeMethods.MESSAGE_CONTEXT_INIT_INSTRUMENT) + { + int* pTemp = (int*)pMessage; + _hsiHandle = *pTemp; + } + else if (messageContext == HssubNativeMethods.MESSAGE_CONTEXT_LB_READ32) + { + // get data into array and convert to the LocalBusParams structure + byte[] arr = new byte[messageSize]; - if (messageContext == HssubNativeMethods.MESSAGE_CONTEXT_INIT_INSTRUMENT) - { - int* pTemp = (int*)pMessage; - _hsiHandle = *pTemp; - } - else if (messageContext == HssubNativeMethods.MESSAGE_CONTEXT_LB_READ32) - { - // get data into array and convert to the LocalBusParams structure - byte[] arr = new byte[messageSize]; + Marshal.Copy((IntPtr)pMessage, arr, 0, (int)messageSize); - Marshal.Copy((IntPtr)pMessage, arr, 0, (int)messageSize); + HssUtilTs.LocalBusParams lbParams = HssUtilTs.ByteArrayToLocalBusParms(arr); - HssUtilTs.LocalBusParams lbParams = HssUtilTs.ByteArrayToLocalBusParms(arr); + _hssCardHandleMap[lbParams.cardHandle].SetLocalBusRxData(lbParams.address, lbParams.data); + } + } + catch { } + } - _hssCardHandleMap[lbParams.cardHandle].SetLocalBusRxData(lbParams.address, lbParams.data); - } - /*else if (messageContext == HssubNativeMethods.MESSAGE_CONTEXT_LB_WRITE32)//@@@ this case does not exist... - { - //HssubChassis.LocalBusParams lbParams = HssUtil.ByteArrayToLocalBusParms(message); + #endregion - //_hssCardHandleMap[lbParams.cardHandle].SetLocalBusRxData(lbParams.address, lbParams.data); - }*/ - else - { - //ErrorLogger.Instance().Write("" + messageContext + " not yet handled"); - } - } - catch (Exception) - { - //ErrorLogger.Instance().Write("" + err.Message); - } - } + #region PublicFuctions - #endregion + /// + /// CommFpgaHssubChassisTs factory constructor + /// + /// + /// + public CommFpgaHssubChassisTs(string deviceName, IConfigurationManager configurationManager, ILogger logger) + { + Name = deviceName; - #region PublicFuctions + _logger = logger; - /// - /// CommFpgaHssubChassisTs factory constructor - /// - /// - /// - public CommFpgaHssubChassisTs(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _logger = logger; + _chassisAddress = _configuration.GetConfigurationValue("CommFpgaHssubChassisTs", "ChassisAddress", "127.0.0.1"); + _killHandlerAppName = _configuration.GetConfigurationValue("CommFpgaHssubChassisTs", "KillHandlerAppName", ""); + _msgHandlerAppName = _configuration.GetConfigurationValue("CommFpgaHssubChassisTs", "MsgHandlerAppName", ""); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _cardList = new List(); - _chassisAddress = _configuration.GetConfigurationValue("CommFpgaHssubChassisTs", "ChassisAddress", "127.0.0.1"); - _killHandlerAppName = _configuration.GetConfigurationValue("CommFpgaHssubChassisTs", "KillHandlerAppName", ""); - _msgHandlerAppName = _configuration.GetConfigurationValue("CommFpgaHssubChassisTs", "MsgHandlerAppName", ""); + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; - _cardList = new List(); + // hold onto callback + _callBack = new HssubNativeMethods.MessageCallbackDelagate(MessageCallback); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; + // _chassisHandle gets set in Initialize + _chassisHandle = 0; - // hold onto callback - _callBack = new HssubNativeMethods.MessageCallbackDelagate(MessageCallback); + // these get initialized in LoadMessageApp() + _hssubAppInit = 0; + _hssubSubSystemApp = 0; + _hssubSubSystemAppSync = 0; + _hssubCloseAppSync = 0; + _hssubKillApp = 0; - // _chassisHandle gets set in Initialize - _chassisHandle = 0; + // this is for card handles, it gets set in the MessageCallback() and passed over to the card object + _hsiHandle = 0; - // these get initialized in LoadMessageApp() - _hssubAppInit = 0; - _hssubSubSystemApp = 0; - _hssubSubSystemAppSync = 0; - _hssubCloseAppSync = 0; - _hssubKillApp = 0; + // hold onto the card objects + _hssCardNameMap = new SortedDictionary(); + _hssCardHandleMap = new SortedDictionary(); + } - // this is for card handles, it gets set in the MessageCallback() and passed over to the card object - _hsiHandle = 0; + /// + /// + /// + /// + /// + /// + /// + public CommFpgaHssubChassisTs(string name, string chassisAddress, string killHandlerAppName, string msgHandlerAppName) + { + // hang onto passed in args + _name = name; + _logger = LogManager.GetCurrentClassLogger(); + _chassisAddress = chassisAddress; + _killHandlerAppName = killHandlerAppName; + _msgHandlerAppName = msgHandlerAppName; + _cardList = new List(); - // hold onto the card objects - _hssCardNameMap = new SortedDictionary(); - _hssCardHandleMap = new SortedDictionary(); - } + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; - /// - /// - /// - /// - /// - /// - /// - public CommFpgaHssubChassisTs(string name, string chassisAddress, string killHandlerAppName, string msgHandlerAppName) - { - // hang onto passed in args - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _chassisAddress = chassisAddress; - _killHandlerAppName = killHandlerAppName; - _msgHandlerAppName = msgHandlerAppName; - _cardList = new List(); + // hold onto callback + _callBack = new HssubNativeMethods.MessageCallbackDelagate(MessageCallback); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; + // _chassisHandle gets set in Initialize + _chassisHandle = 0; - // hold onto callback - _callBack = new HssubNativeMethods.MessageCallbackDelagate(MessageCallback); + // these get initialized in LoadMessageApp() + _hssubAppInit = 0; + _hssubSubSystemApp = 0; + _hssubSubSystemAppSync = 0; + _hssubCloseAppSync = 0; + _hssubKillApp = 0; - // _chassisHandle gets set in Initialize - _chassisHandle = 0; + // this is for card handles, it gets set in the MessageCallback() and passed over to the card object + _hsiHandle = 0; - // these get initialized in LoadMessageApp() - _hssubAppInit = 0; - _hssubSubSystemApp = 0; - _hssubSubSystemAppSync = 0; - _hssubCloseAppSync = 0; - _hssubKillApp = 0; + // hold onto the card objects + _hssCardNameMap = new SortedDictionary(); + _hssCardHandleMap = new SortedDictionary(); + } - // this is for card handles, it gets set in the MessageCallback() and passed over to the card object - _hsiHandle = 0; + /// + /// + /// + /// + public void AddCard(CardInfo cardInfo) + { + // lock up the FPGA resource + lock (_syncObj) + { + _cardList.Add(cardInfo); + } + } - // hold onto the card objects - _hssCardNameMap = new SortedDictionary(); - _hssCardHandleMap = new SortedDictionary(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } - /// - /// - /// - /// - public void AddCard(CardInfo cardInfo) - { - // lock up the FPGA resource - lock (_syncObj) - { - _cardList.Add(cardInfo); - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a FPGA HSS TS called " + _name; + } + } - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a FPGA HSS TS called " + _name; - } - } + /// + /// Dispose of this object's resources. + /// + public void Dispose() + { + // lock up the FPGA resource + lock (_syncObj) + { + Dispose(true); - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + GC.SuppressFinalize(this); + } + } - /// - /// Dispose of this object's resources. - /// - public void Dispose() - { - // lock up the FPGA resource - lock (_syncObj) - { - try - { - Dispose(true); + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public void Initialize() + { + throw new NotImplementedException(); + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + /// + public void Initialize(string fpga) + { + // lock up the FPGA resource + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + InitChassis(); - /// - /// - /// - public void Initialize() - { - throw new NotImplementedException(); - } + // init each card + for (int i = 0; i < _cardList.Count; i++) + { + CreateCard(_cardList[i].cardName, _cardList[i].cardAddress, _cardList[i].startingOffset, _cardList[i].cardFirmwareFile, _cardList[i].memMap); + } - /// - /// - /// - /// - public void Initialize(string fpga) - { - // lock up the FPGA resource - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - InitChassis(); + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } - // init each card - for (int i = 0; i < _cardList.Count; i++) - { - CreateCard(_cardList[i].cardName, _cardList[i].cardAddress, _cardList[i].startingOffset, _cardList[i].cardFirmwareFile, _cardList[i].memMap); - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + // lock up the FPGA resource + lock (_syncObj) + { + short testResults = -1; - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } + StringBuilder errorStrTemp = new StringBuilder(512); - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - // lock up the FPGA resource - lock (_syncObj) - { - short testResults = -1; + int ret = HssubNativeMethods.terHss_self_test(_chassisHandle, ref testResults, errorStrTemp); - StringBuilder errorStrTemp = new StringBuilder(512); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - int ret = HssubNativeMethods.terHss_self_test(_chassisHandle, ref testResults, errorStrTemp); + throw new Exception("terHss_self_test returned an error(" + ret + ")" + ": " + errorStr); + } + else if (testResults != 0) + { + _selfTestResult = SelfTestResult.Fail; + throw new Exception("HSSub Self Test returned an error: " + testResults.ToString() + ": " + errorStrTemp.ToString()); + } + else + { + _selfTestResult = SelfTestResult.Pass; + } - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + return _selfTestResult; + } + } - throw new Exception("terHss_self_test returned an error(" + ret + ")" + ": " + errorStr); - } - else if (testResults != 0) - { - _selfTestResult = SelfTestResult.Fail; - throw new Exception("HSSub Self Test returned an error: " + testResults.ToString() + ": " + errorStrTemp.ToString()); - } - else - { - _selfTestResult = SelfTestResult.Pass; - } + /// + /// + /// + /// + /// + /// + public uint Read(string fpgaName, uint address) + { + // lock up the FPGA resource + lock (_syncObj) + { + return _hssCardNameMap[fpgaName].Read(fpgaName, address); + } + } - return _selfTestResult; - } - } + /// + /// + /// + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + // lock up the FPGA resource + lock (_syncObj) + { + _hssCardNameMap[fpgaName].ReadBlock(fpgaName, address, numberOfWordsToRead, shallWeIncrementAddress, ref dataRead); + } + } - /// - /// - /// - /// - /// - /// - public uint Read(string fpgaName, uint address) - { - // lock up the FPGA resource - lock (_syncObj) - { - return _hssCardNameMap[fpgaName].Read(fpgaName, address); - } - } + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - // lock up the FPGA resource - lock (_syncObj) - { - _hssCardNameMap[fpgaName].ReadBlock(fpgaName, address, numberOfWordsToRead, shallWeIncrementAddress, ref dataRead); - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public void Shutdown() + { + // lock up the FPGA resource + lock (_syncObj) + { + if (_state == State.Ready) + { + int ret = HssubNativeMethods.terHss_close(_chassisHandle); - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + _state = State.Uninitialized; + } + } + } - /// - /// - /// - public void Shutdown() - { - // lock up the FPGA resource - lock (_syncObj) - { - if (_state == State.Ready) - { - int ret = HssubNativeMethods.terHss_close(_chassisHandle); + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - _state = State.Uninitialized; - } - } - } + /// + /// + /// + /// + /// + /// + public void Write(string fpgaName, uint address, uint value) + { + // lock up the FPGA resource + lock (_syncObj) + { + _hssCardNameMap[fpgaName].Write(fpgaName, address, value); + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + // lock up the FPGA resource + lock (_syncObj) + { + _hssCardNameMap[fpgaName].WriteBlock(fpgaName, address, numberOfWordsToWrite, data, shallWeIncrementAddress); + } + } - /// - /// - /// - /// - /// - /// - public void Write(string fpgaName, uint address, uint value) - { - // lock up the FPGA resource - lock (_syncObj) - { - _hssCardNameMap[fpgaName].Write(fpgaName, address, value); - } - } + /// + /// Loads firmware + /// + /// + public void LoadFirmware(string fpgaName) + { + Initialize(fpgaName); + } - /// - /// - /// - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - // lock up the FPGA resource - lock (_syncObj) - { - _hssCardNameMap[fpgaName].WriteBlock(fpgaName, address, numberOfWordsToWrite, data, shallWeIncrementAddress); - } - } - - /// - /// Loads firmware - /// - /// - public void LoadFirmware(string fpgaName) - { - Initialize(fpgaName); - } - - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisTs/CommFpgaHssubChassisTsFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisTs/CommFpgaHssubChassisTsFactory.cs index d5370bf..332536a 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisTs/CommFpgaHssubChassisTsFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaHssubChassisTs/CommFpgaHssubChassisTsFactory.cs @@ -30,71 +30,71 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubChassisTsFactory")] - public class CommFpgaHssubChassisTsFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubChassisTsFactory")] + public class CommFpgaHssubChassisTsFactory : IInstrumentFactory + { + /// + /// The supported interfaces + /// + private readonly List _supportedInterfaces = new List(); + private ILogger _logger; + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - public CommFpgaHssubChassisTsFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + public CommFpgaHssubChassisTsFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaHssubChassisTsFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + /// + /// COECommDeviceInstrumentFactory injection constructor + /// + /// + /// + /// + [ImportingConstructor] + public CommFpgaHssubChassisTsFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaHssubChassisTs(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + _logger = LogManager.GetLogger(name); + return new CommFpgaHssubChassisTs(name, _configurationManager, _logger); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -108,7 +108,7 @@ namespace Raytheon.Instruments _logger = LogManager.GetLogger(name); if (simulateHw) - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); else return new CommFpgaHssubChassisTs(name, _configurationManager, _logger); } @@ -123,17 +123,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaSim/CommFpgaSim.cs b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaSim/CommFpgaSim.cs index aade51e..3654a17 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaSim/CommFpgaSim.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaSim/CommFpgaSim.cs @@ -15,389 +15,353 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.Threading; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A simulated fpga - /// - public class CommFpgaSim : IFpgaComm - { - #region PrivateClassMembers - private Dictionary _registers; - private static object _syncObj = new Object(); - private SelfTestResult _selfTestResult; - private State _state; - private string _name; + /// + /// A simulated fpga + /// + public class CommFpgaSim : IFpgaComm + { + #region PrivateClassMembers + private Dictionary _registers; + private static object _syncObj = new Object(); + private SelfTestResult _selfTestResult; + private State _state; + private string _name; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions - /// - /// The finalizer. - /// - ~CommFpgaSim() - { - Dispose(false); - } + #endregion - /// - /// - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + #region PrivateFunctions + /// + /// The finalizer. + /// + ~CommFpgaSim() + { + Dispose(false); + } - #region PublicFuctions + /// + /// + /// + /// + protected virtual void Dispose(bool disposing) + { + } + #endregion - /// - /// CommFpgaSim factory constructor - /// - /// - /// - public CommFpgaSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFuctions - _logger = logger; + /// + /// CommFpgaSim factory constructor + /// + /// + /// + public CommFpgaSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - _registers = null; - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - /// - /// - /// - /// - public CommFpgaSim(string name) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - _registers = null; - } + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + _registers = null; + } - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } + /// + /// + /// + /// + public CommFpgaSim(string name) + { + _name = name; + _logger = LogManager.GetCurrentClassLogger(); + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + _registers = null; + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a FPGA Sim called " + _name; - } - } + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a FPGA Sim called " + _name; + } + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } - /// - /// - /// - public void Dispose() - { - lock (_syncObj) - { - try - { - Dispose(true); + set + { + throw new NotImplementedException(); + } + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + /// + /// + /// + public void Dispose() + { + lock (_syncObj) + { + Dispose(true); - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } + GC.SuppressFinalize(this); + } + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - throw new NotImplementedException(); - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - public void Initialize(string fpga) - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - _state = State.Ready; - _registers = new Dictionary(); - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } + /// + /// + /// + public void Initialize() + { + throw new NotImplementedException(); + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } + /// + /// + /// + /// + public void Initialize(string fpga) + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + _registers = new Dictionary(); + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Unknown; - return _selfTestResult; - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } - /// - /// - /// - /// - /// - /// - public uint Read(string fpgaName, uint address) - { - lock (_syncObj) - { - Thread.Sleep(50); + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Unknown; + return _selfTestResult; + } - if (_registers.ContainsKey(address) == true) - { - return _registers[address]; - } - else - { - return 0xffffffff; - } - } - } + /// + /// + /// + /// + /// + /// + public uint Read(string fpgaName, uint address) + { + lock (_syncObj) + { + Thread.Sleep(50); - /// - /// - /// - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - lock (_syncObj) - { - Thread.Sleep(50); + if (_registers.ContainsKey(address) == true) + { + return _registers[address]; + } + else + { + return 0xffffffff; + } + } + } - for (int i = 0; i < numberOfWordsToRead; i++) - { - dataRead[i] = Read(fpgaName, address); + /// + /// + /// + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + lock (_syncObj) + { + Thread.Sleep(50); - if (shallWeIncrementAddress == true) - { - address += 4; - } - } - } - } + for (int i = 0; i < numberOfWordsToRead; i++) + { + dataRead[i] = Read(fpgaName, address); - /// - /// - /// - public void Reset() - { - Shutdown(); + if (shallWeIncrementAddress == true) + { + address += 4; + } + } + } + } - Initialize(); - } + /// + /// + /// + public void Reset() + { + Shutdown(); - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + Initialize(); + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public void Shutdown() - { - _state = State.Uninitialized; - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - /// - /// - public void Write(string fpgaName, uint address, uint value) - { - lock (_syncObj) - { - Thread.Sleep(50); + /// + /// + /// + public void Shutdown() + { + _state = State.Uninitialized; + } - _registers[address] = value; - } - } + /// + /// + /// + /// + /// + /// + public void Write(string fpgaName, uint address, uint value) + { + lock (_syncObj) + { + Thread.Sleep(50); - /// - /// - /// - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - lock (_syncObj) - { - Thread.Sleep(50); + _registers[address] = value; + } + } - for (int i = 0; i < numberOfWordsToWrite; i++) - { - uint dataItem = data[i]; + /// + /// + /// + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + lock (_syncObj) + { + Thread.Sleep(50); - Write(fpgaName, address, dataItem); + for (int i = 0; i < numberOfWordsToWrite; i++) + { + uint dataItem = data[i]; - if (shallWeIncrementAddress == true) - { - address += 4; - } - } - } - } + Write(fpgaName, address, dataItem); - /// - /// Loads firmware - /// - /// - public void LoadFirmware(string fpgaName) - { - Initialize(fpgaName); - } + if (shallWeIncrementAddress == true) + { + address += 4; + } + } + } + } - #endregion - } + /// + /// Loads firmware + /// + /// + public void LoadFirmware(string fpgaName) + { + Initialize(fpgaName); + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaSim/CommFpgaSimFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaSim/CommFpgaSimFactory.cs index d01ba50..e9237f9 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/FpgaSim/CommFpgaSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/FpgaSim/CommFpgaSimFactory.cs @@ -30,71 +30,63 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaSimFactory")] - public class CommFpgaSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaSimFactory")] + public class CommFpgaSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - public CommFpgaSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + public CommFpgaSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + /// + /// CommFpgaSimFactory injection constructor + /// + [ImportingConstructor] + public CommFpgaSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommFpgaSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +97,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); } catch (Exception) { @@ -120,17 +110,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSs/CommFpgaHssubCardSs.cs b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSs/CommFpgaHssubCardSs.cs index 316427c..d849477 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSs/CommFpgaHssubCardSs.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSs/CommFpgaHssubCardSs.cs @@ -15,294 +15,261 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; using FpgaMeasurementInstrumentsLib; using NLog; using Raytheon.Common; -using System; namespace Raytheon.Instruments { - /// - /// A class that implements the Teradyne HSS Sub System Card - /// - public class CommFpgaHssubCardSs : IFpgaComm - { - #region PrivateClassMembers - private readonly string _name; - private readonly string _cardAddress; - private readonly uint _startingOffset; - private readonly string _firmware; - private readonly string _memMap; - private uint _cardHandle; - private SelfTestResult _selfTestResult; + /// + /// A class that implements the Teradyne HSS Sub System Card + /// + public class CommFpgaHssubCardSs : IFpgaComm + { + #region PrivateClassMembers + private readonly string _name; + private readonly string _cardAddress; + private readonly uint _startingOffset; + private readonly string _firmware; + private readonly string _memMap; + private uint _cardHandle; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - public string DetailedStatus => throw new NotImplementedException(); + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public string DetailedStatus => throw new NotImplementedException(); - public InstrumentMetadata Info => throw new NotImplementedException(); + public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public string Name { get; set; } + public InstrumentMetadata Info => throw new NotImplementedException(); - public SelfTestResult SelfTestResult => throw new NotImplementedException(); + public string Name { get; set; } - public State Status => throw new NotImplementedException(); + public SelfTestResult SelfTestResult => throw new NotImplementedException(); - #endregion + public State Status => throw new NotImplementedException(); - #region PrivateFunctions + #endregion - /// - /// - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - int ret = HssubNativeMethods.terHsi_close(_cardHandle); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + #region PrivateFunctions - /// - /// - /// - public void LoadFirmware() - { - ushort customerId = 0; - ushort appId = 0; - uint revId = 0; + /// + /// + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + HssubNativeMethods.terHsi_close(_cardHandle); + } + } - int ret = HssubNativeMethods.terHsi_Firmware_Load(_cardHandle, HssubNativeMethods.TERHSI_FPGA_TEST_DEFINED, _firmware, ref customerId, ref appId, ref revId); - if (ret != 0) - { - string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); + /// + /// + /// + public void LoadFirmware() + { + ushort customerId = 0; + ushort appId = 0; + uint revId = 0; - throw new Exception("terHsi_Firmware_Load() returned an error(" + ret + ")" + ": " + errorStr); - } - } + int ret = HssubNativeMethods.terHsi_Firmware_Load(_cardHandle, HssubNativeMethods.TERHSI_FPGA_TEST_DEFINED, _firmware, ref customerId, ref appId, ref revId); + if (ret != 0) + { + string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); - #endregion + throw new Exception("terHsi_Firmware_Load() returned an error(" + ret + ")" + ": " + errorStr); + } + } - #region PublicFuctions + #endregion - /// - /// CommFpgaHssubCardSs factory constructor - /// - /// - /// - public CommFpgaHssubCardSs(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFuctions - _logger = logger; + /// + /// CommFpgaHssubCardSs factory constructor + /// + /// + /// + public CommFpgaHssubCardSs(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _cardAddress = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "CardAddress", "127.0.0.1"); - _startingOffset = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "StartingOffset", 0); - _firmware = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "Firmware", ""); - _memMap = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "MemMap", ""); - _cardHandle = 0; + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - LoadFirmware(); - } + _cardAddress = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "CardAddress", "127.0.0.1"); + _startingOffset = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "StartingOffset", 0); + _firmware = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "Firmware", ""); + _memMap = _configuration.GetConfigurationValue("CommFpgaHssubCardSs", "MemMap", ""); + _cardHandle = 0; - /// - /// - /// - /// - /// - /// - /// - /// - public CommFpgaHssubCardSs(string name, string cardAddress, int startingOffset, string firmware, string memMap) - { - // hold onto args - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _cardAddress = cardAddress; - _startingOffset = (uint)startingOffset; - _firmware = firmware; - _memMap = memMap; - _cardHandle = 0; + LoadFirmware(); + } - LoadFirmware(); - } + /// + /// + /// + /// + /// + /// + /// + /// + public CommFpgaHssubCardSs(string deviceName, string cardAddress, int startingOffset, string firmware, string memMap) + { + // hold onto args + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _cardAddress = cardAddress; + _startingOffset = (uint)startingOffset; + _firmware = firmware; + _memMap = memMap; + _cardHandle = 0; - /// - /// The finalizer. - /// - ~CommFpgaHssubCardSs() - { - Dispose(false); - } + LoadFirmware(); + } - /// - /// - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// The finalizer. + /// + ~CommFpgaHssubCardSs() + { + Dispose(false); + } - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// + /// + public void Dispose() + { + Dispose(true); - /// - /// - /// - /// - public string GetMemMap() - { - return _memMap; - } + GC.SuppressFinalize(this); + } - /// - /// reads FPGA value from address - /// - /// - /// - /// - /// - public uint Read(string fpgaName, uint address) - { - uint dataRead = 0; - int ret = HssubNativeMethods.terHsi_LB_Read32(_cardHandle, _startingOffset + address, ref dataRead); - if (ret != 0) - { - string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); + /// + /// + /// + /// + public string GetMemMap() + { + return _memMap; + } - throw new Exception("terHsi_LB_Read32() returned an error(" + ret + ")" + ": " + errorStr); - } + /// + /// reads FPGA value from address + /// + /// + /// + /// + /// + public uint Read(string fpgaName, uint address) + { + uint dataRead = 0; + int ret = HssubNativeMethods.terHsi_LB_Read32(_cardHandle, _startingOffset + address, ref dataRead); + if (ret != 0) + { + string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); - return dataRead; - } + throw new Exception("terHsi_LB_Read32() returned an error(" + ret + ")" + ": " + errorStr); + } - /// - /// reads block - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - throw new NotImplementedException(); - } + return dataRead; + } - /// - /// writes value to fpga address - /// - /// - /// - public void Write(string fpgaName, uint address, uint value) - { - int ret = HssubNativeMethods.terHsi_LB_Write32(_cardHandle, _startingOffset + address, value); - if (ret != 0) - { - string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); + /// + /// reads block + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + throw new NotImplementedException(); + } - throw new Exception("terHsi_LB_Write32() returned an error(" + ret + ")" + ": " + errorStr); - } - } + /// + /// writes value to fpga address + /// + /// + /// + public void Write(string fpgaName, uint address, uint value) + { + int ret = HssubNativeMethods.terHsi_LB_Write32(_cardHandle, _startingOffset + address, value); + if (ret != 0) + { + string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); - /// - /// writes block - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - throw new Exception("Not Implemented"); - } + throw new Exception("terHsi_LB_Write32() returned an error(" + ret + ")" + ": " + errorStr); + } + } - /// - /// initialize fpga - /// - /// - public void Initialize(string fpgaName) - { - Initialize(); - } + /// + /// writes block + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + throw new Exception("Not Implemented"); + } - /// - /// Loads firmware - /// - /// - public void LoadFirmware(string fpgaName) - { - Initialize(fpgaName); - } + /// + /// initialize fpga + /// + /// + public void Initialize(string fpgaName) + { + Initialize(); + } - public bool ClearErrors() - { - return false; - } + /// + /// Loads firmware + /// + /// + public void LoadFirmware(string fpgaName) + { + Initialize(fpgaName); + } - public void Initialize() - { - LoadFirmware(); - } + public bool ClearErrors() + { + return false; + } - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Unknown; - return _selfTestResult; - } + public void Initialize() + { + LoadFirmware(); + } - public void Reset() - { - Shutdown(); + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Unknown; + return _selfTestResult; + } - Initialize(); - } + public void Reset() + { + Shutdown(); - public void Shutdown() - { - Dispose(); - } - #endregion - } + Initialize(); + } + + public void Shutdown() + { + Dispose(); + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSs/CommFpgaHssubCardSsFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSs/CommFpgaHssubCardSsFactory.cs index 855d782..35354b3 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSs/CommFpgaHssubCardSsFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSs/CommFpgaHssubCardSsFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubCardSsFactory")] - public class CommFpgaHssubCardSsFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubCardSsFactory")] + public class CommFpgaHssubCardSsFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommFpgaHssubCardSsFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaHssubCardSsFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommFpgaHssubCardSsFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommFpgaHssubCardSsFactory injection constructor + /// + [ImportingConstructor] + public CommFpgaHssubCardSsFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaHssubCardSs(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommFpgaHssubCardSs(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); else - return new CommFpgaHssubCardSs(name, _configurationManager, _logger); + return new CommFpgaHssubCardSs(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSsHsi/CommFpgaHssubCardSsHsi.cs b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSsHsi/CommFpgaHssubCardSsHsi.cs index 8b8ab75..ff39ae6 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSsHsi/CommFpgaHssubCardSsHsi.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSsHsi/CommFpgaHssubCardSsHsi.cs @@ -15,93 +15,86 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; using FpgaMeasurementInstrumentsLib; using NLog; using Raytheon.Common; -using System; namespace Raytheon.Instruments { - /// - /// A class that implements the Teradyne HSS Sub System Card with the HSI Library - /// - public unsafe class CommFpgaHssubCardSsHsi : IFpgaComm - { - #region PrivateClassMembers - private enum Mode - { - PRIMARY_CONTROL, - SECONDARY_CONTROL - }; + /// + /// A class that implements the Teradyne HSS Sub System Card with the HSI Library + /// + public unsafe class CommFpgaHssubCardSsHsi : IFpgaComm + { + #region PrivateClassMembers + private enum Mode + { + PRIMARY_CONTROL, + SECONDARY_CONTROL + }; - private readonly string _cardAddress; - private readonly uint _startingOffset; - private readonly string _cardFirmwareFile; - private uint _cardHandle; - private static object _syncObj = new Object(); - private readonly Mode __mode; - private SelfTestResult _selfTestResult; - private State _state; - private string _name; + private readonly string _cardAddress; + private readonly uint _startingOffset; + private readonly string _cardFirmwareFile; + private uint _cardHandle; + private static object _syncObj = new Object(); + private readonly Mode __mode; + private SelfTestResult _selfTestResult; + private State _state; + private string _name; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFuctions + #endregion - /// - /// The finalizer. - /// - ~CommFpgaHssubCardSsHsi() - { - Dispose(false); - } + #region PrivateFuctions - /// - /// - /// - private void LoadFirmware() - { - // lock up the FPGA resource - lock (_syncObj) - { - //ErrorLogger.Instance().Write("begin for " + _cardAddress.ToString(), ErrorLogger.LogLevel.INFO); + /// + /// The finalizer. + /// + ~CommFpgaHssubCardSsHsi() + { + Dispose(false); + } - ushort customerId = 0; - ushort appId = 0; - uint revId = 0; + /// + /// + /// + private void LoadFirmware() + { + // lock up the FPGA resource + lock (_syncObj) + { + ushort customerId = 0; + ushort appId = 0; + uint revId = 0; - int ret = HssubNativeMethods.terHsi_Firmware_Load(_cardHandle, HssubNativeMethods.TERHSI_FPGA_TEST_DEFINED, _cardFirmwareFile, ref customerId, ref appId, ref revId); - if ((uint)ret == 0xbffa4442) - { - // expected, load still seems to work - } - else if (ret != 0) - { - string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); + int ret = HssubNativeMethods.terHsi_Firmware_Load(_cardHandle, HssubNativeMethods.TERHSI_FPGA_TEST_DEFINED, _cardFirmwareFile, ref customerId, ref appId, ref revId); + if ((uint)ret == 0xbffa4442) + { + // expected, load still seems to work + } + else if (ret != 0) + { + string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); - throw new Exception("terHsi_Firmware_Load() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); - } - } - } + throw new Exception("terHsi_Firmware_Load() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); + } + } + } - /// - /// - /// - private void SelfTest() - { - // loop through each card and command self test + /// + /// + /// + private void SelfTest() + { + // loop through each card and command self test - /*short testResults = -1; + /*short testResults = -1; StringBuilder errorStrTemp = new StringBuilder(512); @@ -117,445 +110,418 @@ namespace Raytheon.Instruments { throw new Exception("HSSub Self Test returned an error: " + testResults.ToString() + ": " + errorStrTemp.ToString()); }*/ - } + } - /// - /// Dispose of this object's resources. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - lock (_syncObj) - { - if (_state == State.Ready) - { - int ret = HssubNativeMethods.terHsi_close(_cardHandle); + /// + /// Dispose of this object's resources. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + lock (_syncObj) + { + if (_state == State.Ready) + { + int ret = HssubNativeMethods.terHsi_close(_cardHandle); - _state = State.Uninitialized; - } - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + _state = State.Uninitialized; + } + } + } + } + #endregion - #region PublicFuctions + #region PublicFuctions - /// - /// CommFpgaHssubCardSsHsi factory constructor - /// - /// - /// - public CommFpgaHssubCardSsHsi(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// CommFpgaHssubCardSsHsi factory constructor + /// + /// + /// + public CommFpgaHssubCardSsHsi(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _cardAddress = _configuration.GetConfigurationValue("CommFpgaHssubCardSsHsi", "CardAddress", "127.0.0.1"); - _startingOffset = _configuration.GetConfigurationValue("CommFpgaHssubCardSsHsi", "StartingOffset", 0); - _cardFirmwareFile = _configuration.GetConfigurationValue("CommFpgaHssubCardSsHsi", "CardFirmwareFile", ""); - _cardHandle = 0; - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - __mode = Mode.PRIMARY_CONTROL; - } + _cardAddress = _configuration.GetConfigurationValue("CommFpgaHssubCardSsHsi", "CardAddress", "127.0.0.1"); + _startingOffset = _configuration.GetConfigurationValue("CommFpgaHssubCardSsHsi", "StartingOffset", 0); + _cardFirmwareFile = _configuration.GetConfigurationValue("CommFpgaHssubCardSsHsi", "CardFirmwareFile", ""); + _cardHandle = 0; + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + __mode = Mode.PRIMARY_CONTROL; + } - /// - /// - /// - /// - /// - /// - /// - /// - public CommFpgaHssubCardSsHsi(string name, string cardAddress, uint startingOffset, string cardFirmwareFile) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _cardAddress = cardAddress; - _startingOffset = startingOffset; - _cardFirmwareFile = cardFirmwareFile; - _cardHandle = 0; - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - __mode = Mode.PRIMARY_CONTROL; - } + /// + /// + /// + /// + /// + /// + /// + /// + public CommFpgaHssubCardSsHsi(string deviceName, string cardAddress, uint startingOffset, string cardFirmwareFile) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _cardAddress = cardAddress; + _startingOffset = startingOffset; + _cardFirmwareFile = cardFirmwareFile; + _cardHandle = 0; + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + __mode = Mode.PRIMARY_CONTROL; + } - /// - /// Overloaded constructor for a secondary hsi control. (Firmware load done elsewhere, device reset done elsewhere) - /// Using this constructor will allow the hsot access to the HSS, but it will not load firmware or reset the device - /// - /// - /// - /// - public CommFpgaHssubCardSsHsi(string name, string cardAddress, uint startingOffset) - { - _name = name; - _cardAddress = cardAddress; - _startingOffset = startingOffset; - _cardFirmwareFile = null; - _cardHandle = 0; - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - __mode = Mode.SECONDARY_CONTROL; - } + /// + /// Overloaded constructor for a secondary hsi control. (Firmware load done elsewhere, device reset done elsewhere) + /// Using this constructor will allow the hsot access to the HSS, but it will not load firmware or reset the device + /// + /// + /// + /// + public CommFpgaHssubCardSsHsi(string deviceName, string cardAddress, uint startingOffset) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _cardAddress = cardAddress; + _startingOffset = startingOffset; + _cardFirmwareFile = null; + _cardHandle = 0; + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + __mode = Mode.SECONDARY_CONTROL; + } - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a FPGA HSS HSI called " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a FPGA HSS HSI called " + _name; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this object's resources. - /// - public void Dispose() - { - // lock up the FPGA resource - lock (_syncObj) - { - try - { - Dispose(true); + /// + /// Dispose of this object's resources. + /// + public void Dispose() + { + // lock up the FPGA resource + lock (_syncObj) + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + GC.SuppressFinalize(this); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - Initialize(string.Empty); - } + /// + /// + /// + public void Initialize() + { + Initialize(string.Empty); + } - /// - /// - /// - /// - public void Initialize(string fpgaName) - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - int ret = HssubNativeMethods.terHsi_init(_cardAddress, 0, 0, ref _cardHandle); + /// + /// + /// + /// + public void Initialize(string fpgaName) + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + int ret = HssubNativeMethods.terHsi_init(_cardAddress, 0, 0, ref _cardHandle); - if (ret != 0) - { - string errorStr = HssUtilSs.BuildErrorString(0, ret, _name); + if (ret != 0) + { + string errorStr = HssUtilSs.BuildErrorString(0, ret, _name); - throw new Exception("terHsi_init returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name + " on card " + _name); - } + throw new Exception("terHsi_init returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name + " on card " + _name); + } - // reset it and load firmware if this is the primary controller of the HSS - if (__mode == Mode.PRIMARY_CONTROL) - { - Reset(); + // reset it and load firmware if this is the primary controller of the HSS + if (__mode == Mode.PRIMARY_CONTROL) + { + Reset(); - LoadFirmware(); - } + LoadFirmware(); + } - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Unknown; - return _selfTestResult; - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Unknown; + return _selfTestResult; + } - /// - /// - /// - /// - /// - /// - public uint Read(string fpgaName, uint address) - { - // lock up the FPGA resource - lock (_syncObj) - { - uint dataRead = 0; - int ret = HssubNativeMethods.terHsi_LB_Read32(_cardHandle, _startingOffset + address, ref dataRead); - if (ret != 0) - { - string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); + /// + /// + /// + /// + /// + /// + public uint Read(string fpgaName, uint address) + { + // lock up the FPGA resource + lock (_syncObj) + { + uint dataRead = 0; + int ret = HssubNativeMethods.terHsi_LB_Read32(_cardHandle, _startingOffset + address, ref dataRead); + if (ret != 0) + { + string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); - throw new Exception("terHsi_LB_Read32() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); - } + throw new Exception("terHsi_LB_Read32() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); + } - return dataRead; - } - } + return dataRead; + } + } - /// - /// - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - // lock up the FPGA resource - lock (_syncObj) - { - throw new NotImplementedException(); - } - } + /// + /// + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + // lock up the FPGA resource + lock (_syncObj) + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { - int ret = HssubNativeMethods.terHsi_reset(_cardHandle); + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + int ret = HssubNativeMethods.terHsi_reset(_cardHandle); - if (ret != 0) - { - string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); + if (ret != 0) + { + string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); - throw new Exception("terHsi_reset() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); - } - } - } + throw new Exception("terHsi_reset() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); + } + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public void Shutdown() - { - // lock up the FPGA resource - lock (_syncObj) - { - string errorMsg = ""; - bool wasThereAnError = false; + /// + /// + /// + public void Shutdown() + { + // lock up the FPGA resource + lock (_syncObj) + { + string errorMsg = ""; + bool wasThereAnError = false; - if (_state == State.Ready) - { - int ret = 0; + if (_state == State.Ready) + { + int ret = 0; - // reset it if this is the primary controller of the HSS - if (__mode == Mode.PRIMARY_CONTROL) - { - ret = HssubNativeMethods.terHsi_reset(_cardHandle); - if (ret != 0) - { - wasThereAnError = true; - errorMsg += "terHsi_reset returned error code: " + ret.ToString() + ". "; - } - } + // reset it if this is the primary controller of the HSS + if (__mode == Mode.PRIMARY_CONTROL) + { + ret = HssubNativeMethods.terHsi_reset(_cardHandle); + if (ret != 0) + { + wasThereAnError = true; + errorMsg += "terHsi_reset returned error code: " + ret.ToString() + ". "; + } + } - ret = HssubNativeMethods.terHsi_close(_cardHandle); - if (ret != 0) - { - wasThereAnError = true; - errorMsg += "terHsi_close returned error code: " + ret.ToString(); - } - _state = State.Uninitialized; + ret = HssubNativeMethods.terHsi_close(_cardHandle); + if (ret != 0) + { + wasThereAnError = true; + errorMsg += "terHsi_close returned error code: " + ret.ToString(); + } + _state = State.Uninitialized; - if (wasThereAnError == true) - { - throw new Exception(errorMsg); - } - } - } - } + if (wasThereAnError == true) + { + throw new Exception(errorMsg); + } + } + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - /// - /// - public void Write(string fpgaName, uint address, uint value) - { - // lock up the FPGA resource - lock (_syncObj) - { - int ret = HssubNativeMethods.terHsi_LB_Write32(_cardHandle, _startingOffset + address, value); - if (ret != 0) - { - string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); + /// + /// + /// + /// + /// + /// + public void Write(string fpgaName, uint address, uint value) + { + // lock up the FPGA resource + lock (_syncObj) + { + int ret = HssubNativeMethods.terHsi_LB_Write32(_cardHandle, _startingOffset + address, value); + if (ret != 0) + { + string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); - throw new Exception("terHsi_LB_Write32() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); - } - } - } + throw new Exception("terHsi_LB_Write32() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); + } + } + } - /// - /// - /// - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - // lock up the FPGA resource - lock (_syncObj) - { - if (shallWeIncrementAddress == false) - { - throw new Exception("terHsi_LB_WriteBlock32() does not support shallWeIncrementAddress = false command on card " + _name); - } - else - { - int ret = HssubNativeMethods.terHsi_LB_WriteBlock32(_cardHandle, _startingOffset + address, numberOfWordsToWrite, data); - if (ret != 0) - { - string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); + /// + /// + /// + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + // lock up the FPGA resource + lock (_syncObj) + { + if (shallWeIncrementAddress == false) + { + throw new Exception("terHsi_LB_WriteBlock32() does not support shallWeIncrementAddress = false command on card " + _name); + } + else + { + int ret = HssubNativeMethods.terHsi_LB_WriteBlock32(_cardHandle, _startingOffset + address, numberOfWordsToWrite, data); + if (ret != 0) + { + string errorStr = HssUtilSs.BuildErrorString(_cardHandle, ret, _name); - throw new Exception("terHsi_LB_WriteBlock32() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); - } - } - } - } + throw new Exception("terHsi_LB_WriteBlock32() returned an error(" + ret + ")" + ": " + errorStr + " on card " + _name); + } + } + } + } - /// - /// Loads firmware - /// - /// - public void LoadFirmware(string fpgaName) - { - LoadFirmware(); - } + /// + /// Loads firmware + /// + /// + public void LoadFirmware(string fpgaName) + { + LoadFirmware(); + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSsHsi/CommFpgaHssubCardSsHsiFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSsHsi/CommFpgaHssubCardSsHsiFactory.cs index a599b62..ed11b99 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSsHsi/CommFpgaHssubCardSsHsiFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardSsHsi/CommFpgaHssubCardSsHsiFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubCardSsHsiFactory")] - public class CommFpgaHssubCardSsHsiFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubCardSsHsiFactory")] + public class CommFpgaHssubCardSsHsiFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommFpgaHssubCardSsHsiFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaHssubCardSsHsiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommFpgaHssubCardSsHsiFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommFpgaHssubCardSsHsiFactory injection constructor + /// + [ImportingConstructor] + public CommFpgaHssubCardSsHsiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaHssubCardSsHsi(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommFpgaHssubCardSsHsi(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); else - return new CommFpgaHssubCardSsHsi(name, _configurationManager, _logger); + return new CommFpgaHssubCardSsHsi(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardTs/CommFpgaHssubCardTs.cs b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardTs/CommFpgaHssubCardTs.cs index ee330ed..9137b09 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardTs/CommFpgaHssubCardTs.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardTs/CommFpgaHssubCardTs.cs @@ -15,427 +15,394 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; +using System.Text; using FpgaMeasurementInstrumentsLib; using NLog; using Raytheon.Common; -using System; -using System.Text; namespace Raytheon.Instruments { - /// - /// A class that implements the Teradyne HSS Test Station Card - /// - public class CommFpgaHssubCardTs : IFpgaComm - { - #region PrivateClassMembers - private string _name; - private readonly string _cardAddress; - private readonly int _startingOffset; - private readonly string _firmware; - private readonly uint _chassisHandle; - private readonly int _hssubAppSyncHandle; - private readonly int _hssubAppHandle; - private readonly string _memMap; - private SelfTestResult _selfTestResult; - private int _cardHandle; + /// + /// A class that implements the Teradyne HSS Test Station Card + /// + public class CommFpgaHssubCardTs : IFpgaComm + { + #region PrivateClassMembers + private string _name; + private readonly string _cardAddress; + private readonly int _startingOffset; + private readonly string _firmware; + private readonly uint _chassisHandle; + private readonly int _hssubAppSyncHandle; + private readonly int _hssubAppHandle; + private readonly string _memMap; + private SelfTestResult _selfTestResult; + private int _cardHandle; - private int _latestLbAddress; - private int _latestLbData; + private int _latestLbAddress; + private int _latestLbData; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - public string DetailedStatus => throw new NotImplementedException(); + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } + public string DetailedStatus => throw new NotImplementedException(); - public InstrumentMetadata Info => throw new NotImplementedException(); + public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } - public string Name { get => _name; set { _name = value; } } + public InstrumentMetadata Info => throw new NotImplementedException(); - public SelfTestResult SelfTestResult => PerformSelfTest(); + public string Name { get => _name; set { _name = value; } } - public State Status => State.Ready; + public SelfTestResult SelfTestResult => PerformSelfTest(); - #endregion + public State Status => State.Ready; - #region PrivateFuctions + #endregion - /// - /// - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - HssubNativeMethods.terHss_close(_chassisHandle); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + #region PrivateFuctions - /// - /// - /// - public void Initialize() - { - int ret = HssubNativeMethods.terHss_Application_SendMessage(_chassisHandle, _hssubAppHandle, HssubNativeMethods.MESSAGE_CONTEXT_INIT_INSTRUMENT, _cardAddress.Length, Encoding.ASCII.GetBytes(_cardAddress), HssubNativeMethods.TERHSS_TIMEOUT_60SEC); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + /// + /// + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + HssubNativeMethods.terHss_close(_chassisHandle); + } + } - throw new Exception("terHss_Application_SendMessage() returned an error(" + ret + ")" + ": " + errorStr); - } + /// + /// + /// + public void Initialize() + { + int ret = HssubNativeMethods.terHss_Application_SendMessage(_chassisHandle, _hssubAppHandle, HssubNativeMethods.MESSAGE_CONTEXT_INIT_INSTRUMENT, _cardAddress.Length, Encoding.ASCII.GetBytes(_cardAddress), HssubNativeMethods.TERHSS_TIMEOUT_60SEC); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - LoadFirmware(); - } + throw new Exception("terHss_Application_SendMessage() returned an error(" + ret + ")" + ": " + errorStr); + } - /// - /// - /// - private void LoadFirmware() - { - // send the file to the subsystem - int ret = HssubNativeMethods.terHss_Subsystem_SendFile(_chassisHandle, _firmware, "c:\\temp\\FPGAFile.hsi", HssubNativeMethods.TERHSS_OPTION_ALLOW_OVERWRITE); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + LoadFirmware(); + } - throw new Exception("terHss_SubSyste_SendFile() returned an error(" + ret + ")" + ": " + errorStr); - } + /// + /// + /// + private void LoadFirmware() + { + // send the file to the subsystem + int ret = HssubNativeMethods.terHss_Subsystem_SendFile(_chassisHandle, _firmware, "c:\\temp\\FPGAFile.hsi", HssubNativeMethods.TERHSS_OPTION_ALLOW_OVERWRITE); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - // load the instrument - ret = HssubNativeMethods.terHss_Application_SendMessage(_chassisHandle, _hssubAppHandle, HssubNativeMethods.MESSAGE_CONTEXT_LOAD_INSTRUMENT, 4, BitConverter.GetBytes(_cardHandle), HssubNativeMethods.TERHSS_TIMEOUT_60SEC); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + throw new Exception("terHss_SubSyste_SendFile() returned an error(" + ret + ")" + ": " + errorStr); + } - throw new Exception("terHss_Application_SendMessage() returned an error(" + ret + ")" + ": " + errorStr); - } + // load the instrument + ret = HssubNativeMethods.terHss_Application_SendMessage(_chassisHandle, _hssubAppHandle, HssubNativeMethods.MESSAGE_CONTEXT_LOAD_INSTRUMENT, 4, BitConverter.GetBytes(_cardHandle), HssubNativeMethods.TERHSS_TIMEOUT_60SEC); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - // wait for the callback event - HssUtilTs.WaitForSync(_chassisHandle, _hssubAppSyncHandle, _name); + throw new Exception("terHss_Application_SendMessage() returned an error(" + ret + ")" + ": " + errorStr); + } - // delete the file - ret = HssubNativeMethods.terHss_Subsystem_DeleteFile(_chassisHandle, "c:\\temp\\FPGAFile.hsi", HssubNativeMethods.TERHSS_OPTION_NONE); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + // wait for the callback event + HssUtilTs.WaitForSync(_chassisHandle, _hssubAppSyncHandle, _name); - throw new Exception("terHss_SubSyste_DeleteFile() returned an error(" + ret + ")" + ": " + errorStr); - } - } - #endregion + // delete the file + ret = HssubNativeMethods.terHss_Subsystem_DeleteFile(_chassisHandle, "c:\\temp\\FPGAFile.hsi", HssubNativeMethods.TERHSS_OPTION_NONE); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - #region PublicFuctions + throw new Exception("terHss_SubSyste_DeleteFile() returned an error(" + ret + ")" + ": " + errorStr); + } + } + #endregion - /// - /// CommFpgaHssubCardTs factory constructor - /// - /// - /// - public CommFpgaHssubCardTs(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFuctions - _logger = logger; + /// + /// CommFpgaHssubCardTs factory constructor + /// + /// + /// + public CommFpgaHssubCardTs(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _cardAddress = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "CardAddress", "127.0.0.1"); - _startingOffset = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "StartingOffset", 0); - _firmware = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "Firmware", ""); - _chassisHandle = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "ChassisHandle", 0); - _hssubAppHandle = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "HssubAppHandle", 0); - _hssubAppSyncHandle = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "HssubAppSyncHandle", 0); - _memMap = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "MemMap", ""); - _cardHandle = 0; + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - // this gets set by the HssubChassis when a LB Read callback arrives - _latestLbAddress = -1; - _latestLbData = -1; + _cardAddress = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "CardAddress", "127.0.0.1"); + _startingOffset = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "StartingOffset", 0); + _firmware = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "Firmware", ""); + _chassisHandle = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "ChassisHandle", 0); + _hssubAppHandle = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "HssubAppHandle", 0); + _hssubAppSyncHandle = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "HssubAppSyncHandle", 0); + _memMap = _configuration.GetConfigurationValue("CommFpgaHssubCardTs", "MemMap", ""); + _cardHandle = 0; - Initialize(); - } + // this gets set by the HssubChassis when a LB Read callback arrives + _latestLbAddress = -1; + _latestLbData = -1; - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public CommFpgaHssubCardTs(string name, string cardAddress, int startingOffset, string firmware, uint chassisHandle, int hssubAppHandle, int hssubAppSyncHandle, string memMap) - { - // hold onto args - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _cardAddress = cardAddress; - _startingOffset = startingOffset; - _firmware = firmware; - _chassisHandle = chassisHandle; - _hssubAppHandle = hssubAppHandle; - _hssubAppSyncHandle = hssubAppSyncHandle; - _memMap = memMap; + Initialize(); + } - // this gets set by the HssubChassis in SetHandle() - _cardHandle = 0; + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public CommFpgaHssubCardTs(string deviceName, string cardAddress, int startingOffset, string firmware, uint chassisHandle, int hssubAppHandle, int hssubAppSyncHandle, string memMap) + { + // hold onto args + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _cardAddress = cardAddress; + _startingOffset = startingOffset; + _firmware = firmware; + _chassisHandle = chassisHandle; + _hssubAppHandle = hssubAppHandle; + _hssubAppSyncHandle = hssubAppSyncHandle; + _memMap = memMap; - // this gets set by the HssubChassis when a LB Read callback arrives - _latestLbAddress = -1; - _latestLbData = -1; + // this gets set by the HssubChassis in SetHandle() + _cardHandle = 0; - Initialize(); - } + // this gets set by the HssubChassis when a LB Read callback arrives + _latestLbAddress = -1; + _latestLbData = -1; - /// - /// The finalizer. - /// - ~CommFpgaHssubCardTs() - { - Dispose(false); - } + Initialize(); + } - /// - /// - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// The finalizer. + /// + ~CommFpgaHssubCardTs() + { + Dispose(false); + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// + /// + public void Dispose() + { + Dispose(true); - /// - /// - /// - /// - public string GetMemMap() - { - return _memMap; - } + GC.SuppressFinalize(this); + } - /// - /// - /// - /// - public uint Read(string fpgaName, uint address) - { - // populate the structure - HssUtilTs.LocalBusParams lbParams; - lbParams.cardHandle = _cardHandle; - lbParams.address = (int)(_startingOffset + address); - lbParams.data = 0; + /// + /// + /// + /// + public string GetMemMap() + { + return _memMap; + } - // get the byte array - byte[] dataToSend = HssUtilTs.LocalBusParmsToByteArray(lbParams); + /// + /// + /// + /// + public uint Read(string fpgaName, uint address) + { + // populate the structure + HssUtilTs.LocalBusParams lbParams; + lbParams.cardHandle = _cardHandle; + lbParams.address = (int)(_startingOffset + address); + lbParams.data = 0; - // reset the callback data items - _latestLbAddress = -1; - _latestLbData = -1; + // get the byte array + byte[] dataToSend = HssUtilTs.LocalBusParmsToByteArray(lbParams); - // send the message - int ret = HssubNativeMethods.terHss_Application_SendMessage(_chassisHandle, _hssubAppHandle, HssubNativeMethods.MESSAGE_CONTEXT_LB_READ32, dataToSend.Length, dataToSend, HssubNativeMethods.TERHSS_TIMEOUT_10SEC); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + // reset the callback data items + _latestLbAddress = -1; + _latestLbData = -1; - throw new Exception("terHss_Application_SendMessage() returned an error(" + ret + ")" + ": " + errorStr); - } + // send the message + int ret = HssubNativeMethods.terHss_Application_SendMessage(_chassisHandle, _hssubAppHandle, HssubNativeMethods.MESSAGE_CONTEXT_LB_READ32, dataToSend.Length, dataToSend, HssubNativeMethods.TERHSS_TIMEOUT_10SEC); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - // wait for the callback event - HssUtilTs.WaitForSync(_chassisHandle, _hssubAppSyncHandle, _name); + throw new Exception("terHss_Application_SendMessage() returned an error(" + ret + ")" + ": " + errorStr); + } - // confirm the address is what we requested (Set in SetLocalBusReadData()) - if (_latestLbAddress != lbParams.address) - { - throw new Exception("Received address: " + _latestLbAddress.ToString("X8") + " Expected: " + lbParams.address.ToString("X8")); - } + // wait for the callback event + HssUtilTs.WaitForSync(_chassisHandle, _hssubAppSyncHandle, _name); - return (uint)_latestLbData; - } + // confirm the address is what we requested (Set in SetLocalBusReadData()) + if (_latestLbAddress != lbParams.address) + { + throw new Exception("Received address: " + _latestLbAddress.ToString("X8") + " Expected: " + lbParams.address.ToString("X8")); + } - /// - /// - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - throw new Exception("Not Implemented"); - } + return (uint)_latestLbData; + } - /// - /// - /// - /// - public void SetHandle(int cardHandle) - { - // this gets set in - _cardHandle = cardHandle; - } + /// + /// + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + throw new Exception("Not Implemented"); + } - /// - /// - /// - /// - /// - public void SetLocalBusRxData(int address, int data) - { - _latestLbAddress = address; - _latestLbData = data; - } + /// + /// + /// + /// + public void SetHandle(int cardHandle) + { + // this gets set in + _cardHandle = cardHandle; + } - /// - /// - /// - /// - /// - /// - public void Write(string fpgaName, uint address, uint value) - { + /// + /// + /// + /// + /// + public void SetLocalBusRxData(int address, int data) + { + _latestLbAddress = address; + _latestLbData = data; + } - // populate the structure - HssUtilTs.LocalBusParams lbParams; - lbParams.cardHandle = _cardHandle; - lbParams.address = (int)(_startingOffset + address); - lbParams.data = (int)value; + /// + /// + /// + /// + /// + /// + public void Write(string fpgaName, uint address, uint value) + { - // get the byte array - byte[] dataToSend = HssUtilTs.LocalBusParmsToByteArray(lbParams); + // populate the structure + HssUtilTs.LocalBusParams lbParams; + lbParams.cardHandle = _cardHandle; + lbParams.address = (int)(_startingOffset + address); + lbParams.data = (int)value; - // reset the callback data items - _latestLbAddress = -1; - _latestLbData = -1; + // get the byte array + byte[] dataToSend = HssUtilTs.LocalBusParmsToByteArray(lbParams); - // send the message - int ret = HssubNativeMethods.terHss_Application_SendMessage(_chassisHandle, _hssubAppHandle, HssubNativeMethods.MESSAGE_CONTEXT_LB_WRITE32, dataToSend.Length, dataToSend, HssubNativeMethods.TERHSS_TIMEOUT_10SEC); - if (ret != 0) - { - string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); + // reset the callback data items + _latestLbAddress = -1; + _latestLbData = -1; - throw new Exception("terHss_Application_SendMessage() returned an error(" + ret + ")" + ": " + errorStr); - } + // send the message + int ret = HssubNativeMethods.terHss_Application_SendMessage(_chassisHandle, _hssubAppHandle, HssubNativeMethods.MESSAGE_CONTEXT_LB_WRITE32, dataToSend.Length, dataToSend, HssubNativeMethods.TERHSS_TIMEOUT_10SEC); + if (ret != 0) + { + string errorStr = HssUtilTs.BuildErrorString(_chassisHandle, ret, _name); - // wait for the callback event - HssUtilTs.WaitForSync(_chassisHandle, _hssubAppSyncHandle, _name); + throw new Exception("terHss_Application_SendMessage() returned an error(" + ret + ")" + ": " + errorStr); + } - // confirm the address is what we requested (Set in SetLocalBusReadData()) - /*if (_latestLbAddress != lbParams.address) + // wait for the callback event + HssUtilTs.WaitForSync(_chassisHandle, _hssubAppSyncHandle, _name); + + // confirm the address is what we requested (Set in SetLocalBusReadData()) + /*if (_latestLbAddress != lbParams.address) { throw new Exception("Received address: " + _latestLbAddress.ToString("X8") + " Expected: " + lbParams.address.ToString("X8")); }*/ - } + } - /// - /// - /// - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - public void Initialize(string fpgaName) - { - Initialize(); - } - - /// - /// - /// - /// - public void LoadFirmware(string fpgaName) - { - LoadFirmware(); - } - - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } - - /// - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Unknown; - return _selfTestResult; - } - /// - /// - /// - public void Reset() - { - Shutdown(); + /// + /// + /// + /// + public void Initialize(string fpgaName) + { + Initialize(); + } - Initialize(); - } - - /// - /// - /// - public void Shutdown() - { - Dispose(); - } - #endregion - } + /// + /// + /// + /// + public void LoadFirmware(string fpgaName) + { + LoadFirmware(); + } + + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } + + /// + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Unknown; + return _selfTestResult; + } + /// + /// + /// + public void Reset() + { + Shutdown(); + + Initialize(); + } + + /// + /// + /// + public void Shutdown() + { + Dispose(); + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardTs/CommFpgaHssubCardTsFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardTs/CommFpgaHssubCardTsFactory.cs index eee3ff5..2eb2328 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardTs/CommFpgaHssubCardTsFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/HssubCardTs/CommFpgaHssubCardTsFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubCardTsFactory")] - public class CommFpgaHssubCardTsFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaHssubCardTsFactory")] + public class CommFpgaHssubCardTsFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommFpgaHssubCardTsFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaHssubCardTsFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommFpgaHssubCardTsFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommFpgaHssubCardTsFactory injection constructor + /// + [ImportingConstructor] + public CommFpgaHssubCardTsFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaHssubCardTs(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommFpgaHssubCardTs(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); else - return new CommFpgaHssubCardTs(name, _configurationManager, _logger); + return new CommFpgaHssubCardTs(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/PcNode2x/CommFpgaPcNode2x.cs b/Source/TSRealLib/HAL/Implementations/FPGA/PcNode2x/CommFpgaPcNode2x.cs index 760405c..96fa7f1 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/PcNode2x/CommFpgaPcNode2x.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/PcNode2x/CommFpgaPcNode2x.cs @@ -23,554 +23,519 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A class the provides an interface for read/write to registers on an FPGA that implement PC Node communication - /// - public class CommFpgaPcNode2x : IFpgaComm, IDisposable - { - #region PrivateClassMembers - private SerialPort _serialPort; - private readonly uint _pcNodeAddress; - private byte[] _readBuf; - private static object _syncObj = new Object(); - private uint _delayBeforeReadMs; - private SelfTestResult _selfTestResult; - private State _state; - private string _name; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFuctions - - /// - /// The Finalizer - /// - ~CommFpgaPcNode2x() - { - Dispose(false); - } - - /// - /// Builds a command in the PC node format - /// - /// The address to write to - /// The data to write - /// True is the command is to perform a read, false to perform a write - /// The formatted command - private byte[] BuildCommand(uint address, uint data, bool isForRead) - { - byte[] command = new byte[9]; - - byte type = 0; - - // 2 bit shift per the spec, regardless of its a read or write - address = address >> 2; - - if (isForRead == true) - { - type = 0xf1; - - // 2 bit shift per the spec for the read (this would be the PC node address) - data = data >> 2; - } - else - { - type = 0xf0; - } - - command[0] = type; - byte[] addressBytes = BitConverter.GetBytes(address); - Array.Copy(addressBytes, 0, command, 1, addressBytes.Length); - - byte[] dataBytes = BitConverter.GetBytes(data); - Array.Copy(dataBytes, 0, command, 5, dataBytes.Length); - - return command; - } - - /// - /// Reads the serial port until it is empty - /// - private void ClearBuffer() - { - lock (_syncObj) - { - bool isClearComplete = false; - - while (isClearComplete == false) - { - try - { - int numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); - - if (numBytesRead < _readBuf.Length) - { - isClearComplete = true; - } - } - catch (Exception) - { - //expected if buffer is already cleared - isClearComplete = true; - } - } - } - } - - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _serialPort.Dispose(); - - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - #endregion - - #region PublicFuctions - - /// - /// CommFpgaPcNode2x factory constructor - /// - /// - /// - public CommFpgaPcNode2x(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _pcNodeAddress = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "PCNodeAddress", 0); - - string comPortName = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "ComPortName", "COM1"); - int baudRate = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "BaudRate", 115200); - Parity parity = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "Parity", Parity.None); - int dataBits = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "DataBits", 8); - StopBits stopBits = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "StopBits", StopBits.None); - - _delayBeforeReadMs = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "DelayBeforeReadMs", 0); - _pcNodeAddress = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "PcNodeAddress", 0); - - const int READ_BUF_SIZE = 100; - - try - { - _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits) - { - ReadTimeout = 100 - }; - } - catch (Exception ex) - { - _logger.Error(ex); - - if (_serialPort.IsOpen == true) - { - _serialPort.Close(); - } - throw; - } - - _readBuf = new byte[READ_BUF_SIZE]; - - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } - - - - /// - /// The constructor which opens up a serial port - /// - /// The address of the PC node - /// The port name. "Com1' for example - /// The num of ms to wait before a read - /// The baud rate - /// The parity - /// Number of data bits - /// Number of Stop Bits - public CommFpgaPcNode2x(string name, uint pcNodeAddress, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) - { - const int READ_BUF_SIZE = 100; - - try - { - _name = name; - - _logger = LogManager.GetCurrentClassLogger(); - - _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); - - _serialPort.ReadTimeout = 100; - - _delayBeforeReadMs = delayBeforeReadMs; - - _pcNodeAddress = pcNodeAddress; - - _readBuf = new byte[READ_BUF_SIZE]; - - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } - catch (Exception) - { - if (_serialPort.IsOpen == true) - { - _serialPort.Close(); - } - - throw; - } - } - - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a FPGA PC Node called " + _name; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// Dispose of this object - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - Initialize(string.Empty); - } - - /// - /// - /// - /// - public void Initialize(string fpga) - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - if (_serialPort.IsOpen == false) - { - _serialPort.Open(); - } - - ClearBuffer(); - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } - - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Unknown; - return _selfTestResult; - } - - /// - /// - /// - /// - /// - /// - public uint Read(string fpga, uint address) - { - const int NUM_BYTES_EXPECTED_ON_READ = 9; - - int numBytesRead = 0; - - // lock up the FPGA resource - lock (_syncObj) - { - byte[] command = BuildCommand(address, _pcNodeAddress, true); - - for (uint numTries = 0; numTries < 2; numTries++) - { - _serialPort.Write(command, 0, command.Length); - - Array.Clear(_readBuf, 0, _readBuf.Length); - - Thread.Sleep((int)_delayBeforeReadMs); - - numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); - - int numBytesExpectedToRead = NUM_BYTES_EXPECTED_ON_READ; - - if (numBytesRead != numBytesExpectedToRead) - { - //put out diagnostic - byte[] errorDiag = new byte[numBytesRead]; - - Array.Copy(_readBuf, errorDiag, numBytesRead); - - string errMessage = Util.ByteArrayToHexString(errorDiag); - - //ErrorLogger.Instance().Write("Read got wrong size. expected to read: " + numBytesExpectedToRead.ToString() + ", read: " + numBytesRead.ToString() + " The data received is: " + errMessage); - - if (numTries != 0) - { - //second time - not a good read - throw new Exception("expected to read: " + numBytesExpectedToRead.ToString() + ", read: " + numBytesRead.ToString()); - } - } - else - { - break;//continue processing - } - } - - // Grab the last 4 bytes - uint data = BitConverter.ToUInt32(_readBuf, numBytesRead - 4); - - return data; - } - } - - /// - /// - /// - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - // lock up the FPGA resource - lock (_syncObj) - { - throw new Exception("Not Implemented"); - } - } - - /// - /// - /// - public void Reset() - { - // lock up the FPGA resource - lock (_syncObj) - { - ClearBuffer(); - } - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - public void Shutdown() - { - // lock up the FPGA resource - lock (_syncObj) - { - if (_state == State.Ready) - { - _serialPort.Dispose(); - - _state = State.Uninitialized; - } - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// - /// - /// - /// - /// - public void Write(string fpga, uint address, uint data) - { - byte[] command = BuildCommand(address, data, false); - - // lock up the FPGA resource - lock (_syncObj) - { - _serialPort.Write(command, 0, command.Length); - } - } - - /// - /// - /// - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - // lock up the FPGA resource - lock (_syncObj) - { - throw new Exception("Not Implemented"); - } - } - - /// - /// Loads firmware - /// - /// - public void LoadFirmware(string fpgaName) - { - Initialize(fpgaName); - } - - #endregion - } + /// + /// A class the provides an interface for read/write to registers on an FPGA that implement PC Node communication + /// + public class CommFpgaPcNode2x : IFpgaComm, IDisposable + { + #region PrivateClassMembers + private SerialPort _serialPort; + private readonly uint _pcNodeAddress; + private byte[] _readBuf; + private static object _syncObj = new Object(); + private uint _delayBeforeReadMs; + private SelfTestResult _selfTestResult; + private State _state; + private string _name; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFuctions + + /// + /// The Finalizer + /// + ~CommFpgaPcNode2x() + { + Dispose(false); + } + + /// + /// Builds a command in the PC node format + /// + /// The address to write to + /// The data to write + /// True is the command is to perform a read, false to perform a write + /// The formatted command + private byte[] BuildCommand(uint address, uint data, bool isForRead) + { + byte[] command = new byte[9]; + + byte type = 0; + + // 2 bit shift per the spec, regardless of its a read or write + address = address >> 2; + + if (isForRead == true) + { + type = 0xf1; + + // 2 bit shift per the spec for the read (this would be the PC node address) + data = data >> 2; + } + else + { + type = 0xf0; + } + + command[0] = type; + byte[] addressBytes = BitConverter.GetBytes(address); + Array.Copy(addressBytes, 0, command, 1, addressBytes.Length); + + byte[] dataBytes = BitConverter.GetBytes(data); + Array.Copy(dataBytes, 0, command, 5, dataBytes.Length); + + return command; + } + + /// + /// Reads the serial port until it is empty + /// + private void ClearBuffer() + { + lock (_syncObj) + { + bool isClearComplete = false; + + while (isClearComplete == false) + { + try + { + int numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); + + if (numBytesRead < _readBuf.Length) + { + isClearComplete = true; + } + } + catch (Exception) + { + //expected if buffer is already cleared + isClearComplete = true; + } + } + } + } + + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _serialPort.Dispose(); + + _state = State.Uninitialized; + } + } + } + + #endregion + + #region PublicFuctions + + /// + /// CommFpgaPcNode2x factory constructor + /// + /// + /// + public CommFpgaPcNode2x(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _pcNodeAddress = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "PCNodeAddress", 0); + + string comPortName = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "ComPortName", "COM1"); + int baudRate = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "BaudRate", 115200); + Parity parity = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "Parity", Parity.None); + int dataBits = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "DataBits", 8); + StopBits stopBits = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "StopBits", StopBits.None); + + _delayBeforeReadMs = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "DelayBeforeReadMs", 0); + _pcNodeAddress = _configuration.GetConfigurationValue("CommFpgaPcNode2x", "PcNodeAddress", 0); + + const int READ_BUF_SIZE = 100; + + try + { + _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits) + { + ReadTimeout = 100 + }; + } + catch (Exception ex) + { + _logger.Error(ex); + + if (_serialPort.IsOpen == true) + { + _serialPort.Close(); + } + throw; + } + + _readBuf = new byte[READ_BUF_SIZE]; + + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } + + + + /// + /// The constructor which opens up a serial port + /// + /// The address of the PC node + /// The port name. "Com1' for example + /// The num of ms to wait before a read + /// The baud rate + /// The parity + /// Number of data bits + /// Number of Stop Bits + public CommFpgaPcNode2x(string deviceName, uint pcNodeAddress, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) + { + const int READ_BUF_SIZE = 100; + + try + { + _name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); + + _serialPort.ReadTimeout = 100; + + _delayBeforeReadMs = delayBeforeReadMs; + + _pcNodeAddress = pcNodeAddress; + + _readBuf = new byte[READ_BUF_SIZE]; + + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } + catch (Exception) + { + if (_serialPort.IsOpen == true) + { + _serialPort.Close(); + } + + throw; + } + } + + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a FPGA PC Node called " + _name; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// Dispose of this object + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + Initialize(string.Empty); + } + + /// + /// + /// + /// + public void Initialize(string fpga) + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + if (_serialPort.IsOpen == false) + { + _serialPort.Open(); + } + + ClearBuffer(); + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } + + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Unknown; + return _selfTestResult; + } + + /// + /// + /// + /// + /// + /// + public uint Read(string fpga, uint address) + { + const int NUM_BYTES_EXPECTED_ON_READ = 9; + + int numBytesRead = 0; + + // lock up the FPGA resource + lock (_syncObj) + { + byte[] command = BuildCommand(address, _pcNodeAddress, true); + + for (uint numTries = 0; numTries < 2; numTries++) + { + _serialPort.Write(command, 0, command.Length); + + Array.Clear(_readBuf, 0, _readBuf.Length); + + Thread.Sleep((int)_delayBeforeReadMs); + + numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); + + int numBytesExpectedToRead = NUM_BYTES_EXPECTED_ON_READ; + + if (numBytesRead != numBytesExpectedToRead) + { + //put out diagnostic + byte[] errorDiag = new byte[numBytesRead]; + + Array.Copy(_readBuf, errorDiag, numBytesRead); + + string errMessage = Util.ByteArrayToHexString(errorDiag); + + if (numTries != 0) + { + //second time - not a good read + throw new Exception("expected to read: " + numBytesExpectedToRead.ToString() + ", read: " + numBytesRead.ToString()); + } + } + else + { + break;//continue processing + } + } + + // Grab the last 4 bytes + uint data = BitConverter.ToUInt32(_readBuf, numBytesRead - 4); + + return data; + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + // lock up the FPGA resource + lock (_syncObj) + { + throw new Exception("Not Implemented"); + } + } + + /// + /// + /// + public void Reset() + { + // lock up the FPGA resource + lock (_syncObj) + { + ClearBuffer(); + } + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public void Shutdown() + { + // lock up the FPGA resource + lock (_syncObj) + { + if (_state == State.Ready) + { + _serialPort.Dispose(); + + _state = State.Uninitialized; + } + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + /// + /// + /// + public void Write(string fpga, uint address, uint data) + { + byte[] command = BuildCommand(address, data, false); + + // lock up the FPGA resource + lock (_syncObj) + { + _serialPort.Write(command, 0, command.Length); + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + // lock up the FPGA resource + lock (_syncObj) + { + throw new Exception("Not Implemented"); + } + } + + /// + /// Loads firmware + /// + /// + public void LoadFirmware(string fpgaName) + { + Initialize(fpgaName); + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/PcNode2x/CommFpgaPcNode2xFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/PcNode2x/CommFpgaPcNode2xFactory.cs index ebfb0eb..4339285 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/PcNode2x/CommFpgaPcNode2xFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/PcNode2x/CommFpgaPcNode2xFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaPcNode2xFactory")] - public class CommFpgaPcNode2xFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaPcNode2xFactory")] + public class CommFpgaPcNode2xFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommFpgaPcNode2xFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaPcNode2xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommFpgaPcNode2xFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommFpgaPcNode2xFactory injection constructor + /// + [ImportingConstructor] + public CommFpgaPcNode2xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaPcNode2x(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommFpgaPcNode2x(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); else - return new CommFpgaPcNode2x(name, _configurationManager, _logger); + return new CommFpgaPcNode2x(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/PcNode3x/CommFpgaPcNode3x.cs b/Source/TSRealLib/HAL/Implementations/FPGA/PcNode3x/CommFpgaPcNode3x.cs index 3831f2b..7a66fbf 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/PcNode3x/CommFpgaPcNode3x.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/PcNode3x/CommFpgaPcNode3x.cs @@ -23,55 +23,50 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A class the provides an interface for read/write to registers on an FPGA that implement PC Node communication - /// - public class CommFpgaPcNode3x : IFpgaComm, IDisposable - { - #region PrivateClassMembers - private string _name; - private SerialPort _serialPort; - private readonly uint _pcNodeAddress; - private byte[] _readBuf; - private static object _syncObj = new Object(); - private readonly bool _areUsingStartFrameDelim; - private readonly ushort _startFrameDelim; - private readonly uint _delayBeforeReadMs; - private SelfTestResult _selfTestResult; - private State _state; + /// + /// A class the provides an interface for read/write to registers on an FPGA that implement PC Node communication + /// + public class CommFpgaPcNode3x : IFpgaComm, IDisposable + { + #region PrivateClassMembers + private string _name; + private SerialPort _serialPort; + private readonly uint _pcNodeAddress; + private byte[] _readBuf; + private static object _syncObj = new Object(); + private readonly bool _areUsingStartFrameDelim; + private readonly ushort _startFrameDelim; + private readonly uint _delayBeforeReadMs; + private SelfTestResult _selfTestResult; + private State _state; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFuctions + #endregion - /// - /// The Finalizer - /// - ~CommFpgaPcNode3x() - { - Dispose(false); - } + #region PrivateFuctions - /// - /// Builds a command in the PC node format - /// - /// The address to write to - /// The data to write - /// True is the command is to perform a read, false to perform a write - /// The formatted command - private byte[] BuildCommand(uint address, uint data, bool isForRead) - { - /* + /// + /// The Finalizer + /// + ~CommFpgaPcNode3x() + { + Dispose(false); + } + + /// + /// Builds a command in the PC node format + /// + /// The address to write to + /// The data to write + /// True is the command is to perform a read, false to perform a write + /// The formatted command + private byte[] BuildCommand(uint address, uint data, bool isForRead) + { + /* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Byte En | XGRID Data / Return Address | T | R | Upper 32 - Bit XGRID Address | R | R | @@ -79,395 +74,367 @@ namespace Raytheon.Instruments Bit 35 T = TType(Transmission Type) 0 = Write 1 = Read R = Reserved */ - const ulong READ_OP_CODE_MASK = 0x800000000; - - // the data (PC NODE ADDRESS) is actually only 30 bits when reading - if (isForRead == true) - { - data = data >> 2; - } - - // The address is always 30 bits - address = address >> 2; - - // shift the data into place - ulong commandLow = data; - commandLow = commandLow << 34; - - // or in the address and put it in its place - commandLow = commandLow | address; - commandLow = commandLow << 2; - - // set the op code bit - if (isForRead == true) - { - commandLow = commandLow | READ_OP_CODE_MASK; - } - - // set the byte enables (All high by default) - byte commandHigh = 0xF0; - - // 4 high bits of data go to 4 low bits of commandHigh - data = data >> 28; - commandHigh = (byte)(commandHigh | data); - - // place bytes in correct order and return - byte[] commandLowBytes = BitConverter.GetBytes(commandLow); - - if (_areUsingStartFrameDelim == true) - { - byte[] finalCommand = new byte[11]; - - byte[] frameDelimBytes = BitConverter.GetBytes(_startFrameDelim); - - Array.Copy(frameDelimBytes, finalCommand, frameDelimBytes.Length); - - Array.Copy(commandLowBytes, 0, finalCommand, frameDelimBytes.Length, commandLowBytes.Length); - - finalCommand[10] = commandHigh; - - return finalCommand; - } - else - { - byte[] finalCommand = new byte[9]; - - Array.Copy(commandLowBytes, finalCommand, commandLowBytes.Length); - - finalCommand[8] = commandHigh; - - return finalCommand; - } - } - - - /// - /// Reads the serial port until it is empty - /// - private void ClearBuffer() - { - lock (_syncObj) - { - bool isClearComplete = false; - - while (isClearComplete == false) - { - try - { - int numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); - - if (numBytesRead < _readBuf.Length) - { - isClearComplete = true; - } - } - catch (Exception) - { - //expected if buffer is already cleared - isClearComplete = true; - } - } - } - } - - - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _serialPort.Dispose(); - - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - #endregion - - #region PublicFuctions - - /// - /// CommFpgaPcNode2x factory constructor - /// - /// - /// - public CommFpgaPcNode3x(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _pcNodeAddress = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "PCNodeAddress", 0); - - string comPortName = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "ComPortName", "COM1"); - int baudRate = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "BaudRate", 115200); - Parity parity = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "Parity", Parity.None); - int dataBits = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "DataBits", 8); - StopBits stopBits = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "StopBits", StopBits.None); - - _delayBeforeReadMs = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "DelayBeforeReadMs", 0); - _pcNodeAddress = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "PcNodeAddress", 0); - _startFrameDelim = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "StartFrameDelim", 0); - _areUsingStartFrameDelim = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "AreUsingStartFrameDelim", false); - - const int READ_BUF_SIZE = 100; - - try - { - _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits) - { - ReadTimeout = 100 - }; - } - catch (Exception ex) - { - _logger.Error(ex); - - if (_serialPort.IsOpen == true) - { - _serialPort.Close(); - } - throw; - } - - _readBuf = new byte[READ_BUF_SIZE]; - - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } - - /// - /// The constructor which opens up a serial port - /// - /// The address of the PC node - /// The port name. "Com1' for example - /// The num of ms to wait before a read - /// 0 for no delim - /// The baud rate - /// The parity - /// Number of data bits - /// Number of Stop Bits - public CommFpgaPcNode3x(string name, uint pcNodeAddress, string comPortName, uint delayBeforeReadMs, ushort startFrameDelim, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) - { - const int READ_BUF_SIZE = 100; - - try - { - _name = name; - - _logger = LogManager.GetCurrentClassLogger(); - - _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); - - _serialPort.ReadTimeout = 100; - - _delayBeforeReadMs = delayBeforeReadMs; - - _pcNodeAddress = pcNodeAddress; - - _readBuf = new byte[READ_BUF_SIZE]; - - _startFrameDelim = startFrameDelim; - - _areUsingStartFrameDelim = false; - - if (startFrameDelim != 0) - { - _areUsingStartFrameDelim = true; - } - - _selfTestResult = SelfTestResult.Unknown; - - _state = State.Uninitialized; - } - catch (Exception) - { - if (_serialPort != null && _serialPort.IsOpen == true) - { - _serialPort.Close(); - } - - throw; - } - } - - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a CommFpgaPcNode3x called " + _name; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// Dispose of this object - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - public void Initialize(string fpga) - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - if (_serialPort.IsOpen == false) - { - _serialPort.Open(); - } - - ClearBuffer(); - - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } - - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Unknown; - return _selfTestResult; - } - - /// - /// - /// - /// - /// - /// - public uint Read(string fpga, uint address) - { - const int NUM_BYTES_EXPECTED_ON_READ = 9; - - /* + const ulong READ_OP_CODE_MASK = 0x800000000; + + // the data (PC NODE ADDRESS) is actually only 30 bits when reading + if (isForRead == true) + { + data = data >> 2; + } + + // The address is always 30 bits + address = address >> 2; + + // shift the data into place + ulong commandLow = data; + commandLow = commandLow << 34; + + // or in the address and put it in its place + commandLow = commandLow | address; + commandLow = commandLow << 2; + + // set the op code bit + if (isForRead == true) + { + commandLow = commandLow | READ_OP_CODE_MASK; + } + + // set the byte enables (All high by default) + byte commandHigh = 0xF0; + + // 4 high bits of data go to 4 low bits of commandHigh + data = data >> 28; + commandHigh = (byte)(commandHigh | data); + + // place bytes in correct order and return + byte[] commandLowBytes = BitConverter.GetBytes(commandLow); + + if (_areUsingStartFrameDelim == true) + { + byte[] finalCommand = new byte[11]; + + byte[] frameDelimBytes = BitConverter.GetBytes(_startFrameDelim); + + Array.Copy(frameDelimBytes, finalCommand, frameDelimBytes.Length); + + Array.Copy(commandLowBytes, 0, finalCommand, frameDelimBytes.Length, commandLowBytes.Length); + + finalCommand[10] = commandHigh; + + return finalCommand; + } + else + { + byte[] finalCommand = new byte[9]; + + Array.Copy(commandLowBytes, finalCommand, commandLowBytes.Length); + + finalCommand[8] = commandHigh; + + return finalCommand; + } + } + + + /// + /// Reads the serial port until it is empty + /// + private void ClearBuffer() + { + lock (_syncObj) + { + bool isClearComplete = false; + + while (isClearComplete == false) + { + try + { + int numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); + + if (numBytesRead < _readBuf.Length) + { + isClearComplete = true; + } + } + catch (Exception) + { + //expected if buffer is already cleared + isClearComplete = true; + } + } + } + } + + + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _serialPort.Dispose(); + + _state = State.Uninitialized; + } + } + } + + #endregion + + #region PublicFuctions + + /// + /// CommFpgaPcNode2x factory constructor + /// + /// + /// + public CommFpgaPcNode3x(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _pcNodeAddress = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "PCNodeAddress", 0); + + string comPortName = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "ComPortName", "COM1"); + int baudRate = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "BaudRate", 115200); + Parity parity = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "Parity", Parity.None); + int dataBits = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "DataBits", 8); + StopBits stopBits = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "StopBits", StopBits.None); + + _delayBeforeReadMs = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "DelayBeforeReadMs", 0); + _pcNodeAddress = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "PcNodeAddress", 0); + _startFrameDelim = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "StartFrameDelim", 0); + _areUsingStartFrameDelim = _configuration.GetConfigurationValue("CommFpgaPcNode3x", "AreUsingStartFrameDelim", false); + + const int READ_BUF_SIZE = 100; + + try + { + _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits) + { + ReadTimeout = 100 + }; + } + catch (Exception ex) + { + _logger.Error(ex); + + if (_serialPort.IsOpen == true) + { + _serialPort.Close(); + } + throw; + } + + _readBuf = new byte[READ_BUF_SIZE]; + + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } + + /// + /// The constructor which opens up a serial port + /// + /// The address of the PC node + /// The port name. "Com1' for example + /// The num of ms to wait before a read + /// 0 for no delim + /// The baud rate + /// The parity + /// Number of data bits + /// Number of Stop Bits + public CommFpgaPcNode3x(string deviceName, uint pcNodeAddress, string comPortName, uint delayBeforeReadMs, ushort startFrameDelim, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) + { + const int READ_BUF_SIZE = 100; + + try + { + _name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _serialPort = new SerialPort(comPortName, baudRate, parity, dataBits, stopBits); + + _serialPort.ReadTimeout = 100; + + _delayBeforeReadMs = delayBeforeReadMs; + + _pcNodeAddress = pcNodeAddress; + + _readBuf = new byte[READ_BUF_SIZE]; + + _startFrameDelim = startFrameDelim; + + _areUsingStartFrameDelim = false; + + if (startFrameDelim != 0) + { + _areUsingStartFrameDelim = true; + } + + _selfTestResult = SelfTestResult.Unknown; + + _state = State.Uninitialized; + } + catch (Exception) + { + if (_serialPort != null && _serialPort.IsOpen == true) + { + _serialPort.Close(); + } + + throw; + } + } + + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a CommFpgaPcNode3x called " + _name; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// Dispose of this object + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + public void Initialize(string fpga) + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + if (_serialPort.IsOpen == false) + { + _serialPort.Open(); + } + + ClearBuffer(); + + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } + + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Unknown; + return _selfTestResult; + } + + /// + /// + /// + /// + /// + /// + public uint Read(string fpga, uint address) + { + const int NUM_BYTES_EXPECTED_ON_READ = 9; + + /* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Byte En | XGRID Data / Return Address | T | R | Upper 32 - Bit XGRID Address | R | R | @@ -475,179 +442,177 @@ namespace Raytheon.Instruments Bit 35 T = TType(Transmission Type) 0 = Write 1 = Read R = Reserved */ - int numBytesRead = 0; + int numBytesRead = 0; - // lock up the FPGA resource - lock (_syncObj) - { - byte[] command = BuildCommand(address, _pcNodeAddress, true); + // lock up the FPGA resource + lock (_syncObj) + { + byte[] command = BuildCommand(address, _pcNodeAddress, true); - for (uint numTries = 0; numTries < 2; numTries++) - { - _serialPort.Write(command, 0, command.Length); + for (uint numTries = 0; numTries < 2; numTries++) + { + _serialPort.Write(command, 0, command.Length); - Array.Clear(_readBuf, 0, _readBuf.Length); + Array.Clear(_readBuf, 0, _readBuf.Length); - Thread.Sleep((int)_delayBeforeReadMs); + Thread.Sleep((int)_delayBeforeReadMs); - numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); + numBytesRead = _serialPort.Read(_readBuf, 0, _readBuf.Length); - int numBytesExpectedToRead = NUM_BYTES_EXPECTED_ON_READ; + int numBytesExpectedToRead = NUM_BYTES_EXPECTED_ON_READ; - if (_areUsingStartFrameDelim == true) - { - // plus 2 for the delim - numBytesExpectedToRead += 2; - } + if (_areUsingStartFrameDelim == true) + { + // plus 2 for the delim + numBytesExpectedToRead += 2; + } - if (numBytesRead != numBytesExpectedToRead) - { - //put out diagnostic - byte[] errorDiag = new byte[numBytesRead]; + if (numBytesRead != numBytesExpectedToRead) + { + //put out diagnostic + byte[] errorDiag = new byte[numBytesRead]; - Array.Copy(_readBuf, errorDiag, numBytesRead); + Array.Copy(_readBuf, errorDiag, numBytesRead); - string errMessage = Util.ByteArrayToHexString(errorDiag); + string errMessage = Util.ByteArrayToHexString(errorDiag); - //ErrorLogger.Instance().Write("Read got wrong size. expected to read: " + numBytesExpectedToRead.ToString() + ", read: " + numBytesRead.ToString() + " The data received is: " + errMessage); + if (numTries != 0) + { + //second time - not a good read + throw new Exception("expected to read: " + numBytesExpectedToRead.ToString() + ", read: " + numBytesRead.ToString()); + } + } + else + { + break;//continue processing + } + } - if (numTries != 0) - { - //second time - not a good read - throw new Exception("expected to read: " + numBytesExpectedToRead.ToString() + ", read: " + numBytesRead.ToString()); - } - } - else - { - break;//continue processing - } - } + // Grab the last 5 bytes + ulong temp = BitConverter.ToUInt64(_readBuf, numBytesRead - 5); - // Grab the last 5 bytes - ulong temp = BitConverter.ToUInt64(_readBuf, numBytesRead - 5); + // ditch the first 4 bits + temp = temp >> 4; - // ditch the first 4 bits - temp = temp >> 4; + // clear out everything but the 4 bytes we want + temp = temp << 32; + temp = temp >> 32; - // clear out everything but the 4 bytes we want - temp = temp << 32; - temp = temp >> 32; + // return the next 32 bits + uint finalData = (uint)temp; - // return the next 32 bits - uint finalData = (uint)temp; + return finalData; + } + } - return finalData; - } - } + /// + /// + /// + /// + /// + /// + /// + /// + public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) + { + // lock up the FPGA resource + lock (_syncObj) + { + throw new Exception("Not Implemented"); + } + } - /// - /// - /// - /// - /// - /// - /// - /// - public void ReadBlock(string fpgaName, uint address, uint numberOfWordsToRead, bool shallWeIncrementAddress, ref uint[] dataRead) - { - // lock up the FPGA resource - lock (_syncObj) - { - throw new Exception("Not Implemented"); - } - } + /// + /// + /// + public void Reset() + { + // lock up the FPGA resource + lock (_syncObj) + { + ClearBuffer(); + } + } - /// - /// - /// - public void Reset() - { - // lock up the FPGA resource - lock (_syncObj) - { - ClearBuffer(); - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + if (_state == State.Ready) + { + _serialPort.Dispose(); + _state = State.Uninitialized; + } + } + } - /// - /// - /// - public void Shutdown() - { - lock (_syncObj) - { - if (_state == State.Ready) - { - _serialPort.Dispose(); - _state = State.Uninitialized; - } - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + /// + /// + /// + public void Write(string fpga, uint address, uint data) + { + byte[] command = BuildCommand(address, data, false); - /// - /// - /// - /// - /// - /// - public void Write(string fpga, uint address, uint data) - { - byte[] command = BuildCommand(address, data, false); + // lock up the FPGA resource + lock (_syncObj) + { + _serialPort.Write(command, 0, command.Length); + } + } - // lock up the FPGA resource - lock (_syncObj) - { - _serialPort.Write(command, 0, command.Length); - } - } + /// + /// + /// + /// + /// + /// + /// + /// + public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) + { + // lock up the FPGA resource + lock (_syncObj) + { + throw new Exception("Not Implemented"); + } + } - /// - /// - /// - /// - /// - /// - /// - /// - public void WriteBlock(string fpgaName, uint address, uint numberOfWordsToWrite, uint[] data, bool shallWeIncrementAddress) - { - // lock up the FPGA resource - lock (_syncObj) - { - throw new Exception("Not Implemented"); - } - } - - /// - /// Loads firmware - /// - /// - public void LoadFirmware(string fpgaName) - { - Initialize(fpgaName); - } - #endregion - } + /// + /// Loads firmware + /// + /// + public void LoadFirmware(string fpgaName) + { + Initialize(fpgaName); + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FPGA/PcNode3x/CommFpgaPcNode3xFactory.cs b/Source/TSRealLib/HAL/Implementations/FPGA/PcNode3x/CommFpgaPcNode3xFactory.cs index 6870044..1a48496 100644 --- a/Source/TSRealLib/HAL/Implementations/FPGA/PcNode3x/CommFpgaPcNode3xFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FPGA/PcNode3x/CommFpgaPcNode3xFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "CommFpgaPcNode3xFactory")] - public class CommFpgaPcNode3xFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "CommFpgaPcNode3xFactory")] + public class CommFpgaPcNode3xFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public CommFpgaPcNode3xFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public CommFpgaPcNode3xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public CommFpgaPcNode3xFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// CommFpgaPcNode3xFactory injection constructor + /// + [ImportingConstructor] + public CommFpgaPcNode3xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFpgaComm)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new CommFpgaPcNode3x(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFpgaComm)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new CommFpgaPcNode3x(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new CommFpgaSim(name, _configurationManager, _logger); + return new CommFpgaSim(name, _configurationManager); else - return new CommFpgaPcNode3x(name, _configurationManager, _logger); + return new CommFpgaPcNode3x(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaDPF20/FlowMeterOmegaDPF20.cs b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaDPF20/FlowMeterOmegaDPF20.cs index 780e009..d6130df 100644 --- a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaDPF20/FlowMeterOmegaDPF20.cs +++ b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaDPF20/FlowMeterOmegaDPF20.cs @@ -24,264 +24,245 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// Flow Meter class used to interact with flow meter. - /// It supports the Omega DPF20 when configured to slave mode (where data is pulled as opposed to pushed). - /// Set to slave mode on the front panel - /// - public class FlowMeterOmegaDPF20 : IFlowMeter - { - #region PublicMembers - public enum FlowMeterMode - { - MASTER, - SLAVE - }; - #endregion - #region PrivateMembers + /// + /// Flow Meter class used to interact with flow meter. + /// It supports the Omega DPF20 when configured to slave mode (where data is pulled as opposed to pushed). + /// Set to slave mode on the front panel + /// + public class FlowMeterOmegaDPF20 : IFlowMeter + { + #region PublicMembers + public enum FlowMeterMode + { + MASTER, + SLAVE + }; + #endregion + #region PrivateMembers - //Prevent Collisions - private static object _sync = new object(); + //Prevent Collisions + private static object _sync = new object(); - //Ethernet Communication - private readonly string _ipAddr; - private readonly int _port; - private readonly byte _flowMeterAddress; - private readonly FlowMeterOmegaDPF20.FlowMeterMode _mode; - private const int _READ_BUFFER_SIZE = 1024; - private const int _READ_TIMEOUT = 5500; - private byte[] _readBuffer; - private NetworkStream _tcpStream; - TcpClient _flowSocket; + //Ethernet Communication + private readonly string _ipAddr; + private readonly int _port; + private readonly byte _flowMeterAddress; + private readonly FlowMeterOmegaDPF20.FlowMeterMode _mode; + private const int _READ_BUFFER_SIZE = 1024; + private const int _READ_TIMEOUT = 5500; + private byte[] _readBuffer; + private NetworkStream _tcpStream; + TcpClient _flowSocket; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - public string DetailedStatus => throw new NotImplementedException(); + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public string DetailedStatus => throw new NotImplementedException(); - public InstrumentMetadata Info => throw new NotImplementedException(); + public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public string Name {get; set;} + public InstrumentMetadata Info => throw new NotImplementedException(); - public SelfTestResult SelfTestResult => throw new NotImplementedException(); + public string Name { get; set; } - public State Status => throw new NotImplementedException(); + public SelfTestResult SelfTestResult => throw new NotImplementedException(); - #endregion + public State Status => throw new NotImplementedException(); - #region PrivateFunctions - /// - /// Destructor - /// - ~FlowMeterOmegaDPF20() - { - Dispose(false); - } + #endregion - /// - /// Dispose of this object's resources - /// - /// Currently disposing - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - //Close Connection (if available) - _tcpStream?.Close(); - _flowSocket?.Close(); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + #region PrivateFunctions + /// + /// Destructor + /// + ~FlowMeterOmegaDPF20() + { + Dispose(false); + } - #endregion + /// + /// Dispose of this object's resources + /// + /// Currently disposing + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + //Close Connection (if available) + _tcpStream?.Close(); + _flowSocket?.Close(); + } + } - #region PublicFunctions + #endregion - /// - /// FlowMeterOmegaDPF20 factory constructor - /// - /// - /// - public FlowMeterOmegaDPF20(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions - _logger = logger; + /// + /// FlowMeterOmegaDPF20 factory constructor + /// + /// + /// + public FlowMeterOmegaDPF20(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _ipAddr = _configuration.GetConfigurationValue("FlowMeterOmegaDPF20", "IpAddr", ""); - _port = _configuration.GetConfigurationValue("FlowMeterOmegaDPF20", "Port", 0); + _ipAddr = _configuration.GetConfigurationValue("FlowMeterOmegaDPF20", "IpAddr", ""); + _port = _configuration.GetConfigurationValue("FlowMeterOmegaDPF20", "Port", 0); - _readBuffer = new byte[_READ_BUFFER_SIZE]; + _readBuffer = new byte[_READ_BUFFER_SIZE]; - //Create and open a socket to flow meter - _flowSocket = new TcpClient(_ipAddr, _port); - _tcpStream = _flowSocket.GetStream(); - _tcpStream.ReadTimeout = _READ_TIMEOUT; - } + //Create and open a socket to flow meter + _flowSocket = new TcpClient(_ipAddr, _port); + _tcpStream = _flowSocket.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; + } - /// - /// Constructor for the DPF20 flow meter. It makes a socket connection upon construction - /// - /// The name. Anything the hosts wants it to be - /// IP Address of the flow meter server - /// Port of the flow meter server - /// The address on the front display of the flow meter - /// The mode on the front display of the flow meter - public FlowMeterOmegaDPF20(string name, string ipAddress, int port, byte flowMeterAddress, FlowMeterOmegaDPF20.FlowMeterMode mode) - { - Name = name; - _logger = LogManager.GetCurrentClassLogger(); + /// + /// Constructor for the DPF20 flow meter. It makes a socket connection upon construction + /// + /// The name. Anything the hosts wants it to be + /// IP Address of the flow meter server + /// Port of the flow meter server + /// The address on the front display of the flow meter + /// The mode on the front display of the flow meter + public FlowMeterOmegaDPF20(string deviceName, string ipAddress, int port, byte flowMeterAddress, FlowMeterOmegaDPF20.FlowMeterMode mode) + { + Name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _ipAddr = ipAddress; - _port = port; - _flowMeterAddress = flowMeterAddress; - _mode = mode; + _ipAddr = ipAddress; + _port = port; + _flowMeterAddress = flowMeterAddress; + _mode = mode; - //Initialize read buffer - _readBuffer = new byte[_READ_BUFFER_SIZE]; + //Initialize read buffer + _readBuffer = new byte[_READ_BUFFER_SIZE]; - //Create and open a socket to flow meter - _flowSocket = new TcpClient(_ipAddr, _port); - _tcpStream = _flowSocket.GetStream(); - _tcpStream.ReadTimeout = _READ_TIMEOUT; - } + //Create and open a socket to flow meter + _flowSocket = new TcpClient(_ipAddr, _port); + _tcpStream = _flowSocket.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; + } - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// The address on the front display of the flow meter - /// The mode on the front display of the flow meter - public FlowMeterOmegaDPF20(string name, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One, byte flowMeterAddress = 128, FlowMeterOmegaDPF20.FlowMeterMode mode = FlowMeterMode.SLAVE) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// The address on the front display of the flow meter + /// The mode on the front display of the flow meter + public FlowMeterOmegaDPF20(string name, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One, byte flowMeterAddress = 128, FlowMeterOmegaDPF20.FlowMeterMode mode = FlowMeterMode.SLAVE) + { + throw new NotImplementedException(); + } - // This code added to correctly implement the disposable pattern. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] - public void Dispose() - { - try - { - lock (_sync) - { - Dispose(true); + // This code added to correctly implement the disposable pattern. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] + public void Dispose() + { + try + { + lock (_sync) + { + Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception ex) - { - _logger.Error(ex.Message); - } - } + GC.SuppressFinalize(this); + } + } + catch (Exception ex) + { + _logger.Error(ex.Message); + } + } - /// - /// Query the flow rate from the flow meter - /// - /// the flow rate. - public double ReadFlow() - { - lock (_sync) - { - if (_mode == FlowMeterMode.SLAVE) - { - byte[] cmd = FlowMeterOmegaDPF20DataParser.CreateReadFlowCmd(_flowMeterAddress); + /// + /// Query the flow rate from the flow meter + /// + /// the flow rate. + public double ReadFlow() + { + lock (_sync) + { + if (_mode == FlowMeterMode.SLAVE) + { + byte[] cmd = FlowMeterOmegaDPF20DataParser.CreateReadFlowCmd(_flowMeterAddress); - _tcpStream.Write(cmd, 0, cmd.Length); + _tcpStream.Write(cmd, 0, cmd.Length); - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - double flow = FlowMeterOmegaDPF20DataParser.ParseReadFlowRsp(_readBuffer, numBytesRead); + double flow = FlowMeterOmegaDPF20DataParser.ParseReadFlowRsp(_readBuffer, numBytesRead); - return flow; - } - else if (_mode == FlowMeterMode.MASTER) - { - const int EXPECTED_DATA_LEN = 18; + return flow; + } + else if (_mode == FlowMeterMode.MASTER) + { + const int EXPECTED_DATA_LEN = 18; - // ensure we have at least one full message - // need at least 35 bytes (worst case partial msg plus a full message) - int numBytesAvailable = _flowSocket.Available; - while (numBytesAvailable < (EXPECTED_DATA_LEN * 2) - 1) - { - Thread.Sleep(5); - numBytesAvailable = _flowSocket.Available; - } + // ensure we have at least one full message + // need at least 35 bytes (worst case partial msg plus a full message) + int numBytesAvailable = _flowSocket.Available; + while (numBytesAvailable < (EXPECTED_DATA_LEN * 2) - 1) + { + Thread.Sleep(5); + numBytesAvailable = _flowSocket.Available; + } - byte[] readBuf = new byte[numBytesAvailable]; + byte[] readBuf = new byte[numBytesAvailable]; - int numBytesRead = _tcpStream.Read(readBuf, 0, readBuf.Length); + int numBytesRead = _tcpStream.Read(readBuf, 0, readBuf.Length); - double flow = FlowMeterOmegaDPF20DataParser.ParseMasterFlowMsg(readBuf, numBytesRead); + double flow = FlowMeterOmegaDPF20DataParser.ParseMasterFlowMsg(readBuf, numBytesRead); - return flow; - } - else - { - throw new Exception("unknown mode: " + _mode.ToString()); - } - } - } + return flow; + } + else + { + throw new Exception("unknown mode: " + _mode.ToString()); + } + } + } - public bool ClearErrors() - { - throw new NotImplementedException(); - } + public bool ClearErrors() + { + throw new NotImplementedException(); + } - public void Initialize() - { - throw new NotImplementedException(); - } + public void Initialize() + { + throw new NotImplementedException(); + } - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - public void Reset() - { - throw new NotImplementedException(); - } + public void Reset() + { + throw new NotImplementedException(); + } - public void Shutdown() - { - throw new NotImplementedException(); - } + public void Shutdown() + { + throw new NotImplementedException(); + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaDPF20/FlowMeterOmegaDPF20Factory.cs b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaDPF20/FlowMeterOmegaDPF20Factory.cs index fbb579a..b36d274 100644 --- a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaDPF20/FlowMeterOmegaDPF20Factory.cs +++ b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaDPF20/FlowMeterOmegaDPF20Factory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "FlowMeterOmegaDPF20Factory")] - public class FlowMeterOmegaDPF20Factory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "FlowMeterOmegaDPF20Factory")] + public class FlowMeterOmegaDPF20Factory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public FlowMeterOmegaDPF20Factory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public FlowMeterOmegaDPF20Factory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public FlowMeterOmegaDPF20Factory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// FlowMeterOmegaDPF20Factory injection constructor + /// + [ImportingConstructor] + public FlowMeterOmegaDPF20Factory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFlowMeter)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new FlowMeterOmegaDPF20(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFlowMeter)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new FlowMeterOmegaDPF20(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new FlowMeterSim(name, _configurationManager, _logger); + return new FlowMeterSim(name, _configurationManager); else - return new FlowMeterOmegaDPF20(name, _configurationManager, _logger); + return new FlowMeterOmegaDPF20(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaM1676/FlowMeterOmegaM1676.cs b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaM1676/FlowMeterOmegaM1676.cs index 1486c68..d9469c4 100644 --- a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaM1676/FlowMeterOmegaM1676.cs +++ b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaM1676/FlowMeterOmegaM1676.cs @@ -24,355 +24,322 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// Flow Meter class used to interact with M1676 flow meter - /// - public class FlowMeterOmegaM1676 : IFlowMeter - { - #region PrivateMembers - //Commands - private const string _CARRIAGE_RTN = "\r"; - private const string _FLOW = "@U?V"; - private const string _GET_VERSION = "@U?SC"; - private const string _SET_CONFIG = "@U?SP2B"; - private const string _SET_DEC_POINT = "@U?SP2A0"; - private const string _SET_SCALE_1ST_BYTE = "@U?SP2F"; - private const string _SET_SCALE_2ND_BYTE = "@U?SP30"; - private const string _SET_SCALE_3RD_BYTE = "@U?SP31"; + /// + /// Flow Meter class used to interact with M1676 flow meter + /// + public class FlowMeterOmegaM1676 : IFlowMeter + { + #region PrivateMembers + //Commands + private const string _CARRIAGE_RTN = "\r"; + private const string _FLOW = "@U?V"; + private const string _GET_VERSION = "@U?SC"; + private const string _SET_CONFIG = "@U?SP2B"; + private const string _SET_DEC_POINT = "@U?SP2A0"; + private const string _SET_SCALE_1ST_BYTE = "@U?SP2F"; + private const string _SET_SCALE_2ND_BYTE = "@U?SP30"; + private const string _SET_SCALE_3RD_BYTE = "@U?SP31"; - //Prevent Collisions - private static object _sync = new object(); + //Prevent Collisions + private static object _sync = new object(); - //Ethernet Communication - private readonly string _ipAddr; - private readonly int _port; - private const int _READ_BUFFER_SIZE = 1024; - private const int _READ_TIMEOUT = 5000; - private byte[] _readBuffer; - private NetworkStream _tcpStream; + //Ethernet Communication + private readonly string _ipAddr; + private readonly int _port; + private const int _READ_BUFFER_SIZE = 1024; + private const int _READ_TIMEOUT = 5000; + private byte[] _readBuffer; + private NetworkStream _tcpStream; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - public string DetailedStatus => throw new NotImplementedException(); + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public string DetailedStatus => throw new NotImplementedException(); - public InstrumentMetadata Info => throw new NotImplementedException(); + public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public string Name { get; set;} + public InstrumentMetadata Info => throw new NotImplementedException(); - public SelfTestResult SelfTestResult => throw new NotImplementedException(); + public string Name { get; set; } - public State Status => throw new NotImplementedException(); + public SelfTestResult SelfTestResult => throw new NotImplementedException(); - #endregion + public State Status => throw new NotImplementedException(); - #region PrivateFunctions - /// - /// Destructor - /// - ~FlowMeterOmegaM1676() - { - Dispose(false); - } + #endregion - /// - /// Open socket to the flow meter - /// - private void ConnectEthernet() - { - //Create and open a socket to flow meter - TcpClient flowSocket = new TcpClient(_ipAddr, _port); - _tcpStream = flowSocket.GetStream(); - _tcpStream.ReadTimeout = _READ_TIMEOUT; - } + #region PrivateFunctions + /// + /// Destructor + /// + ~FlowMeterOmegaM1676() + { + Dispose(false); + } + + /// + /// Open socket to the flow meter + /// + private void ConnectEthernet() + { + //Create and open a socket to flow meter + TcpClient flowSocket = new TcpClient(_ipAddr, _port); + _tcpStream = flowSocket.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; + } - /// - /// Turn off the alarm feature of the flow meter - /// - private void ConfigureAlarm() - { - lock (_sync) - { - //Turn off the Alarm in the response messages -> 000001 - SendMessageNoResponse(_SET_CONFIG + "01"); - } - } + /// + /// Turn off the alarm feature of the flow meter + /// + private void ConfigureAlarm() + { + lock (_sync) + { + //Turn off the Alarm in the response messages -> 000001 + SendMessageNoResponse(_SET_CONFIG + "01"); + } + } - /// - /// Used to set the decimal place of the measurement and display: - /// 0 --> Auto Range - /// 1 --> FFFFFF. - /// 2 --> FFFFF.F - /// 3 --> FFFF.FF - /// 4 --> FFF.FFF - /// 5 --> FF.FFFF - /// 6 --> F.FFFFF - /// - /// Set the decimal place of the measurement. - private void ConfigureDecimalOutput(int option) - { - lock (_sync) - { - if (option < 0) - { - option = 0; - } - else if (option > 6) - { - option = 0; - } + /// + /// Used to set the decimal place of the measurement and display: + /// 0 --> Auto Range + /// 1 --> FFFFFF. + /// 2 --> FFFFF.F + /// 3 --> FFFF.FF + /// 4 --> FFF.FFF + /// 5 --> FF.FFFF + /// 6 --> F.FFFFF + /// + /// Set the decimal place of the measurement. + private void ConfigureDecimalOutput(int option) + { + lock (_sync) + { + if (option < 0) + { + option = 0; + } + else if (option > 6) + { + option = 0; + } - SendMessageNoResponse(_SET_DEC_POINT + option.ToString()); - } - } + SendMessageNoResponse(_SET_DEC_POINT + option.ToString()); + } + } - /// - /// Configure the scale factor to .002 (per CIL manual) - /// - private void ConfigureScaleFactor() - { - lock (_sync) - { - //Per manual .002 --> 0x400002 - //Send a byte at a time (0x40, 0x00, 0x02) - SendMessageNoResponse(_SET_SCALE_1ST_BYTE + "02"); - SendMessageNoResponse(_SET_SCALE_2ND_BYTE + "00"); - SendMessageNoResponse(_SET_SCALE_3RD_BYTE + "40"); - } - } + /// + /// Configure the scale factor to .002 (per CIL manual) + /// + private void ConfigureScaleFactor() + { + lock (_sync) + { + //Per manual .002 --> 0x400002 + //Send a byte at a time (0x40, 0x00, 0x02) + SendMessageNoResponse(_SET_SCALE_1ST_BYTE + "02"); + SendMessageNoResponse(_SET_SCALE_2ND_BYTE + "00"); + SendMessageNoResponse(_SET_SCALE_3RD_BYTE + "40"); + } + } - /// - /// Dispose of this object's resources - /// - /// Currently disposing - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - //Close Connection (if available) - _tcpStream?.Close(); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of this object's resources + /// + /// Currently disposing + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + //Close Connection (if available) + _tcpStream?.Close(); + } + } - /// - /// Send a command to the flow meter and request a response - /// - /// Command to send. - /// Response from the flow meter. - private string SendMessageGetResponse(string cmd) - { - lock (_sync) - { - //Send the data - SendMessageNoResponse(cmd); + /// + /// Send a command to the flow meter and request a response + /// + /// Command to send. + /// Response from the flow meter. + private string SendMessageGetResponse(string cmd) + { + lock (_sync) + { + //Send the data + SendMessageNoResponse(cmd); - //clear the buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + //clear the buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); - //read from the response buffer - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + //read from the response buffer + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - //convert response to a string - string rspStr = Encoding.ASCII.GetString(_readBuffer); + //convert response to a string + string rspStr = Encoding.ASCII.GetString(_readBuffer); - //Check Response - if (rspStr.Contains(_CARRIAGE_RTN)) - { - //Parse string ("/r") - char[] delimit = { '\r' }; - string[] parsed = rspStr.Split(delimit, StringSplitOptions.RemoveEmptyEntries); + //Check Response + if (rspStr.Contains(_CARRIAGE_RTN)) + { + //Parse string ("/r") + char[] delimit = { '\r' }; + string[] parsed = rspStr.Split(delimit, StringSplitOptions.RemoveEmptyEntries); - //Return parsed message - return parsed[0]; - } - else - { - throw new Exception("Command message not successful"); - } - } - } + //Return parsed message + return parsed[0]; + } + else + { + throw new Exception("Command message not successful"); + } + } + } - /// - /// Send a command to the flow meter - /// - /// The command to send - private void SendMessageNoResponse(string cmd) - { - lock (_sync) - { - //Format the command before sending - string commandString = cmd + _CARRIAGE_RTN; + /// + /// Send a command to the flow meter + /// + /// The command to send + private void SendMessageNoResponse(string cmd) + { + lock (_sync) + { + //Format the command before sending + string commandString = cmd + _CARRIAGE_RTN; - //convert to byte array for sending - byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); + //convert to byte array for sending + byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); - //send the data - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - } - } - #endregion + //send the data + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + } + } + #endregion - #region PublicFunctions + #region PublicFunctions - /// - /// FlowMeterOmegaM1676 factory constructor - /// - /// - /// - public FlowMeterOmegaM1676(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// FlowMeterOmegaM1676 factory constructor + /// + /// + /// + public FlowMeterOmegaM1676(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _ipAddr = _configuration.GetConfigurationValue("FlowMeterOmegaM1676", "IpAddr", ""); - _port = _configuration.GetConfigurationValue("FlowMeterOmegaM1676", "Port", 0); + _ipAddr = _configuration.GetConfigurationValue("FlowMeterOmegaM1676", "IpAddr", ""); + _port = _configuration.GetConfigurationValue("FlowMeterOmegaM1676", "Port", 0); - _readBuffer = new byte[_READ_BUFFER_SIZE]; - //Connect to and configure device - ConnectEthernet(); + _readBuffer = new byte[_READ_BUFFER_SIZE]; + //Connect to and configure device + ConnectEthernet(); - //Configuration - ConfigureAlarm(); - ConfigureDecimalOutput(4); - ConfigureScaleFactor(); - } + //Configuration + ConfigureAlarm(); + ConfigureDecimalOutput(4); + ConfigureScaleFactor(); + } - /// - /// Constructor for the M1676 flow meter. Forms a socket connection upon construction - /// - /// The name. Anything the host wants it to be - /// IP Address of the flow meter - /// Port of the flow meter - public FlowMeterOmegaM1676(string name, string ipAddress, int port) - { - Name = name; - _logger = LogManager.GetCurrentClassLogger(); - _ipAddr = ipAddress; - _port = port; + /// + /// Constructor for the M1676 flow meter. Forms a socket connection upon construction + /// + /// The name. Anything the host wants it to be + /// IP Address of the flow meter + /// Port of the flow meter + public FlowMeterOmegaM1676(string deviceName, string ipAddress, int port) + { + Name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _ipAddr = ipAddress; + _port = port; - //Initialize read buffer - _readBuffer = new byte[_READ_BUFFER_SIZE]; + //Initialize read buffer + _readBuffer = new byte[_READ_BUFFER_SIZE]; - //Connect to and configure device - ConnectEthernet(); + //Connect to and configure device + ConnectEthernet(); - //Configuration - ConfigureAlarm(); - ConfigureDecimalOutput(4); - ConfigureScaleFactor(); - } + //Configuration + ConfigureAlarm(); + ConfigureDecimalOutput(4); + ConfigureScaleFactor(); + } - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public FlowMeterOmegaM1676(string name, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public FlowMeterOmegaM1676(string name, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) + { + throw new NotImplementedException(); + } - // This code added to correctly implement the disposable pattern. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] - public void Dispose() - { - try - { - lock (_sync) - { - Dispose(true); + // This code added to correctly implement the disposable pattern. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] + public void Dispose() + { + lock (_sync) + { + Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } + } - /// - /// Query the flow rate from the flow meter - /// - /// the flow rate. - public double ReadFlow() - { - lock (_sync) - { - string rsp = SendMessageGetResponse(_FLOW); + /// + /// Query the flow rate from the flow meter + /// + /// the flow rate. + public double ReadFlow() + { + lock (_sync) + { + string rsp = SendMessageGetResponse(_FLOW); - //Convert string value to double and return - return double.Parse(rsp); - } - } + //Convert string value to double and return + return double.Parse(rsp); + } + } - public bool ClearErrors() - { - throw new NotImplementedException(); - } + public bool ClearErrors() + { + throw new NotImplementedException(); + } - public void Initialize() - { - throw new NotImplementedException(); - } + public void Initialize() + { + throw new NotImplementedException(); + } - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - public void Reset() - { - throw new NotImplementedException(); - } + public void Reset() + { + throw new NotImplementedException(); + } - public void Shutdown() - { - throw new NotImplementedException(); - } + public void Shutdown() + { + throw new NotImplementedException(); + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaM1676/FlowMeterOmegaM1676Factory.cs b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaM1676/FlowMeterOmegaM1676Factory.cs index abb2a9b..c85daf2 100644 --- a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaM1676/FlowMeterOmegaM1676Factory.cs +++ b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterOmegaM1676/FlowMeterOmegaM1676Factory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "FlowMeterOmegaM1676Factory")] - public class FlowMeterOmegaM1676Factory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "FlowMeterOmegaM1676Factory")] + public class FlowMeterOmegaM1676Factory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public FlowMeterOmegaM1676Factory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public FlowMeterOmegaM1676Factory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public FlowMeterOmegaM1676Factory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// FlowMeterOmegaM1676Factory injection constructor + /// + [ImportingConstructor] + public FlowMeterOmegaM1676Factory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFlowMeter)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new FlowMeterOmegaM1676(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFlowMeter)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new FlowMeterOmegaM1676(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new FlowMeterSim(name, _configurationManager, _logger); + return new FlowMeterSim(name, _configurationManager); else - return new FlowMeterOmegaM1676(name, _configurationManager, _logger); + return new FlowMeterOmegaM1676(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterSim/FlowMeterSim.cs b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterSim/FlowMeterSim.cs index cd66585..f40ec9f 100644 --- a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterSim/FlowMeterSim.cs +++ b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterSim/FlowMeterSim.cs @@ -22,177 +22,141 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// Flow Meter Sim Class - /// - public class FlowMeterSim : IFlowMeter - { - #region PrivateMembers - private static object _sync = new object(); + /// + /// Flow Meter Sim Class + /// + public class FlowMeterSim : IFlowMeter + { + #region PrivateMembers + private static object _sync = new object(); - public string DetailedStatus => throw new NotImplementedException(); + public string DetailedStatus => throw new NotImplementedException(); - public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public InstrumentMetadata Info => throw new NotImplementedException(); + public InstrumentMetadata Info => throw new NotImplementedException(); - public string Name { get; set; } + public string Name { get; set; } - public SelfTestResult SelfTestResult => throw new NotImplementedException(); + public SelfTestResult SelfTestResult => throw new NotImplementedException(); - public State Status => throw new NotImplementedException(); + public State Status => throw new NotImplementedException(); - /// - /// Destructor - /// - ~FlowMeterSim() - { - Dispose(false); - } + /// + /// Destructor + /// + ~FlowMeterSim() + { + Dispose(false); + } - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// Dispose of this object's resources - /// - /// Currently disposing - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + #region PrivateFunctions - #region PublicFunctions + /// + /// Dispose of this object's resources + /// + /// Currently disposing + protected virtual void Dispose(bool disposing) + { + } + #endregion - /// - /// FlowMeterOmegaDPF20 factory constructor - /// - /// - /// - public FlowMeterSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions - _logger = logger; + /// + /// FlowMeterOmegaDPF20 factory constructor + /// + /// + /// + public FlowMeterSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - } + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - /// - /// - /// - /// - public FlowMeterSim(string name) - { - Name = name; - _logger = LogManager.GetCurrentClassLogger(); - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + } - // This code added to correctly implement the disposable pattern. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] - public void Dispose() - { - try - { - lock (_sync) - { - Dispose(true); + /// + /// + /// + /// + public FlowMeterSim(string name) + { + Name = name; + _logger = LogManager.GetCurrentClassLogger(); + } - GC.SuppressFinalize(this); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + // This code added to correctly implement the disposable pattern. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] + public void Dispose() + { + lock (_sync) + { + Dispose(true); - /// - /// Query the flow rate from the flow meter - /// - /// the flow rate. - public double ReadFlow() - { - lock (_sync) - { - double max = 0.15; + GC.SuppressFinalize(this); + } + } - double min = .35; + /// + /// Query the flow rate from the flow meter + /// + /// the flow rate. + public double ReadFlow() + { + lock (_sync) + { + double max = 0.15; - Random rnd = new Random(); + double min = .35; - double seed = rnd.NextDouble(); + Random rnd = new Random(); - double dataToReturn = (seed * (max - min)) + min; + double seed = rnd.NextDouble(); - Thread.Sleep(100); + double dataToReturn = (seed * (max - min)) + min; - return dataToReturn; - } - } + Thread.Sleep(100); - public bool ClearErrors() - { - throw new NotImplementedException(); - } + return dataToReturn; + } + } - public void Initialize() - { - throw new NotImplementedException(); - } + public bool ClearErrors() + { + throw new NotImplementedException(); + } - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + public void Initialize() + { + throw new NotImplementedException(); + } - public void Reset() - { - throw new NotImplementedException(); - } + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - public void Shutdown() - { - throw new NotImplementedException(); - } + public void Reset() + { + throw new NotImplementedException(); + } - #endregion - } + public void Shutdown() + { + throw new NotImplementedException(); + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterSim/FlowMeterSimFactory.cs b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterSim/FlowMeterSimFactory.cs index fb88774..11dfaff 100644 --- a/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterSim/FlowMeterSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/FlowMeter/FlowMeterSim/FlowMeterSimFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "FlowMeterSimFactory")] - public class FlowMeterSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "FlowMeterSimFactory")] + public class FlowMeterSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public FlowMeterSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public FlowMeterSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public FlowMeterSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// FlowMeterSimFactory injection constructor + /// + [ImportingConstructor] + public FlowMeterSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IFlowMeter)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new FlowMeterSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IFlowMeter)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new FlowMeterSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +98,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new FlowMeterSim(name, _configurationManager, _logger); + return new FlowMeterSim(name, _configurationManager); } catch (Exception) { @@ -120,17 +111,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/JTAG/JtagConsole/JtagConsole.cs b/Source/TSRealLib/HAL/Implementations/JTAG/JtagConsole/JtagConsole.cs index 9b7941b..cde3966 100644 --- a/Source/TSRealLib/HAL/Implementations/JTAG/JtagConsole/JtagConsole.cs +++ b/Source/TSRealLib/HAL/Implementations/JTAG/JtagConsole/JtagConsole.cs @@ -15,333 +15,297 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; using System; using System.Diagnostics; using System.IO; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// - public class JtagConsole : IJtag - { - #region PrivateMembers - private string _name; - private static object _syncObj = new Object(); - private SelfTestResult _selfTestResult; - private State _state; + /// + /// + public class JtagConsole : IJtag + { + #region PrivateMembers + private string _name; + private static object _syncObj = new Object(); + private SelfTestResult _selfTestResult; + private State _state; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// Finalizer. - /// - ~JtagConsole() - { - Dispose(false); - } + #region PrivateFunctions - /// - /// - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Finalizer. + /// + ~JtagConsole() + { + Dispose(false); + } - /// - /// - /// - /// - /// - /// - /// - /// - private void GetDiagData(string bsxFilePath, string diag1File, string diag1CmdLine, string jobName, string diagFileName) - { - ProcessStartInfo startinfo = new ProcessStartInfo(diag1File, diag1CmdLine); - Process proc = Process.Start(startinfo); - proc.WaitForExit(); - int exitCode = proc.ExitCode; + /// + /// + /// + /// + protected virtual void Dispose(bool disposing) + { + } - // failed to get diag data - if (exitCode != 0) - { - throw new Exception("Could not capture JTAG diag file. Job: " + jobName + ", Diag Name: " + diagFileName + ", please inspect the JTAG failure manually"); - } + /// + /// + /// + /// + /// + /// + /// + /// + private void GetDiagData(string bsxFilePath, string diag1File, string diag1CmdLine, string jobName, string diagFileName) + { + ProcessStartInfo startinfo = new ProcessStartInfo(diag1File, diag1CmdLine); + Process proc = Process.Start(startinfo); + proc.WaitForExit(); + int exitCode = proc.ExitCode; - // copy over the output of diag output - string outputFileName = bsxFilePath + Util.GetTimeString() + diagFileName; - File.Copy(bsxFilePath + jobName + diagFileName, outputFileName); - } + // failed to get diag data + if (exitCode != 0) + { + throw new Exception("Could not capture JTAG diag file. Job: " + jobName + ", Diag Name: " + diagFileName + ", please inspect the JTAG failure manually"); + } - #endregion + // copy over the output of diag output + string outputFileName = bsxFilePath + Util.GetTimeString() + diagFileName; + File.Copy(bsxFilePath + jobName + diagFileName, outputFileName); + } - #region PublicFuctions + #endregion - /// - /// JtagConsole factory constructor - /// - /// - /// - public JtagConsole(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFuctions - _logger = logger; + /// + /// JtagConsole factory constructor + /// + /// + /// + public JtagConsole(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - public JtagConsole(string name) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + public JtagConsole(string deviceName) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a JTAG Console called " + _name; - } - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a JTAG Console called " + _name; + } + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - /// - /// Dispose of resources - /// - public void Dispose() - { - try - { - Dispose(true); + set + { + throw new NotImplementedException(); + } + } - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of resources + /// + public void Dispose() + { + Dispose(true); - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + GC.SuppressFinalize(this); + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - lock (_syncObj) - { - if (_state == State.Uninitialized) - { - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name= value; } - } + /// + /// + /// + public void Initialize() + { + lock (_syncObj) + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - lock (_syncObj) - { - _selfTestResult = SelfTestResult.Pass; - return _selfTestResult; - } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + lock (_syncObj) + { + _selfTestResult = SelfTestResult.Pass; + return _selfTestResult; + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + } + } - /// - /// Perform a JTAG cob - /// - /// The jtag job information - /// - public int PerformJtagJob(JtagJobInfo measurement) - { - lock (_syncObj) - { - ProcessStartInfo startinfo = new ProcessStartInfo(measurement.bsxFilePath + measurement.bsxFile, measurement.bsxFileCommandline); - Process proc = Process.Start(startinfo); - proc.WaitForExit(); - int exitCode = proc.ExitCode; + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - // test failed - if (exitCode != 0) - { - if (measurement.shallWeUseDiag1 == true) - { - GetDiagData(measurement.bsxFilePath, measurement.diag1File, measurement.diag1CmdLine, measurement.jobName, "_ttr.rtf"); - } + /// + /// Perform a JTAG cob + /// + /// The jtag job information + /// + public int PerformJtagJob(JtagJobInfo measurement) + { + lock (_syncObj) + { + ProcessStartInfo startinfo = new ProcessStartInfo(measurement.bsxFilePath + measurement.bsxFile, measurement.bsxFileCommandline); + Process proc = Process.Start(startinfo); + proc.WaitForExit(); + int exitCode = proc.ExitCode; - if (measurement.shallWeUseDiag2 == true) - { - GetDiagData(measurement.bsxFilePath, measurement.diag2File, measurement.diag2CmdLine, measurement.jobName, ".dia"); - } + // test failed + if (exitCode != 0) + { + if (measurement.shallWeUseDiag1 == true) + { + GetDiagData(measurement.bsxFilePath, measurement.diag1File, measurement.diag1CmdLine, measurement.jobName, "_ttr.rtf"); + } - return exitCode; - } - else - { - return exitCode; - } - } - } + if (measurement.shallWeUseDiag2 == true) + { + GetDiagData(measurement.bsxFilePath, measurement.diag2File, measurement.diag2CmdLine, measurement.jobName, ".dia"); + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + return exitCode; + } + else + { + return exitCode; + } + } + } - /// - /// - /// - public void Shutdown() - { - lock (_syncObj) - { - _state = State.Uninitialized; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - #endregion - } + /// + /// + /// + public void Shutdown() + { + lock (_syncObj) + { + _state = State.Uninitialized; + } + } + + #endregion + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/JTAG/JtagConsole/JtagConsoleFactory.cs b/Source/TSRealLib/HAL/Implementations/JTAG/JtagConsole/JtagConsoleFactory.cs index 55ba914..e953d07 100644 --- a/Source/TSRealLib/HAL/Implementations/JTAG/JtagConsole/JtagConsoleFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/JTAG/JtagConsole/JtagConsoleFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "JtagConsoleFactory")] - public class JtagConsoleFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "JtagConsoleFactory")] + public class JtagConsoleFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public JtagConsoleFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public JtagConsoleFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public JtagConsoleFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// JtagConsoleFactory injection constructor + /// + [ImportingConstructor] + public JtagConsoleFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IJtag)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new JtagConsole(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IJtag)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new JtagConsole(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new JtagSim(name, _configurationManager, _logger); + return new JtagSim(name, _configurationManager); else - return new JtagConsole(name, _configurationManager, _logger); + return new JtagConsole(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/JTAG/JtagSim/JtagSim.cs b/Source/TSRealLib/HAL/Implementations/JTAG/JtagSim/JtagSim.cs index afc5594..1675f56 100644 --- a/Source/TSRealLib/HAL/Implementations/JTAG/JtagSim/JtagSim.cs +++ b/Source/TSRealLib/HAL/Implementations/JTAG/JtagSim/JtagSim.cs @@ -15,268 +15,232 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; using NLog; using Raytheon.Common; -using System; namespace Raytheon.Instruments { - /// - /// - public class JtagSim : IJtag - { - #region PrivateClassMembers - private string _name; - private SelfTestResult _selfTestResult; - private State _state; + /// + /// + public class JtagSim : IJtag + { + #region PrivateClassMembers + private string _name; + private SelfTestResult _selfTestResult; + private State _state; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #endregion + #endregion - #region PrivateClassFunctions - /// - /// The finalizer. - /// - ~JtagSim() - { - Dispose(false); - } + #region PrivateClassFunctions + /// + /// The finalizer. + /// + ~JtagSim() + { + Dispose(false); + } - /// - /// Dispose of this object. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + /// + /// Dispose of this object. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + } + #endregion - #region PublicClassFunctions + #region PublicClassFunctions - /// - /// JtagSim factory constructor - /// - /// - /// - public JtagSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// JtagSim factory constructor + /// + /// + /// + public JtagSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } - public JtagSim(string name) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + public JtagSim(string deviceName) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a JTAG Sim called " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a JTAG Sim called " + _name; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this object. + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); - } - } + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString() + " on card " + _name); + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Pass; - return _selfTestResult; - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Pass; + return _selfTestResult; + } - /// - /// - /// - public void Reset() - { - } + /// + /// + /// + public void Reset() + { + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - /// - /// - public int PerformJtagJob(JtagJobInfo jobInfo) - { - return 0; - } + /// + /// + /// + /// + /// + public int PerformJtagJob(JtagJobInfo jobInfo) + { + return 0; + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Shutdown() - { - _state = State.Uninitialized; - } + /// + /// + /// + public void Shutdown() + { + _state = State.Uninitialized; + } - #endregion - } + #endregion + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/JTAG/JtagSim/JtagSimFactory.cs b/Source/TSRealLib/HAL/Implementations/JTAG/JtagSim/JtagSimFactory.cs index 7ef1aca..e7536d7 100644 --- a/Source/TSRealLib/HAL/Implementations/JTAG/JtagSim/JtagSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/JTAG/JtagSim/JtagSimFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "JtagSimFactory")] - public class JtagSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "JtagSimFactory")] + public class JtagSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public JtagSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public JtagSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public JtagSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// JtagSimFactory injection constructor + /// + [ImportingConstructor] + public JtagSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IJtag)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new JtagSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IJtag)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new JtagSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +98,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new JtagSim(name, _configurationManager, _logger); + return new JtagSim(name, _configurationManager); } catch (Exception) { @@ -120,17 +111,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/JTAG/JtagTeradyneEDigital6020A/JtagTeradyneEDigital6020A.cs b/Source/TSRealLib/HAL/Implementations/JTAG/JtagTeradyneEDigital6020A/JtagTeradyneEDigital6020A.cs index 3826ffd..610da26 100644 --- a/Source/TSRealLib/HAL/Implementations/JTAG/JtagTeradyneEDigital6020A/JtagTeradyneEDigital6020A.cs +++ b/Source/TSRealLib/HAL/Implementations/JTAG/JtagTeradyneEDigital6020A/JtagTeradyneEDigital6020A.cs @@ -15,183 +15,147 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; using NLog; using Raytheon.Common; -using System; namespace Raytheon.Instruments { - /// - /// - public class JtagTeradyneEDigital6020A : IJtag - { - #region PrivateClassMembers - private string _logicalName; + /// + /// + public class JtagTeradyneEDigital6020A : IJtag + { + #region PrivateClassMembers + private string _logicalName; - public string DetailedStatus => throw new NotImplementedException(); + public string DetailedStatus => throw new NotImplementedException(); - public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } + public bool DisplayEnabled { get => false; set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => false; set => throw new NotImplementedException(); } - public InstrumentMetadata Info => throw new NotImplementedException(); + public InstrumentMetadata Info => throw new NotImplementedException(); - public string Name { get => _logicalName; set { _logicalName = value; } } + public string Name { get => _logicalName; set { _logicalName = value; } } - public SelfTestResult SelfTestResult => PerformSelfTest(); + public SelfTestResult SelfTestResult => PerformSelfTest(); - public State Status => throw new NotImplementedException(); + public State Status => throw new NotImplementedException(); - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateClassFunctions - /// - /// The finalizer. - /// - ~JtagTeradyneEDigital6020A() - { - Dispose(false); - } + #endregion - /// - /// Dispose of this object. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + #region PrivateClassFunctions + /// + /// The finalizer. + /// + ~JtagTeradyneEDigital6020A() + { + Dispose(false); + } - #region PublicClassFunctions + /// + /// Dispose of this object. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + } + #endregion - /// - /// JtagTeradyneEDigital6020A factory constructor - /// - /// - /// - public JtagTeradyneEDigital6020A(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicClassFunctions - _logger = logger; + /// + /// JtagTeradyneEDigital6020A factory constructor + /// + /// + /// + public JtagTeradyneEDigital6020A(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - } + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - /// - /// - /// - /// - public JtagTeradyneEDigital6020A(string logicalName) - { - _logicalName = logicalName; - _logger = LogManager.GetCurrentClassLogger(); - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// + /// + /// + public JtagTeradyneEDigital6020A(string deviceName) + { + _logicalName = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + } - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected. - } - } - } + /// + /// Dispose of this object. + /// + public void Dispose() + { + Dispose(true); - /// - /// - /// - /// - /// - public int PerformJtagJob(JtagJobInfo jobInfo) - { - throw new NotImplementedException(); - } + GC.SuppressFinalize(this); + } - /// - /// - /// - /// - public bool ClearErrors() - { - return false; - } + /// + /// + /// + /// + /// + public int PerformJtagJob(JtagJobInfo jobInfo) + { + throw new NotImplementedException(); + } - /// - /// - /// - public void Initialize() - { - } + /// + /// + /// + /// + public bool ClearErrors() + { + return false; + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - return SelfTestResult.Unknown; - } + /// + /// + /// + public void Initialize() + { + } - /// - /// - /// - public void Reset() - { - Shutdown(); + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + return SelfTestResult.Unknown; + } - Initialize(); - } + /// + /// + /// + public void Reset() + { + Shutdown(); - /// - /// - /// - public void Shutdown() - { - Dispose(); - } + Initialize(); + } - #endregion - } + /// + /// + /// + public void Shutdown() + { + Dispose(); + } + + #endregion + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/JTAG/JtagTeradyneEDigital6020A/JtagTeradyneEDigital6020AFactory.cs b/Source/TSRealLib/HAL/Implementations/JTAG/JtagTeradyneEDigital6020A/JtagTeradyneEDigital6020AFactory.cs index c9e78fc..3e76645 100644 --- a/Source/TSRealLib/HAL/Implementations/JTAG/JtagTeradyneEDigital6020A/JtagTeradyneEDigital6020AFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/JTAG/JtagTeradyneEDigital6020A/JtagTeradyneEDigital6020AFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "JtagTeradyneEDigital6020AFactory")] - public class JtagTeradyneEDigital6020AFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "JtagTeradyneEDigital6020AFactory")] + public class JtagTeradyneEDigital6020AFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public JtagTeradyneEDigital6020AFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public JtagTeradyneEDigital6020AFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public JtagTeradyneEDigital6020AFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// JtagTeradyneEDigital6020AFactory injection constructor + /// + [ImportingConstructor] + public JtagTeradyneEDigital6020AFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IJtag)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new JtagTeradyneEDigital6020A(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IJtag)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new JtagTeradyneEDigital6020A(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new JtagSim(name, _configurationManager, _logger); + return new JtagSim(name, _configurationManager); else - return new JtagTeradyneEDigital6020A(name, _configurationManager, _logger); + return new JtagTeradyneEDigital6020A(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/LSPS/LspsChamber/LpspChamberFactory.cs b/Source/TSRealLib/HAL/Implementations/LSPS/LspsChamber/LpspChamberFactory.cs index 6f2fd76..d6f2e26 100644 --- a/Source/TSRealLib/HAL/Implementations/LSPS/LspsChamber/LpspChamberFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/LSPS/LspsChamber/LpspChamberFactory.cs @@ -30,72 +30,63 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "LspsChamberFactory")] - public class LpspChamberFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private static ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "LspsChamberFactory")] + public class LpspChamberFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public LpspChamberFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public LpspChamberFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; - _logger = LogManager.GetCurrentClassLogger(); + public LpspChamberFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (NLog.LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - NLog.LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// LspsChamberFactory injection constructor + /// + [ImportingConstructor] + public LpspChamberFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ILspsChamber)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new LspsChamber(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (NLog.LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + NLog.LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ILspsChamber)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new LspsChamber(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,9 +97,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new LspsChamber(name, _configurationManager, _logger); + return new LspsChamber(name, _configurationManager); } catch (Exception) { @@ -121,17 +110,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/LSPS/LspsChamber/LspsChamber.cs b/Source/TSRealLib/HAL/Implementations/LSPS/LspsChamber/LspsChamber.cs index ea216f6..af468c5 100644 --- a/Source/TSRealLib/HAL/Implementations/LSPS/LspsChamber/LspsChamber.cs +++ b/Source/TSRealLib/HAL/Implementations/LSPS/LspsChamber/LspsChamber.cs @@ -30,15 +30,15 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; -using Raytheon.Instruments.Lib; -using Raytheon.Instruments.LSPS; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text.RegularExpressions; +using NLog; +using Raytheon.Common; +using Raytheon.Instruments.Lib; +using Raytheon.Instruments.LSPS; namespace Raytheon.Instruments { @@ -89,13 +89,8 @@ namespace Raytheon.Instruments SMALL_TARGET = 6 }; - /// - /// NLog logger - /// private static ILogger _logger; - /// - /// Raytheon configuration - /// + private readonly IConfigurationManager _configurationManager; private readonly IConfiguration _configuration; @@ -162,11 +157,11 @@ namespace Raytheon.Instruments ///
/// /// - public LspsChamber(string deviceName, IConfigurationManager configurationManager, ILogger logger) + public LspsChamber(string deviceName, IConfigurationManager configurationManager) { Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); _configurationManager = configurationManager; _configuration = _configurationManager.GetConfiguration(Name); diff --git a/Source/TSRealLib/HAL/Implementations/NetCdfData/NetCdfData.cs b/Source/TSRealLib/HAL/Implementations/NetCdfData/NetCdfData.cs index aaaee1a..36acbe4 100644 --- a/Source/TSRealLib/HAL/Implementations/NetCdfData/NetCdfData.cs +++ b/Source/TSRealLib/HAL/Implementations/NetCdfData/NetCdfData.cs @@ -30,11 +30,11 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.IO; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { @@ -43,14 +43,8 @@ namespace Raytheon.Instruments ///
public class NetCdfData : INetCdfData { - /// - /// NLog logger - /// - private static ILogger logger_; + private static ILogger _logger; - /// - /// Raytheon configuration - /// private readonly IConfigurationManager _configurationManager; private readonly IConfiguration _configuration; @@ -78,7 +72,7 @@ namespace Raytheon.Instruments ///
public void Initialize() { - logger_.Trace($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + _logger.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); } /// @@ -86,12 +80,12 @@ namespace Raytheon.Instruments /// public void Shutdown() { - logger_.Trace($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + _logger.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); } public void Reset() { - logger_.Trace($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); + _logger.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); } /// @@ -99,10 +93,10 @@ namespace Raytheon.Instruments /// /// /// - public NetCdfData(string deviceName, IConfigurationManager configurationManager, ILogger logger) + public NetCdfData(string deviceName, IConfigurationManager configurationManager) { Name = deviceName; - logger_ = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); _configurationManager = configurationManager; _configuration = _configurationManager.GetConfiguration(Name); diff --git a/Source/TSRealLib/HAL/Implementations/NetCdfData/NetCdfDataFactory.cs b/Source/TSRealLib/HAL/Implementations/NetCdfData/NetCdfDataFactory.cs index 129a333..508195b 100644 --- a/Source/TSRealLib/HAL/Implementations/NetCdfData/NetCdfDataFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/NetCdfData/NetCdfDataFactory.cs @@ -30,72 +30,65 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "NetCdfDataFactory")] - public class NetCdfDataFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "NetCdfDataFactory")] + public class NetCdfDataFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public NetCdfDataFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public NetCdfDataFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public NetCdfDataFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// NetCdfDataFactory injection constructor + /// + [ImportingConstructor] + public NetCdfDataFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(INetCdfData)); - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new NetCdfData(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(INetCdfData)); + } + + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new NetCdfData(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,9 +99,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new NetCdfData(name, _configurationManager, _logger); + return new NetCdfData(name, _configurationManager); } catch (Exception) { @@ -121,17 +112,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterKeysightScpi/PowerMeterKeysightScpi.cs b/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterKeysightScpi/PowerMeterKeysightScpi.cs index 5f83734..c16d525 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterKeysightScpi/PowerMeterKeysightScpi.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterKeysightScpi/PowerMeterKeysightScpi.cs @@ -22,192 +22,173 @@ // accordance with DoD-5220.22-M or OPNAVINST 5510.1h. //>>*************************************************************************** -using NLog; -using Raytheon.Common; -using Raytheon.Units; using System; using System.Net.Sockets; using System.Text; using System.Threading; +using NLog; +using Raytheon.Common; +using Raytheon.Units; namespace Raytheon.Instruments { /// /// public class PowerMeterKeysightScpi : IPowerMeter - { - #region PublicMembers - #endregion + { + #region PublicMembers + #endregion - #region PrivateMembers + #region PrivateMembers - private const string _READ_ERROR_CODE_CMD = "SYST:ERR?"; - private const string _RESETCMD = "*RST"; - private const string _ISOPCCMD = "*STB? "; - private const string _SELFTESTCMD = "*TST? "; - private const string _MEASURE = "MEAS?"; - private const string _FREE_RUN_MODE = "INIT:CONT ON"; - private const string _SENSE = "SENS"; - private const string _AVERAGE = ":AVER"; - private const string _STATE = ":STAT"; - private const string _DISPLAY = "DISP"; - private const string _WINDOW = ":WIND"; - private const string _NUMERIC = ":NUM"; - private const string _RESOLUTION = ":RES"; - private const string _ZERO = "CALibration:ZERO:AUTO ONCE"; - private const string _AUTO = ":AUTO"; - private const string _CAL = "CAL"; - private const string _ONCE = "ONCE"; + private const string _READ_ERROR_CODE_CMD = "SYST:ERR?"; + private const string _RESETCMD = "*RST"; + private const string _ISOPCCMD = "*STB? "; + private const string _SELFTESTCMD = "*TST? "; + private const string _MEASURE = "MEAS?"; + private const string _FREE_RUN_MODE = "INIT:CONT ON"; + private const string _SENSE = "SENS"; + private const string _AVERAGE = ":AVER"; + private const string _STATE = ":STAT"; + private const string _DISPLAY = "DISP"; + private const string _WINDOW = ":WIND"; + private const string _NUMERIC = ":NUM"; + private const string _RESOLUTION = ":RES"; + private const string _ZERO = "CALibration:ZERO:AUTO ONCE"; + private const string _AUTO = ":AUTO"; + private const string _CAL = "CAL"; + private const string _ONCE = "ONCE"; - private int m_PORT = 5025; - private const int m_READ_TIMEOUT = 10000; + private int m_PORT = 5025; + private const int m_READ_TIMEOUT = 10000; - private readonly string _address; - private byte[] _readBuffer; - private NetworkStream _tcpStream; + private readonly string _address; + private byte[] _readBuffer; + private NetworkStream _tcpStream; - private State _state; - private SelfTestResult _selfTestResult; - private string _name; + private State _state; + private SelfTestResult _selfTestResult; + private string _name; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// The Finalizer which will release resources if required - /// - ~PowerMeterKeysightScpi() - { - Dispose(false); - } + #region PrivateFunctions - /// - /// Calibrate Chanel A or B - /// Channel A = 1 - /// Channel B = 2 - /// - /// - private void Calibrate(int channelNumber) - { - if ((channelNumber < 1) || (channelNumber > 2)) - { - string errMsg = "Channel [" + channelNumber.ToString() + "] Invalid "; - throw new Exception("" + errMsg); - } + /// + /// The Finalizer which will release resources if required + /// + ~PowerMeterKeysightScpi() + { + Dispose(false); + } - // write calibrate - string command = _CAL + channelNumber.ToString() + _AUTO + " " + _ONCE; - IOWrite(command); - } + /// + /// Calibrate Chanel A or B + /// Channel A = 1 + /// Channel B = 2 + /// + /// + private void Calibrate(int channelNumber) + { + if ((channelNumber < 1) || (channelNumber > 2)) + { + string errMsg = "Channel [" + channelNumber.ToString() + "] Invalid "; + throw new Exception("" + errMsg); + } - /// - /// Convert scpi data to string - /// - /// - /// - private string ConvertToString(ref byte[] data) - { - string rsp = System.Text.Encoding.ASCII.GetString(data); - return rsp; - } + // write calibrate + string command = _CAL + channelNumber.ToString() + _AUTO + " " + _ONCE; + IOWrite(command); + } - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); + /// + /// Convert scpi data to string + /// + /// + /// + private string ConvertToString(ref byte[] data) + { + string rsp = System.Text.Encoding.ASCII.GetString(data); + return rsp; + } - _tcpStream.Close(); + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); - _tcpStream.Dispose(); + _tcpStream.Close(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _tcpStream.Dispose(); - /// - /// Get the error code. - /// - /// The error code. - /// The error description. - private string GetErrorCode(out int errorCode) - { - // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query + _state = State.Uninitialized; + } + } + } - string command = _READ_ERROR_CODE_CMD + "\n"; + /// + /// Get the error code. + /// + /// The error code. + /// The error description. + private string GetErrorCode(out int errorCode) + { + // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + string command = _READ_ERROR_CODE_CMD + "\n"; - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - // read the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); - // convert to a string - string rspStr = ConvertToString(ref _readBuffer); + // read the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - // parse the response - string[] tokens = rspStr.Split(','); + // convert to a string + string rspStr = ConvertToString(ref _readBuffer); - errorCode = Util.ConvertStringToInt32(tokens[0]); + // parse the response + string[] tokens = rspStr.Split(','); - // it should always be 2 - if (tokens.Length >= 2) - { - return tokens[1]; - } - else - { - return ""; - } - } + errorCode = Util.ConvertStringToInt32(tokens[0]); - /// - /// - /// - /// - private bool HasItTriggered() - { - return false; - // Check the Trigger Event register to see if the event has properly triggered - /*string command = m_ISITCOMPLETEDCMD + "\n"; + // it should always be 2 + if (tokens.Length >= 2) + { + return tokens[1]; + } + else + { + return ""; + } + } + + /// + /// + /// + /// + private bool HasItTriggered() + { + return false; + // Check the Trigger Event register to see if the event has properly triggered + /*string command = m_ISITCOMPLETEDCMD + "\n"; string rspStr = IOQuery(command); bool isTriggered = false; @@ -220,107 +201,107 @@ namespace Raytheon.Instruments } return isTriggered;*/ - } + } - /// - /// - /// - /// - /// - private string IOQuery(string command) - { - // send the command - IOWrite(command, false); + /// + /// + /// + /// + /// + private string IOQuery(string command) + { + // send the command + IOWrite(command, false); - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); - // read from the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + // read from the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - // convert response to a string - string rspStr = ConvertToString(ref _readBuffer); + // convert response to a string + string rspStr = ConvertToString(ref _readBuffer); - // check for errors - int err = 0; - string message = GetErrorCode(out err); - if (err != 0) - { - throw new Exception("PowerMeterKeysightScpi:IOQuery() - Power Meter " + _name + " returned error code: " + err.ToString() + ", " + message); - } + // check for errors + int err = 0; + string message = GetErrorCode(out err); + if (err != 0) + { + throw new Exception("PowerMeterKeysightScpi:IOQuery() - Power Meter " + _name + " returned error code: " + err.ToString() + ", " + message); + } - return rspStr; - } + return rspStr; + } - /// - /// - /// - /// - private void IOWrite(string command, bool shallWeCheckForError = true) - { - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + /// + /// + /// + /// + private void IOWrite(string command, bool shallWeCheckForError = true) + { + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - // check for errors - if (shallWeCheckForError == true) - { - int err = 0; - string errorMessage = GetErrorCode(out err); - if (err != 0) - { - throw new Exception("PowerMeterKeysightScpi:IOWrite() - Device " + _name + " returned error code: " + err.ToString() + "," + errorMessage); - } - } - } + // check for errors + if (shallWeCheckForError == true) + { + int err = 0; + string errorMessage = GetErrorCode(out err); + if (err != 0) + { + throw new Exception("PowerMeterKeysightScpi:IOWrite() - Device " + _name + " returned error code: " + err.ToString() + "," + errorMessage); + } + } + } - /// - /// - /// - /// - /// - /// - private bool IsOperationCompleted(string statusString, string expectedResult = "1") - { - bool completed = false; + /// + /// + /// + /// + /// + /// + private bool IsOperationCompleted(string statusString, string expectedResult = "1") + { + bool completed = false; - // If Scope returns '+x' instead of 'x', where 'x' is any character, trim it. - if (statusString.IndexOf('+') == 0) - { - statusString = statusString.TrimStart('+'); - } + // If Scope returns '+x' instead of 'x', where 'x' is any character, trim it. + if (statusString.IndexOf('+') == 0) + { + statusString = statusString.TrimStart('+'); + } - if (statusString.Equals(expectedResult) == true) - { - completed = true; - } + if (statusString.Equals(expectedResult) == true) + { + completed = true; + } - return completed; - } + return completed; + } - /// - /// - Set auto averaging - /// - enable or disable filtering - /// - /// - /// - private void SetAverage(int SenseCount, bool enableAutoAverage) - { - string errMsg; - if ((SenseCount < 1) || (SenseCount > 2)) - { - errMsg = "Sensor Count [" + SenseCount.ToString() + "] Invalid "; - throw new Exception(errMsg); - } + /// + /// - Set auto averaging + /// - enable or disable filtering + /// + /// + /// + private void SetAverage(int SenseCount, bool enableAutoAverage) + { + string errMsg; + if ((SenseCount < 1) || (SenseCount > 2)) + { + errMsg = "Sensor Count [" + SenseCount.ToString() + "] Invalid "; + throw new Exception(errMsg); + } - string command = _SENSE + SenseCount.ToString() + _AVERAGE + _STATE + enableAutoAverage.ToString(); + string command = _SENSE + SenseCount.ToString() + _AVERAGE + _STATE + enableAutoAverage.ToString(); - IOWrite(command); - } + IOWrite(command); + } - /*@@@ Not Needed I don't think + /*@@@ Not Needed I don't think /// /// Set Power Meter Interface /// @@ -355,342 +336,328 @@ namespace Raytheon.Instruments IOWrite(command); }*/ - /// - /// - /// - /// - /// - /// - private void SetResolution(int windowNumber, int numValue, int resolution) - { + /// + /// + /// + /// + /// + /// + private void SetResolution(int windowNumber, int numValue, int resolution) + { - string errMsg; - if ((windowNumber < 1) || (windowNumber > 2)) - { - errMsg = "Window Number[" + windowNumber.ToString() + "] Invalid "; - throw new Exception(errMsg); - } + string errMsg; + if ((windowNumber < 1) || (windowNumber > 2)) + { + errMsg = "Window Number[" + windowNumber.ToString() + "] Invalid "; + throw new Exception(errMsg); + } - if ((numValue < 1) || (numValue > 2)) - { - errMsg = "Numeric [" + numValue.ToString() + "] Invalid "; - throw new Exception(errMsg); - } + if ((numValue < 1) || (numValue > 2)) + { + errMsg = "Numeric [" + numValue.ToString() + "] Invalid "; + throw new Exception(errMsg); + } - if ((resolution < 1) || (resolution > 4)) - { - errMsg = "Resolution Level [" + resolution.ToString() + "] Invalid "; - throw new Exception(errMsg); - } + if ((resolution < 1) || (resolution > 4)) + { + errMsg = "Resolution Level [" + resolution.ToString() + "] Invalid "; + throw new Exception(errMsg); + } - string command = _DISPLAY + _WINDOW + windowNumber.ToString() + _NUMERIC + numValue.ToString() + _RESOLUTION + " " + resolution.ToString(); + string command = _DISPLAY + _WINDOW + windowNumber.ToString() + _NUMERIC + numValue.ToString() + _RESOLUTION + " " + resolution.ToString(); - IOWrite(command); - } + IOWrite(command); + } - #endregion + #endregion - /// - /// PowerMeterKeysightScpi factory constructor - /// - /// - /// - public PowerMeterKeysightScpi(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - const int READ_BUFFER_SIZE = 512; + /// + /// PowerMeterKeysightScpi factory constructor + /// + /// + /// + public PowerMeterKeysightScpi(string deviceName, IConfigurationManager configurationManager) + { + const int READ_BUFFER_SIZE = 512; - Name = deviceName; + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; - _readBuffer = new byte[READ_BUFFER_SIZE]; + _readBuffer = new byte[READ_BUFFER_SIZE]; - _address = _configuration.GetConfigurationValue("PowerMeterKeysightScpi", "Address", "127.0.0.1"); - m_PORT = _configuration.GetConfigurationValue("PowerMeterKeysightScpi", "Address", 5025); + _address = _configuration.GetConfigurationValue("PowerMeterKeysightScpi", "Address", "127.0.0.1"); + m_PORT = _configuration.GetConfigurationValue("PowerMeterKeysightScpi", "Address", 5025); - TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); + TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); - _tcpStream = scopeSocketConn.GetStream(); - _tcpStream.ReadTimeout = m_READ_TIMEOUT; + _tcpStream = scopeSocketConn.GetStream(); + _tcpStream.ReadTimeout = m_READ_TIMEOUT; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - /// - public PowerMeterKeysightScpi(string name, string address) - { - const int READ_BUFFER_SIZE = 512; - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _address = address; - _readBuffer = new byte[READ_BUFFER_SIZE]; - TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); - _tcpStream = scopeSocketConn.GetStream(); - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + /// + /// + /// + /// + /// + public PowerMeterKeysightScpi(string deviceName, string address) + { + const int READ_BUFFER_SIZE = 512; + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _address = address; + _readBuffer = new byte[READ_BUFFER_SIZE]; + TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); + _tcpStream = scopeSocketConn.GetStream(); + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - public int Channels - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public int Channels + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Scpi Power Meter"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Scpi Power Meter"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - /// - /// - /// - public bool EnableChannel(int channel, bool enable) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + /// + /// + public bool EnableChannel(int channel, bool enable) + { + throw new NotImplementedException(); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - Reset(); + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + Reset(); - // we already connected to the instrument in the constructor - _state = State.Ready; - } - else - { - throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } + // we already connected to the instrument in the constructor + _state = State.Ready; + } + else + { + throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - /// - public Power GetMeasurement(int channel) - { - // for now, just use free running mode with default expected power levels - const string EXPECTED_POWER = "DEF"; - const string RESOLUTION = "DEF"; + /// + /// + /// + /// + /// + public Power GetMeasurement(int channel) + { + // for now, just use free running mode with default expected power levels + const string EXPECTED_POWER = "DEF"; + const string RESOLUTION = "DEF"; - //@@@ TBD if this is needed turn off system header - // for now, just use free running mode with default expected power levels - // if we need better resolution, we will extend the IPowerInterface - string command = _FREE_RUN_MODE + "\n"; - IOWrite(command); + //@@@ TBD if this is needed turn off system header + // for now, just use free running mode with default expected power levels + // if we need better resolution, we will extend the IPowerInterface + string command = _FREE_RUN_MODE + "\n"; + IOWrite(command); - //MEAS1? DEF,DEF,(@1) - //MEAS? DEF,DEF,(@1) - command = _MEASURE + " " + EXPECTED_POWER + "," + RESOLUTION + ",(@" + channel.ToString() + ")" + "\n"; - string rspStr = IOQuery(command); + //MEAS1? DEF,DEF,(@1) + //MEAS? DEF,DEF,(@1) + command = _MEASURE + " " + EXPECTED_POWER + "," + RESOLUTION + ",(@" + channel.ToString() + ")" + "\n"; + string rspStr = IOQuery(command); - string[] tokens = rspStr.Split('\n'); + string[] tokens = rspStr.Split('\n'); - double power = Util.ConvertStringToDouble(tokens[0]); + double power = Util.ConvertStringToDouble(tokens[0]); - return Power.FromWatts(power); - } + return Power.FromWatts(power); + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - try - { - // change the timeout to account for the long self test - _tcpStream.ReadTimeout = 90000; + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + try + { + // change the timeout to account for the long self test + _tcpStream.ReadTimeout = 90000; - // send the command and get the response - string command = _SELFTESTCMD + "\n"; - string rspStr = IOQuery(command); + // send the command and get the response + string command = _SELFTESTCMD + "\n"; + string rspStr = IOQuery(command); - // parse the response - string[] tokens = rspStr.Split('\n'); + // parse the response + string[] tokens = rspStr.Split('\n'); - //Check if self test is completed; returns status of "0". - if (IsOperationCompleted(tokens[0], "0") == false) - { - string errorMsg = "Power Meter " + _name + " returned an error: " + tokens[0]; - throw new Exception(errorMsg); - } + //Check if self test is completed; returns status of "0". + if (IsOperationCompleted(tokens[0], "0") == false) + { + string errorMsg = "Power Meter " + _name + " returned an error: " + tokens[0]; + throw new Exception(errorMsg); + } - _selfTestResult = SelfTestResult.Pass; + _selfTestResult = SelfTestResult.Pass; - return SelfTestResult.Pass; - } - catch (Exception) - { - throw; - } - finally - { - // restore the timeout - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - } - } + return SelfTestResult.Pass; + } + catch (Exception) + { + throw; + } + finally + { + // restore the timeout + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + } + } - /// - /// - /// - public void Reset() - { - // Resets the power meter - string command = _RESETCMD + "\n"; - IOWrite(command); + /// + /// + /// + public void Reset() + { + // Resets the power meter + string command = _RESETCMD + "\n"; + IOWrite(command); - Thread.Sleep(3000); + Thread.Sleep(3000); - /*command = _ISOPCCMD + "\n"; + /*command = _ISOPCCMD + "\n"; string rspStr = IOQuery(command); // parse the response @@ -700,76 +667,76 @@ namespace Raytheon.Instruments { throw new Exception("Reset was not completed."); }*/ - } + } - /// - /// - /// - /// - /// - /// - public bool SetFrequency(int channel, Frequency frequency) - { - int freq = Convert.ToInt32(frequency.Hertz); + /// + /// + /// + /// + /// + /// + public bool SetFrequency(int channel, Frequency frequency) + { + int freq = Convert.ToInt32(frequency.Hertz); - string command = "SENSe1:FREQuency " + freq.ToString() + "HZ" + "\n"; - IOWrite(command); + string command = "SENSe1:FREQuency " + freq.ToString() + "HZ" + "\n"; + IOWrite(command); - return true; - } + return true; + } - /// - /// - /// - public void Shutdown() - { - string errorMsg = ""; + /// + /// + /// + public void Shutdown() + { + string errorMsg = ""; - if (_state == State.Ready) - { - try - { - //Reset System - Reset(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + if (_state == State.Ready) + { + try + { + //Reset System + Reset(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - // the stream was created in the constructor, dispose of it here - try - { - if (_tcpStream != null) - { - _tcpStream.Dispose(); - _tcpStream = null; - } - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + // the stream was created in the constructor, dispose of it here + try + { + if (_tcpStream != null) + { + _tcpStream.Dispose(); + _tcpStream = null; + } + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - if (errorMsg != "") - { - throw new Exception("System " + _name + " Had an error: " + errorMsg); - } - } + if (errorMsg != "") + { + throw new Exception("System " + _name + " Had an error: " + errorMsg); + } + } - /// - /// - /// - /// - public bool ZeroMeter() - { - throw new NotImplementedException(); + /// + /// + /// + /// + public bool ZeroMeter() + { + throw new NotImplementedException(); - // zero the power meter - /* + // zero the power meter + /* string command = _ZERO + "\n"; IOWrite(command); @@ -782,6 +749,6 @@ namespace Raytheon.Instruments string command = m_CAL + channelNumber.ToString() + m_Zero + m_Auto + m_Space + m_Once; IOWrite(command);*/ - } - } + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterKeysightScpi/PowerMeterKeysightScpiFactory.cs b/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterKeysightScpi/PowerMeterKeysightScpiFactory.cs index 0ba251e..86a6de7 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterKeysightScpi/PowerMeterKeysightScpiFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterKeysightScpi/PowerMeterKeysightScpiFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { [ExportInstrumentFactory(ModelNumber = "PowerMeterKeysightScpiFactory")] - public class PowerMeterKeysightScpiFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + public class PowerMeterKeysightScpiFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public PowerMeterKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public PowerMeterKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public PowerMeterKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// PowerMeterKeysightScpiFactory injection constructor + /// + [ImportingConstructor] + public PowerMeterKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IPowerMeter)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new PowerMeterKeysightScpi(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IPowerMeter)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new PowerMeterKeysightScpi(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new PowerMeterSim(name, _configurationManager, _logger); + return new PowerMeterSim(name, _configurationManager); else - return new PowerMeterKeysightScpi(name, _configurationManager, _logger); + return new PowerMeterKeysightScpi(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterSim/PowerMeterSim.cs b/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterSim/PowerMeterSim.cs index abdf563..07a56ba 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterSim/PowerMeterSim.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterSim/PowerMeterSim.cs @@ -22,357 +22,321 @@ // accordance with DoD-5220.22-M or OPNAVINST 5510.1h. //>>*************************************************************************** +using System; +using System.Threading; using NLog; using Raytheon.Common; using Raytheon.Units; -using System; -using System.Threading; namespace Raytheon.Instruments { /// /// public class PowerMeterSim : IPowerMeter - { - #region PublicMembers - #endregion + { + #region PrivateMembers - #region PrivateMembers + private State _state; + private SelfTestResult _selfTestResult; + private string _name; + private double _lastPowerLevel; - private State _state; - private SelfTestResult _selfTestResult; - private string _name; - private double _lastPowerLevel; + private readonly ILogger _logger; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #endregion + #endregion - #region PrivateFunctions + #region PrivateFunctions - /// - /// The Finalizer which will release resources if required - /// - ~PowerMeterSim() - { - Dispose(false); - } + /// + /// The Finalizer which will release resources if required + /// + ~PowerMeterSim() + { + Dispose(false); + } - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _state = State.Uninitialized; + } + } + } - #endregion + #endregion - /// - /// PowerMeterSim factory constructor - /// - /// - /// - public PowerMeterSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// PowerMeterSim factory constructor + /// + /// + /// + public PowerMeterSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - _lastPowerLevel = 100.0; - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + _lastPowerLevel = 100.0; + } - /// - /// - /// - /// - public PowerMeterSim(string name) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - _lastPowerLevel = 100.0; - } + /// + /// + /// + /// + public PowerMeterSim(string deviceName) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + _lastPowerLevel = 100.0; + } - /// - /// - /// - public int Channels - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public int Channels + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Sim Power Meter"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Sim Power Meter"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - /// - /// - /// - public bool EnableChannel(int channel, bool enable) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + /// + /// + public bool EnableChannel(int channel, bool enable) + { + throw new NotImplementedException(); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - Reset(); + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + Reset(); - // we already connected to the instrument in the constructor - _state = State.Ready; - } - else - { - throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } + // we already connected to the instrument in the constructor + _state = State.Ready; + } + else + { + throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - /// - public Power GetMeasurement(int channel) - { - double max = _lastPowerLevel; + /// + /// + /// + /// + /// + public Power GetMeasurement(int channel) + { + double max = _lastPowerLevel; - double min = 1.0; + double min = 1.0; - Random rnd = new Random(); + Random rnd = new Random(); - double seed = rnd.NextDouble(); + double seed = rnd.NextDouble(); - double dataToReturn = (seed * (max - min)) + min; + double dataToReturn = (seed * (max - min)) + min; - Thread.Sleep(200); + Thread.Sleep(200); - return Power.FromWatts(dataToReturn); - } + return Power.FromWatts(dataToReturn); + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - try - { - _selfTestResult = SelfTestResult.Pass; - return _selfTestResult; - } - catch (Exception) - { - throw; - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + try + { + _selfTestResult = SelfTestResult.Pass; + return _selfTestResult; + } + catch (Exception) + { + throw; + } + } - /// - /// - /// - public void Reset() - { - } + /// + /// + /// + public void Reset() + { + } - /// - /// - /// - /// - /// - /// - public bool SetFrequency(int channel, Frequency frequency) - { - return true; - } + /// + /// + /// + /// + /// + /// + public bool SetFrequency(int channel, Frequency frequency) + { + return true; + } - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - _state = State.Uninitialized; - } - } + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + _state = State.Uninitialized; + } + } - /// - /// - /// - /// - public bool ZeroMeter() - { - throw new NotImplementedException(); - } - } + /// + /// + /// + /// + public bool ZeroMeter() + { + throw new NotImplementedException(); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterSim/PowerMeterSimFactory.cs b/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterSim/PowerMeterSimFactory.cs index 0fce204..185565d 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterSim/PowerMeterSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerMeter/PowerMeterSim/PowerMeterSimFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "PowerMeterSimFactory")] - public class PowerMeterSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "PowerMeterSimFactory")] + public class PowerMeterSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public PowerMeterSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public PowerMeterSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public PowerMeterSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// PowerMeterSimFactory injection constructor + /// + [ImportingConstructor] + public PowerMeterSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IPowerMeter)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new PowerMeterSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IPowerMeter)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new PowerMeterSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +98,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new PowerMeterSim(name, _configurationManager, _logger); + return new PowerMeterSim(name, _configurationManager); } catch (Exception) { @@ -120,17 +111,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplyKeysight.cs b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplyKeysight.cs index bba9a17..958fca8 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplyKeysight.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplyKeysight.cs @@ -15,12 +15,12 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; -using Raytheon.Units; using System; using System.Net.Sockets; using System.Text; +using NLog; +using Raytheon.Common; +using Raytheon.Units; namespace Raytheon.Instruments { @@ -28,466 +28,452 @@ namespace Raytheon.Instruments /// A class that provides an interface for controlling power supply modules via SCPI commands. ///
public class PowerSupplyKeysight : IDCPwr - { - #region PublicClassMembers + { + #region PublicClassMembers #pragma warning disable CS0067 - public event EventHandler OverCurrent; - public event EventHandler OverVoltage; + public event EventHandler OverCurrent; + public event EventHandler OverVoltage; #pragma warning restore - #endregion + #endregion - #region PrivateClassMembers + #region PrivateClassMembers - private string _name; - private readonly PowerScpiCommands _scpiCommands; - private double _overCurrentProtection; - private double _overVoltageProtection; - private double _voltageSetpoint; - private readonly double _voltageSetpointInitial; - private readonly double _maxVoltageSetpoint; - private readonly double _minVoltageSetpoint; - private readonly double _inRushDelay; - private readonly double _slewRateVoltsPerSecond; - private readonly int _moduleNumber; - private byte[] _readBuffer; - private NetworkStream _tcpStream; - private State _state; - private const int _READ_TIMEOUT = 5000; + private string _name; + private readonly PowerScpiCommands _scpiCommands; + private double _overCurrentProtection; + private double _overVoltageProtection; + private double _voltageSetpoint; + private readonly double _voltageSetpointInitial; + private readonly double _maxVoltageSetpoint; + private readonly double _minVoltageSetpoint; + private readonly double _inRushDelay; + private readonly double _slewRateVoltsPerSecond; + private readonly int _moduleNumber; + private byte[] _readBuffer; + private NetworkStream _tcpStream; + private State _state; + private const int _READ_TIMEOUT = 5000; - /// - /// NLog logger - /// - private readonly ILogger _logger; + /// + /// NLog logger + /// + private readonly ILogger _logger; - #endregion + #endregion - #region PublicFuctions + #region PublicFuctions - /// - /// The constructor which sets the power supply to constant voltage mode, set the OCP, OVP and setpoint voltage - /// - /// The logical name of the supply. - /// Scpi commands to use. - /// The overcurrent protection setting (Amps). - /// The overvoltage protection setting (Volts). - /// The voltage setpoint (Volts). - /// The voltage setpoint max (Volts) soft limit. - /// The voltage setpoint min (Volts) soft limit. - /// In rush delay in seconds.-1 to leave it as default - /// The ramp up rate.-1 to leave it as default - /// TCP Stream (Ethernet). - /// The module number (multiple modules in a system). - public PowerSupplyKeysight(string name, PowerScpiCommands scpiCommands, double overCurrentProtection, double overVoltageProtection, double voltageSetpoint, double maxVoltageSetpoint, double minVoltageSetpoint, double inRushDelayInSeconds, double slewRateVoltsPerSecond, NetworkStream tcpStream, int moduleNumber = -1) - { - const int READ_BUFFER_SIZE = 512; + /// + /// The constructor which sets the power supply to constant voltage mode, set the OCP, OVP and setpoint voltage + /// + /// The logical name of the supply. + /// Scpi commands to use. + /// The overcurrent protection setting (Amps). + /// The overvoltage protection setting (Volts). + /// The voltage setpoint (Volts). + /// The voltage setpoint max (Volts) soft limit. + /// The voltage setpoint min (Volts) soft limit. + /// In rush delay in seconds.-1 to leave it as default + /// The ramp up rate.-1 to leave it as default + /// TCP Stream (Ethernet). + /// The module number (multiple modules in a system). + public PowerSupplyKeysight(string name, PowerScpiCommands scpiCommands, double overCurrentProtection, double overVoltageProtection, double voltageSetpoint, double maxVoltageSetpoint, double minVoltageSetpoint, double inRushDelayInSeconds, double slewRateVoltsPerSecond, NetworkStream tcpStream, int moduleNumber = -1) + { + const int READ_BUFFER_SIZE = 512; - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _scpiCommands = scpiCommands; - _overCurrentProtection = overCurrentProtection; - _overVoltageProtection = overVoltageProtection; - _voltageSetpoint = voltageSetpoint; - _voltageSetpointInitial = voltageSetpoint; - _maxVoltageSetpoint = maxVoltageSetpoint; - _minVoltageSetpoint = minVoltageSetpoint; - _inRushDelay = inRushDelayInSeconds; - _slewRateVoltsPerSecond = slewRateVoltsPerSecond; - _moduleNumber = moduleNumber; - _readBuffer = new byte[READ_BUFFER_SIZE]; + _name = name; + _logger = LogManager.GetCurrentClassLogger(); + _scpiCommands = scpiCommands; + _overCurrentProtection = overCurrentProtection; + _overVoltageProtection = overVoltageProtection; + _voltageSetpoint = voltageSetpoint; + _voltageSetpointInitial = voltageSetpoint; + _maxVoltageSetpoint = maxVoltageSetpoint; + _minVoltageSetpoint = minVoltageSetpoint; + _inRushDelay = inRushDelayInSeconds; + _slewRateVoltsPerSecond = slewRateVoltsPerSecond; + _moduleNumber = moduleNumber; + _readBuffer = new byte[READ_BUFFER_SIZE]; - _tcpStream = tcpStream; + _tcpStream = tcpStream; - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - /// - /// - /// - /// - public bool ClearErrors() - { - return _state == State.Uninitialized; - } + /// + /// + /// + /// + public bool ClearErrors() + { + return _state == State.Uninitialized; + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this object. + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public Current CurrentLimit - { - get - { - return Current.FromAmps(ReadOcpSetpoint()); - } + /// + /// + /// + public Current CurrentLimit + { + get + { + return Current.FromAmps(ReadOcpSetpoint()); + } - set - { - _overCurrentProtection = value.Amps; + set + { + _overCurrentProtection = value.Amps; - SetAndConfirmOCP(); - } - } + SetAndConfirmOCP(); + } + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Keysight Scpi Power Supply"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Keysight Scpi Power Supply"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool Enabled - { - get - { - return IsOutputOn(); - } + /// + /// + /// + public bool Enabled + { + get + { + return IsOutputOn(); + } - set - { - if (value == false) - { - Off(); - } - else - { - On(); - } - } - } + set + { + if (value == false) + { + Off(); + } + else + { + On(); + } + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Returns this object's module number. - /// - /// The module number. - /*public int GetModuleNumber() + /// + /// Returns this object's module number. + /// + /// The module number. + /*public int GetModuleNumber() { return _moduleNumber; }*/ - /// - /// - /// - public bool InhibitEnabled - { - get - { - return false; - } + /// + /// + /// + public bool InhibitEnabled + { + get + { + return false; + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - // make sure it is off - Off(); + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + // make sure it is off + Off(); - // set up power supply - // for 6702 look at page 36 - SetConstantVoltageMode(); - SetAndConfirmOVP(); - SetAndConfirmOCP(); - SetVoltageSetpoint(_voltageSetpoint); + // set up power supply + // for 6702 look at page 36 + SetConstantVoltageMode(); + SetAndConfirmOVP(); + SetAndConfirmOCP(); + SetVoltageSetpoint(_voltageSetpoint); - // -1.0 means leave as default - if (_inRushDelay != -1.0) - { - SetAndConfirmInRushDelay(); - } + // -1.0 means leave as default + if (_inRushDelay != -1.0) + { + SetAndConfirmInRushDelay(); + } - // -1.0 means leave as default - if (_slewRateVoltsPerSecond != -1.0) - { - SetAndConfirmSlewRate(); - } + // -1.0 means leave as default + if (_slewRateVoltsPerSecond != -1.0) + { + SetAndConfirmSlewRate(); + } - _state = State.Ready; - } - else - { - throw new Exception("PowerSupplyKeysight::Initialize() - " + _name + " expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + _state = State.Ready; + } + else + { + throw new Exception(_name + " expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// Control the power supply internal mechanical relay state - /// - /// True to connect, false to disconnect - public void MechanicalRelayOutputControl(bool shallWeConnect) - { - throw new Exception("Not yet implemented"); - } + /// + /// Control the power supply internal mechanical relay state + /// + /// True to connect, false to disconnect + public void MechanicalRelayOutputControl(bool shallWeConnect) + { + throw new Exception("Not yet implemented"); + } - /// - /// - /// - /// - public Current MeasureCurrent() - { - return Current.FromAmps(ReadCurrent()); - } + /// + /// + /// + /// + public Current MeasureCurrent() + { + return Current.FromAmps(ReadCurrent()); + } - /// - /// - /// - /// - public Voltage MeasureVoltage() - { - return Voltage.FromVolts(ReadVoltage()); - } + /// + /// + /// + /// + public Voltage MeasureVoltage() + { + return Voltage.FromVolts(ReadVoltage()); + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public Voltage OutputVoltage - { - get - { - return Voltage.FromVolts(ReadVoltageSetpoint()); - } + /// + /// + /// + public Voltage OutputVoltage + { + get + { + return Voltage.FromVolts(ReadVoltageSetpoint()); + } - set - { - double volts = value.Volts; + set + { + double volts = value.Volts; - // do not let host set the voltage out of range, unless it is being set to 0 - if (volts != 0.0) - { - if (volts > _maxVoltageSetpoint || volts < _minVoltageSetpoint) - { - throw new Exception("PowerSupplyKeysight::OutputVoltage() - Desired voltage setpoint out of range for supply " + _name + ". Commanded setpoint: " + value.ToString() + ", Max: " + _maxVoltageSetpoint.ToString() + ", Min: " + _minVoltageSetpoint.ToString()); - } - } + // do not let host set the voltage out of range, unless it is being set to 0 + if (volts != 0.0) + { + if (volts > _maxVoltageSetpoint || volts < _minVoltageSetpoint) + { + throw new Exception("Desired voltage setpoint out of range for supply " + _name + ". Commanded setpoint: " + value.ToString() + ", Max: " + _maxVoltageSetpoint.ToString() + ", Min: " + _minVoltageSetpoint.ToString()); + } + } - SetVoltageSetpoint(volts); - } - } + SetVoltageSetpoint(volts); + } + } - /// - /// - /// - public Voltage OverVoltageProtection - { - get - { - return Voltage.FromVolts(ReadOvpSetpoint()); - } + /// + /// + /// + public Voltage OverVoltageProtection + { + get + { + return Voltage.FromVolts(ReadOvpSetpoint()); + } - set - { - _overVoltageProtection = value.Volts; + set + { + _overVoltageProtection = value.Volts; - SetAndConfirmOVP(); - } - } + SetAndConfirmOVP(); + } + } - /// - /// - /// - public bool OverVoltageProtectionEnabled - { - get - { - return true; - } + /// + /// + /// + public bool OverVoltageProtectionEnabled + { + get + { + return true; + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException("PowerSupplyKeysight::PerformSelfTest() - self test is not implemented in the " + _name + " supply"); - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException("Self test is not implemented in the " + _name + " supply"); + } - /// - /// Read the overvoltage and overcurrent protection status. - /// - /// The binary sum of all bits (decimal value) set in the Questionable Status Condition register. - public int ReadProtectionStatus() - { - // send the command - string command = _scpiCommands._READ_PROTECTION_STATUS_CMD + " " + GetModuleCmd() + "\n"; - string rspStr = IOQuery(command); + /// + /// Read the overvoltage and overcurrent protection status. + /// + /// The binary sum of all bits (decimal value) set in the Questionable Status Condition register. + public int ReadProtectionStatus() + { + // send the command + string command = _scpiCommands._READ_PROTECTION_STATUS_CMD + " " + GetModuleCmd() + "\n"; + string rspStr = IOQuery(command); - // parse the response - string[] tokens = rspStr.Split('\n'); + // parse the response + string[] tokens = rspStr.Split('\n'); - int ret = Util.ConvertStringToInt32(tokens[0]); + int ret = Util.ConvertStringToInt32(tokens[0]); - return ret; - } + return ret; + } - /// - /// - /// - public void Reset() - { - throw new NotImplementedException("PowerSupplyKeysight::Reset() - cant reset a module, only the system"); - } + /// + /// + /// + public void Reset() + { + throw new NotImplementedException("Cant reset a module, only the system"); + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// + /// + /// + /// - public void Shutdown() - { - if (_state == State.Ready) - { - string errorMsg = ""; + public void Shutdown() + { + if (_state == State.Ready) + { + string errorMsg = ""; - try - { - Off(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + try + { + Off(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - _state = State.Uninitialized; + _state = State.Uninitialized; - if (errorMsg != "") - { - throw new Exception("PowerSupplyKeysight::ShutdDown() - Power Supply " + _name + " had an error: " + errorMsg); - } - } - } + if (errorMsg != "") + { + throw new Exception("Power Supply " + _name + " had an error: " + errorMsg); + } + } + } - /// - /// - /// - public Voltage VoltageSoftLimit - { - get - { - return Voltage.FromVolts(_maxVoltageSetpoint); - } + /// + /// + /// + public Voltage VoltageSoftLimit + { + get + { + return Voltage.FromVolts(_maxVoltageSetpoint); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } #endregion @@ -506,33 +492,19 @@ namespace Raytheon.Instruments /// True = currently disposing, False = not disposing. protected virtual void Dispose(bool disposing) { - try + if (disposing) { - if (disposing) + if (_state == State.Ready) { - if (_state == State.Ready) + try { - try - { - Off(); - } - catch (Exception) - { - } - - _state = State.Uninitialized; + Off(); } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected + catch (Exception) + { + } + + _state = State.Uninitialized; } } } @@ -651,7 +623,7 @@ namespace Raytheon.Instruments if (programmedSlewValue != _slewRateVoltsPerSecond) { - string errMsg = "PowerSupplyKeysight:SetAndConfirmSlewRate() - power supply " + _name + " reported a setpoint slew rate that was not cmmanded. Trying to set it to: " + _slewRateVoltsPerSecond + ", the power supply returned: " + programmedSlewValue; + string errMsg = "Power supply " + _name + " reported a setpoint slew rate that was not commanded. Trying to set it to: " + _slewRateVoltsPerSecond + ", the power supply returned: " + programmedSlewValue; throw new Exception(errMsg); } } @@ -669,12 +641,12 @@ namespace Raytheon.Instruments { if (voltage > _maxVoltageSetpoint || voltage < _minVoltageSetpoint) { - throw new Exception("PowerSupplyKeysight:SetVoltageSetpoint() - Desired voltage setpoint for supply " + _name + " out of range. Commanded setpoint: " + voltage.ToString() + ", Max: " + _maxVoltageSetpoint.ToString() + ", Min: " + _minVoltageSetpoint.ToString()); + throw new Exception("Desired voltage setpoint for supply " + _name + " out of range. Commanded setpoint: " + voltage.ToString() + ", Max: " + _maxVoltageSetpoint.ToString() + ", Min: " + _minVoltageSetpoint.ToString()); } if (voltage > _overVoltageProtection) { - throw new Exception("PowerSupplyKeysight:SetVoltageSetpoint() - Desired voltage setpoint for supply " + _name + " out of range. Commanded setpoint: " + voltage.ToString() + ", OVP is: " + _overVoltageProtection.ToString()); + throw new Exception("Desired voltage setpoint for supply " + _name + " out of range. Commanded setpoint: " + voltage.ToString() + ", OVP is: " + _overVoltageProtection.ToString()); } } @@ -687,12 +659,12 @@ namespace Raytheon.Instruments if (voltageSetpointReturned < (voltage - TOLERANCE)) { - string errMsg = "PowerSupplyKeysight:SetVoltageSetpoint() - power supply " + _name + " reported setpoint voltage lower than expected. Trying to set it to: " + voltage + ", the power supply returned: " + voltageSetpointReturned; + string errMsg = "Power supply " + _name + " reported setpoint voltage lower than expected. Trying to set it to: " + voltage + ", the power supply returned: " + voltageSetpointReturned; throw new Exception(errMsg); } else if (voltageSetpointReturned > (voltage + TOLERANCE)) { - string errMsg = "PowerSupplyKeysight:SetVoltageSetpoint() - power supply " + _name + " reported setpoint voltage higher than expected. Trying to set it to: " + voltage + ", the power supply returned: " + voltageSetpointReturned; + string errMsg = "Power supply " + _name + " reported setpoint voltage higher than expected. Trying to set it to: " + voltage + ", the power supply returned: " + voltageSetpointReturned; throw new Exception(errMsg); } @@ -713,7 +685,7 @@ namespace Raytheon.Instruments { response = Encoding.ASCII.GetString(_readBuffer, 0, bytesRead); } - + return response; } diff --git a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplySystemKeysight.cs b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplySystemKeysight.cs index 4dcab0b..66d7370 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplySystemKeysight.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplySystemKeysight.cs @@ -20,16 +20,15 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. using System; using System.Collections.Generic; +using System.IO; +using System.Linq; using System.Net.Sockets; using System.Text; -using Raytheon.Common; -using Raytheon.Units; -using NLog; -using System.IO; -using System.Reflection; -using System.Linq; -using Raytheon.Instruments.PowerSupply; using System.Threading; +using NLog; +using Raytheon.Common; +using Raytheon.Instruments.PowerSupply; +using Raytheon.Units; namespace Raytheon.Instruments { @@ -41,36 +40,31 @@ namespace Raytheon.Instruments #region PrivateClassMembers private byte[] _readBuffer; - private NetworkStream _tcpStream; - private readonly SortedDictionary _powerModuleMap; + private NetworkStream _tcpStream; + private readonly SortedDictionary _powerModuleMap; private Dictionary _powerModuleInfoDict = new Dictionary(); //@@@ Don't want this here, but until the interface can change..this is the only option private readonly SortedDictionary _powerModuleInitialVoltageSetpoint; - private string _name; - private object _syncObj = new Object(); - private const int _READ_TIMEOUT = 5000; - private readonly List _moduleNumbersThatHaveBeenAdded; - private readonly PowerScpiCommands _scpiCommands; - private State _state; - private readonly string _address; - private readonly int _port; - private SelfTestResult _selfTestResult; - private readonly bool _shallWeCoupleOutputProtection; + private string _name; + private object _syncObj = new Object(); + private const int _READ_TIMEOUT = 5000; + private readonly List _moduleNumbersThatHaveBeenAdded; + private readonly PowerScpiCommands _scpiCommands; + private State _state; + private readonly string _address; + private readonly int _port; + private SelfTestResult _selfTestResult; + private readonly bool _shallWeCoupleOutputProtection; private List _groupedModules; private List _coupledModules; - /// - /// NLog logger - /// private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - private IConfigurationFile _powerSupplySystemConfig; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + private IConfigurationFile _powerSupplySystemConfig; #endregion @@ -82,212 +76,211 @@ namespace Raytheon.Instruments /// /// /// - public PowerSupplySystemKeysight(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - const int READ_BUFFER_SIZE = 512; + public PowerSupplySystemKeysight(string deviceName, IConfigurationManager configurationManager) + { + const int READ_BUFFER_SIZE = 512; - Name = deviceName; + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); _configurationManager = configurationManager; _configuration = _configurationManager.GetConfiguration(Name); - string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - string powerSupplySystemDefPath = _configuration.GetConfigurationValue(deviceName, PowerSupply.ConfigXml.POWER_SUPPLY_SYSTEM_DEF_FILEPATH.ToString()); + string powerSupplySystemDefPath = _configuration.GetConfigurationValue(deviceName, PowerSupply.ConfigXml.POWER_SUPPLY_SYSTEM_DEF_FILEPATH.ToString()); - if (!Path.IsPathRooted(powerSupplySystemDefPath)) - powerSupplySystemDefPath = Path.GetFullPath(Path.Combine(assemblyFolder, powerSupplySystemDefPath)); + if (!Path.IsPathRooted(powerSupplySystemDefPath)) + powerSupplySystemDefPath = Path.GetFullPath(Path.Combine(_configurationManager.ConfigurationStoragePath, powerSupplySystemDefPath)); _powerSupplySystemConfig = new ConfigurationFile(powerSupplySystemDefPath); _address = _powerSupplySystemConfig.ReadValue(deviceName, PowerSupply.ConfigIni.ETHERNET_ADDRESS.ToString()); Int32.TryParse(_powerSupplySystemConfig.ReadValue(deviceName, PowerSupply.ConfigIni.ETHERNET_PORT.ToString()), out _port); - _port = _powerSupplySystemConfig.ReadValue(deviceName, PowerSupply.ConfigIni.ETHERNET_PORT.ToString(), 1); + _port = _powerSupplySystemConfig.ReadValue(deviceName, PowerSupply.ConfigIni.ETHERNET_PORT.ToString(), 1); _shallWeCoupleOutputProtection = _powerSupplySystemConfig.ReadValue(deviceName, PowerSupply.ConfigIni.ENABLE_OUTPUT_COUPLING_PROTECTION.ToString(), false); - _readBuffer = new byte[READ_BUFFER_SIZE]; - _powerModuleInitialVoltageSetpoint = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); - _moduleNumbersThatHaveBeenAdded = new List(); - _powerModuleMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); + _readBuffer = new byte[READ_BUFFER_SIZE]; + _powerModuleInitialVoltageSetpoint = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); + _moduleNumbersThatHaveBeenAdded = new List(); + _powerModuleMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); - var scpiDefPath = _powerSupplySystemConfig.ReadValue(deviceName, PowerSupply.ConfigIni.SCPI_DEF_FILEPATH.ToString()); + var scpiDefPath = _powerSupplySystemConfig.ReadValue(deviceName, PowerSupply.ConfigIni.SCPI_DEF_FILEPATH.ToString()); if (!Path.IsPathRooted(scpiDefPath)) - scpiDefPath = Path.GetFullPath(Path.Combine(assemblyFolder, scpiDefPath)); + scpiDefPath = Path.GetFullPath(Path.Combine(_configurationManager.ConfigurationStoragePath, scpiDefPath)); _scpiCommands = new PowerScpiCommands(scpiDefPath); _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Keysight Scpi Power Supply System called " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Keysight Scpi Power Supply System called " + _name; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - lock (_syncObj) - { - if (value == true) - { - // send the command - string command = _scpiCommands._SET_FRONTPANEL_ENABLE_CMD + "\n"; - IOWrite(command); - } - else - { - string command = _scpiCommands._SET_FRONTPANEL_DISABLE_CMD + "\n"; - IOWrite(command); - } - } - } - } + set + { + lock (_syncObj) + { + if (value == true) + { + // send the command + string command = _scpiCommands._SET_FRONTPANEL_ENABLE_CMD + "\n"; + IOWrite(command); + } + else + { + string command = _scpiCommands._SET_FRONTPANEL_DISABLE_CMD + "\n"; + IOWrite(command); + } + } + } + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - try - { - lock (_syncObj) - { - Dispose(true); + /// + /// Dispose of this object. + /// + public void Dispose() + { + try + { + lock (_syncObj) + { + Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception ex) - { - _logger.Error(ex, ex.Message); - } - } + GC.SuppressFinalize(this); + } + } + catch (Exception ex) + { + _logger.Error(ex, ex.Message); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - lock (_syncObj) - { - if (value == true) - { - // send the command - string command = _scpiCommands._SET_FRONTPANEL_ENABLE_CMD + "\n"; - IOWrite(command); - } - else - { - string command = _scpiCommands._SET_FRONTPANEL_DISABLE_CMD + "\n"; - IOWrite(command); - } - } - } - } + set + { + lock (_syncObj) + { + if (value == true) + { + // send the command + string command = _scpiCommands._SET_FRONTPANEL_ENABLE_CMD + "\n"; + IOWrite(command); + } + else + { + string command = _scpiCommands._SET_FRONTPANEL_DISABLE_CMD + "\n"; + IOWrite(command); + } + } + } + } - /// - /// Get the error code. - /// - /// The error code. - /// The error description. - public string GetErrorCode(out int errorCode) - { - lock (_syncObj) - { - // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query + /// + /// Get the error code. + /// + /// The error code. + /// The error description. + public string GetErrorCode(out int errorCode) + { + lock (_syncObj) + { + // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query - string command = _scpiCommands._READ_ERROR_CODE_CMD + "\n"; + string command = _scpiCommands._READ_ERROR_CODE_CMD + "\n"; - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - // send the data out - CommInterfaceWrite(commandBuffer); + // send the data out + CommInterfaceWrite(commandBuffer); - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); // read the response string rspStr = GetResponse(); - // parse the response - string[] tokens = rspStr.Split(','); + // parse the response + string[] tokens = rspStr.Split(','); - errorCode = Util.ConvertStringToInt32(tokens[0]); + errorCode = Util.ConvertStringToInt32(tokens[0]); - // it should always be 2 - if (tokens.Length >= 2) - { - return tokens[1]; - } - else - { - return ""; - } - } - } + // it should always be 2 + if (tokens.Length >= 2) + { + return tokens[1]; + } + else + { + return ""; + } + } + } - /// - /// Get the names of the modules in this system - /// - /// - public List GetModuleNames() - { - lock (_syncObj) - { - List moduleNames = new List(); + /// + /// Get the names of the modules in this system + /// + /// + public List GetModuleNames() + { + lock (_syncObj) + { + List moduleNames = new List(); - foreach (KeyValuePair modules in _powerModuleMap) - { - moduleNames.Add(modules.Key); - } + foreach (KeyValuePair modules in _powerModuleMap) + { + moduleNames.Add(modules.Key); + } - return moduleNames; - } - } + return moduleNames; + } + } /// /// Get the dictionary that contains configuration information for each module /// /// public Dictionary GetPowerSupplyModuleInfoDict(string powerSystem) - { + { lock (_syncObj) { - return _powerModuleInfoDict; + return _powerModuleInfoDict; } } @@ -297,100 +290,104 @@ namespace Raytheon.Instruments /// The module to get the overcurrent protection setting. /// The current (Amps). public double GetOverCurrentSetting(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::GetOverCurrentSetting() - could not find supply: " + name.ToUpper() + " in System " + _name); - } + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::GetOverCurrentSetting() - could not find supply: " + name.ToUpper() + " in System " + _name); + } - return _powerModuleMap[name.ToUpper()].CurrentLimit.Amps; - } - } + return _powerModuleMap[name.ToUpper()].CurrentLimit.Amps; + } + } - /// - /// Get the overvoltage protection setting. - /// - /// The module to get the overvoltage protection setting. - /// The voltage (Volts). - public double GetOverVoltageSetting(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::GetOverVoltageSetting() - could not find supply: " + name.ToUpper() + " in System " + _name); - } + /// + /// Get the overvoltage protection setting. + /// + /// The module to get the overvoltage protection setting. + /// The voltage (Volts). + public double GetOverVoltageSetting(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::GetOverVoltageSetting() - could not find supply: " + name.ToUpper() + " in System " + _name); + } - return _powerModuleMap[name.ToUpper()].OverVoltageProtection.Volts; - } - } + return _powerModuleMap[name.ToUpper()].OverVoltageProtection.Volts; + } + } - /// - /// - /// - /// - public double GetSlewRate(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::GetSlewRate() - could not find supply: " + name.ToUpper() + " in System " + _name); - } + /// + /// + /// + /// + public double GetSlewRate(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::GetSlewRate() - could not find supply: " + name.ToUpper() + " in System " + _name); + } - throw new NotImplementedException(); + throw new NotImplementedException(); - //return _powerModuleMap[name.ToUpper()].GetSlewRate(); - } - } + //return _powerModuleMap[name.ToUpper()].GetSlewRate(); + } + } - /// - /// Get the voltage setpoint. - /// - /// The module to get the voltage setpoint setting. - /// the voltage setpoint (Volts). - public double GetVoltageSetting(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::GetVoltageSetting() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + /// + /// Get the voltage setpoint. + /// + /// The module to get the voltage setpoint setting. + /// the voltage setpoint (Volts). + public double GetVoltageSetting(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::GetVoltageSetting() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - return _powerModuleMap[name.ToUpper()].OutputVoltage.Volts; - } - } + return _powerModuleMap[name.ToUpper()].OutputVoltage.Volts; + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - try - { - TcpClient powerSupplySocketConn = new TcpClient(_address, _port); - // connect to the supply and setup stream - _tcpStream = powerSupplySocketConn.GetStream(); - _tcpStream.ReadTimeout = _READ_TIMEOUT; + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + try + { + TcpClient powerSupplySocketConn = null; + if (_tcpStream == null) + { + powerSupplySocketConn = new TcpClient(_address, _port); + // connect to the supply and setup stream + _tcpStream = powerSupplySocketConn.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; - Reset(); + Reset(); + } string coupledModules = _powerSupplySystemConfig.ReadValue(Name, PowerSupply.ConfigIni.COUPLED_MODULES.ToString()); string groupedModules = _powerSupplySystemConfig.ReadValue(Name, PowerSupply.ConfigIni.GROUPED_MODULES.ToString()); @@ -410,7 +407,7 @@ namespace Raytheon.Instruments { _tcpStream.Close(); powerSupplySocketConn.Close(); - powerSupplySocketConn = new TcpClient(_address, _port); + powerSupplySocketConn = new TcpClient(_address, _port); _tcpStream = powerSupplySocketConn.GetStream(); _tcpStream.ReadTimeout = _READ_TIMEOUT; } @@ -423,31 +420,31 @@ namespace Raytheon.Instruments } double overCurrentProtection; - double overVoltageProtection; - double voltageSetpoint; - double maxVoltageSetpoint; - double minVoltageSetpoint; - double slewRateVoltsPerSecond; - double inRushDelaySecs; - int moduleNumber = -1; - for (int i = 0; i < powerModules.Count(); i++) - { - string moduleName = powerModules[i]; + double overVoltageProtection; + double voltageSetpoint; + double maxVoltageSetpoint; + double minVoltageSetpoint; + double slewRateVoltsPerSecond; + double inRushDelaySecs; + int moduleNumber = -1; + for (int i = 0; i < powerModules.Count(); i++) + { + string moduleName = powerModules[i]; - int.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.INDEX.ToString()), out moduleNumber); - Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.OCP.ToString()), out overCurrentProtection); - Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.OVP.ToString()), out overVoltageProtection); - Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.VOLTAGE_SETPOINT.ToString()), out voltageSetpoint); - Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.MIN_VOLTAGE.ToString()), out minVoltageSetpoint); - Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.MAX_VOLTAGE.ToString()), out maxVoltageSetpoint); + int.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.INDEX.ToString()), out moduleNumber); + Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.OCP.ToString()), out overCurrentProtection); + Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.OVP.ToString()), out overVoltageProtection); + Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.VOLTAGE_SETPOINT.ToString()), out voltageSetpoint); + Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.MIN_VOLTAGE.ToString()), out minVoltageSetpoint); + Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.MAX_VOLTAGE.ToString()), out maxVoltageSetpoint); - try - { - if (!Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.VOLTAGE_SLEW_RATE.ToString()), out slewRateVoltsPerSecond)) - slewRateVoltsPerSecond = -1.0; - } - catch - { + try + { + if (!Double.TryParse(_powerSupplySystemConfig.ReadValue($"{Name}.{moduleName}", PowerSupply.ConfigIni.VOLTAGE_SLEW_RATE.ToString()), out slewRateVoltsPerSecond)) + slewRateVoltsPerSecond = -1.0; + } + catch + { slewRateVoltsPerSecond = -1.0; } @@ -463,115 +460,115 @@ namespace Raytheon.Instruments _powerModuleInfoDict[moduleName] = new PowerSupplyModuleInfo(moduleNumber, overCurrentProtection, overVoltageProtection, voltageSetpoint, slewRateVoltsPerSecond, minVoltageSetpoint, maxVoltageSetpoint); - // create and initialize the power module - IDCPwr powerSupply = new PowerSupplyKeysight(moduleName, _scpiCommands, overCurrentProtection, overVoltageProtection, voltageSetpoint, maxVoltageSetpoint, minVoltageSetpoint, inRushDelaySecs, slewRateVoltsPerSecond, _tcpStream, moduleNumber); + // create and initialize the power module + IDCPwr powerSupply = new PowerSupplyKeysight(moduleName, _scpiCommands, overCurrentProtection, overVoltageProtection, voltageSetpoint, maxVoltageSetpoint, minVoltageSetpoint, inRushDelaySecs, slewRateVoltsPerSecond, _tcpStream, moduleNumber); - // remember that we have added this module - _moduleNumbersThatHaveBeenAdded.Add(moduleNumber); + // remember that we have added this module + _moduleNumbersThatHaveBeenAdded.Add(moduleNumber); - // remember the module name - _powerModuleMap.Add(moduleName.ToUpper(), powerSupply); + // remember the module name + _powerModuleMap.Add(moduleName.ToUpper(), powerSupply); - // remember the initial voltage setpoint - _powerModuleInitialVoltageSetpoint.Add(moduleName.ToUpper(), voltageSetpoint); + // remember the initial voltage setpoint + _powerModuleInitialVoltageSetpoint.Add(moduleName.ToUpper(), voltageSetpoint); - powerSupply.Initialize(); - } + powerSupply.Initialize(); + } - if (_shallWeCoupleOutputProtection == true) - { - EnableOutputProtectionCoupling(); - } + if (_shallWeCoupleOutputProtection == true) + { + EnableOutputProtectionCoupling(); + } - _state = State.Ready; - } - catch (Exception) - { - throw; - } - } - else - { - throw new Exception("PowerSupplySystemKeysight::Initialize() - expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } + _state = State.Ready; + } + catch (Exception) + { + throw; + } + } + else + { + throw new Exception("PowerSupplySystemKeysight::Initialize() - expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// Query the output state. - /// - /// The module to query. - /// The output state. True = On, False = Off. - public bool IsOutputOn(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::IsOutputOn() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + /// + /// Query the output state. + /// + /// The module to query. + /// The output state. True = On, False = Off. + public bool IsOutputOn(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::IsOutputOn() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - return _powerModuleMap[name.ToUpper()].Enabled; - } - } + return _powerModuleMap[name.ToUpper()].Enabled; + } + } - /// - /// Send a command to the power supply and get the response. - /// - /// The command to send. - /// The power supply response. - public string IOQuery(string commandString) - { - lock (_syncObj) - { - // not calling IOWrite() so IOWrite() can check for errors after each write + /// + /// Send a command to the power supply and get the response. + /// + /// The command to send. + /// The power supply response. + public string IOQuery(string commandString) + { + lock (_syncObj) + { + // not calling IOWrite() so IOWrite() can check for errors after each write - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); - // send the data out - CommInterfaceWrite(commandBuffer); + // send the data out + CommInterfaceWrite(commandBuffer); - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); // read from the response string rspStr = GetResponse(); - // check for errors - int errorCode = -1; - string err = GetErrorCode(out errorCode); - if (errorCode != 0) - { - throw new Exception("PowerSupplySystemKeysight::IOQuery() - System " + _name + " returned error: " + err); - } + // check for errors + int errorCode = -1; + string err = GetErrorCode(out errorCode); + if (errorCode != 0) + { + throw new Exception("PowerSupplySystemKeysight::IOQuery() - System " + _name + " returned error: " + err); + } - return rspStr; - } - } + return rspStr; + } + } - /// - /// Sends a SCPI Command to the instrument. - /// - /// The SCPI Command to be sent to the instrument. - public void IOWrite(string commandString) - { - lock (_syncObj) - { - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); + /// + /// Sends a SCPI Command to the instrument. + /// + /// The SCPI Command to be sent to the instrument. + public void IOWrite(string commandString) + { + lock (_syncObj) + { + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); - // send the data out - CommInterfaceWrite(commandBuffer); + // send the data out + CommInterfaceWrite(commandBuffer); - // check for errors - int errorCode = -1; - string err = GetErrorCode(out errorCode); - if (errorCode != 0) - { - throw new Exception("PowerSupplySystemKeysight::IOWrite() - System " + _name + " returned error: " + err); - } - } - } + // check for errors + int errorCode = -1; + string err = GetErrorCode(out errorCode); + if (errorCode != 0) + { + throw new Exception("PowerSupplySystemKeysight::IOWrite() - System " + _name + " returned error: " + err); + } + } + } /// /// Control the power supply internal mechanical relay state @@ -597,412 +594,434 @@ namespace Raytheon.Instruments /// The name of the module. /// The current (Amps). public double MeasureCurrent(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::MeasureCurrent() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::MeasureCurrent() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - return _powerModuleMap[name.ToUpper()].MeasureCurrent().Amps; - } - } + return _powerModuleMap[name.ToUpper()].MeasureCurrent().Amps; + } + } - /// - /// Read the voltage. - /// - /// The name of the module. - /// The voltage (Volts). - public double MeasureVoltage(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::MeasureVoltage() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + /// + /// Read the voltage. + /// + /// The name of the module. + /// The voltage (Volts). + public double MeasureVoltage(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::MeasureVoltage() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - return _powerModuleMap[name.ToUpper()].MeasureVoltage().Volts; - } - } + return _powerModuleMap[name.ToUpper()].MeasureVoltage().Volts; + } + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } - /// - /// Turn the output off. - /// - /// The name of the module. - public void Off(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::Off() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + /// + /// Turn the output off. + /// + /// The name of the module. + public void Off(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::Off() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - _powerModuleMap[name.ToUpper()].Enabled = false; - } - } + _powerModuleMap[name.ToUpper()].Enabled = false; - /// - /// Turn the output on. - /// - /// The name of the module. - public void On(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::On() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + _powerModuleInfoDict[name].isOn_ = false; + } + } - _powerModuleMap[name.ToUpper()].Enabled = true; - } - } + /// + /// Turn the output on. + /// + /// The name of the module. + public void On(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::On() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - try - { - lock (_syncObj) - { - // change the timeout to account for the long self test - CommSetReadTimeout(30000); + _powerModuleMap[name.ToUpper()].Enabled = true; - // send the command and get the response - string command = _scpiCommands._SELFTEST_CMD + "\n"; - string rspStr = IOQuery(command); + _powerModuleInfoDict[name].isOn_ = true; + } + } - // parse the response - string[] tokens = rspStr.Split('\n'); + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { - int rsp = Util.ConvertStringToInt32(tokens[0]); + TcpClient powerSupplySocketConn = null; + try + { + lock (_syncObj) + { + if (_tcpStream == null) + { + powerSupplySocketConn = new TcpClient(_address, _port); + // connect to the supply and setup stream + _tcpStream = powerSupplySocketConn.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; - if (rsp != 0) - { - _selfTestResult = SelfTestResult.Fail; - string errorMsg = "PowerSupplySystemKeysight::PerformSelfTest() - System " + _name + " returned an error: " + rsp.ToString(); - throw new Exception(errorMsg); - } + Reset(); + } - _selfTestResult = SelfTestResult.Pass; + // change the timeout to account for the long self test + CommSetReadTimeout(30000); - return SelfTestResult.Pass; - } - } - catch (Exception) - { - _selfTestResult = SelfTestResult.Fail; - throw; - } - finally - { - // restore the timeout - CommSetReadTimeout(_READ_TIMEOUT); - } - } + // send the command and get the response + string command = _scpiCommands._SELFTEST_CMD + "\n"; + string rspStr = IOQuery(command); - /// - /// Read the overvoltage and overcurrent protection status. - /// - /// The name of the module. - /// The binary sum of all bits (decimal value) set in the Questionable Status Enable register. - public int ReadProtectionStatus(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::ReadProtectionStatus() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + // parse the response + string[] tokens = rspStr.Split('\n'); - return _powerModuleMap[name.ToUpper()].ReadProtectionStatus(); - } - } + int rsp = Util.ConvertStringToInt32(tokens[0]); - /// - /// reads power data - /// - /// - /// A Power Data Object - public PowerData ReadPowerData(string name) - { - lock (_syncObj) - { - // voltage, voltage setpoint, current, output status - double voltage = MeasureVoltage(name); - double voltageSetpoint = GetVoltageSetting(name); - double current = MeasureCurrent(name); - bool outputStatus = IsOutputOn(name); - int faultStatus = ReadProtectionStatus(name); - double overVoltageProtection = GetOverVoltageSetting(name); - double overCurrentProtection = GetOverCurrentSetting(name); + if (rsp != 0) + { + _selfTestResult = SelfTestResult.Fail; + string errorMsg = "PowerSupplySystemKeysight::PerformSelfTest() - System " + _name + " returned an error: " + rsp.ToString(); + throw new Exception(errorMsg); + } - return new PowerData(voltage, voltageSetpoint, overVoltageProtection, current, overCurrentProtection, outputStatus, faultStatus); - } - } + _selfTestResult = SelfTestResult.Pass; - /// - /// reads power data - /// - /// - /// - /// - /// - /// - /// - public void ReadPowerData(string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool outputStatus, out int faultStatus) - { - lock (_syncObj) - { - // voltage, voltage setpoint, current, output status - voltage = MeasureVoltage(moduleName); - voltageSetpoint = GetVoltageSetting(moduleName); - current = MeasureCurrent(moduleName); - outputStatus = IsOutputOn(moduleName); - faultStatus = ReadProtectionStatus(moduleName); - } - } + return SelfTestResult.Pass; + } + } + catch (Exception) + { + _selfTestResult = SelfTestResult.Fail; + throw; + } + finally + { + if (_tcpStream != null) + { + _tcpStream.Close(); + _tcpStream = null; + } - /// - /// Resets the instrument - /// - public void Reset() - { - lock (_syncObj) - { - // send the command - string command = _scpiCommands._RESET_CMD + "\n"; - IOWrite(command); - } - } + if (powerSupplySocketConn != null) + powerSupplySocketConn.Close(); + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// Read the overvoltage and overcurrent protection status. + /// + /// The name of the module. + /// The binary sum of all bits (decimal value) set in the Questionable Status Enable register. + public int ReadProtectionStatus(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::ReadProtectionStatus() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - /// - /// Changes the setpoint voltage back to the value that was passed into the constructor - /// - /// The name of the power module - public void SetInitialVoltage(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::SetInitialVoltage() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + return _powerModuleMap[name.ToUpper()].ReadProtectionStatus(); + } + } - double initializeVoltage = _powerModuleInitialVoltageSetpoint[name.ToUpper()]; + /// + /// reads power data + /// + /// + /// A Power Data Object + public PowerData ReadPowerData(string name) + { + lock (_syncObj) + { + // voltage, voltage setpoint, current, output status + double voltage = MeasureVoltage(name); + double voltageSetpoint = GetVoltageSetting(name); + double current = MeasureCurrent(name); + bool isOutputOn = IsOutputOn(name); + int faultStatus = ReadProtectionStatus(name); + double overVoltageProtection = GetOverVoltageSetting(name); + double overCurrentProtection = GetOverCurrentSetting(name); - SetVoltageSetpoint(name.ToUpper(), initializeVoltage); - } - } + return new PowerData(voltage, voltageSetpoint, overVoltageProtection, current, overCurrentProtection, isOutputOn, faultStatus); + } + } - /// - /// Set the slew rate - /// - /// slew in volts per second - public void SetSlewRate(string name, double commandedSlew) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::SetSlewRate() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + /// + /// reads power data + /// + /// + /// + /// + /// + /// + /// + public void ReadPowerData(string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool isOutputOn, out int faultStatus) + { + lock (_syncObj) + { + // voltage, voltage setpoint, current, output status + voltage = MeasureVoltage(moduleName); + voltageSetpoint = GetVoltageSetting(moduleName); + current = MeasureCurrent(moduleName); + isOutputOn = IsOutputOn(moduleName); + faultStatus = ReadProtectionStatus(moduleName); + } + } - throw new NotImplementedException(); + /// + /// Resets the instrument + /// + public void Reset() + { + lock (_syncObj) + { + // send the command + string command = _scpiCommands._RESET_CMD + "\n"; + IOWrite(command); + } + } - //_powerModuleMap[name.ToUpper()].SetSlewRate(commandedSlew); - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// Set the OCP value - /// - /// The name of the power module - /// The value in amps to set as the OCP - public void SetOverCurrentProtection(string moduleName, double ocpValue) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::SetOverCurrentrotection() - could not find supply: " + moduleName.ToUpper() + " In System " + _name); - } + /// + /// Changes the setpoint voltage back to the value that was passed into the constructor + /// + /// The name of the power module + public void SetInitialVoltage(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::SetInitialVoltage() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - _powerModuleMap[moduleName.ToUpper()].CurrentLimit = Current.FromAmps(ocpValue); - } - } + double initializeVoltage = _powerModuleInitialVoltageSetpoint[name.ToUpper()]; - /// - /// - /// - /// The name of the module - /// The value in volts to set as the OVP - public void SetOverVoltageProtection(string moduleName, double ovpValue) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::SetOverVoltageProtection() - could not find supply: " + moduleName.ToUpper() + " In System " + _name); - } + SetVoltageSetpoint(name.ToUpper(), initializeVoltage); + } + } - _powerModuleMap[moduleName.ToUpper()].OverVoltageProtection = Voltage.FromVolts(ovpValue); - } - } + /// + /// Set the slew rate + /// + /// slew in volts per second + public void SetSlewRate(string name, double commandedSlew) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::SetSlewRate() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - /// - /// Set the voltage setpoint. - /// - /// The name of the module. - /// The desired voltage (in volts). - public void SetVoltageSetpoint(string name, double volts) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemKeysight::SetVoltageSetpoint() - could not find supply: " + name.ToUpper() + " In System " + _name); - } + throw new NotImplementedException(); - _powerModuleMap[name.ToUpper()].OutputVoltage = Voltage.FromVolts(volts); - } - } + //_powerModuleMap[name.ToUpper()].SetSlewRate(commandedSlew); + } + } - /// - /// Turns off each supply, resets the system and disposes the socket - /// - public void Shutdown() - { - lock (_syncObj) - { - string errorMsg = ""; + /// + /// Set the OCP value + /// + /// The name of the power module + /// The value in amps to set as the OCP + public void SetOverCurrentProtection(string moduleName, double ocpValue) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::SetOverCurrentrotection() - could not find supply: " + moduleName.ToUpper() + " In System " + _name); + } - if (_state == State.Ready) - { - try - { - foreach (KeyValuePair entry in _powerModuleMap) - { - entry.Value.Shutdown(); - } - } - catch (Exception ex) - { - _logger.Error(ex, ex.Message); - } + _powerModuleMap[moduleName.ToUpper()].CurrentLimit = Current.FromAmps(ocpValue); + } + } - try - { - //Reset System - Reset(); - } - catch (Exception ex) - { - _logger.Error(ex, ex.Message); - } + /// + /// + /// + /// The name of the module + /// The value in volts to set as the OVP + public void SetOverVoltageProtection(string moduleName, double ovpValue) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::SetOverVoltageProtection() - could not find supply: " + moduleName.ToUpper() + " In System " + _name); + } - _state = State.Uninitialized; - } + _powerModuleMap[moduleName.ToUpper()].OverVoltageProtection = Voltage.FromVolts(ovpValue); + } + } - // the stream was created in the constructor, dispose of it here - try - { - if (_tcpStream != null) - { - _tcpStream.Dispose(); - _tcpStream = null; - } - } - catch (Exception ex) - { - _logger.Error(ex, ex.Message); - } + /// + /// Set the voltage setpoint. + /// + /// The name of the module. + /// The desired voltage (in volts). + public void SetVoltageSetpoint(string name, double volts) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("PowerSupplySystemKeysight::SetVoltageSetpoint() - could not find supply: " + name.ToUpper() + " In System " + _name); + } - if (errorMsg != "") - { - throw new Exception("PowerSupplySystemKeysight::ShutdDown() - System " + _name + " Had an error: " + errorMsg); - } - } - } + _powerModuleMap[name.ToUpper()].OutputVoltage = Voltage.FromVolts(volts); + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// Turns off each supply, resets the system and disposes the socket + /// + public void Shutdown() + { + lock (_syncObj) + { + string errorMsg = ""; - /// - /// Turn off the watchdog capability. - /// - public void WatchdogDisable() - { - lock (_syncObj) - { - // send the command - string command = _scpiCommands._SET_WATCHDOGOFF_CMD + "\n"; - IOWrite(command); - } - } + if (_state == State.Ready) + { + try + { + foreach (KeyValuePair entry in _powerModuleMap) + { + entry.Value.Shutdown(); + } + } + catch (Exception ex) + { + _logger.Error(ex, ex.Message); + } - /// - /// Turn on the watchdog capability. - /// - /// The watchdog time in seconds. - public void WatchdogEnable(uint time) - { - lock (_syncObj) - { - string timeCommand = _scpiCommands._SET_WATCHDOGDELAY_CMD + " " + time.ToString() + "\n"; - IOWrite(timeCommand); + try + { + //Reset System + Reset(); + } + catch (Exception ex) + { + _logger.Error(ex, ex.Message); + } - // send the command - string onCommand = _scpiCommands._SET_WATCHDOGON_CMD + "\n"; - IOWrite(onCommand); - } - } + _state = State.Uninitialized; + } - /// - /// gets system name - /// - /// - public string GetSystemName() - { - return _name; - } + // the stream was created in the constructor, dispose of it here + try + { + if (_tcpStream != null) + { + _tcpStream.Dispose(); + _tcpStream = null; + } + } + catch (Exception ex) + { + _logger.Error(ex, ex.Message); + } + + if (errorMsg != "") + { + throw new Exception("PowerSupplySystemKeysight::ShutdDown() - System " + _name + " Had an error: " + errorMsg); + } + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// Turn off the watchdog capability. + /// + public void WatchdogDisable() + { + lock (_syncObj) + { + // send the command + string command = _scpiCommands._SET_WATCHDOGOFF_CMD + "\n"; + IOWrite(command); + } + } + + /// + /// Turn on the watchdog capability. + /// + /// The watchdog time in seconds. + public void WatchdogEnable(uint time) + { + lock (_syncObj) + { + string timeCommand = _scpiCommands._SET_WATCHDOGDELAY_CMD + " " + time.ToString() + "\n"; + IOWrite(timeCommand); + + // send the command + string onCommand = _scpiCommands._SET_WATCHDOGON_CMD + "\n"; + IOWrite(onCommand); + } + } + + /// + /// gets system name + /// + /// + public string GetSystemName() + { + return _name; + } #endregion @@ -1147,7 +1166,7 @@ namespace Raytheon.Instruments groupListToQuery = "\"" + groupListToQuery + "\"\n"; // see if channels are grouped - string queryGroupCommand = _scpiCommands._QUERY_COUPLE_CHANNELS_CMD+ "\n"; + string queryGroupCommand = _scpiCommands._QUERY_COUPLE_CHANNELS_CMD + "\n"; for (int i = 1; i <= 2; i++) { diff --git a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplySystemKeysightFactory.cs b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplySystemKeysightFactory.cs index 0d48e51..e8fdf08 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplySystemKeysightFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemKeysight/PowerSupplySystemKeysightFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "PowerSupplySystemKeysightFactory")] - public class PowerSupplySystemKeysightFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "PowerSupplySystemKeysightFactory")] + public class PowerSupplySystemKeysightFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public PowerSupplySystemKeysightFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public PowerSupplySystemKeysightFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public PowerSupplySystemKeysightFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// PowerSupplySystemKeysightFactory injection constructor + /// + [ImportingConstructor] + public PowerSupplySystemKeysightFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IPowerSupplySystem)); - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new PowerSupplySystemKeysight(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IPowerSupplySystem)); + } + + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new PowerSupplySystemKeysight(name, _configurationManager); + } + catch (Exception) + { + throw; + } } /// @@ -106,16 +99,14 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - if (simulateHw) - return new PowerSupplySystemSim(name, _configurationManager, _logger); - else - return new PowerSupplySystemKeysight(name, _configurationManager, _logger); + if (simulateHw) + return new PowerSupplySystemSim(name, _configurationManager); + else + return new PowerSupplySystemKeysight(name, _configurationManager); } catch (Exception) { - throw; + throw; } } @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySim.cs b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySim.cs index 53401cb..00bfa08 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySim.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySim.cs @@ -15,24 +15,22 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; -using Raytheon.Units; using System; -using System.Net.Sockets; using System.Threading; +using NLog; +using Raytheon.Units; namespace Raytheon.Instruments { - /// - /// A class that provides an interface for controlling simulated power supply systems and their modules. - /// - public class PowerSupplySim : IDCPwr - { - #region PublicClassMembers + /// + /// A class that provides an interface for controlling simulated power supply systems and their modules. + /// + public class PowerSupplySim : IDCPwr + { + #region PublicClassMembers #pragma warning disable CS0067 - public event EventHandler OverCurrent; - public event EventHandler OverVoltage; + public event EventHandler OverCurrent; + public event EventHandler OverVoltage; #pragma warning restore #endregion @@ -131,23 +129,9 @@ namespace Raytheon.Instruments /// public void Dispose() { - try - { - Dispose(true); + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + GC.SuppressFinalize(this); } /// @@ -233,7 +217,7 @@ namespace Raytheon.Instruments } else { - throw new Exception("PowerSupplySim::Initialize() - expected the supply " + _name + " to be Uninitialized, state was: " + _state.ToString()); + throw new Exception("Expected the supply " + _name + " to be Uninitialized, state was: " + _state.ToString()); } } @@ -312,7 +296,7 @@ namespace Raytheon.Instruments { if (volts > _maxVoltageSetpoint || volts < _minVoltageSetpoint) { - throw new Exception("PowerSupplySim::OutputVoltage() - Desired voltage setpoint out of range for supply " + _name + ". Commanded setpoint: " + value.ToString() + ", Max: " + _maxVoltageSetpoint.ToString() + ", Min: " + _minVoltageSetpoint.ToString()); + throw new Exception("Desired voltage setpoint out of range for supply " + _name + ". Commanded setpoint: " + value.ToString() + ", Max: " + _maxVoltageSetpoint.ToString() + ", Min: " + _minVoltageSetpoint.ToString()); } } @@ -452,149 +436,135 @@ namespace Raytheon.Instruments #region PrivateClassMembers private string _name; - private double _overCurrentProtection; - private double _overVoltageProtection; - private double _voltageSetpoint; - private double _voltageSetpointInitial; - private readonly double _maxVoltageSetpoint; - private readonly double _minVoltageSetpoint; - private readonly int _moduleNumber; - private bool _isPowerOn; - private double _slewRateVoltsPerSecond; - private State _state; + private double _overCurrentProtection; + private double _overVoltageProtection; + private double _voltageSetpoint; + private double _voltageSetpointInitial; + private readonly double _maxVoltageSetpoint; + private readonly double _minVoltageSetpoint; + private readonly int _moduleNumber; + private bool _isPowerOn; + private double _slewRateVoltsPerSecond; + private State _state; - /// - /// NLog logger - /// - private readonly ILogger _logger; + /// + /// NLog logger + /// + private readonly ILogger _logger; - #endregion + #endregion - #region PrivateFuctions + #region PrivateFuctions - /// - /// The finalizer. - /// - ~PowerSupplySim() - { - Dispose(false); - } + /// + /// The finalizer. + /// + ~PowerSupplySim() + { + Dispose(false); + } - /// - /// Dispose of this object. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Off(); + /// + /// Dispose of this object. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Off(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _state = State.Uninitialized; + } + } + } - /// - /// Returns this object module number. - /// - /// The module number. - /*public int GetModuleNumber() + /// + /// Returns this object module number. + /// + /// The module number. + /*public int GetModuleNumber() { return _moduleNumber; }*/ - /// - /// Turn the output off (simulated). - /// - private void Off() - { - // a small 10 ms sleep for simulation - Thread.Sleep(10); + /// + /// Turn the output off (simulated). + /// + private void Off() + { + // a small 10 ms sleep for simulation + Thread.Sleep(10); - _isPowerOn = false; - } + _isPowerOn = false; + } - /// - /// Turn the output on (simulated). - /// - private void On() - { - // a small 10 ms sleep for simulation - Thread.Sleep(10); + /// + /// Turn the output on (simulated). + /// + private void On() + { + // a small 10 ms sleep for simulation + Thread.Sleep(10); - _isPowerOn = true; - } + _isPowerOn = true; + } - /// - /// Read the current (simulated). - /// - /// The current (simulated). - private double ReadCurrent() - { - // a small 10 ms sleep for simulation - Thread.Sleep(100); + /// + /// Read the current (simulated). + /// + /// The current (simulated). + private double ReadCurrent() + { + // a small 10 ms sleep for simulation + Thread.Sleep(100); - double currentToReturn = 0.0; + double currentToReturn = 0.0; - if (_isPowerOn) - { - double maxCurrent = _overCurrentProtection; - double minCurrent = _overCurrentProtection - .5; + if (_isPowerOn) + { + double maxCurrent = _overCurrentProtection; + double minCurrent = _overCurrentProtection - .5; - Random rnd = new Random(); + Random rnd = new Random(); - double seed = rnd.NextDouble(); + double seed = rnd.NextDouble(); - currentToReturn = (seed * (maxCurrent - minCurrent)) + minCurrent; - } + currentToReturn = (seed * (maxCurrent - minCurrent)) + minCurrent; + } - return currentToReturn; - } + return currentToReturn; + } - /// - /// Read the voltage. - /// - /// The voltage (simulated). - private double ReadVoltage() - { - // a small 10 ms sleep for simulation - Thread.Sleep(100); + /// + /// Read the voltage. + /// + /// The voltage (simulated). + private double ReadVoltage() + { + // a small 10 ms sleep for simulation + Thread.Sleep(100); - double voltageToReturn = 0.0; + double voltageToReturn = 0.0; - if (_isPowerOn) - { - double maxVoltage = _voltageSetpoint + 1; - double minVoltage = _voltageSetpoint - 1; + if (_isPowerOn) + { + double maxVoltage = _voltageSetpoint + 1; + double minVoltage = _voltageSetpoint - 1; - Random rnd = new Random(); + Random rnd = new Random(); - double seed = rnd.NextDouble(); + double seed = rnd.NextDouble(); - voltageToReturn = (seed * (maxVoltage - minVoltage)) + minVoltage; - } + voltageToReturn = (seed * (maxVoltage - minVoltage)) + minVoltage; + } - return voltageToReturn; - } + return voltageToReturn; + } - #endregion + #endregion - } + } } \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySystemSim.cs b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySystemSim.cs index bf94212..3f0ba75 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySystemSim.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySystemSim.cs @@ -20,163 +20,141 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. using System; using System.Collections.Generic; -using Raytheon.Units; +using System.IO; +using System.Linq; using System.Threading; using NLog; using Raytheon.Common; -using System.Net.Sockets; -using System.Linq; -using System.IO; -using System.Reflection; using Raytheon.Instruments.PowerSupply; +using Raytheon.Units; namespace Raytheon.Instruments { - /// - /// A class to control a power supply system. - /// - public class PowerSupplySystemSim : IPowerSupplySystem - { - #region PrivateClassMembers - private SortedDictionary _powerModuleMap; + /// + /// A class to control a power supply system. + /// + public class PowerSupplySystemSim : IPowerSupplySystem + { + #region PrivateClassMembers + private SortedDictionary _powerModuleMap; private Dictionary _powerModuleInfoDict = new Dictionary(); private SortedDictionary _powerModuleInitialVoltageSetpoint; - private string _name; - private object _syncObj = new Object(); - private List _moduleNumbersThatHaveBeenAdded; - private State _state; - private SelfTestResult _selfTestResult; + private string _name; + private object _syncObj = new Object(); + private List _moduleNumbersThatHaveBeenAdded; + private State _state; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFuctions - /// - /// The Finalizer. - /// - ~PowerSupplySystemSim() - { - Dispose(false); - } + #endregion - /// - /// Dispose of this object. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - lock (_syncObj) - { - if (disposing) - { - if (_state == State.Ready) - { - try - { - //Reset System - Reset(); - } - catch (Exception) - { - } + #region PrivateFuctions + /// + /// The Finalizer. + /// + ~PowerSupplySystemSim() + { + Dispose(false); + } - try - { - foreach (KeyValuePair entry in _powerModuleMap) - { - entry.Value.Shutdown(); - } - } - catch (Exception) - { - } + /// + /// Dispose of this object. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + lock (_syncObj) + { + if (disposing) + { + if (_state == State.Ready) + { + try + { + //Reset System + Reset(); + } + catch (Exception) + { + } - _state = State.Uninitialized; - } - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + try + { + foreach (KeyValuePair entry in _powerModuleMap) + { + entry.Value.Shutdown(); + } + } + catch (Exception) + { + } - #endregion + _state = State.Uninitialized; + } + } + } + } - #region PublicFuctions + #endregion - /// - /// PowerSupplySystemSim factory constructor - /// - /// - /// - /// - public PowerSupplySystemSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - try - { - Name = deviceName; + #region PublicFuctions - _logger = logger; + /// + /// PowerSupplySystemSim factory constructor + /// + /// + /// + /// + public PowerSupplySystemSim(string deviceName, IConfigurationManager configurationManager) + { + try + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - string powerSupplySystemDefPath = _configuration.GetConfigurationValue(deviceName, PowerSupply.ConfigXml.POWER_SUPPLY_SYSTEM_DEF_FILEPATH.ToString()); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - if (!Path.IsPathRooted(powerSupplySystemDefPath)) - powerSupplySystemDefPath = Path.GetFullPath(Path.Combine(assemblyFolder, powerSupplySystemDefPath)); + string powerSupplySystemDefPath = _configuration.GetConfigurationValue(deviceName, PowerSupply.ConfigXml.POWER_SUPPLY_SYSTEM_DEF_FILEPATH.ToString()); - IConfigurationFile config = new ConfigurationFile(powerSupplySystemDefPath); + if (!Path.IsPathRooted(powerSupplySystemDefPath)) + powerSupplySystemDefPath = Path.GetFullPath(Path.Combine(_configurationManager.ConfigurationStoragePath, powerSupplySystemDefPath)); - _powerModuleInitialVoltageSetpoint = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); + IConfigurationFile config = new ConfigurationFile(powerSupplySystemDefPath); - _moduleNumbersThatHaveBeenAdded = new List(); + _powerModuleInitialVoltageSetpoint = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); - _powerModuleMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); + _moduleNumbersThatHaveBeenAdded = new List(); - string moduleDef = config.ReadValue(deviceName, PowerSupply.ConfigIni.MODULE_DEFINITION.ToString()); - List powerModules = moduleDef.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries).ToList(); + _powerModuleMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); - double overCurrentProtection; - double overVoltageProtection; - double voltageSetpoint; - double maxVoltageSetpoint; - double minVoltageSetpoint; - double slewRateVoltsPerSecond; - double inRushDelaySecs; - int moduleNumber = -1; - for (int i = 0; i < powerModules.Count(); i++) - { - string moduleName = powerModules[i]; + string moduleDef = config.ReadValue(deviceName, PowerSupply.ConfigIni.MODULE_DEFINITION.ToString()); + List powerModules = moduleDef.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries).ToList(); - int.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.INDEX.ToString()), out moduleNumber); - Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.OCP.ToString()), out overCurrentProtection); - Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.OVP.ToString()), out overVoltageProtection); - Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.VOLTAGE_SETPOINT.ToString()), out voltageSetpoint); - Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.MIN_VOLTAGE.ToString()), out minVoltageSetpoint); - Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.MAX_VOLTAGE.ToString()), out maxVoltageSetpoint); + double overCurrentProtection; + double overVoltageProtection; + double voltageSetpoint; + double maxVoltageSetpoint; + double minVoltageSetpoint; + double slewRateVoltsPerSecond; + double inRushDelaySecs; + int moduleNumber = -1; + for (int i = 0; i < powerModules.Count(); i++) + { + string moduleName = powerModules[i]; + + int.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.INDEX.ToString()), out moduleNumber); + Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.OCP.ToString()), out overCurrentProtection); + Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.OVP.ToString()), out overVoltageProtection); + Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.VOLTAGE_SETPOINT.ToString()), out voltageSetpoint); + Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.MIN_VOLTAGE.ToString()), out minVoltageSetpoint); + Double.TryParse(config.ReadValue($"{deviceName}.{moduleName}", PowerSupply.ConfigIni.MAX_VOLTAGE.ToString()), out maxVoltageSetpoint); try { @@ -200,145 +178,131 @@ namespace Raytheon.Instruments _powerModuleInfoDict[moduleName] = new PowerSupplyModuleInfo(moduleNumber, overCurrentProtection, overVoltageProtection, voltageSetpoint, slewRateVoltsPerSecond, minVoltageSetpoint, maxVoltageSetpoint); - // create and initialize the power module - IDCPwr powerSupply = new PowerSupplySim(moduleName, overCurrentProtection, overVoltageProtection, voltageSetpoint, maxVoltageSetpoint, minVoltageSetpoint, inRushDelaySecs, moduleNumber); + // create and initialize the power module + IDCPwr powerSupply = new PowerSupplySim(moduleName, overCurrentProtection, overVoltageProtection, voltageSetpoint, maxVoltageSetpoint, minVoltageSetpoint, inRushDelaySecs, moduleNumber); - // remember that we have added this module - _moduleNumbersThatHaveBeenAdded.Add(moduleNumber); + // remember that we have added this module + _moduleNumbersThatHaveBeenAdded.Add(moduleNumber); - // remember the module name - _powerModuleMap.Add(moduleName.ToUpper(), powerSupply); + // remember the module name + _powerModuleMap.Add(moduleName.ToUpper(), powerSupply); - // remember the initial voltage setpoint - _powerModuleInitialVoltageSetpoint.Add(moduleName.ToUpper(), voltageSetpoint); - } + // remember the initial voltage setpoint + _powerModuleInitialVoltageSetpoint.Add(moduleName.ToUpper(), voltageSetpoint); + } - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } - catch (Exception) - { - throw; - } - } + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } + catch (Exception) + { + throw; + } + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// Couple modules together - /// - /// - public void CoupleChannels(List moduleNameList) - { - throw new NotImplementedException(); - } + /// + /// Couple modules together + /// + /// + public void CoupleChannels(List moduleNameList) + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Power Supply System Sim called " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Power Supply System Sim called " + _name; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set { ; } - } + set {; } + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - try - { - lock (_syncObj) - { - Dispose(true); + /// + /// Dispose of this object. + /// + public void Dispose() + { + lock (_syncObj) + { + Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Get the error code. - /// - /// The error code. - /// The error description. - public string GetErrorCode(out int errorCode) - { - lock (_syncObj) - { - errorCode = 0; - return ""; - } - } + /// + /// Get the error code. + /// + /// The error code. + /// The error description. + public string GetErrorCode(out int errorCode) + { + lock (_syncObj) + { + errorCode = 0; + return ""; + } + } - /// - /// Get the names of the modules in this system - /// - /// - public List GetModuleNames() - { - lock (_syncObj) - { - List moduleNames = new List(); + /// + /// Get the names of the modules in this system + /// + /// + public List GetModuleNames() + { + lock (_syncObj) + { + List moduleNames = new List(); - foreach (KeyValuePair modules in _powerModuleMap) - { - moduleNames.Add(modules.Key); - } + foreach (KeyValuePair modules in _powerModuleMap) + { + moduleNames.Add(modules.Key); + } - return moduleNames; - } - } + return moduleNames; + } + } /// /// Get the dictionary that contains configuration information for each module @@ -358,577 +322,581 @@ namespace Raytheon.Instruments /// The module to get the overcurrent protection setting. /// The current (Amps). public double GetOverCurrentSetting(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::GetOverCurrentSetting() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - return _powerModuleMap[name.ToUpper()].CurrentLimit.Amps; - } - } - - /// - /// Get the overvoltage protection setting. - /// - /// The module to get the overvoltage protection setting. - /// The voltage (Volts). - public double GetOverVoltageSetting(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::GetOverVoltageSetting() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - return _powerModuleMap[name.ToUpper()].OverVoltageProtection.Volts; - } - } - - /// - /// - /// - /// - public double GetSlewRate(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::GetSlewRate() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - throw new NotImplementedException(); - - //return _powerModuleMap[name.ToUpper()].GetSlewRate(); - } - } - - /// - /// Get the voltage setpoint. - /// - /// The module to get the voltage setpoint setting. - /// the voltage setpoint (Volts). - public double GetVoltageSetting(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::GetVoltageSetting() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - return _powerModuleMap[name.ToUpper()].OutputVoltage.Volts; - } - } - - /// - /// Group Modules Together - /// - /// - public void GroupModules(List moduleNameList) - { - lock (_syncObj) - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - Reset(); - - PerformSelfTest(); - - // initialize each module - foreach (KeyValuePair powerModPair in _powerModuleMap) - { - powerModPair.Value.Initialize(); - } - - _state = State.Ready; - } - else - { - throw new Exception("PowerSupplySystemSim::Initialize() - expected the System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } - - /// - /// Send a command and return the response - /// - /// - /// - public string IOQuery(string commandString) - { - Thread.Sleep(500); - - // return something - return "1.11"; - } - - /// - /// Send a command - /// - /// - public void IOWrite(string commandString) - { - Thread.Sleep(50); - } - - /// - /// Query the output state. - /// - /// The module to query. - /// The output state. True = On, False = Off. - public bool IsOutputOn(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::IsOutputOn() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - return _powerModuleMap[name.ToUpper()].Enabled; - } - } - - /// - /// Control the power supply internal mechanical relay state - /// - /// The module to act on - /// True to connect, false to disconnect - public void MechanicalRelayOutputControl(string name, bool shallWeConnect) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::MechanicalRelayOutputControl() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - } - } - - /// - /// Read the current. - /// - /// The name of the module. - /// The current (Amps). - public double MeasureCurrent(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::MeasureCurrent() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - return _powerModuleMap[name.ToUpper()].MeasureCurrent().Amps; - } - } - - /// - /// Read the voltage. - /// - /// The name of the module. - /// The voltage (Volts). - public double MeasureVoltage(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::MeasureVoltage() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - return _powerModuleMap[name.ToUpper()].MeasureVoltage().Volts; - } - } - - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } - - /// - /// Turn the output off. - /// - /// The name of the module. - public void Off(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::Off() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - _powerModuleMap[name.ToUpper()].Enabled = false; - } - } - - /// - /// Turn the output on. - /// - /// The name of the module. - public void On(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::On() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - _powerModuleMap[name.ToUpper()].Enabled = true; - } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Pass; - - return _selfTestResult; - } - - /// - /// Read the overvoltage and overcurrent protection status. - /// - /// The name of the module. - /// The binary sum of all bits (decimal value) set in the Questionable Status Enable register. - public int ReadProtectionStatus(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::ReadProtectionStatus() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - return _powerModuleMap[name.ToUpper()].ReadProtectionStatus(); - } - } - - /// - /// - /// - /// - /// - public PowerData ReadPowerData(string name) - { - lock (_syncObj) - { - // voltage, voltage setpoint, current, output status - double voltage = MeasureVoltage(name); - double voltageSetpoint = GetVoltageSetting(name); - double current = MeasureCurrent(name); - bool outputStatus = IsOutputOn(name); - int faultStatus = ReadProtectionStatus(name); - double overVoltageProtection = GetOverVoltageSetting(name); - double overCurrentProtection = GetOverCurrentSetting(name); - - return new PowerData(voltage, voltageSetpoint, overVoltageProtection, current, overCurrentProtection, outputStatus, faultStatus); - } - } - - /// - /// - /// - public void Reset() - { - lock (_syncObj) - { - } - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - /// - public void SetInitialVoltage(string name) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::SetInitialVoltage() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - double initializeVoltage = _powerModuleInitialVoltageSetpoint[name.ToUpper()]; - - SetVoltageSetpoint(name.ToUpper(), initializeVoltage); - } - } - - /// - /// Set the slew rate - /// - /// slew in volts per second - public void SetSlewRate(string name, double commandedSlew) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::SetSlewRate() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - throw new NotImplementedException(); - - //_powerModuleMap[name.ToUpper()].SetSlewRate(commandedSlew); - } - } - - /// - /// - /// - /// - /// - public void SetOverCurrentProtection(string moduleName, double ocpValue) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::SetOverCurrentProtection() - could not find supply: " + moduleName.ToUpper() + " In System " + _name); - } - - _powerModuleMap[moduleName.ToUpper()].CurrentLimit = Current.FromAmps(ocpValue); - } - } - - /// - /// - /// - /// - /// - public void SetOverVoltageProtection(string moduleName, double ovpValue) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::SetOverVoltageProtection() - could not find supply: " + moduleName.ToUpper() + " In System " + _name); - } - - _powerModuleMap[moduleName.ToUpper()].OverVoltageProtection = Voltage.FromVolts(ovpValue); - } - } - - /// - /// Set the voltage setpoint. - /// - /// The name of the module. - /// The desired voltage. - public void SetVoltageSetpoint(string name, double volts) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) - { - throw new Exception("PowerSupplySystemSim::SetVoltageSetpoint() - could not find supply: " + name.ToUpper() + " In System " + _name); - } - - _powerModuleMap[name.ToUpper()].OutputVoltage = Voltage.FromVolts(volts); - } - } - - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - string errorMsg = ""; - - try - { - //Reset System - Reset(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } - - try - { - foreach (KeyValuePair entry in _powerModuleMap) - { - entry.Value.Shutdown(); - } - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } - - try - { - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } - - _state = State.Uninitialized; - - if (errorMsg != "") - { - throw new Exception("PowerSupplySystemSim::ShutdDown() - System " + _name + " had an error: " + errorMsg); - } - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// Turn off the watchdog capability. - /// - public void WatchdogDisable() - { - lock (_syncObj) - { - } - } - - /// - /// Turn on the watchdog capability. - /// - /// The watchdog time in seconds. - public void WatchdogEnable(uint time) - { - lock (_syncObj) - { - } - } - - /// - /// Adds another power supply to the Power Supply System - /// - /// - /// - /// - /// - /// - /// - /// - /// - public void AddPowerSupply(string name, double overCurrentProtection, double overVoltageProtection, double voltageSetpoint, double maxVoltageSetpoint, double minVoltageSetpoint, int moduleNumber = -1) - { - lock (_syncObj) - { - if (_powerModuleMap.ContainsKey(name.ToUpper()) == true) - { - throw new Exception("PowerSupplySystemSim::AddPowerSupply() - system already contains a supply named: " + name.ToUpper() + " In System " + _name); - } - - // check to see if this index has already been added - // would like to ask the IDCPwr object, but that functionality is not exposed in the interface - if (_moduleNumbersThatHaveBeenAdded.Contains(moduleNumber) == true) - { - throw new Exception("PowerSupplySystemSim::AddPowerSupply() - module number has already been added: " + moduleNumber + " In System " + _name); - } - - // confirm we are already initialized - if (_state != State.Uninitialized) - { - throw new Exception("PowerSupplySystemSim::AddPowerSupply() - System " + _name + " must be Uninitialized when adding power supplies. Current state is: " + _state.ToString()); - } - - // create and initialize the power module - IDCPwr powerSupply = new PowerSupplySim(name, overCurrentProtection, overVoltageProtection, voltageSetpoint, maxVoltageSetpoint, minVoltageSetpoint, moduleNumber); - - _moduleNumbersThatHaveBeenAdded.Add(moduleNumber); - - _powerModuleMap.Add(name.ToUpper(), powerSupply); - - _powerModuleInitialVoltageSetpoint.Add(name.ToUpper(), voltageSetpoint); - } - } - - /// - /// returns system name - /// - /// - public string GetSystemName() => Name; - - /// - /// reads power data - /// - /// - /// - /// - /// - /// - /// - public void ReadPowerData(string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool outputStatus, out int faultStatus) - { - lock (_syncObj) - { - // voltage, voltage setpoint, current, output status - voltage = MeasureVoltage(moduleName); - voltageSetpoint = GetVoltageSetting(moduleName); - current = MeasureCurrent(moduleName); - outputStatus = IsOutputOn(moduleName); - faultStatus = ReadProtectionStatus(moduleName); - } - - } - - #endregion - } + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + return _powerModuleMap[name.ToUpper()].CurrentLimit.Amps; + } + } + + /// + /// Get the overvoltage protection setting. + /// + /// The module to get the overvoltage protection setting. + /// The voltage (Volts). + public double GetOverVoltageSetting(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + return _powerModuleMap[name.ToUpper()].OverVoltageProtection.Volts; + } + } + + /// + /// + /// + /// + public double GetSlewRate(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + throw new NotImplementedException(); + + //return _powerModuleMap[name.ToUpper()].GetSlewRate(); + } + } + + /// + /// Get the voltage setpoint. + /// + /// The module to get the voltage setpoint setting. + /// the voltage setpoint (Volts). + public double GetVoltageSetting(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + return _powerModuleMap[name.ToUpper()].OutputVoltage.Volts; + } + } + + /// + /// Group Modules Together + /// + /// + public void GroupModules(List moduleNameList) + { + lock (_syncObj) + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + Reset(); + + PerformSelfTest(); + + // initialize each module + foreach (KeyValuePair powerModPair in _powerModuleMap) + { + powerModPair.Value.Initialize(); + } + + _state = State.Ready; + } + else + { + throw new Exception("Expected the System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } + + /// + /// Send a command and return the response + /// + /// + /// + public string IOQuery(string commandString) + { + Thread.Sleep(500); + + // return something + return "1.11"; + } + + /// + /// Send a command + /// + /// + public void IOWrite(string commandString) + { + Thread.Sleep(50); + } + + /// + /// Query the output state. + /// + /// The module to query. + /// The output state. True = On, False = Off. + public bool IsOutputOn(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + return _powerModuleMap[name.ToUpper()].Enabled; + } + } + + /// + /// Control the power supply internal mechanical relay state + /// + /// The module to act on + /// True to connect, false to disconnect + public void MechanicalRelayOutputControl(string name, bool shallWeConnect) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + } + } + + /// + /// Read the current. + /// + /// The name of the module. + /// The current (Amps). + public double MeasureCurrent(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + return _powerModuleMap[name.ToUpper()].MeasureCurrent().Amps; + } + } + + /// + /// Read the voltage. + /// + /// The name of the module. + /// The voltage (Volts). + public double MeasureVoltage(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + return _powerModuleMap[name.ToUpper()].MeasureVoltage().Volts; + } + } + + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } + + /// + /// Turn the output off. + /// + /// The name of the module. + public void Off(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + _powerModuleMap[name.ToUpper()].Enabled = false; + + _powerModuleInfoDict[name].isOn_ = false; + } + } + + /// + /// Turn the output on. + /// + /// The name of the module. + public void On(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + _powerModuleMap[name.ToUpper()].Enabled = true; + + _powerModuleInfoDict[name].isOn_ = true; + } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Pass; + + return _selfTestResult; + } + + /// + /// Read the overvoltage and overcurrent protection status. + /// + /// The name of the module. + /// The binary sum of all bits (decimal value) set in the Questionable Status Enable register. + public int ReadProtectionStatus(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + return _powerModuleMap[name.ToUpper()].ReadProtectionStatus(); + } + } + + /// + /// + /// + /// + /// + public PowerData ReadPowerData(string name) + { + lock (_syncObj) + { + // voltage, voltage setpoint, current, output status + double voltage = MeasureVoltage(name); + double voltageSetpoint = GetVoltageSetting(name); + double current = MeasureCurrent(name); + bool isOutputOn = IsOutputOn(name); + int faultStatus = ReadProtectionStatus(name); + double overVoltageProtection = GetOverVoltageSetting(name); + double overCurrentProtection = GetOverCurrentSetting(name); + + return new PowerData(voltage, voltageSetpoint, overVoltageProtection, current, overCurrentProtection, isOutputOn, faultStatus); + } + } + + /// + /// + /// + public void Reset() + { + lock (_syncObj) + { + } + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + /// + public void SetInitialVoltage(string name) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + double initializeVoltage = _powerModuleInitialVoltageSetpoint[name.ToUpper()]; + + SetVoltageSetpoint(name.ToUpper(), initializeVoltage); + } + } + + /// + /// Set the slew rate + /// + /// slew in volts per second + public void SetSlewRate(string name, double commandedSlew) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + throw new NotImplementedException(); + + //_powerModuleMap[name.ToUpper()].SetSlewRate(commandedSlew); + } + } + + /// + /// + /// + /// + /// + public void SetOverCurrentProtection(string moduleName, double ocpValue) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + moduleName.ToUpper() + " In System " + _name); + } + + _powerModuleMap[moduleName.ToUpper()].CurrentLimit = Current.FromAmps(ocpValue); + } + } + + /// + /// + /// + /// + /// + public void SetOverVoltageProtection(string moduleName, double ovpValue) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + moduleName.ToUpper() + " In System " + _name); + } + + _powerModuleMap[moduleName.ToUpper()].OverVoltageProtection = Voltage.FromVolts(ovpValue); + } + } + + /// + /// Set the voltage setpoint. + /// + /// The name of the module. + /// The desired voltage. + public void SetVoltageSetpoint(string name, double volts) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == false) + { + throw new Exception("Could not find supply: " + name.ToUpper() + " In System " + _name); + } + + _powerModuleMap[name.ToUpper()].OutputVoltage = Voltage.FromVolts(volts); + } + } + + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + string errorMsg = ""; + + try + { + //Reset System + Reset(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } + + try + { + foreach (KeyValuePair entry in _powerModuleMap) + { + entry.Value.Shutdown(); + } + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } + + try + { + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } + + _state = State.Uninitialized; + + if (errorMsg != "") + { + throw new Exception("System " + _name + " had an error: " + errorMsg); + } + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// Turn off the watchdog capability. + /// + public void WatchdogDisable() + { + lock (_syncObj) + { + } + } + + /// + /// Turn on the watchdog capability. + /// + /// The watchdog time in seconds. + public void WatchdogEnable(uint time) + { + lock (_syncObj) + { + } + } + + /// + /// Adds another power supply to the Power Supply System + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void AddPowerSupply(string name, double overCurrentProtection, double overVoltageProtection, double voltageSetpoint, double maxVoltageSetpoint, double minVoltageSetpoint, int moduleNumber = -1) + { + lock (_syncObj) + { + if (_powerModuleMap.ContainsKey(name.ToUpper()) == true) + { + throw new Exception("System already contains a supply named: " + name.ToUpper() + " In System " + _name); + } + + // check to see if this index has already been added + // would like to ask the IDCPwr object, but that functionality is not exposed in the interface + if (_moduleNumbersThatHaveBeenAdded.Contains(moduleNumber) == true) + { + throw new Exception("Module number has already been added: " + moduleNumber + " In System " + _name); + } + + // confirm we are already initialized + if (_state != State.Uninitialized) + { + throw new Exception("System " + _name + " must be Uninitialized when adding power supplies. Current state is: " + _state.ToString()); + } + + // create and initialize the power module + IDCPwr powerSupply = new PowerSupplySim(name, overCurrentProtection, overVoltageProtection, voltageSetpoint, maxVoltageSetpoint, minVoltageSetpoint, moduleNumber); + + _moduleNumbersThatHaveBeenAdded.Add(moduleNumber); + + _powerModuleMap.Add(name.ToUpper(), powerSupply); + + _powerModuleInitialVoltageSetpoint.Add(name.ToUpper(), voltageSetpoint); + } + } + + /// + /// returns system name + /// + /// + public string GetSystemName() => Name; + + /// + /// reads power data + /// + /// + /// + /// + /// + /// + /// + public void ReadPowerData(string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool isOutputOn, out int faultStatus) + { + lock (_syncObj) + { + // voltage, voltage setpoint, current, output status + voltage = MeasureVoltage(moduleName); + voltageSetpoint = GetVoltageSetting(moduleName); + current = MeasureCurrent(moduleName); + isOutputOn = IsOutputOn(moduleName); + faultStatus = ReadProtectionStatus(moduleName); + } + + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySystemSimFactory.cs b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySystemSimFactory.cs index 740d3ee..d174303 100644 --- a/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySystemSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/PowerSupply/PowerSupplySystemSim/PowerSupplySystemSimFactory.cs @@ -30,72 +30,65 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "PowerSupplySystemSimFactory")] - public class PowerSupplySystemSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "PowerSupplySystemSimFactory")] + public class PowerSupplySystemSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public PowerSupplySystemSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public PowerSupplySystemSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public PowerSupplySystemSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// PowerSupplySystemSimFactory injection constructor + /// + [ImportingConstructor] + public PowerSupplySystemSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IPowerSupplySystem)); - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new PowerSupplySystemSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IPowerSupplySystem)); + } + + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new PowerSupplySystemSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,11 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - return new PowerSupplySystemSim(name, _configurationManager, _logger); + return new PowerSupplySystemSim(name, _configurationManager); } catch (Exception) { - throw; + throw; } } @@ -120,17 +112,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Scope/ScopeKeysightScpi/ScopeKeysightScpi.cs b/Source/TSRealLib/HAL/Implementations/Scope/ScopeKeysightScpi/ScopeKeysightScpi.cs index ce11503..d7979f4 100644 --- a/Source/TSRealLib/HAL/Implementations/Scope/ScopeKeysightScpi/ScopeKeysightScpi.cs +++ b/Source/TSRealLib/HAL/Implementations/Scope/ScopeKeysightScpi/ScopeKeysightScpi.cs @@ -22,12 +22,12 @@ // accordance with DoD-5220.22-M or OPNAVINST 5510.1h. //>>*************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Net.Sockets; using System.Text; using System.Threading; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { @@ -35,314 +35,287 @@ namespace Raytheon.Instruments /// A class for controlling a scope via scpi commands /// public class ScopeKeysightScpi : IOscilloScope - { - #region PublicMembers - #endregion + { + #region PrivateMembers - #region PrivateMembers - /*private enum SourceType - { - CHANNEL, - FUNCTION - }*/ + // if other commands are needed http://www.keysight.com/upload/cmc_upload/All/Infiniium_prog_guide.pdf pg 770 + private const string m_SUBTRACTFUNC = ":SUBT "; + private const string m_MEASFALLCMD = ":MEAS:FALL? "; + private const string m_MEASRISCMD = ":MEAS:RISetime? "; + private const string m_MEASVTIMCMD = ":MEAS:VTIM? "; - // if other commands are needed http://www.keysight.com/upload/cmc_upload/All/Infiniium_prog_guide.pdf pg 770 - private const string m_SUBTRACTFUNC = ":SUBT "; - private const string m_MEASFALLCMD = ":MEAS:FALL? "; - private const string m_MEASRISCMD = ":MEAS:RISetime? "; - private const string m_MEASVTIMCMD = ":MEAS:VTIM? "; + private const string _READ_ERROR_CODE_CMD = "SYST:ERR?"; + private const string m_MEASFREQCMD = ":MEAS:FREQ? "; + private const string m_SINGLECMD = ":SINGle"; + private const string m_STOPCMD = ":STOP"; + private const string m_RUNCMD = ":RUN"; + private const string m_RESETCMD = "*RST"; + //private const string m_ISOPCCMD = "*OPC? "; + private const string m_ISITCOMPLETEDCMD = ":TER? "; + private const string m_SELFTESTCMD = "*TST? "; + private const string m_COLON = ":"; + private const string m_COMMA = ","; + private const string m_QUESTMARK = "?"; + private const string m_SPACE = " "; + private const string m_SLASH = "\\"; + private const string m_DOUBLESLASH = "\\\\"; + private const string m_DOUBLEQUOTES = "\""; - private const string _READ_ERROR_CODE_CMD = "SYST:ERR?"; - private const string m_MEASFREQCMD = ":MEAS:FREQ? "; - private const string m_SINGLECMD = ":SINGle"; - private const string m_STOPCMD = ":STOP"; - private const string m_RUNCMD = ":RUN"; - private const string m_RESETCMD = "*RST"; - //private const string m_ISOPCCMD = "*OPC? "; - private const string m_ISITCOMPLETEDCMD = ":TER? "; - private const string m_SELFTESTCMD = "*TST? "; - private const string m_COLON = ":"; - private const string m_COMMA = ","; - private const string m_QUESTMARK = "?"; - private const string m_SPACE = " "; - private const string m_SLASH = "\\"; - private const string m_DOUBLESLASH = "\\\\"; - private const string m_DOUBLEQUOTES = "\""; + // Turn Headers Off when Returning Values to Numeric Variables + private const string m_SYSHEADEROFFCMD = ":SYST:HEAD OFF"; + private const string m_ANALAEDGCMD = ":ANALyze:AEDGes "; + private const string m_ANALASIGTYPECMD = ":ANALyze:SIGNal:TYPE"; + private const string m_ANALASIGTYPE_OPTION = "PAM4"; + private const string m_CHANCMD = "CHAN"; + private const string m_FUNCCMD = "FUNC"; + private const string m_CHANDISPCMD = ":DISP "; + private const string m_CHANINPUTCMD = ":INP "; + private const string m_INPUTIMPEDANCECMD = "DC"; + private const string m_TIMESCALECMD = ":TIM:SCAL "; + private const string m_TIMEOFFSETCMD = ":TIM:POS "; + private const string m_TRIGSRCCMD = ":TRIG:EDGE:SOUR "; + private const string m_TRIGLEVCMD = ":TRIG:LEV "; + private const string m_RISETRIGEDGESELCMD = ":TRIG:EDGE:SLOP POS"; + private const string m_FALLTRIGEDGESELCMD = ":TRIG:EDGE:SLOP NEG"; + private const string m_VOLTPERDIVCMD = ":SCAL "; + private const string m_VOLTOFFSETCMD = ":OFFS "; - // Turn Headers Off when Returning Values to Numeric Variables - private const string m_SYSHEADEROFFCMD = ":SYST:HEAD OFF"; - private const string m_ANALAEDGCMD = ":ANALyze:AEDGes "; - private const string m_ANALASIGTYPECMD = ":ANALyze:SIGNal:TYPE"; - private const string m_ANALASIGTYPE_OPTION = "PAM4"; - private const string m_CHANCMD = "CHAN"; - private const string m_FUNCCMD = "FUNC"; - private const string m_CHANDISPCMD = ":DISP "; - private const string m_CHANINPUTCMD = ":INP "; - private const string m_INPUTIMPEDANCECMD = "DC"; - private const string m_TIMESCALECMD = ":TIM:SCAL "; - private const string m_TIMEOFFSETCMD = ":TIM:POS "; - private const string m_TRIGSRCCMD = ":TRIG:EDGE:SOUR "; - private const string m_TRIGLEVCMD = ":TRIG:LEV "; - private const string m_RISETRIGEDGESELCMD = ":TRIG:EDGE:SLOP POS"; - private const string m_FALLTRIGEDGESELCMD = ":TRIG:EDGE:SLOP NEG"; - private const string m_VOLTPERDIVCMD = ":SCAL "; - private const string m_VOLTOFFSETCMD = ":OFFS "; + // The :MEASure:CLEar command clears the measurement results from the screen + // and disables all previously enabled measurements. + private const string m_MEASCLEARCMD = ":MEAS:CLE"; + private const string m_MEASDELTCMD = ":MEAS:DELT"; + private const string m_MEASDELTDEFCMD = ":MEAS:DELT:DEF"; + private const string m_MEASSOURCMD = ":MEAS:SOUR"; - // The :MEASure:CLEar command clears the measurement results from the screen - // and disables all previously enabled measurements. - private const string m_MEASCLEARCMD = ":MEAS:CLE"; - private const string m_MEASDELTCMD = ":MEAS:DELT"; - private const string m_MEASDELTDEFCMD = ":MEAS:DELT:DEF"; - private const string m_MEASSOURCMD = ":MEAS:SOUR"; + // These threshold settings in voltages are used for rise/fall measurements. + private const string m_MEASTHRRFALABSCMD = ":MEAS:THR:RFAL:ABS"; + private const string m_MEASTHRGENABSCMD = ":MEAS:THR:GEN:ABS"; + private const string m_MEASTHRGENMETHCMD = ":MEAS:THR:GEN:METH"; + private const string m_MEASTHRGENTOPBABSCMD = ":MEAS:THR:GEN:TOPB:ABS"; + private const string m_MEASTHRGENTOPBABS_OPTION = "5.0,1.0"; + private const string m_MEASTHRGENTOPBMETHCMD = ":MEAS:THR:GEN:TOPB:METH"; - // These threshold settings in voltages are used for rise/fall measurements. - private const string m_MEASTHRRFALABSCMD = ":MEAS:THR:RFAL:ABS"; - private const string m_MEASTHRGENABSCMD = ":MEAS:THR:GEN:ABS"; - private const string m_MEASTHRGENMETHCMD = ":MEAS:THR:GEN:METH"; - private const string m_MEASTHRGENTOPBABSCMD = ":MEAS:THR:GEN:TOPB:ABS"; - private const string m_MEASTHRGENTOPBABS_OPTION = "5.0,1.0"; - private const string m_MEASTHRGENTOPBMETHCMD = ":MEAS:THR:GEN:TOPB:METH"; + // The :MEASure:PWIDth command measures the width of the first positive pulse on the screen + // using the mid-threshold levels of the waveform(50% levels with standard measurements selected). + private const string m_MEASPWIDCMD = ":MEAS:PWID? "; - // The :MEASure:PWIDth command measures the width of the first positive pulse on the screen - // using the mid-threshold levels of the waveform(50% levels with standard measurements selected). - private const string m_MEASPWIDCMD = ":MEAS:PWID? "; + private const string m_MEASTHRMETH_OPTION = "ABS"; - private const string m_MEASTHRMETH_OPTION = "ABS"; + // Trigger sweep + private const string m_ISTRIGGEREDCMD = ":TRIG:SWE? "; + private const string m_TRIGGERCMD = ":TRIG:SWE "; + private const string m_TRIGGER_OPTION = "TRIG"; - // Trigger sweep - private const string m_ISTRIGGEREDCMD = ":TRIG:SWE? "; - private const string m_TRIGGERCMD = ":TRIG:SWE "; - private const string m_TRIGGER_OPTION = "TRIG"; + // ON or OFF + private const string m_OPTION_ON = "ON"; + private const string m_OPTION_OFF = "OFF"; - // ON or OFF - private const string m_OPTION_ON = "ON"; - private const string m_OPTION_OFF = "OFF"; + private const string m_IMAGE_DEST = @"\Users\Public\Documents"; + private const string m_DESIRED_FOLDER = @"\Scope_Measurements"; + private const string m_IMAGE_FORMAT = "GIF"; + private const string m_IMAGE_SOURCE = "SCR"; + private const string m_SAVEIMAGECMD = ":DISK:SAVE:IMAGe "; - private const string m_IMAGE_DEST = @"\Users\Public\Documents"; - private const string m_DESIRED_FOLDER = @"\Scope_Measurements"; - private const string m_IMAGE_FORMAT = "GIF"; - private const string m_IMAGE_SOURCE = "SCR"; - private const string m_SAVEIMAGECMD = ":DISK:SAVE:IMAGe "; + // Maximum number of channels provided by scope. + private const int m_MAXNUMOFCHANN = 4; + private const int m_READ_TIMEOUT = 5000; - // Maximum number of channels provided by scope. - private const int m_MAXNUMOFCHANN = 4; - private const int m_READ_TIMEOUT = 5000; + private readonly string _address; + private byte[] _readBuffer; + private NetworkStream _tcpStream; - private readonly string _address; - private byte[] _readBuffer; - private NetworkStream _tcpStream; + private State _state; + private SelfTestResult _selfTestResult; + private string _name; - private State _state; - private SelfTestResult _selfTestResult; - private string _name; + private readonly ILogger _logger; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #endregion + #endregion - #region PrivateFunctions + #region PrivateFunctions - /// - /// The Finalizer which will release resources if required - /// - ~ScopeKeysightScpi() - { - Dispose(false); - } + /// + /// The Finalizer which will release resources if required + /// + ~ScopeKeysightScpi() + { + Dispose(false); + } - /// - /// Convert scpi data to string - /// - /// - /// - private string ConvertToString(ref byte[] data) - { - string rsp = System.Text.Encoding.ASCII.GetString(data); - return rsp; - } + /// + /// Convert scpi data to string + /// + /// + /// + private string ConvertToString(ref byte[] data) + { + string rsp = System.Text.Encoding.ASCII.GetString(data); + return rsp; + } - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); - _tcpStream.Close(); + _tcpStream.Close(); - _tcpStream.Dispose(); + _tcpStream.Dispose(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _state = State.Uninitialized; + } + } + } - /// - /// Get the error code. - /// - /// The error code. - /// The error description. - private string GetErrorCode(out int errorCode) - { - // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query + /// + /// Get the error code. + /// + /// The error code. + /// The error description. + private string GetErrorCode(out int errorCode) + { + // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query - string command = _READ_ERROR_CODE_CMD + "\n"; + string command = _READ_ERROR_CODE_CMD + "\n"; - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); - // read the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + // read the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - // convert to a string - string rspStr = ConvertToString(ref _readBuffer); + // convert to a string + string rspStr = ConvertToString(ref _readBuffer); - // parse the response - string[] tokens = rspStr.Split(','); + // parse the response + string[] tokens = rspStr.Split(','); - errorCode = Util.ConvertStringToInt32(tokens[0]); + errorCode = Util.ConvertStringToInt32(tokens[0]); - // it should always be 2 - if (tokens.Length >= 2) - { - return tokens[1]; - } - else - { - return ""; - } - } + // it should always be 2 + if (tokens.Length >= 2) + { + return tokens[1]; + } + else + { + return ""; + } + } - /// - /// - /// - /// - /// - /// - private bool IsOperationCompleted(string statusString, string expectedResult = "1") - { - bool completed = false; + /// + /// + /// + /// + /// + /// + private bool IsOperationCompleted(string statusString, string expectedResult = "1") + { + bool completed = false; - // If Scope returns '+x' instead of 'x', where 'x' is any character, trim it. - if (statusString.IndexOf('+') == 0) - { - statusString = statusString.TrimStart('+'); - } + // If Scope returns '+x' instead of 'x', where 'x' is any character, trim it. + if (statusString.IndexOf('+') == 0) + { + statusString = statusString.TrimStart('+'); + } - if (statusString.Equals(expectedResult) == true) - { - completed = true; - } + if (statusString.Equals(expectedResult) == true) + { + completed = true; + } - return completed; - } + return completed; + } - #endregion + #endregion - #region PublicFunctions - /// - /// ScopeKeysightScpi factory constructor - /// - /// - /// - public ScopeKeysightScpi(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions + /// + /// ScopeKeysightScpi factory constructor + /// + /// + /// + public ScopeKeysightScpi(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _address = _configuration.GetConfigurationValue("ScopeKeysightScpi", "Address", ""); - int port = _configuration.GetConfigurationValue("ScopeKeysightScpi", "Port", 0); + _address = _configuration.GetConfigurationValue("ScopeKeysightScpi", "Address", ""); + int port = _configuration.GetConfigurationValue("ScopeKeysightScpi", "Port", 0); - const int READ_BUFFER_SIZE = 512; - _readBuffer = new byte[READ_BUFFER_SIZE]; + const int READ_BUFFER_SIZE = 512; + _readBuffer = new byte[READ_BUFFER_SIZE]; - TcpClient scopeSocketConn = new TcpClient(_address, port); - _tcpStream = scopeSocketConn.GetStream(); - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + TcpClient scopeSocketConn = new TcpClient(_address, port); + _tcpStream = scopeSocketConn.GetStream(); + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - /// - public ScopeKeysightScpi(string name, string address, int port) - { - const int READ_BUFFER_SIZE = 512; - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _address = address; - _readBuffer = new byte[READ_BUFFER_SIZE]; - TcpClient scopeSocketConn = new TcpClient(_address, port); - _tcpStream = scopeSocketConn.GetStream(); - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + /// + /// + /// + /// + /// + public ScopeKeysightScpi(string deviceName, string address, int port) + { + const int READ_BUFFER_SIZE = 512; + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _address = address; + _readBuffer = new byte[READ_BUFFER_SIZE]; + TcpClient scopeSocketConn = new TcpClient(_address, port); + _tcpStream = scopeSocketConn.GetStream(); + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - /// - /// - /// - /// - /// - public void ConfigureChannel(int channelNumber, double timePerDivison, double timeOffset, double voltageOffset, double voltageScale, string inputImpedance) - { - // make sure it is stopped first - string command = m_STOPCMD + "\n"; - IOWrite(command); + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void ConfigureChannel(int channelNumber, double timePerDivison, double timeOffset, double voltageOffset, double voltageScale, string inputImpedance) + { + // make sure it is stopped first + string command = m_STOPCMD + "\n"; + IOWrite(command); - /*command = m_ISOPCCMD + "\n"; + /*command = m_ISOPCCMD + "\n"; string rspStr = IOQuery(command); string[] tokens = rspStr.Split('\n'); @@ -353,399 +326,385 @@ namespace Raytheon.Instruments throw new Exception("STOP was not completed."); }*/ - // clear the measurement - command = m_MEASCLEARCMD + "\n"; - IOWrite(command); + // clear the measurement + command = m_MEASCLEARCMD + "\n"; + IOWrite(command); - //1. time per division - command = m_TIMESCALECMD + timePerDivison.ToString() + "\n"; - IOWrite(command); + //1. time per division + command = m_TIMESCALECMD + timePerDivison.ToString() + "\n"; + IOWrite(command); - //2. time offset - command = m_TIMEOFFSETCMD + timeOffset.ToString() + "\n"; - IOWrite(command); + //2. time offset + command = m_TIMEOFFSETCMD + timeOffset.ToString() + "\n"; + IOWrite(command); - //3. Volt per division - command = m_COLON + m_CHANCMD + channelNumber.ToString() + m_VOLTPERDIVCMD + voltageScale.ToString() + "\n"; - IOWrite(command); + //3. Volt per division + command = m_COLON + m_CHANCMD + channelNumber.ToString() + m_VOLTPERDIVCMD + voltageScale.ToString() + "\n"; + IOWrite(command); - //4. Volt offset - command = m_COLON + m_CHANCMD + channelNumber.ToString() + m_VOLTOFFSETCMD + voltageOffset.ToString() + "\n"; - IOWrite(command); + //4. Volt offset + command = m_COLON + m_CHANCMD + channelNumber.ToString() + m_VOLTOFFSETCMD + voltageOffset.ToString() + "\n"; + IOWrite(command); - // It sets input impedance to 1M ohmns. - // The value of inputImpedance is expected to be "DC", equivalent to 1M ohmn; otherwise, it outputs error. - if (inputImpedance.ToUpper().Trim() != m_INPUTIMPEDANCECMD.ToUpper()) - { - throw new Exception("ScopeSetupChannel() expected inputImpedance to be DC."); - } + // It sets input impedance to 1M ohmns. + // The value of inputImpedance is expected to be "DC", equivalent to 1M ohmn; otherwise, it outputs error. + if (inputImpedance.ToUpper().Trim() != m_INPUTIMPEDANCECMD.ToUpper()) + { + throw new Exception("ScopeSetupChannel() expected inputImpedance to be DC."); + } - command = m_COLON + m_CHANCMD + channelNumber.ToString() + m_CHANINPUTCMD + inputImpedance + "\n"; - IOWrite(command); + command = m_COLON + m_CHANCMD + channelNumber.ToString() + m_CHANINPUTCMD + inputImpedance + "\n"; + IOWrite(command); - // It turns on the specified channel. - command = m_COLON + m_CHANCMD + channelNumber.ToString() + m_CHANDISPCMD + m_OPTION_ON + "\n"; - IOWrite(command); + // It turns on the specified channel. + command = m_COLON + m_CHANCMD + channelNumber.ToString() + m_CHANDISPCMD + m_OPTION_ON + "\n"; + IOWrite(command); - // start it back up - command = m_RUNCMD + "\n"; - IOWrite(command); - } + // start it back up + command = m_RUNCMD + "\n"; + IOWrite(command); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Scpi Scope"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Scpi Scope"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - public bool HasItTriggered() - { - // Check the Trigger Event register to see if the event has properly triggered + /// + /// + /// + /// + public bool HasItTriggered() + { + // Check the Trigger Event register to see if the event has properly triggered - string command = m_ISITCOMPLETEDCMD + "\n"; - //string command = m_ISTRIGGEREDCMD + "\n"; - string rspStr = IOQuery(command); - bool isTriggered = false; + string command = m_ISITCOMPLETEDCMD + "\n"; + //string command = m_ISTRIGGEREDCMD + "\n"; + string rspStr = IOQuery(command); + bool isTriggered = false; - string[] tokens = rspStr.Split('\n'); + string[] tokens = rspStr.Split('\n'); - // check to see if it is triggered. - if (IsOperationCompleted(tokens[0]) == true) - { - isTriggered = true; - } + // check to see if it is triggered. + if (IsOperationCompleted(tokens[0]) == true) + { + isTriggered = true; + } - return isTriggered; - } + return isTriggered; + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - Reset(); + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + Reset(); - // we already connected to the instrument in the constructor - _state = State.Ready; - } - else - { - throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } + // we already connected to the instrument in the constructor + _state = State.Ready; + } + else + { + throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - /// - public string IOQuery(string command) - { - // send the command - IOWrite(command, false); + /// + /// + /// + /// + /// + public string IOQuery(string command) + { + // send the command + IOWrite(command, false); - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); - // read from the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + // read from the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - // convert response to a string - string rspStr = ConvertToString(ref _readBuffer); + // convert response to a string + string rspStr = ConvertToString(ref _readBuffer); - // check for errors - int err = 0; - string errorMessage = GetErrorCode(out err); - if (err != 0) - { - throw new Exception("ScopeKeysightScpi:IOQuery() - Scope " + _name + " returned error code: " + err.ToString() + "," + errorMessage); - } + // check for errors + int err = 0; + string errorMessage = GetErrorCode(out err); + if (err != 0) + { + throw new Exception("ScopeKeysightScpi:IOQuery() - Scope " + _name + " returned error code: " + err.ToString() + "," + errorMessage); + } - return rspStr; - } + return rspStr; + } - /// - /// - /// - /// - public void IOWrite(string command, bool shallWeCheckForError = true) - { - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + /// + /// + /// + /// + public void IOWrite(string command, bool shallWeCheckForError = true) + { + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - // check for errors - if (shallWeCheckForError == true) - { - int err = 0; - string errorMessage = GetErrorCode(out err); - if (err != 0) - { - throw new Exception("ScopeKeysightScpi:IOWrite() - Scope " + _name + " returned error code: " + err.ToString() + "," + errorMessage); - } - } - } + // check for errors + if (shallWeCheckForError == true) + { + int err = 0; + string errorMessage = GetErrorCode(out err); + if (err != 0) + { + throw new Exception("ScopeKeysightScpi:IOWrite() - Scope " + _name + " returned error code: " + err.ToString() + "," + errorMessage); + } + } + } - /// - /// - /// - /// - public double MeasureFallTime(int channelNumber) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public double MeasureFallTime(int channelNumber) + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - /// - public double MeasureFrequency(int channelNumber) - { - // turn off system header - string command = m_SYSHEADEROFFCMD + "\n"; - IOWrite(command); + /// + /// + /// + /// + /// + public double MeasureFrequency(int channelNumber) + { + // turn off system header + string command = m_SYSHEADEROFFCMD + "\n"; + IOWrite(command); - // send the command to read the data - command = m_MEASFREQCMD + m_CHANCMD + channelNumber.ToString() + "\n"; + // send the command to read the data + command = m_MEASFREQCMD + m_CHANCMD + channelNumber.ToString() + "\n"; - string rspStr = IOQuery(command); + string rspStr = IOQuery(command); - string[] tokens = rspStr.Split('\n'); + string[] tokens = rspStr.Split('\n'); - double freq = Util.ConvertStringToDouble(tokens[0]); + double freq = Util.ConvertStringToDouble(tokens[0]); - return freq; - } + return freq; + } - /// - /// - /// - /// - public double MeasureMaxVoltage(int channelNumber) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public double MeasureMaxVoltage(int channelNumber) + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - public double MeasureMinVoltage(int channelNumber) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public double MeasureMinVoltage(int channelNumber) + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - public double MeasurePulseWidth(int channelNumber) - { - // turn off system header - string command = m_SYSHEADEROFFCMD + "\n"; - IOWrite(command); + /// + /// + /// + /// + public double MeasurePulseWidth(int channelNumber) + { + // turn off system header + string command = m_SYSHEADEROFFCMD + "\n"; + IOWrite(command); - // send the command to read the data - command = m_MEASPWIDCMD + m_CHANCMD + channelNumber.ToString() + "\n"; + // send the command to read the data + command = m_MEASPWIDCMD + m_CHANCMD + channelNumber.ToString() + "\n"; - string rspStr = IOQuery(command); + string rspStr = IOQuery(command); - string[] tokens = rspStr.Split('\n'); + string[] tokens = rspStr.Split('\n'); - double pulseWidth = Util.ConvertStringToDouble(tokens[0]); + double pulseWidth = Util.ConvertStringToDouble(tokens[0]); - return pulseWidth; - } + return pulseWidth; + } - /// - /// - /// - /// - public double MeasureRiseTime(int channelNumber) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public double MeasureRiseTime(int channelNumber) + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - public double MeasureVoltageLevel(int channelNumber) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public double MeasureVoltageLevel(int channelNumber) + { + throw new NotImplementedException(); + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - try - { - // change the timeout to account for the long self test - _tcpStream.ReadTimeout = 90000; + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + try + { + // change the timeout to account for the long self test + _tcpStream.ReadTimeout = 90000; - // send the command and get the response - string command = m_SELFTESTCMD + "\n"; - string rspStr = IOQuery(command); + // send the command and get the response + string command = m_SELFTESTCMD + "\n"; + string rspStr = IOQuery(command); - // parse the response - string[] tokens = rspStr.Split('\n'); + // parse the response + string[] tokens = rspStr.Split('\n'); - //Check if self test is completed; returns status of "0". - if (IsOperationCompleted(tokens[0], "0") == false) - { - _selfTestResult = SelfTestResult.Fail; - string errorMsg = "System " + _name + " returned an error: " + tokens[0]; - throw new Exception(errorMsg); - } - else - { - _selfTestResult = SelfTestResult.Pass; - } + //Check if self test is completed; returns status of "0". + if (IsOperationCompleted(tokens[0], "0") == false) + { + _selfTestResult = SelfTestResult.Fail; + string errorMsg = "System " + _name + " returned an error: " + tokens[0]; + throw new Exception(errorMsg); + } + else + { + _selfTestResult = SelfTestResult.Pass; + } - return _selfTestResult; - } - catch (Exception) - { - throw; - } - finally - { - // restore the timeout - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - } - } + return _selfTestResult; + } + catch (Exception) + { + throw; + } + finally + { + // restore the timeout + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + } + } - /// - /// - /// - public void Reset() - { - // Resets the oscilloscope - string command = m_RESETCMD + "\n"; - IOWrite(command); + /// + /// + /// + public void Reset() + { + // Resets the oscilloscope + string command = m_RESETCMD + "\n"; + IOWrite(command); - // just a swag - Thread.Sleep(3000); + // just a swag + Thread.Sleep(3000); - /*command = m_ISOPCCMD + "\n"; + /*command = m_ISOPCCMD + "\n"; string rspStr = IOQuery(command); // parse the response @@ -755,63 +714,63 @@ namespace Raytheon.Instruments { throw new Exception("Reset was not completed."); }*/ - } + } - /// - /// - /// - public void SaveImage(string fileName) - { - try - { - string timeStamp_date = DateTime.Now.ToString("yyyyMMdd"); - string timeStamp_sec = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"); - string folderTimeStamp = DateTime.Now.ToString("yyyy-MM-dd-HH-mm"); + /// + /// + /// + public void SaveImage(string fileName) + { + try + { + string timeStamp_date = DateTime.Now.ToString("yyyyMMdd"); + string timeStamp_sec = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"); + string folderTimeStamp = DateTime.Now.ToString("yyyy-MM-dd-HH-mm"); - string srcPath = $"{m_DOUBLESLASH}{_address}{m_IMAGE_DEST}{m_DESIRED_FOLDER}{m_SLASH}{timeStamp_date}{m_SLASH}{folderTimeStamp}{m_SLASH}"; + string srcPath = $"{m_DOUBLESLASH}{_address}{m_IMAGE_DEST}{m_DESIRED_FOLDER}{m_SLASH}{timeStamp_date}{m_SLASH}{folderTimeStamp}{m_SLASH}"; - bool exists = System.IO.Directory.Exists(srcPath); + bool exists = System.IO.Directory.Exists(srcPath); - if (!exists) - { - try - { - System.IO.Directory.CreateDirectory(srcPath); - //m_SrcDirectory = $"{m_DOUBLESLASH}{_address}{m_IMAGE_DEST}{m_DESIRED_FOLDER}{m_SLASH}{testUnit}"; - // m_TimeStampeDate = timeStamp_date; - } - catch (Exception) - { - Reset(); - throw; - } - } + if (!exists) + { + try + { + System.IO.Directory.CreateDirectory(srcPath); + //m_SrcDirectory = $"{m_DOUBLESLASH}{_address}{m_IMAGE_DEST}{m_DESIRED_FOLDER}{m_SLASH}{testUnit}"; + // m_TimeStampeDate = timeStamp_date; + } + catch (Exception) + { + Reset(); + throw; + } + } - string m_scopeFileName = $"{timeStamp_date}{m_SLASH}{folderTimeStamp}{m_SLASH}{fileName}_{timeStamp_sec}.{m_IMAGE_FORMAT}"; + string m_scopeFileName = $"{timeStamp_date}{m_SLASH}{folderTimeStamp}{m_SLASH}{fileName}_{timeStamp_sec}.{m_IMAGE_FORMAT}"; - string filename = $"{srcPath}{fileName}_{timeStamp_sec}"; + string filename = $"{srcPath}{fileName}_{timeStamp_sec}"; - string command = m_SAVEIMAGECMD + m_DOUBLEQUOTES + filename + m_DOUBLEQUOTES + m_COMMA + m_IMAGE_FORMAT + m_COMMA + m_IMAGE_SOURCE + m_COMMA + m_OPTION_ON + "\n"; - IOWrite(command); - } - catch (Exception) - { - Reset(); - throw; - } - } + string command = m_SAVEIMAGECMD + m_DOUBLEQUOTES + filename + m_DOUBLEQUOTES + m_COMMA + m_IMAGE_FORMAT + m_COMMA + m_IMAGE_SOURCE + m_COMMA + m_OPTION_ON + "\n"; + IOWrite(command); + } + catch (Exception) + { + Reset(); + throw; + } + } - /// - /// - /// - public void SetupTrigger(bool useRisingEdge, int channelNumber, double triggerLevel) - { - try - { - string command = m_STOPCMD + "\n"; - IOWrite(command); + /// + /// + /// + public void SetupTrigger(bool useRisingEdge, int channelNumber, double triggerLevel) + { + try + { + string command = m_STOPCMD + "\n"; + IOWrite(command); - /*command = m_ISOPCCMD + "\n"; + /*command = m_ISOPCCMD + "\n"; string rspStr = IOQuery(command); string[] tokens = rspStr.Split('\n'); @@ -821,30 +780,30 @@ namespace Raytheon.Instruments throw new Exception("STOP was not completed."); }*/ - command = m_MEASCLEARCMD + "\n"; - IOWrite(command); + command = m_MEASCLEARCMD + "\n"; + IOWrite(command); - //5. Trigger level - //*** Trigger edge source - command = m_TRIGSRCCMD + m_CHANCMD + channelNumber.ToString() + "\n"; - IOWrite(command); + //5. Trigger level + //*** Trigger edge source + command = m_TRIGSRCCMD + m_CHANCMD + channelNumber.ToString() + "\n"; + IOWrite(command); - //*** select edge type - if (useRisingEdge) - { - command = m_RISETRIGEDGESELCMD + "\n"; - } - else - { - command = m_FALLTRIGEDGESELCMD + "\n"; - } - IOWrite(command); + //*** select edge type + if (useRisingEdge) + { + command = m_RISETRIGEDGESELCMD + "\n"; + } + else + { + command = m_FALLTRIGEDGESELCMD + "\n"; + } + IOWrite(command); - //*** select trigger level - command = m_TRIGLEVCMD + m_CHANCMD + channelNumber.ToString() + ", " + triggerLevel.ToString() + "\n"; - IOWrite(command); + //*** select trigger level + command = m_TRIGLEVCMD + m_CHANCMD + channelNumber.ToString() + ", " + triggerLevel.ToString() + "\n"; + IOWrite(command); - /*command = m_ISOPCCMD + "\n"; + /*command = m_ISOPCCMD + "\n"; rspStr = IOQuery(command); tokens = rspStr.Split('\n'); @@ -855,59 +814,59 @@ namespace Raytheon.Instruments throw new Exception("Trigger level was not completed."); }*/ - // start it back up - command = m_RUNCMD + "\n"; - IOWrite(command); - } - catch (Exception) - { - Reset(); - throw; - } - } + // start it back up + command = m_RUNCMD + "\n"; + IOWrite(command); + } + catch (Exception) + { + Reset(); + throw; + } + } - /// - /// - /// - public void Shutdown() - { - string errorMsg = ""; + /// + /// + /// + public void Shutdown() + { + string errorMsg = ""; - if (_state == State.Ready) - { - try - { - //Reset System - Reset(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + if (_state == State.Ready) + { + try + { + //Reset System + Reset(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - // the stream was created in the constructor, dispose of it here - try - { - if (_tcpStream != null) - { - _tcpStream.Dispose(); - _tcpStream = null; - } - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + // the stream was created in the constructor, dispose of it here + try + { + if (_tcpStream != null) + { + _tcpStream.Dispose(); + _tcpStream = null; + } + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - if (errorMsg != "") - { - throw new Exception("System " + _name + " Had an error: " + errorMsg); - } - } + if (errorMsg != "") + { + throw new Exception("System " + _name + " Had an error: " + errorMsg); + } + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Scope/ScopeKeysightScpi/ScopeKeysightScpiFactory.cs b/Source/TSRealLib/HAL/Implementations/Scope/ScopeKeysightScpi/ScopeKeysightScpiFactory.cs index c179867..06641cc 100644 --- a/Source/TSRealLib/HAL/Implementations/Scope/ScopeKeysightScpi/ScopeKeysightScpiFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Scope/ScopeKeysightScpi/ScopeKeysightScpiFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "ScopeKeysightScpiFactory")] - public class ScopeKeysightScpiFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "ScopeKeysightScpiFactory")] + public class ScopeKeysightScpiFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public ScopeKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public ScopeKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public ScopeKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// ScopeKeysightScpiFactory injection constructor + /// + [ImportingConstructor] + public ScopeKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IOscilloScope)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new ScopeKeysightScpi(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IOscilloScope)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new ScopeKeysightScpi(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new ScopeSim(name, _configurationManager, _logger); + return new ScopeSim(name, _configurationManager); else - return new ScopeKeysightScpi(name, _configurationManager, _logger); + return new ScopeKeysightScpi(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Scope/ScopeSim/ScopeSim.cs b/Source/TSRealLib/HAL/Implementations/Scope/ScopeSim/ScopeSim.cs index c4fbb9e..ed3b63a 100644 --- a/Source/TSRealLib/HAL/Implementations/Scope/ScopeSim/ScopeSim.cs +++ b/Source/TSRealLib/HAL/Implementations/Scope/ScopeSim/ScopeSim.cs @@ -15,280 +15,275 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; using NLog; using Raytheon.Common; -using System; namespace Raytheon.Instruments { - /// - /// - /// - public class ScopeSim : IOscilloScope - { - #region PrivateMembers - private State _state; - private string _name; - private SelfTestResult _selfTestResult; + /// + /// + /// + public class ScopeSim : IOscilloScope + { + #region PrivateMembers + private State _state; + private string _name; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - /// - /// ScopeSim factory constructor - /// - /// - /// - public ScopeSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #endregion - _logger = logger; + /// + /// ScopeSim factory constructor + /// + /// + /// + public ScopeSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - /// - /// - /// - /// - public ScopeSim(string name) - { - _name = name; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - _logger = LogManager.GetCurrentClassLogger(); + /// + /// + /// + /// + public ScopeSim(string deviceName) + { + _name = deviceName; - _selfTestResult = SelfTestResult.Unknown; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _state = State.Uninitialized; - } + _selfTestResult = SelfTestResult.Unknown; - /// - /// - /// - /// - public void ConfigureChannel(int channelNumber, double timePerDivison, double timeOffset, double voltageOffset, double voltageScale, string inputImpedance) - { - } + _state = State.Uninitialized; + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Scope Sim called " + _name; - } - } + /// + /// + /// + /// + public void ConfigureChannel(int channelNumber, double timePerDivison, double timeOffset, double voltageOffset, double voltageScale, string inputImpedance) + { + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Scope Sim called " + _name; + } + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + set + { + throw new NotImplementedException(); + } + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - public bool ClearErrors() - { - throw new NotImplementedException(); - } + public bool ClearErrors() + { + throw new NotImplementedException(); + } - public bool HasItTriggered() - { - return true; - } + public bool HasItTriggered() + { + return true; + } - public void Initialize() - { - if (_state == State.Uninitialized) - { - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + public void Initialize() + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - public string IOQuery(string command) - { - // nothing to do in sim - return ""; - } + public string IOQuery(string command) + { + // nothing to do in sim + return ""; + } - public void IOWrite(string command, bool shallWeCheckForError = true) - { - // nothing to do in sim - } + public void IOWrite(string command, bool shallWeCheckForError = true) + { + // nothing to do in sim + } - public double MeasureFallTime(int channelNumber) - { - throw new NotImplementedException(); - } + public double MeasureFallTime(int channelNumber) + { + throw new NotImplementedException(); + } - public double MeasureFrequency(int channel) - { - double max = 10000; + public double MeasureFrequency(int channel) + { + double max = 10000; - double min = 100; + double min = 100; - Random rnd = new Random(); + Random rnd = new Random(); - double seed = rnd.NextDouble(); + double seed = rnd.NextDouble(); - double dataToReturn = (seed * (max - min)) + min; + double dataToReturn = (seed * (max - min)) + min; - return dataToReturn; - } + return dataToReturn; + } - public double MeasureMaxVoltage(int channelNumber) - { - throw new NotImplementedException(); - } + public double MeasureMaxVoltage(int channelNumber) + { + throw new NotImplementedException(); + } - public double MeasureMinVoltage(int channelNumber) - { - throw new NotImplementedException(); - } + public double MeasureMinVoltage(int channelNumber) + { + throw new NotImplementedException(); + } - public double MeasurePulseWidth(int channelNumber) - { - double max = 10000; + public double MeasurePulseWidth(int channelNumber) + { + double max = 10000; - double min = 100; + double min = 100; - Random rnd = new Random(); + Random rnd = new Random(); - double seed = rnd.NextDouble(); + double seed = rnd.NextDouble(); - double dataToReturn = (seed * (max - min)) + min; + double dataToReturn = (seed * (max - min)) + min; - return dataToReturn; - } + return dataToReturn; + } - public double MeasureRiseTime(int channelNumber) - { - throw new NotImplementedException(); - } + public double MeasureRiseTime(int channelNumber) + { + throw new NotImplementedException(); + } - public double MeasureVoltageLevel(int channelNumber) - { - throw new NotImplementedException(); - } + public double MeasureVoltageLevel(int channelNumber) + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - _selfTestResult = SelfTestResult.Pass; - return _selfTestResult; - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + _selfTestResult = SelfTestResult.Pass; + return _selfTestResult; + } - public void Reset() - { - } + public void Reset() + { + } - public void SaveImage(string fileName) - { - } + public void SaveImage(string fileName) + { + } - public void SetupTrigger(bool useRisingEdge, int channelNumber, double triggerLevel) - { + public void SetupTrigger(bool useRisingEdge, int channelNumber, double triggerLevel) + { - } + } - public void Shutdown() - { - if (_state == State.Ready) - { - _state = State.Uninitialized; - } - } + public void Shutdown() + { + if (_state == State.Ready) + { + _state = State.Uninitialized; + } + } - } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Scope/ScopeSim/ScopeSimFactory.cs b/Source/TSRealLib/HAL/Implementations/Scope/ScopeSim/ScopeSimFactory.cs index e221693..92b5f4d 100644 --- a/Source/TSRealLib/HAL/Implementations/Scope/ScopeSim/ScopeSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Scope/ScopeSim/ScopeSimFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "ScopeSimFactory")] - public class ScopeSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "ScopeSimFactory")] + public class ScopeSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public ScopeSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public ScopeSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public ScopeSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// ScopeSimFactory injection constructor + /// + [ImportingConstructor] + public ScopeSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IOscilloScope)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new ScopeSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IOscilloScope)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new ScopeSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,9 +99,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new ScopeSim(name, _configurationManager, _logger); + return new ScopeSim(name, _configurationManager); } catch (Exception) { @@ -121,17 +112,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Scope/ScopeZBind/ScopeZBind.cs b/Source/TSRealLib/HAL/Implementations/Scope/ScopeZBind/ScopeZBind.cs index 51adfb7..b638e4a 100644 --- a/Source/TSRealLib/HAL/Implementations/Scope/ScopeZBind/ScopeZBind.cs +++ b/Source/TSRealLib/HAL/Implementations/Scope/ScopeZBind/ScopeZBind.cs @@ -23,536 +23,500 @@ //>>*************************************************************************** using System; -using System.Threading; using System.Text; +using System.Threading; using NLog; using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A class for controlling a scope via ZBind Teradyne Library - /// - public class ScopeZBind : IOscilloScope - { - #region PublicMembers - #endregion - - #region PrivateMembers - - // Maximum number of channels provided by scope. - private readonly string _address; - private IntPtr _handle; - - private State _state; - private SelfTestResult _selfTestResult; - private string _name; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFunctions - - /// - /// The Finalizer which will release resources if required - /// - ~ScopeZBind() - { - Dispose(false); - } - - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); - - ScopeZBindNativeMethods.zbind_remove(_handle); - - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - #endregion - - #region PublicFunctions - /// - /// ScopeZBind factory constructor - /// - /// - /// - /// - public ScopeZBind(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _address = _configuration.GetConfigurationValue("ScopeZBind", "Address", ""); - - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// - /// - /// - /// - public ScopeZBind(string name, string address) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _address = address; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - /// Horizontal - /// - /// - /// Verticle Voltage Scale - /// - public void ConfigureChannel(int channelNumber, double timePerDivison, double timeOffset, double voltageOffset, double voltageScale, string inputImpedance) - { - const int SWEEP_POINTS = 2000; - - Reset(); - IOWrite("INP1 ON"); - IOWrite("INP2 ON"); - IOWrite("SENSe:SWEep:POINts " + SWEEP_POINTS.ToString()); // Options defined in zScopeM - IOWrite("SENSe:SWEep:TIME " + timePerDivison.ToString()); // SWEEP_TIME.ToString()); // In seconds - IOWrite("SWE:OFFS:TIME 0.0"); - IOWrite("AVER:STAT 0"); - IOWrite("INIT:CONT 0"); - IOWrite("SWE:MODE NORM"); - IOWrite("VOLT1:RANG:OFFS " + voltageOffset.ToString()); - IOWrite("VOLT1:RANG:PTP " + voltageScale.ToString()); // 10 division on screen so V/Div will be 1/10th of input - IOWrite("INP1:FILT 0"); - - // start wave form collection - IOWrite("INIT"); - Thread.Sleep(1000); - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Teradyne ZBind Scope"; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - /// - public bool HasItTriggered() - { - // Did not find support for this in the API, just return true - return true; - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - int ZT_LAN = 0x0004; - int err = ScopeZBindNativeMethods.zbind_add(_address, ZT_LAN, out _handle); - - // check for errors - if (err != 0) - { - throw new Exception("ScopeZBind:Initialize() - Scope " + _name + " returned error code: " + err.ToString()); - } - - // reset the scope - Reset(); - - // we already connected to the instrument in the constructor - _state = State.Ready; - } - else - { - throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } - - /// - /// - /// - /// - /// - public string IOQuery(string command) - { - // send the command - IOWrite(command, false); - - // read from the response - StringBuilder rspStr = new StringBuilder(512); - - int err = ScopeZBindNativeMethods.zbind_receive(_handle, 0, "%[ -~]", rspStr); - - // check for errors - if (err != 0) - { - throw new Exception("ScopeZBind:IOQuery() - Scope " + _name + " returned error code: " + err.ToString()); - } - - return rspStr.ToString(); - } - - /// - /// - /// - /// - public void IOWrite(string command, bool shallWeCheckForError = true) - { - int err = ScopeZBindNativeMethods.zbind_send(_handle, 0, command); - - // check for errors - if (shallWeCheckForError == true) - { - if (err != 0) - { - throw new Exception("ScopeZBind:IOWrite() - Scope " + _name + " returned error code: " + err.ToString()); - } - } - - // wait a bit for processing - Thread.Sleep(50); - } - - /// - /// - /// - /// - public double MeasureFallTime(int channelNumber) - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - /// - public double MeasureFrequency(int channelNumber) - { - IOWrite("INIT"); - - IOWrite("SENSe:SWEep:MODE NORM"); - - string enableCommand = "SENSe:INPut" + channelNumber.ToString() + ":STATe 1"; - IOWrite(enableCommand); - - // stop the waveform - IOWrite("ABORt"); - - // wait a bit for the wave form to settle - Thread.Sleep(1000); - - // The scope will respond with a string like "60.6575321, 0" - string response = IOQuery("MEASure:VOLTage:FREQuency? INPut" + channelNumber.ToString()); - - double result = Double.Parse(response.Split(Convert.ToChar(","))[0], System.Globalization.NumberStyles.Float); - - return result; - } - - /// - /// - /// - /// - public double MeasureMaxVoltage(int channelNumber) - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - public double MeasureMinVoltage(int channelNumber) - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - public double MeasurePulseWidth(int channelNumber) - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - public double MeasureRiseTime(int channelNumber) - { - throw new NotImplementedException(); - } - - /// - /// - /// - /// - public double MeasureVoltageLevel(int channelNumber) - { - throw new NotImplementedException(); - } - - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } - - /// - /// - /// - public void Reset() - { - // Resets the oscilloscope - string command = "*RST"; - IOWrite(command); - - // just a swag - Thread.Sleep(3000); - } - - /// - /// - /// - public void SaveImage(string fileName) - { - throw new NotImplementedException(); - } - - /// - /// - /// - public void SetupTrigger(bool useRisingEdge, int channelNumber, double triggerLevel) - { - IOWrite("TRIG:TYPE EDGE"); - IOWrite("TRIG:SOUR INP1"); - IOWrite("TRIG:INP1:LEV " + triggerLevel.ToString()); - - if (useRisingEdge == true) - { - IOWrite("TRIG:SLOP POS"); - } - else - { - IOWrite("TRIG:SLOP NEG"); - } - } - - /// - /// - /// - public void Shutdown() - { - string errorMsg = ""; - - if (_state == State.Ready) - { - try - { - //Reset System - Reset(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } - - _state = State.Uninitialized; - } - - // the stream was created in the constructor, dispose of it here - try - { - int err = ScopeZBindNativeMethods.zbind_remove(_handle); - - // check for errors - if (err != 0) - { - throw new Exception("ScopeZBind:Shutdown() - Scope " + _name + " returned error code: " + err.ToString()); - } - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } - - if (errorMsg != "") - { - throw new Exception("System " + _name + " Had an error: " + errorMsg); - } - } - - #endregion - } + /// + /// A class for controlling a scope via ZBind Teradyne Library + /// + public class ScopeZBind : IOscilloScope + { + #region PrivateMembers + + // Maximum number of channels provided by scope. + private readonly string _address; + private IntPtr _handle; + + private State _state; + private SelfTestResult _selfTestResult; + private string _name; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFunctions + + /// + /// The Finalizer which will release resources if required + /// + ~ScopeZBind() + { + Dispose(false); + } + + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); + + ScopeZBindNativeMethods.zbind_remove(_handle); + + _state = State.Uninitialized; + } + } + } + + #endregion + + #region PublicFunctions + /// + /// ScopeZBind factory constructor + /// + /// + /// + /// + public ScopeZBind(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _address = _configuration.GetConfigurationValue("ScopeZBind", "Address", ""); + + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// + /// + /// + /// + public ScopeZBind(string deviceName, string address) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _address = address; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// Horizontal + /// + /// + /// Verticle Voltage Scale + /// + public void ConfigureChannel(int channelNumber, double timePerDivison, double timeOffset, double voltageOffset, double voltageScale, string inputImpedance) + { + const int SWEEP_POINTS = 2000; + + Reset(); + IOWrite("INP1 ON"); + IOWrite("INP2 ON"); + IOWrite("SENSe:SWEep:POINts " + SWEEP_POINTS.ToString()); // Options defined in zScopeM + IOWrite("SENSe:SWEep:TIME " + timePerDivison.ToString()); // SWEEP_TIME.ToString()); // In seconds + IOWrite("SWE:OFFS:TIME 0.0"); + IOWrite("AVER:STAT 0"); + IOWrite("INIT:CONT 0"); + IOWrite("SWE:MODE NORM"); + IOWrite("VOLT1:RANG:OFFS " + voltageOffset.ToString()); + IOWrite("VOLT1:RANG:PTP " + voltageScale.ToString()); // 10 division on screen so V/Div will be 1/10th of input + IOWrite("INP1:FILT 0"); + + // start wave form collection + IOWrite("INIT"); + Thread.Sleep(1000); + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Teradyne ZBind Scope"; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + /// + public bool HasItTriggered() + { + // Did not find support for this in the API, just return true + return true; + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + int ZT_LAN = 0x0004; + int err = ScopeZBindNativeMethods.zbind_add(_address, ZT_LAN, out _handle); + + // check for errors + if (err != 0) + { + throw new Exception("ScopeZBind:Initialize() - Scope " + _name + " returned error code: " + err.ToString()); + } + + // reset the scope + Reset(); + + // we already connected to the instrument in the constructor + _state = State.Ready; + } + else + { + throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } + + /// + /// + /// + /// + /// + public string IOQuery(string command) + { + // send the command + IOWrite(command, false); + + // read from the response + StringBuilder rspStr = new StringBuilder(512); + + int err = ScopeZBindNativeMethods.zbind_receive(_handle, 0, "%[ -~]", rspStr); + + // check for errors + if (err != 0) + { + throw new Exception("ScopeZBind:IOQuery() - Scope " + _name + " returned error code: " + err.ToString()); + } + + return rspStr.ToString(); + } + + /// + /// + /// + /// + public void IOWrite(string command, bool shallWeCheckForError = true) + { + int err = ScopeZBindNativeMethods.zbind_send(_handle, 0, command); + + // check for errors + if (shallWeCheckForError == true) + { + if (err != 0) + { + throw new Exception("ScopeZBind:IOWrite() - Scope " + _name + " returned error code: " + err.ToString()); + } + } + + // wait a bit for processing + Thread.Sleep(50); + } + + /// + /// + /// + /// + public double MeasureFallTime(int channelNumber) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public double MeasureFrequency(int channelNumber) + { + IOWrite("INIT"); + + IOWrite("SENSe:SWEep:MODE NORM"); + + string enableCommand = "SENSe:INPut" + channelNumber.ToString() + ":STATe 1"; + IOWrite(enableCommand); + + // stop the waveform + IOWrite("ABORt"); + + // wait a bit for the wave form to settle + Thread.Sleep(1000); + + // The scope will respond with a string like "60.6575321, 0" + string response = IOQuery("MEASure:VOLTage:FREQuency? INPut" + channelNumber.ToString()); + + double result = Double.Parse(response.Split(Convert.ToChar(","))[0], System.Globalization.NumberStyles.Float); + + return result; + } + + /// + /// + /// + /// + public double MeasureMaxVoltage(int channelNumber) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + public double MeasureMinVoltage(int channelNumber) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + public double MeasurePulseWidth(int channelNumber) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + public double MeasureRiseTime(int channelNumber) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + public double MeasureVoltageLevel(int channelNumber) + { + throw new NotImplementedException(); + } + + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } + + /// + /// + /// + public void Reset() + { + // Resets the oscilloscope + string command = "*RST"; + IOWrite(command); + + // just a swag + Thread.Sleep(3000); + } + + /// + /// + /// + public void SaveImage(string fileName) + { + throw new NotImplementedException(); + } + + /// + /// + /// + public void SetupTrigger(bool useRisingEdge, int channelNumber, double triggerLevel) + { + IOWrite("TRIG:TYPE EDGE"); + IOWrite("TRIG:SOUR INP1"); + IOWrite("TRIG:INP1:LEV " + triggerLevel.ToString()); + + if (useRisingEdge == true) + { + IOWrite("TRIG:SLOP POS"); + } + else + { + IOWrite("TRIG:SLOP NEG"); + } + } + + /// + /// + /// + public void Shutdown() + { + string errorMsg = ""; + + if (_state == State.Ready) + { + try + { + //Reset System + Reset(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } + + _state = State.Uninitialized; + } + + // the stream was created in the constructor, dispose of it here + try + { + int err = ScopeZBindNativeMethods.zbind_remove(_handle); + + // check for errors + if (err != 0) + { + throw new Exception("ScopeZBind:Shutdown() - Scope " + _name + " returned error code: " + err.ToString()); + } + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } + + if (errorMsg != "") + { + throw new Exception("System " + _name + " Had an error: " + errorMsg); + } + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Scope/ScopeZBind/ScopeZBindFactory.cs b/Source/TSRealLib/HAL/Implementations/Scope/ScopeZBind/ScopeZBindFactory.cs index 6e2aaff..8ace30c 100644 --- a/Source/TSRealLib/HAL/Implementations/Scope/ScopeZBind/ScopeZBindFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Scope/ScopeZBind/ScopeZBindFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "ScopeZBindFactory")] - public class ScopeZBindFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "ScopeZBindFactory")] + public class ScopeZBindFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public ScopeZBindFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public ScopeZBindFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public ScopeZBindFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// ScopeZBindFactory injection constructor + /// + [ImportingConstructor] + public ScopeZBindFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IOscilloScope)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new ScopeZBind(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IOscilloScope)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new ScopeZBind(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new ScopeSim(name, _configurationManager, _logger); + return new ScopeSim(name, _configurationManager); else - return new ScopeZBind(name, _configurationManager, _logger); + return new ScopeZBind(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Scope/ScopeZtec/ScopeZtec.cs b/Source/TSRealLib/HAL/Implementations/Scope/ScopeZtec/ScopeZtec.cs index 8e95e69..963909b 100644 --- a/Source/TSRealLib/HAL/Implementations/Scope/ScopeZtec/ScopeZtec.cs +++ b/Source/TSRealLib/HAL/Implementations/Scope/ScopeZtec/ScopeZtec.cs @@ -21,585 +21,549 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// CDTS HAL Oscilloscope Driver for ZTEC ZT4442 - /// - public class ScopeZtec : IOscilloScope - { - #region PublicMembers - #endregion + /// + /// CDTS HAL Oscilloscope Driver for ZTEC ZT4442 + /// + public class ScopeZtec : IOscilloScope + { + #region PrivateMembers + private enum enSCOPEInput { DC_50, DC_1M, AC_1M }; - #region PrivateMembers - private enum enSCOPEInput { DC_50, DC_1M, AC_1M }; + private IntPtr _handle; + private string _resourceString; + private State _state; + private SelfTestResult _selfTestResult; + private string _name; - private IntPtr _handle; - private string _resourceString; - private State _state; - private SelfTestResult _selfTestResult; - private string _name; + private readonly ILogger _logger; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #endregion + #endregion - #region PrivateFunctions - /// - /// The Finalizer which will release resources if required - /// - ~ScopeZtec() - { - Dispose(false); - } + #region PrivateFunctions + /// + /// The Finalizer which will release resources if required + /// + ~ScopeZtec() + { + Dispose(false); + } - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); - int ret = ScopeZtMNativeMethods.ztscopeM_close(_handle); + int ret = ScopeZtMNativeMethods.ztscopeM_close(_handle); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _state = State.Uninitialized; + } + } + } - /// - /// Check instrument error status. If there is a failure, get its error message and generate an exception. - /// - /// if set to true if error occurred - /// The error code. - /// The error message. - /// - private void CheckError(out bool bErrorOccurred, out int nErrorCode, out string strErrorMsg) - { - bErrorOccurred = false; - nErrorCode = 0; - strErrorMsg = ""; - int numberOfErrors = 0; - int ztError = ScopeZtMNativeMethods.ztscopeM_error_count(_handle, out numberOfErrors); - if (numberOfErrors == 0) - { - bErrorOccurred = false; - } - else - { - bErrorOccurred = true; - int[] errors = new int[numberOfErrors]; - byte[] errMsg = new byte[256]; - ztError = ScopeZtMNativeMethods.ztscopeM_errors(_handle, out numberOfErrors, errors); - //this also clear the error buffer - nErrorCode = errors[numberOfErrors - 1]; //take last error - ScopeZtMNativeMethods.ztscopeM_error_description(nErrorCode, errMsg); - strErrorMsg = System.Text.Encoding.Default.GetString(errMsg); - } - } + /// + /// Check instrument error status. If there is a failure, get its error message and generate an exception. + /// + /// if set to true if error occurred + /// The error code. + /// The error message. + /// + private void CheckError(out bool bErrorOccurred, out int nErrorCode, out string strErrorMsg) + { + bErrorOccurred = false; + nErrorCode = 0; + strErrorMsg = ""; + int numberOfErrors = 0; + int ztError = ScopeZtMNativeMethods.ztscopeM_error_count(_handle, out numberOfErrors); + if (numberOfErrors == 0) + { + bErrorOccurred = false; + } + else + { + bErrorOccurred = true; + int[] errors = new int[numberOfErrors]; + byte[] errMsg = new byte[256]; + ztError = ScopeZtMNativeMethods.ztscopeM_errors(_handle, out numberOfErrors, errors); + //this also clear the error buffer + nErrorCode = errors[numberOfErrors - 1]; //take last error + ScopeZtMNativeMethods.ztscopeM_error_description(nErrorCode, errMsg); + strErrorMsg = System.Text.Encoding.Default.GetString(errMsg); + } + } - /// - /// Discards any queued errors, clears the instrument status, - /// and resets the status and event registers. - /// - /// - private void ClearError() - { - int numberOfErrors = 0; - ScopeZtMNativeMethods.ztscopeM_error_count(_handle, out numberOfErrors); - if (numberOfErrors > 0) - { - int[] errors = new int[numberOfErrors]; - //this retrieve and clear the error buffer - ScopeZtMNativeMethods.ztscopeM_errors(_handle, out numberOfErrors, errors); - } - } + /// + /// Discards any queued errors, clears the instrument status, + /// and resets the status and event registers. + /// + /// + private void ClearError() + { + int numberOfErrors = 0; + ScopeZtMNativeMethods.ztscopeM_error_count(_handle, out numberOfErrors); + if (numberOfErrors > 0) + { + int[] errors = new int[numberOfErrors]; + //this retrieve and clear the error buffer + ScopeZtMNativeMethods.ztscopeM_errors(_handle, out numberOfErrors, errors); + } + } - /// - /// - /// - /// - private void ClearMeasurement(int channel) - { - //@@@ not sure if this is the correct command - if (0 != ScopeZtMNativeMethods.ztscopeM_calculate_measure_clear(_handle, channel)) - { - RaiseExceptionAtError(); - } - } + /// + /// + /// + /// + private void ClearMeasurement(int channel) + { + //@@@ not sure if this is the correct command + if (0 != ScopeZtMNativeMethods.ztscopeM_calculate_measure_clear(_handle, channel)) + { + RaiseExceptionAtError(); + } + } - /// - /// - /// - /// - public void Disable(int channel) - { - int ret = ScopeZtMNativeMethods.ztscopeM_channel_enable(_handle, channel, 0x00000000); - if (0 != ret) - { - RaiseExceptionAtError(); - } - } + /// + /// + /// + /// + public void Disable(int channel) + { + int ret = ScopeZtMNativeMethods.ztscopeM_channel_enable(_handle, channel, 0x00000000); + if (0 != ret) + { + RaiseExceptionAtError(); + } + } - /// - /// - /// - /// - public void Enable(int channel) - { - int ret = ScopeZtMNativeMethods.ztscopeM_channel_enable(_handle, channel, 0x00000001); - if (0 != ret) - { - RaiseExceptionAtError(); - } - } + /// + /// + /// + /// + public void Enable(int channel) + { + int ret = ScopeZtMNativeMethods.ztscopeM_channel_enable(_handle, channel, 0x00000001); + if (0 != ret) + { + RaiseExceptionAtError(); + } + } - /// - /// Gets or sets Configure input termination for channel: DC_50=0, DC_1M=1, AC_1M =2 - /// Use one of the three subcommands to enable the appropriate signal input termination. - /// The subcommands correspond to DC coupling with 50 ohm termination resistance, - /// DC coupling with 1 Mohm termination resistance, - /// and AC coupling with 1 Mohm termination resistance, respectively. - /// - /// - /// Configure input termination for channel: DC_50=0, DC_1M=1, AC_1M =2 - /// - private void InputImpedance(enSCOPEInput input, int channel) - { - //only valid for input channels - if (channel >= 4) - { - throw new Exception("invalid channel number input: " + channel.ToString()); - } + /// + /// Gets or sets Configure input termination for channel: DC_50=0, DC_1M=1, AC_1M =2 + /// Use one of the three subcommands to enable the appropriate signal input termination. + /// The subcommands correspond to DC coupling with 50 ohm termination resistance, + /// DC coupling with 1 Mohm termination resistance, + /// and AC coupling with 1 Mohm termination resistance, respectively. + /// + /// + /// Configure input termination for channel: DC_50=0, DC_1M=1, AC_1M =2 + /// + private void InputImpedance(enSCOPEInput input, int channel) + { + //only valid for input channels + if (channel >= 4) + { + throw new Exception("invalid channel number input: " + channel.ToString()); + } - int V_coupling = 0; - double V_impedance = 0.0; - switch (input) - { - //#define ZTSCOPEM_COUP_AC 0x00000000 - //#define ZTSCOPEM_COUP_DC 0x00000001 - //#define ZTSCOPEM_COUP_ACLFR 0x00000002 - //#define ZTSCOPEM_COUP_GND 0x00000003 - //#define ZTSCOPEM_IMP_50 50.0 - //#define ZTSCOPEM_IMP_1M 1000000.0 - case enSCOPEInput.DC_50: - V_coupling = 0x00000001; //ZTSCOPEM_COUP_DC - V_impedance = 50.0; //50 Ohm - ZTSCOPEM_IMP_50 - break; - case enSCOPEInput.DC_1M: - V_coupling = 0x00000001; //ZTSCOPEM_COUP_DC - V_impedance = 1000000.0; //ZTSCOPEM_IMP_1M - break; - case enSCOPEInput.AC_1M: - V_coupling = 0x00000000; //ZTSCOPEM_COUP_AC - V_impedance = 1000000.0; //ZTSCOPEM_IMP_1M - break; - default: //unknown, default to DC_1M - V_coupling = 0x00000001; //ZTSCOPEM_COUP_DC - V_impedance = 1000000.0; //ZTSCOPEM_IMP_1M - break; - } + int V_coupling = 0; + double V_impedance = 0.0; + switch (input) + { + //#define ZTSCOPEM_COUP_AC 0x00000000 + //#define ZTSCOPEM_COUP_DC 0x00000001 + //#define ZTSCOPEM_COUP_ACLFR 0x00000002 + //#define ZTSCOPEM_COUP_GND 0x00000003 + //#define ZTSCOPEM_IMP_50 50.0 + //#define ZTSCOPEM_IMP_1M 1000000.0 + case enSCOPEInput.DC_50: + V_coupling = 0x00000001; //ZTSCOPEM_COUP_DC + V_impedance = 50.0; //50 Ohm - ZTSCOPEM_IMP_50 + break; + case enSCOPEInput.DC_1M: + V_coupling = 0x00000001; //ZTSCOPEM_COUP_DC + V_impedance = 1000000.0; //ZTSCOPEM_IMP_1M + break; + case enSCOPEInput.AC_1M: + V_coupling = 0x00000000; //ZTSCOPEM_COUP_AC + V_impedance = 1000000.0; //ZTSCOPEM_IMP_1M + break; + default: //unknown, default to DC_1M + V_coupling = 0x00000001; //ZTSCOPEM_COUP_DC + V_impedance = 1000000.0; //ZTSCOPEM_IMP_1M + break; + } - int ret = ScopeZtMNativeMethods.ztscopeM_single_input_coupling(_handle, channel, V_coupling); - if (0 != ret) - { - RaiseExceptionAtError(); - } + int ret = ScopeZtMNativeMethods.ztscopeM_single_input_coupling(_handle, channel, V_coupling); + if (0 != ret) + { + RaiseExceptionAtError(); + } - ret = ScopeZtMNativeMethods.ztscopeM_single_input_impedance(_handle, channel, V_impedance); - if (0 != ret) - { - RaiseExceptionAtError(); - } - } + ret = ScopeZtMNativeMethods.ztscopeM_single_input_impedance(_handle, channel, V_impedance); + if (0 != ret) + { + RaiseExceptionAtError(); + } + } - /// - /// If there is error, throw an exception with error query information. - /// - private void RaiseExceptionAtError() - { - bool bErrorOccurred = false; - int nErrorCode = 0; - string strErrorMsg = ""; - CheckError(out bErrorOccurred, out nErrorCode, out strErrorMsg); - if (bErrorOccurred) - { - throw new Exception(strErrorMsg); - } - } + /// + /// If there is error, throw an exception with error query information. + /// + private void RaiseExceptionAtError() + { + bool bErrorOccurred = false; + int nErrorCode = 0; + string strErrorMsg = ""; + CheckError(out bErrorOccurred, out nErrorCode, out strErrorMsg); + if (bErrorOccurred) + { + throw new Exception(strErrorMsg); + } + } - /// - /// - /// - private void Run() - { - int ret = ScopeZtMNativeMethods.ztscopeM_initiate(_handle); - if (0 != ret) - { - RaiseExceptionAtError(); - } - } + /// + /// + /// + private void Run() + { + int ret = ScopeZtMNativeMethods.ztscopeM_initiate(_handle); + if (0 != ret) + { + RaiseExceptionAtError(); + } + } - /// - /// Causes the Scope to stop acquiring data. - /// - /// - private void Stop() - { - int ret = ScopeZtMNativeMethods.ztscopeM_abort(_handle); - if (0 != ret) - { - RaiseExceptionAtError(); - } - } + /// + /// Causes the Scope to stop acquiring data. + /// + /// + private void Stop() + { + int ret = ScopeZtMNativeMethods.ztscopeM_abort(_handle); + if (0 != ret) + { + RaiseExceptionAtError(); + } + } - /// - /// Gets or sets the display timescale in seconds per division. This actually set Sweep time to be 10x time scale. - /// - /// - /// The display timescale in seconds per division - /// - private double TimeScale - { - get - { - throw new NotImplementedException(); + /// + /// Gets or sets the display timescale in seconds per division. This actually set Sweep time to be 10x time scale. + /// + /// + /// The display timescale in seconds per division + /// + private double TimeScale + { + get + { + throw new NotImplementedException(); - /*double sweepTime; + /*double sweepTime; ZTScopeM.ztscopeM_single_horizontal_time_query(m_Handle, out sweepTime); return sweepTime / 10.0;*/ - } - set - { - int ret = ScopeZtMNativeMethods.ztscopeM_single_horizontal_time(_handle, value * 10); - if (0 != ret) - { - RaiseExceptionAtError(); - } - } - } + } + set + { + int ret = ScopeZtMNativeMethods.ztscopeM_single_horizontal_time(_handle, value * 10); + if (0 != ret) + { + RaiseExceptionAtError(); + } + } + } - /// - /// Gets or sets The display voltage scale in Volts per division - /// - /// - /// The display voltage scale in Volts per division - /// - private void VoltScale(int channel, double range) - { - //only valid for input channels - if (channel >= 4) - { - throw new Exception("invalid channel number input: " + channel.ToString()); - } + /// + /// Gets or sets The display voltage scale in Volts per division + /// + /// + /// The display voltage scale in Volts per division + /// + private void VoltScale(int channel, double range) + { + //only valid for input channels + if (channel >= 4) + { + throw new Exception("invalid channel number input: " + channel.ToString()); + } - double V_range = 400.0; - //need range check - if (range > 40) - { - V_range = 400.0; //set to the maximum range - } - else - { - V_range = range * 10; - } + double V_range = 400.0; + //need range check + if (range > 40) + { + V_range = 400.0; //set to the maximum range + } + else + { + V_range = range * 10; + } - int ret = ScopeZtMNativeMethods.ztscopeM_single_input_range(_handle, channel, V_range); - if (0 != ret) - { - RaiseExceptionAtError(); - } - } + int ret = ScopeZtMNativeMethods.ztscopeM_single_input_range(_handle, channel, V_range); + if (0 != ret) + { + RaiseExceptionAtError(); + } + } - /// - /// Gets or sets The display offset voltage in Volts - /// A positive voltage offset shifts the displayed signal (as well as ground and trigger level indicators) downward; - /// in other words, the center of the vertical scale is set to dOffset. - /// - /// - /// The display offset voltage in Volts - /// - private void VoltOffset(int channel, double offset) - { - //only valid for input channels - if (channel >= 4) - { - throw new Exception("invalid channel number input: " + channel.ToString()); - } + /// + /// Gets or sets The display offset voltage in Volts + /// A positive voltage offset shifts the displayed signal (as well as ground and trigger level indicators) downward; + /// in other words, the center of the vertical scale is set to dOffset. + /// + /// + /// The display offset voltage in Volts + /// + private void VoltOffset(int channel, double offset) + { + //only valid for input channels + if (channel >= 4) + { + throw new Exception("invalid channel number input: " + channel.ToString()); + } - int ret = ScopeZtMNativeMethods.ztscopeM_single_input_offset(_handle, channel, offset); - if (0 != ret) - { - RaiseExceptionAtError(); - } - } - #endregion + int ret = ScopeZtMNativeMethods.ztscopeM_single_input_offset(_handle, channel, offset); + if (0 != ret) + { + RaiseExceptionAtError(); + } + } + #endregion - #region PublicFunctions + #region PublicFunctions - /// - /// ScopeZtec factory constructor - /// - /// - /// - /// - public ScopeZtec(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// ScopeZtec factory constructor + /// + /// + /// + /// + public ScopeZtec(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _resourceString = _configuration.GetConfigurationValue("ScopeZtec", "ResourceString", ""); + _resourceString = _configuration.GetConfigurationValue("ScopeZtec", "ResourceString", ""); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public ScopeZtec(string name, string resourceString) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _resourceString = resourceString; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + /// + /// + /// + /// + public ScopeZtec(string deviceName, string resourceString) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _resourceString = resourceString; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public bool ClearErrors() - { - ClearError(); + /// + /// + /// + /// + public bool ClearErrors() + { + ClearError(); - return true; - } + return true; + } - /// - /// - /// - /// - /// - /// - /// - /// - /// - public void ConfigureChannel(int channelNumber, double timePerDivison, double timeOffset, double voltageOffset, double voltageScale, string inputImpedance) - { - // make sure it is stopped first - Stop(); + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void ConfigureChannel(int channelNumber, double timePerDivison, double timeOffset, double voltageOffset, double voltageScale, string inputImpedance) + { + // make sure it is stopped first + Stop(); - // clear the measurement - ClearMeasurement(channelNumber); + // clear the measurement + ClearMeasurement(channelNumber); - //1. time per division - TimeScale = timePerDivison; + //1. time per division + TimeScale = timePerDivison; - //2. time offset - int ret = ScopeZtMNativeMethods.ztscopeM_single_horizontal_offset_time(_handle, timeOffset); - if (0 != ret) - { - RaiseExceptionAtError(); - } + //2. time offset + int ret = ScopeZtMNativeMethods.ztscopeM_single_horizontal_offset_time(_handle, timeOffset); + if (0 != ret) + { + RaiseExceptionAtError(); + } - //3. Volt per division - VoltScale(channelNumber, voltageScale); + //3. Volt per division + VoltScale(channelNumber, voltageScale); - //4. Volt offset - VoltOffset(channelNumber, voltageOffset); + //4. Volt offset + VoltOffset(channelNumber, voltageOffset); - // set input impedance to 1M ohmns. - enSCOPEInput imped = enSCOPEInput.DC_1M; + // set input impedance to 1M ohmns. + enSCOPEInput imped = enSCOPEInput.DC_1M; - // The value of inputImpedance is expected to be "DC", equivalent to 1M ohmn; otherwise, it outputs error. - if (inputImpedance.ToUpper().Trim() != "DC".ToUpper()) - { - throw new Exception("ScopeSetupChannel() expected Input Impedance to be DC. If others are needed, need to update sw"); - } + // The value of inputImpedance is expected to be "DC", equivalent to 1M ohmn; otherwise, it outputs error. + if (inputImpedance.ToUpper().Trim() != "DC".ToUpper()) + { + throw new Exception("ScopeSetupChannel() expected Input Impedance to be DC. If others are needed, need to update sw"); + } - InputImpedance(imped, channelNumber); + InputImpedance(imped, channelNumber); - // It turns on the specified channel. - Enable(channelNumber); + // It turns on the specified channel. + Enable(channelNumber); - // start it back up - Run(); - } + // start it back up + Run(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a CDTS ZTec Scope"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a CDTS ZTec Scope"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - /// - public bool HasItTriggered() - { - int state = 0; - int ret = ScopeZtMNativeMethods.ztscopeM_trigger_event_query(_handle, out state); - if (0 != ret) - { - RaiseExceptionAtError(); - } + /// + /// + /// + /// + public bool HasItTriggered() + { + int state = 0; + int ret = ScopeZtMNativeMethods.ztscopeM_trigger_event_query(_handle, out state); + if (0 != ret) + { + RaiseExceptionAtError(); + } - if (state == 1) - { - return true; - } - else - { - return false; - } - } + if (state == 1) + { + return true; + } + else + { + return false; + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - int ret = ScopeZtMNativeMethods.ztscopeM_initialize(_resourceString, - 0, // id_query - 1, // reset - out _handle); + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + int ret = ScopeZtMNativeMethods.ztscopeM_initialize(_resourceString, + 0, // id_query + 1, // reset + out _handle); - if (ret != 0) - { - throw new Exception("call to ztscopeM_initialize returned " + ret); - } + if (ret != 0) + { + throw new Exception("call to ztscopeM_initialize returned " + ret); + } - Reset(); + Reset(); - // we already connected to the instrument in the constructor - _state = State.Ready; - } - else - { - throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } + // we already connected to the instrument in the constructor + _state = State.Ready; + } + else + { + throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - /// - public string IOQuery(string command) - { - throw new NotImplementedException(); + /// + /// + /// + /// + /// + public string IOQuery(string command) + { + throw new NotImplementedException(); - // send the command - /*IOWrite(command, false); + // send the command + /*IOWrite(command, false); // clear our buffer Array.Clear(_readBuffer, 0, _readBuffer.Length); @@ -619,18 +583,18 @@ namespace Raytheon.Instruments } return rspStr;*/ - } + } - /// - /// - /// - /// - public void IOWrite(string command, bool shallWeCheckForError = true) - { - throw new NotImplementedException(); + /// + /// + /// + /// + public void IOWrite(string command, bool shallWeCheckForError = true) + { + throw new NotImplementedException(); - // convert to a byte array - /*byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + // convert to a byte array + /*byte[] commandBuffer = Encoding.ASCII.GetBytes(command); // send the data out _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); @@ -645,202 +609,202 @@ namespace Raytheon.Instruments throw new Exception("ScopeZtec:IOWrite() - Scope " + _name + " returned error code: " + err.ToString() + "," + errorMessage); } }*/ - } + } - /// - /// - /// - /// - public double MeasureFallTime(int channelNumber) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public double MeasureFallTime(int channelNumber) + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - /// - public double MeasureFrequency(int channelNumber) - { - double freq = -1.0; + /// + /// + /// + /// + /// + public double MeasureFrequency(int channelNumber) + { + double freq = -1.0; - int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x0000000D, channelNumber, out freq); - if (0 != ret) - { - RaiseExceptionAtError(); - } + int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x0000000D, channelNumber, out freq); + if (0 != ret) + { + RaiseExceptionAtError(); + } - return freq; - } + return freq; + } - /// - /// - /// - /// - public double MeasureMaxVoltage(int channelNumber) - { - double max = -1.0; + /// + /// + /// + /// + public double MeasureMaxVoltage(int channelNumber) + { + double max = -1.0; - int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x00000012, channelNumber, out max); - if (0 != ret) - { - RaiseExceptionAtError(); - } + int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x00000012, channelNumber, out max); + if (0 != ret) + { + RaiseExceptionAtError(); + } - return max; - } + return max; + } - /// - /// - /// - /// - public double MeasureMinVoltage(int channelNumber) - { - double min = 999.99; + /// + /// + /// + /// + public double MeasureMinVoltage(int channelNumber) + { + double min = 999.99; - int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x00000013, channelNumber, out min); - if (0 != ret) - { - RaiseExceptionAtError(); - } + int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x00000013, channelNumber, out min); + if (0 != ret) + { + RaiseExceptionAtError(); + } - return min; - } + return min; + } - /// - /// - /// - /// - public double MeasurePulseWidth(int channelNumber) - { - double pw = -1.0; + /// + /// + /// + /// + public double MeasurePulseWidth(int channelNumber) + { + double pw = -1.0; - int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x0000001B, channelNumber, out pw); - if (0 != ret) - { - RaiseExceptionAtError(); - } + int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x0000001B, channelNumber, out pw); + if (0 != ret) + { + RaiseExceptionAtError(); + } - return pw; - } + return pw; + } - /// - /// - /// - /// - public double MeasureRiseTime(int channelNumber) - { - double rt = -1.0; + /// + /// + /// + /// + public double MeasureRiseTime(int channelNumber) + { + double rt = -1.0; - int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x00000020, channelNumber, out rt); - if (0 != ret) - { - RaiseExceptionAtError(); - } + int ret = ScopeZtMNativeMethods.ztscopeM_measure_immediate(_handle, 0x00000020, channelNumber, out rt); + if (0 != ret) + { + RaiseExceptionAtError(); + } - return rt; - } + return rt; + } - /// - /// - /// - /// - public double MeasureVoltageLevel(int channelNumber) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public double MeasureVoltageLevel(int channelNumber) + { + throw new NotImplementedException(); + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - int selfTestStatus = -1; - //Returns the test status register. - //Bit 0- Baseboard Register Test Failed Bit - //Bit 1- Unused Bit 2- Baseboard ROM Test Failed Bit - //Bit 3- Unused - //Bit 4- Reference Oscillator Test Failed Bit - //Bit 5- DRAM Test Failed Bit - //Bit 6- FlashMemory Test Failed Bit - //Bit 7- Unused Bit - //Bit 8- Digitizer 1Register Test Failed Bit - //Bit 9- Digitizer 2Register Test Failed Bit - //Bit 10-15- Unused Bits - int ret = ScopeZtMNativeMethods.ztscopeM_self_test(_handle, out selfTestStatus); - if (0 != ret) - { - RaiseExceptionAtError(); - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + int selfTestStatus = -1; + //Returns the test status register. + //Bit 0- Baseboard Register Test Failed Bit + //Bit 1- Unused Bit 2- Baseboard ROM Test Failed Bit + //Bit 3- Unused + //Bit 4- Reference Oscillator Test Failed Bit + //Bit 5- DRAM Test Failed Bit + //Bit 6- FlashMemory Test Failed Bit + //Bit 7- Unused Bit + //Bit 8- Digitizer 1Register Test Failed Bit + //Bit 9- Digitizer 2Register Test Failed Bit + //Bit 10-15- Unused Bits + int ret = ScopeZtMNativeMethods.ztscopeM_self_test(_handle, out selfTestStatus); + if (0 != ret) + { + RaiseExceptionAtError(); + } - if (selfTestStatus == 0) - { - _selfTestResult = SelfTestResult.Pass; - } - else - { - _selfTestResult = SelfTestResult.Fail; - throw new Exception("Self Test Failed with an Error Code: " + selfTestStatus.ToString()); - } + if (selfTestStatus == 0) + { + _selfTestResult = SelfTestResult.Pass; + } + else + { + _selfTestResult = SelfTestResult.Fail; + throw new Exception("Self Test Failed with an Error Code: " + selfTestStatus.ToString()); + } - return _selfTestResult; - } + return _selfTestResult; + } - /// - /// - /// - public void Reset() - { - int ret = ScopeZtMNativeMethods.ztscopeM_reset(_handle); - if (0 != ret) - { - RaiseExceptionAtError(); - } - } + /// + /// + /// + public void Reset() + { + int ret = ScopeZtMNativeMethods.ztscopeM_reset(_handle); + if (0 != ret) + { + RaiseExceptionAtError(); + } + } - /// - /// - /// - public void SaveImage(string fileName) - { - throw new NotImplementedException(); - /*try + /// + /// + /// + public void SaveImage(string fileName) + { + throw new NotImplementedException(); + /*try { string timeStamp_date = DateTime.Now.ToString("yyyyMMdd"); string timeStamp_sec = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"); @@ -877,87 +841,87 @@ namespace Raytheon.Instruments Reset(); throw; }*/ - } + } - /// - /// - /// - public void SetupTrigger(bool useRisingEdge, int channelNumber, double triggerLevel) - { - const int RISING_TRIGGER = 0x00000000; - const int FALLING_TRIGGER = 0x00000001; + /// + /// + /// + public void SetupTrigger(bool useRisingEdge, int channelNumber, double triggerLevel) + { + const int RISING_TRIGGER = 0x00000000; + const int FALLING_TRIGGER = 0x00000001; - try - { - Stop(); + try + { + Stop(); - int ret = ScopeZtMNativeMethods.ztscopeM_single_trigger_type(_handle, 0x00000000); - if (0 != ret) - { - RaiseExceptionAtError(); - } + int ret = ScopeZtMNativeMethods.ztscopeM_single_trigger_type(_handle, 0x00000000); + if (0 != ret) + { + RaiseExceptionAtError(); + } - int trigSource = channelNumber + 0x0000000A; - int triggerEdge = FALLING_TRIGGER; + int trigSource = channelNumber + 0x0000000A; + int triggerEdge = FALLING_TRIGGER; - if (useRisingEdge == true) - { - triggerEdge = RISING_TRIGGER; - } + if (useRisingEdge == true) + { + triggerEdge = RISING_TRIGGER; + } - ret = ScopeZtMNativeMethods.ztscopeM_trigger(_handle, trigSource, triggerLevel, triggerEdge); - if (0 != ret) - { - RaiseExceptionAtError(); - } + ret = ScopeZtMNativeMethods.ztscopeM_trigger(_handle, trigSource, triggerLevel, triggerEdge); + if (0 != ret) + { + RaiseExceptionAtError(); + } - //ret = ScopeZtMNativeMethods.ztscopeM_trigger_holdoff(_handle, dHoldoffDuration, 1); + //ret = ScopeZtMNativeMethods.ztscopeM_trigger_holdoff(_handle, dHoldoffDuration, 1); - Run(); - } - catch (Exception) - { - Reset(); - throw; - } - } + Run(); + } + catch (Exception) + { + Reset(); + throw; + } + } - /// - /// - /// - public void Shutdown() - { - string errorMsg = ""; + /// + /// + /// + public void Shutdown() + { + string errorMsg = ""; - if (_state == State.Ready) - { - try - { - Reset(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + if (_state == State.Ready) + { + try + { + Reset(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - // the stream was created in the constructor, dispose of it here - try - { - int ret = ScopeZtMNativeMethods.ztscopeM_close(_handle); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + // the stream was created in the constructor, dispose of it here + try + { + int ret = ScopeZtMNativeMethods.ztscopeM_close(_handle); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - if (errorMsg != "") - { - throw new Exception("System " + _name + " Had an error: " + errorMsg); - } - } - #endregion - } + if (errorMsg != "") + { + throw new Exception("System " + _name + " Had an error: " + errorMsg); + } + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Scope/ScopeZtec/ScopeZtecFactory.cs b/Source/TSRealLib/HAL/Implementations/Scope/ScopeZtec/ScopeZtecFactory.cs index 6e34c91..bf3c9dc 100644 --- a/Source/TSRealLib/HAL/Implementations/Scope/ScopeZtec/ScopeZtecFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Scope/ScopeZtec/ScopeZtecFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "ScopeZtecFactory")] - public class ScopeZtecFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "ScopeZtecFactory")] + public class ScopeZtecFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public ScopeZtecFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public ScopeZtecFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public ScopeZtecFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// ScopeZtecFactory injection constructor + /// + [ImportingConstructor] + public ScopeZtecFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IOscilloScope)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new ScopeZtec(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IOscilloScope)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new ScopeZtec(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new ScopeSim(name, _configurationManager, _logger); + return new ScopeSim(name, _configurationManager); else - return new ScopeZtec(name, _configurationManager, _logger); + return new ScopeZtec(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenKeysightScpi/SigGenKeysightScpi.cs b/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenKeysightScpi/SigGenKeysightScpi.cs index ae73f3a..4997f47 100644 --- a/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenKeysightScpi/SigGenKeysightScpi.cs +++ b/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenKeysightScpi/SigGenKeysightScpi.cs @@ -22,491 +22,458 @@ // accordance with DoD-5220.22-M or OPNAVINST 5510.1h. //>>*************************************************************************** -using NLog; -using Raytheon.Common; -using Raytheon.Framework; using System; using System.Net.Sockets; using System.Text; using System.Threading; +using NLog; +using Raytheon.Common; +using Raytheon.Framework; namespace Raytheon.Instruments { /// /// public class SigGenKeysightScpi : ISignalGenerator - { - #region PublicMembers - #endregion - - #region PrivateMembers - private const string _READ_ERROR_CODE_CMD = "SYST:ERR?"; - private const string _SELFTESTCMD = "*TST? "; - private const string _RESETCMD = "*RST"; - private const string _ISOPCCMD = "*STB? "; - private const string _FREQCMD = ":FREQ:FIX"; - private const string _PWRLEVELMD = "POW:LEV"; - private const string _OUTPUTON = ":OUTPut ON"; - private const string _OUTPUTOFF = ":OUTPut OFF"; - - private int m_PORT = 5025; - private const int m_READ_TIMEOUT = 5000; - - private readonly string _address; - private byte[] _readBuffer; - private NetworkStream _tcpStream; - - private State _state; - private SelfTestResult _selfTestResult; - private string _name; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFunctions - - /// - /// The Finalizer which will release resources if required - /// - ~SigGenKeysightScpi() - { - Dispose(false); - } - - /// - /// Convert scpi data to string - /// - /// - /// - private string ConvertToString(ref byte[] data) - { - string rsp = System.Text.Encoding.ASCII.GetString(data); - return rsp; - } - - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); - - _tcpStream.Close(); - - _tcpStream.Dispose(); - - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// Get the error code. - /// - /// The error code. - /// The error description. - private string GetErrorCode(out int errorCode) - { - // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query - - string command = _READ_ERROR_CODE_CMD + "\n"; - - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); - - // read the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - - // convert to a string - string rspStr = ConvertToString(ref _readBuffer); - - // parse the response - string[] tokens = rspStr.Split(','); - - errorCode = Util.ConvertStringToInt32(tokens[0]); - - // it should always be 2 - if (tokens.Length >= 2) - { - return tokens[1]; - } - else - { - return ""; - } - } - - /// - /// - /// - /// - /// - /// - private bool IsOperationCompleted(string statusString, string expectedResult = "1") - { - bool completed = false; - - // If Scope returns '+x' instead of 'x', where 'x' is any character, trim it. - if (statusString.IndexOf('+') == 0) - { - statusString = statusString.TrimStart('+'); - } - - if (statusString.Equals(expectedResult) == true) - { - completed = true; - } - - return completed; - } - - #endregion - - /// - /// SigGenKeysightScpi factory constructor - /// - /// - /// - public SigGenKeysightScpi(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - const int READ_BUFFER_SIZE = 512; - - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _address = _configuration.GetConfigurationValue("SigGenKeysightScpi", "Address", "127.0.0.1"); - m_PORT = _configuration.GetConfigurationValue("SigGenKeysightScpi", "Port", 5025); - - _readBuffer = new byte[READ_BUFFER_SIZE]; - TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); - _tcpStream = scopeSocketConn.GetStream(); - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// - /// - /// - /// - public SigGenKeysightScpi(string name, string address) - { - const int READ_BUFFER_SIZE = 512; - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _address = address; - _readBuffer = new byte[READ_BUFFER_SIZE]; - TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); - _tcpStream = scopeSocketConn.GetStream(); - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } - - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Scpi Signal Generator"; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - /// - /// - public void Enable(bool enable) - { - if (enable == true) - { - string command = _OUTPUTON + "\n"; - IOWrite(command); - } - else - { - string command = _OUTPUTOFF + "\n"; - IOWrite(command); - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } - - set - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } - - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - Reset(); - - // we already connected to the instrument in the constructor - _state = State.Ready; - } - else - { - throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } - - /// - /// - /// - /// - /// - public string IOQuery(string command) - { - // send the command - IOWrite(command, false); - - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); - - // read from the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - - // convert response to a string - string rspStr = ConvertToString(ref _readBuffer); - - // check for errors - int err = 0; - string message = GetErrorCode(out err); - if (err != 0) - { - throw new Exception("SigGenKeysightScpi:IOQuery() - Sig Gen " + _name + " returned error code: " + err.ToString() + ", " + message); - } - - return rspStr; - } - - /// - /// - /// - /// - public void IOWrite(string command, bool shallWeCheckForError = true) - { - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - - // check for errors - if (shallWeCheckForError == true) - { - int err = 0; - string errorMessage = GetErrorCode(out err); - if (err != 0) - { - throw new Exception("SigGenKeysightScpi:IOWrite() - Device " + _name + " returned error code: " + err.ToString() + "," + errorMessage); - } - } - } - - /// - /// - /// - public string Name - { - get - { - return _name; - } - set { _name = value; } - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } - - /// - /// - /// - public State Status - { - get - { - return _state; - } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - try - { - // change the timeout to account for the long self test - _tcpStream.ReadTimeout = 120000; - - // send the command and get the rsponse - string command = _SELFTESTCMD + "\n"; - string rspStr = IOQuery(command); - - // parse the response - string[] tokens = rspStr.Split('\n'); - - //Check if self test is completed; returns status of "0". - if (IsOperationCompleted(tokens[0], "0") == false) - { - string errorMsg = "System " + _name + " returned an error: " + tokens[0]; - throw new Exception(errorMsg); - } - - _selfTestResult = SelfTestResult.Pass; - - return SelfTestResult.Pass; - } - catch (Exception) - { - throw; - } - finally - { - // restore the timeout - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - } - } - - /// - /// - /// - public void Reset() - { - // Resets the sig gen - string command = _RESETCMD + "\n"; - IOWrite(command); - - Thread.Sleep(3000); - - /*command = _ISOPCCMD + "\n"; + { + #region PublicMembers + #endregion + + #region PrivateMembers + private const string _READ_ERROR_CODE_CMD = "SYST:ERR?"; + private const string _SELFTESTCMD = "*TST? "; + private const string _RESETCMD = "*RST"; + private const string _ISOPCCMD = "*STB? "; + private const string _FREQCMD = ":FREQ:FIX"; + private const string _PWRLEVELMD = "POW:LEV"; + private const string _OUTPUTON = ":OUTPut ON"; + private const string _OUTPUTOFF = ":OUTPut OFF"; + + private int m_PORT = 5025; + private const int m_READ_TIMEOUT = 5000; + + private readonly string _address; + private byte[] _readBuffer; + private NetworkStream _tcpStream; + + private State _state; + private SelfTestResult _selfTestResult; + private string _name; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFunctions + + /// + /// The Finalizer which will release resources if required + /// + ~SigGenKeysightScpi() + { + Dispose(false); + } + + /// + /// Convert scpi data to string + /// + /// + /// + private string ConvertToString(ref byte[] data) + { + string rsp = System.Text.Encoding.ASCII.GetString(data); + return rsp; + } + + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); + + _tcpStream.Close(); + + _tcpStream.Dispose(); + + _state = State.Uninitialized; + } + } + } + + /// + /// Get the error code. + /// + /// The error code. + /// The error description. + private string GetErrorCode(out int errorCode) + { + // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query + + string command = _READ_ERROR_CODE_CMD + "\n"; + + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); + + // read the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + + // convert to a string + string rspStr = ConvertToString(ref _readBuffer); + + // parse the response + string[] tokens = rspStr.Split(','); + + errorCode = Util.ConvertStringToInt32(tokens[0]); + + // it should always be 2 + if (tokens.Length >= 2) + { + return tokens[1]; + } + else + { + return ""; + } + } + + /// + /// + /// + /// + /// + /// + private bool IsOperationCompleted(string statusString, string expectedResult = "1") + { + bool completed = false; + + // If Scope returns '+x' instead of 'x', where 'x' is any character, trim it. + if (statusString.IndexOf('+') == 0) + { + statusString = statusString.TrimStart('+'); + } + + if (statusString.Equals(expectedResult) == true) + { + completed = true; + } + + return completed; + } + + #endregion + + /// + /// SigGenKeysightScpi factory constructor + /// + /// + /// + public SigGenKeysightScpi(string deviceName, IConfigurationManager configurationManager) + { + const int READ_BUFFER_SIZE = 512; + + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _address = _configuration.GetConfigurationValue("SigGenKeysightScpi", "Address", "127.0.0.1"); + m_PORT = _configuration.GetConfigurationValue("SigGenKeysightScpi", "Port", 5025); + + _readBuffer = new byte[READ_BUFFER_SIZE]; + TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); + _tcpStream = scopeSocketConn.GetStream(); + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// + /// + /// + /// + public SigGenKeysightScpi(string deviceName, string address) + { + const int READ_BUFFER_SIZE = 512; + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _address = address; + _readBuffer = new byte[READ_BUFFER_SIZE]; + TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); + _tcpStream = scopeSocketConn.GetStream(); + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Scpi Signal Generator"; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// + /// + /// + /// + public void Enable(bool enable) + { + if (enable == true) + { + string command = _OUTPUTON + "\n"; + IOWrite(command); + } + else + { + string command = _OUTPUTOFF + "\n"; + IOWrite(command); + } + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + Reset(); + + // we already connected to the instrument in the constructor + _state = State.Ready; + } + else + { + throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } + + /// + /// + /// + /// + /// + public string IOQuery(string command) + { + // send the command + IOWrite(command, false); + + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); + + // read from the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + + // convert response to a string + string rspStr = ConvertToString(ref _readBuffer); + + // check for errors + int err = 0; + string message = GetErrorCode(out err); + if (err != 0) + { + throw new Exception("SigGenKeysightScpi:IOQuery() - Sig Gen " + _name + " returned error code: " + err.ToString() + ", " + message); + } + + return rspStr; + } + + /// + /// + /// + /// + public void IOWrite(string command, bool shallWeCheckForError = true) + { + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + + // check for errors + if (shallWeCheckForError == true) + { + int err = 0; + string errorMessage = GetErrorCode(out err); + if (err != 0) + { + throw new Exception("SigGenKeysightScpi:IOWrite() - Device " + _name + " returned error code: " + err.ToString() + "," + errorMessage); + } + } + } + + /// + /// + /// + public string Name + { + get + { + return _name; + } + set { _name = value; } + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + try + { + // change the timeout to account for the long self test + _tcpStream.ReadTimeout = 120000; + + // send the command and get the rsponse + string command = _SELFTESTCMD + "\n"; + string rspStr = IOQuery(command); + + // parse the response + string[] tokens = rspStr.Split('\n'); + + //Check if self test is completed; returns status of "0". + if (IsOperationCompleted(tokens[0], "0") == false) + { + string errorMsg = "System " + _name + " returned an error: " + tokens[0]; + throw new Exception(errorMsg); + } + + _selfTestResult = SelfTestResult.Pass; + + return SelfTestResult.Pass; + } + catch (Exception) + { + throw; + } + finally + { + // restore the timeout + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + } + } + + /// + /// + /// + public void Reset() + { + // Resets the sig gen + string command = _RESETCMD + "\n"; + IOWrite(command); + + Thread.Sleep(3000); + + /*command = _ISOPCCMD + "\n"; string rspStr = IOQuery(command); // parse the response @@ -516,75 +483,75 @@ namespace Raytheon.Instruments { throw new Exception("Reset was not completed."); }*/ - } + } - /// - /// - /// - /// - /// - /// - public void SetFrequency(UnitizedValue frequency) - { - int freq = Convert.ToInt32(frequency.Value); + /// + /// + /// + /// + /// + /// + public void SetFrequency(UnitizedValue frequency) + { + int freq = Convert.ToInt32(frequency.Value); - string command = _FREQCMD + " " + freq.ToString() + "\n"; - IOWrite(command); - } + string command = _FREQCMD + " " + freq.ToString() + "\n"; + IOWrite(command); + } - /// - /// - /// - /// - public void SetPowerLevel(UnitizedValue powerLevel) - { - int power = Convert.ToInt32(powerLevel.Value); + /// + /// + /// + /// + public void SetPowerLevel(UnitizedValue powerLevel) + { + int power = Convert.ToInt32(powerLevel.Value); - string command = _PWRLEVELMD + " " + power.ToString() + "dBm\n"; - IOWrite(command); - } + string command = _PWRLEVELMD + " " + power.ToString() + "dBm\n"; + IOWrite(command); + } - /// - /// - /// - public void Shutdown() - { - string errorMsg = ""; + /// + /// + /// + public void Shutdown() + { + string errorMsg = ""; - if (_state == State.Ready) - { - try - { - //Reset System - Reset(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + if (_state == State.Ready) + { + try + { + //Reset System + Reset(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - // the stream was created in the constructor, dispose of it here - try - { - if (_tcpStream != null) - { - _tcpStream.Dispose(); - _tcpStream = null; - } - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + // the stream was created in the constructor, dispose of it here + try + { + if (_tcpStream != null) + { + _tcpStream.Dispose(); + _tcpStream = null; + } + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - if (errorMsg != "") - { - throw new Exception("System " + _name + " Had an error: " + errorMsg); - } - } + if (errorMsg != "") + { + throw new Exception("System " + _name + " Had an error: " + errorMsg); + } + } - } + } } diff --git a/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenKeysightScpi/SigGenKeysightScpiFactory.cs b/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenKeysightScpi/SigGenKeysightScpiFactory.cs index 19a4444..eee582d 100644 --- a/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenKeysightScpi/SigGenKeysightScpiFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenKeysightScpi/SigGenKeysightScpiFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SigGenKeysightScpiFactory")] - public class SigGenKeysightScpiFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SigGenKeysightScpiFactory")] + public class SigGenKeysightScpiFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SigGenKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SigGenKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SigGenKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SigGenKeysightScpiFactory injection constructor + /// + [ImportingConstructor] + public SigGenKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISignalGenerator)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SigGenKeysightScpi(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISignalGenerator)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SigGenKeysightScpi(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new SigGenSim(name, _configurationManager, _logger); + return new SigGenSim(name, _configurationManager); else - return new SigGenKeysightScpi(name, _configurationManager, _logger); + return new SigGenKeysightScpi(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenSim/SigGenSim.cs b/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenSim/SigGenSim.cs index 3149bbc..e908ed7 100644 --- a/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenSim/SigGenSim.cs +++ b/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenSim/SigGenSim.cs @@ -22,305 +22,269 @@ // accordance with DoD-5220.22-M or OPNAVINST 5510.1h. //>>*************************************************************************** +using System; using NLog; using Raytheon.Common; using Raytheon.Framework; -using System; namespace Raytheon.Instruments { /// /// public class SigGenSim : ISignalGenerator - { - #region PublicMembers - #endregion + { + #region PrivateMembers - #region PrivateMembers + private State _state; + private SelfTestResult _selfTestResult; + private string _name; - private State _state; - private SelfTestResult _selfTestResult; - private string _name; + private readonly ILogger _logger; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #endregion + #endregion - #region PrivateFunctions + #region PrivateFunctions - /// - /// The Finalizer which will release resources if required - /// - ~SigGenSim() - { - Dispose(false); - } + /// + /// The Finalizer which will release resources if required + /// + ~SigGenSim() + { + Dispose(false); + } - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _state = State.Uninitialized; + } + } + } - #endregion + #endregion - /// - /// PowerMeterKeysightScpi factory constructor - /// - /// - /// - public SigGenSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// PowerMeterKeysightScpi factory constructor + /// + /// + /// + public SigGenSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public SigGenSim(string name) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + /// + /// + /// + /// + public SigGenSim(string deviceName) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Scpi Sig Gen"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Scpi Sig Gen"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - /// - /// - public void Enable(bool enable) - { - } + /// + /// + /// + /// + /// + public void Enable(bool enable) + { + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - Reset(); + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + Reset(); - // we already connected to the instrument in the constructor - _state = State.Ready; - } - else - { - throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } + // we already connected to the instrument in the constructor + _state = State.Ready; + } + else + { + throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - /// - public string IOQuery(string command) - { - return "Junk Sim Data"; - } + /// + /// + /// + /// + /// + public string IOQuery(string command) + { + return "Junk Sim Data"; + } - /// - /// - /// - /// - public void IOWrite(string command, bool shallWeCheckForError = true) - { - } + /// + /// + /// + /// + public void IOWrite(string command, bool shallWeCheckForError = true) + { + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set - { - _name = value; - } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - try - { - _selfTestResult = SelfTestResult.Pass; + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + try + { + _selfTestResult = SelfTestResult.Pass; - return SelfTestResult.Pass; - } - catch (Exception) - { - throw; - } - } + return SelfTestResult.Pass; + } + catch (Exception) + { + throw; + } + } - /// - /// - /// - public void Reset() - { - } + /// + /// + /// + public void Reset() + { + } /// /// @@ -344,23 +308,23 @@ namespace Raytheon.Instruments /// /// public void Shutdown() - { - string errorMsg = ""; + { + string errorMsg = ""; - if (_state == State.Ready) - { - try - { - //Reset System - Reset(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + if (_state == State.Ready) + { + try + { + //Reset System + Reset(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - _state = State.Uninitialized; - } - } - } + _state = State.Uninitialized; + } + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenSim/SigGenSimFactory.cs b/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenSim/SigGenSimFactory.cs index ffd9fdc..44c1326 100644 --- a/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenSim/SigGenSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/SignalGenerator/SigGenSim/SigGenSimFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SigGenSimFactory")] - public class SigGenSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SigGenSimFactory")] + public class SigGenSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SigGenSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SigGenSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SigGenSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SigGenSimFactory injection constructor + /// + [ImportingConstructor] + public SigGenSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISignalGenerator)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SigGenSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISignalGenerator)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SigGenSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +98,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new SigGenSim(name, _configurationManager, _logger); + return new SigGenSim(name, _configurationManager); } catch (Exception) { @@ -120,17 +111,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnKeysightScpi/SpecAnKeysightScpi.cs b/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnKeysightScpi/SpecAnKeysightScpi.cs index 30361cb..99a1bbd 100644 --- a/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnKeysightScpi/SpecAnKeysightScpi.cs +++ b/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnKeysightScpi/SpecAnKeysightScpi.cs @@ -22,365 +22,343 @@ // accordance with DoD-5220.22-M or OPNAVINST 5510.1h. //>>*************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Net.Sockets; using System.Text; using System.Threading; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { /// /// public class SpecAnKeysightScpi : ISpecAnalyzer - { - #region PublicMembers - #endregion - - #region PrivateMembers - private const string _READ_ERROR_CODE_CMD = "SYST:ERR?"; - private const string _SELFTESTCMD = "*TST? "; - private const string _RESETCMD = "*RST"; - /*private const string _ISOPCCMD = "*STB? "; + { + #region PrivateMembers + private const string _READ_ERROR_CODE_CMD = "SYST:ERR?"; + private const string _SELFTESTCMD = "*TST? "; + private const string _RESETCMD = "*RST"; + /*private const string _ISOPCCMD = "*STB? "; private const string _FREQCMD = ":FREQ:FIX"; private const string _PWRLEVELMD = "POW:REF"; private const string _OUTPUTON = ":OUTPut ON"; private const string _OUTPUTOFF = ":OUTPut OFF";*/ - private const string _INIT_IMMEDIATE = "INIT:IMM"; - private const string _MARKER_SET_MAX = "CALC:MARK:MAX"; - private const string _MARKER_QUERY_MAX_X = "CALC:MARK:X?"; - private const string _MARKER_QUERY_MAX_Y = "CALC:MARK:Y?"; - private const string _AVG_OFF = "AVER OFF"; - private const string _AVG_ON = "AVER ON"; - private const string _AVG_LOG = "AVER:TYPE LOG"; - private const string _AVG_RMS = "AVER:TYPE RMS"; - //private const string _AVG_SCAL = "AVER:TYPE SCAL"; - private const string _AVG_COUNT = "AVER:COUN"; - private const string _ATTENUATION_AUTO_ON = "POWer:ATTenuation:AUTO ON"; - private const string _ATTENUATION_AUTO_OFF = "POWer:ATTenuation:AUTO OFF"; - private const string _ATTENUATION_SET = "POWer:ATTenuation"; + private const string _INIT_IMMEDIATE = "INIT:IMM"; + private const string _MARKER_SET_MAX = "CALC:MARK:MAX"; + private const string _MARKER_QUERY_MAX_X = "CALC:MARK:X?"; + private const string _MARKER_QUERY_MAX_Y = "CALC:MARK:Y?"; + private const string _AVG_OFF = "AVER OFF"; + private const string _AVG_ON = "AVER ON"; + private const string _AVG_LOG = "AVER:TYPE LOG"; + private const string _AVG_RMS = "AVER:TYPE RMS"; + //private const string _AVG_SCAL = "AVER:TYPE SCAL"; + private const string _AVG_COUNT = "AVER:COUN"; + private const string _ATTENUATION_AUTO_ON = "POWer:ATTenuation:AUTO ON"; + private const string _ATTENUATION_AUTO_OFF = "POWer:ATTenuation:AUTO OFF"; + private const string _ATTENUATION_SET = "POWer:ATTenuation"; - //private const string _POWER_LEVEL = "POWer:LEVel"; - //private const string _POWER_LEVEL_AUTO_ON = "POWer:LEVel:AUTO ON"; - //private const string _POWER_LEVEL_AUTO_OFF = "POWer:LEVel:AUTO OFF"; + //private const string _POWER_LEVEL = "POWer:LEVel"; + //private const string _POWER_LEVEL_AUTO_ON = "POWer:LEVel:AUTO ON"; + //private const string _POWER_LEVEL_AUTO_OFF = "POWer:LEVel:AUTO OFF"; - private const string _FREQ_CENTER = "SENS:FREQ:CENT"; - private const string _FREQ_SPAN = "SENS:FREQ:SPAN"; + private const string _FREQ_CENTER = "SENS:FREQ:CENT"; + private const string _FREQ_SPAN = "SENS:FREQ:SPAN"; - private const string _RBW_SET = "BWID"; - private const string _RBW_AUTO_ON = "BWID:AUTO On"; - private const string _RBW_AUTO_OFF = "BWID:AUTO Off"; - private const string _VBW_SET = "BWID:VID"; - private const string _VBW_AUTO_ON = "BWID:VID:AUTO On"; - private const string _VBW_AUTO_OFF = "BWID:VID:AUTO Off"; + private const string _RBW_SET = "BWID"; + private const string _RBW_AUTO_ON = "BWID:AUTO On"; + private const string _RBW_AUTO_OFF = "BWID:AUTO Off"; + private const string _VBW_SET = "BWID:VID"; + private const string _VBW_AUTO_ON = "BWID:VID:AUTO On"; + private const string _VBW_AUTO_OFF = "BWID:VID:AUTO Off"; - private int m_PORT = 5025; - private const int m_READ_TIMEOUT = 10000; + private int m_PORT = 5025; + private const int m_READ_TIMEOUT = 10000; - private readonly string _address; - private byte[] _readBuffer; - private NetworkStream _tcpStream; + private readonly string _address; + private byte[] _readBuffer; + private NetworkStream _tcpStream; - private State _state; - private SelfTestResult _selfTestResult; - private string _name; + private State _state; + private SelfTestResult _selfTestResult; + private string _name; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// The Finalizer which will release resources if required - /// - ~SpecAnKeysightScpi() - { - Dispose(false); - } + #region PrivateFunctions - /// - /// Convert scpi data to string - /// - /// - /// - private string ConvertToString(ref byte[] data) - { - string rsp = System.Text.Encoding.ASCII.GetString(data); - return rsp; - } + /// + /// The Finalizer which will release resources if required + /// + ~SpecAnKeysightScpi() + { + Dispose(false); + } - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); + /// + /// Convert scpi data to string + /// + /// + /// + private string ConvertToString(ref byte[] data) + { + string rsp = System.Text.Encoding.ASCII.GetString(data); + return rsp; + } - _tcpStream.Close(); + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); - _tcpStream.Dispose(); + _tcpStream.Close(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _tcpStream.Dispose(); - /// - /// Get the error code. - /// - /// The error code. - /// The error description. - private string GetErrorCode(out int errorCode) - { - // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query + _state = State.Uninitialized; + } + } + } - string command = _READ_ERROR_CODE_CMD + "\n"; + /// + /// Get the error code. + /// + /// The error code. + /// The error description. + private string GetErrorCode(out int errorCode) + { + // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + string command = _READ_ERROR_CODE_CMD + "\n"; - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - // read the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); - // convert to a string - string rspStr = ConvertToString(ref _readBuffer); + // read the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - // parse the response - string[] tokens = rspStr.Split(','); + // convert to a string + string rspStr = ConvertToString(ref _readBuffer); - errorCode = Util.ConvertStringToInt32(tokens[0]); + // parse the response + string[] tokens = rspStr.Split(','); - // it should always be 2 - if (tokens.Length >= 2) - { - return tokens[1]; - } - else - { - return ""; - } - } + errorCode = Util.ConvertStringToInt32(tokens[0]); - /// - /// - /// - /// - /// - /// - private bool IsOperationCompleted(string statusString, string expectedResult = "1") - { - bool completed = false; + // it should always be 2 + if (tokens.Length >= 2) + { + return tokens[1]; + } + else + { + return ""; + } + } - // If Scope returns '+x' instead of 'x', where 'x' is any character, trim it. - if (statusString.IndexOf('+') == 0) - { - statusString = statusString.TrimStart('+'); - } + /// + /// + /// + /// + /// + /// + private bool IsOperationCompleted(string statusString, string expectedResult = "1") + { + bool completed = false; - if (statusString.Equals(expectedResult) == true) - { - completed = true; - } + // If Scope returns '+x' instead of 'x', where 'x' is any character, trim it. + if (statusString.IndexOf('+') == 0) + { + statusString = statusString.TrimStart('+'); + } - return completed; - } + if (statusString.Equals(expectedResult) == true) + { + completed = true; + } - #endregion + return completed; + } - /// - /// SpecAnKeysightScpi factory constructor - /// - /// - /// - public SpecAnKeysightScpi(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - const int READ_BUFFER_SIZE = 512; + #endregion - Name = deviceName; + /// + /// SpecAnKeysightScpi factory constructor + /// + /// + /// + public SpecAnKeysightScpi(string deviceName, IConfigurationManager configurationManager) + { + const int READ_BUFFER_SIZE = 512; - _logger = logger; + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _address = _configuration.GetConfigurationValue("SpecAnKeysightScpi", "Address", "127.0.0.1"); - m_PORT = _configuration.GetConfigurationValue("SpecAnKeysightScpi", "Port", 5025); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _readBuffer = new byte[READ_BUFFER_SIZE]; - TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); - _tcpStream = scopeSocketConn.GetStream(); - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _address = _configuration.GetConfigurationValue("SpecAnKeysightScpi", "Address", "127.0.0.1"); + m_PORT = _configuration.GetConfigurationValue("SpecAnKeysightScpi", "Port", 5025); - /// - /// - /// - /// - /// - public SpecAnKeysightScpi(string name, string address) - { - const int READ_BUFFER_SIZE = 512; - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _address = address; - _readBuffer = new byte[READ_BUFFER_SIZE]; - TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); - _tcpStream = scopeSocketConn.GetStream(); - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _readBuffer = new byte[READ_BUFFER_SIZE]; + TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); + _tcpStream = scopeSocketConn.GetStream(); + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + /// + public SpecAnKeysightScpi(string deviceName, string address) + { + const int READ_BUFFER_SIZE = 512; + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _address = address; + _readBuffer = new byte[READ_BUFFER_SIZE]; + TcpClient scopeSocketConn = new TcpClient(_address, m_PORT); + _tcpStream = scopeSocketConn.GetStream(); + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - /// - public void ConfigureAveraging(SpecAnAveragingType type, int numOfAverages) - { - if (type == SpecAnAveragingType.NONE) - { - string command = _AVG_OFF + "\n"; - IOWrite(command); - } - else - { - string onCommand = _AVG_ON + "\n"; - IOWrite(onCommand); + /// + /// + /// + /// + /// + public void ConfigureAveraging(SpecAnAveragingType type, int numOfAverages) + { + if (type == SpecAnAveragingType.NONE) + { + string command = _AVG_OFF + "\n"; + IOWrite(command); + } + else + { + string onCommand = _AVG_ON + "\n"; + IOWrite(onCommand); - string countCommand = _AVG_COUNT + " " + numOfAverages.ToString() + "\n"; - IOWrite(onCommand); + string countCommand = _AVG_COUNT + " " + numOfAverages.ToString() + "\n"; + IOWrite(onCommand); - if (type == SpecAnAveragingType.LOG) - { - string logCommand = _AVG_LOG + "\n"; - IOWrite(logCommand); - } - else if (type == SpecAnAveragingType.RMS) - { - string rmsCommand = _AVG_RMS + "\n"; - IOWrite(rmsCommand); - } - /*else if (type == SpecAnAveragingType.SCAL) + if (type == SpecAnAveragingType.LOG) + { + string logCommand = _AVG_LOG + "\n"; + IOWrite(logCommand); + } + else if (type == SpecAnAveragingType.RMS) + { + string rmsCommand = _AVG_RMS + "\n"; + IOWrite(rmsCommand); + } + /*else if (type == SpecAnAveragingType.SCAL) { //@@@ resulting in error -224 string scalCommand = _AVG_SCAL + "\n"; IOWrite(scalCommand); }*/ - else - { - throw new Exception("unsupported averaging type: " + type.ToString()); - } - } - } + else + { + throw new Exception("unsupported averaging type: " + type.ToString()); + } + } + } - /// - /// - /// - /// - /// - public void ConfigureBandwidth(int rbw, int vbw) - { - if (rbw == -99) - { - string command = _RBW_AUTO_ON + "\n"; - IOWrite(command); - } - else - { - string command = _RBW_AUTO_OFF + "\n"; - IOWrite(command); + /// + /// + /// + /// + /// + public void ConfigureBandwidth(int rbw, int vbw) + { + if (rbw == -99) + { + string command = _RBW_AUTO_ON + "\n"; + IOWrite(command); + } + else + { + string command = _RBW_AUTO_OFF + "\n"; + IOWrite(command); - command = _RBW_SET + " " + rbw.ToString() + "\n"; - IOWrite(command); - } + command = _RBW_SET + " " + rbw.ToString() + "\n"; + IOWrite(command); + } - if (vbw == -99) - { - string command = _VBW_AUTO_ON + "\n"; - IOWrite(command); - } - else - { - string command = _VBW_AUTO_OFF + "\n"; - IOWrite(command); + if (vbw == -99) + { + string command = _VBW_AUTO_ON + "\n"; + IOWrite(command); + } + else + { + string command = _VBW_AUTO_OFF + "\n"; + IOWrite(command); - command = _VBW_SET + " " + vbw.ToString() + "\n"; - IOWrite(command); - } - } + command = _VBW_SET + " " + vbw.ToString() + "\n"; + IOWrite(command); + } + } - /// - /// - /// - /// - /// - public void ConfigureFrequency(int centerFreq, int span) - { - string command = _FREQ_CENTER + " " + centerFreq.ToString() + "\n"; - IOWrite(command); + /// + /// + /// + /// + /// + public void ConfigureFrequency(int centerFreq, int span) + { + string command = _FREQ_CENTER + " " + centerFreq.ToString() + "\n"; + IOWrite(command); - command = _FREQ_SPAN + " " + span.ToString() + "\n"; - IOWrite(command); - } + command = _FREQ_SPAN + " " + span.ToString() + "\n"; + IOWrite(command); + } - /// - /// - /// - /// - /// - public void ConfigurePowerLevel(/*int referanceLevel, */int attenuation) - { - /*if (referanceLevel == -99) + /// + /// + /// + /// + /// + public void ConfigurePowerLevel(/*int referanceLevel, */int attenuation) + { + /*if (referanceLevel == -99) { string command = _POWER_LEVEL_AUTO_ON + " " + referanceLevel.ToString() + "\n"; IOWrite(command); @@ -394,319 +372,305 @@ namespace Raytheon.Instruments IOWrite(command); }*/ - if (attenuation == -99) - { - string command = _ATTENUATION_AUTO_ON + "\n"; - IOWrite(command); - } - else - { - string command = _ATTENUATION_AUTO_OFF + "\n"; - IOWrite(command); + if (attenuation == -99) + { + string command = _ATTENUATION_AUTO_ON + "\n"; + IOWrite(command); + } + else + { + string command = _ATTENUATION_AUTO_OFF + "\n"; + IOWrite(command); - command = _ATTENUATION_SET + " " + attenuation.ToString() + "\n"; - IOWrite(command); - } - } + command = _ATTENUATION_SET + " " + attenuation.ToString() + "\n"; + IOWrite(command); + } + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Scpi Spec An"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Scpi Spec An"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - Reset(); + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + Reset(); - // we already connected to the instrument in the constructor - _state = State.Ready; - } - else - { - throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } + // we already connected to the instrument in the constructor + _state = State.Ready; + } + else + { + throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - /// - public string IOQuery(string command, int timeout = 10000) - { - _tcpStream.ReadTimeout = timeout; + /// + /// + /// + /// + /// + public string IOQuery(string command, int timeout = 10000) + { + _tcpStream.ReadTimeout = timeout; - // send the command - IOWrite(command, false); + // send the command + IOWrite(command, false); - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); - // read from the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + // read from the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - // convert response to a string - string rspStr = ConvertToString(ref _readBuffer); + // convert response to a string + string rspStr = ConvertToString(ref _readBuffer); - // check for errors - int err = 0; - string message = GetErrorCode(out err); - if (err != 0) - { - throw new Exception("SpecAnKeysightScpi:IOQuery() - Spec An " + _name + " returned error code: " + err.ToString() + ", " + message); - } + // check for errors + int err = 0; + string message = GetErrorCode(out err); + if (err != 0) + { + throw new Exception("SpecAnKeysightScpi:IOQuery() - Spec An " + _name + " returned error code: " + err.ToString() + ", " + message); + } - return rspStr; - } + return rspStr; + } - /// - /// - /// - /// - public void IOWrite(string command, bool shallWeCheckForError = true) - { - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + /// + /// + /// + /// + public void IOWrite(string command, bool shallWeCheckForError = true) + { + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - // check for errors - if (shallWeCheckForError == true) - { - int err = 0; - string errorMessage = GetErrorCode(out err); - if (err != 0) - { - throw new Exception("SpecAnKeysightScpi:IOWrite() - Device " + _name + " returned error code: " + err.ToString() + "," + errorMessage); - } - } - } + // check for errors + if (shallWeCheckForError == true) + { + int err = 0; + string errorMessage = GetErrorCode(out err); + if (err != 0) + { + throw new Exception("SpecAnKeysightScpi:IOWrite() - Device " + _name + " returned error code: " + err.ToString() + "," + errorMessage); + } + } + } - /// - /// - /// - /// - public double MeasurePeakAmplitude() - { - //Initiate a single sweep - string command = _INIT_IMMEDIATE + "\n"; - IOWrite(command); + /// + /// + /// + /// + public double MeasurePeakAmplitude() + { + //Initiate a single sweep + string command = _INIT_IMMEDIATE + "\n"; + IOWrite(command); - //@@@ probably need to wait until sweep is completed - //although examples dont show that..have to try it out with a real signal + //@@@ probably need to wait until sweep is completed + //although examples dont show that..have to try it out with a real signal - // Set the marker to the maximum peak - command = _MARKER_SET_MAX + "\n"; - IOWrite(command); + // Set the marker to the maximum peak + command = _MARKER_SET_MAX + "\n"; + IOWrite(command); - //Query and read the marker frequency - command = _MARKER_QUERY_MAX_Y + "\n"; - string rspStr = IOQuery(command); + //Query and read the marker frequency + command = _MARKER_QUERY_MAX_Y + "\n"; + string rspStr = IOQuery(command); - string[] tokens = rspStr.Split('\n'); + string[] tokens = rspStr.Split('\n'); - double amp = Util.ConvertStringToDouble(tokens[0]); + double amp = Util.ConvertStringToDouble(tokens[0]); - return amp; - } + return amp; + } - /// - /// - /// - /// - public double MeasurePeakFrequency() - { - //Initiate a single sweep - string command = _INIT_IMMEDIATE + "\n"; - IOWrite(command); + /// + /// + /// + /// + public double MeasurePeakFrequency() + { + //Initiate a single sweep + string command = _INIT_IMMEDIATE + "\n"; + IOWrite(command); - //@@@ probably need to wait until sweep is completed - //although examples dont show that..have to try it out with a real signal + //@@@ probably need to wait until sweep is completed + //although examples dont show that..have to try it out with a real signal - // Set the marker to the maximum peak - command = _MARKER_SET_MAX + "\n"; - IOWrite(command); + // Set the marker to the maximum peak + command = _MARKER_SET_MAX + "\n"; + IOWrite(command); - //Query and read the marker frequency - command = _MARKER_QUERY_MAX_X + "\n"; - string rspStr = IOQuery(command); + //Query and read the marker frequency + command = _MARKER_QUERY_MAX_X + "\n"; + string rspStr = IOQuery(command); - string[] tokens = rspStr.Split('\n'); + string[] tokens = rspStr.Split('\n'); - double freq = Util.ConvertStringToDouble(tokens[0]); + double freq = Util.ConvertStringToDouble(tokens[0]); - return freq; - } + return freq; + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set - { - _name = value; - } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - try - { - // change the timeout to account for the long self test - _tcpStream.ReadTimeout = 120000; + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + try + { + // change the timeout to account for the long self test + _tcpStream.ReadTimeout = 120000; - // send the command and get the rsponse - string command = _SELFTESTCMD + "\n"; - string rspStr = IOQuery(command); + // send the command and get the rsponse + string command = _SELFTESTCMD + "\n"; + string rspStr = IOQuery(command); - // parse the response - string[] tokens = rspStr.Split('\n'); + // parse the response + string[] tokens = rspStr.Split('\n'); - //Check if self test is completed; returns status of "0". - if (IsOperationCompleted(tokens[0], "0") == false) - { - string errorMsg = "System " + _name + " returned an error: " + tokens[0]; - throw new Exception(errorMsg); - } + //Check if self test is completed; returns status of "0". + if (IsOperationCompleted(tokens[0], "0") == false) + { + string errorMsg = "System " + _name + " returned an error: " + tokens[0]; + throw new Exception(errorMsg); + } - _selfTestResult = SelfTestResult.Pass; + _selfTestResult = SelfTestResult.Pass; - return SelfTestResult.Pass; - } - catch (Exception) - { - throw; - } - finally - { - // restore the timeout - _tcpStream.ReadTimeout = m_READ_TIMEOUT; - } - } + return SelfTestResult.Pass; + } + catch (Exception) + { + throw; + } + finally + { + // restore the timeout + _tcpStream.ReadTimeout = m_READ_TIMEOUT; + } + } - /// - /// - /// - public void Reset() - { - // Resets the instrument - string command = _RESETCMD + "\n"; - IOWrite(command); + /// + /// + /// + public void Reset() + { + // Resets the instrument + string command = _RESETCMD + "\n"; + IOWrite(command); - Thread.Sleep(3000); + Thread.Sleep(3000); - /*command = _ISOPCCMD + "\n"; + /*command = _ISOPCCMD + "\n"; string rspStr = IOQuery(command); // parse the response @@ -716,49 +680,49 @@ namespace Raytheon.Instruments { throw new Exception("Reset was not completed."); }*/ - } + } - /// - /// - /// - public void Shutdown() - { - string errorMsg = ""; + /// + /// + /// + public void Shutdown() + { + string errorMsg = ""; - if (_state == State.Ready) - { - try - { - //Reset System - Reset(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + if (_state == State.Ready) + { + try + { + //Reset System + Reset(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - // the stream was created in the constructor, dispose of it here - try - { - if (_tcpStream != null) - { - _tcpStream.Dispose(); - _tcpStream = null; - } - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + // the stream was created in the constructor, dispose of it here + try + { + if (_tcpStream != null) + { + _tcpStream.Dispose(); + _tcpStream = null; + } + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } - if (errorMsg != "") - { - throw new Exception("System " + _name + " Had an error: " + errorMsg); - } - } + if (errorMsg != "") + { + throw new Exception("System " + _name + " Had an error: " + errorMsg); + } + } - } + } } diff --git a/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnKeysightScpi/SpecAnKeysightScpiFactory.cs b/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnKeysightScpi/SpecAnKeysightScpiFactory.cs index 4b8b79d..1b7d2fb 100644 --- a/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnKeysightScpi/SpecAnKeysightScpiFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnKeysightScpi/SpecAnKeysightScpiFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SpecAnKeysightScpiFactory")] - public class SpecAnKeysightScpiFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SpecAnKeysightScpiFactory")] + public class SpecAnKeysightScpiFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SpecAnKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SpecAnKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SpecAnKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SpecAnKeysightScpiFactory injection constructor + /// + [ImportingConstructor] + public SpecAnKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISpecAnalyzer)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SpecAnKeysightScpi(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISpecAnalyzer)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SpecAnKeysightScpi(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new SpecAnSim(name, _configurationManager, _logger); + return new SpecAnSim(name, _configurationManager); else - return new SpecAnKeysightScpi(name, _configurationManager, _logger); + return new SpecAnKeysightScpi(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnSim/SpecAnSim.cs b/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnSim/SpecAnSim.cs index 208a901..e7f10e3 100644 --- a/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnSim/SpecAnSim.cs +++ b/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnSim/SpecAnSim.cs @@ -28,369 +28,336 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// - public class SpecAnSim : ISpecAnalyzer - { - #region PublicMembers - #endregion + /// + /// + public class SpecAnSim : ISpecAnalyzer + { + #region PublicMembers + #endregion - #region PrivateMembers + #region PrivateMembers - private State _state; - private SelfTestResult _selfTestResult; - private string _name; + private State _state; + private SelfTestResult _selfTestResult; + private string _name; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// The Finalizer which will release resources if required - /// - ~SpecAnSim() - { - Dispose(false); - } + #region PrivateFunctions - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); + /// + /// The Finalizer which will release resources if required + /// + ~SpecAnSim() + { + Dispose(false); + } - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); - #endregion + _state = State.Uninitialized; + } + } + } - /// - /// SpecAnSim factory constructor - /// - /// - /// - public SpecAnSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #endregion - _logger = logger; + /// + /// SpecAnSim factory constructor + /// + /// + /// + public SpecAnSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - /// - /// - /// - /// - public SpecAnSim(string name) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - /// - public void ConfigureAveraging(SpecAnAveragingType type, int numOfAverages) - { + /// + /// + /// + /// + public SpecAnSim(string deviceName) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - } + /// + /// + /// + /// + /// + public void ConfigureAveraging(SpecAnAveragingType type, int numOfAverages) + { - /// - /// - /// - /// - /// - public void ConfigureBandwidth(int rbw, int vbw) - { + } - } + /// + /// + /// + /// + /// + public void ConfigureBandwidth(int rbw, int vbw) + { - /// - /// - /// - /// - /// - public void ConfigureFrequency(int centerFreq, int span) - { + } - } + /// + /// + /// + /// + /// + public void ConfigureFrequency(int centerFreq, int span) + { - /// - /// - /// - /// - /// - public void ConfigurePowerLevel(/*int referanceLevel, */int attenuation) - { + } - } + /// + /// + /// + /// + /// + public void ConfigurePowerLevel(/*int referanceLevel, */int attenuation) + { - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Scpi Spec An "; - } - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Scpi Spec An "; + } + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - /// - /// Dispose of this objects resources - /// - public void Dispose() - { - try - { - Dispose(true); + set + { + throw new NotImplementedException(); + } + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of this objects resources + /// + public void Dispose() + { + Dispose(true); - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + GC.SuppressFinalize(this); + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - // if we have not yet been initialized, go ahead and create the socket - if (_state == State.Uninitialized) - { - Reset(); + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - // we already connected to the instrument in the constructor - _state = State.Ready; - } - else - { - throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); - } - } + /// + /// + /// + public void Initialize() + { + // if we have not yet been initialized, go ahead and create the socket + if (_state == State.Uninitialized) + { + Reset(); - /// - /// - /// - /// - /// - public string IOQuery(string command, int timeout = 10000) - { - return "100"; - } + // we already connected to the instrument in the constructor + _state = State.Ready; + } + else + { + throw new Exception("expected the state of System " + _name + " to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - public void IOWrite(string command, bool shallWeCheckForError = true) - { - } + /// + /// + /// + /// + /// + public string IOQuery(string command, int timeout = 10000) + { + return "100"; + } - /// - /// - /// - /// - public double MeasurePeakAmplitude() - { - return 0.0; - } + /// + /// + /// + /// + public void IOWrite(string command, bool shallWeCheckForError = true) + { + } - /// - /// - /// - /// - public double MeasurePeakFrequency() - { - return 0.0; - } + /// + /// + /// + /// + public double MeasurePeakAmplitude() + { + return 0.0; + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - set - { - _name = value; - } - } + /// + /// + /// + /// + public double MeasurePeakFrequency() + { + return 0.0; + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - try - { - _selfTestResult = SelfTestResult.Pass; + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - return SelfTestResult.Pass; - } - catch (Exception) - { - throw; - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + try + { + _selfTestResult = SelfTestResult.Pass; - /// - /// - /// - public void Reset() - { - } + return SelfTestResult.Pass; + } + catch (Exception) + { + throw; + } + } - /// - /// - /// - public void Shutdown() - { - string errorMsg = ""; + /// + /// + /// + public void Reset() + { + } - if (_state == State.Ready) - { - try - { - //Reset System - Reset(); - } - catch (Exception err) - { - errorMsg += err.Message + " "; - } + /// + /// + /// + public void Shutdown() + { + string errorMsg = ""; - _state = State.Uninitialized; - } - } - } + if (_state == State.Ready) + { + try + { + //Reset System + Reset(); + } + catch (Exception err) + { + errorMsg += err.Message + " "; + } + + _state = State.Uninitialized; + } + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnSim/SpecAnSimFactory.cs b/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnSim/SpecAnSimFactory.cs index de6c2a5..801488b 100644 --- a/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnSim/SpecAnSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/SpecAnalyzer/SpecAnSim/SpecAnSimFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SpecAnSimFactory")] - public class SpecAnSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SpecAnSimFactory")] + public class SpecAnSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SpecAnSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SpecAnSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SpecAnSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SpecAnSimFactory injection constructor + /// + [ImportingConstructor] + public SpecAnSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISpecAnalyzer)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SpecAnSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISpecAnalyzer)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SpecAnSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +98,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new SpecAnSim(name, _configurationManager, _logger); + return new SpecAnSim(name, _configurationManager); } catch (Exception) { @@ -120,17 +111,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchKeysightScpi/SwitchKeysightScpi.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchKeysightScpi/SwitchKeysightScpi.cs index 0db132f..1fb1757 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchKeysightScpi/SwitchKeysightScpi.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchKeysightScpi/SwitchKeysightScpi.cs @@ -22,11 +22,11 @@ // accordance with DoD-5220.22-M or OPNAVINST 5510.1h. //>>*************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Net.Sockets; using System.Text; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { @@ -35,449 +35,413 @@ namespace Raytheon.Instruments /// It only supports individual relay mode at this time. /// public class SwitchKeysightScpi : ISwitch - { - #region PrivateMemberVariables - private const string READ_ERROR_STATUS_CMD = "SYST:ERR?"; - private const string _SELFTESTCMD = "*TST?"; - private const string _RESETCMD = "*RST"; - //@@@ add scpi commands here - - private int _PORT = 5025; - private const int _READ_TIMEOUT = 5000; - private byte[] _readBuffer; - private NetworkStream _tcpStream; - private string _name; - - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - #endregion - - #region PrivateFunctions - /// - /// Dispose of this object's resources. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing && _tcpStream != null) - { - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// Convert scpi data to string - /// - /// - /// - private string ConvertToString(ref byte[] data) - { - string rsp = System.Text.Encoding.ASCII.GetString(data); - return rsp; - } - - /// - /// Get the error code. - /// - /// The error code (number). - private int GetErrorCode() - { - // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query - string command = READ_ERROR_STATUS_CMD + "\n"; - - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(command); - - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); - - // read the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - - // convert to a string - string rspStr = ConvertToString(ref _readBuffer); - - // parse the response - string[] tokens = rspStr.Split(','); - - int ret = Util.ConvertStringToInt32(tokens[0]); - - return ret; - } - - - /// - /// Send a command to the DMM and get the response - /// - /// The command to send - /// The DMM response - private string IOQuery(string commandString) - { - // send the command - IOWrite(commandString); - - // clear our buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); - - // read from the response - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - - // convert response to a string - string rspStr = ConvertToString(ref _readBuffer); - - // check for errors - int err = GetErrorCode(); - if (err != 0) - { - throw new Exception("SwitchKeysightScpi:IOQuery() - returned error code: " + err.ToString()); - } - - return rspStr; - } - - /// - /// Sends a SCPI Command to the instrument. - /// - /// The SCPI Command to be sent to the instrument. - private void IOWrite(string commandString) - { - // convert to a byte array - byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); - - // send the data out - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - - // check for errors - int err = GetErrorCode(); - if (err != 0) - { - throw new Exception("SwitchKeysightScpi:IOQuery() - returned error code: " + err.ToString()); - } - } - - /// - /// Perform self-test. - /// - private void SelfTest() - { - try - { - // change the timeout to account for the long self test - _tcpStream.ReadTimeout = 30000; - - // send the command and get the response - string command = _SELFTESTCMD + "\n"; - string rspStr = IOQuery(command); - - // parse the response - string[] tokens = rspStr.Split('\n'); - - int rsp = Util.ConvertStringToInt32(tokens[0]); - - if (rsp != 0) - { - string errorMsg = "returned an error: " + rsp.ToString() + "," + rspStr; - throw new Exception(errorMsg); - } - } - catch (Exception) - { - throw; - } - finally - { - // restore the timeout - _tcpStream.ReadTimeout = _READ_TIMEOUT; - } - } - #endregion - - #region PublicFunctions - - /// - /// SwitchKeysightScpi factory constructor - /// - /// - /// - public SwitchKeysightScpi(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; - - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - var address = _configuration.GetConfigurationValue("SwitchKeysightScpi", "Address", "127.0.0.1"); - _PORT = _configuration.GetConfigurationValue("SwitchKeysightScpi", "Port", 5025); - - const int READ_BUFFER_SIZE = 512; - - _readBuffer = new byte[READ_BUFFER_SIZE]; - - TcpClient dmmSocketConn = new TcpClient(address, _PORT); - _tcpStream = dmmSocketConn.GetStream(); - _tcpStream.ReadTimeout = _READ_TIMEOUT; - - SelfTest(); - } - - /// - /// Constructor for RelaySwitch card. - /// - /// The address of the RelaySwitch. - /// The options used for setting up the instrument. - public SwitchKeysightScpi(string name, string address) - { - const int READ_BUFFER_SIZE = 512; - - _name = name; - - _logger = LogManager.GetCurrentClassLogger(); - - _readBuffer = new byte[READ_BUFFER_SIZE]; - - TcpClient dmmSocketConn = new TcpClient(address, _PORT); - _tcpStream = dmmSocketConn.GetStream(); - _tcpStream.ReadTimeout = _READ_TIMEOUT; - - SelfTest(); - } - - /// - /// Finalizer. - /// - ~SwitchKeysightScpi() - { - Dispose(false); - } - - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } - - /// - /// Close a single relay. - /// - /// The relay to close. - public void Connect(string path) - { - // send the command - - //IOWrite(command); - - //read back to verify state of relay? - - - //"ROUT:CLOS (@3923)" - } - - /// - /// Open a single relay. - /// - /// The relay to open. - public void Disconnect(string path) - { - // send the command - - //IOWrite(command); - - //read back to verify state of relay? - //"ROUT:OPEN (@3923)") - } - - /// - /// - /// - public void DisconnectAll() - { - } - - /// - /// Dispose of resources. - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Keysight 34980A switch"; - } - } - - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotSupportedException(); - } - - set - { - throw new NotSupportedException(); - } - } - - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotSupportedException(); - } - - set - { - throw new NotSupportedException(); - } - } - - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotSupportedException(); - } - } - - /// - /// - /// - public void Initialize() - { - throw new NotSupportedException(); - } - - /// - /// - /// - public bool IsDebounced - { - get - { - throw new NotSupportedException(); - } - } - - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } - - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - throw new NotSupportedException(); - } - } - - /// - /// - /// - public State Status - { - get - { - throw new NotSupportedException(); - } - } - - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - throw new NotSupportedException(); - } - - /// - /// - /// - public void Reset() - { - IOWrite(_RESETCMD + "\n"); - } - - /// - /// - /// - public void Shutdown() - { - if (_tcpStream != null) - { - Reset(); - _tcpStream.Dispose(); - } - } - #endregion - } + { + #region PrivateMemberVariables + private const string READ_ERROR_STATUS_CMD = "SYST:ERR?"; + private const string _SELFTESTCMD = "*TST?"; + private const string _RESETCMD = "*RST"; + //@@@ add scpi commands here + + private int _PORT = 5025; + private const int _READ_TIMEOUT = 5000; + private byte[] _readBuffer; + private NetworkStream _tcpStream; + private string _name; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFunctions + /// + /// Dispose of this object's resources. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + } + + /// + /// Convert scpi data to string + /// + /// + /// + private string ConvertToString(ref byte[] data) + { + string rsp = System.Text.Encoding.ASCII.GetString(data); + return rsp; + } + + /// + /// Get the error code. + /// + /// The error code (number). + private int GetErrorCode() + { + // not calling IOQuery() here so IOQuery() can call GetErrorCode() after each query + string command = READ_ERROR_STATUS_CMD + "\n"; + + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(command); + + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); + + // read the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + + // convert to a string + string rspStr = ConvertToString(ref _readBuffer); + + // parse the response + string[] tokens = rspStr.Split(','); + + int ret = Util.ConvertStringToInt32(tokens[0]); + + return ret; + } + + + /// + /// Send a command to the DMM and get the response + /// + /// The command to send + /// The DMM response + private string IOQuery(string commandString) + { + // send the command + IOWrite(commandString); + + // clear our buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); + + // read from the response + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + + // convert response to a string + string rspStr = ConvertToString(ref _readBuffer); + + // check for errors + int err = GetErrorCode(); + if (err != 0) + { + throw new Exception("SwitchKeysightScpi:IOQuery() - returned error code: " + err.ToString()); + } + + return rspStr; + } + + /// + /// Sends a SCPI Command to the instrument. + /// + /// The SCPI Command to be sent to the instrument. + private void IOWrite(string commandString) + { + // convert to a byte array + byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); + + // send the data out + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + + // check for errors + int err = GetErrorCode(); + if (err != 0) + { + throw new Exception("SwitchKeysightScpi:IOQuery() - returned error code: " + err.ToString()); + } + } + + /// + /// Perform self-test. + /// + private void SelfTest() + { + try + { + // change the timeout to account for the long self test + _tcpStream.ReadTimeout = 30000; + + // send the command and get the response + string command = _SELFTESTCMD + "\n"; + string rspStr = IOQuery(command); + + // parse the response + string[] tokens = rspStr.Split('\n'); + + int rsp = Util.ConvertStringToInt32(tokens[0]); + + if (rsp != 0) + { + string errorMsg = "returned an error: " + rsp.ToString() + "," + rspStr; + throw new Exception(errorMsg); + } + } + catch (Exception) + { + throw; + } + finally + { + // restore the timeout + _tcpStream.ReadTimeout = _READ_TIMEOUT; + } + } + #endregion + + #region PublicFunctions + + /// + /// SwitchKeysightScpi factory constructor + /// + /// + /// + public SwitchKeysightScpi(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + var address = _configuration.GetConfigurationValue("SwitchKeysightScpi", "Address", "127.0.0.1"); + _PORT = _configuration.GetConfigurationValue("SwitchKeysightScpi", "Port", 5025); + + const int READ_BUFFER_SIZE = 512; + + _readBuffer = new byte[READ_BUFFER_SIZE]; + + TcpClient dmmSocketConn = new TcpClient(address, _PORT); + _tcpStream = dmmSocketConn.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; + + SelfTest(); + } + + /// + /// Constructor for RelaySwitch card. + /// + /// The address of the RelaySwitch. + /// The options used for setting up the instrument. + public SwitchKeysightScpi(string deviceName, string address) + { + const int READ_BUFFER_SIZE = 512; + + _name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _readBuffer = new byte[READ_BUFFER_SIZE]; + + TcpClient dmmSocketConn = new TcpClient(address, _PORT); + _tcpStream = dmmSocketConn.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; + + SelfTest(); + } + + /// + /// Finalizer. + /// + ~SwitchKeysightScpi() + { + Dispose(false); + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// Close a single relay. + /// + /// The relay to close. + public void Connect(string path) + { + // send the command + + //IOWrite(command); + + //read back to verify state of relay? + + + //"ROUT:CLOS (@3923)" + } + + /// + /// Open a single relay. + /// + /// The relay to open. + public void Disconnect(string path) + { + // send the command + + //IOWrite(command); + + //read back to verify state of relay? + //"ROUT:OPEN (@3923)") + } + + /// + /// + /// + public void DisconnectAll() + { + } + + /// + /// Dispose of resources. + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Keysight 34980A switch"; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotSupportedException(); + } + + set + { + throw new NotSupportedException(); + } + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotSupportedException(); + } + + set + { + throw new NotSupportedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotSupportedException(); + } + } + + /// + /// + /// + public void Initialize() + { + throw new NotSupportedException(); + } + + /// + /// + /// + public bool IsDebounced + { + get + { + throw new NotSupportedException(); + } + } + + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + throw new NotSupportedException(); + } + } + + /// + /// + /// + public State Status + { + get + { + throw new NotSupportedException(); + } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotSupportedException(); + } + + /// + /// + /// + public void Reset() + { + IOWrite(_RESETCMD + "\n"); + } + + /// + /// + /// + public void Shutdown() + { + if (_tcpStream != null) + { + Reset(); + _tcpStream.Dispose(); + } + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchKeysightScpi/SwitchKeysightScpiFactory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchKeysightScpi/SwitchKeysightScpiFactory.cs index de74bb1..771b045 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchKeysightScpi/SwitchKeysightScpiFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchKeysightScpi/SwitchKeysightScpiFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SwitchKeysightScpiFactory")] - public class SwitchKeysightScpiFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SwitchKeysightScpiFactory")] + public class SwitchKeysightScpiFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SwitchKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SwitchKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SwitchKeysightScpiFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SwitchKeysightScpiFactory injection constructor + /// + [ImportingConstructor] + public SwitchKeysightScpiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISwitch)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SwitchKeysightScpi(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchKeysightScpi(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new SwitchSim(name, _configurationManager, _logger); + return new SwitchSim(name, _configurationManager); else - return new SwitchKeysightScpi(name, _configurationManager, _logger); + return new SwitchKeysightScpi(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/Documentation/40-42-585_Programming_Diagram.png b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/Documentation/40-42-585_Programming_Diagram.png new file mode 100644 index 0000000..7a2665c Binary files /dev/null and b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/Documentation/40-42-585_Programming_Diagram.png differ diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/Documentation/Resistance_Def_Example.ini b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/Documentation/Resistance_Def_Example.ini new file mode 100644 index 0000000..ac92f25 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/Documentation/Resistance_Def_Example.ini @@ -0,0 +1,9 @@ +;format is signal_name = range|resolution|delay(ms)|scale factor|relays|type|cable, connector and pin id|lower_limit|upper_limit +;Type is TWO or FOUR for two wire and four wire measurements +;Relay Format: [Card_Name]:[Path] +; [Card_Name] - Must match the name of the switch card defined in the Instrument.xml +; [Path] - [subUnit#].[channel_x1].[channel_y1],[subUnit#].[channel_x2].[channel_y2] +; x1 is routed to y1, x2 is routed to y2, y1 goes to DMM + input, y2 goes to DMM - input +;Cable and Pin Id Format: [Cable_Id]_[Connecto_Id]_[Pin_Id]_[Cable_Id]_[Connector_Id]_[Pin_Id] +[DmmReadResistance] +W3_AUD_GDNC_FILTER = NO_PCODE|-1|0.001|100|1|PICKERING_SWITCH_MATRIX_64X4:0.17.1,0.16.2|TWO|W1_P3_52_W1_P4_4|0.0|5.0 diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/Documentation/Supported_Devices.txt b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/Documentation/Supported_Devices.txt new file mode 100644 index 0000000..a94ebb0 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/Documentation/Supported_Devices.txt @@ -0,0 +1 @@ +Pickering Matrix Switch 40-585A-001 \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/SwitchMatrixPickering40x.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/SwitchMatrixPickering40x.cs new file mode 100644 index 0000000..809df1a --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/SwitchMatrixPickering40x.cs @@ -0,0 +1,347 @@ +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ + +using System; +using NLog; +using Pickering.Lxi.Piplx; +using Raytheon.Common; + +namespace Raytheon.Instruments +{ + /// + /// A Pickering implementation of the IRelaySwitch interface + /// + public class SwitchMatrixPickering40x : ISwitch + { + #region PrivateMemberVariables + private string _name; + private string _lxiIpAddress; + private int _deviceNum; + private int _busNum; + private PiplxCard _switchMatrixCard; + private State _state; + private SelfTestResult _selfTestResult; + private object _syncObj = new Object(); + PiplxManager _piplxManager; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFunctions + + /// + /// Close/open relay pair defined in the path + /// + /// The relay to close + private void OperateRelays(string path, bool state) + { + lock (_syncObj) + { + // split path into 2 items. Each item contains channel information + string[] channelArray = path.Split(','); + + if (channelArray.Length != 2) + { + throw new Exception($"Invalid path: {path}. Expected format: [subunit].[channel_x].[channel_y],[subunit].[channel_x].[channel_y]"); + } + + for (int i = 0; i < channelArray.Length; i++) + { + string[] itemArray = channelArray[i].Split('.'); + + if (itemArray.Length != 3) + { + throw new Exception($"Invalid path: {path}. Expected format: [subunit].[channel_x].[channel_y]"); + } + + int itemIndex = 0; + if (int.TryParse(itemArray[itemIndex++], out int subUnitIndex) && int.TryParse(itemArray[itemIndex++], out int xIndex) && int.TryParse(itemArray[itemIndex++], out int yIndex)) + { + MatrixSubunit subUnit = (MatrixSubunit)_switchMatrixCard.Subunits[subUnitIndex]; + + subUnit.OperateCrosspoint(yIndex, xIndex, state); + } + else + { + throw new Exception($"Invalid path: {channelArray[i]}. Expected format: [subunit].[channel_x].[channel_y]"); + } + } + } + } + + /// + /// Opens all relays on the card + /// + private void RelayOpenAll() + { + lock (_syncObj) + { + for (int i = 0; i < _switchMatrixCard.Subunits.Count; i++) + { + MatrixSubunit subUnit = (MatrixSubunit)_switchMatrixCard.Subunits[i]; + subUnit.ClearSubunit(); + } + } + } + + #endregion + + #region PublicFunctions + + /// + /// SwitchMatrixPickering40x factory constructor + /// + /// + /// + public SwitchMatrixPickering40x(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _lxiIpAddress = _configuration.GetConfigurationValue(Name, "LXI_IP_ADDRESS"); + Int32.TryParse(_configuration.GetConfigurationValue(Name, "DEVICE_NUMBER"), out _deviceNum); + Int32.TryParse(_configuration.GetConfigurationValue(Name, "BUS_NUMBER"), out _busNum); + + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// The Finalizer + /// + ~SwitchMatrixPickering40x() + { + + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + public void Connect(string path) + { + OperateRelays(path, true); + } + + /// + /// + /// + /// + public void Disconnect(string path) + { + OperateRelays(path, false); + } + + /// + /// + /// + public void DisconnectAll() + { + RelayOpenAll(); + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Pickering Switch"; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _piplxManager = new PiplxManager(_lxiIpAddress); + + foreach (PiplxCard card in _piplxManager.Cards) + { + PiplxCardInfo info = (PiplxCardInfo)card.Info; + + if (info.Device == _deviceNum && info.Bus == _busNum) + { + _switchMatrixCard = card; + + _switchMatrixCard.Open(); + + RelayOpenAll(); + + break; + } + } + + if (_switchMatrixCard == null) + { + throw new Exception($"No switch matrix card exists in LXI chassis with DEVICE_NUMBER={_deviceNum} and BUS_NUMBER={_busNum}"); + } + + _state = State.Ready; + } + else + { + throw new Exception("Expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } + + /// + /// + /// + public bool IsDebounced + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } + + /// + /// + /// + public void Reset() + { + throw new NotImplementedException(); + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + if (_switchMatrixCard != null && _switchMatrixCard.IsOpen()) + { + RelayOpenAll(); + _switchMatrixCard.Close(); + } + + if (_piplxManager != null && _piplxManager.Connected) + _piplxManager.Disconnect(); + + _state = State.Uninitialized; + } + } + + #endregion + } +} diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/SwitchMatrixPickering40x.csproj b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/SwitchMatrixPickering40x.csproj new file mode 100644 index 0000000..bb1f686 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/SwitchMatrixPickering40x.csproj @@ -0,0 +1,43 @@ + + + + net472 + Raytheon.Instruments.SwitchMatrixPickering40x + Switch Matrix Pickering 40x implementation + Switch Matrix Pickering 40x implementation + Library + + + + 1.0.0 + + + + + + + + + + + + + + + ..\..\Common\COTS\Pickering\Pickering.Lxi.Communication.dll + + + ..\..\Common\COTS\Pickering\Pickering.Lxi.Piplx.dll + + + + + + + + + + + + + diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/SwitchMatrixPickering40xFactory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/SwitchMatrixPickering40xFactory.cs new file mode 100644 index 0000000..4f505c5 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMatrixPickering40x/SwitchMatrixPickering40xFactory.cs @@ -0,0 +1,131 @@ +// ********************************************************************************************************** +// SwitchMatrixPickering40xFactory.cs +// 2/20/2023 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** + +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Reflection; +using NLog; +using Raytheon.Common; + +namespace Raytheon.Instruments +{ + [ExportInstrumentFactory(ModelNumber = "SwitchMatrixPickering40xFactory")] + public class SwitchMatrixPickering40xFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); + + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; + + public SwitchMatrixPickering40xFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } + + /// + /// SwitchMatrixPickering40xFactory injection constructor + /// + [ImportingConstructor] + public SwitchMatrixPickering40xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; + + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchMatrixPickering40x(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } + + /// + /// Gets the instrument + /// + /// + /// + public object GetInstrument(string name, bool simulateHw) + { + try + { + if (simulateHw) + return new SwitchSim(name, _configurationManager); + else + return new SwitchMatrixPickering40x(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } + + /// + /// Gets supported interfaces + /// + /// + public ICollection GetSupportedInterfaces() + { + return _supportedInterfaces.ToArray(); + } + + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } +} diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/Documentation/65-260_Programming_Diagram.png b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/Documentation/65-260_Programming_Diagram.png new file mode 100644 index 0000000..cdf82bc Binary files /dev/null and b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/Documentation/65-260_Programming_Diagram.png differ diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/Documentation/Resistance_Def_Example.ini b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/Documentation/Resistance_Def_Example.ini new file mode 100644 index 0000000..ba11e94 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/Documentation/Resistance_Def_Example.ini @@ -0,0 +1,24 @@ +;format is signal_name = range|resolution|min_delay(ms)|max_delay(ms)|scale factor|relays|type|cable, connector and pin id|lower_limit|upper_limit +;Range format for Raptor Squib Meter: +; Refer to 101-SQB-RAK Meter Customer Command Set Verion 1.0.8.pdf, page 13 on range setting +; There is no auto range +; Possible ranges: +; 0 No Range +; 1 DIODE Range +; 2 20 Ohm +; 3 200 Ohm +; 4 2K Ohm +; 5 20K Ohm +; 6 200K Ohm +; 7 2M Ohm +;Type is TWO or FOUR for two wire and four wire measurements +;Relay Format: [Card_Name]:[Path] +; [Card_Name] - Must match the name of the switch card defined in the Instrument.xml +; [Path] - [card#].[channel#],[card#].[channel#] +; If card# = 0, then all cards are treated as 1 virtual card. +; That means the number of channels = # of cards x 96 (channels) +; If card# > 0, then each card is treated as individual card. +; The number of channels = 96 +;Cable and Pin Id Format: [Cable_Id]_[Connecto_Id]_[Pin_Id]_[Cable_Id]_[Connector_Id]_[Pin_Id] +[DmmReadResistance] +SIGNAL_1 = NO_PCODE|7|0.001|100|1|PICKERING_SWITCH_MULTIPLEXER_96X4:0.1,0.96|FOUR|W1_P3_52_W1_P4_4|0.0|5.0 diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/Documentation/Supported_Devices.txt b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/Documentation/Supported_Devices.txt new file mode 100644 index 0000000..05a0c30 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/Documentation/Supported_Devices.txt @@ -0,0 +1,2 @@ +Pickering LXI Chassis 65-200-002 +Pickering LXI Multiplexer 65-260-901 \ No newline at end of file diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/SwitchMultiplexerPickering60x.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/SwitchMultiplexerPickering60x.cs new file mode 100644 index 0000000..e3a6360 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/SwitchMultiplexerPickering60x.cs @@ -0,0 +1,510 @@ +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ + +using System; +using NLog; +using Pickering.Lxi.Piplx; +using Raytheon.Common; + +namespace Raytheon.Instruments +{ + /// + /// A Pickering implementation of the IRelaySwitch interface + /// + public class SwitchMultiplexerPickering60x : ISwitch + { + enum SubUnit + { + HiMux, + LoMux, + Switch, + Matrix + } + + #region PrivateMemberVariables + private string _name; + private string _lxiIpAddress; + private bool _isSingleCardMode; + private int _cardNumWithConnectedDmm; + private int _cardStartingIndex = 0; + private int _virtualCardCount = 1; + private int _numBusSelectPerCard = 0; + // Only used to route a closed channel from one card to another card that is connected to DMM to make measurement + // There's no use case for us to be switching between the bus select channels, so we pick one channel to route signals from one card to another + static private int _busSelectMatrixChanNum = 1; + private State _state; + private SelfTestResult _selfTestResult; + private object _syncObj = new Object(); + private PiplxManager _piplxManager; + + private readonly ILogger _logger; + + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; + + #endregion + + #region PrivateFunctions + + /// + /// Close/open relay pair defined in the path + /// + /// The relay to open + private void OperateRelays(string path, bool state) + { + lock (_syncObj) + { + // split path into 2 items. Each item contains channel information + string[] channelArray = path.Split(','); + + if (channelArray.Length != 2) + { + throw new Exception($"Invalid path: {path}. Expected format: [Card_Index].[Switch_Chan_Num],[Card_Index].[Switch_Chan_Num]"); + } + + string channelInfo; + int hiChannelNum = 0; + int loChannelNum = 0; + int hiCardNum = 0; + int loCardNum = 0; + for (int i = 0; i < channelArray.Length; i++) + { + channelInfo = channelArray[i].Trim(); + + string[] itemArray = channelInfo.Split('.'); + + int itemIndex = 0; + if (int.TryParse(itemArray[itemIndex++], out int cardIndex) && int.TryParse(itemArray[itemIndex++], out int channelNum)) + { + if (_isSingleCardMode) + { + if (cardIndex != _cardStartingIndex) + throw new Exception($"Invalid card index: {cardIndex}. Card index can only be 0 when operating in single card mode"); + } + else if (cardIndex < _cardStartingIndex || cardIndex >= _piplxManager.CardsCount) + { + throw new Exception($"Invalid card index: {cardIndex}. Card index can only be between {_cardStartingIndex} and {_piplxManager.CardsCount - 1} when operating in individual card mode"); + } + + // close/open the channel relay + GetSwitchSubUnit(cardIndex).OperateBit(channelNum, state); + + if (i == 0) + { + // close/open Hi mux relay + GetHiMuxSubUnit(cardIndex).OperateBit(channelNum, state); + hiCardNum = cardIndex; + hiChannelNum = channelNum; + } + else + { + // close/open Lo mux relay + GetLoMuxSubUnit(cardIndex).OperateBit(channelNum, state); + loCardNum = cardIndex; + loChannelNum = channelNum; + } + } + else + { + throw new Exception($"Invalid channel information: {channelInfo}. Expected format: [Card_Index].[Switch_Chan_Num]"); + } + } + + if (hiChannelNum > 0 && loChannelNum > 0) + { + if (_isSingleCardMode) + { + // calculate physical number of switching channels per physical card + int phyNumChanPerCard = GetSwitchSubUnit(_cardStartingIndex).BitsCount / (_piplxManager.CardsCount - 1); + + // calculate physical card number for Hi side + int phyHiCardNum = (int)Math.Ceiling((double)hiChannelNum / (double)phyNumChanPerCard); + + // calculate physical card number for Lo side + int phyLoCardNum = (int)Math.Ceiling((double)loChannelNum / (double)phyNumChanPerCard); + + if (phyHiCardNum != _cardNumWithConnectedDmm) + { + // calculate virtual bus select matrix channel on the card that is being switched + int virtualBusSelectMatrixChanNum = (phyHiCardNum * _numBusSelectPerCard) + (_busSelectMatrixChanNum - _numBusSelectPerCard); + + // open/close the bus select channel so we can route the Hi channel from this card to the card connected to the DMM + GetMatrixSubUnit(_cardStartingIndex).OperateCrosspoint(1, virtualBusSelectMatrixChanNum, state); + } + + if (phyLoCardNum != _cardNumWithConnectedDmm) + { + // calculate virtual bus select matrix channel on the card that is being switched + int virtualBusSelectMatrixChanNum = (phyLoCardNum * _numBusSelectPerCard) + (_busSelectMatrixChanNum - _numBusSelectPerCard); + + // open/close the bus select channel so we can route the Lo channel from this card to the card connected to the DMM + GetMatrixSubUnit(_cardStartingIndex).OperateCrosspoint(2, virtualBusSelectMatrixChanNum, state); + } + } + else if (hiCardNum > 0 && loCardNum > 0) + { + if (hiCardNum != _cardNumWithConnectedDmm) + { + // open/close the bus select channel so we can route the Hi channel from this card to the card connected to the DMM + GetMatrixSubUnit(hiCardNum).OperateCrosspoint(1, _busSelectMatrixChanNum, state); + } + + if (loCardNum != _cardNumWithConnectedDmm) + { + // open/close the bus select channel so we can route the Lo channel from this card to the card connected to the DMM + GetMatrixSubUnit(loCardNum).OperateCrosspoint(2, _busSelectMatrixChanNum, state); + } + } + } + } + } + + /// + /// Opens all relays on the card + /// + private void RelayOpenAll() + { + lock (_syncObj) + { + for (int i = _cardStartingIndex; i < _virtualCardCount; i++) + { + if (_piplxManager.Cards[i].IsOpen()) + { + GetHiMuxSubUnit(i).ClearSubunit(); + GetLoMuxSubUnit(i).ClearSubunit(); + GetSwitchSubUnit(i).ClearSubunit(); + GetMatrixSubUnit(i).ClearSubunit(); + } + } + } + } + + /// + /// Get Hi Mux Sub Unit + /// + private MultiplexerSubunit GetHiMuxSubUnit(int cardIndex) + { + return (MultiplexerSubunit)((PiplxCard)_piplxManager.Cards[cardIndex]).OutputSubunits[(int)SubUnit.HiMux]; + } + + /// + /// Get Low Mux Sub Unit + /// + private MultiplexerSubunit GetLoMuxSubUnit(int cardIndex) + { + return (MultiplexerSubunit)((PiplxCard)_piplxManager.Cards[cardIndex]).OutputSubunits[(int)SubUnit.LoMux]; + } + + /// + /// Get Switch Sub Unit + /// + private SwitchSubunit GetSwitchSubUnit(int cardIndex) + { + return (SwitchSubunit)((PiplxCard)_piplxManager.Cards[cardIndex]).OutputSubunits[(int)SubUnit.Switch]; + } + + /// + /// Get Matrix Sub Unit + /// + private MatrixSubunit GetMatrixSubUnit(int cardIndex) + { + return (MatrixSubunit)((PiplxCard)_piplxManager.Cards[cardIndex]).OutputSubunits[(int)SubUnit.Matrix]; + } + + #endregion + + #region PublicFunctions + + /// + /// SwitchMultiplexerPickering60x factory constructor + /// + /// + /// + public SwitchMultiplexerPickering60x(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _lxiIpAddress = _configuration.GetConfigurationValue(Name, "LXI_IP_ADDRESS"); + bool.TryParse(_configuration.GetConfigurationValue(Name, "IS_SINGLE_CARD_MODE"), out _isSingleCardMode); + Int32.TryParse(_configuration.GetConfigurationValue(Name, "CARD_NUMBER_WITH_CONNECTED_DMM"), out _cardNumWithConnectedDmm); + Int32.TryParse(_configuration.GetConfigurationValue(Name, "BUS_SELECT_MATRIX_CHANNEL_NUMBER"), out _busSelectMatrixChanNum); + + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } + + /// + /// The Finalizer + /// + ~SwitchMultiplexerPickering60x() + { + + } + + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + public void Connect(string path) + { + OperateRelays(path, true); + } + + /// + /// + /// + /// + public void Disconnect(string path) + { + OperateRelays(path, false); + } + + /// + /// + /// + public void DisconnectAll() + { + RelayOpenAll(); + } + + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Pickering Switch"; + } + } + + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _piplxManager = new PiplxManager(_lxiIpAddress); + + if (!_isSingleCardMode) + { + _cardStartingIndex = 1; + _virtualCardCount = _piplxManager.CardsCount; + _numBusSelectPerCard = GetMatrixSubUnit(_cardStartingIndex).BitsCount; + } + else + { + // calculate number of bus select channels per card + _numBusSelectPerCard = (GetMatrixSubUnit(_cardStartingIndex).BitsCount / (_piplxManager.CardsCount - 1)) / 2; + } + + if (_busSelectMatrixChanNum < 1 || _busSelectMatrixChanNum > _numBusSelectPerCard) + { + throw new Exception($"Invalid bus select channel: {_busSelectMatrixChanNum}. Number must be between 1 and {_numBusSelectPerCard}"); + } + + if (_cardNumWithConnectedDmm < 1 || _cardNumWithConnectedDmm >= _piplxManager.CardsCount) + { + throw new Exception($"Invalid card number: {_cardNumWithConnectedDmm} for the card that is connected to DMM. Number must be between 1 and {_piplxManager.CardsCount - 1}"); + } + + for (int i = _cardStartingIndex; i < _virtualCardCount; i++) + { + _piplxManager.Cards[i].Open(); + + GetHiMuxSubUnit(i).ClearSubunit(); + GetLoMuxSubUnit(i).ClearSubunit(); + GetSwitchSubUnit(i).ClearSubunit(); + GetMatrixSubUnit(i).ClearSubunit(); + } + + if (_isSingleCardMode) + { + // calculate virtual bus select matrix channel on the card that's connected to the DMM + int virtualBusSelectMatrixChanNum = (_cardNumWithConnectedDmm * _numBusSelectPerCard) + (_busSelectMatrixChanNum - _numBusSelectPerCard); + + // close the bus select relay on the card that is connected to DMM + // so we can route channels on other cards to this card in order to make DMM measurements + // close the Hi channel + GetMatrixSubUnit(_cardStartingIndex).OperateCrosspoint(1, virtualBusSelectMatrixChanNum, true); + // close the Lo channel + GetMatrixSubUnit(_cardStartingIndex).OperateCrosspoint(2, virtualBusSelectMatrixChanNum, true); + } + else + { + // close the bus select relay on the card that is connected to DMM + // so we can route channels on other cards to this card in order to make DMM measurements + // close the Hi channel + GetMatrixSubUnit(_cardNumWithConnectedDmm).OperateCrosspoint(1, _busSelectMatrixChanNum, true); + // close the Lo channel + GetMatrixSubUnit(_cardNumWithConnectedDmm).OperateCrosspoint(2, _busSelectMatrixChanNum, true); + } + + _state = State.Ready; + } + else + { + throw new Exception("Expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } + + /// + /// + /// + public bool IsDebounced + { + get + { + throw new NotImplementedException(); + } + } + + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } + + /// + /// + /// + public void Reset() + { + throw new NotImplementedException(); + } + + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } + + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + RelayOpenAll(); + + for (int i = _cardStartingIndex; i < _virtualCardCount; i++) + { + if (_piplxManager.Cards[i].IsOpen()) + { + _piplxManager.Cards[i].Close(); + } + } + + if (_piplxManager != null && _piplxManager.Connected) + { + _piplxManager.Disconnect(); + } + + _state = State.Uninitialized; + } + } + + #endregion + } +} diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/SwitchMultiplexerPickering60x.csproj b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/SwitchMultiplexerPickering60x.csproj new file mode 100644 index 0000000..fd9abbe --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/SwitchMultiplexerPickering60x.csproj @@ -0,0 +1,43 @@ + + + + net472 + Raytheon.Instruments.SwitchMultiplexerPickering60x + Switch Multiplexer Pickering 60x implementation + Switch Multiplexer Pickering 60x implementation + Library + + + + 1.0.0 + + + + + + + + + + + + + + + ..\..\Common\COTS\Pickering\Pickering.Lxi.Communication.dll + + + ..\..\Common\COTS\Pickering\Pickering.Lxi.Piplx.dll + + + + + + + + + + + + + diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/SwitchMultiplexerPickering60xFactory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/SwitchMultiplexerPickering60xFactory.cs new file mode 100644 index 0000000..03d217f --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchMultiplexerPickering60x/SwitchMultiplexerPickering60xFactory.cs @@ -0,0 +1,131 @@ +// ********************************************************************************************************** +// SwitchMatrixPickering40xFactory.cs +// 2/20/2023 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** + +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Reflection; +using NLog; +using Raytheon.Common; + +namespace Raytheon.Instruments +{ + [ExportInstrumentFactory(ModelNumber = "SwitchMultiplexerPickering60xFactory")] + public class SwitchMultiplexerPickering60xFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); + + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; + + public SwitchMultiplexerPickering60xFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } + + /// + /// SwitchMultiplexerPickering60xFactory injection constructor + /// + [ImportingConstructor] + public SwitchMultiplexerPickering60xFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; + + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchMultiplexerPickering60x(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } + + /// + /// Gets the instrument + /// + /// + /// + public object GetInstrument(string name, bool simulateHw) + { + try + { + if (simulateHw) + return new SwitchSim(name, _configurationManager); + else + return new SwitchMultiplexerPickering60x(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } + + /// + /// Gets supported interfaces + /// + /// + public ICollection GetSupportedInterfaces() + { + return _supportedInterfaces.ToArray(); + } + + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } +} diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchNiPxi/SwitchNiPxi.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchNiPxi/SwitchNiPxi.cs index a5c7241..ad2a3ff 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchNiPxi/SwitchNiPxi.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchNiPxi/SwitchNiPxi.cs @@ -22,339 +22,306 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A simulated implementation of the ISwitch interface. - /// - public class SwitchNiPxi : ISwitch, IDisposable - { - #region PrivateMemberVariables + /// + /// A simulated implementation of the ISwitch interface. + /// + public class SwitchNiPxi : ISwitch, IDisposable + { + #region PrivateMemberVariables - private NISwitch _niSwitch; - private string _name; - private readonly string _address; - private readonly string _topology; - private State _state; - private SelfTestResult _selfTestResult; + private NISwitch _niSwitch; + private string _name; + private readonly string _address; + private readonly string _topology; + private State _state; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// The Finalizer - /// - ~SwitchNiPxi() - { - Dispose(false); - } + #region PrivateFunctions - /// - /// Dispose of this object's resources. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _niSwitch.Utility.Reset(); + /// + /// The Finalizer + /// + ~SwitchNiPxi() + { + Dispose(false); + } - _niSwitch.Close(); + /// + /// Dispose of this object's resources. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _niSwitch.Utility.Reset(); - _niSwitch.Dispose(); + _niSwitch.Close(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _niSwitch.Dispose(); - #endregion + _state = State.Uninitialized; + } + } + } - #region PublicFunctions + #endregion - /// - /// SwitchNiPxi factory constructor - /// - /// - /// - public SwitchNiPxi(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions - _logger = logger; + /// + /// SwitchNiPxi factory constructor + /// + /// + /// + public SwitchNiPxi(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _address = _configuration.GetConfigurationValue("SwitchNiPxi", "Address", ""); - _topology = _configuration.GetConfigurationValue("SwitchNiPxi", "Topology", ""); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _address = _configuration.GetConfigurationValue("SwitchNiPxi", "Address", ""); + _topology = _configuration.GetConfigurationValue("SwitchNiPxi", "Topology", ""); - /// - /// - /// - /// - /// - public SwitchNiPxi(string name, string address, string topology = "") - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _address = address; - _topology = topology; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - // set in Initialize() - _niSwitch = null; + /// + /// + /// + /// + /// + public SwitchNiPxi(string deviceName, string address, string topology = "") + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _address = address; + _topology = topology; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + // set in Initialize() + _niSwitch = null; - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public void Connect(string path) - { - _niSwitch.RelayOperations.RelayControl(path, SwitchRelayAction.CloseRelay); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - public void Disconnect(string path) - { - _niSwitch.RelayOperations.RelayControl(path, SwitchRelayAction.OpenRelay); - } + /// + /// + /// + /// + public void Connect(string path) + { + _niSwitch.RelayOperations.RelayControl(path, SwitchRelayAction.CloseRelay); + } - /// - /// - /// - public void DisconnectAll() - { - _niSwitch.Path.DisconnectAll(); - } + /// + /// + /// + /// + public void Disconnect(string path) + { + _niSwitch.RelayOperations.RelayControl(path, SwitchRelayAction.OpenRelay); + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// + /// + public void DisconnectAll() + { + _niSwitch.Path.DisconnectAll(); + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of this object. + /// + public void Dispose() + { + Dispose(true); - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a NI Switch"; - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a NI Switch"; + } + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + set + { + throw new NotImplementedException(); + } + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool IsDebounced - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - _niSwitch = new NISwitch(_address, _topology, false, true); + /// + /// + /// + public bool IsDebounced + { + get + { + throw new NotImplementedException(); + } + } - //_niSwitch.ModuleCharacteristics.PowerDownLatchingRelaysAfterDebounce + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _niSwitch = new NISwitch(_address, _topology, false, true); - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + //_niSwitch.ModuleCharacteristics.PowerDownLatchingRelaysAfterDebounce - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - Ivi.Driver.SelfTestResult res = _niSwitch.Utility.SelfTest(); + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - if (res.Code != 0) - { - _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; - throw new Exception("self test returned: " + res.Code + "," + res.Message + " on card " + _name); - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + Ivi.Driver.SelfTestResult res = _niSwitch.Utility.SelfTest(); - _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; + if (res.Code != 0) + { + _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; + throw new Exception("self test returned: " + res.Code + "," + res.Message + " on card " + _name); + } - return _selfTestResult; - } + _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; - /// - /// - /// - public void Reset() - { - _niSwitch.Utility.Reset(); - } + return _selfTestResult; + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public void Reset() + { + _niSwitch.Utility.Reset(); + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - _niSwitch.Utility.Reset(); + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - _niSwitch.Close(); + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + _niSwitch.Utility.Reset(); - _niSwitch.Dispose(); + _niSwitch.Close(); - _state = State.Uninitialized; - } - } + _niSwitch.Dispose(); - #endregion - } + _state = State.Uninitialized; + } + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchNiPxi/SwitchNiPxiFactory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchNiPxi/SwitchNiPxiFactory.cs index a02482d..d5ffca1 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchNiPxi/SwitchNiPxiFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchNiPxi/SwitchNiPxiFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SwitchNiPxiFactory")] - public class SwitchNiPxiFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SwitchNiPxiFactory")] + public class SwitchNiPxiFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SwitchNiPxiFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SwitchNiPxiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SwitchNiPxiFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SwitchNiPxiFactory injection constructor + /// + [ImportingConstructor] + public SwitchNiPxiFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISwitch)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SwitchNiPxi(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchNiPxi(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new SwitchSim(name, _configurationManager, _logger); + return new SwitchSim(name, _configurationManager); else - return new SwitchNiPxi(name, _configurationManager, _logger); + return new SwitchNiPxi(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchNise/SwitchNise.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchNise/SwitchNise.cs index ad2d697..5aad219 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchNise/SwitchNise.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchNise/SwitchNise.cs @@ -15,250 +15,246 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; using NLog; using Raytheon.Common; -using System; namespace Raytheon.Instruments { - public class SwitchNise : ISwitch - { - private int _hSession = 0; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + public class SwitchNise : ISwitch + { + private int _hSession = 0; - /// - /// SwitchNise factory constructor - /// - /// - /// - public SwitchNise(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + private readonly ILogger _logger; - _logger = logger; + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + /// + /// SwitchNise factory constructor + /// + /// + /// + public SwitchNise(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - var virtualDeviceName = _configuration.GetConfigurationValue("SwitchNise", "VirtualDeviceName", ""); - string options = _configuration.GetConfigurationValue("SwitchNise", "Options", ""); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - try - { - int status = NiseNativeMethods.niSE_OpenSession(virtualDeviceName, options, out _hSession); - if (status != 0) - { - throw new InstrumentException(string.Format("Could not open NISE session '{0}', error # {1}", virtualDeviceName, status)); - } - } - catch (BadImageFormatException ex) - { - throw new InstrumentException("Possible 32/64-bit issue with NI Switch Executive, see inner exception.", ex); - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - DetailedStatus = ""; - DisplayEnabled = false; - FrontPanelEnabled = false; - Info = new InstrumentMetadata - { - ModelNumber = "NISE" - }; - Name = virtualDeviceName; - SelfTestResult = Raytheon.Instruments.SelfTestResult.Pass; - Status = State.Ready; - } + var virtualDeviceName = _configuration.GetConfigurationValue("SwitchNise", "VirtualDeviceName", ""); + string options = _configuration.GetConfigurationValue("SwitchNise", "Options", ""); - public SwitchNise(string virtualDeviceName) - { - string options = ""; - var status = -123; + try + { + int status = NiseNativeMethods.niSE_OpenSession(virtualDeviceName, options, out _hSession); + if (status != 0) + { + throw new InstrumentException(string.Format("Could not open NISE session '{0}', error # {1}", virtualDeviceName, status)); + } + } + catch (BadImageFormatException ex) + { + throw new InstrumentException("Possible 32/64-bit issue with NI Switch Executive, see inner exception.", ex); + } - _logger = LogManager.GetCurrentClassLogger(); + DetailedStatus = ""; + DisplayEnabled = false; + FrontPanelEnabled = false; + Info = new InstrumentMetadata + { + ModelNumber = "NISE" + }; + Name = virtualDeviceName; + SelfTestResult = Raytheon.Instruments.SelfTestResult.Pass; + Status = State.Ready; + } - try - { - status = NiseNativeMethods.niSE_OpenSession(virtualDeviceName, options, out _hSession); + public SwitchNise(string virtualDeviceName) + { + string options = ""; + var status = -123; - if (status != 0) - { - throw new InstrumentException(string.Format("Could not open NISE session '{0}', error # {1}", virtualDeviceName, status)); - } - } - catch (BadImageFormatException ex) - { - throw new InstrumentException("Possible 32/64-bit issue with NI Switch Executive, see inner exception.", ex); - } + _logger = LogManager.GetLogger($"{this.GetType().Name} - {virtualDeviceName}"); - DetailedStatus = ""; - DisplayEnabled = false; - FrontPanelEnabled = false; - Info = new InstrumentMetadata(); - Info.ModelNumber = "NISE"; - Name = virtualDeviceName; - SelfTestResult = Raytheon.Instruments.SelfTestResult.Pass; - Status = State.Ready; - } + try + { + status = NiseNativeMethods.niSE_OpenSession(virtualDeviceName, options, out _hSession); - public bool ClearErrors() - { - int status = NiseNativeMethods.niSE_ClearError(_hSession); + if (status != 0) + { + throw new InstrumentException(string.Format("Could not open NISE session '{0}', error # {1}", virtualDeviceName, status)); + } + } + catch (BadImageFormatException ex) + { + throw new InstrumentException("Possible 32/64-bit issue with NI Switch Executive, see inner exception.", ex); + } - if (status != 0) - { - Status = State.HardwareFailure; - DetailedStatus = "ClearError failed"; + DetailedStatus = ""; + DisplayEnabled = false; + FrontPanelEnabled = false; + Info = new InstrumentMetadata(); + Info.ModelNumber = "NISE"; + Name = virtualDeviceName; + SelfTestResult = Raytheon.Instruments.SelfTestResult.Pass; + Status = State.Ready; + } - throw new InstrumentException("" + string.Format("Could not clear errors, error # {0}", status)); - } + public bool ClearErrors() + { + int status = NiseNativeMethods.niSE_ClearError(_hSession); - Status = State.Ready; + if (status != 0) + { + Status = State.HardwareFailure; + DetailedStatus = "ClearError failed"; - return true; - } + throw new InstrumentException("" + string.Format("Could not clear errors, error # {0}", status)); + } - public void Connect(string path) - { - int status = NiseNativeMethods.niSE_Connect(_hSession, path, NiseNativeMethods.MulticonnectMode.NoMulticonnect, true); + Status = State.Ready; - if (status != 0) - { - Status = State.HardwareFailure; - DetailedStatus = "Connect failed"; + return true; + } - throw new InstrumentException("" + string.Format("Could not connect '{0}', NISE error # {1}", path, status)); - } - } + public void Connect(string path) + { + int status = NiseNativeMethods.niSE_Connect(_hSession, path, NiseNativeMethods.MulticonnectMode.NoMulticonnect, true); - public string DetailedStatus - { - get; - private set; - } + if (status != 0) + { + Status = State.HardwareFailure; + DetailedStatus = "Connect failed"; - public void Disconnect(string path) - { - int status = NiseNativeMethods.niSE_Disconnect(_hSession, path); + throw new InstrumentException("" + string.Format("Could not connect '{0}', NISE error # {1}", path, status)); + } + } - if (status != 0) - { - throw new InstrumentException(string.Format("" + "Could not disconnect '{0}', NISE error # {1}", path, status)); - } - } + public string DetailedStatus + { + get; + private set; + } - public void DisconnectAll() - { - int status = NiseNativeMethods.niSE_DisconnectAll(_hSession); + public void Disconnect(string path) + { + int status = NiseNativeMethods.niSE_Disconnect(_hSession, path); - if (status != 0) - { - Status = State.HardwareFailure; - DetailedStatus = "DisconnectAll failed"; + if (status != 0) + { + throw new InstrumentException(string.Format("" + "Could not disconnect '{0}', NISE error # {1}", path, status)); + } + } - throw new InstrumentException(string.Format("" + "Could not disconnect all, NISE error # {0}", status)); - } - } + public void DisconnectAll() + { + int status = NiseNativeMethods.niSE_DisconnectAll(_hSession); - //*** consider implementing 'set' to change back to some default value - // not available - public bool DisplayEnabled - { - get; - set; - } + if (status != 0) + { + Status = State.HardwareFailure; + DetailedStatus = "DisconnectAll failed"; - //*** consider implementing 'set' to change back to some default value - // not available - public bool FrontPanelEnabled - { - get; - set; - } + throw new InstrumentException(string.Format("" + "Could not disconnect all, NISE error # {0}", status)); + } + } - public InstrumentMetadata Info - { - get; - private set; - } + //*** consider implementing 'set' to change back to some default value + // not available + public bool DisplayEnabled + { + get; + set; + } - public void Initialize() - { - // do not want to allow user to open another session since they must close each one - // they open. already opened in constructor + //*** consider implementing 'set' to change back to some default value + // not available + public bool FrontPanelEnabled + { + get; + set; + } - ClearErrors(); - } + public InstrumentMetadata Info + { + get; + private set; + } - public bool IsDebounced - { - get - { - bool isDebounced; - int status = NiseNativeMethods.niSE_IsDebounced(_hSession, out isDebounced); + public void Initialize() + { + // do not want to allow user to open another session since they must close each one + // they open. already opened in constructor - if (status != 0) - { - Status = State.HardwareFailure; - DetailedStatus = "IsDebounced failed"; + ClearErrors(); + } - throw new InstrumentException("" + string.Format("Could not check debounce, error # {0}", status)); - } + public bool IsDebounced + { + get + { + bool isDebounced; + int status = NiseNativeMethods.niSE_IsDebounced(_hSession, out isDebounced); - return isDebounced; - } - } + if (status != 0) + { + Status = State.HardwareFailure; + DetailedStatus = "IsDebounced failed"; - public string Name - { - get; - private set; - } + throw new InstrumentException("" + string.Format("Could not check debounce, error # {0}", status)); + } - public SelfTestResult PerformSelfTest() - { - return SelfTestResult.Pass; - } + return isDebounced; + } + } - public void Reset() - { - ClearErrors(); - DisconnectAll(); + public string Name + { + get; + private set; + } - Status = State.Ready; - DetailedStatus = ""; - } + public SelfTestResult PerformSelfTest() + { + return SelfTestResult.Pass; + } - // not available - public SelfTestResult SelfTestResult - { - get; - private set; - } + public void Reset() + { + ClearErrors(); + DisconnectAll(); - public void Shutdown() - { - Int32 status = NiseNativeMethods.niSE_CloseSession(_hSession); + Status = State.Ready; + DetailedStatus = ""; + } - if (status != 0) - { - Status = State.HardwareFailure; - DetailedStatus = "Close failed"; + // not available + public SelfTestResult SelfTestResult + { + get; + private set; + } - throw new InstrumentException("" + string.Format("Could not close NISE session, error # {0}", status)); - } - } + public void Shutdown() + { + Int32 status = NiseNativeMethods.niSE_CloseSession(_hSession); - public State Status - { - get; - private set; - } - } + if (status != 0) + { + Status = State.HardwareFailure; + DetailedStatus = "Close failed"; + + throw new InstrumentException("" + string.Format("Could not close NISE session, error # {0}", status)); + } + } + + public State Status + { + get; + private set; + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchNise/SwitchNiseFactory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchNise/SwitchNiseFactory.cs index f5f1f30..b684146 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchNise/SwitchNiseFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchNise/SwitchNiseFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SwitchNiseFactory")] - public class SwitchNiseFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SwitchNiseFactory")] + public class SwitchNiseFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SwitchNiseFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SwitchNiseFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SwitchNiseFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SwitchNiseFactory injection constructor + /// + [ImportingConstructor] + public SwitchNiseFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISwitch)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SwitchNise(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchNise(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new SwitchSim(name, _configurationManager, _logger); + return new SwitchSim(name, _configurationManager); else - return new SwitchNise(name, _configurationManager, _logger); + return new SwitchNise(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi40_531_Soap/SwitchPickeringLxi40_531_Soap.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi40_531_Soap/SwitchPickeringLxi40_531_Soap.cs index 6059233..9d70fb6 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi40_531_Soap/SwitchPickeringLxi40_531_Soap.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi40_531_Soap/SwitchPickeringLxi40_531_Soap.cs @@ -22,388 +22,354 @@ using SwitchMeasurementInstrumentsLib.Pickering40LxiSoap; namespace Raytheon.Instruments { - /// - /// A Pickering implementation of the IRelaySwitch interface - /// - public class SwitchPickeringLxi40_531_Soap : ISwitch, IDisposable - { - #region PrivateMemberVariables + /// + /// A Pickering implementation of the IRelaySwitch interface + /// + public class SwitchPickeringLxi40_531_Soap : ISwitch, IDisposable + { + #region PrivateMemberVariables - private string _name; - private PiCards _card; - private readonly int _subUnit; - private State _state; - private SelfTestResult _selfTestResult; + private string _name; + private PiCards _card; + private readonly int _subUnit; + private State _state; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// The Finalizer - /// - ~SwitchPickeringLxi40_531_Soap() - { - Dispose(false); - } + #region PrivateFunctions - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _card.ClearAll(); - _card.Dispose(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// The Finalizer + /// + ~SwitchPickeringLxi40_531_Soap() + { + Dispose(false); + } - /// - /// Close a single relay - /// The relay string should be the string form of an integer that represents the bit to close - /// - /// The relay to close - private void RelayClose(string relay) - { - int ret = _card.OpBit(_subUnit, Convert.ToInt32(relay), true); + /// + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _card.ClearAll(); + _card.Dispose(); + _state = State.Uninitialized; + } + } + } - if (ret != 0) - { - throw new Exception("OpBit failed with a ret of: " + ret); - } - } + /// + /// Close a single relay + /// The relay string should be the string form of an integer that represents the bit to close + /// + /// The relay to close + private void RelayClose(string relay) + { + int ret = _card.OpBit(_subUnit, Convert.ToInt32(relay), true); - /// - /// Opens a single relay - /// The relay strings should be the string form of an integer that represents the bit to close - /// - /// The relay to open - private void RelayOpen(string relay) - { - int ret = _card.OpBit(_subUnit, Convert.ToInt32(relay), false); + if (ret != 0) + { + throw new Exception("OpBit failed with a ret of: " + ret); + } + } - if (ret != 0) - { - throw new Exception("OpBit failed with a ret of: " + ret); - } - } + /// + /// Opens a single relay + /// The relay strings should be the string form of an integer that represents the bit to close + /// + /// The relay to open + private void RelayOpen(string relay) + { + int ret = _card.OpBit(_subUnit, Convert.ToInt32(relay), false); - /// - /// Opens all relays on the card - /// - private void RelayOpenAll() - { - int ret = _card.ClearCard(); + if (ret != 0) + { + throw new Exception("OpBit failed with a ret of: " + ret); + } + } - if (ret != 0) - { - throw new Exception("OpBit failed with a ret of: " + ret); - } - } + /// + /// Opens all relays on the card + /// + private void RelayOpenAll() + { + int ret = _card.ClearCard(); - #endregion + if (ret != 0) + { + throw new Exception("OpBit failed with a ret of: " + ret); + } + } - #region PublicFunctions + #endregion - /// - /// SwitchPickeringLxi40_531_Soap factory constructor - /// - /// - /// - public SwitchPickeringLxi40_531_Soap(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions - _logger = logger; + /// + /// SwitchPickeringLxi40_531_Soap factory constructor + /// + /// + /// + public SwitchPickeringLxi40_531_Soap(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - var address = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "Address", "127.0.0.1"); - var deviceNumber = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "DeviceNumber", 0); - var busNumber = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "BusNumber", 0); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _subUnit = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "SubUnit", 0); + var address = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "Address", "127.0.0.1"); + var deviceNumber = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "DeviceNumber", 0); + var busNumber = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "BusNumber", 0); - _card = new PiCards - { - Url = $"http://{address}/bin/picards" - }; + _subUnit = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "SubUnit", 0); - LocationHeader lh = new LocationHeader - { - Slot = deviceNumber, - Bus = busNumber - }; + _card = new PiCards + { + Url = $"http://{address}/bin/picards" + }; - _card.CardLocation = lh; + LocationHeader lh = new LocationHeader + { + Slot = deviceNumber, + Bus = busNumber + }; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _card.CardLocation = lh; - /// - /// - /// - /// - /// - /// - /// - /// - public SwitchPickeringLxi40_531_Soap(string name, string address, int deviceNumber, int busNumber, int subUnit) - { - _name = name; - - _logger = LogManager.GetCurrentClassLogger(); + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - _subUnit = subUnit; + /// + /// + /// + /// + /// + /// + /// + /// + public SwitchPickeringLxi40_531_Soap(string deviceName, string address, int deviceNumber, int busNumber, int subUnit) + { + _name = deviceName; - _card = new PiCards(); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - string tempAddress = "http://" + address + "/bin/picards"; - _card.Url = tempAddress; + _subUnit = subUnit; - LocationHeader lh = new LocationHeader(); - lh.Slot = deviceNumber; - lh.Bus = busNumber; + _card = new PiCards(); - _card.CardLocation = lh; + string tempAddress = "http://" + address + "/bin/picards"; + _card.Url = tempAddress; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + LocationHeader lh = new LocationHeader(); + lh.Slot = deviceNumber; + lh.Bus = busNumber; - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + _card.CardLocation = lh; - /// - /// - /// - /// - public void Connect(string path) - { - RelayClose(path); - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public void Disconnect(string path) - { - RelayOpen(path); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public void DisconnectAll() - { - RelayOpenAll(); - } + /// + /// + /// + /// + public void Connect(string path) + { + RelayClose(path); + } - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// + /// + /// + public void Disconnect(string path) + { + RelayOpen(path); + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// + /// + public void DisconnectAll() + { + RelayOpenAll(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Pickering Switch"; - } - } + /// + /// Dispose of the resources contained by this object + /// + public void Dispose() + { + Dispose(true); - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + GC.SuppressFinalize(this); + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Pickering Switch"; + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - // nothing to initialize here - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool IsDebounced - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool IsDebounced + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Reset() - { - throw new NotImplementedException(); - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public void Reset() + { + throw new NotImplementedException(); + } - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - _card.ClearAll(); - _card.Dispose(); - _state = State.Uninitialized; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - #endregion - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + _card.ClearAll(); + _card.Dispose(); + _state = State.Uninitialized; + } + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi40_531_Soap/SwitchPickeringLxi40_531_SoapFactory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi40_531_Soap/SwitchPickeringLxi40_531_SoapFactory.cs index 4a60ab2..03ef33e 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi40_531_Soap/SwitchPickeringLxi40_531_SoapFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi40_531_Soap/SwitchPickeringLxi40_531_SoapFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SwitchPickeringLxi40_531_SoapFactory")] - public class SwitchPickeringLxi40_531_SoapFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SwitchPickeringLxi40_531_SoapFactory")] + public class SwitchPickeringLxi40_531_SoapFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SwitchPickeringLxi40_531_SoapFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SwitchPickeringLxi40_531_SoapFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SwitchPickeringLxi40_531_SoapFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SwitchPickeringLxi40_531_SoapFactory injection constructor + /// + [ImportingConstructor] + public SwitchPickeringLxi40_531_SoapFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISwitch)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SwitchPickeringLxi40_531_Soap(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchPickeringLxi40_531_Soap(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new SwitchSim(name, _configurationManager, _logger); + return new SwitchSim(name, _configurationManager); else - return new SwitchPickeringLxi40_531_Soap(name, _configurationManager, _logger); + return new SwitchPickeringLxi40_531_Soap(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi60_522_Soap/SwitchPickeringLxi60_522_Soap.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi60_522_Soap/SwitchPickeringLxi60_522_Soap.cs index afc9cd6..0e5e99a 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi60_522_Soap/SwitchPickeringLxi60_522_Soap.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi60_522_Soap/SwitchPickeringLxi60_522_Soap.cs @@ -22,388 +22,353 @@ using SwitchMeasurementInstrumentsLib.Pickering60LxiSoap; namespace Raytheon.Instruments { - /// - /// A Pickering implementation of the IRelaySwitch interface - /// - public class SwitchPickeringLxi60_522_Soap : ISwitch, IDisposable - { - #region PrivateMemberVariables + /// + /// A Pickering implementation of the IRelaySwitch interface + /// + public class SwitchPickeringLxi60_522_Soap : ISwitch, IDisposable + { + #region PrivateMemberVariables - private string _name; - private PiCards _card; - private readonly int _subUnit; - private State _state; - private SelfTestResult _selfTestResult; + private string _name; + private PiCards _card; + private readonly int _subUnit; + private State _state; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// The Finalizer - /// - ~SwitchPickeringLxi60_522_Soap() - { - Dispose(false); - } + #region PrivateFunctions - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _card.ClearAll(); - _card.Dispose(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// The Finalizer + /// + ~SwitchPickeringLxi60_522_Soap() + { + Dispose(false); + } - /// - /// Close a single relay - /// The relay string should be the string form of an integer that represents the bit to close - /// - /// The relay to close - private void RelayClose(string relay) - { - int ret = _card.OpBit(_subUnit, Convert.ToInt32(relay), true); + /// + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _card.ClearAll(); + _card.Dispose(); + _state = State.Uninitialized; + } + } + } - if (ret != 0) - { - throw new Exception("OpBit failed with a ret of: " + ret); - } - } + /// + /// Close a single relay + /// The relay string should be the string form of an integer that represents the bit to close + /// + /// The relay to close + private void RelayClose(string relay) + { + int ret = _card.OpBit(_subUnit, Convert.ToInt32(relay), true); - /// - /// Opens a single relay - /// The relay strings should be the string form of an integer that represents the bit to close - /// - /// The relay to open - private void RelayOpen(string relay) - { - int ret = _card.OpBit(_subUnit, Convert.ToInt32(relay), false); + if (ret != 0) + { + throw new Exception("OpBit failed with a ret of: " + ret); + } + } - if (ret != 0) - { - throw new Exception("OpBit failed with a ret of: " + ret); - } - } + /// + /// Opens a single relay + /// The relay strings should be the string form of an integer that represents the bit to close + /// + /// The relay to open + private void RelayOpen(string relay) + { + int ret = _card.OpBit(_subUnit, Convert.ToInt32(relay), false); - /// - /// Opens all relays on the card - /// - private void RelayOpenAll() - { - int ret = _card.ClearCard(); + if (ret != 0) + { + throw new Exception("OpBit failed with a ret of: " + ret); + } + } - if (ret != 0) - { - throw new Exception("OpBit failed with a ret of: " + ret); - } - } + /// + /// Opens all relays on the card + /// + private void RelayOpenAll() + { + int ret = _card.ClearCard(); - #endregion + if (ret != 0) + { + throw new Exception("OpBit failed with a ret of: " + ret); + } + } - #region PublicFunctions + #endregion - /// - /// SwitchPickeringLxi60_522_Soap factory constructor - /// - /// - /// - public SwitchPickeringLxi60_522_Soap(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions - _logger = logger; + /// + /// SwitchPickeringLxi60_522_Soap factory constructor + /// + /// + /// + public SwitchPickeringLxi60_522_Soap(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - var address = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "Address", "127.0.0.1"); - var deviceNumber = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "DeviceNumber", 0); - var busNumber = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "BusNumber", 0); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _subUnit = _configuration.GetConfigurationValue("SwitchPickeringLxi60_522_Soap", "SubUnit", 0); + var address = _configuration.GetConfigurationValue(Name, Switch.ConfigXml.LXI_IP_ADDRESS.ToString()); + Int64.TryParse(_configuration.GetConfigurationValue(Name, Switch.ConfigXml.DEVICE_NUMBER.ToString()), out long deviceNumber); + Int64.TryParse(_configuration.GetConfigurationValue(Name, Switch.ConfigXml.BUS_NUMBER.ToString()), out long busNumber); + Int32.TryParse(_configuration.GetConfigurationValue(Name, Switch.ConfigXml.SUB_UNIT.ToString()), out _subUnit); - _card = new PiCards - { - Url = $"http://{address}/bin/picards" - }; + _card = new PiCards + { + Url = $"http://{address}/bin/picards" + }; - LocationHeader lh = new LocationHeader - { - Slot = deviceNumber, - Bus = busNumber - }; + LocationHeader lh = new LocationHeader + { + Slot = deviceNumber, + Bus = busNumber + }; - _card.CardLocation = lh; + _card.CardLocation = lh; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - /// - /// - /// - /// - public SwitchPickeringLxi60_522_Soap(string name, string address, int deviceNumber, int busNumber, int subUnit) - { - _name = name; + /// + /// + /// + /// + /// + /// + /// + /// + public SwitchPickeringLxi60_522_Soap(string deviceName, string address, int deviceNumber, int busNumber, int subUnit) + { + _name = deviceName; - _logger = LogManager.GetCurrentClassLogger(); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _subUnit = subUnit; + _subUnit = subUnit; - _card = new PiCards(); + _card = new PiCards(); - string tempAddress = "http://" + address + "/bin/picards"; - _card.Url = tempAddress; + string tempAddress = "http://" + address + "/bin/picards"; + _card.Url = tempAddress; - LocationHeader lh = new LocationHeader(); - lh.Slot = deviceNumber; - lh.Bus = busNumber; + LocationHeader lh = new LocationHeader(); + lh.Slot = deviceNumber; + lh.Bus = busNumber; - _card.CardLocation = lh; + _card.CardLocation = lh; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - public void Connect(string path) - { - RelayClose(path); - } + /// + /// + /// + /// + public void Connect(string path) + { + RelayClose(path); + } - /// - /// - /// - /// - public void Disconnect(string path) - { - RelayOpen(path); - } + /// + /// + /// + /// + public void Disconnect(string path) + { + RelayOpen(path); + } - /// - /// - /// - public void DisconnectAll() - { - RelayOpenAll(); - } + /// + /// + /// + public void DisconnectAll() + { + RelayOpenAll(); + } - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of the resources contained by this object + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Pickering Switch"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Pickering Switch"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - // nothing to initialize here - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - public bool IsDebounced - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool IsDebounced + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - /// - /// - /// - public void Reset() - { - throw new NotImplementedException(); - } + /// + /// + /// + public void Reset() + { + throw new NotImplementedException(); + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - _card.ClearAll(); - _card.Dispose(); - _state = State.Uninitialized; - } - } + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + _card.ClearAll(); + _card.Dispose(); + _state = State.Uninitialized; + } + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi60_522_Soap/SwitchPickeringLxi60_522_SoapFactory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi60_522_Soap/SwitchPickeringLxi60_522_SoapFactory.cs index b1198d7..38e3fef 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi60_522_Soap/SwitchPickeringLxi60_522_SoapFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringLxi60_522_Soap/SwitchPickeringLxi60_522_SoapFactory.cs @@ -31,72 +31,67 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; -using SwitchMeasurementInstrumentsLib; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SwitchPickeringLxi60_522_SoapFactory")] - public class SwitchPickeringLxi60_522_SoapFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SwitchPickeringLxi60_522_SoapFactory")] + public class SwitchPickeringLxi60_522_SoapFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SwitchPickeringLxi60_522_SoapFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SwitchPickeringLxi60_522_SoapFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SwitchPickeringLxi60_522_SoapFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// COECommDeviceInstrumentFactory injection constructor + /// + /// + /// + /// + [ImportingConstructor] + public SwitchPickeringLxi60_522_SoapFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISwitch)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SwitchPickeringLxi60_522_Soap(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchPickeringLxi60_522_Soap(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -107,12 +102,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new SwitchSim(name, _configurationManager, _logger); + return new SwitchSim(name, _configurationManager); else - return new SwitchPickeringLxi60_522_Soap(name, _configurationManager, _logger); + return new SwitchPickeringLxi60_522_Soap(name, _configurationManager); } catch (Exception) { @@ -125,17 +118,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/Documentation/Supported_Devices.txt b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/Documentation/Supported_Devices.txt new file mode 100644 index 0000000..bc2ac25 --- /dev/null +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/Documentation/Supported_Devices.txt @@ -0,0 +1,2 @@ +Pickering Switch Relay 40-156-001 +Pickering Switch Relay 40-137-101 diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/SwitchPickeringPipx40.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/SwitchPickeringPipx40.cs index 46bf42b..cf7154c 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/SwitchPickeringPipx40.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/SwitchPickeringPipx40.cs @@ -23,382 +23,348 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A Pickering implementation of the IRelaySwitch interface - /// - public class SwitchPickeringPipx40 : ISwitch - { - #region PrivateMemberVariables - private readonly int _handle; - private string _name; - private readonly int _subUnit; - private State _state; - private SelfTestResult _selfTestResult; + /// + /// A Pickering implementation of the IRelaySwitch interface + /// + public class SwitchPickeringPipx40 : ISwitch + { + #region PrivateMemberVariables + private readonly int _handle; + private string _name; + private readonly int _subUnit; + private State _state; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// Dispose of the resources contained by this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - RelayOpenAll(); - Pickering.Pipx40.Interop.Pipx40Module.Reset(_handle); - Pickering.Pipx40.Interop.Pipx40Module.Close(_handle); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + #region PrivateFunctions - /// - /// Close a single relay - /// The relay string should be the string form of an integer that represents the bit to close - /// - /// The relay to close - private void RelayClose(string relay) - { - //VI_ON energizes - int ret = Pickering.Pipx40.Interop.Pipx40Module.SetChannelState(_handle, _subUnit, Convert.ToInt32(relay), 1); - //pipx40_operateSwitch - if (ret != 0) - { - throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.SetChannelState() return: " + ret.ToString()); - } - } + /// + /// Dispose of the resources contained by this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + RelayOpenAll(); + Pickering.Pipx40.Interop.Pipx40Module.Reset(_handle); + Pickering.Pipx40.Interop.Pipx40Module.Close(_handle); + _state = State.Uninitialized; + } + } + } - /// - /// Opens a single relay - /// The relay strings should be the string form of an integer that represents the bit to close - /// - /// The relay to open - private void RelayOpen(string relay) - { - //VI_OFF energizes - int ret = Pickering.Pipx40.Interop.Pipx40Module.SetChannelState(_handle, _subUnit, Convert.ToInt32(relay), 0); - //pipx40_operateSwitch - if (ret != 0) - { - throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.SetChannelState() return: " + ret.ToString()); - } - } + /// + /// Close a single relay + /// The relay string should be the string form of an integer that represents the bit to close + /// + /// The relay to close + private void RelayClose(string relay) + { + //VI_ON energizes + int ret = Pickering.Pipx40.Interop.Pipx40Module.SetChannelState(_handle, _subUnit, Convert.ToInt32(relay), 1); + //pipx40_operateSwitch + if (ret != 0) + { + throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.SetChannelState() return: " + ret.ToString()); + } + } - /// - /// Opens all relays on the card - /// - private void RelayOpenAll() - { - Pickering.Pipx40.Interop.Pipx40Module.ClearCard(_handle); + /// + /// Opens a single relay + /// The relay strings should be the string form of an integer that represents the bit to close + /// + /// The relay to open + private void RelayOpen(string relay) + { + //VI_OFF energizes + int ret = Pickering.Pipx40.Interop.Pipx40Module.SetChannelState(_handle, _subUnit, Convert.ToInt32(relay), 0); + //pipx40_operateSwitch + if (ret != 0) + { + throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.SetChannelState() return: " + ret.ToString()); + } + } - //Pickering.Pipx40.Interop.Pipx40Module.ClearSub(_handle, _subUnit); - } + /// + /// Opens all relays on the card + /// + private void RelayOpenAll() + { + Pickering.Pipx40.Interop.Pipx40Module.ClearCard(_handle); - private void SelfTest() - { - SelftestFault stFault = new SelftestFault(); + //Pickering.Pipx40.Interop.Pipx40Module.ClearSub(_handle, _subUnit); + } - StringBuilder message = new StringBuilder(); + private void SelfTest() + { + SelftestFault stFault = new SelftestFault(); - int ret = Pickering.Pipx40.Interop.Pipx40Module.SelfTest(_handle, ref stFault, message); + StringBuilder message = new StringBuilder(); - if (ret != 0) - { - throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.SelfTest() return: " + ret.ToString() + ", " + message.ToString()); - } - } + int ret = Pickering.Pipx40.Interop.Pipx40Module.SelfTest(_handle, ref stFault, message); - #endregion + if (ret != 0) + { + throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.SelfTest() return: " + ret.ToString() + ", " + message.ToString()); + } + } - #region PublicFunctions + #endregion - /// - /// SwitchPickeringPipx40 factory constructor - /// - /// - /// - public SwitchPickeringPipx40(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions - _logger = logger; + /// + /// SwitchPickeringPipx40 factory constructor + /// + /// + /// + public SwitchPickeringPipx40(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _subUnit = _configuration.GetConfigurationValue("SwitchPickeringPipx40", "SubUnit", 0); - - int ret = Pipx40Module.Init(Name, 0, 1, ref _handle); - if (ret != 0) - { - throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.Init() return: " + ret.ToString()); - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _subUnit = _configuration.GetConfigurationValue("SwitchPickeringPipx40", "SubUnit", 0); - /// - /// - /// - /// - /// - /// - public SwitchPickeringPipx40(string name, string address, int subUnit) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _subUnit = subUnit; + int ret = Pipx40Module.Init(Name, 0, 1, ref _handle); + if (ret != 0) + { + throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.Init() return: " + ret.ToString()); + } - int ret = Pipx40Module.Init(name, 0, 1, ref _handle); - if (ret != 0) - { - throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.Init() return: " + ret.ToString()); - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + /// + /// + /// + /// + /// + /// + public SwitchPickeringPipx40(string deviceName, string address, int subUnit) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _subUnit = subUnit; - /// - /// The Finalizer - /// - ~SwitchPickeringPipx40() - { - Dispose(false); - } + int ret = Pipx40Module.Init(deviceName, 0, 1, ref _handle); + if (ret != 0) + { + throw new Exception("Pickering.Pipx40.Interop.Pipx40Module.Init() return: " + ret.ToString()); + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public void Connect(string path) - { - RelayClose(path); - } + /// + /// The Finalizer + /// + ~SwitchPickeringPipx40() + { + Dispose(false); + } - /// - /// - /// - /// - public void Disconnect(string path) - { - RelayOpen(path); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - public void DisconnectAll() - { - RelayOpenAll(); - } + /// + /// + /// + /// + public void Connect(string path) + { + RelayClose(path); + } - /// - /// Dispose of the resources contained by this object - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// + /// + /// + public void Disconnect(string path) + { + RelayOpen(path); + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// + /// + public void DisconnectAll() + { + RelayOpenAll(); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Pickering Switch"; - } - } + /// + /// Dispose of the resources contained by this object + /// + public void Dispose() + { + Dispose(true); - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + GC.SuppressFinalize(this); + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Pickering Switch"; + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - // nothing to initialize here - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool IsDebounced - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool IsDebounced + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Reset() - { - throw new NotImplementedException(); - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public void Reset() + { + throw new NotImplementedException(); + } - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - RelayOpenAll(); - Pickering.Pipx40.Interop.Pipx40Module.Reset(_handle); - Pickering.Pipx40.Interop.Pipx40Module.Close(_handle); - _state = State.Uninitialized; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - #endregion - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } + + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + RelayOpenAll(); + Pickering.Pipx40.Interop.Pipx40Module.Reset(_handle); + Pickering.Pipx40.Interop.Pipx40Module.Close(_handle); + _state = State.Uninitialized; + } + } + + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/SwitchPickeringPipx40Factory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/SwitchPickeringPipx40Factory.cs index 7298bbd..d100c79 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/SwitchPickeringPipx40Factory.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchPickeringPipx40/SwitchPickeringPipx40Factory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SwitchPickeringPipx40Factory")] - public class SwitchPickeringPipx40Factory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SwitchPickeringPipx40Factory")] + public class SwitchPickeringPipx40Factory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SwitchPickeringPipx40Factory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SwitchPickeringPipx40Factory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SwitchPickeringPipx40Factory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SwitchPickeringPipx40Factory injection constructor + /// + [ImportingConstructor] + public SwitchPickeringPipx40Factory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISwitch)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SwitchPickeringPipx40(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchPickeringPipx40(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new SwitchSim(name, _configurationManager, _logger); + return new SwitchSim(name, _configurationManager); else - return new SwitchPickeringPipx40(name, _configurationManager, _logger); + return new SwitchPickeringPipx40(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchSim/SwitchSim.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchSim/SwitchSim.cs index 5d84d2d..5841b44 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchSim/SwitchSim.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchSim/SwitchSim.cs @@ -22,329 +22,287 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// A simulated implementation of the ISwitch interface. - /// - public class SwitchSim : ISwitch - { - #region PrivateMemberVariables + /// + /// A simulated implementation of the ISwitch interface. + /// + public class SwitchSim : ISwitch + { + #region PrivateMemberVariables - private Dictionary _relayStates; - private string _name; - private State _state; - private SelfTestResult _selfTestResult; + private Dictionary _relayStates; + private string _name; + private State _state; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions + #endregion - /// - /// The Finalizer - /// - ~SwitchSim() - { - Dispose(false); - } + #region PrivateFunctions - /// - /// Dispose of this object's resources. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// The Finalizer + /// + ~SwitchSim() + { + Dispose(false); + } - /// - /// Close a relay (simulated). - /// - /// The relay to close. - private void RelayClose(string relay) - { - _relayStates[relay] = true; - } + /// + /// Dispose of this object's resources. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + _state = State.Uninitialized; + } + } + } - /// - /// Open a relay (simulated). - /// - /// The relay to open. - private void RelayOpen(string relay) - { - _relayStates[relay] = false; - } + /// + /// Close a relay (simulated). + /// + /// The relay to close. + private void OperateRelays(string path, bool state) + { + _relayStates[path] = state; + } - /// - /// - /// - private void RelayOpenAll() - { - List keys = new List(_relayStates.Keys); + /// + /// + /// + private void RelayOpenAll() + { + List keys = new List(_relayStates.Keys); - foreach (string key in keys) - { - _relayStates[key] = false; - } - } + foreach (string key in keys) + { + _relayStates[key] = false; + } + } - #endregion + #endregion - #region PublicFunctions + #region PublicFunctions - /// - /// SwitchSim factory constructor - /// - /// - /// - public SwitchSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// SwitchSim factory constructor + /// + /// + /// + public SwitchSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _relayStates = new Dictionary(); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _relayStates = new Dictionary(); + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// Constructor for RelaySwitch card (simulated). - /// - public SwitchSim(string name) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _relayStates = new Dictionary(); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + /// + /// Constructor for RelaySwitch card (simulated). + /// + public SwitchSim(string deviceName) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _relayStates = new Dictionary(); + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// - /// - /// - public void Connect(string path) - { - RelayClose(path); - } + /// + /// + /// + /// + public void Connect(string path) + { + OperateRelays(path, true); + } - /// - /// - /// - /// - public void Disconnect(string path) - { - RelayOpen(path); - } + /// + /// + /// + /// + public void Disconnect(string path) + { + OperateRelays(path, false); + } - /// - /// - /// - public void DisconnectAll() - { - RelayOpenAll(); - } + /// + /// + /// + public void DisconnectAll() + { + RelayOpenAll(); + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this object. + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Sim Switch"; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Sim Switch"; + } + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - set - { - throw new NotImplementedException(); - } - } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public bool IsDebounced - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool IsDebounced + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - /// - /// - /// - public void Reset() - { - } + /// + /// + /// + public void Reset() + { + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// - /// - public void Shutdown() - { - _state = State.Uninitialized; - } + /// + /// + /// + public void Shutdown() + { + _state = State.Uninitialized; + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchSim/SwitchSimFactory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchSim/SwitchSimFactory.cs index 4e5f071..459c01e 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchSim/SwitchSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchSim/SwitchSimFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SwitchSimFactory")] - public class SwitchSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SwitchSimFactory")] + public class SwitchSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SwitchSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SwitchSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SwitchSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SwitchSimFactory injection constructor + /// + [ImportingConstructor] + public SwitchSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISwitch)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SwitchSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,9 +99,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new SwitchSim(name, _configurationManager, _logger); + return new SwitchSim(name, _configurationManager); } catch (Exception) { @@ -121,17 +112,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchVTI/SwitchVTI.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchVTI/SwitchVTI.cs index dacc0eb..d1e6dc1 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchVTI/SwitchVTI.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchVTI/SwitchVTI.cs @@ -23,367 +23,334 @@ //>>*************************************************************************** using System; -using VTI.VTEXSwitch.Interop; using NLog; using Raytheon.Common; +using VTI.VTEXSwitch.Interop; namespace Raytheon.Instruments { - /// - /// This is a class for controlling a VTI EX1200-3001, 5002, 4264 switch card. - /// It only supports individual relay mode at this time. - /// - public class SwitchVTI : ISwitch - { - #region PrivateMemberVariables - private VTEXSwitch _switch; - private string _name; - private readonly string _address; - private readonly string _options; - private State _state; - private SelfTestResult _selfTestResult; + /// + /// This is a class for controlling a VTI EX1200-3001, 5002, 4264 switch card. + /// It only supports individual relay mode at this time. + /// + public class SwitchVTI : ISwitch + { + #region PrivateMemberVariables + private VTEXSwitch _switch; + private string _name; + private readonly string _address; + private readonly string _options; + private State _state; + private SelfTestResult _selfTestResult; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateFunctions - /// - /// Finalizer. - /// - ~SwitchVTI() - { - Dispose(false); - } + #endregion - /// - /// Dispose of this object's resources. - /// - /// True = currently disposing, False = not disposing. - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (_state == State.Ready) - { - Reset(); + #region PrivateFunctions + /// + /// Finalizer. + /// + ~SwitchVTI() + { + Dispose(false); + } - _switch.Close(); + /// + /// Dispose of this object's resources. + /// + /// True = currently disposing, False = not disposing. + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (_state == State.Ready) + { + Reset(); - _state = State.Uninitialized; - } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + _switch.Close(); - /// - /// Perform self-test. - /// - private string SelfTest() - { - int testResult = 0; + _state = State.Uninitialized; + } + } + } - string selfTestMessage = ""; + /// + /// Perform self-test. + /// + private string SelfTest() + { + int testResult = 0; - _switch.Utility.SelfTest(ref testResult, ref selfTestMessage); + string selfTestMessage = ""; - if (testResult != 0) - { - throw new Exception("Self test returned an error code of: " + testResult.ToString() + ", and an error string of: " + selfTestMessage); - } + _switch.Utility.SelfTest(ref testResult, ref selfTestMessage); - return selfTestMessage; - } - #endregion + if (testResult != 0) + { + throw new Exception("Self test returned an error code of: " + testResult.ToString() + ", and an error string of: " + selfTestMessage); + } - #region PublicFunctions + return selfTestMessage; + } + #endregion - /// - /// SwitchVTI factory constructor - /// - /// - /// - public SwitchVTI(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + #region PublicFunctions - _logger = logger; + /// + /// SwitchVTI factory constructor + /// + /// + /// + public SwitchVTI(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _address = _configuration.GetConfigurationValue("SwitchVTI", "Address", ""); - _options = _configuration.GetConfigurationValue("SwitchVTI", "Options", ""); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + _address = _configuration.GetConfigurationValue("SwitchVTI", "Address", ""); + _options = _configuration.GetConfigurationValue("SwitchVTI", "Options", ""); - /// - /// Constructor for RelaySwitch card. - /// - /// The name. - /// The address of the RelaySwitch. - /// The options used for setting up the instrument. - public SwitchVTI(string name, string address, string options) - { - _name = name; - _logger = LogManager.GetCurrentClassLogger(); - _address = address; - _options = options; + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - // created in initialized - _switch = null; + /// + /// Constructor for RelaySwitch card. + /// + /// The name. + /// The address of the RelaySwitch. + /// The options used for setting up the instrument. + public SwitchVTI(string deviceName, string address, string options) + { + _name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _address = address; + _options = options; - _state = State.Uninitialized; - _selfTestResult = SelfTestResult.Unknown; - } + // created in initialized + _switch = null; - /// - /// - /// - /// - public bool ClearErrors() - { - throw new NotImplementedException(); - } + _state = State.Uninitialized; + _selfTestResult = SelfTestResult.Unknown; + } - /// - /// Close a single relay. - /// The COTS library works on string inputs: - /// - Ex Relay: "2!K1" Means card 2 relay 1. - /// - /// The relay to close. - public void Connect(string path) - { - _switch.InstrumentSpecific.CloseRelays(path); - } + /// + /// + /// + /// + public bool ClearErrors() + { + throw new NotImplementedException(); + } - /// - /// Open a single relay. - /// The COTS library works on string inputs: - /// - Ex Relay: "2!K1" Means card 2 relay 1. - /// - /// The relay to open. - public void Disconnect(string path) - { - _switch.InstrumentSpecific.OpenRelays(path); - } + /// + /// Close a single relay. + /// The COTS library works on string inputs: + /// - Ex Relay: "2!K1" Means card 2 relay 1. + /// + /// The relay to close. + public void Connect(string path) + { + _switch.InstrumentSpecific.CloseRelays(path); + } - /// - /// - /// - public void DisconnectAll() - { - string relayList = _switch.InstrumentSpecific.ListOfRelays; + /// + /// Open a single relay. + /// The COTS library works on string inputs: + /// - Ex Relay: "2!K1" Means card 2 relay 1. + /// + /// The relay to open. + public void Disconnect(string path) + { + _switch.InstrumentSpecific.OpenRelays(path); + } - _switch.InstrumentSpecific.OpenRelays(relayList); - } + /// + /// + /// + public void DisconnectAll() + { + string relayList = _switch.InstrumentSpecific.ListOfRelays; - /// - /// Dispose of resources. - /// - public void Dispose() - { - try - { - Dispose(true); + _switch.InstrumentSpecific.OpenRelays(relayList); + } - GC.SuppressFinalize(this); - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of resources. + /// + public void Dispose() + { + Dispose(true); - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a VTI Switch"; - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - throw new NotSupportedException(); - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a VTI Switch"; + } + } - set - { - throw new NotSupportedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + throw new NotSupportedException(); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotSupportedException(); - } + set + { + throw new NotSupportedException(); + } + } - set - { - throw new NotSupportedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotSupportedException(); + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotSupportedException(); - } - } + set + { + throw new NotSupportedException(); + } + } - /// - /// - /// - public void Initialize() - { - if (_state == State.Uninitialized) - { - _switch = new VTEXSwitch(); - _switch.Initialize(_address, false, true, _options); - _state = State.Ready; - } - else - { - throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotSupportedException(); + } + } - /// - /// - /// - public bool IsDebounced - { - get - { - throw new NotSupportedException(); - } - } + /// + /// + /// + public void Initialize() + { + if (_state == State.Uninitialized) + { + _switch = new VTEXSwitch(); + _switch.Initialize(_address, false, true, _options); + _state = State.Ready; + } + else + { + throw new Exception("expected the state to be Uninitialized, state was: " + _state.ToString()); + } + } - /// - /// - /// - public string Name - { - get { return _name; } - set { _name = value; } - } + /// + /// + /// + public bool IsDebounced + { + get + { + throw new NotSupportedException(); + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - int testResult = 0; - string result = ""; - _switch.Utility.SelfTest(ref testResult, ref result); + /// + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } - // Set measurement input to backplane after performing self test. Default is front panel. - // _dmm.Measurement.In = VTEXDmmInputSelectEnum.VTEXDmmInputSelectInternal; + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + int testResult = 0; + string result = ""; + _switch.Utility.SelfTest(ref testResult, ref result); - if (testResult > 0) - { - _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; - throw new Exception("self test failed with an Error Code: " + testResult + " and Error Message: " + result); - } + // Set measurement input to backplane after performing self test. Default is front panel. + // _dmm.Measurement.In = VTEXDmmInputSelectEnum.VTEXDmmInputSelectInternal; - _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; + if (testResult > 0) + { + _selfTestResult = Raytheon.Instruments.SelfTestResult.Fail; + throw new Exception("self test failed with an Error Code: " + testResult + " and Error Message: " + result); + } - return _selfTestResult; - } + _selfTestResult = Raytheon.Instruments.SelfTestResult.Pass; - /// - /// - /// - public void Reset() - { - _switch.Utility.Reset(); - } + return _selfTestResult; + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public void Reset() + { + _switch.Utility.Reset(); + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public void Shutdown() - { - if (_state == State.Ready) - { - Reset(); + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - _switch.Close(); + /// + /// + /// + public void Shutdown() + { + if (_state == State.Ready) + { + Reset(); - _state = State.Uninitialized; - } - } - #endregion - } + _switch.Close(); + + _state = State.Uninitialized; + } + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/Switch/SwitchVTI/SwitchVTIFactory.cs b/Source/TSRealLib/HAL/Implementations/Switch/SwitchVTI/SwitchVTIFactory.cs index 292f45a..2a410b5 100644 --- a/Source/TSRealLib/HAL/Implementations/Switch/SwitchVTI/SwitchVTIFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/Switch/SwitchVTI/SwitchVTIFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "SwitchVTIFactory")] - public class SwitchVTIFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "SwitchVTIFactory")] + public class SwitchVTIFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public SwitchVTIFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public SwitchVTIFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public SwitchVTIFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// SwitchVTIFactory injection constructor + /// + [ImportingConstructor] + public SwitchVTIFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ISwitch)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new SwitchVTI(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ISwitch)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new SwitchVTI(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new SwitchSim(name, _configurationManager, _logger); + return new SwitchSim(name, _configurationManager); else - return new SwitchVTI(name, _configurationManager, _logger); + return new SwitchVTI(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorOmegaM3446/TempMonitorOmegaM3446.cs b/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorOmegaM3446/TempMonitorOmegaM3446.cs index ceb3d3e..9ea36da 100644 --- a/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorOmegaM3446/TempMonitorOmegaM3446.cs +++ b/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorOmegaM3446/TempMonitorOmegaM3446.cs @@ -24,286 +24,253 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// Temperature monitor class used to interact with the M3446 temperature sensor. - /// Parsing assumes Echo mode is turned off (front panel of instrument) - /// - public class TempMonitorOmegaM3446 : ITempMonitor - { - #region PrivateMembers - //Commands - private const string _CARRIAGE_RTN = "\r"; - private const string _TEMP = "*X03"; - private const string _VERSION = "*U03"; + /// + /// Temperature monitor class used to interact with the M3446 temperature sensor. + /// Parsing assumes Echo mode is turned off (front panel of instrument) + /// + public class TempMonitorOmegaM3446 : ITempMonitor + { + #region PrivateMembers + //Commands + private const string _CARRIAGE_RTN = "\r"; + private const string _TEMP = "*X03"; + private const string _VERSION = "*U03"; - //Prevent Collisions - private static object m_sync = new object(); + //Prevent Collisions + private static object m_sync = new object(); - private readonly string _ipAddr; - private readonly int _port; - private const int _READ_BUFFER_SIZE = 128; - private const int _READ_TIMEOUT = 5000; - private byte[] _readBuffer; - private NetworkStream _tcpStream; - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly string _ipAddr; + private readonly int _port; + private const int _READ_BUFFER_SIZE = 128; + private const int _READ_TIMEOUT = 5000; + private byte[] _readBuffer; + private NetworkStream _tcpStream; - public string DetailedStatus => throw new NotImplementedException(); + private readonly ILogger _logger; - public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - public InstrumentMetadata Info => throw new NotImplementedException(); + public string DetailedStatus => throw new NotImplementedException(); - public string Name { get; set; } + public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public SelfTestResult SelfTestResult => throw new NotImplementedException(); + public InstrumentMetadata Info => throw new NotImplementedException(); - public State Status => throw new NotImplementedException(); + public string Name { get; set; } - #endregion + public SelfTestResult SelfTestResult => throw new NotImplementedException(); - #region PrivateFunctions - /// - /// Destructor - /// - ~TempMonitorOmegaM3446() - { - Dispose(false); - } + public State Status => throw new NotImplementedException(); - /// - /// Dispose of this object's resources - /// - /// Currently disposing - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - //Close Connection (if available) - _tcpStream?.Close(); + #endregion - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + #region PrivateFunctions + /// + /// Destructor + /// + ~TempMonitorOmegaM3446() + { + Dispose(false); + } - /// - /// Open socket to the temperature sensor - /// - private void ConnectEthernet() - { - //Create and open a socket to temperature sensor - TcpClient tempSocket = new TcpClient(_ipAddr, _port); - _tcpStream = tempSocket.GetStream(); - _tcpStream.ReadTimeout = _READ_TIMEOUT; - } + /// + /// Dispose of this object's resources + /// + /// Currently disposing + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + //Close Connection (if available) + _tcpStream?.Close(); + } + } + + /// + /// Open socket to the temperature sensor + /// + private void ConnectEthernet() + { + //Create and open a socket to temperature sensor + TcpClient tempSocket = new TcpClient(_ipAddr, _port); + _tcpStream = tempSocket.GetStream(); + _tcpStream.ReadTimeout = _READ_TIMEOUT; + } - /// - /// Get the current version of software loaded on temperature sensor - /// - private void GetSoftwareVersion() - { - lock (m_sync) - { - //Request the software version - string rsp = SendMessageGetResponse(_VERSION); - } - } + /// + /// Get the current version of software loaded on temperature sensor + /// + private void GetSoftwareVersion() + { + lock (m_sync) + { + //Request the software version + string rsp = SendMessageGetResponse(_VERSION); + } + } - /// - /// Send a command to the temperature sensor and request a response - /// - /// Command to send. - /// Response from the temperature sensor. - private string SendMessageGetResponse(string cmd) - { - lock (m_sync) - { - //Format the command before sending - string commandString = cmd + _CARRIAGE_RTN; + /// + /// Send a command to the temperature sensor and request a response + /// + /// Command to send. + /// Response from the temperature sensor. + private string SendMessageGetResponse(string cmd) + { + lock (m_sync) + { + //Format the command before sending + string commandString = cmd + _CARRIAGE_RTN; - //convert to byte array for sending - byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); + //convert to byte array for sending + byte[] commandBuffer = Encoding.ASCII.GetBytes(commandString); - //send the data - _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); + //send the data + _tcpStream.Write(commandBuffer, 0, commandBuffer.Length); - //clear the buffer - Array.Clear(_readBuffer, 0, _readBuffer.Length); + //clear the buffer + Array.Clear(_readBuffer, 0, _readBuffer.Length); - //read from the response buffer - int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); + //read from the response buffer + int numBytesRead = _tcpStream.Read(_readBuffer, 0, _readBuffer.Length); - //convert response to a string - string rspStr = Encoding.ASCII.GetString(_readBuffer); + //convert response to a string + string rspStr = Encoding.ASCII.GetString(_readBuffer); - //Check Response - if (rspStr.Contains(_CARRIAGE_RTN)) - { - char[] delimit = { '\r' }; - string[] parsed = rspStr.Split(delimit, StringSplitOptions.RemoveEmptyEntries); + //Check Response + if (rspStr.Contains(_CARRIAGE_RTN)) + { + char[] delimit = { '\r' }; + string[] parsed = rspStr.Split(delimit, StringSplitOptions.RemoveEmptyEntries); - //Return parsed message - return parsed[0]; - } - else - { - throw new Exception("Command message not successful"); - } - } - } + //Return parsed message + return parsed[0]; + } + else + { + throw new Exception("Command message not successful"); + } + } + } - #endregion + #endregion - #region PublicFunctions + #region PublicFunctions - /// - /// TempMonitorOmegaM3446 factory constructor - /// - /// - /// - public TempMonitorOmegaM3446(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// TempMonitorOmegaM3446 factory constructor + /// + /// + /// + public TempMonitorOmegaM3446(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); - _ipAddr = _configuration.GetConfigurationValue("TempMonitorOmegaM3446", "IpAddr", ""); - _port = _configuration.GetConfigurationValue("TempMonitorOmegaM3446", "Port", 0); + _ipAddr = _configuration.GetConfigurationValue("TempMonitorOmegaM3446", "IpAddr", ""); + _port = _configuration.GetConfigurationValue("TempMonitorOmegaM3446", "Port", 0); - _readBuffer = new byte[_READ_BUFFER_SIZE]; + _readBuffer = new byte[_READ_BUFFER_SIZE]; - //Connect to device - ConnectEthernet(); - } + //Connect to device + ConnectEthernet(); + } - /// - /// Constructor for the temperature sensor - /// - /// the name - /// IP Address of the equipment - /// Port of the equipment - public TempMonitorOmegaM3446(string name, string ipAddress, int port) - { - Name = name; - _logger = LogManager.GetCurrentClassLogger(); - _ipAddr = ipAddress; - _port = port; + /// + /// Constructor for the temperature sensor + /// + /// the name + /// IP Address of the equipment + /// Port of the equipment + public TempMonitorOmegaM3446(string deviceName, string ipAddress, int port) + { + Name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + _ipAddr = ipAddress; + _port = port; - //Initialize read buffer - _readBuffer = new byte[_READ_BUFFER_SIZE]; + //Initialize read buffer + _readBuffer = new byte[_READ_BUFFER_SIZE]; - ConnectEthernet(); - } + ConnectEthernet(); + } - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public TempMonitorOmegaM3446(string name, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public TempMonitorOmegaM3446(string name, string comPortName, uint delayBeforeReadMs, int baudRate = 115200, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One) + { + throw new NotImplementedException(); + } - // This code added to correctly implement the disposable pattern. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] - public void Dispose() - { - try - { - lock (m_sync) - { - Dispose(true); + // This code added to correctly implement the disposable pattern. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] + public void Dispose() + { + lock (m_sync) + { + Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } + } - /// - /// Returns the current temperature read by temperature sensor - /// - /// The current Temperature reading - public double ReadTemperature() - { - lock (m_sync) - { - //Request current temp reading - string rsp = SendMessageGetResponse(_TEMP); + /// + /// Returns the current temperature read by temperature sensor + /// + /// The current Temperature reading + public double ReadTemperature() + { + lock (m_sync) + { + //Request current temp reading + string rsp = SendMessageGetResponse(_TEMP); - return double.Parse(rsp); - } - } + return double.Parse(rsp); + } + } - public bool ClearErrors() - { - throw new NotImplementedException(); - } + public bool ClearErrors() + { + throw new NotImplementedException(); + } - public void Initialize() - { - throw new NotImplementedException(); - } + public void Initialize() + { + throw new NotImplementedException(); + } - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - public void Reset() - { - throw new NotImplementedException(); - } + public void Reset() + { + throw new NotImplementedException(); + } - public void Shutdown() - { - throw new NotImplementedException(); - } + public void Shutdown() + { + throw new NotImplementedException(); + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorOmegaM3446/TempMonitorOmegaM3446Factory.cs b/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorOmegaM3446/TempMonitorOmegaM3446Factory.cs index aa9d310..5fc90ab 100644 --- a/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorOmegaM3446/TempMonitorOmegaM3446Factory.cs +++ b/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorOmegaM3446/TempMonitorOmegaM3446Factory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "TempMonitorOmegaM3446Factory")] - public class TempMonitorOmegaM3446Factory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "TempMonitorOmegaM3446Factory")] + public class TempMonitorOmegaM3446Factory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public TempMonitorOmegaM3446Factory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public TempMonitorOmegaM3446Factory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public TempMonitorOmegaM3446Factory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// TempMonitorOmegaM3446Factory injection constructor + /// + [ImportingConstructor] + public TempMonitorOmegaM3446Factory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ITempMonitor)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new TempMonitorOmegaM3446(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ITempMonitor)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new TempMonitorOmegaM3446(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,12 +98,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new TempMonitorSim(name, _configurationManager, _logger); + return new TempMonitorSim(name, _configurationManager); else - return new TempMonitorOmegaM3446(name, _configurationManager, _logger); + return new TempMonitorOmegaM3446(name, _configurationManager); } catch (Exception) { @@ -123,17 +114,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorSim/TempMonitorSim.cs b/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorSim/TempMonitorSim.cs index 8a4cb9c..a264680 100644 --- a/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorSim/TempMonitorSim.cs +++ b/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorSim/TempMonitorSim.cs @@ -22,182 +22,145 @@ using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// Temperature monitor class used to interact with the temperature sensor. - /// - public class TempMonitorSim : ITempMonitor - { - #region PrivateMembers + /// + /// Temperature monitor class used to interact with the temperature sensor. + /// + public class TempMonitorSim : ITempMonitor + { + #region PrivateMembers - private static object m_sync = new object(); + private object m_sync = new object(); - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - public string DetailedStatus => throw new NotImplementedException(); + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public string DetailedStatus => throw new NotImplementedException(); - public InstrumentMetadata Info => throw new NotImplementedException(); + public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public string Name { get; set; } + public InstrumentMetadata Info => throw new NotImplementedException(); - public SelfTestResult SelfTestResult => throw new NotImplementedException(); + public string Name { get; set; } - public State Status => throw new NotImplementedException(); + public SelfTestResult SelfTestResult => throw new NotImplementedException(); - #endregion + public State Status => throw new NotImplementedException(); - #region PrivateFunctions - /// - /// Destructor - /// - ~TempMonitorSim() - { - Dispose(false); - } + #endregion - /// - /// Dispose of this object's resources - /// - /// Currently disposing - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { + #region PrivateFunctions + /// + /// Destructor + /// + ~TempMonitorSim() + { + Dispose(false); + } - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of this object's resources + /// + /// Currently disposing + protected virtual void Dispose(bool disposing) + { + } - #endregion + #endregion - #region PublicFunctions + #region PublicFunctions - /// - /// TempMonitorSim factory constructor - /// - /// - /// - public TempMonitorSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// TempMonitorSim factory constructor + /// + /// + /// + public TempMonitorSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _logger = logger; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + } - /// - /// Constructor for the temperature sensor - /// - /// the name - /// IP Address of the equipment - /// Port of the equipment - public TempMonitorSim(string name) - { - Name = name; - _logger = LogManager.GetCurrentClassLogger(); - } + /// + /// Constructor for the temperature sensor + /// + /// the name + /// IP Address of the equipment + /// Port of the equipment + public TempMonitorSim(string deviceName) + { + Name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + } - // This code added to correctly implement the disposable pattern. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] - public void Dispose() - { - try - { - lock (m_sync) - { - Dispose(true); + // This code added to correctly implement the disposable pattern. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] + public void Dispose() + { + lock (m_sync) + { + Dispose(true); - GC.SuppressFinalize(this); - } - } - catch (Exception) - { - try - { - //ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } + } - /// - /// Returns the current temperature read by temperature sensor - /// - /// The current Temperature reading - public double ReadTemperature() - { - lock (m_sync) - { - double max = 20.0; + /// + /// Returns the current temperature read by temperature sensor + /// + /// The current Temperature reading + public double ReadTemperature() + { + lock (m_sync) + { + double max = 20.0; - double min = 30.0; + double min = 30.0; - Random rnd = new Random(); + Random rnd = new Random(); - double seed = rnd.NextDouble(); + double seed = rnd.NextDouble(); - double dataToReturn = (seed * (max - min)) + min; + double dataToReturn = (seed * (max - min)) + min; - Thread.Sleep(100); + Thread.Sleep(100); - return dataToReturn; - } - } + return dataToReturn; + } + } - public bool ClearErrors() - { - throw new NotImplementedException(); - } + public bool ClearErrors() + { + throw new NotImplementedException(); + } - public void Initialize() - { - throw new NotImplementedException(); - } + public void Initialize() + { + throw new NotImplementedException(); + } - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - public void Reset() - { - throw new NotImplementedException(); - } + public void Reset() + { + throw new NotImplementedException(); + } - public void Shutdown() - { - throw new NotImplementedException(); - } + public void Shutdown() + { + throw new NotImplementedException(); + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorSim/TempMonitorSimFactory.cs b/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorSim/TempMonitorSimFactory.cs index 09e396a..57a669b 100644 --- a/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorSim/TempMonitorSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/TempMonitor/TempMonitorSim/TempMonitorSimFactory.cs @@ -30,71 +30,64 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "TempMonitorSimFactory")] - public class TempMonitorSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "TempMonitorSimFactory")] + public class TempMonitorSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public TempMonitorSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public TempMonitorSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public TempMonitorSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// TempMonitorSimFactory injection constructor + /// + [ImportingConstructor] + public TempMonitorSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ITempMonitor)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new TempMonitorSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ITempMonitor)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new TempMonitorSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -105,9 +98,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new TempMonitorSim(name, _configurationManager, _logger); + return new TempMonitorSim(name, _configurationManager); } catch (Exception) { @@ -120,17 +111,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderSim/VideoRecorderSim.cs b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderSim/VideoRecorderSim.cs index 4eb78bc..b5998b9 100644 --- a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderSim/VideoRecorderSim.cs +++ b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderSim/VideoRecorderSim.cs @@ -15,11 +15,11 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; using System; using System.IO; using System.Threading; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { @@ -27,270 +27,237 @@ namespace Raytheon.Instruments /// A simulated video recorder ///
public class VideoRecorderSim : IVideoRecorder - { - #region PrivateClassMembers - private const string _SIM_VIDEO_FILE_NAME = "SimVideo"; - private string _lastGrabFileName; + { + #region PrivateClassMembers + private const string _SIM_VIDEO_FILE_NAME = "SimVideo"; + private string _lastGrabFileName; - public string DetailedStatus { get; protected set; } + public string DetailedStatus { get; protected set; } - public bool DisplayEnabled { get; set; } - public bool FrontPanelEnabled { get; set; } + public bool DisplayEnabled { get; set; } + public bool FrontPanelEnabled { get; set; } - public InstrumentMetadata Info { get; set; } + public InstrumentMetadata Info { get; set; } - public string Name { get; protected set; } + public string Name { get; protected set; } - public SelfTestResult SelfTestResult => PerformSelfTest(); + public SelfTestResult SelfTestResult => PerformSelfTest(); - public State Status { get; set; } + public State Status { get; set; } - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; + private readonly ILogger _logger; - #endregion + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - #region PrivateClassFunctions - /// - /// The Finalizer - /// - ~VideoRecorderSim() - { - Dispose(false); - } + #endregion - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - Disconnect(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion + #region PrivateClassFunctions + /// + /// The Finalizer + /// + ~VideoRecorderSim() + { + Dispose(false); + } - #region PublicClassFunctions - /// - /// VideoRecorderSim factory constructor - /// - /// - /// - public VideoRecorderSim(string deviceName, IConfigurationManager configurationManager, ILogger logger) - { - Name = deviceName; + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + Disconnect(); + } + } + #endregion - _logger = logger; + #region PublicClassFunctions + /// + /// VideoRecorderSim factory constructor + /// + /// + /// + public VideoRecorderSim(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - } - /// - /// The sim constructor - /// - public VideoRecorderSim() - { - _lastGrabFileName = ""; - _logger = LogManager.GetCurrentClassLogger(); - } + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); - /// - /// - /// - /// - /// - public void AddNcdfAttributes(string videoFile, string attributeFile) - { - Thread.Sleep(1000); - } + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + } + /// + /// The sim constructor + /// + public VideoRecorderSim() + { + _lastGrabFileName = ""; + _logger = LogManager.GetCurrentClassLogger(); + } - /// - /// - /// - public void Connect() - { - Thread.Sleep(1000); - } + /// + /// + /// + /// + /// + public void AddNcdfAttributes(string videoFile, string attributeFile) + { + Thread.Sleep(1000); + } - /// - /// - /// - public void Disconnect() - { - Thread.Sleep(1000); - } + /// + /// + /// + public void Connect() + { + Thread.Sleep(1000); + } - /// - /// Dispose of this object - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// + /// + public void Disconnect() + { + Thread.Sleep(1000); + } - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// Dispose of this object + /// + public void Dispose() + { + Dispose(true); - /// - /// This will create an empty video file in the user temp folder - /// - /// - /// - public void GrabVideoToDisk(uint numberOfFrames, VideoSaveFormat format) - { - Thread.Sleep(1000); + GC.SuppressFinalize(this); + } - // create a dummy file - string tempDirectory = Path.GetTempPath(); + /// + /// This will create an empty video file in the user temp folder + /// + /// + /// + public void GrabVideoToDisk(uint numberOfFrames, VideoSaveFormat format) + { + Thread.Sleep(1000); - string time = Util.GetTimeString(); + // create a dummy file + string tempDirectory = Path.GetTempPath(); - if (format == VideoSaveFormat.BIN) - { - tempDirectory += time + _SIM_VIDEO_FILE_NAME + ".bin"; - } - else if (format == VideoSaveFormat.NCDF) - { - tempDirectory += time + _SIM_VIDEO_FILE_NAME + ".ncdf"; - } - else - { - throw new Exception("UnhandledExceptionEventArgs save format" + format); - } + string time = Util.GetTimeString(); - string simFileName = tempDirectory; + if (format == VideoSaveFormat.BIN) + { + tempDirectory += time + _SIM_VIDEO_FILE_NAME + ".bin"; + } + else if (format == VideoSaveFormat.NCDF) + { + tempDirectory += time + _SIM_VIDEO_FILE_NAME + ".ncdf"; + } + else + { + throw new Exception("UnhandledExceptionEventArgs save format" + format); + } - File.Create(simFileName); + string simFileName = tempDirectory; - _lastGrabFileName = simFileName; - } + File.Create(simFileName); - /// - /// - /// - /// The number of free Gigabytes - /// The number of free Gigabytes - /// The number of free Gigabytes - /// The number of free Gigabytes - public void QueryHardDrive(ref float driveSpace1, ref float driveSpace2, ref float driveSpace3, ref float driveSpace4) - { - const float FREE_SPACE_IN_GB = 10.0f; - const float FULL_IN_GB = 0.0f; + _lastGrabFileName = simFileName; + } - driveSpace1 = FREE_SPACE_IN_GB; - driveSpace2 = FULL_IN_GB; - driveSpace3 = FULL_IN_GB; - driveSpace4 = FULL_IN_GB; - } + /// + /// + /// + /// The number of free Gigabytes + /// The number of free Gigabytes + /// The number of free Gigabytes + /// The number of free Gigabytes + public void QueryHardDrive(ref float driveSpace1, ref float driveSpace2, ref float driveSpace3, ref float driveSpace4) + { + const float FREE_SPACE_IN_GB = 10.0f; + const float FULL_IN_GB = 0.0f; - /// - /// - /// - /// - /// - /// - public void MoveFile(string fromFile, string toFile, MoveControl control) - { - File.Move(fromFile, toFile); - } + driveSpace1 = FREE_SPACE_IN_GB; + driveSpace2 = FULL_IN_GB; + driveSpace3 = FULL_IN_GB; + driveSpace4 = FULL_IN_GB; + } - /// - /// - /// - public void ShowLiveVideo() - { - Thread.Sleep(1000); - } + /// + /// + /// + /// + /// + /// + public void MoveFile(string fromFile, string toFile, MoveControl control) + { + File.Move(fromFile, toFile); + } - /// - /// - /// - public void StopLiveVideo() - { - Thread.Sleep(1000); - } + /// + /// + /// + public void ShowLiveVideo() + { + Thread.Sleep(1000); + } - /// - /// This will return the file created by GrabVideoToDisk() - /// - /// - /// - public string WaitForGrabToComplete(int timeoutms) - { - Thread.Sleep(1000); + /// + /// + /// + public void StopLiveVideo() + { + Thread.Sleep(1000); + } - // return the last file that was created, and clear the last file name for the next time - string lastFileName = _lastGrabFileName; - _lastGrabFileName = ""; - return lastFileName; - } + /// + /// This will return the file created by GrabVideoToDisk() + /// + /// + /// + public string WaitForGrabToComplete(int timeoutms) + { + Thread.Sleep(1000); - public bool ClearErrors() - { - return false; - } + // return the last file that was created, and clear the last file name for the next time + string lastFileName = _lastGrabFileName; + _lastGrabFileName = ""; + return lastFileName; + } - public void Initialize() - { - } + public bool ClearErrors() + { + return false; + } - public SelfTestResult PerformSelfTest() - { - return SelfTestResult.Unknown; - } + public void Initialize() + { + } - public void Reset() - { - Shutdown(); - Initialize(); - } + public SelfTestResult PerformSelfTest() + { + return SelfTestResult.Unknown; + } - public void Shutdown() - { - Disconnect(); - Dispose(); - } + public void Reset() + { + Shutdown(); + Initialize(); + } - public byte[] GetSmallVideoFrame(string name, int nFrames, bool sensor, ref uint numBytesRead, bool deleteVideoFile) - { - return new byte[1024]; - } - #endregion - } + public void Shutdown() + { + Disconnect(); + Dispose(); + } + + public byte[] GetSmallVideoFrame(string name, int nFrames, bool sensor, ref uint numBytesRead, bool deleteVideoFile) + { + return new byte[1024]; + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderSim/VideoRecorderSimFactory.cs b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderSim/VideoRecorderSimFactory.cs index d222f04..7cc13d7 100644 --- a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderSim/VideoRecorderSimFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderSim/VideoRecorderSimFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "VideoRecorderSimFactory")] - public class VideoRecorderSimFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "VideoRecorderSimFactory")] + public class VideoRecorderSimFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public VideoRecorderSimFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public VideoRecorderSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public VideoRecorderSimFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// VideoRecorderSimFactory injection constructor + /// + [ImportingConstructor] + public VideoRecorderSimFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(IVideoRecorder)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new VideoRecorderSim(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(IVideoRecorder)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new VideoRecorderSim(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,9 +99,7 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - - return new VideoRecorderSim(name, _configurationManager, _logger); + return new VideoRecorderSim(name, _configurationManager); } catch (Exception) { @@ -121,17 +112,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/Lib/CommDeviceNode.cs b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/Lib/CommDeviceNode.cs index 710b041..e528f9d 100644 --- a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/Lib/CommDeviceNode.cs +++ b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/Lib/CommDeviceNode.cs @@ -15,357 +15,315 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Common; - using System; using System.Threading; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// An interface to sending/receiving data over comm devices - /// - internal class CommDeviceNode : ICommDevice, IDisposable - { - #region PrivateClassMembers - private ICommDevice _commDevice; - private IWorkerInterface _socketReadWorker; - private Thread _socketReadThread; - private readonly string _name; - private SelfTestResult _selfTestResult; - private State _state; + /// + /// An interface to sending/receiving data over comm devices + /// + internal class CommDeviceNode : ICommDevice, IDisposable + { + #region PrivateClassMembers + private ICommDevice _commDevice; + private IWorkerInterface _socketReadWorker; + private Thread _socketReadThread; + private readonly string _name; + private SelfTestResult _selfTestResult; + private State _state; - private uint _commReadWorkerBufferSize; - private uint _readWorkerRestTimeInMs; - private MsgDevice _msgHandler; + private uint _commReadWorkerBufferSize; + private uint _readWorkerRestTimeInMs; + private MsgDevice _msgHandler; + private readonly ILogger _logger; + #endregion - #endregion - - #region PrivateFuctions - /// - /// The finalizer. Necessary for quitting the read thread - /// - ~CommDeviceNode() - { - Dispose(false); - } + #region PrivateFuctions + /// + /// The finalizer. Necessary for quitting the read thread + /// + ~CommDeviceNode() + { + Dispose(false); + } - /// - /// Quit the threads associated with the node - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - State initialState = _state; + /// + /// Quit the threads associated with the node + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + State initialState = _state; - // close the socket and threads - try - { - if (initialState == State.Ready) - { - Shutdown(); - _commDevice.Shutdown(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + // close the socket and threads + if (initialState == State.Ready) + { + Shutdown(); + _commDevice.Shutdown(); + } - // dispose of the resources - try - { - if (initialState == State.Ready) - { - _socketReadWorker.Dispose(); - _state = State.Uninitialized; - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + if (initialState == State.Ready) + { + _socketReadWorker.Dispose(); + _state = State.Uninitialized; + } + } + } - #endregion + #endregion - #region PublicFuctions + #region PublicFuctions - /// - /// The constructor - /// - /// The name of this instance - /// The communication device - /// The message handler for this interface - /// The number of bytes for the buffer internal to this class. Each individual read will read upto this buffer size (or until the timeout happens) - /// Number of ms to reset between read calls on the comm interface - public CommDeviceNode(string name, ICommDevice commDevice, MsgDevice msgHandler, uint commReadWorkerBufferSize = 100000, uint readWorkerRestTimeInMs = 10) - { - _name = name; - _commDevice = commDevice; - - _commReadWorkerBufferSize = commReadWorkerBufferSize; - _readWorkerRestTimeInMs = readWorkerRestTimeInMs; - _msgHandler = msgHandler; + /// + /// The constructor + /// + /// The name of this instance + /// The communication device + /// The message handler for this interface + /// The number of bytes for the buffer internal to this class. Each individual read will read upto this buffer size (or until the timeout happens) + /// Number of ms to reset between read calls on the comm interface + public CommDeviceNode(string name, ICommDevice commDevice, MsgDevice msgHandler, uint commReadWorkerBufferSize = 100000, uint readWorkerRestTimeInMs = 10) + { + _logger = LogManager.GetCurrentClassLogger(); + _name = name; + _commDevice = commDevice; - Open(); - } + _commReadWorkerBufferSize = commReadWorkerBufferSize; + _readWorkerRestTimeInMs = readWorkerRestTimeInMs; + _msgHandler = msgHandler; - /// - /// Starts communication thread - /// - public void Open() - { - _socketReadWorker = new CommReadWorker(this, _msgHandler, _commReadWorkerBufferSize, _readWorkerRestTimeInMs); - _socketReadThread = new Thread(_socketReadWorker.DoWork); + Open(); + } - // start the read thread - _socketReadThread.Start(); + /// + /// Starts communication thread + /// + public void Open() + { + _socketReadWorker = new CommReadWorker(this, _msgHandler, _commReadWorkerBufferSize, _readWorkerRestTimeInMs); + _socketReadThread = new Thread(_socketReadWorker.DoWork); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + // start the read thread + _socketReadThread.Start(); + + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } - /// - /// there is no error msg repository - /// - /// - public bool ClearErrors() - { - return false; - } + /// + /// there is no error msg repository + /// + /// + public bool ClearErrors() + { + return false; + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Comm Sim Device Node " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Comm Sim Device Node " + _name; + } + } - /// - /// - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - _commDevice.Initialize(); - _state = State.Ready; - } + /// + /// + /// + public void Initialize() + { + _commDevice.Initialize(); + _state = State.Ready; + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - /// - /// Read data from the socket - /// - /// The data that was read - /// the number of bytes read - public uint Read(ref byte[] dataRead) - { - return _commDevice.Read(ref dataRead); - } + /// + /// Read data from the socket + /// + /// The data that was read + /// the number of bytes read + public uint Read(ref byte[] dataRead) + { + return _commDevice.Read(ref dataRead); + } - /// - /// Resets communications - /// - public void Reset() - { - Close(); - Open(); - } + /// + /// Resets communications + /// + public void Reset() + { + Close(); + Open(); + } - /// - /// - /// - /// - public void SetReadTimeout(uint readTimeout) - { - _commDevice.SetReadTimeout(readTimeout); - } + /// + /// + /// + /// + public void SetReadTimeout(uint readTimeout) + { + _commDevice.SetReadTimeout(readTimeout); + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// Close communications - /// - public void Close() - { - Shutdown(); - } + /// + /// Close communications + /// + public void Close() + { + Shutdown(); + } - /// - /// Close communications - /// - public void Shutdown() - { - if (_state == State.Ready) - { - const int THREAD_QUIT_TIMEOUT_MS = 3000; + /// + /// Close communications + /// + public void Shutdown() + { + if (_state == State.Ready) + { + const int THREAD_QUIT_TIMEOUT_MS = 3000; - // tell the thread to quit - _socketReadWorker.QuitWork(); + // tell the thread to quit + _socketReadWorker.QuitWork(); - // close the socket which the thread might be blocked on - _commDevice.Shutdown(); + // close the socket which the thread might be blocked on + _commDevice.Shutdown(); - if (_socketReadThread.IsAlive) - { - bool didThreadQuit = _socketReadThread.Join(THREAD_QUIT_TIMEOUT_MS); + if (_socketReadThread.IsAlive) + { + bool didThreadQuit = _socketReadThread.Join(THREAD_QUIT_TIMEOUT_MS); - if (didThreadQuit == false) - { - ErrorLogger.Instance().Write("CommDeviceNode::Close() - Logging Thread did not quit as expected, aborting it"); - _socketReadThread.Abort(); - } - else - { - ErrorLogger.Instance().Write("CommDeviceNode::Close() - Logging Thread quit successfully after join", ErrorLogger.LogLevel.INFO); - } - } - else - { - ErrorLogger.Instance().Write("CommDeviceNode::Close() - Logging Thread quit successfully", ErrorLogger.LogLevel.INFO); - } - } + if (didThreadQuit == false) + { + _logger.Debug("Logging Thread did not quit as expected, aborting it"); + _socketReadThread.Abort(); + } + else + { + _logger.Debug("Logging Thread quit successfully after join"); + } + } + else + { + _logger.Debug("Logging Thread quit successfully"); + } + } - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - /// - /// Send data on the socket - /// - /// The data to send - /// The number of bytes to write from the dataToSend buffer - /// The number of bytes sent - public uint Write(byte[] dataToSend, uint numBytesToWrite) - { - return _commDevice.Write(dataToSend, numBytesToWrite); - } + /// + /// Send data on the socket + /// + /// The data to send + /// The number of bytes to write from the dataToSend buffer + /// The number of bytes sent + public uint Write(byte[] dataToSend, uint numBytesToWrite) + { + return _commDevice.Write(dataToSend, numBytesToWrite); + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/Lib/CommReadWorker.cs b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/Lib/CommReadWorker.cs index 2e8b1ef..f03e4ef 100644 --- a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/Lib/CommReadWorker.cs +++ b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/Lib/CommReadWorker.cs @@ -17,8 +17,7 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. using System; using System.Threading; -using System.Net.Sockets; -using Raytheon.Instruments; +using NLog; using Raytheon.Common; namespace Raytheon.Instruments @@ -35,6 +34,7 @@ namespace Raytheon.Instruments private AutoResetEvent _quitEvent; private byte[] _dataRead; private readonly uint _timeToRestBetweenReadsInMs; + private readonly ILogger _logger; #endregion #region PublicFuctions @@ -48,6 +48,7 @@ namespace Raytheon.Instruments /// Number of ms to rest after a read call public CommReadWorker(ICommDevice commNode, MsgDevice msghandler, uint bufferSize, uint timeToRestBetweenReadsInMs) { + _logger = LogManager.GetCurrentClassLogger(); _commNode = commNode; _threadQuitControl = false; _msgHandler = msghandler; @@ -69,23 +70,9 @@ namespace Raytheon.Instruments ///
public void Dispose() { - try - { - Dispose(true); + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + GC.SuppressFinalize(this); } /// @@ -110,33 +97,14 @@ namespace Raytheon.Instruments // not using timeToRestBetweenReadsInMs. Just going to wait 1 ms and get back to the read if (_quitEvent.WaitOne(1)) { - ErrorLogger.Instance().Write("CommReadWorker::DoWork() - received signal to quit", ErrorLogger.LogLevel.INFO); + _logger.Debug("received signal to quit"); _threadQuitControl = true; } } - catch (SocketException e) - { - if (e.SocketErrorCode == SocketError.TimedOut) - { - //expected - } - else - { - ErrorLogger.Instance().Write("CommReadWorker::DoWork() - " + e.Message, ErrorLogger.LogLevel.ERROR); - } - } - catch (Exception e) - { - ErrorLogger.Instance().Write("CommReadWorker::DoWork() - " + e.Message, ErrorLogger.LogLevel.ERROR); - } + catch { } } - - ErrorLogger.Instance().Write("CommReadWorker::DoWork() - exiting", ErrorLogger.LogLevel.INFO); - } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); } + catch { } } /// @@ -154,23 +122,9 @@ namespace Raytheon.Instruments /// protected virtual void Dispose(bool disposing) { - try + if (disposing) { - if (disposing) - { - _quitEvent.Dispose(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } + _quitEvent.Dispose(); } } #endregion diff --git a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/MessageHandler/VrsClientMsgHandler.cs b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/MessageHandler/VrsClientMsgHandler.cs index 11a5eeb..cebfc76 100644 --- a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/MessageHandler/VrsClientMsgHandler.cs +++ b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/MessageHandler/VrsClientMsgHandler.cs @@ -15,9 +15,10 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Common; using System; using System.Collections.Generic; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { @@ -29,6 +30,7 @@ namespace Raytheon.Instruments #region PrivateClassMembers private Dictionary> _messageHandlerMap; private ICommDevice _commInterface; + private readonly ILogger _logger; #endregion #region PrivateClassFunctions @@ -42,17 +44,14 @@ namespace Raytheon.Instruments { try { - ErrorLogger.Instance().Write("VrsClientMsgHandler::HandleAddAttributesRspMsg() - beginning", ErrorLogger.LogLevel.INFO); + _logger.Debug("beginning"); VrsAddAttributesRspMessage msg = new VrsAddAttributesRspMessage(false); msg.Parse(pData); msg.ExecuteMsg(); AutomationRxMsgBuffer.Instance().AddMsg(msg); } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } + catch { } return true; } @@ -65,17 +64,14 @@ namespace Raytheon.Instruments { try { - ErrorLogger.Instance().Write("VrsClientMsgHandler::HandleConnectRspMsg() - beginning", ErrorLogger.LogLevel.INFO); + _logger.Debug("beginning"); VrsConnectRspMessage msg = new VrsConnectRspMessage(false); msg.Parse(pData); msg.ExecuteMsg(); AutomationRxMsgBuffer.Instance().AddMsg(msg); } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } + catch { } return true; } @@ -89,17 +85,14 @@ namespace Raytheon.Instruments { try { - ErrorLogger.Instance().Write("VrsClientMsgHandler::HandleDisconnectRspMsg() - beginning", ErrorLogger.LogLevel.INFO); + _logger.Debug("beginning"); VrsDisconnectRspMessage msg = new VrsDisconnectRspMessage(false); msg.Parse(pData); msg.ExecuteMsg(); AutomationRxMsgBuffer.Instance().AddMsg(msg); } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } + catch { } return true; } @@ -112,17 +105,14 @@ namespace Raytheon.Instruments { try { - ErrorLogger.Instance().Write("VrsClientMsgHandler::HandleGrabToDiskRspMsg() - beginning", ErrorLogger.LogLevel.INFO); + _logger.Debug("beginning"); VrsGrabToDiskRspMessage msg = new VrsGrabToDiskRspMessage(false); msg.Parse(pData); msg.ExecuteMsg(); AutomationRxMsgBuffer.Instance().AddMsg(msg); } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } + catch { } return true; } @@ -136,17 +126,14 @@ namespace Raytheon.Instruments { try { - ErrorLogger.Instance().Write("VrsClientMsgHandler::HandleGrabToDiskCompleteRspMsg() - beginning", ErrorLogger.LogLevel.INFO); + _logger.Debug("beginning"); VrsGrabToDiskCompleteRspMessage msg = new VrsGrabToDiskCompleteRspMessage(false, ""); msg.Parse(pData); msg.ExecuteMsg(); AutomationRxMsgBuffer.Instance().AddMsg(msg); } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } + catch { } return true; } @@ -160,17 +147,14 @@ namespace Raytheon.Instruments { try { - ErrorLogger.Instance().Write("VrsClientMsgHandler::HandleMoveFileRspMsg() - beginning", ErrorLogger.LogLevel.INFO); + _logger.Debug("beginning"); VrsMoveFileRspMessage msg = new VrsMoveFileRspMessage(false); msg.Parse(pData); msg.ExecuteMsg(); AutomationRxMsgBuffer.Instance().AddMsg(msg); } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } + catch { } return true; } @@ -184,17 +168,14 @@ namespace Raytheon.Instruments { try { - ErrorLogger.Instance().Write("VrsClientMsgHandler::HandleQueryDiskRspMsg() - beginning", ErrorLogger.LogLevel.INFO); + _logger.Debug("beginning"); VrsQueryHardDriveRspMessage msg = new VrsQueryHardDriveRspMessage(false, 0, 0, 0, 0); msg.Parse(pData); msg.ExecuteMsg(); AutomationRxMsgBuffer.Instance().AddMsg(msg); } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } + catch { } return true; } @@ -208,17 +189,14 @@ namespace Raytheon.Instruments { try { - ErrorLogger.Instance().Write("VrsClientMsgHandler::HandleStopLiveVideoRspMsg() - beginning", ErrorLogger.LogLevel.INFO); + _logger.Debug("beginning"); VrStopLiveVideoRspMessage msg = new VrStopLiveVideoRspMessage(false); msg.Parse(pData); msg.ExecuteMsg(); AutomationRxMsgBuffer.Instance().AddMsg(msg); } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } + catch { } return true; } @@ -232,17 +210,14 @@ namespace Raytheon.Instruments { try { - ErrorLogger.Instance().Write("VrsClientMsgHandler::HandleShowLiveVideoRspMsg() - beginning", ErrorLogger.LogLevel.INFO); + _logger.Debug("beginning"); VrShowLiveVideoRspMessage msg = new VrShowLiveVideoRspMessage(false); msg.Parse(pData); msg.ExecuteMsg(); AutomationRxMsgBuffer.Instance().AddMsg(msg); } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } + catch { } return true; } @@ -257,6 +232,8 @@ namespace Raytheon.Instruments unsafe public VrsClientMsgHandler(uint bufferSize) : base(new VrsMsgParser(), bufferSize) { + _logger = LogManager.GetCurrentClassLogger(); + _commInterface = null; // set the callback @@ -304,7 +281,7 @@ namespace Raytheon.Instruments { if (_messageHandlerMap.ContainsKey(msgId) == false) { - ErrorLogger.Instance().Write("VrsClientMsgHandler::OnCompleteMessage() - detected unknown msg id: " + msgId.ToString()); + _logger.Warn("VrsClientMsgHandler::OnCompleteMessage() - detected unknown msg id: " + msgId.ToString()); } else { diff --git a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/MessageHandler/VrsMsgParser.cs b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/MessageHandler/VrsMsgParser.cs index b0d942b..794f854 100644 --- a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/MessageHandler/VrsMsgParser.cs +++ b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/MessageHandler/VrsMsgParser.cs @@ -15,9 +15,10 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Common; using System; using System.Collections.Generic; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { @@ -30,6 +31,7 @@ namespace Raytheon.Instruments #region PrivateClassMembers private List _messageList; private AutomationMessageHeader _header; + private readonly ILogger _logger; #endregion #region PublicClassFunctions @@ -39,6 +41,8 @@ namespace Raytheon.Instruments /// public VrsMsgParser() { + _logger = LogManager.GetCurrentClassLogger(); + _messageList = new List(); _messageList.Add((uint)VrsAutomationMsgIds.VRS_CONNECT_CMD); _messageList.Add((uint)VrsAutomationMsgIds.VRS_CONNECT_RSP); @@ -78,7 +82,7 @@ namespace Raytheon.Instruments // check to see if we have enough data for at least a header if (numBytesInPdata < AutomationMessageHeader.HEADER_EXPECTED_SIZE) { - ErrorLogger.Instance().Write("VrsMsgParser::run() - not enough data in the buffer to form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes", ErrorLogger.LogLevel.INFO); + _logger.Debug("not enough data in the buffer to form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes"); bytesToRemove = 0; return false; } @@ -91,8 +95,8 @@ namespace Raytheon.Instruments // do we have this message in our messageSizeMap_ dictionary? if (_messageList.Contains(_header.GetMessageId()) == false) { - string msg = "VrsMsgParser::run() - unknown id received: " + Convert.ToString(_header.GetMessageId()); - ErrorLogger.Instance().Write(msg, ErrorLogger.LogLevel.ERROR); + string msg = "unknown id received: " + Convert.ToString(_header.GetMessageId()); + _logger.Warn(msg); bytesToRemove = totalMsgSize; // move on to next message return false; } diff --git a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/VideoRecorderVrsClient.cs b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/VideoRecorderVrsClient.cs index e1460d0..837da80 100644 --- a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/VideoRecorderVrsClient.cs +++ b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/VideoRecorderVrsClient.cs @@ -18,10 +18,10 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. // Ignore Spelling: Ncdf -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { @@ -29,490 +29,440 @@ namespace Raytheon.Instruments /// The interface for the test controller to automate the VRS system /// public class VideoRecorderVrsClient : IVideoRecorder - { - #region PrivateClassMembers - private readonly string _remoteAddress; - private readonly int _remotePort; - private readonly int _localPort; - private readonly CommDeviceNode _udpNode; - private readonly ICommDevice _commDevice; - private readonly uint _parseBufferSize; - private static readonly object _syncObj = new Object(); - /// - /// NLog logger - /// - private readonly ILogger _logger; - /// - /// Raytheon configuration - /// - private readonly IConfigurationManager _configurationManager; - private readonly IConfiguration _configuration; - - public string DetailedStatus => throw new NotImplementedException(); - - public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - - public InstrumentMetadata Info => throw new NotImplementedException(); - - public string Name { get; set; } - - public SelfTestResult SelfTestResult => throw new NotImplementedException(); - - public State Status => throw new NotImplementedException(); - #endregion - - #region PrivateClassFunctions - - /// - /// The Finalizer - /// - ~VideoRecorderVrsClient() - { - Dispose(false); - } - - /// - /// Dispose of this object - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - Disconnect(); - _commDevice.Shutdown(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - - try - { - if (disposing) - { - _udpNode.Dispose(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion - - #region PublicClassFunctions - - /// - /// The constructor - /// - /// The remote computer address - /// The remote computer port - /// the local computer port - /// the parse buffer size in bytes - public VideoRecorderVrsClient(string remoteAddress, int remotePort, int localPort, uint parseBufferSize) - { - _logger = LogManager.GetCurrentClassLogger(); - - // init error logger singleton - ErrorLogger.Instance().Write("beginning", ErrorLogger.LogLevel.INFO); - - _remoteAddress = remoteAddress; - - _remotePort = remotePort; - - _localPort = localPort; - - _parseBufferSize = parseBufferSize; - - List msgIds = new List(); - - foreach (uint id in Enum.GetValues(typeof(VrsAutomationMsgIds))) - { - msgIds.Add(id); - } - - AutomationRxMsgBuffer.Instance(msgIds); - - VrsClientMsgHandler msghandler = new VrsClientMsgHandler(_parseBufferSize); - - _commDevice = new CommDeviceUdp("CommDeviceUdp", _localPort, _remotePort, _remoteAddress); - - _udpNode = new CommDeviceNode("CommDeviceNode", _commDevice, msghandler); - - msghandler.SetCommInterface(_udpNode); - } - - /// - /// updated constructor - /// - /// - /// - /// - public VideoRecorderVrsClient(string name, IConfigurationManager configurationManager, ILogger logger) - { - Name = name; - _logger = logger; - - _configurationManager = configurationManager; - _configuration = _configurationManager.GetConfiguration(Name); - - _remoteAddress = _configuration.GetConfigurationValue("VideoRecorderVrsClient", "RemoteAddress", "127.0.0.1"); - _remotePort = _configuration.GetConfigurationValue("VideoRecorderVrsClient", "RemotePort", 0); - _localPort = _configuration.GetConfigurationValue("VideoRecorderVrsClient", "LocalPort", 0); - _parseBufferSize = _configuration.GetConfigurationValue("VideoRecorderVrsClient", "LocalPort", 1024); - - List msgIds = new List(); - foreach (uint id in Enum.GetValues(typeof(VrsAutomationMsgIds))) - { - msgIds.Add(id); - } - - AutomationRxMsgBuffer.Instance(msgIds); - - VrsClientMsgHandler msghandler = new VrsClientMsgHandler(_parseBufferSize); - - _commDevice = new CommDeviceUdp("CommDeviceUdp", _localPort, _remotePort, _remoteAddress); - _udpNode = new CommDeviceNode("CommDeviceNode", _commDevice, msghandler); - - msghandler.SetCommInterface(_udpNode); - } - - /// - /// Send a message to the VRS and command it to add ncdf attributes to a video file - /// - /// The video file to add attributes to - /// The attribute file - public void AddNcdfAttributes(string videoFile, string attributeFile) - { - lock (_syncObj) - { - AutomationMessage addAttributesMsg = new VrsAddAttributesCmdMessage(videoFile, attributeFile); - - AutomationMessage addAttributesRspMsg = new VrsAddAttributesRspMessage(false); - - CommUtil.Instance().SendCommandGetResponse(_udpNode, addAttributesMsg, ref addAttributesRspMsg); - - VrsAddAttributesRspMessage tempRsp = (VrsAddAttributesRspMessage)addAttributesRspMsg; - - bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); - - ErrorLogger.Instance().Write("init complete", ErrorLogger.LogLevel.INFO); - - if (wasConnectMsgSuccessful == false) - { - throw new Exception("VrsAddAttributesRspMessage returned a successful flag of false"); - } - } - } - - /// - /// Connect to the VRS system - /// - public void Connect() - { - lock (_syncObj) - { - // send the vrs a message just to make sure the two apps are talking - AutomationMessage connectMsg = new VrsConnectCmdMessage(); + { + #region PrivateClassMembers + private readonly string _remoteAddress; + private readonly int _remotePort; + private readonly int _localPort; + private readonly CommDeviceNode _udpNode; + private readonly ICommDevice _commDevice; + private readonly uint _parseBufferSize; + private static readonly object _syncObj = new Object(); - AutomationMessage connectRspMsg = new VrsConnectRspMessage(false); + private readonly ILogger _logger; - CommUtil.Instance().SendCommandGetResponse(_udpNode, connectMsg, ref connectRspMsg); + private readonly IConfigurationManager _configurationManager; + private readonly IConfiguration _configuration; - VrsConnectRspMessage tempRsp = (VrsConnectRspMessage)connectRspMsg; - - bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); - - ErrorLogger.Instance().Write("init complete", ErrorLogger.LogLevel.INFO); - - if (wasConnectMsgSuccessful == false) - { - throw new Exception("VrsConnectRspMessage returned a successful flag of false"); - } - } - } - - /// - /// Disconnect from the VRS - /// - public void Disconnect() - { - lock (_syncObj) - { - // send the vrs a message just to make sure the two apps are talking - AutomationMessage disconnectMsg = new VrsDisconnectCmdMessage(); - - AutomationMessage disconnectRspMsg = new VrsDisconnectRspMessage(false); - - CommUtil.Instance().SendCommandGetResponse(_udpNode, disconnectMsg, ref disconnectRspMsg); - - VrsDisconnectRspMessage tempRsp = (VrsDisconnectRspMessage)disconnectRspMsg; - - bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); - - ErrorLogger.Instance().Write("init complete", ErrorLogger.LogLevel.INFO); - - if (wasConnectMsgSuccessful == false) - { - throw new Exception("VrsDisconnectRspMessage returned a successful flag of false"); - } - } - } - - /// - /// Dispose of this object - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// record video to the VRS hard drive. This function returns once the grab has begun, Use WaitForGrabToComplete() to know when the grab is completed - /// - /// The number of frames to grab - /// The save file format - public void GrabVideoToDisk(uint numberOfFrames, VideoSaveFormat format) - { - const int RSP_TIMEOUT = 20000; - - lock (_syncObj) - { - //reset the event for WaitForGrabComplete - AutomationRxMsgBuffer.Instance().ResetRxEvent((uint)VrsAutomationMsgIds.VRS_GRAB_TO_DISK_COMPLETE_RSP); - - // send the vrs a message just to make sure the two apps are talking - AutomationMessage grabCmd = new VrsGrabToDiskCmdMessage(numberOfFrames, format); - - AutomationMessage grabRsp = new VrsGrabToDiskRspMessage(false); - - CommUtil.Instance().SendCommandGetResponse(_udpNode, grabCmd, ref grabRsp, RSP_TIMEOUT); - - VrsGrabToDiskRspMessage tempRsp = (VrsGrabToDiskRspMessage)grabRsp; - - bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); - - ErrorLogger.Instance().Write("init complete", ErrorLogger.LogLevel.INFO); - - if (wasConnectMsgSuccessful == false) - { - throw new Exception("VrsGrabToDiskRspMessage returned a successful flag of false"); - } - } - } - - /// - /// Get the number of GB free on the VRS system. - /// - /// Drive 1 free space in GBs - /// Drive 2 free space in GBs - /// Drive 3 free space in GBs - /// Drive 4 free space in GBs - public void QueryHardDrive(ref float driveSpace1, ref float driveSpace2, ref float driveSpace3, ref float driveSpace4) - { - lock (_syncObj) - { - // send the vrs a message just to make sure the two apps are talking - AutomationMessage msg = new VrsQueryHardDriveCmdMessage(); - - AutomationMessage rsp = new VrsQueryHardDriveRspMessage(false, 0, 0, 0, 0); - - CommUtil.Instance().SendCommandGetResponse(_udpNode, msg, ref rsp); - - VrsQueryHardDriveRspMessage tempRsp = (VrsQueryHardDriveRspMessage)rsp; - - bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); - - ErrorLogger.Instance().Write("init complete", ErrorLogger.LogLevel.INFO); - - if (wasConnectMsgSuccessful == false) - { - throw new Exception("VrsQueryHardDriveRspMessage returned a successful flag of false"); - } - - tempRsp.GetDriveSpace(ref driveSpace1, ref driveSpace2, ref driveSpace3, ref driveSpace4); - } - } - - /// - /// Moves a file from one location to another - /// - /// - /// - /// - public void MoveFile(string fromFile, string toFile, MoveControl control) - { - lock (_syncObj) - { - // send the vrs a message just to make sure the two apps are talking - AutomationMessage cmd = new VrsMoveFileCmdMessage(fromFile, toFile, control); - - AutomationMessage rsp = new VrsMoveFileRspMessage(false); - - CommUtil.Instance().SendCommandGetResponse(_udpNode, cmd, ref rsp); - - VrsMoveFileRspMessage tempRsp = (VrsMoveFileRspMessage)rsp; - - bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); - - if (wasConnectMsgSuccessful == false) - { - throw new Exception("VrsMoveFileRspMessage returned a successful flag of false"); - } - } - } - - /// - /// Start displaying live video on the VRS - /// - public void ShowLiveVideo() - { - lock (_syncObj) - { - // send the vrs a message just to make sure the two apps are talking - AutomationMessage cmd = new VrShowLiveVideoCmdMessage(); - - AutomationMessage rsp = new VrShowLiveVideoRspMessage(false); - - CommUtil.Instance().SendCommandGetResponse(_udpNode, cmd, ref rsp); - - VrShowLiveVideoRspMessage tempRsp = (VrShowLiveVideoRspMessage)rsp; - - bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); - - ErrorLogger.Instance().Write("init complete", ErrorLogger.LogLevel.INFO); - - if (wasConnectMsgSuccessful == false) - { - throw new Exception("VrShowLiveVideoRspMessage returned a successful flag of false"); - } - } - } - - /// - /// Stop displaying video on the VRS - /// - public void StopLiveVideo() - { - lock (_syncObj) - { - // send the vrs a message just to make sure the two apps are talking - AutomationMessage cmd = new VrStopLiveVideoCmdMessage(); - - AutomationMessage rsp = new VrStopLiveVideoRspMessage(false); - - CommUtil.Instance().SendCommandGetResponse(_udpNode, cmd, ref rsp); - - VrStopLiveVideoRspMessage tempRsp = (VrStopLiveVideoRspMessage)rsp; - - bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); - - ErrorLogger.Instance().Write("init complete", ErrorLogger.LogLevel.INFO); - - if (wasConnectMsgSuccessful == false) - { - throw new Exception("VrStopLiveVideoRspMessage returned a successful flag of false"); - } - } - } - - /// - /// A blocking function that waits for a video capture to complete - /// - /// - /// - public string WaitForGrabToComplete(int timeoutms) - { - lock (_syncObj) - { - bool didWeGetRsp = AutomationRxMsgBuffer.Instance().WaitForRspMsg((uint)VrsAutomationMsgIds.VRS_GRAB_TO_DISK_COMPLETE_RSP, timeoutms); - - if (didWeGetRsp == true) - { - VrsGrabToDiskCompleteRspMessage rsp = (VrsGrabToDiskCompleteRspMessage)AutomationRxMsgBuffer.Instance().GetNewestMessage((uint)VrsAutomationMsgIds.VRS_GRAB_TO_DISK_COMPLETE_RSP); - - return rsp.GetFileName(); - } - else - { - throw new Exception("Timed out waiting for response"); - } - } - } - - public bool ClearErrors() - { - return false; - } - - public void Initialize() - { - throw new NotImplementedException(); - } - - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } - - /// - /// - /// - public void Reset() - { - Disconnect(); - - Connect(); - } - - /// - /// - /// - /// - public void Shutdown() - { - Dispose(true); - } - - public byte[] GetSmallVideoFrame(string name, int nFrames, bool sensor, ref uint numBytesRead, bool deleteVideoFile) - { - throw new NotImplementedException(); - } - #endregion - } + public string DetailedStatus => throw new NotImplementedException(); + + public bool DisplayEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool FrontPanelEnabled { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public InstrumentMetadata Info => throw new NotImplementedException(); + + public string Name { get; set; } + + public SelfTestResult SelfTestResult => throw new NotImplementedException(); + + public State Status => throw new NotImplementedException(); + #endregion + + #region PrivateClassFunctions + + /// + /// The Finalizer + /// + ~VideoRecorderVrsClient() + { + Dispose(false); + } + + /// + /// Dispose of this object + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + Disconnect(); + _commDevice.Shutdown(); + _udpNode.Dispose(); + } + } + #endregion + + #region PublicClassFunctions + + /// + /// The constructor + /// + /// The remote computer address + /// The remote computer port + /// the local computer port + /// the parse buffer size in bytes + public VideoRecorderVrsClient(string remoteAddress, int remotePort, int localPort, uint parseBufferSize) + { + _logger = LogManager.GetCurrentClassLogger(); + + // init error logger singleton + _logger.Debug("beginning"); + + _remoteAddress = remoteAddress; + + _remotePort = remotePort; + + _localPort = localPort; + + _parseBufferSize = parseBufferSize; + + List msgIds = new List(); + + foreach (uint id in Enum.GetValues(typeof(VrsAutomationMsgIds))) + { + msgIds.Add(id); + } + + AutomationRxMsgBuffer.Instance(msgIds); + + VrsClientMsgHandler msghandler = new VrsClientMsgHandler(_parseBufferSize); + + _commDevice = new CommDeviceUdp("CommDeviceUdp", _localPort, _remotePort, _remoteAddress); + + _udpNode = new CommDeviceNode("CommDeviceNode", _commDevice, msghandler); + + msghandler.SetCommInterface(_udpNode); + } + + /// + /// updated constructor + /// + /// + /// + /// + public VideoRecorderVrsClient(string deviceName, IConfigurationManager configurationManager) + { + Name = deviceName; + _logger = LogManager.GetLogger($"{this.GetType().Name} - {deviceName}"); + + _configurationManager = configurationManager; + _configuration = _configurationManager.GetConfiguration(Name); + + _remoteAddress = _configuration.GetConfigurationValue("VideoRecorderVrsClient", "RemoteAddress", "127.0.0.1"); + _remotePort = _configuration.GetConfigurationValue("VideoRecorderVrsClient", "RemotePort", 0); + _localPort = _configuration.GetConfigurationValue("VideoRecorderVrsClient", "LocalPort", 0); + _parseBufferSize = _configuration.GetConfigurationValue("VideoRecorderVrsClient", "LocalPort", 1024); + + List msgIds = new List(); + foreach (uint id in Enum.GetValues(typeof(VrsAutomationMsgIds))) + { + msgIds.Add(id); + } + + AutomationRxMsgBuffer.Instance(msgIds); + + VrsClientMsgHandler msghandler = new VrsClientMsgHandler(_parseBufferSize); + + _commDevice = new CommDeviceUdp("CommDeviceUdp", _localPort, _remotePort, _remoteAddress); + _udpNode = new CommDeviceNode("CommDeviceNode", _commDevice, msghandler); + + msghandler.SetCommInterface(_udpNode); + } + + /// + /// Send a message to the VRS and command it to add ncdf attributes to a video file + /// + /// The video file to add attributes to + /// The attribute file + public void AddNcdfAttributes(string videoFile, string attributeFile) + { + lock (_syncObj) + { + AutomationMessage addAttributesMsg = new VrsAddAttributesCmdMessage(videoFile, attributeFile); + + AutomationMessage addAttributesRspMsg = new VrsAddAttributesRspMessage(false); + + CommUtil.Instance().SendCommandGetResponse(_udpNode, addAttributesMsg, ref addAttributesRspMsg); + + VrsAddAttributesRspMessage tempRsp = (VrsAddAttributesRspMessage)addAttributesRspMsg; + + bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); + + _logger.Debug("init complete"); + + if (wasConnectMsgSuccessful == false) + { + throw new Exception("VrsAddAttributesRspMessage returned a successful flag of false"); + } + } + } + + /// + /// Connect to the VRS system + /// + public void Connect() + { + lock (_syncObj) + { + // send the vrs a message just to make sure the two apps are talking + AutomationMessage connectMsg = new VrsConnectCmdMessage(); + + AutomationMessage connectRspMsg = new VrsConnectRspMessage(false); + + CommUtil.Instance().SendCommandGetResponse(_udpNode, connectMsg, ref connectRspMsg); + + VrsConnectRspMessage tempRsp = (VrsConnectRspMessage)connectRspMsg; + + bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); + + _logger.Debug("init complete"); + + if (wasConnectMsgSuccessful == false) + { + throw new Exception("VrsConnectRspMessage returned a successful flag of false"); + } + } + } + + /// + /// Disconnect from the VRS + /// + public void Disconnect() + { + lock (_syncObj) + { + // send the vrs a message just to make sure the two apps are talking + AutomationMessage disconnectMsg = new VrsDisconnectCmdMessage(); + + AutomationMessage disconnectRspMsg = new VrsDisconnectRspMessage(false); + + CommUtil.Instance().SendCommandGetResponse(_udpNode, disconnectMsg, ref disconnectRspMsg); + + VrsDisconnectRspMessage tempRsp = (VrsDisconnectRspMessage)disconnectRspMsg; + + bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); + + _logger.Debug("init complete"); + + if (wasConnectMsgSuccessful == false) + { + throw new Exception("VrsDisconnectRspMessage returned a successful flag of false"); + } + } + } + + /// + /// Dispose of this object + /// + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + /// + /// record video to the VRS hard drive. This function returns once the grab has begun, Use WaitForGrabToComplete() to know when the grab is completed + /// + /// The number of frames to grab + /// The save file format + public void GrabVideoToDisk(uint numberOfFrames, VideoSaveFormat format) + { + const int RSP_TIMEOUT = 20000; + + lock (_syncObj) + { + //reset the event for WaitForGrabComplete + AutomationRxMsgBuffer.Instance().ResetRxEvent((uint)VrsAutomationMsgIds.VRS_GRAB_TO_DISK_COMPLETE_RSP); + + // send the vrs a message just to make sure the two apps are talking + AutomationMessage grabCmd = new VrsGrabToDiskCmdMessage(numberOfFrames, format); + + AutomationMessage grabRsp = new VrsGrabToDiskRspMessage(false); + + CommUtil.Instance().SendCommandGetResponse(_udpNode, grabCmd, ref grabRsp, RSP_TIMEOUT); + + VrsGrabToDiskRspMessage tempRsp = (VrsGrabToDiskRspMessage)grabRsp; + + bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); + + _logger.Debug("init complete"); + + if (wasConnectMsgSuccessful == false) + { + throw new Exception("VrsGrabToDiskRspMessage returned a successful flag of false"); + } + } + } + + /// + /// Get the number of GB free on the VRS system. + /// + /// Drive 1 free space in GBs + /// Drive 2 free space in GBs + /// Drive 3 free space in GBs + /// Drive 4 free space in GBs + public void QueryHardDrive(ref float driveSpace1, ref float driveSpace2, ref float driveSpace3, ref float driveSpace4) + { + lock (_syncObj) + { + // send the vrs a message just to make sure the two apps are talking + AutomationMessage msg = new VrsQueryHardDriveCmdMessage(); + + AutomationMessage rsp = new VrsQueryHardDriveRspMessage(false, 0, 0, 0, 0); + + CommUtil.Instance().SendCommandGetResponse(_udpNode, msg, ref rsp); + + VrsQueryHardDriveRspMessage tempRsp = (VrsQueryHardDriveRspMessage)rsp; + + bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); + + _logger.Debug("init complete"); + + if (wasConnectMsgSuccessful == false) + { + throw new Exception("VrsQueryHardDriveRspMessage returned a successful flag of false"); + } + + tempRsp.GetDriveSpace(ref driveSpace1, ref driveSpace2, ref driveSpace3, ref driveSpace4); + } + } + + /// + /// Moves a file from one location to another + /// + /// + /// + /// + public void MoveFile(string fromFile, string toFile, MoveControl control) + { + lock (_syncObj) + { + // send the vrs a message just to make sure the two apps are talking + AutomationMessage cmd = new VrsMoveFileCmdMessage(fromFile, toFile, control); + + AutomationMessage rsp = new VrsMoveFileRspMessage(false); + + CommUtil.Instance().SendCommandGetResponse(_udpNode, cmd, ref rsp); + + VrsMoveFileRspMessage tempRsp = (VrsMoveFileRspMessage)rsp; + + bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); + + if (wasConnectMsgSuccessful == false) + { + throw new Exception("VrsMoveFileRspMessage returned a successful flag of false"); + } + } + } + + /// + /// Start displaying live video on the VRS + /// + public void ShowLiveVideo() + { + lock (_syncObj) + { + // send the vrs a message just to make sure the two apps are talking + AutomationMessage cmd = new VrShowLiveVideoCmdMessage(); + + AutomationMessage rsp = new VrShowLiveVideoRspMessage(false); + + CommUtil.Instance().SendCommandGetResponse(_udpNode, cmd, ref rsp); + + VrShowLiveVideoRspMessage tempRsp = (VrShowLiveVideoRspMessage)rsp; + + bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); + + _logger.Debug("init complete"); + + if (wasConnectMsgSuccessful == false) + { + throw new Exception("VrShowLiveVideoRspMessage returned a successful flag of false"); + } + } + } + + /// + /// Stop displaying video on the VRS + /// + public void StopLiveVideo() + { + lock (_syncObj) + { + // send the vrs a message just to make sure the two apps are talking + AutomationMessage cmd = new VrStopLiveVideoCmdMessage(); + + AutomationMessage rsp = new VrStopLiveVideoRspMessage(false); + + CommUtil.Instance().SendCommandGetResponse(_udpNode, cmd, ref rsp); + + VrStopLiveVideoRspMessage tempRsp = (VrStopLiveVideoRspMessage)rsp; + + bool wasConnectMsgSuccessful = tempRsp.GetSuccessfulFlag(); + + _logger.Debug("init complete"); + + if (wasConnectMsgSuccessful == false) + { + throw new Exception("VrStopLiveVideoRspMessage returned a successful flag of false"); + } + } + } + + /// + /// A blocking function that waits for a video capture to complete + /// + /// + /// + public string WaitForGrabToComplete(int timeoutms) + { + lock (_syncObj) + { + bool didWeGetRsp = AutomationRxMsgBuffer.Instance().WaitForRspMsg((uint)VrsAutomationMsgIds.VRS_GRAB_TO_DISK_COMPLETE_RSP, timeoutms); + + if (didWeGetRsp == true) + { + VrsGrabToDiskCompleteRspMessage rsp = (VrsGrabToDiskCompleteRspMessage)AutomationRxMsgBuffer.Instance().GetNewestMessage((uint)VrsAutomationMsgIds.VRS_GRAB_TO_DISK_COMPLETE_RSP); + + return rsp.GetFileName(); + } + else + { + throw new Exception("Timed out waiting for response"); + } + } + } + + public bool ClearErrors() + { + return false; + } + + public void Initialize() + { + throw new NotImplementedException(); + } + + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } + + /// + /// + /// + public void Reset() + { + Disconnect(); + + Connect(); + } + + /// + /// + /// + /// + public void Shutdown() + { + Dispose(true); + } + + public byte[] GetSmallVideoFrame(string name, int nFrames, bool sensor, ref uint numBytesRead, bool deleteVideoFile) + { + throw new NotImplementedException(); + } + #endregion + } } diff --git a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/VideoRecorderVrsClientFactory.cs b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/VideoRecorderVrsClientFactory.cs index e3ba77b..22615ff 100644 --- a/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/VideoRecorderVrsClientFactory.cs +++ b/Source/TSRealLib/HAL/Implementations/VideoRecorder/VideoRecorderVrsClient/VideoRecorderVrsClientFactory.cs @@ -31,71 +31,64 @@ // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using NLog; -using Raytheon.Common; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Reflection; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - [ExportInstrumentFactory(ModelNumber = "VideoRecorderVrsClientFactory")] - public class VideoRecorderVrsClientFactory : IInstrumentFactory - { - /// - /// The supported interfaces - /// - private readonly List _supportedInterfaces = new List(); - private ILogger _logger; - private readonly IConfigurationManager _configurationManager; - private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; - private static string DefaultPath; + [ExportInstrumentFactory(ModelNumber = "VideoRecorderVrsClientFactory")] + public class VideoRecorderVrsClientFactory : IInstrumentFactory + { + private readonly List _supportedInterfaces = new List(); - public VideoRecorderVrsClientFactory(string defaultConfigPath = DefaultConfigPath) - : this(null, defaultConfigPath) - { - } + private readonly IConfigurationManager _configurationManager; + private const string DefaultConfigPath = @"C:\ProgramData\Raytheon\InstrumentManagerService"; + private static string DefaultPath; - /// - /// COECommDeviceInstrumentFactory injection constructor - /// - /// - /// - /// - [ImportingConstructor] - public VideoRecorderVrsClientFactory([Import(AllowDefault = false)] IConfigurationManager configManager, - [Import(AllowDefault = true)] string defaultConfigPath = null) - { - DefaultPath = defaultConfigPath; + public VideoRecorderVrsClientFactory(string defaultConfigPath = DefaultConfigPath) + : this(null, defaultConfigPath) + { + } - if (LogManager.Configuration == null) - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); - } + /// + /// VideoRecorderVrsClientFactory injection constructor + /// + [ImportingConstructor] + public VideoRecorderVrsClientFactory([Import(AllowDefault = false)] IConfigurationManager configManager, + [Import(AllowDefault = true)] string defaultConfigPath = null) + { + DefaultPath = defaultConfigPath; - _configurationManager = configManager ?? GetConfigurationManager(); - _supportedInterfaces.Add(typeof(ICommDevice)); - } - /// - /// Gets the instrument - /// - /// - /// - public IInstrument GetInstrument(string name) - { - try - { - _logger = LogManager.GetLogger(name); - return new VideoRecorderVrsClient(name, _configurationManager, _logger); - } - catch (Exception) - { - throw; - } - } + if (LogManager.Configuration == null) + { + var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(assemblyFolder + "\\nlog.config"); + } + + _configurationManager = configManager ?? GetConfigurationManager(); + _supportedInterfaces.Add(typeof(ICommDevice)); + } + /// + /// Gets the instrument + /// + /// + /// + public IInstrument GetInstrument(string name) + { + try + { + return new VideoRecorderVrsClient(name, _configurationManager); + } + catch (Exception) + { + throw; + } + } /// /// Gets the instrument @@ -106,12 +99,10 @@ namespace Raytheon.Instruments { try { - _logger = LogManager.GetLogger(name); - if (simulateHw) - return new VideoRecorderSim(name, _configurationManager, _logger); + return new VideoRecorderSim(name, _configurationManager); else - return new VideoRecorderVrsClient(name, _configurationManager, _logger); + return new VideoRecorderVrsClient(name, _configurationManager); } catch (Exception) { @@ -124,17 +115,17 @@ namespace Raytheon.Instruments /// /// public ICollection GetSupportedInterfaces() - { - return _supportedInterfaces.ToArray(); - } + { + return _supportedInterfaces.ToArray(); + } - /// - /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService - /// - /// - private static IConfigurationManager GetConfigurationManager() - { - return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); - } - } + /// + /// returns configuration based on the predefined path or default path c:/ProgramData/Raytheon/InstrumentManagerService + /// + /// + private static IConfigurationManager GetConfigurationManager() + { + return string.IsNullOrEmpty(DefaultPath) ? new RaytheonConfigurationManager() : new RaytheonConfigurationManager(DefaultPath); + } + } } diff --git a/Source/TSRealLib/HAL/Interfaces/Common/IInstrumentManager/IInstrumentManager.cs b/Source/TSRealLib/HAL/Interfaces/Common/IInstrumentManager/IInstrumentManager.cs index e40147f..3396785 100644 --- a/Source/TSRealLib/HAL/Interfaces/Common/IInstrumentManager/IInstrumentManager.cs +++ b/Source/TSRealLib/HAL/Interfaces/Common/IInstrumentManager/IInstrumentManager.cs @@ -39,120 +39,122 @@ using System.Diagnostics.CodeAnalysis; namespace Raytheon.Instruments { - /// - /// Instrument manager interface. - /// - /// - /// An instrument manager is responsible for loading all of the instrument plugins and providing an interface for retrieving those instruments. - /// - [UmsContract] - public interface IInstrumentManager - { - /// - /// Gets an instrument by name. - /// - /// The name. - /// The instrument - /// This function cannot be named the same as the Generic method GetInstrument/ - /// because certain test executives do not support generics, and will throw an AmbiguousMatchException. - IInstrument GetGenericInstrument(string name); + /// + /// Instrument manager interface. + /// + /// + /// An instrument manager is responsible for loading all of the instrument plugins and providing an interface for retrieving those instruments. + /// + [UmsContract] + public interface IInstrumentManager + { + /// + /// Gets an instrument by name. + /// + /// The name. + /// The instrument + /// This function cannot be named the same as the Generic method GetInstrument/ + /// because certain test executives do not support generics, and will throw an AmbiguousMatchException. + IInstrument GetGenericInstrument(string name); - /// - /// Gets an instrument by name. - /// - /// The name. - /// The instrument - T GetInstrument(string name) where T : class; + /// + /// Gets an instrument by name. + /// + /// The name. + /// The instrument + T GetInstrument(string name) where T : class; - /// - /// Gets all instruments currently loaded. - /// - /// collection of all known instruments - ICollection GetInstruments(); + /// + /// Gets all instruments currently loaded. + /// + /// collection of all known instruments + ICollection GetInstruments(); - /// - /// Gets all instruments currently loaded. - /// - /// array of all known instruments - [UmsCommand("IInstrumentManager.GetInstrumentsArray")] - object[] GetInstrumentsArray(); + /// + /// Gets all instruments currently loaded. + /// + /// array of all known instruments + [UmsCommand("IInstrumentManager.GetInstrumentsArray")] + object[] GetInstrumentsArray(); - /// - /// Gets the instruments of the given type. - /// - /// The type. - /// all known instruments of a certain type - ICollection GetInstruments(Type type); + /// + /// Gets the instruments of the given type. + /// + /// The type. + /// all known instruments of a certain type + ICollection GetInstruments(Type type); - /// - /// Gets the instruments of the given type. - /// - /// The type. - /// array of instruments of the specified type - object[] GetInstrumentsArray(Type type); + /// + /// Gets the instruments of the given type. + /// + /// The type. + /// array of instruments of the specified type + object[] GetInstrumentsArray(Type type); - /// - /// Initializes the instrument manager - /// - [UmsCommand("IInstrumentManager.Initialize")] - void Initialize(); + /// + /// Initializes the instrument manager + /// + [UmsCommand("IInstrumentManager.Initialize")] + void Initialize(); - /// - /// Sets/Gets the part location - /// Added Dec 2013 to better clarify where the part locations are loading from - /// and to be able to set it before initialization - /// - string _partsLocation - { - get; - set; - } + /// + /// Sets/Gets the part location + /// Added Dec 2013 to better clarify where the part locations are loading from + /// and to be able to set it before initialization + /// + string _partsLocation { get; set; } - /// - /// Closes the instrument manager - /// - void Shutdown(); + /// + /// ConfigLocation - where the configuration manager stores config files + /// specifically Instruments.xml + /// + string _configLocation { get; set; } - /// - /// Returns a collection of instrument names loaded. - /// - /// all the known instrument's unique name - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] - [UmsCommand("IInstrumentManager.GetInstrumentNames")] - ICollection GetInstrumentNames(); + /// + /// Closes the instrument manager + /// + void Shutdown(); - /// - /// Returns a collection of instrument names loaded. - /// - /// all the known instrument names in array form - [UmsCommand("IInstrumentManager.GetInstrumentNamesArray")] - string[] GetInstrumentNamesArray(); + /// + /// Returns a collection of instrument names loaded. + /// + /// all the known instrument's unique name + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] + [UmsCommand("IInstrumentManager.GetInstrumentNames")] + ICollection GetInstrumentNames(); - /// - /// Initializes all of the instruments. - /// - [UmsCommand("IInstrumentManager.InitializeInstruments")] - void InitializeInstruments(); + /// + /// Returns a collection of instrument names loaded. + /// + /// all the known instrument names in array form + [UmsCommand("IInstrumentManager.GetInstrumentNamesArray")] + string[] GetInstrumentNamesArray(); - /// - /// Initializes the instrument. - /// - /// Name of the inst. - [UmsCommand("IInstrumentManager.InitializeInstrument")] - void InitializeInstrument(string instName); + /// + /// Initializes all of the instruments. + /// + [UmsCommand("IInstrumentManager.InitializeInstruments")] + void InitializeInstruments(); - /// - /// Shuts down all of the instruments. - /// - [UmsCommand("IInstrumentManager.ShutdownInstruments")] - void ShutdownInstruments(); + /// + /// Initializes the instrument. + /// + /// Name of the inst. + [UmsCommand("IInstrumentManager.InitializeInstrument")] + void InitializeInstrument(string instName); - /// - /// Shutdowns the instrument. - /// - /// Name of the inst. - [UmsCommand("IInstrumentManager.ShutdownInstrument")] - void ShutdownInstrument(string instName); + /// + /// Shuts down all of the instruments. + /// + [UmsCommand("IInstrumentManager.ShutdownInstruments")] + void ShutdownInstruments(); - } + /// + /// Shutdowns the instrument. + /// + /// Name of the inst. + [UmsCommand("IInstrumentManager.ShutdownInstrument")] + void ShutdownInstrument(string instName); + + } } diff --git a/Source/TSRealLib/HAL/Interfaces/IBit/IBit.cs b/Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeComm.cs similarity index 65% rename from Source/TSRealLib/HAL/Interfaces/IBit/IBit.cs rename to Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeComm.cs index 08a916b..0196223 100644 --- a/Source/TSRealLib/HAL/Interfaces/IBit/IBit.cs +++ b/Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeComm.cs @@ -1,5 +1,5 @@ // ********************************************************************************************************** -// IBit.cs +// CoeComm.cs // 6/21/2022 // NGI - Next Generation Interceptor // @@ -30,55 +30,65 @@ // DISTRIBUTION/DISSEMINATION CONTROL: F // POC: Alex Kravchenko (1118268) // ********************************************************************************************************** -using Raytheon.Communication; using System.Collections.Generic; +using Raytheon.Communication; namespace Raytheon.Instruments { [UmsContract] - public interface IBit : IInstrument + public interface CoeComm : IInstrument { /// /// Open the communication interface /// - [UmsCommand( "IBit.Open" )] - void Open( ); + [UmsCommand("CoeComm.Open")] + void Open(); /// /// Close the communication interface /// - [UmsCommand( "IBit.Close" )] - void Close( ); + [UmsCommand("CoeComm.Close")] + void Close(); /// - /// Starts execution of the Built In Test + /// Send a message /// /// could be either a label or message name - /// how log to wait in milliseconds /// /// - [UmsCommand( "IBit.RunBIT" )] - bool RunBIT( string messageId, uint timeoutInMs, IEnumerable> messageParams ); - + [UmsCommand("CoeComm.SendMessage")] + bool SendMessage(string messageId, IEnumerable> messageParams); /// - /// Starts execution of the Built In Test and waits for result - /// - /// could be either a label or message name - /// could be either a label or message name - /// how log to wait in milliseconds - /// - /// - [UmsCommand( "IBit.RunBITWaitForResults" )] - BitTestResults RunBITWaitForResults( string messageIdOut, string messageIdIn, uint timeoutInMs, IEnumerable> messageParams ); - - - /// - /// Retrieve resutls from previously started test + /// Get next response in FIFO Qeueu, meaning we are getting the oldest response /// /// could be either a label or message name /// - [UmsCommand( "IBit.GetBITResults" )] - BitTestResults GetBITResults( string messageId ); + [UmsCommand("CoeComm.GetNextResponseInQueue")] + CoeResponseMsgData GetNextResponseInQueue(string messageId); + + /// + /// Clear the queue for a particular response message. + /// This is useful if we have a large size queue and we don't want to dequeue each item to get + /// to the newest item. So we clear the queue first, before trying to get the newest item in the queue + /// + /// could be either a label or message name + /// + [UmsCommand("CoeComm.ClearResponseMessageQeue")] + void ClearResponseMessageQueue(string messageId); + + /// + /// Get XML Documents + /// + /// + [UmsCommand("CoeComm.GetXmlDocs")] + object GetXmlDocs(); + + /// + /// Determine if we should log this message + /// + /// + [UmsCommand("CoeComm.ShallLogMessage")] + bool ShallLogMessage(string messageName); } } diff --git a/Source/TSRealLib/HAL/Interfaces/IBit/IBit.csproj b/Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeComm.csproj similarity index 75% rename from Source/TSRealLib/HAL/Interfaces/IBit/IBit.csproj rename to Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeComm.csproj index 6cc411f..6ef23eb 100644 --- a/Source/TSRealLib/HAL/Interfaces/IBit/IBit.csproj +++ b/Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeComm.csproj @@ -2,8 +2,8 @@ net472 - Raytheon.Instruments.BIT.Contracts - nterface definition for Built In Test (BIT) + Raytheon.Instruments.CoeComm.Contracts + Interface definition for COE (Common Operator Environment) Communication HAL diff --git a/Source/TSRealLib/HAL/Interfaces/IBit/BitTestResult.cs b/Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeFieldData.cs similarity index 99% rename from Source/TSRealLib/HAL/Interfaces/IBit/BitTestResult.cs rename to Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeFieldData.cs index b021f84..814a1f5 100644 --- a/Source/TSRealLib/HAL/Interfaces/IBit/BitTestResult.cs +++ b/Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeFieldData.cs @@ -38,7 +38,7 @@ namespace Raytheon.Instruments { [Serializable] [DataContract] - public class BitTestResult + public class CoeFieldData { [DataMember] public string FieldArrayValue { get; set; } diff --git a/Source/TSRealLib/HAL/Interfaces/IBit/BitTestResults.cs b/Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeResponseMsgData.cs similarity index 90% rename from Source/TSRealLib/HAL/Interfaces/IBit/BitTestResults.cs rename to Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeResponseMsgData.cs index 44f9d7d..7859cb2 100644 --- a/Source/TSRealLib/HAL/Interfaces/IBit/BitTestResults.cs +++ b/Source/TSRealLib/HAL/Interfaces/ICoeComm/CoeResponseMsgData.cs @@ -40,7 +40,7 @@ namespace Raytheon.Instruments { [Serializable] [DataContract] - public class BitTestResults + public class CoeResponseMsgData { [DataMember] public string Name { get; set; } @@ -52,11 +52,11 @@ namespace Raytheon.Instruments public DateTime Time { get; set; } [DataMember] - public IList Results { get; set; } + public IList FieldDataList { get; set; } - public BitTestResult GetResult( string fieldName ) + public CoeFieldData GetFieldData( string fieldName ) { - return Results.FirstOrDefault( f => f.FieldName == fieldName ); + return FieldDataList.FirstOrDefault( f => f.FieldName == fieldName ); } } } diff --git a/Source/TSRealLib/HAL/Interfaces/IBit/Exceptions/BitNotConnectedException.cs b/Source/TSRealLib/HAL/Interfaces/ICoeComm/Exceptions/CoeNotConnectedException.cs similarity index 83% rename from Source/TSRealLib/HAL/Interfaces/IBit/Exceptions/BitNotConnectedException.cs rename to Source/TSRealLib/HAL/Interfaces/ICoeComm/Exceptions/CoeNotConnectedException.cs index c1f46df..6f7bdc0 100644 --- a/Source/TSRealLib/HAL/Interfaces/IBit/Exceptions/BitNotConnectedException.cs +++ b/Source/TSRealLib/HAL/Interfaces/ICoeComm/Exceptions/CoeNotConnectedException.cs @@ -34,20 +34,20 @@ using System; namespace Raytheon.Instruments.Exceptions { - public class BitNotConnectedException : Exception + public class CoeNotConnectedException : Exception { - public BitNotConnectedException() - : base("BIT Not Connected, please check your settings") + public CoeNotConnectedException() + : base("COE Not Connected, please check your settings") { } - public BitNotConnectedException(string message) - : base($"BIT Not Connected, {message}") + public CoeNotConnectedException(string message) + : base(message) { } - public BitNotConnectedException(string message, Exception innerException) - : base($"BIT Not Connected, {message}", innerException) + public CoeNotConnectedException(string message, Exception innerException) + : base(message, innerException) { } } diff --git a/Source/TSRealLib/HAL/Interfaces/IBit/Exceptions/BitParseException.cs b/Source/TSRealLib/HAL/Interfaces/ICoeComm/Exceptions/CoeParseException.cs similarity index 84% rename from Source/TSRealLib/HAL/Interfaces/IBit/Exceptions/BitParseException.cs rename to Source/TSRealLib/HAL/Interfaces/ICoeComm/Exceptions/CoeParseException.cs index 8e131c0..e80606c 100644 --- a/Source/TSRealLib/HAL/Interfaces/IBit/Exceptions/BitParseException.cs +++ b/Source/TSRealLib/HAL/Interfaces/ICoeComm/Exceptions/CoeParseException.cs @@ -34,20 +34,20 @@ using System; namespace Raytheon.Instruments.Exceptions { - public class BitParseException : Exception + public class CoeParseException : Exception { - public BitParseException() - : base("BIT Message Parsing Error, please check your settings") + public CoeParseException() + : base("COE Message Parsing Error, please check your settings") { } - public BitParseException(string message) - : base($"BIT Message Parsing Error, {message}") + public CoeParseException(string message) + : base(message) { } - public BitParseException(string message, Exception innerException) - : base($"BIT Message Parsing Error, {message}", innerException) + public CoeParseException(string message, Exception innerException) + : base(message, innerException) { } } diff --git a/Source/TSRealLib/HAL/Interfaces/IBit/Exceptions/BitTimeoutException.cs b/Source/TSRealLib/HAL/Interfaces/ICoeComm/Exceptions/CoeTimeoutException.cs similarity index 84% rename from Source/TSRealLib/HAL/Interfaces/IBit/Exceptions/BitTimeoutException.cs rename to Source/TSRealLib/HAL/Interfaces/ICoeComm/Exceptions/CoeTimeoutException.cs index 10efd77..939d160 100644 --- a/Source/TSRealLib/HAL/Interfaces/IBit/Exceptions/BitTimeoutException.cs +++ b/Source/TSRealLib/HAL/Interfaces/ICoeComm/Exceptions/CoeTimeoutException.cs @@ -34,20 +34,20 @@ using System; namespace Raytheon.Instruments.Exceptions { - public class BitTimeoutException : Exception + public class CoeTimeoutException : Exception { - public BitTimeoutException() - : base("BIT Timed Out, please check your settings") + public CoeTimeoutException() + : base("COE Timed Out, please check your settings") { } - public BitTimeoutException(string message) - : base($"BIT Timed Out, {message}") + public CoeTimeoutException(string message) + : base(message) { } - public BitTimeoutException(string message, Exception innerException) - : base($"BIT Timed Out, {message}", innerException) + public CoeTimeoutException(string message, Exception innerException) + : base(message, innerException) { } } diff --git a/Source/TSRealLib/HAL/Interfaces/ICommDevice/ICommDevice.cs b/Source/TSRealLib/HAL/Interfaces/ICommDevice/ICommDevice.cs index dc1c00a..ad4df20 100644 --- a/Source/TSRealLib/HAL/Interfaces/ICommDevice/ICommDevice.cs +++ b/Source/TSRealLib/HAL/Interfaces/ICommDevice/ICommDevice.cs @@ -65,7 +65,7 @@ namespace Raytheon.Instruments /// /// [UmsCommand("ICommDevice.SetReadTimeout")] - void SetReadTimeout(uint timeout); + void SetReadTimeout(uint timeoutMs = 0); /// /// Writes data to a communication device diff --git a/Source/Program/Common/ConfigLogic/ProgramConfigIni.cs b/Source/TSRealLib/HAL/Interfaces/IDmm/DmmConfigXml.cs similarity index 75% rename from Source/Program/Common/ConfigLogic/ProgramConfigIni.cs rename to Source/TSRealLib/HAL/Interfaces/IDmm/DmmConfigXml.cs index 73fd3c6..55327c4 100644 --- a/Source/Program/Common/ConfigLogic/ProgramConfigIni.cs +++ b/Source/TSRealLib/HAL/Interfaces/IDmm/DmmConfigXml.cs @@ -21,21 +21,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ProgramLib +namespace Raytheon.Instruments.Dmm { - /// - /// Define all the sections and keys that exists in the INI file - /// - internal enum ProgramConfigIni + public enum ConfigXml { - // list all the sections here - GENERAL, - // list all the keys here - DATA_BASE_PATH, - DATA_TEMP_PATH, - APP_BASE_PATH, - POWER_SUPPLY_SELF_TEST_DATETIME, - POWER_SUPPLY_READ_RATE + IP_ADDRESS } } diff --git a/Source/TSRealLib/HAL/Interfaces/IGeneralIO/ConfigIni.cs b/Source/TSRealLib/HAL/Interfaces/IGeneralIO/ConfigIni.cs index b6ea34d..526e2da 100644 --- a/Source/TSRealLib/HAL/Interfaces/IGeneralIO/ConfigIni.cs +++ b/Source/TSRealLib/HAL/Interfaces/IGeneralIO/ConfigIni.cs @@ -37,8 +37,11 @@ namespace Raytheon.Instruments.GeneralIO COM_PORT, DIO_ADDRESS, + DIO_PORT, DIO_OPTIONS, + DEVICE_NUMBER, - PXI_CARD_SLOT_INDEX + BUS_NUMBER, + LXI_IP_ADDRESS } } diff --git a/Source/TSRealLib/HAL/Interfaces/IGeneralIO/Datatypes.cs b/Source/TSRealLib/HAL/Interfaces/IGeneralIO/Datatypes.cs index 0625888..02d883c 100644 --- a/Source/TSRealLib/HAL/Interfaces/IGeneralIO/Datatypes.cs +++ b/Source/TSRealLib/HAL/Interfaces/IGeneralIO/Datatypes.cs @@ -12,6 +12,7 @@ namespace Raytheon.Instruments public struct DIOChannelInfo { public uint channelNumber; + public IOType ioType; public int initialValue; }; diff --git a/Source/TSRealLib/HAL/Interfaces/IGeneralIO/IGeneralIO.cs b/Source/TSRealLib/HAL/Interfaces/IGeneralIO/IGeneralIO.cs index 5d92708..073ccda 100644 --- a/Source/TSRealLib/HAL/Interfaces/IGeneralIO/IGeneralIO.cs +++ b/Source/TSRealLib/HAL/Interfaces/IGeneralIO/IGeneralIO.cs @@ -58,13 +58,13 @@ namespace Raytheon.Instruments IODatatypes.BitState GetBitState(string signalName); /// - /// Get signal names + /// Get all signals /// /// /// /// [UmsCommand("IGeneralIO.GetSignalNames")] - List GetSignalNames(); + Dictionary GetAllSignals(); /// /// Gets the number of input bits. diff --git a/Source/TSRealLib/HAL/Interfaces/IPowerSupplySystem/IPowerSupplySystem.cs b/Source/TSRealLib/HAL/Interfaces/IPowerSupplySystem/IPowerSupplySystem.cs index 948eceb..907319d 100644 --- a/Source/TSRealLib/HAL/Interfaces/IPowerSupplySystem/IPowerSupplySystem.cs +++ b/Source/TSRealLib/HAL/Interfaces/IPowerSupplySystem/IPowerSupplySystem.cs @@ -155,7 +155,7 @@ namespace Raytheon.Instruments /// The module to read /// THe Power Data [UmsCommand( "IPowerSupplySystem.ReadPowerData" )] - void ReadPowerData( string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool outputStatus, out int faultStatus ); + void ReadPowerData( string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool isOutputOn, out int faultStatus ); /// /// Set the slew rate diff --git a/Source/TSRealLib/HAL/Interfaces/IPowerSupplySystem/PowerData.cs b/Source/TSRealLib/HAL/Interfaces/IPowerSupplySystem/PowerData.cs index e962c08..1a78d43 100644 --- a/Source/TSRealLib/HAL/Interfaces/IPowerSupplySystem/PowerData.cs +++ b/Source/TSRealLib/HAL/Interfaces/IPowerSupplySystem/PowerData.cs @@ -37,16 +37,16 @@ namespace Raytheon.Instruments.PowerSupply /// /// /// - /// + /// /// - public PowerData(double voltage, double voltageSetpoint, double overVoltageProtection, double current, double overCurrentProtection, bool outputStatus, int faultStatus) + public PowerData(double voltage, double voltageSetpoint, double overVoltageProtection, double current, double overCurrentProtection, bool isOutputOn, int faultStatus) { Voltage = voltage; VoltageSetpoint = voltageSetpoint; OverVoltageProtection = overVoltageProtection; Current = current; OverCurrentProtection = overCurrentProtection; - OutputStatus = outputStatus; + IsOutputOn = isOutputOn; FaultStatus = faultStatus; } @@ -66,7 +66,7 @@ namespace Raytheon.Instruments.PowerSupply /// Getter for the output status /// [DataMember] - public bool OutputStatus { get; set; } + public bool IsOutputOn { get; set; } /// /// Getter for OCP value diff --git a/Source/TSRealLib/HAL/Interfaces/ISwitch/SwitchConfigXml.cs b/Source/TSRealLib/HAL/Interfaces/ISwitch/SwitchConfigXml.cs new file mode 100644 index 0000000..c16e6f9 --- /dev/null +++ b/Source/TSRealLib/HAL/Interfaces/ISwitch/SwitchConfigXml.cs @@ -0,0 +1,34 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Raytheon.Instruments.Switch +{ + public enum ConfigXml + { + // list all the keys here + LXI_IP_ADDRESS, + DEVICE_NUMBER, + BUS_NUMBER, + SUB_UNIT + } +} diff --git a/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/Exceptions/MalMeasurementManagerNullReferenceException.cs b/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/Exceptions/MalMeasurementManagerNullReferenceException.cs new file mode 100644 index 0000000..adfec70 --- /dev/null +++ b/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/Exceptions/MalMeasurementManagerNullReferenceException.cs @@ -0,0 +1,55 @@ +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY +WARNING - THIS DOCUMENT CONTAINS TECHNICAL DATA WHOSE EXPORT OR DISCLOSURE +TO NON-U.S. PERSONS, WHEREVER LOCATED, IS RESTRICTED BY THE INTERNATIONAL +TRAFFIC IN ARMS REGULATIONS (ITAR) (22 C.F.R. SECTIONS 120-130). VIOLATIONS +ARE SUBJECT TO SEVERE CRIMINAL PENALTIES. + +DISTRIBUTION STATEMENT F: FURTHER DISSEMINATION ONLY AS DIRECTED BY MISSILE +DEFENSE AGENCY, MDA/GMY NEXT GENERATION INTERCEPTOR PROJECT OFFICE +(DATE OF DETERMINATION 14 JUNE 2021) OR HIGHER DOD AUTHORITY. +OTHER REQUESTS FOR THIS DOCUMENT SHALL BE REFERRED TO: MISSILE DEFENSE +AGENCY, CONTRACTS DIRECTORATE, ATTN: GMY-K, BLDG. 5222 MARTIN ROAD, +REDSTONE ARSENAL, AL 35898. + +WARNING - THIS DOCUMENT CONTAINS TECHNICAL DATA WHOSE EXPORT IS RESTRICTED +BY THE ARMS EXPORT CONTROL ACT (TITLE 22, U.S.C., SEC 2751, ET SEQ.) OR +THE EXPORT ADMINISTRATION ACT OF 1979 (TITLE 50, U.S.C., APP.2401 ET SEQ), +AS AMENDED. VIOLATIONS OF THESE EXPORT LAWS ARE SUBJECT TO SEVERE CRIMINAL +PENALTIES. DISSEMINATE IN ACCORDANCE WITH PROVISIONS OF +DOD DIRECTIVE 5230.25 + +DESTRUCTION NOTICE - FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN +DOD 5220.22-M, +NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR +DODM 5200.01-VOLUME 3, DOD INFORMATION SECURITY PROGRAM: PROTECTION OF +CLASSIFIED INFORMATION, ENCLOSURE 3, SECTION 17. FOR CONTROLLED +UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION +-------------------------------------------------------------------------*/ +using System; + +namespace MeasurementManagerLib +{ + public class MalMeasurementManagerNullReferenceException : Exception + { + protected MalMeasurementManagerNullReferenceException() { } + + public MalMeasurementManagerNullReferenceException(Type type) + : base($"Reference to object of type {type.Name} is null. Please create an instance of the object.") + { + } + + public MalMeasurementManagerNullReferenceException(string message) + : base(message) + { + } + + public MalMeasurementManagerNullReferenceException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/MalMeasurementLibManager.cs b/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/MalMeasurementLibManager.cs index ac19958..8644984 100644 --- a/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/MalMeasurementLibManager.cs +++ b/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/MalMeasurementLibManager.cs @@ -32,9 +32,6 @@ INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION using System; using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Threading; - using Raytheon.Instruments; using static MeasurementManagerLib.BitMeasurementManager; @@ -45,23 +42,249 @@ namespace MeasurementManagerLib /// public class MalMeasurementLibManager : IDisposable { - public FpgaMeasurementManager FpgaMeasurementManager { get; set; } - public PowerSupplyMeasurementManager PowerSupplyMeasurementManager { get; set; } - public SwitchMeasurementManager SwitchMeasurementManager { get; set; } - public BitMeasurementManager BitMeasurementManager { get; set; } - public BitGenSoftMeasurementManager BitGenSoftMeasurementManager { get; set; } - public ChillerCartMeasurementManager ChillerMeasurementManager { get; set; } - public DioMeasurementManager DioMeasurementManager { get; set; } - public JtagMeasurementManager JtagMeasurementManager { get; set; } - public VideoRecorderMeasurementManager VideoRecorderMeasurementManager { get; set; } - public RelayMeasurementManager RelayMeasurementManager { get; set; } - public RfMeasurementManager RfMeasurementManager { get; set; } - public SpaceChamberLSPSMeasurementManager SpaceChamberLSPSMeasurementManager { get; set; } - public TelemetryMeasurementManager TelemetryMeasurementManager { get; set; } - public CryoMeasurementManager CryoMeasurementManager { get; set; } - public OpticalBenchMeasurementManager OpticalBenchMeasurementManager { get; set; } + private FpgaMeasurementManager _fpgaMeasurementManager; + private PowerSupplyMeasurementManager _powerSupplyMeasurementManager; + private SwitchMeasurementManager _switchMeasurementManager; + private BitMeasurementManager _bitMeasurementManager; + private CoeMeasurementManager _coeMeasurementManager; + private ChillerCartMeasurementManager _chillerMeasurementManager; + private DioMeasurementManager _dioMeasurementManager; + private JtagMeasurementManager _jtagMeasurementManager; + private VideoRecorderMeasurementManager _videoRecorderMeasurementManager; + private RelayMeasurementManager _relayMeasurementManager; + private RfMeasurementManager _rfMeasurementManager; + private SpaceChamberLspsMeasurementManager _spaceChamberLspsMeasurementManager; + private TelemetryMeasurementManager _telemetryMeasurementManager; + private CryoMeasurementManager _cryoMeasurementManager; + private OpticalBenchMeasurementManager _opticalBenchMeasurementManager; - public IInstrumentManager InstrumentManager { get; set; } + public FpgaMeasurementManager FpgaMeasurementManager + { + get + { + if (_fpgaMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(FpgaMeasurementManager)); + + return _fpgaMeasurementManager; + } + + private set + { + _fpgaMeasurementManager = value; + } + } + public PowerSupplyMeasurementManager PowerSupplyMeasurementManager + { + get + { + if (_powerSupplyMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(PowerSupplyMeasurementManager)); + + return _powerSupplyMeasurementManager; + } + + private set + { + _powerSupplyMeasurementManager = value; + } + } + public SwitchMeasurementManager SwitchMeasurementManager + { + get + { + if (_switchMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(SwitchMeasurementManager)); + + return _switchMeasurementManager; + } + + private set + { + _switchMeasurementManager = value; + } + } + public BitMeasurementManager BitMeasurementManager + { + get + { + if (_bitMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(BitMeasurementManager)); + + return _bitMeasurementManager; + } + + private set + { + _bitMeasurementManager = value; + } + } + public CoeMeasurementManager CoeMeasurementManager + { + get + { + if (_coeMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(CoeMeasurementManager)); + + return _coeMeasurementManager; + } + + private set + { + _coeMeasurementManager = value; + } + } + public ChillerCartMeasurementManager ChillerMeasurementManager + { + get + { + if (_chillerMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(ChillerCartMeasurementManager)); + + return _chillerMeasurementManager; + } + + private set + { + _chillerMeasurementManager = value; + } + } + public DioMeasurementManager DioMeasurementManager + { + get + { + if (_dioMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(DioMeasurementManager)); + + return _dioMeasurementManager; + } + + private set + { + _dioMeasurementManager = value; + } + } + public JtagMeasurementManager JtagMeasurementManager + { + get + { + if (_jtagMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(JtagMeasurementManager)); + + return _jtagMeasurementManager; + } + + private set + { + _jtagMeasurementManager = value; + } + } + public VideoRecorderMeasurementManager VideoRecorderMeasurementManager + { + get + { + if (_videoRecorderMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(VideoRecorderMeasurementManager)); + + return _videoRecorderMeasurementManager; + } + + private set + { + _videoRecorderMeasurementManager = value; + } + } + public RelayMeasurementManager RelayMeasurementManager + { + get + { + if (_relayMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(RelayMeasurementManager)); + + return _relayMeasurementManager; + } + + private set + { + _relayMeasurementManager = value; + } + } + public RfMeasurementManager RfMeasurementManager + { + get + { + if (_rfMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(RfMeasurementManager)); + + return _rfMeasurementManager; + } + + private set + { + _rfMeasurementManager = value; + } + } + public SpaceChamberLspsMeasurementManager SpaceChamberLspsMeasurementManager + { + get + { + if (_spaceChamberLspsMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(SpaceChamberLspsMeasurementManager)); + + return _spaceChamberLspsMeasurementManager; + } + + private set + { + _spaceChamberLspsMeasurementManager = value; + } + } + public TelemetryMeasurementManager TelemetryMeasurementManager + { + get + { + if (_telemetryMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(TelemetryMeasurementManager)); + + return _telemetryMeasurementManager; + } + + private set + { + _telemetryMeasurementManager = value; + } + } + public CryoMeasurementManager CryoMeasurementManager + { + get + { + if (_cryoMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(CryoMeasurementManager)); + + return _cryoMeasurementManager; + } + + private set + { + _cryoMeasurementManager = value; + } + } + public OpticalBenchMeasurementManager OpticalBenchMeasurementManager + { + get + { + if (_opticalBenchMeasurementManager == null) + throw new MalMeasurementManagerNullReferenceException(typeof(OpticalBenchMeasurementManager)); + + return _opticalBenchMeasurementManager; + } + + private set + { + _opticalBenchMeasurementManager = value; + } + } + + public IInstrumentManager InstrumentManager { get; private set; } ~MalMeasurementLibManager() { @@ -98,34 +321,36 @@ namespace MeasurementManagerLib /// Initialize the BIT interface manager /// /// - /// + /// + /// + /// + /// + /// public void InitializeBitMeasurementManager(string measurementDefFile, string comDeviceName, string comNodeName, string binDataLogFilename, string asciiDataLogFileName, MessageReceivedDelegate callback) { // create the object once no matter how many times the host calls this - if (BitMeasurementManager == null) + if (_bitMeasurementManager == null) { - BitMeasurementManager = new BitMeasurementManager(InstrumentManager, measurementDefFile, comDeviceName, comNodeName, binDataLogFilename, asciiDataLogFileName, callback); + _bitMeasurementManager = new BitMeasurementManager(InstrumentManager, measurementDefFile, comDeviceName, comNodeName, binDataLogFilename, asciiDataLogFileName, callback); } } /// /// Initialize the BIT interface manager /// - /// - /// - /// - public void InitializeBitGenSoftMeasurementManager(List instrumentNames) + /// + public void InitializeCoeMeasurementManager(string coeMeasurementManagerConfigFullPath) { - if (BitGenSoftMeasurementManager == null) + if (_coeMeasurementManager == null) { - BitGenSoftMeasurementManager = new BitGenSoftMeasurementManager(InstrumentManager, instrumentNames); + _coeMeasurementManager = new CoeMeasurementManager(InstrumentManager, coeMeasurementManagerConfigFullPath); + _coeMeasurementManager.InitNodes(); } } /// /// Initialize the Chiller interface manager /// - /// /// /// /// @@ -133,90 +358,81 @@ namespace MeasurementManagerLib public void InitializeChillerCartMeasurementManager(string chillerName, string flowMeeterName, string tempSensorName, string errorLog) { // create the object once no matter how many times the host calls this - if (ChillerMeasurementManager == null) + if (_chillerMeasurementManager == null) { - ChillerMeasurementManager = new ChillerCartMeasurementManager(InstrumentManager, chillerName, flowMeeterName, tempSensorName, errorLog); + _chillerMeasurementManager = new ChillerCartMeasurementManager(InstrumentManager, chillerName, flowMeeterName, tempSensorName, errorLog); } } /// /// Initialize the Dio interface manager /// - /// - /// public void InitializeDioMeasurementManager() { // create the object once no matter how many times the host calls this - if (DioMeasurementManager == null) + if (_dioMeasurementManager == null) { - DioMeasurementManager = new DioMeasurementManager(InstrumentManager); + _dioMeasurementManager = new DioMeasurementManager(InstrumentManager); } } /// /// Initialize the Jtag interface manager /// - /// /// /// - /// public void InitializeJtagMeasurementManager(string instrumentName, string measurementDefFile) { // create the object once no matter how many times the host calls this - if (JtagMeasurementManager == null) + if (_jtagMeasurementManager == null) { - JtagMeasurementManager = new JtagMeasurementManager(InstrumentManager, instrumentName, measurementDefFile); + _jtagMeasurementManager = new JtagMeasurementManager(InstrumentManager, instrumentName, measurementDefFile); } } /// /// Initialize the fpga communication manager /// - /// /// /// public void InitializeFpgaMeasurementManager(List instrumentNames, string instrumentDefFile) { // create the object once no matter how many times the host calls this - if (FpgaMeasurementManager == null) + if (_fpgaMeasurementManager == null) { - FpgaMeasurementManager = new FpgaMeasurementManager(InstrumentManager, instrumentNames, instrumentDefFile); + _fpgaMeasurementManager = new FpgaMeasurementManager(InstrumentManager, instrumentNames, instrumentDefFile); } } /// /// Initialize the power system and connect to the power supplies /// - /// - /// public void InitializePowerSupplyMeasurementManager() { // create the object once no matter how many times the host calls this - if (PowerSupplyMeasurementManager == null) + if (_powerSupplyMeasurementManager == null) { - PowerSupplyMeasurementManager = new PowerSupplyMeasurementManager(InstrumentManager); + _powerSupplyMeasurementManager = new PowerSupplyMeasurementManager(InstrumentManager); } } /// /// Initialize the relay manager /// - /// /// /// public void InitializeRelayMeasurementManager(List instrumentNames, string configFileName) { // create the object once no matter how many times the host calls this - if (RelayMeasurementManager == null) + if (_relayMeasurementManager == null) { - RelayMeasurementManager = new RelayMeasurementManager(InstrumentManager, instrumentNames, configFileName); + _relayMeasurementManager = new RelayMeasurementManager(InstrumentManager, instrumentNames, configFileName); } } /// /// Initializes Rf Measurement Manager /// - /// /// /// /// @@ -225,62 +441,55 @@ namespace MeasurementManagerLib public void InitializeRfMeasurementManager(List switchInstrumentNames, string powerMeeterName, string signalGeneratorName, string specAnalyzerName, string configFileName) { // create the object once no matter how many times the host calls this - if (RfMeasurementManager == null) + if (_rfMeasurementManager == null) { - RfMeasurementManager = new RfMeasurementManager(InstrumentManager, switchInstrumentNames, powerMeeterName, signalGeneratorName, specAnalyzerName, configFileName); + _rfMeasurementManager = new RfMeasurementManager(InstrumentManager, switchInstrumentNames, powerMeeterName, signalGeneratorName, specAnalyzerName, configFileName); } } /// /// Initializes Space Chamber LSPS Measurement Manager /// - /// /// /// public void InitializeSpaceChamberLSPSMeasurementManager(string lspsChamber, string netCdfData) { // create the object once no matter how many times the host calls this - if (SpaceChamberLSPSMeasurementManager == null) + if (_spaceChamberLspsMeasurementManager == null) { - SpaceChamberLSPSMeasurementManager = new SpaceChamberLSPSMeasurementManager(InstrumentManager, lspsChamber, netCdfData); + _spaceChamberLspsMeasurementManager = new SpaceChamberLspsMeasurementManager(InstrumentManager, lspsChamber, netCdfData); } } /// /// Initializes Switch Measurement Manager /// - /// - /// - /// - /// - /// - public void InitializeSwitchMeasurementManager() + /// + public void InitializeSwitchMeasurementManager(string switchMeasurementManagerConfigFullPath, bool skipDmmInitialization = false) { // create the object once no matter how many times the host calls this - if (SwitchMeasurementManager == null) + if (_switchMeasurementManager == null) { - SwitchMeasurementManager = new SwitchMeasurementManager(InstrumentManager); + _switchMeasurementManager = new SwitchMeasurementManager(InstrumentManager, switchMeasurementManagerConfigFullPath, skipDmmInitialization); } } /// /// Initialize the video recorder manager /// - /// - /// + /// public void InitializeVideoRecorderMeasurementManager(string deviceName) { // create the object once no matter how many times the host calls this - if (VideoRecorderMeasurementManager == null) + if (_videoRecorderMeasurementManager == null) { - VideoRecorderMeasurementManager = new VideoRecorderMeasurementManager(InstrumentManager, deviceName); + _videoRecorderMeasurementManager = new VideoRecorderMeasurementManager(InstrumentManager, deviceName); } } /// /// Initializes Cryo Measurement Manager /// - /// /// /// /// @@ -288,40 +497,39 @@ namespace MeasurementManagerLib public void InitializeCryoMeasurementManager(string commDeviceName, string serialDeviceName, bool isThereHardware, string errorLogFileName) { // create the object once no matter how many times the host calls this - if (CryoMeasurementManager == null) + if (_cryoMeasurementManager == null) { - CryoMeasurementManager = new CryoMeasurementManager(InstrumentManager, commDeviceName, serialDeviceName, isThereHardware, errorLogFileName); + _cryoMeasurementManager = new CryoMeasurementManager(InstrumentManager, commDeviceName, serialDeviceName, isThereHardware, errorLogFileName); } } /// /// Initializes Optical Bench Measurement Manager /// - /// /// /// /// public void InitializeOpticalBenchMeasurementManager(string instrumentName, string measurementDefFile, string instrumentDefFile) { // create the object once no matter how many times the host calls this - if (OpticalBenchMeasurementManager == null) + if (_opticalBenchMeasurementManager == null) { - OpticalBenchMeasurementManager = new OpticalBenchMeasurementManager(InstrumentManager, instrumentName, measurementDefFile, instrumentDefFile); + _opticalBenchMeasurementManager = new OpticalBenchMeasurementManager(InstrumentManager, instrumentName, measurementDefFile, instrumentDefFile); } } /// /// initializes Telemetry Measurement Manager for multiple instruments /// - /// - /// + /// + /// public void InitializeTelemetryMeasurementManager(List instrumentNames, string telemetryMalFile) { // create the object once no matter how many times the host calls this - if (TelemetryMeasurementManager == null) + if (_telemetryMeasurementManager == null) { - TelemetryMeasurementManager = new TelemetryMeasurementManager(InstrumentManager, instrumentNames, telemetryMalFile); + _telemetryMeasurementManager = new TelemetryMeasurementManager(InstrumentManager, instrumentNames, telemetryMalFile); } } diff --git a/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/Raytheon.MAL.csproj b/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/Raytheon.MAL.csproj index 808b035..e02631f 100644 --- a/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/Raytheon.MAL.csproj +++ b/Source/TSRealLib/MAL/ManagerMaster/Raytheon.MAL/Raytheon.MAL.csproj @@ -19,9 +19,9 @@ - + diff --git a/Source/TSRealLib/MAL/Managers/BitGenSoftMeasurementManager/BITCommand.cs b/Source/TSRealLib/MAL/Managers/BitGenSoftMeasurementManager/BITCommand.cs deleted file mode 100644 index 29b0c7d..0000000 --- a/Source/TSRealLib/MAL/Managers/BitGenSoftMeasurementManager/BITCommand.cs +++ /dev/null @@ -1,215 +0,0 @@ -// ********************************************************************************************************** -// BITCommand.cs -// 8/31/2023 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// DISTRIBUTION STATEMENT F: FURTHER DISSEMINATION ONLY AS DIRECTED BY -// MISSILE DEFENSE AGENCY, MDA/GMY NEXT GENERATION INTERCEPTOR PROJECT -// OFFICE (DATE OF DETERMINATION 14 JUNE 2021) OR HIGHER DOD AUTHORITY. -// OTHER REQUESTS FOR THIS DOCUMENT SHALL BE REFERRED TO: MISSILE DEFENSE -// AGENCY, CONTRACTS DIRECTORATE, ATTN: GMY‐K, BLDG. 5222 MARTIN ROAD, -// REDSTONE ARSENAL, AL 35898. -// -// WARNING: THIS DOCUMENT CONTAINS TECHNICAL DATA WHOSE EXPORT IS -// RESTRICTED BY THE ARMS EXPORT CONTROL ACT (TITLE 22, U.S.C., -// SECTION 2751, ET SEQ.) OR THE EXPORT ADMINISTRATION ACT OF 1979 -// (TITLE 50 U.S.C. APP. 2401 ET SEQ.), AS AMENDED. VIOLATIONS OF -// THESE EXPORT LAWS ARE SUBJECT TO SEVERE CRIMINAL PENALTIES. -// DISSEMINATE IN ACCORDANCE WITH PROVISIONS OF DOD DIRECTIVE 5230.25. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION -// PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY -// PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL -// COMPETITIVE HARM TO RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER -// SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED TO -// OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE -// EXPRESS WRITTEN APPROVAL OF RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE - FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN -// DOD 5220.22-M, NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, -// FEBRUARY 2006, INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, -// SECTION 7, OR DODM 5200.01-VOLUME 3, DOD INFORMATION SECURITY PROGRAM: -// PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, SECTION 17. FOR -// CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM -// 5200.01-VOLUME 4, INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED -// INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** -// Ignore Spelling: Deserialized - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml.Serialization; - -namespace BitGenSoftMeasurementManagerLib -{ - - [XmlType(TypeName = "ResponseMessageType")] - public enum ResponseMessageType - { - U, // Unknown or Undefined - R, // Required - E, // Error - P // Parametric - } - - [XmlType(TypeName = "ParamType")] - public enum ParameterType - { - U, // Unknown or Undefined will default to string - N, // Numeric - S, // String - A, // Array - P // p-data array - } - - - [XmlType(TypeName = "BITResponseMsg")] - public class BITResponseMsg - { - [XmlAttribute("type")] - public ResponseMessageType ResponseType { get; set; } - - [XmlText] - public string Name { get; set; } - } - - [XmlType("Value")] - public class BITParameter - { - [XmlAttribute(AttributeName = "name")] - public string Key { get; set; } - - [XmlAttribute(AttributeName = "type")] - public ParameterType ParameterType { get; set; } - - [XmlAttribute(AttributeName = "delim")] - public string Delim { get; set; } - - [XmlText] - public string Value { get; set; } - } - - [Serializable] - public class BITCommand - { - [XmlElement(ElementName = "Command")] - public string Command { get; set; } - - [XmlElement(ElementName = "CommandTimeout")] - public uint CommandTimeout { get; set; } - - [XmlArray("CommandParameters")] - [XmlArrayItem("Value", Type = typeof(BITParameter))] - public List CommandParameters { get; set; } = new List(); - - [XmlArray("CommandResponses")] - [XmlArrayItem("BITResponseMsg", Type = typeof(BITResponseMsg))] - public List CommandResponses { get; set; } = new List(); - - [XmlElement(ElementName = "ParametricResponse")] - public string ParametricResponse { get; set; } - - [XmlElement(ElementName = "ParametricTimeout")] - public uint ParametricTimeout { get; set; } - - [XmlArray("ResponseParameters")] - [XmlArrayItem("Value", Type = typeof(BITParameter))] - public List ResponseParameters { get; set; } = new List(); - - /// - /// converts one hex parameter string into parameter array - /// - public void UnfoldHexParameters() - { - if (!CommandParameters.Any(p => p.ParameterType == ParameterType.P)) - return; - - var paramList = CommandParameters.Where(p => p.ParameterType == ParameterType.P).ToList(); - List removeList = new List(); - foreach (BITParameter param in paramList) - { - AddPDataArrayValues(param.Key, param.Value, param.Delim); - removeList.Add(param); - } - CommandParameters.RemoveAll(c => removeList.Contains(c)); - } - - /// - /// takes a hex string and breaks it up into individual characters - /// then inserts them as parameters - /// - /// - /// - /// - private void AddPDataArrayValues(string key, string value, string delim) - { - var parms = BreakByPages(value, delim); - - int index = 0; - foreach (var item in parms) - { - string itemKey = $"{key}[{index++}]"; - string itemValue = item; - CommandParameters.Add(new BITParameter { Key = itemKey, Value = itemValue } ); - } - } - - /// - /// takes a large hex string and breaks it in multiple pages based on the known header - /// adjusts the size of the page to be divisible by 4 bytes - /// and also adds a 12 byte footer of zero values to the end of the page - /// - /// - /// - /// - private static IEnumerable BreakByPages(string hexStr, string header) - { - const int footerSize = 12; - string[] pages = hexStr.Split(new[] { header }, StringSplitOptions.RemoveEmptyEntries); - - foreach (string page in pages) - { - string completePage = header + page; - int pageSize = (completePage.Length + 7) & ~7; - string paddedPage = completePage.PadRight(pageSize + (footerSize * 2), '0'); - IEnumerable hexChars = BreakIntoHexCharacters(paddedPage); - foreach (string hexChar in hexChars) - { - yield return hexChar; - } - } - } - - /// - /// takes a large string of hex characters and breaks it into individual hex values - /// then yields these values to the calling code - /// - /// - /// - public static IEnumerable BreakIntoHexCharacters(string hexString) - { - int characterSize = 2; - int length = hexString.Length; - for (int i = 0; i < length; i += characterSize) - { - if (i + characterSize > length) - { - hexString = hexString.PadRight(i + characterSize, '0'); - } - yield return "0x" + hexString.Substring(i, characterSize); - } - } - } -} diff --git a/Source/TSRealLib/MAL/Managers/BitGenSoftMeasurementManager/BitGenSoftMeasurementManager.cs b/Source/TSRealLib/MAL/Managers/BitGenSoftMeasurementManager/BitGenSoftMeasurementManager.cs deleted file mode 100644 index d5c2140..0000000 --- a/Source/TSRealLib/MAL/Managers/BitGenSoftMeasurementManager/BitGenSoftMeasurementManager.cs +++ /dev/null @@ -1,936 +0,0 @@ -// ********************************************************************************************************** -// BitGenSoftMeasurementManager.cs -// 7/28/2022 -// NGI - Next Generation Interceptor -// -// Contract No. HQ0856-21-C-0003/1022000209 -// -// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. -// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. -// -// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON -// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. -// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON -// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED -// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF -// RAYTHEON COMPANY. -// -// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -// -// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, -// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, -// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, -// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, -// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, -// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. -// -// CONTROLLED BY: MISSILE DEFENSE AGENCY -// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE -// CUI CATEGORY: CTI -// DISTRIBUTION/DISSEMINATION CONTROL: F -// POC: Alex Kravchenko (1118268) -// ********************************************************************************************************** - -using NLog; -using Raytheon.Common; -using Raytheon.Instruments; -using Raytheon.Instruments.Exceptions; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -using BitGenSoftMeasurementManagerLib; - -namespace MeasurementManagerLib -{ - /// - /// Bit Gen Soft Measurement Manager class - /// - public class BitGenSoftMeasurementManager : IDisposable - { - private readonly Logger _logger = LogManager.GetCurrentClassLogger(); - - private readonly Dictionary _bitNodes = new Dictionary(); - - private readonly IInstrumentManager _instrumentManager; - private IConfigurationManager _configurationManager; - private int _checkForMessageIntervalMs = 10; - /// - /// constructor that will create a list of BIT instruments - /// - /// - /// - public BitGenSoftMeasurementManager(IInstrumentManager instrumentManager, List instrumentNames) - : this(instrumentManager) - { - try - { - foreach (string instrumentName in instrumentNames) - { - var bitNode = (IBit)_instrumentManager.GetGenericInstrument(instrumentName); - if (bitNode == null) - { - _logger.Error("Error creating TCP BIT device, check your settings"); - } - else - { - _bitNodes.Add(instrumentName, bitNode); - } - } - } - catch (Exception ex) - { - _logger.Error($"Unable to create BIT instrument\n{ex.Message}"); - } - } - - /// - /// in case instrument manager was passed from upper level - /// - /// - private BitGenSoftMeasurementManager(IInstrumentManager instrumentManager) - { - _instrumentManager = instrumentManager; - InitializeConfigurationManager(); - } - - /// - /// initializes configuration manager, - /// will use configuration path from General Instrument Manager if available - /// otherwise will try to use the instruments path - /// - private void InitializeConfigurationManager() - { - string defaultPath; - if (_instrumentManager is GeneralInstrumentManager generalinstrumentManager) - { - defaultPath = generalinstrumentManager._configLocation; - } - else - { - defaultPath = _instrumentManager._partsLocation; - } - - _configurationManager = new RaytheonConfigurationManager(defaultPath); - - var config = _configurationManager.GetConfiguration("BitGenSoftMeasurementManager"); - - _checkForMessageIntervalMs = config.GetConfigurationValue("Settings", "CheckForMessageIntervalMs", 10); - } - - /// - /// initialize COE nodes based on test type - /// - /// - /// - public void InitNodes() - { - foreach (var node in _bitNodes) - { - try - { - IBit bitNode = node.Value; - bitNode.Initialize(); - bitNode.Open(); - } - catch (Exception ex) - { - _logger.Error(ex, ex.Message); - } - } - } - - /// - /// close all connections - /// - /// - public void Dispose() - { - foreach (var bitNode in _bitNodes) - { - bitNode.Value?.Shutdown(); - } - } - - /// - /// straight pass-through the message and parameters - /// - /// - /// - /// - /// - public bool RunBIT(string messageId, uint timeoutInMs, IEnumerable> messageParams = null) - { - if (_bitNodes.Any()) - { - IBit bitNode = _bitNodes.First().Value; - return bitNode.RunBIT(messageId, timeoutInMs, messageParams); - } - else - { - _logger.Error($"Unable to locate BIT node. No nodes defined"); - return false; - } - } - - /// - /// straight pass-through the message and parameters - /// - /// - /// - /// - /// - /// - public bool RunBIT(string instrumentName, string messageId, uint timeoutInMs, IEnumerable> messageParams = null) - { - if (_bitNodes.ContainsKey(instrumentName)) - { - return _bitNodes[instrumentName].RunBIT(messageId, timeoutInMs, messageParams); - } - else - { - _logger.Error($"Unable to locate BIT node {instrumentName}"); - return false; - } - } - - /// - /// always runs the request on the first node, - /// - /// - /// - /// - /// - /// - public BitTestResults RunBITWaitForResults(string messageIdOut, - string messageIdIn, - uint timeoutInMs, - IEnumerable> messageParams = null) - { - if (_bitNodes.Any()) - { - IBit bitNode = _bitNodes.First().Value; - return bitNode.RunBITWaitForResults(messageIdOut, messageIdIn, timeoutInMs, messageParams); - } - else - { - _logger.Error($"Unable to locate BIT node. No nodes defined"); - return null; - } - } - - /// - /// run BIT message and wait for result from the instrument based on the name - /// - /// - /// - /// - /// - /// - /// - public BitTestResults RunBITWaitForResults(string instrumentName, - string messageIdOut, - string messageIdIn, - uint timeoutInMs, - IEnumerable> messageParams = null) - { - if (_bitNodes.ContainsKey(instrumentName)) - { - return _bitNodes[instrumentName].RunBITWaitForResults(messageIdOut, messageIdIn, timeoutInMs, messageParams); - } - else - { - _logger.Error($"Unable to locate BIT node {instrumentName}"); - return null; - } - - } - - /// - /// RunBITWaitForResults for the whole list of BIT Commands - /// runs on the first node - /// - /// - /// - public List RunBITWaitForResultsList(List commands) - { - if (_bitNodes.Any()) - { - return RunBITWaitForResultsList(commands, _bitNodes.First().Value); - } - else - { - _logger.Error("Unable to locate BIT node. No nodes defined"); - return null; - } - } - - /// - /// RunBITWaitForResults for the whole list of BIT Commands - /// - /// - /// - /// - public List RunBITWaitForResultsList(string instrumentName, List commands) - { - if (_bitNodes.ContainsKey(instrumentName)) - { - return RunBITWaitForResultsList(commands, _bitNodes[instrumentName]); - } - else - { - _logger.Error($"Unable to locate BIT node {instrumentName}"); - return null; - } - - } - - /// - /// Runs BIT command and returns the results as a list - /// - /// - /// - public async Task> RunBITWaitForResultsListAsync(List commands) - { - if (_bitNodes.Any()) - { - return await RunBITWaitForResultsListAsync(commands, _bitNodes.First().Value); - } - else - { - _logger.Error("Unable to locate BIT node. No nodes defined"); - return null; - } - } - - /// - /// Runs BIT command for specific instrument and returns the results as a list - /// - /// - /// - /// - public async Task> RunBITWaitForResultsListAsync(string instrumentName, List commands) - { - if (_bitNodes.ContainsKey(instrumentName)) - { - return await RunBITWaitForResultsListAsync(commands, _bitNodes[instrumentName]); - } - else - { - _logger.Error($"Unable to locate BIT node {instrumentName}"); - return null; - } - } - - /// - /// asynchronously runs BIT command and waits for multiple results including parametric messages - /// - /// BIT instrument to run command - /// main command - /// timeout value in ms for the main response - /// optional parameters for the main command - /// list of additional response messages with their respective timeouts to wait for - /// parametric timeout value in ms - /// nack response id when provided will be expected as a possible response for either main response or parametric response - /// - /// - public async Task> RunBITWaitForResultsAsync( string instrumentName, - string bitCommandId, - int retries, - uint timeout, - IEnumerable> commandParams = null, - List parametricResponseIds = null, - uint timeout2 = 0, - string errorMessageId = null) - { - IBit bitGenSoftManager = _bitNodes[instrumentName] ?? throw new Exception("BitGenSoftManager is null. Unable to perform operation."); - - BITCommand command = BuildBITCommand(bitCommandId, retries, timeout, commandParams, parametricResponseIds, timeout2, errorMessageId); - - return await RunBITWaitForResultsListAsync(new List { command }, bitGenSoftManager); - } - - /// - /// keep reading any of the messages from the list - /// - /// - /// - /// - /// - /// - public async Task KeepReadingBitResultsListAsync(string instrumentName, List parametricResponseIds, CancellationToken token) - { - IBit bitNode = _bitNodes[instrumentName] ?? throw new Exception("BitGenSoftManager is null. Unable to perform operation."); - await KeepReadingBitResultsListAsync(parametricResponseIds, token, bitNode); - } - - /// - /// keep reading any of the messages from the list from the first node - /// - /// - /// - /// - /// - public async Task KeepReadingBitResultsListAsync(List parametricResponseIds, CancellationToken token) - { - IBit bitNode = _bitNodes.First().Value; - await KeepReadingBitResultsListAsync(parametricResponseIds, token, bitNode); - } - - /// - /// looking for a any of the messages from the list - /// - /// - /// - /// - /// - /// - public async Task> GetBitResultsListAsync(string instrumentName, List parametricResponseIds, int timeOut) - { - IBit bitNode = _bitNodes[instrumentName] ?? throw new Exception("BitGenSoftManager is null. Unable to perform operation."); - return await GetBitResultsListAsync(parametricResponseIds, timeOut, bitNode); - } - - /// - /// looking for a any of the messages from the list on the first node - /// - /// - /// - /// - /// - public async Task> GetBitResultsListAsync(List parametricResponseIds, int timeOut) - { - IBit bitNode = _bitNodes.First().Value; - return await GetBitResultsListAsync(parametricResponseIds, timeOut, bitNode); - } - - /// - /// look for results in the node until either result was found or canceled - /// - /// - /// - /// - public async Task GetBITResultsAsync(CancellationToken token, string responseId) - { - IBit bitNode = _bitNodes.First().Value; - return await GetBITResultsAsync(token, responseId, bitNode); - } - - /// - /// look for results in the node until either result was found or canceled - /// - /// - /// - /// - /// - public async Task GetBITResultsAsync(string instrumentName, CancellationToken token, string responseId) - { - IBit bitNode = _bitNodes[instrumentName] ?? throw new Exception("BitGenSoftManager is null. Unable to perform operation."); - return await GetBITResultsAsync(token, responseId, bitNode); - } - - /// - /// look for results in either node - /// - /// - /// - public BitTestResults GetBITResults(string messageId) - { - _logger.Trace($"Getting BIT result for: {messageId}."); - if (_bitNodes.Any()) - { - IBit bitNode = _bitNodes.First().Value; - return bitNode.GetBITResults(messageId); - } - else - return null; - } - - /// - /// look for results in either node - /// - /// - /// - /// - public BitTestResults GetBITResults(string instrumentName, string messageId) - { - _logger.Trace($"{instrumentName} Getting BIT result for: {messageId}."); - return _bitNodes.ContainsKey(instrumentName) ? _bitNodes[instrumentName].GetBITResults(messageId) : null; - } - - /// - /// opens a folder parse XML files for BITCommand definitions and returns a list - /// - /// - /// - public Dictionary> GetBITCommands(string directoryPath) - { - Dictionary> bitCommands = new Dictionary>(); - - try - { - string[] xmlFiles; - if (directoryPath.EndsWith(".xml", StringComparison.InvariantCultureIgnoreCase)) - { - xmlFiles = new string[] {directoryPath}; - } - else - { - // Get all XML files recursively in the specified directory - xmlFiles = Directory.GetFiles(directoryPath, "*.xml", SearchOption.TopDirectoryOnly); - } - - foreach (string xmlFile in xmlFiles) - { - ConfigurationFile configFile = new ConfigurationFile(xmlFile); - - List sections = configFile.ReadAllSections(); - - foreach (string section in sections) - { - List commands = configFile.ReadList(section, "BIT_CMD"); - if(bitCommands.ContainsKey(section)) - { - _logger.Warn($"Found a duplicate BIT configuration section {section}, overwriting from {xmlFile} file."); - } - else - { - _logger.Trace($"Adding {section} commands from {xmlFile} file"); - } - bitCommands[section] = commands; - } - } - } - catch (Exception ex) - { - _logger.Error(ex, $"Error reading BIT Command definitions in {directoryPath}"); - throw; - } - - return bitCommands; - } - - #region Private functions - - /// - /// will keep pumping messages from the receiving queue until canceled - /// - /// - /// - /// - /// - private async Task KeepReadingBitResultsListAsync(List parametricResponseIds, CancellationToken token, IBit bitNode) - { - _logger.Trace($"{bitNode.Name} Start continuously reading these messages: {string.Join(", ", parametricResponseIds)}."); - - Dictionary score = new Dictionary(); - do - { - foreach (var responseId in parametricResponseIds) - { - BitTestResults bitTestresults = await GetBITResultsAsync(token, responseId, bitNode); - - if (bitTestresults != null && !string.IsNullOrEmpty(bitTestresults.Label)) - { - if(uint.TryParse(bitTestresults.Label, out uint label)) - { - if(!score.ContainsKey(label)) - { - score.Add(label, 1); - } - else - { - score[label]++; - } - } - } - } - //await Task.Delay(_checkForMessageIntervalMs); - } while (!token.IsCancellationRequested); - - foreach (var item in score) - { - _logger.Trace($"{bitNode.Name} Dequeued the total of {item.Value} BIT messages for 0x{item.Key:X} label"); - } - } - - - /// - /// - /// - /// - /// - /// - /// - private async Task> GetBitResultsListAsync(List parametricResponseIds, int timeOut, IBit node) - { - _logger.Trace($"{node.Name} Start continuously getting BIT results for these messages: {string.Join(", ", parametricResponseIds)}."); - - List results = new List(); - - CancellationTokenSource tokenSource = new CancellationTokenSource(); - List> responseTasks = new List>(); - - foreach (var responseId in parametricResponseIds) - { - responseTasks.Add(GetBITResultsAsync(tokenSource.Token, responseId, node)); - } - - Task timeoutTask = Task.Delay(timeOut); - var completedTask = await Task.WhenAny(responseTasks.Concat(new[] { timeoutTask })); - - tokenSource.Cancel(); - tokenSource.Dispose(); - - if (completedTask == timeoutTask) - { - _logger.Warn($"Timed out after {timeOut} ms while waiting on parametrized response message(s) {string.Join(", ", parametricResponseIds)}"); - } - else - { - var completedResults = responseTasks.Where(t => t.Status == TaskStatus.RanToCompletion && t.Result != null).Select(t => t.Result); - results.AddRange(completedResults); - } - - _logger.Trace($"{node.Name} Completed getting BIT results for these messages: {string.Join(", ", parametricResponseIds)}, found {results?.Count} results"); - - return results; - } - - /// - /// look for results in the node until either result was found or canceled - /// - /// - /// - /// - /// - private async Task GetBITResultsAsync(CancellationToken token, string responseId, IBit node) - { - //_logger.Trace($"{node.Name} Start waiting for BIT message: {responseId}."); - - BitTestResults bitTestResults = null; - do - { - await Task.Delay(_checkForMessageIntervalMs); - try - { - bitTestResults = node.GetBITResults(responseId); - } - catch (Exception ex) - { - _logger.Error(ex, ex.Message); - break; - } - } while (bitTestResults == null && !token.IsCancellationRequested); - - //_logger.Trace($"{node.Name} Done waiting for BIT message: {responseId}."); - - return bitTestResults; - } - - /// - /// builds a command from parameters - /// - /// - /// - /// - /// - /// - /// - /// - /// - private static BITCommand BuildBITCommand(string bitCommandId, - int retries, - uint timeout, - IEnumerable> commandParams = null, - List parametricResponseIds = null, - uint timeout2 = 0, - string errorMessageId = null) - { - BITCommand bitCommand = new BITCommand - { - Command = bitCommandId, - CommandTimeout = timeout, - CommandParameters = new List(), - CommandResponses = new List(), - ParametricResponse = retries.ToString(), - ParametricTimeout = timeout2 - }; - - if (commandParams != null) - { - foreach (var commandParameter in commandParams) - { - bitCommand.CommandParameters.Add(new BITParameter - { - Key = commandParameter.Key, - Value = commandParameter.Value, - ParameterType = ParameterType.U - }); - } - } - if(parametricResponseIds != null) - { - foreach (var response in parametricResponseIds) - { - bitCommand.CommandResponses.Add(new BITResponseMsg - { - Name = response, - ResponseType = ResponseMessageType.P - }); - } - } - if(!string.IsNullOrEmpty(errorMessageId)) - { - bitCommand.CommandResponses.Add(new BITResponseMsg - { - Name = errorMessageId, - ResponseType = ResponseMessageType.E - }); - } - - return bitCommand; - } - - /// - /// - /// - /// - /// - /// - private List RunBITWaitForResultsList(List commands, IBit node) - { - List results = new List(); - - foreach (var command in commands) - { - string bitCommand = command.Command; - string bitResponseId = ResponseGroupForFirstBITCall(command); - uint timeout = command.CommandTimeout; - uint timeout2 = command.ParametricTimeout; - string strParamerticResponse = command.ParametricResponse; - int retries = 0; - if (int.TryParse(strParamerticResponse, out int tmpretries)) - { - retries = tmpretries; - } - List> commandParams = ConvertCommandParameters(command.CommandParameters); - int runIndex = 0; - do - { - runIndex++; - try - { - var result = node.RunBITWaitForResults(bitCommand, bitResponseId, timeout, commandParams); - results.Add(result); - } - catch (BitTimeoutException) - { - _logger.Warn($"Timeout after {timeout} ms on BIT command {bitCommand} waiting for result {bitResponseId}, retry number {runIndex}"); - if (runIndex == retries) - { - throw; - } - } - } while (results == null && runIndex <= retries); - - var responseGroup = ResponseGroupListForParameterBITCall(command); - - if (responseGroup == null || !responseGroup.Any()) - { - continue; - } - - CancellationTokenSource cts = new CancellationTokenSource(); - ParallelOptions options = new ParallelOptions - { - CancellationToken = cts.Token, - MaxDegreeOfParallelism = Environment.ProcessorCount - }; - - try - { - Parallel.ForEach(responseGroup, options, item => - { - var totalWaitTimeMs = _checkForMessageIntervalMs; - BitTestResults parametricresults; - do - { - parametricresults = node.GetBITResults(item); - - if (parametricresults != null) - { - break; - } - else - { - Thread.Sleep(_checkForMessageIntervalMs); - totalWaitTimeMs += _checkForMessageIntervalMs; - } - } while (totalWaitTimeMs < timeout2 && !cts.IsCancellationRequested); - - if (parametricresults == null && !cts.IsCancellationRequested) - { - _logger.Warn($"Timed out while waiting on parametrized response message(s) for {command.Command} command"); - } - - if (parametricresults != null) - { - // replace earlier results (confirmation message) with parametric results - results.Add(parametricresults); - cts.Cancel(); - } - }); - - } - catch (OperationCanceledException) - { - _logger.Trace($"Done waiting on parametrized response message(s) for {command.Command} command"); - } - finally - { - cts.Dispose(); - } - - } - - return results; - } - - /// - /// runs bit command and then - /// - /// - /// - /// - private async Task> RunBITWaitForResultsListAsync(List commands, IBit node) - { - List results = new List(); - - foreach (var command in commands) - { - string bitCommand = command.Command; - string bitResponseId = ResponseGroupForFirstBITCall(command); - uint timeout = command.CommandTimeout; - uint timeout2 = command.ParametricTimeout; - string strParamerticResponse = command.ParametricResponse; - int retries = 0; - if (int.TryParse(strParamerticResponse, out int tmpretries)) - { - retries = tmpretries; - } - List> commandParams = ConvertCommandParameters(command.CommandParameters); - int runIndex = 0; - do - { - runIndex++; - try - { - var result = await Task.Run(() => node.RunBITWaitForResults(bitCommand, bitResponseId, timeout, commandParams)); - results.Add(result); - } - catch (BitTimeoutException) - { - _logger.Warn($"Timeout after {timeout} ms on BIT command {bitCommand} waiting for result {bitResponseId}, retry number {runIndex}"); - if (runIndex == retries) - { - throw; - } - } - } while (results == null && runIndex <= retries); - - var responseGroup = ResponseGroupListForParameterBITCall(command); - - if (responseGroup == null || !responseGroup.Any()) - { - continue; - } - - var paramResults = await GetBitResultsListAsync(responseGroup, (int)timeout2, node); - if (paramResults != null) - { - results.AddRange(paramResults); - } - } - - return results; - } - - /// - /// for the initial BIT message expect to find R (main Response) - /// if any responses marked as E (error) add it to the list as alternative expected response, separated by comma - /// - /// - /// - private static string ResponseGroupForFirstBITCall(BITCommand command) - { - StringBuilder resp = new StringBuilder(); - var tempMainResponseGroup = command.CommandResponses.Where(m => m.ResponseType != ResponseMessageType.E).ToList(); - if (tempMainResponseGroup != null) - { - // check for Rs first and if no messages marked with Rs than check for Us - var mainResponse = tempMainResponseGroup.FirstOrDefault(m => m.ResponseType == ResponseMessageType.R); - if (mainResponse != null) - { - resp.Append(mainResponse.Name); - } - } - - // append all error message ids - foreach (var item in command.CommandResponses.Where(m => m.ResponseType == ResponseMessageType.E)) - { - resp.Append(','); - resp.Append(item.Name); - } - - return resp.ToString(); - } - /// - /// for subsequent parameter response look for either P (parameterized) or U (undefined) - /// if any responses marked as E (error) add it to the list as alternative expected response - /// - /// - /// - private static List ResponseGroupListForParameterBITCall(BITCommand command) - { - List resp = new List(); - bool parameterizedRespExpected = false; - var tempMainResponseGroup = command.CommandResponses.Where(m => m.ResponseType != ResponseMessageType.E).ToList(); - if (tempMainResponseGroup != null) - { - // check for Rs first and if no messages marked with Rs than check for Us - var mainResponse = tempMainResponseGroup.FirstOrDefault(m => m.ResponseType == ResponseMessageType.P || m.ResponseType == ResponseMessageType.U); - if (mainResponse != null) - { - resp.Add(mainResponse.Name); - parameterizedRespExpected = true; - } - } - if (parameterizedRespExpected) - { - // append all error message ids - foreach (var item in command.CommandResponses.Where(m => m.ResponseType == ResponseMessageType.E)) - { - resp.Add(item.Name); - } - } - return resp; - } - - private static List> ConvertCommandParameters(List @in) - { - List> parameters = new List>(); - foreach (var parameter in @in) - { - parameters.Add(new KeyValuePair(parameter.Key, parameter.Value)); - } - return parameters; - } - - #endregion - } -} diff --git a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/BitMsgRxBuffer.cs b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/BitMsgRxBuffer.cs index edbf05d..bc0c7d6 100644 --- a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/BitMsgRxBuffer.cs +++ b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/BitMsgRxBuffer.cs @@ -16,9 +16,9 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using System.Threading; using System.Collections.Generic; -using Raytheon.Common; +using System.Threading; +using NLog; namespace BitMeasurementManagerLib { @@ -34,6 +34,7 @@ namespace BitMeasurementManagerLib private BitMessageIDs _messageIds; private Dictionary> _msgList; private Dictionary _receivedMsgEvents; + private readonly ILogger _logger; #endregion #region PrivateFuctions @@ -43,6 +44,8 @@ namespace BitMeasurementManagerLib /// private BitMsgRxBuffer(BitMessageIDs messageIds) { + _logger = LogManager.GetCurrentClassLogger(); + _messageIds = messageIds; _msgList = new Dictionary>(); @@ -88,17 +91,17 @@ namespace BitMeasurementManagerLib if (shouldWeDeleteOthers == true) { - ErrorLogger.Instance().Write("BitMsgRxBuffer::AddMsg() - clearing list for " + msgId.ToString(), ErrorLogger.LogLevel.INFO); + _logger.Debug("clearing list for " + msgId.ToString()); ClearList(msgId); } if (_msgList.ContainsKey(msgId) == false) { - ErrorLogger.Instance().Write("BitMsgRxBuffer::AddMsg() - creating new list for " + msgId.ToString(), ErrorLogger.LogLevel.INFO); + _logger.Debug("creating new list for " + msgId.ToString()); _msgList[msgId] = new List(); } - ErrorLogger.Instance().Write("BitMsgRxBuffer::AddMsg() - Adding " + msgId.ToString() + " to the list", ErrorLogger.LogLevel.INFO); + _logger.Debug("Adding " + msgId.ToString() + " to the list"); _msgList[msgId].Add(msg); _receivedMsgEvents[msgId].Set(); diff --git a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/BitSimCommDeviceNode.cs b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/BitSimCommDeviceNode.cs index 5aa2821..4dbab4a 100644 --- a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/BitSimCommDeviceNode.cs +++ b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/BitSimCommDeviceNode.cs @@ -15,402 +15,331 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Instruments; -using Raytheon.Common; using System; using System.Runtime.InteropServices; using System.Threading; +using NLog; +using Raytheon.Common; +using Raytheon.Instruments; namespace BitMeasurementManagerLib { - /// - /// An interface to sending/receiving data over TCP sockets - /// - internal class BitSimCommDeviceNode : ICommDevice, IDisposable - { - #region PrivateClassMembers - private ICommDevice _commDevice; - private BitMessageIDs _messageIds; - private IWorkerInterface _socketReadWorker; - private Thread _socketReadThread; - private readonly string _name; - private SelfTestResult _selfTestResult; - private State _state; - #endregion + /// + /// An interface to sending/receiving data over TCP sockets + /// + internal class BitSimCommDeviceNode : ICommDevice, IDisposable + { + #region PrivateClassMembers + private ICommDevice _commDevice; + private BitMessageIDs _messageIds; + private IWorkerInterface _socketReadWorker; + private Thread _socketReadThread; + private readonly string _name; + private SelfTestResult _selfTestResult; + private State _state; + private readonly ILogger _logger; + #endregion - #region PrivateFunctions - /// - /// The finalizer. Necessary for quitting the read thread - /// - ~BitSimCommDeviceNode() - { - Dispose(false); - } + #region PrivateFunctions + /// + /// The finalizer. Necessary for quitting the read thread + /// + ~BitSimCommDeviceNode() + { + Dispose(false); + } - /// - /// Quit the threads associated with the node - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - State initialState = _state; + /// + /// Quit the threads associated with the node + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + State initialState = _state; - // close the socket and threads - try - { - if (initialState == State.Ready) - { - Shutdown(); + // close the socket and threads + if (initialState == State.Ready) + { + Shutdown(); - _commDevice.Shutdown(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + _commDevice.Shutdown(); + } - // dispose of the resources - try - { - if (initialState == State.Ready) - { - _socketReadWorker.Dispose(); - _state = State.Uninitialized; - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + // dispose of the resources + if (initialState == State.Ready) + { + _socketReadWorker.Dispose(); + _state = State.Uninitialized; + } + } + } - #endregion + #endregion - #region PublicFuctions + #region PublicFuctions - /// - /// - /// - /// The name of this instance - /// - /// - /// - /// - public BitSimCommDeviceNode(string name, ICommDevice commDevice, BitMessageIDs messageIds, MsgDevice msgHandler, uint commReadWorkerBufferSize = 100000, uint readWorkerRestTimeInMs = 10) - { - _name = name; + /// + /// + /// + /// The name of this instance + /// + /// + /// + /// + public BitSimCommDeviceNode(string name, ICommDevice commDevice, BitMessageIDs messageIds, MsgDevice msgHandler, uint commReadWorkerBufferSize = 100000, uint readWorkerRestTimeInMs = 10) + { + _logger = LogManager.GetCurrentClassLogger(); - _commDevice = commDevice; + _name = name; - _messageIds = messageIds; + _commDevice = commDevice; - _socketReadWorker = new CommReadWorker(this, msgHandler, commReadWorkerBufferSize, readWorkerRestTimeInMs); - _socketReadThread = new Thread(_socketReadWorker.DoWork); + _messageIds = messageIds; - // start the read thread - _socketReadThread.Start(); + _socketReadWorker = new CommReadWorker(this, msgHandler, commReadWorkerBufferSize, readWorkerRestTimeInMs); + _socketReadThread = new Thread(_socketReadWorker.DoWork); - _selfTestResult = SelfTestResult.Unknown; + // start the read thread + _socketReadThread.Start(); - _state = State.Uninitialized; - } + _selfTestResult = SelfTestResult.Unknown; - public void Open() - { - } + _state = State.Uninitialized; + } - /// - /// - /// - /// - public bool ClearErrors() - { - return true; - } + public void Open() + { + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } + /// + /// + /// + /// + public bool ClearErrors() + { + return true; + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a BIT Comm Sim Device Node " + _name; - } - } + set + { + throw new NotImplementedException(); + } + } - public void Close() - { - Dispose(); - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a BIT Comm Sim Device Node " + _name; + } + } - /// - /// Close the device - /// - /*public void Close() - { - const int THREAD_QUIT_TIMEOUT_MS = 3000; + public void Close() + { + Dispose(); + } - // tell the thread to quit - _socketReadWorker.QuitWork(); + /// + /// + /// + public void Dispose() + { + Dispose(true); - // close the socket which the thread might be blocked on - _commDevice.Close(); + GC.SuppressFinalize(this); + } - if (_socketReadThread.IsAlive) - { - bool didThreadQuit = _socketReadThread.Join(THREAD_QUIT_TIMEOUT_MS); + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + throw new NotImplementedException(); + } - if (didThreadQuit == false) - { - ErrorLogger.Instance().Write("BitSimCommDeviceNode::Close() - Logging Thread did not quit as expected, aborting it"); - _socketReadThread.Abort(); - } - else - { - ErrorLogger.Instance().Write("BitSimCommDeviceNode::Close() - Logging Thread quit successfully after join", ErrorLogger.LogLevel.INFO); - } - } - else - { - ErrorLogger.Instance().Write("BitSimCommDeviceNode::Close() - Logging Thread quit successfully", ErrorLogger.LogLevel.INFO); - } - }*/ + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + /// + /// + /// + public void Initialize() + { + _commDevice.Initialize(); + _state = State.Ready; + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - throw new NotImplementedException(); - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + return _commDevice.SelfTestResult; + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// Read data from the socket + /// + /// The data that was read + /// the number of bytes read + public uint Read(ref byte[] dataRead) + { + return 0; + } - /// - /// - /// - public void Initialize() - { - _commDevice.Initialize(); - _state = State.Ready; - } + /// + /// + public void Reset() + { + Close(); - /// - /// - /// - public string Name - { - get - { - return _name; - } - } + Initialize(); + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - return _commDevice.SelfTestResult; - } + /// + /// + /// + /// + public void SetReadTimeout(uint readTimeout) + { + } - /// - /// Read data from the socket - /// - /// The data that was read - /// the number of bytes read - public uint Read(ref byte[] dataRead) - { - return 0; - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - public void Reset() - { - Close(); + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - Initialize(); - } + /// + /// + /// + public void Shutdown() + { + const int THREAD_QUIT_TIMEOUT_MS = 3000; - /// - /// - /// - /// - public void SetReadTimeout(uint readTimeout) - { - } + if (_state == State.Ready) + { + // tell the thread to quit + _socketReadWorker.QuitWork(); - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + // close the socket which the thread might be blocked on + _commDevice.Shutdown(); - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + if (_socketReadThread.IsAlive) + { + bool didThreadQuit = _socketReadThread.Join(THREAD_QUIT_TIMEOUT_MS); - /// - /// - /// - public void Shutdown() - { - const int THREAD_QUIT_TIMEOUT_MS = 3000; + if (didThreadQuit == false) + { + _logger.Debug("Logging Thread did not quit as expected, aborting it"); + _socketReadThread.Abort(); + } + else + { + _logger.Debug("Logging Thread quit successfully after join"); + } + } + else + { + _logger.Debug("Logging Thread quit successfully"); + } + } - if (_state == State.Ready) - { - // tell the thread to quit - _socketReadWorker.QuitWork(); + _state = State.Uninitialized; + } - // close the socket which the thread might be blocked on - _commDevice.Shutdown(); + /// + /// Send data on the socket + /// + /// The data to send + /// The number of bytes to write from the dataToSend buffer + /// The number of bytes sent + public uint Write(byte[] dataToSend, uint numBytesToWrite) + { + // determine the id and get create the rsp message + IntPtr pDataPtr = Marshal.AllocHGlobal(dataToSend.Length); + Marshal.Copy(dataToSend, 0, pDataPtr, dataToSend.Length); + uint commandId = BitConfigurableMessageHeader.GetMessageId(pDataPtr, (uint)dataToSend.Length); + Marshal.FreeHGlobal(pDataPtr); - if (_socketReadThread.IsAlive) - { - bool didThreadQuit = _socketReadThread.Join(THREAD_QUIT_TIMEOUT_MS); + bool isThereAResponse = _messageIds.IsThereAResponseMessage(commandId); - if (didThreadQuit == false) - { - ErrorLogger.Instance().Write("BitSimCommDeviceNode::Close() - Logging Thread did not quit as expected, aborting it"); - _socketReadThread.Abort(); - } - else - { - ErrorLogger.Instance().Write("BitSimCommDeviceNode::Close() - Logging Thread quit successfully after join", ErrorLogger.LogLevel.INFO); - } - } - else - { - ErrorLogger.Instance().Write("BitSimCommDeviceNode::Close() - Logging Thread quit successfully", ErrorLogger.LogLevel.INFO); - } - } + // if there is a rsp msg, create a dummy msg + if (isThereAResponse == true) + { + uint rspId = _messageIds.GetResponseId(commandId); + BitConfigurableMessage rspMessage = BitConfigurableMessageFactory.Instance().RetreiveMessage(rspId); + BitMsgRxBuffer.Instance().AddMsg(rspMessage); + //uint msgLen = rspMessage.GetEntireMsgLength(); + //byte[] simData = new byte[msgLen]; + //_msgHandler.AddData(); + } + else + { + } - _state = State.Uninitialized; - } + return (uint)dataToSend.Length; + } - /// - /// Send data on the socket - /// - /// The data to send - /// The number of bytes to write from the dataToSend buffer - /// The number of bytes sent - public uint Write(byte[] dataToSend, uint numBytesToWrite) - { - // determine the id and get create the rsp message - IntPtr pDataPtr = Marshal.AllocHGlobal(dataToSend.Length); - Marshal.Copy(dataToSend, 0, pDataPtr, dataToSend.Length); - uint commandId = BitConfigurableMessageHeader.GetMessageId(pDataPtr, (uint)dataToSend.Length); - Marshal.FreeHGlobal(pDataPtr); - - bool isThereAResponse = _messageIds.IsThereAResponseMessage(commandId); - - // if there is a rsp msg, create a dummy msg - if (isThereAResponse == true) - { - uint rspId = _messageIds.GetResponseId(commandId); - BitConfigurableMessage rspMessage = BitConfigurableMessageFactory.Instance().RetreiveMessage(rspId); - BitMsgRxBuffer.Instance().AddMsg(rspMessage); - //uint msgLen = rspMessage.GetEntireMsgLength(); - //byte[] simData = new byte[msgLen]; - //_msgHandler.AddData(); - } - else - { - } - - return (uint)dataToSend.Length; - } - - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/CommDeviceNode.cs b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/CommDeviceNode.cs index 710b041..bd6993c 100644 --- a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/CommDeviceNode.cs +++ b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/CommDeviceNode.cs @@ -15,357 +15,316 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Common; - using System; using System.Threading; +using NLog; +using Raytheon.Common; namespace Raytheon.Instruments { - /// - /// An interface to sending/receiving data over comm devices - /// - internal class CommDeviceNode : ICommDevice, IDisposable - { - #region PrivateClassMembers - private ICommDevice _commDevice; - private IWorkerInterface _socketReadWorker; - private Thread _socketReadThread; - private readonly string _name; - private SelfTestResult _selfTestResult; - private State _state; + /// + /// An interface to sending/receiving data over comm devices + /// + internal class CommDeviceNode : ICommDevice, IDisposable + { + #region PrivateClassMembers + private ICommDevice _commDevice; + private IWorkerInterface _socketReadWorker; + private Thread _socketReadThread; + private readonly string _name; + private SelfTestResult _selfTestResult; + private State _state; - private uint _commReadWorkerBufferSize; - private uint _readWorkerRestTimeInMs; - private MsgDevice _msgHandler; + private uint _commReadWorkerBufferSize; + private uint _readWorkerRestTimeInMs; + private MsgDevice _msgHandler; + private readonly ILogger _logger; - #endregion + #endregion - #region PrivateFuctions - /// - /// The finalizer. Necessary for quitting the read thread - /// - ~CommDeviceNode() - { - Dispose(false); - } + #region PrivateFuctions + /// + /// The finalizer. Necessary for quitting the read thread + /// + ~CommDeviceNode() + { + Dispose(false); + } - /// - /// Quit the threads associated with the node - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - State initialState = _state; + /// + /// Quit the threads associated with the node + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + State initialState = _state; - // close the socket and threads - try - { - if (initialState == State.Ready) - { - Shutdown(); - _commDevice.Shutdown(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + // close the socket and threads + if (initialState == State.Ready) + { + Shutdown(); + _commDevice.Shutdown(); + } - // dispose of the resources - try - { - if (initialState == State.Ready) - { - _socketReadWorker.Dispose(); - _state = State.Uninitialized; - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - } + // dispose of the resources + if (initialState == State.Ready) + { + _socketReadWorker.Dispose(); + _state = State.Uninitialized; + } + } + } - #endregion + #endregion - #region PublicFuctions + #region PublicFuctions - /// - /// The constructor - /// - /// The name of this instance - /// The communication device - /// The message handler for this interface - /// The number of bytes for the buffer internal to this class. Each individual read will read upto this buffer size (or until the timeout happens) - /// Number of ms to reset between read calls on the comm interface - public CommDeviceNode(string name, ICommDevice commDevice, MsgDevice msgHandler, uint commReadWorkerBufferSize = 100000, uint readWorkerRestTimeInMs = 10) - { - _name = name; - _commDevice = commDevice; - - _commReadWorkerBufferSize = commReadWorkerBufferSize; - _readWorkerRestTimeInMs = readWorkerRestTimeInMs; - _msgHandler = msgHandler; + /// + /// The constructor + /// + /// The name of this instance + /// The communication device + /// The message handler for this interface + /// The number of bytes for the buffer internal to this class. Each individual read will read upto this buffer size (or until the timeout happens) + /// Number of ms to reset between read calls on the comm interface + public CommDeviceNode(string name, ICommDevice commDevice, MsgDevice msgHandler, uint commReadWorkerBufferSize = 100000, uint readWorkerRestTimeInMs = 10) + { + _logger = LogManager.GetCurrentClassLogger(); + _name = name; + _commDevice = commDevice; - Open(); - } + _commReadWorkerBufferSize = commReadWorkerBufferSize; + _readWorkerRestTimeInMs = readWorkerRestTimeInMs; + _msgHandler = msgHandler; - /// - /// Starts communication thread - /// - public void Open() - { - _socketReadWorker = new CommReadWorker(this, _msgHandler, _commReadWorkerBufferSize, _readWorkerRestTimeInMs); - _socketReadThread = new Thread(_socketReadWorker.DoWork); + Open(); + } - // start the read thread - _socketReadThread.Start(); + /// + /// Starts communication thread + /// + public void Open() + { + _socketReadWorker = new CommReadWorker(this, _msgHandler, _commReadWorkerBufferSize, _readWorkerRestTimeInMs); + _socketReadThread = new Thread(_socketReadWorker.DoWork); - _selfTestResult = SelfTestResult.Unknown; - _state = State.Uninitialized; - } + // start the read thread + _socketReadThread.Start(); + + _selfTestResult = SelfTestResult.Unknown; + _state = State.Uninitialized; + } - /// - /// there is no error msg repository - /// - /// - public bool ClearErrors() - { - return false; - } + /// + /// there is no error msg repository + /// + /// + public bool ClearErrors() + { + return false; + } - /// - /// - /// - public bool DisplayEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool DisplayEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public string DetailedStatus - { - get - { - return "This is a Comm Sim Device Node " + _name; - } - } + /// + /// + /// + public string DetailedStatus + { + get + { + return "This is a Comm Sim Device Node " + _name; + } + } - /// - /// - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// - /// - public bool FrontPanelEnabled - { - get - { - return false; - } - set - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public bool FrontPanelEnabled + { + get + { + return false; + } + set + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public InstrumentMetadata Info - { - get - { - throw new NotImplementedException(); - } - } + /// + /// + /// + public InstrumentMetadata Info + { + get + { + throw new NotImplementedException(); + } + } - /// - /// - /// - public void Initialize() - { - _commDevice.Initialize(); - _state = State.Ready; - } + /// + /// + /// + public void Initialize() + { + _commDevice.Initialize(); + _state = State.Ready; + } - /// - /// - /// - public string Name - { - get - { - return _name; - } - } + /// + /// + /// + public string Name + { + get + { + return _name; + } + } - /// - /// - /// - /// - public SelfTestResult PerformSelfTest() - { - throw new NotImplementedException(); - } + /// + /// + /// + /// + public SelfTestResult PerformSelfTest() + { + throw new NotImplementedException(); + } - /// - /// Read data from the socket - /// - /// The data that was read - /// the number of bytes read - public uint Read(ref byte[] dataRead) - { - return _commDevice.Read(ref dataRead); - } + /// + /// Read data from the socket + /// + /// The data that was read + /// the number of bytes read + public uint Read(ref byte[] dataRead) + { + return _commDevice.Read(ref dataRead); + } - /// - /// Resets communications - /// - public void Reset() - { - Close(); - Open(); - } + /// + /// Resets communications + /// + public void Reset() + { + Close(); + Open(); + } - /// - /// - /// - /// - public void SetReadTimeout(uint readTimeout) - { - _commDevice.SetReadTimeout(readTimeout); - } + /// + /// + /// + /// + public void SetReadTimeout(uint readTimeout) + { + _commDevice.SetReadTimeout(readTimeout); + } - /// - /// - /// - public SelfTestResult SelfTestResult - { - get - { - return _selfTestResult; - } - } + /// + /// + /// + public SelfTestResult SelfTestResult + { + get + { + return _selfTestResult; + } + } - /// - /// - /// - public State Status - { - get - { - return _state; - } - } + /// + /// + /// + public State Status + { + get + { + return _state; + } + } - /// - /// Close communications - /// - public void Close() - { - Shutdown(); - } + /// + /// Close communications + /// + public void Close() + { + Shutdown(); + } - /// - /// Close communications - /// - public void Shutdown() - { - if (_state == State.Ready) - { - const int THREAD_QUIT_TIMEOUT_MS = 3000; + /// + /// Close communications + /// + public void Shutdown() + { + if (_state == State.Ready) + { + const int THREAD_QUIT_TIMEOUT_MS = 3000; - // tell the thread to quit - _socketReadWorker.QuitWork(); + // tell the thread to quit + _socketReadWorker.QuitWork(); - // close the socket which the thread might be blocked on - _commDevice.Shutdown(); + // close the socket which the thread might be blocked on + _commDevice.Shutdown(); - if (_socketReadThread.IsAlive) - { - bool didThreadQuit = _socketReadThread.Join(THREAD_QUIT_TIMEOUT_MS); + if (_socketReadThread.IsAlive) + { + bool didThreadQuit = _socketReadThread.Join(THREAD_QUIT_TIMEOUT_MS); - if (didThreadQuit == false) - { - ErrorLogger.Instance().Write("CommDeviceNode::Close() - Logging Thread did not quit as expected, aborting it"); - _socketReadThread.Abort(); - } - else - { - ErrorLogger.Instance().Write("CommDeviceNode::Close() - Logging Thread quit successfully after join", ErrorLogger.LogLevel.INFO); - } - } - else - { - ErrorLogger.Instance().Write("CommDeviceNode::Close() - Logging Thread quit successfully", ErrorLogger.LogLevel.INFO); - } - } + if (didThreadQuit == false) + { + _socketReadThread.Abort(); + } + else + { + _logger.Debug("Logging Thread quit successfully after join"); + } + } + else + { + _logger.Debug("Logging Thread quit successfully"); + } + } - _state = State.Uninitialized; - } + _state = State.Uninitialized; + } - /// - /// Send data on the socket - /// - /// The data to send - /// The number of bytes to write from the dataToSend buffer - /// The number of bytes sent - public uint Write(byte[] dataToSend, uint numBytesToWrite) - { - return _commDevice.Write(dataToSend, numBytesToWrite); - } + /// + /// Send data on the socket + /// + /// The data to send + /// The number of bytes to write from the dataToSend buffer + /// The number of bytes sent + public uint Write(byte[] dataToSend, uint numBytesToWrite) + { + return _commDevice.Write(dataToSend, numBytesToWrite); + } - #endregion - } + #endregion + } } diff --git a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/CommReadWorker.cs b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/CommReadWorker.cs index 2e8b1ef..778c80d 100644 --- a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/CommReadWorker.cs +++ b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Lib/CommReadWorker.cs @@ -17,8 +17,7 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. using System; using System.Threading; -using System.Net.Sockets; -using Raytheon.Instruments; +using NLog; using Raytheon.Common; namespace Raytheon.Instruments @@ -35,6 +34,7 @@ namespace Raytheon.Instruments private AutoResetEvent _quitEvent; private byte[] _dataRead; private readonly uint _timeToRestBetweenReadsInMs; + private readonly ILogger _logger; #endregion #region PublicFuctions @@ -48,6 +48,7 @@ namespace Raytheon.Instruments /// Number of ms to rest after a read call public CommReadWorker(ICommDevice commNode, MsgDevice msghandler, uint bufferSize, uint timeToRestBetweenReadsInMs) { + _logger = LogManager.GetCurrentClassLogger(); _commNode = commNode; _threadQuitControl = false; _msgHandler = msghandler; @@ -69,23 +70,9 @@ namespace Raytheon.Instruments /// public void Dispose() { - try - { - Dispose(true); + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + GC.SuppressFinalize(this); } /// @@ -110,33 +97,14 @@ namespace Raytheon.Instruments // not using timeToRestBetweenReadsInMs. Just going to wait 1 ms and get back to the read if (_quitEvent.WaitOne(1)) { - ErrorLogger.Instance().Write("CommReadWorker::DoWork() - received signal to quit", ErrorLogger.LogLevel.INFO); + _logger.Debug("received signal to quit"); _threadQuitControl = true; } } - catch (SocketException e) - { - if (e.SocketErrorCode == SocketError.TimedOut) - { - //expected - } - else - { - ErrorLogger.Instance().Write("CommReadWorker::DoWork() - " + e.Message, ErrorLogger.LogLevel.ERROR); - } - } - catch (Exception e) - { - ErrorLogger.Instance().Write("CommReadWorker::DoWork() - " + e.Message, ErrorLogger.LogLevel.ERROR); - } + catch (Exception) { } } - - ErrorLogger.Instance().Write("CommReadWorker::DoWork() - exiting", ErrorLogger.LogLevel.INFO); - } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); } + catch (Exception) { } } /// @@ -154,23 +122,9 @@ namespace Raytheon.Instruments /// protected virtual void Dispose(bool disposing) { - try + if (disposing) { - if (disposing) - { - _quitEvent.Dispose(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } + _quitEvent.Dispose(); } } #endregion diff --git a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Messages/BitConfigurableMessageHeader.cs b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Messages/BitConfigurableMessageHeader.cs index 0b9227a..5d69409 100644 --- a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Messages/BitConfigurableMessageHeader.cs +++ b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/Messages/BitConfigurableMessageHeader.cs @@ -15,8 +15,8 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Common; using System; +using Raytheon.Common; namespace BitMeasurementManagerLib { @@ -71,8 +71,7 @@ namespace BitMeasurementManagerLib // is there enough data? if (numBytesInPdata <= headerDef.secondaryMsgIdByteLocation + headerDef.secondaryMsgIdDataLen) { - ErrorLogger.Instance().Write("BitConfigurableMessageHeader::GetSecondaryCmdMessageId() - not enough data form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + (headerDef.secondaryMsgIdByteLocation + headerDef.secondaryMsgIdDataLen).ToString() + " for a header", ErrorLogger.LogLevel.INFO); - throw new Exception("BitConfigurableMessageHeader::GetSecondaryCmdMessageId() - not enough data form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + (headerDef.secondaryMsgIdByteLocation + headerDef.secondaryMsgIdDataLen).ToString() + " for a header"); + throw new Exception("Not enough data form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + (headerDef.secondaryMsgIdByteLocation + headerDef.secondaryMsgIdDataLen).ToString() + " for a header"); } if (headerDef.secondaryMsgIdByteLocation == 0) @@ -141,8 +140,7 @@ namespace BitMeasurementManagerLib // is there enough data? if (numBytesInPdata <= headerDef.msgIdByteLocation + headerDef.msgIdDataLen) { - ErrorLogger.Instance().Write("BitConfigurableMessageHeader::GetCmdMessageId() - not enough data form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + (headerDef.msgIdByteLocation + headerDef.msgIdDataLen).ToString() + " for a header", ErrorLogger.LogLevel.INFO); - throw new Exception("BitConfigurableMessageHeader::GetCmdMessageId() - not enough data form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + (headerDef.msgIdByteLocation + headerDef.msgIdDataLen).ToString() + " for a header"); + throw new Exception("Not enough data form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + (headerDef.msgIdByteLocation + headerDef.msgIdDataLen).ToString() + " for a header"); } uint cmdId = 0; diff --git a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/MsgHandler/BitMsgHandler.cs b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/MsgHandler/BitMsgHandler.cs index 24d9e3e..ca78909 100644 --- a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/MsgHandler/BitMsgHandler.cs +++ b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/MsgHandler/BitMsgHandler.cs @@ -16,9 +16,10 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using Raytheon.Common; -using System.IO; using System.Collections.Generic; +using System.IO; +using NLog; +using Raytheon.Common; namespace BitMeasurementManagerLib { @@ -48,6 +49,7 @@ namespace BitMeasurementManagerLib private readonly bool _shallWeLogIncomingAsciiData; private readonly uint _bitmask; private readonly string _crcFieldName; + private readonly ILogger _logger; #endregion #region PublicFuctions @@ -66,6 +68,7 @@ namespace BitMeasurementManagerLib unsafe public BitMsgHandler(BitMessageIDs messageIds, MeasurementManagerLib.BitMeasurementManager.MessageReceivedDelegate callback, uint bufferSize, string binLogFileName, string asciiLogFileName, bool shallWeLogOutgoingBinData, bool shallWeLogOutgoingAsciiData, bool shallWeLogIncomingBinData, bool shallWeLogIncomingAsciiData, uint crcBitmask, string crcFieldName, bool shallWePerformVerboseParserLogging) : base(new BitMsgParser(messageIds, shallWePerformVerboseParserLogging), bufferSize) { + _logger = LogManager.GetCurrentClassLogger(); _messageIds = messageIds; // hold onto the callback @@ -166,7 +169,7 @@ namespace BitMeasurementManagerLib { if (_messageIds.ContainsId(msgId) == false) { - ErrorLogger.Instance().Write("BitMsgHandler::OnCompleteMessage() - detected unknown msg id: " + msgId.ToString()); + _logger.Warn("BitMsgHandler::OnCompleteMessage() - detected unknown msg id: " + msgId.ToString()); } else { @@ -184,7 +187,7 @@ namespace BitMeasurementManagerLib if (maskedStatus != 0) { - ErrorLogger.Instance().Write($"Message Status register indicates that a CRC error may have occurred. Raw status read: 0x{rawStatus:X8}. Masked status value: 0x{maskedStatus:X8}"); + _logger.Warn($"Message Status register indicates that a CRC error may have occurred. Raw status read: 0x{rawStatus:X8}. Masked status value: 0x{maskedStatus:X8}"); callbackValue = -1; } } @@ -207,14 +210,10 @@ namespace BitMeasurementManagerLib } // some debugging - ErrorLogger.Instance().Write("BitMsgHandler::HandleMsg() - added message " + msgId.ToString("X8") + " to buffer ", ErrorLogger.LogLevel.INFO); + _logger.Debug("added message " + msgId.ToString("X8") + " to buffer "); } } - catch (Exception err) - { - //@@@ need to flow error to the host - ErrorLogger.Instance().Write("BitMsgHandler::HandleMsg() - caught an error: " + err.Message, ErrorLogger.LogLevel.ERROR); - } + catch { } } /// @@ -271,7 +270,7 @@ namespace BitMeasurementManagerLib { if (_binWriter == null && _shallWeLogIncomingBinData == true) { - throw new Exception("BitMsgHandler::WriteIncomingDataToLog() - Trying to log bin data before the log file is open"); + throw new Exception("Trying to log bin data before the log file is open"); } else if (_shallWeLogIncomingBinData == true) { @@ -292,7 +291,7 @@ namespace BitMeasurementManagerLib { if (_asciiWriter == null && _shallWeLogIncomingAsciiData == true) { - throw new Exception("BitMsgHandler::WriteIncomingDataToLog() - Trying to log ascii data before the log file is open"); + throw new Exception("Trying to log ascii data before the log file is open"); } else if (_shallWeLogIncomingAsciiData == true) { @@ -318,7 +317,7 @@ namespace BitMeasurementManagerLib { if (_binWriter == null && _shallWeLogOutgoingBinData == true) { - throw new Exception("BitMsgHandler::WriteOutgoingDataToLog() - Trying to log bin data before the log file is open"); + throw new Exception("Trying to log bin data before the log file is open"); } else if (_shallWeLogOutgoingBinData == true) { @@ -339,7 +338,7 @@ namespace BitMeasurementManagerLib { if (_asciiWriter == null && _shallWeLogOutgoingAsciiData == true) { - throw new Exception("BitMsgHandler::WriteOutgoingDataToLog() - Trying to log ascii data before the log file is open"); + throw new Exception("Trying to log ascii data before the log file is open"); } else if (_shallWeLogOutgoingAsciiData == true) { @@ -362,25 +361,18 @@ namespace BitMeasurementManagerLib { if (disposing) { - try + // call the parent dispose first + base.Dispose(disposing); + + // now dispose of our resources + if (_binWriter != null) { - // call the parent dispose first - base.Dispose(disposing); - - // now dispose of our resources - if (_binWriter != null) - { - _binWriter.Dispose(); - } - - if (_asciiWriter != null) - { - _asciiWriter.Dispose(); - } + _binWriter.Dispose(); } - catch (Exception err) + + if (_asciiWriter != null) { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); + _asciiWriter.Dispose(); } } } diff --git a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/MsgHandler/BitMsgParser.cs b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/MsgHandler/BitMsgParser.cs index 53182f4..978795f 100644 --- a/Source/TSRealLib/MAL/Managers/BitMeasurementManager/MsgHandler/BitMsgParser.cs +++ b/Source/TSRealLib/MAL/Managers/BitMeasurementManager/MsgHandler/BitMsgParser.cs @@ -15,8 +15,9 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Common; using System; +using NLog; +using Raytheon.Common; namespace BitMeasurementManagerLib { @@ -34,6 +35,7 @@ namespace BitMeasurementManagerLib private readonly BitMessageIDs _messageIdToSizeMap; private BitMsgEndianControl.HeaderDef _headerDef; private readonly bool _shallWePerformVerboseParserLogging; + private readonly ILogger _logger; #endregion #region PrivateFuctions @@ -54,7 +56,7 @@ namespace BitMeasurementManagerLib if (numBytesInPdata < payloadHeaderSize) { - ErrorLogger.Instance().Write("BitMsgParser::HandleData() - not enough data in the buffer to form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + payloadHeaderSize.ToString() + " for a header", ErrorLogger.LogLevel.INFO); + _logger.Debug("not enough data in the buffer to form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + payloadHeaderSize.ToString() + " for a header"); bytesToRemove = 0; return false; } @@ -67,8 +69,8 @@ namespace BitMeasurementManagerLib if (_messageIdToSizeMap.ContainsId(id) == false) { uint numBytesToRemove = Resync(pData, numBytesInPdata); - string msg = "BitMsgParser::HandleData() - unknown id received: " + id.ToString("X8") + " When resyncing threw away " + numBytesToRemove.ToString() + " Bytes"; - ErrorLogger.Instance().Write(msg, ErrorLogger.LogLevel.ERROR); + string msg = "unknown id received: " + id.ToString("X8") + " When resyncing threw away " + numBytesToRemove.ToString() + " Bytes"; + _logger.Warn(msg); bytesToRemove = numBytesToRemove; return false; } @@ -79,8 +81,8 @@ namespace BitMeasurementManagerLib if (secondaryId != _headerDef.secondaryMsgIdExpectedValue) { uint numBytesToRemove = Resync(pData, numBytesInPdata); - string msg = "BitMsgParser::HandleData() - detected seondary ID: " + secondaryId.ToString("X8") + " was not as expected: " + _headerDef.secondaryMsgIdExpectedValue.ToString("X8") + " When resyncing threw away " + numBytesToRemove.ToString() + " Bytes"; - ErrorLogger.Instance().Write(msg, ErrorLogger.LogLevel.ERROR); + string msg = "detected seondary ID: " + secondaryId.ToString("X8") + " was not as expected: " + _headerDef.secondaryMsgIdExpectedValue.ToString("X8") + " When resyncing threw away " + numBytesToRemove.ToString() + " Bytes"; + _logger.Warn(msg); bytesToRemove = numBytesToRemove; return false; } @@ -91,7 +93,7 @@ namespace BitMeasurementManagerLib // do we have enough data to make the complete message if (numBytesInPdata < msgSize) { - ErrorLogger.Instance().Write("BitMsgParser::HandleData() - not enough data in the buffer to form a entire message. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, expected msg size is: " + msgSize.ToString(), ErrorLogger.LogLevel.INFO); + _logger.Debug("not enough data in the buffer to form a entire message. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, expected msg size is: " + msgSize.ToString()); // need to wait for more data bytesToRemove = 0; return false; @@ -102,7 +104,7 @@ namespace BitMeasurementManagerLib if (_shallWePerformVerboseParserLogging == true) { - ErrorLogger.Instance().Write("BitMsgParser::HandleData() - found msg: " + id.ToString() + " which has " + msgSize.ToString() + " bytes", ErrorLogger.LogLevel.INFO); + _logger.Debug("found msg: " + id.ToString() + " which has " + msgSize.ToString() + " bytes"); } messageId = id; @@ -118,7 +120,7 @@ namespace BitMeasurementManagerLib /// The number of bytes to remove from the buffer private uint Resync(IntPtr pData, uint numBytesInPdata) { - ErrorLogger.Instance().Write("BitMsgParser::Resync() - Begin", ErrorLogger.LogLevel.INFO); + _logger.Debug("Begin"); // increment pData by 1 pData = IntPtr.Add(pData, 1); @@ -138,7 +140,7 @@ namespace BitMeasurementManagerLib if (numBytesInPdata < payloadHeaderSize) { - ErrorLogger.Instance().Write("BitMsgParser::Resync() - not enough data in the buffer to form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + payloadHeaderSize.ToString() + " for a header. Removing " + bytesToRemove.ToString() + " bytes", ErrorLogger.LogLevel.INFO); + _logger.Debug("not enough data in the buffer to form a header. Buffer contained " + Convert.ToString(numBytesInPdata) + " bytes, needed " + payloadHeaderSize.ToString() + " for a header. Removing " + bytesToRemove.ToString() + " bytes"); break; } @@ -179,20 +181,20 @@ namespace BitMeasurementManagerLib else { didWeFindMsg = true; - ErrorLogger.Instance().Write("BitMsgParser::Resync() - Detected message ID: " + id.ToString("X8") + ". Detected Secondary ID: " + secondaryId.ToString("X8") + " Resync complete. Removing " + bytesToRemove.ToString() + " Bytes", ErrorLogger.LogLevel.INFO); + _logger.Debug("Detected message ID: " + id.ToString("X8") + ". Detected Secondary ID: " + secondaryId.ToString("X8") + " Resync complete. Removing " + bytesToRemove.ToString() + " Bytes"); break; } } else { didWeFindMsg = true; - ErrorLogger.Instance().Write("BitMsgParser::Resync() - Detected message ID: " + id.ToString("X8") + ". Resync complete. Removing " + bytesToRemove.ToString() + " Bytes", ErrorLogger.LogLevel.INFO); + _logger.Debug("Detected message ID: " + id.ToString("X8") + ". Resync complete. Removing " + bytesToRemove.ToString() + " Bytes"); break; } } } - ErrorLogger.Instance().Write("BitMsgParser::Resync() - returning " + bytesToRemove.ToString(), ErrorLogger.LogLevel.INFO); + _logger.Debug("returning " + bytesToRemove.ToString()); return bytesToRemove; @@ -208,6 +210,7 @@ namespace BitMeasurementManagerLib /// public BitMsgParser(BitMessageIDs messageIds, bool shallWePerformVerboseParserLogging) { + _logger = LogManager.GetCurrentClassLogger(); // Using it to hold onto valid message ids and the size _messageIdToSizeMap = messageIds; _shallWePerformVerboseParserLogging = shallWePerformVerboseParserLogging; diff --git a/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ChillerCartMeasurementManager.cs b/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ChillerCartMeasurementManager.cs index 597839e..14f979b 100644 --- a/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ChillerCartMeasurementManager.cs +++ b/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ChillerCartMeasurementManager.cs @@ -15,12 +15,11 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using Raytheon.Instruments; -using Raytheon.Common; using System; using System.Threading; using ChillerCartMeasurementManagerLib; using NLog; +using Raytheon.Instruments; namespace MeasurementManagerLib { @@ -165,15 +164,6 @@ namespace MeasurementManagerLib _logger?.Error(err.Message + "\r\n" + err.StackTrace); } } - - try - { - ErrorLogger.Instance().Dispose(); - } - catch (Exception) - { - // nothing to do - } } } diff --git a/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/ChillerDataLogWorker.cs b/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/ChillerDataLogWorker.cs index 3a2411a..7deb285 100644 --- a/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/ChillerDataLogWorker.cs +++ b/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/ChillerDataLogWorker.cs @@ -16,10 +16,11 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using System.Threading; -using Raytheon.Common; using System.IO; +using System.Threading; using MeasurementManagerLib; +using NLog; +using Raytheon.Common; namespace ChillerCartMeasurementManagerLib { @@ -37,6 +38,7 @@ namespace ChillerCartMeasurementManagerLib private readonly ChillerCartMeasurementManager.ChillerDelegate _callback; private readonly string _logFileName; private readonly int _threadRestTimeMs; + private readonly ILogger _logger; #endregion #region PrivateFunctions @@ -55,25 +57,11 @@ namespace ChillerCartMeasurementManagerLib /// protected virtual void Dispose(bool disposing) { - try + if (disposing) { - if (disposing) - { - _fileWriter.Dispose(); + _fileWriter.Dispose(); - _quitEvent.Dispose(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } + _quitEvent.Dispose(); } } #endregion @@ -88,6 +76,8 @@ namespace ChillerCartMeasurementManagerLib /// public ChillerDataLogWorker(ChillerCartMeasurementManager controller, string logFileName, int threadRestTimeMs, ChillerCartMeasurementManager.ChillerDelegate callback) { + _logger = LogManager.GetCurrentClassLogger(); + _threadQuitControl = false; _quitEvent = new AutoResetEvent(false); @@ -123,23 +113,9 @@ namespace ChillerCartMeasurementManagerLib /// public void Dispose() { - try - { - Dispose(true); + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + GC.SuppressFinalize(this); } /// @@ -176,7 +152,6 @@ namespace ChillerCartMeasurementManagerLib catch (Exception e) { string msg = e.Message; - ErrorLogger.Instance().Write(msg + "\r\n" + e.StackTrace, ErrorLogger.LogLevel.ERROR); _fileWriter.WriteLine(Util.GetTimeString() + ", " + msg); @@ -184,12 +159,9 @@ namespace ChillerCartMeasurementManagerLib _callback?.Invoke(-1, -1, -1); } } - ErrorLogger.Instance().Write("ChillerCartDataLogWorker::DoWork() - exiting", ErrorLogger.LogLevel.INFO); } - catch (Exception err) + catch (Exception) { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - //Send error code to callback if valid _callback?.Invoke(-1, -1, -1); } diff --git a/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/FlowMeterDataLogWorker.cs b/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/FlowMeterDataLogWorker.cs index 21f58c8..deadaa9 100644 --- a/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/FlowMeterDataLogWorker.cs +++ b/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/FlowMeterDataLogWorker.cs @@ -16,10 +16,11 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using System.Threading; -using Raytheon.Common; using System.IO; +using System.Threading; using MeasurementManagerLib; +using NLog; +using Raytheon.Common; namespace ChillerCartMeasurementManagerLib { @@ -37,6 +38,7 @@ namespace ChillerCartMeasurementManagerLib private readonly ChillerCartMeasurementManager.FlowMeterDelegate _callback; private readonly string _logFileName; private readonly int _threadRestTimeMs; + private readonly ILogger _logger; #endregion #region PrivateFunctions @@ -56,25 +58,11 @@ namespace ChillerCartMeasurementManagerLib /// protected virtual void Dispose(bool disposing) { - try + if (disposing) { - if (disposing) - { - _fileWriter.Dispose(); + _fileWriter.Dispose(); - _quitEvent.Dispose(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } + _quitEvent.Dispose(); } } #endregion @@ -89,6 +77,8 @@ namespace ChillerCartMeasurementManagerLib /// public FlowMeterDataLogWorker(ChillerCartMeasurementManager controller, string logFileName, int threadRestTimeMs, ChillerCartMeasurementManager.FlowMeterDelegate callback) { + _logger = LogManager.GetCurrentClassLogger(); + _threadQuitControl = false; _quitEvent = new AutoResetEvent(false); @@ -122,23 +112,9 @@ namespace ChillerCartMeasurementManagerLib /// public void Dispose() { - try - { - Dispose(true); + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + GC.SuppressFinalize(this); } /// @@ -175,8 +151,6 @@ namespace ChillerCartMeasurementManagerLib { string msg = e.Message; - ErrorLogger.Instance().Write(msg + "\r\n" + e.StackTrace, ErrorLogger.LogLevel.ERROR); - _fileWriter.WriteLine(Util.GetTimeString() + ", " + msg); //Invoke the callback if valid @@ -186,12 +160,9 @@ namespace ChillerCartMeasurementManagerLib } } } - ErrorLogger.Instance().Write("FlowMeterDataLogWorker::DoWork() - exiting", ErrorLogger.LogLevel.INFO); } - catch (Exception err) + catch (Exception) { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - //Send error code to callback if valid if (_callback != null && _threadQuitControl == false) { diff --git a/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/TempDataLogWorker.cs b/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/TempDataLogWorker.cs index 5bad98d..8d93ce4 100644 --- a/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/TempDataLogWorker.cs +++ b/Source/TSRealLib/MAL/Managers/ChillerCartMeasurementManager/ThreadWorkers/TempDataLogWorker.cs @@ -16,10 +16,11 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; -using System.Threading; -using Raytheon.Common; using System.IO; +using System.Threading; using MeasurementManagerLib; +using NLog; +using Raytheon.Common; namespace ChillerCartMeasurementManagerLib { @@ -37,6 +38,7 @@ namespace ChillerCartMeasurementManagerLib private readonly ChillerCartMeasurementManager.TemperatureDelegate _callback; private readonly string _logFileName; private readonly int _threadRestTimeMs; + private readonly ILogger _logger; #endregion @@ -57,25 +59,11 @@ namespace ChillerCartMeasurementManagerLib /// protected virtual void Dispose(bool disposing) { - try + if (disposing) { - if (disposing) - { - _fileWriter.Dispose(); + _fileWriter.Dispose(); - _quitEvent.Dispose(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } + _quitEvent.Dispose(); } } #endregion @@ -91,6 +79,8 @@ namespace ChillerCartMeasurementManagerLib /// public TempDataLogWorker(ChillerCartMeasurementManager controller, string logFileName, int threadRestTimeMs, ChillerCartMeasurementManager.TemperatureDelegate callback) { + _logger = LogManager.GetCurrentClassLogger(); + _threadQuitControl = false; _quitEvent = new AutoResetEvent(false); @@ -125,23 +115,9 @@ namespace ChillerCartMeasurementManagerLib /// public void Dispose() { - try - { - Dispose(true); + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } + GC.SuppressFinalize(this); } /// @@ -177,7 +153,6 @@ namespace ChillerCartMeasurementManagerLib catch (Exception e) { string msg = e.Message; - ErrorLogger.Instance().Write(msg + "\r\n" + e.StackTrace, ErrorLogger.LogLevel.ERROR); _fileWriter.WriteLine(Util.GetTimeString() + ", " + msg); @@ -185,12 +160,9 @@ namespace ChillerCartMeasurementManagerLib _callback?.Invoke(-1, -1); } } - ErrorLogger.Instance().Write("TempDataLogWorker::DoWork() - exiting", ErrorLogger.LogLevel.INFO); } - catch (Exception err) + catch (Exception) { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - //Send error code to callback if valid _callback(-1, -1); } diff --git a/Source/TSRealLib/MAL/Managers/CoeMeasurementManager/CoeMeasurementManager.cs b/Source/TSRealLib/MAL/Managers/CoeMeasurementManager/CoeMeasurementManager.cs new file mode 100644 index 0000000..8c3c4b8 --- /dev/null +++ b/Source/TSRealLib/MAL/Managers/CoeMeasurementManager/CoeMeasurementManager.cs @@ -0,0 +1,268 @@ +// ********************************************************************************************************** +// BitGenSoftMeasurementManager.cs +// 7/28/2022 +// NGI - Next Generation Interceptor +// +// Contract No. HQ0856-21-C-0003/1022000209 +// +// THIS DOCUMENT DOES NOT CONTAIN TECHNOLOGY OR TECHNICAL DATA CONTROLLED UNDER EITHER THE U.S. +// INTERNATIONAL TRAFFIC IN ARMS REGULATIONS OR THE U.S. EXPORT ADMINISTRATION REGULATIONS. +// +// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION PROPRIETARY TO RAYTHEON +// COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. +// DISCLOSURE TO UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO RAYTHEON +// COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS CONTENTS SHALL BE FURNISHED OR DISCLOSED +// TO OR COPIED OR USED BY PERSONS OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF +// RAYTHEON COMPANY. +// +// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +// +// DESTRUCTION NOTICE: FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN DOD 5220.22-M, +// NATIONAL INDUSTRIAL SECURITY PROGRAM OPERATING MANUAL, FEBRUARY 2006, +// INCORPORATING CHANGE 1, MARCH 28, 2013, CHAPTER 5, SECTION 7, OR DODM 5200.01-VOLUME 3, +// DOD INFORMATION SECURITY PROGRAM: PROTECTION OF CLASSIFIED INFORMATION, ENCLOSURE 3, +// SECTION 17. FOR CONTROLLED UNCLASSIFIED INFORMATION FOLLOW THE PROCEDURES IN DODM 5200.01-VOLUME 4, +// INFORMATION SECURITY PROGRAM: CONTROLLED UNCLASSIFIED INFORMATION. +// +// CONTROLLED BY: MISSILE DEFENSE AGENCY +// CONTROLLED BY: GROUND-BASED MIDCOURSE DEFENSE PROGRAM OFFICE +// CUI CATEGORY: CTI +// DISTRIBUTION/DISSEMINATION CONTROL: F +// POC: Alex Kravchenko (1118268) +// ********************************************************************************************************** + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.XPath; +using NLog; +using Raytheon.Common; +using Raytheon.Common.Coe; +using Raytheon.Instruments; + +namespace MeasurementManagerLib +{ + /// + /// COE Measurement Manager class + /// + public class CoeMeasurementManager : IDisposable + { + private readonly ILogger _logger = LogManager.GetCurrentClassLogger(); + + private readonly Dictionary _coeNodes = new Dictionary(); + + private readonly IInstrumentManager _instrumentManager; + public int CheckForMessageIntervalMs { get; private set; } + /// + /// constructor that will create a list of BIT instruments + /// + /// + /// + public CoeMeasurementManager(IInstrumentManager instrumentManager, string coeMeasurementManagerConfigFullPath) + { + try + { + _instrumentManager = instrumentManager; + + ConfigurationFile configurationFile = new ConfigurationFile(coeMeasurementManagerConfigFullPath); + + CheckForMessageIntervalMs = 10; + + if (Int32.TryParse(configurationFile.ReadValue("GENERAL", "CheckForMessageIntervalMs"), out int val)) + { + CheckForMessageIntervalMs = val; + } + + ICollection coeNodeList = _instrumentManager.GetInstruments(typeof(CoeComm)); + foreach (CoeComm node in coeNodeList) + { + _coeNodes.Add(node.Name, node); + } + } + catch (Exception) + { + throw; + } + } + + ~CoeMeasurementManager() + { + _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() ..."); + foreach (var node in _coeNodes) + { + try + { + CoeComm coeNode = node.Value; + coeNode.Shutdown(); + } + catch { } + } + } + + /// + /// Get XML Docs + /// + public object GetXmlDocs(string coeDevice) + { + return _coeNodes[coeDevice].GetXmlDocs(); + } + + /// + /// Create a message + /// + public Message CreateMessage(string coeDevice, string messageName) + { + Message msg = null; + + MessageXmlDocument msgXmlDocument = null; + + Dictionary xmlDocs = new Dictionary(); + var xmlDocObject = GetXmlDocs(coeDevice); + + if (xmlDocObject != null && xmlDocObject.GetType() == xmlDocs.GetType()) + { + xmlDocs = (Dictionary)xmlDocObject; + + foreach (KeyValuePair item in xmlDocs) + { + XPathNavigator Node = xmlDocs[item.Key].CreateNavigator(); + XPathNodeIterator Nodeset = Node.Select("interface/message/name"); + while (Nodeset.MoveNext()) + { + if (String.Equals(Nodeset.Current.Value, messageName, StringComparison.OrdinalIgnoreCase)) + { + msgXmlDocument = item.Value; + break; + } + } + + if (msgXmlDocument != null) + break; + } + } + + if (msgXmlDocument != null) + { + msg = new Message(messageName, msgXmlDocument, _coeNodes[coeDevice].ShallLogMessage(messageName)); + msg.Default(); + } + + return msg; + } + + /// + /// initialize COE nodes based on test type + /// + /// + /// + public void InitNodes() + { + foreach (var node in _coeNodes) + { + try + { + CoeComm coeNode = node.Value; + coeNode.Initialize(); + coeNode.Open(); + } + catch (Exception) + { + throw; + } + } + } + + /// + /// close all connections + /// + /// + public void Dispose() + { + foreach (var coeNode in _coeNodes) + { + coeNode.Value?.Shutdown(); + } + } + + /// + /// Send message using the first available device + /// + /// + /// + /// + /// + public bool SendMessage(string messageId, IEnumerable> messageParams = null) + { + if (_coeNodes.Any()) + { + CoeComm coeNode = _coeNodes.First().Value; + return coeNode.SendMessage(messageId, messageParams); + } + else + { + throw new Exception($"Unable to locate COE node. No nodes defined"); + } + } + + /// + /// Send message from a particular device + /// + /// + /// + /// + /// + /// + public bool SendMessage(string instrumentName, string messageId, IEnumerable> messageParams = null) + { + if (_coeNodes.ContainsKey(instrumentName)) + { + return _coeNodes[instrumentName].SendMessage(messageId, messageParams); + } + else + { + throw new Exception($"Unable to locate COE node {instrumentName}"); + } + } + + /// + /// Get subscribed message from UUT using the first device + /// + /// + /// + public CoeResponseMsgData GetNextResponseInQueue(string messageId) + { + if (_coeNodes.Any()) + { + CoeComm coeNode = _coeNodes.First().Value; + return coeNode.GetNextResponseInQueue(messageId); + } + else + return null; + } + + /// + /// Get subscribed message from UUT from a particular device + /// + /// + /// + /// + public CoeResponseMsgData GetNextResponseInQueue(string instrumentName, string messageId) + { + return _coeNodes.ContainsKey(instrumentName) ? _coeNodes[instrumentName].GetNextResponseInQueue(messageId) : null; + } + + /// + /// Clear the queue for a particular response message. + /// This is useful if we have a large size queue and we don't want to dequeue each item to get + /// to the newest item. So we clear the queue first, before trying to get the newest item in the queue + /// + public void ClearResponseMessageQueue(string instrumentName, string messageId) + { + if (_coeNodes.ContainsKey(instrumentName)) + { + _coeNodes[instrumentName].ClearResponseMessageQueue(messageId); + } + } + + } +} diff --git a/Source/TSRealLib/MAL/Managers/BitGenSoftMeasurementManager/BitGenSoftMeasurementManager.csproj b/Source/TSRealLib/MAL/Managers/CoeMeasurementManager/CoeMeasurementManager.csproj similarity index 74% rename from Source/TSRealLib/MAL/Managers/BitGenSoftMeasurementManager/BitGenSoftMeasurementManager.csproj rename to Source/TSRealLib/MAL/Managers/CoeMeasurementManager/CoeMeasurementManager.csproj index 4a2bad9..c62c858 100644 --- a/Source/TSRealLib/MAL/Managers/BitGenSoftMeasurementManager/BitGenSoftMeasurementManager.csproj +++ b/Source/TSRealLib/MAL/Managers/CoeMeasurementManager/CoeMeasurementManager.csproj @@ -3,9 +3,9 @@ net472 - BitGenSoftMeasurementManager + CoeMeasurementManager Composable Test Software Library - Bit GenSoft Measurement Manager + COE Measurement Manager Library @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/Source/TSRealLib/MAL/Managers/DioMeasurementManager/DioMeasurementManager.cs b/Source/TSRealLib/MAL/Managers/DioMeasurementManager/DioMeasurementManager.cs index 300406e..d9bfe77 100644 --- a/Source/TSRealLib/MAL/Managers/DioMeasurementManager/DioMeasurementManager.cs +++ b/Source/TSRealLib/MAL/Managers/DioMeasurementManager/DioMeasurementManager.cs @@ -15,26 +15,24 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ -using NLog; -using Raytheon.Common; -using Raytheon.Instruments; -using Raytheon.Instruments.GeneralIO; using System; using System.Collections.Generic; -using System.Configuration; -using System.IO; -using System.Reflection; +using System.Linq; using System.Threading; +using NLog; +using Raytheon.Instruments; namespace MeasurementManagerLib { /// - /// This class manages IDIO instruments and provides an abstraction + /// This class manages DIO instruments and provides an abstraction /// public class DioMeasurementManager : IDisposable - { - #region PrivateClassMembers - private SortedDictionary _signalNameToObjectMap = new SortedDictionary(); + { + #region PrivateClassMembers + private SortedDictionary _signalNameToDioModuleMap = new SortedDictionary(); + + public Dictionary SignalNameToChannelInfoMap { get; private set; } private static NLog.ILogger _logger; #endregion @@ -49,22 +47,27 @@ namespace MeasurementManagerLib { _logger = LogManager.GetCurrentClassLogger(); + SignalNameToChannelInfoMap = new Dictionary(); + ICollection dioModuleList = instrumentManager.GetInstruments(typeof(IGeneralIO)); // populate the maps foreach (IGeneralIO dioModule in dioModuleList) { dioModule.Initialize(); - List signalNames = dioModule.GetSignalNames(); + Dictionary signalNameToChannelInfoMap = dioModule.GetAllSignals(); - foreach (string signalName in signalNames) - { - if (_signalNameToObjectMap.ContainsKey(signalName.ToUpper())) + // add signal map for this DIO module to master signal map + signalNameToChannelInfoMap.ToList().ForEach(x => SignalNameToChannelInfoMap.Add(x.Key, x.Value)); + + foreach (KeyValuePair item in signalNameToChannelInfoMap) + { + if (_signalNameToDioModuleMap.ContainsKey(item.Key.ToUpper())) { - throw new Exception("There is more than 1 DIO card that have the same signal name: " + signalName); + throw new Exception("There is more than 1 DIO card that have the same signal name: " + item.Key); } - _signalNameToObjectMap[signalName.ToUpper()] = dioModule; + _signalNameToDioModuleMap[item.Key.ToUpper()] = dioModule; } } } @@ -100,7 +103,7 @@ namespace MeasurementManagerLib /// 0 if the signal is low, 1 if the signal is high public IODatatypes.BitState GetInputSignalState(string signalName) { - return _signalNameToObjectMap[signalName.ToUpper()].GetBitState(signalName); + return _signalNameToDioModuleMap[signalName.ToUpper()].GetBitState(signalName); } /// @@ -111,7 +114,7 @@ namespace MeasurementManagerLib /// number of ms to wait after setting signal public void SetOutputSignalState(string signalName, IODatatypes.BitState state, uint timeToSleepMs = 100) { - _signalNameToObjectMap[signalName.ToUpper()].SetBit(signalName, state); + _signalNameToDioModuleMap[signalName.ToUpper()].SetBit(signalName, state); // wait a bit Thread.Sleep((int)timeToSleepMs); @@ -125,40 +128,24 @@ namespace MeasurementManagerLib /// The Finalizer /// ~DioMeasurementManager() - { - Dispose(false); - } + { + Dispose(false); + } - /// - /// - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - foreach (KeyValuePair entry in _signalNameToObjectMap) - { - try - { - entry.Value.Shutdown(); - } - catch (Exception err) - { - _logger?.Error(err.Message + "\r\n" + err.StackTrace); - } - } - - try - { - ErrorLogger.Instance().Dispose(); - } - catch (Exception) - { - // nothing to do - } - } - } - #endregion - } + /// + /// + /// + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + foreach (KeyValuePair entry in _signalNameToDioModuleMap) + { + entry.Value.Shutdown(); + } + } + } + #endregion + } } diff --git a/Source/TSRealLib/MAL/Managers/PowerSupplyMeasurementManger/PowerSupplyMeasurementManager.cs b/Source/TSRealLib/MAL/Managers/PowerSupplyMeasurementManger/PowerSupplyMeasurementManager.cs index 5b550dc..b7937e8 100644 --- a/Source/TSRealLib/MAL/Managers/PowerSupplyMeasurementManger/PowerSupplyMeasurementManager.cs +++ b/Source/TSRealLib/MAL/Managers/PowerSupplyMeasurementManger/PowerSupplyMeasurementManager.cs @@ -18,52 +18,35 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. // Ignore Spelling: Selftest ovp ocp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; using NLog; using Raytheon.Instruments; using Raytheon.Instruments.PowerSupply; -using Raytheon.Common; -using System; -using System.CodeDom; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using System.Xml.Linq; namespace MeasurementManagerLib { - /// - /// The entry point for the library that controls power supplies. - /// This class parses out the definition of all power supplies in a system and provides control to the host. - /// In simple cases, the host only needs to fill in the ini file and use the OutputDisable() and OutputEnable() functions. - /// A variety of other capability is exposed for more complex applications. - /// - public class PowerSupplyMeasurementManager : IDisposable - { - #region PublicClassMembers - /// - /// A callback definition for the power monitor. - /// The host may pass in this delegate to PowerLogStart() to receive callbacks from the monitor thread. - /// - /// The callback returns a comma delimited string of the format: "System, Module, voltage, voltage setpoint, current, output status, fault status"; - /// If an exception is thrown in the monitor thread, this value will be set to -1, else it will be 0; - public delegate void PowerMonitorDelegate(List retData, int errorCode); + /// + /// The entry point for the library that controls power supplies. + /// This class parses out the definition of all power supplies in a system and provides control to the host. + /// In simple cases, the host only needs to fill in the ini file and use the OutputDisable() and OutputEnable() functions. + /// A variety of other capability is exposed for more complex applications. + /// + public class PowerSupplyMeasurementManager : IDisposable + { + #region PublicClassMembers + private Exception _exceptionFromSuportThread; + private object _powerSupplySelfTestSyncOjb = new object(); - #endregion + #endregion - #region PrivateClassMembers - // power system name to power system object - private SortedDictionary _powerSystemNameToObjectMap; + #region PrivateClassMembers + // power system name to power system object + private SortedDictionary _powerSystemNameToObjectMap; - // power module name to power system object - private SortedDictionary _powerModuleNameToObjectMap; - private PowerSupplyDataLogWorker _dataLogWorker; - private Thread _dataLogThread; - - // these are used to remember the logging thread params if the host is loading new power def files - string _prevPowerLogFileName; - int _prevPowerLogRestTime; - PowerMonitorDelegate _prevPowerLogCallback; + // power module name to power system object + private SortedDictionary _powerModuleNameToObjectMap; private static NLog.ILogger _logger; private IInstrumentManager _instrumentManager; @@ -80,35 +63,15 @@ namespace MeasurementManagerLib /// /// public PowerSupplyMeasurementManager(IInstrumentManager instrumentManager) - { + { _logger = LogManager.GetCurrentClassLogger(); - _instrumentManager = instrumentManager; + _instrumentManager = instrumentManager; _powerSystemNameToObjectMap = new SortedDictionary(); - // create some maps to support the functions the MAL input - _powerSystemNameToObjectMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); - _powerModuleNameToObjectMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); - - ICollection powerSystemList = _instrumentManager.GetInstruments(typeof(IPowerSupplySystem)); - // populate the maps - foreach (IPowerSupplySystem powerSystem in powerSystemList) - { - powerSystem.Initialize(); - _powerSystemNameToObjectMap[powerSystem.Name.ToUpper()] = powerSystem; - - List moduleNames = powerSystem.GetModuleNames(); - - foreach (string moduleName in moduleNames) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper())) - { - throw new Exception("There is more than 1 power system that have the same module name: " + moduleName); - } - - _powerModuleNameToObjectMap[moduleName.ToUpper()] = powerSystem; - } - } + // create some maps to support the functions the MAL input + _powerSystemNameToObjectMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); + _powerModuleNameToObjectMap = new SortedDictionary(StringComparer.InvariantCultureIgnoreCase); PerformPowerSupplySelfTests(); @@ -116,6 +79,30 @@ namespace MeasurementManagerLib { throw new Exception($"{_powerSystemWithFailedSelfTest}'s self-test failed."); } + else if (_exceptionFromSuportThread != null) + { + throw new Exception("Check inner exception", _exceptionFromSuportThread); + } + + ICollection powerSystemList = _instrumentManager.GetInstruments(typeof(IPowerSupplySystem)); + // populate the maps + foreach (IPowerSupplySystem powerSystem in powerSystemList) + { + powerSystem.Initialize(); + _powerSystemNameToObjectMap[powerSystem.Name.ToUpper()] = powerSystem; + + List moduleNames = powerSystem.GetModuleNames(); + + foreach (string moduleName in moduleNames) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper())) + { + throw new Exception("There is more than 1 power system that have the same module name: " + moduleName); + } + + _powerModuleNameToObjectMap[moduleName.ToUpper()] = powerSystem; + } + } } /// @@ -137,12 +124,12 @@ namespace MeasurementManagerLib Task[] taskArray = new Task[powerSystemList.Count]; - int index = 0; + int index = 0; foreach (IPowerSupplySystem powerSystem in powerSystemList) { // perform self test on power system Task task = Task.Factory.StartNew(() => PerformPowerSupplySelfTestTask(powerSystem)); - taskArray.SetValue(task,index++); + taskArray.SetValue(task, index++); } Task.WaitAll(taskArray); @@ -156,21 +143,36 @@ namespace MeasurementManagerLib private void PerformPowerSupplySelfTestTask(IPowerSupplySystem powerSystem) { SelfTestResult result = SelfTestResult.Pass; + Exception exception = null; + string powerSystemWithFailedSelfTest = String.Empty; _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() for {powerSystem.Name} is running..."); try - { + { result = powerSystem.PerformSelfTest(); - if (result == SelfTestResult.Fail && String.IsNullOrEmpty(_powerSystemWithFailedSelfTest)) + if (result == SelfTestResult.Fail) { - _powerSystemWithFailedSelfTest = powerSystem.Name; + powerSystemWithFailedSelfTest = powerSystem.Name; } } catch (Exception ex) { - _logger?.Error(ex.Message + "\n" + ex.StackTrace); + exception = ex; + } + + lock (_powerSupplySelfTestSyncOjb) + { + if (String.IsNullOrEmpty(_powerSystemWithFailedSelfTest) && _exceptionFromSuportThread == null) + { + if (!String.IsNullOrEmpty(powerSystemWithFailedSelfTest)) + _powerSystemWithFailedSelfTest = powerSystemWithFailedSelfTest; + else if (exception != null) + { + _exceptionFromSuportThread = exception; + } + } } _logger?.Debug($"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() for {powerSystem.Name} is exiting..."); @@ -181,81 +183,67 @@ namespace MeasurementManagerLib /// /// The name of the system to disable, as defined in the config file public void DisplayDisable(string powerSystem) - { - if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) - { - throw new Exception("Could not find power system: " + powerSystem); - } + { + if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) + { + throw new Exception("Could not find power system: " + powerSystem); + } - _powerSystemNameToObjectMap[powerSystem.ToUpper()].DisplayEnabled = false; - } + _powerSystemNameToObjectMap[powerSystem.ToUpper()].DisplayEnabled = false; + } - /// - /// Enable the power supply display interface. - /// - /// The name of the system to disable, as defined in the config file - public void DisplayEnable(string powerSystem) - { - if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) - { - throw new Exception("Could not find power system: " + powerSystem); - } + /// + /// Enable the power supply display interface. + /// + /// The name of the system to disable, as defined in the config file + public void DisplayEnable(string powerSystem) + { + if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) + { + throw new Exception("Could not find power system: " + powerSystem); + } - _powerSystemNameToObjectMap[powerSystem.ToUpper()].DisplayEnabled = true; - } + _powerSystemNameToObjectMap[powerSystem.ToUpper()].DisplayEnabled = true; + } - /// - /// Dispose of this object. - /// - public void Dispose() - { - try - { - Dispose(true); + /// + /// Dispose of this object. + /// + public void Dispose() + { + Dispose(true); - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } + GC.SuppressFinalize(this); + } - /// - /// Get all of the power module names - /// - /// Array of the system/module names. - public List GetPowerModuleList() - { - List powerModules = new List(); + /// + /// Get all of the power module names + /// + /// Array of the system/module names. + public List GetPowerModuleList() + { + List powerModules = new List(); - foreach (KeyValuePair item in _powerModuleNameToObjectMap) - { - powerModules.Add(item.Key); - } + foreach (KeyValuePair item in _powerModuleNameToObjectMap) + { + powerModules.Add(item.Key); + } - return powerModules; - } + return powerModules; + } - /// - /// Get the power module names for a given system - /// - /// Array of the system/module names. - public List GetPowerSupplyList(string powerSystem) - { - if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) - { - throw new Exception("Unknown power system: " + powerSystem); - } + /// + /// Get the power module names for a given system + /// + /// Array of the system/module names. + public List GetPowerSupplyList(string powerSystem) + { + if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) + { + throw new Exception("Unknown power system: " + powerSystem); + } - return _powerSystemNameToObjectMap[powerSystem.ToUpper()].GetModuleNames(); + return _powerSystemNameToObjectMap[powerSystem.ToUpper()].GetModuleNames(); }//GetPowerSupplyModuleInfoDict /// @@ -277,363 +265,293 @@ namespace MeasurementManagerLib /// /// Array of power system names, as defined in the config file public List GetPowerSupplySystemList() - { - List powerSystems = new List(); + { + List powerSystems = new List(); - foreach (KeyValuePair item in _powerSystemNameToObjectMap) - { - powerSystems.Add(item.Key); - } + foreach (KeyValuePair item in _powerSystemNameToObjectMap) + { + powerSystems.Add(item.Key); + } - return powerSystems; - } + return powerSystems; + } - /// - /// Query the supply and returns the programed OCP. Should match what was in the definition file. - /// - /// The name of the power supply. - /// The programmed overcurrent protection value - public double GetOverCurrentProtection(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Query the supply and returns the programed OCP. Should match what was in the definition file. + /// + /// The name of the power supply. + /// The programmed overcurrent protection value + public double GetOverCurrentProtection(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetOverCurrentSetting(moduleName); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetOverCurrentSetting(moduleName); + } - /// - /// Query the supply and returns the programed OVP. Should match what was in the definition file. - /// - /// The name of the power supply. - /// The programmed overvoltage protection value. - public double GetOverVoltageProtection(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Query the supply and returns the programed OVP. Should match what was in the definition file. + /// + /// The name of the power supply. + /// The programmed overvoltage protection value. + public double GetOverVoltageProtection(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetOverVoltageSetting(moduleName); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetOverVoltageSetting(moduleName); + } - /// - /// Query the supply and returns the programed slew rate - /// - /// - /// The programmed slew rate - public double GetSlewRate(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Query the supply and returns the programed slew rate + /// + /// + /// The programmed slew rate + public double GetSlewRate(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetSlewRate(moduleName); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetSlewRate(moduleName); + } - /// - /// Query the system that contains the passed in module and returns the system error code. - /// - /// The module to query. - /// The error code. - /// The string form of the error code. Will be empty string if there is no error. - public string GetSystemErrorCode(string moduleName, out int errorCode) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Query the system that contains the passed in module and returns the system error code. + /// + /// The module to query. + /// The error code. + /// The string form of the error code. Will be empty string if there is no error. + public string GetSystemErrorCode(string moduleName, out int errorCode) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetErrorCode(out errorCode); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetErrorCode(out errorCode); + } - /// - /// Query the supply and returns the programmed voltage setpoint. - /// After construction, this should match what was in the definition file. - /// The host may override the value by calling SetVoltageSetpoint(). - /// - /// The name of the power supply. - /// The programmed voltage setpoint. - public double GetVoltageSetpoint(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Query the supply and returns the programmed voltage setpoint. + /// After construction, this should match what was in the definition file. + /// The host may override the value by calling SetVoltageSetpoint(). + /// + /// The name of the power supply. + /// The programmed voltage setpoint. + public double GetVoltageSetpoint(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetVoltageSetting(moduleName); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].GetVoltageSetting(moduleName); + } - /// - /// Query the supply and returns true if output is enabled. - /// - /// The name of the power supply. - /// True if output is enabled, false if it is not enabled. - public bool IsPowerSupplyOn(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Query the supply and returns true if output is enabled. + /// + /// The name of the power supply. + /// True if output is enabled, false if it is not enabled. + public bool IsPowerSupplyOn(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].IsOutputOn(moduleName); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].IsOutputOn(moduleName); + } - /// - /// Sends a SCPI command to the power system and reads the response - /// - /// The name of the power system. - /// The SCPI command to send - /// - public string IOQuery(string powerSystem, string command) - { - if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) - { - throw new Exception("Could not find power system: " + powerSystem); - } + /// + /// Sends a SCPI command to the power system and reads the response + /// + /// The name of the power system. + /// The SCPI command to send + /// + public string IOQuery(string powerSystem, string command) + { + if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) + { + throw new Exception("Could not find power system: " + powerSystem); + } - return _powerSystemNameToObjectMap[powerSystem.ToUpper()].IOQuery(command); - } + return _powerSystemNameToObjectMap[powerSystem.ToUpper()].IOQuery(command); + } - /// - /// Sends a SCPI command to the power system - /// - /// The name of the power system. - /// The SCPI command to send - public void IOWrite(string powerSystem, string command) - { - if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) - { - throw new Exception("Could not find power system: " + powerSystem); - } + /// + /// Sends a SCPI command to the power system + /// + /// The name of the power system. + /// The SCPI command to send + public void IOWrite(string powerSystem, string command) + { + if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) + { + throw new Exception("Could not find power system: " + powerSystem); + } - _powerSystemNameToObjectMap[powerSystem.ToUpper()].IOWrite(command); - } + _powerSystemNameToObjectMap[powerSystem.ToUpper()].IOWrite(command); + } - /// - /// Read the current of a module. - /// - /// The module to read. - /// The current (Amps). - public double MeasureCurrent(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Read the current of a module. + /// + /// The module to read. + /// The current (Amps). + public double MeasureCurrent(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].MeasureCurrent(moduleName); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].MeasureCurrent(moduleName); + } - /// - /// Query the supply for its voltage. - /// - /// The module to read. - /// The voltage (Volts). - public double MeasureVoltage(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Query the supply for its voltage. + /// + /// The module to read. + /// The voltage (Volts). + public double MeasureVoltage(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].MeasureVoltage(moduleName); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].MeasureVoltage(moduleName); + } - /// - /// Disable the output of the power supply. - /// - /// The name of the power supply module. - public void OutputDisable(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Disable the output of the power supply. + /// + /// The name of the power supply module. + public void OutputDisable(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - _powerModuleNameToObjectMap[moduleName.ToUpper()].Off(moduleName); - } + _powerModuleNameToObjectMap[moduleName.ToUpper()].Off(moduleName); + } - /// - /// Enable the output of the power supply. - /// - /// The name of the module to enable. - public void OutputEnable(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Enable the output of the power supply. + /// + /// The name of the module to enable. + public void OutputEnable(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - _powerModuleNameToObjectMap[moduleName.ToUpper()].On(moduleName); - } + _powerModuleNameToObjectMap[moduleName.ToUpper()].On(moduleName); + } - /// - /// start logging of power supply data. - /// Queries the list of all power modules. - /// Logs data to the define path. - /// Returns data to defined callback function. - /// - /// Path to create the log file. - /// The time to wait between queries. - /// Function to call. Null can be passed in in which case no hot callback will be issued - public void PowerLogStart(string fileName, int threadRestTimeMs, PowerMonitorDelegate callback) - { - // if we have been running before, stop just in case the host did not - if (_dataLogWorker != null) - { - PowerLogStop(); + /// + /// Control the power supply internal mechanical relay state + /// + /// True to connect, false to disconnect + public void MechanicalRelayOutputControl(string moduleName, bool shallWeConnect) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - _dataLogWorker.Dispose(); - } + _powerModuleNameToObjectMap[moduleName.ToUpper()].MechanicalRelayOutputControl(moduleName, shallWeConnect); + } - _dataLogWorker = new PowerSupplyDataLogWorker(this, fileName, threadRestTimeMs, callback); - - _dataLogThread = new Thread(_dataLogWorker.DoWork); - - // start the thread back up - _dataLogThread.Start(); - - _prevPowerLogFileName = fileName; - _prevPowerLogRestTime = threadRestTimeMs; - _prevPowerLogCallback = callback; - } - - /// - /// stops logging data and closes the file. - /// - public void PowerLogStop() - { - // Wait up to 5 seconds for the thread to quit - const int THREAD_QUIT_TIMEOUT_MS = 5000; - - string functionName = $"{this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}()"; - - if (_dataLogWorker != null) - { - _dataLogWorker.QuitWork(); - - if ((_dataLogThread != null) && _dataLogThread.IsAlive) - { - bool didThreadQuit = _dataLogThread.Join(THREAD_QUIT_TIMEOUT_MS); - - if (didThreadQuit == false) - { - _logger.Error($"{functionName} - Logging Thread did not quit as expected, aborting it"); - _dataLogThread.Abort(); - } - else - { - _logger.Debug("{functionName} - Logging Thread quit successfully after join"); - } - } - else - { - _logger.Debug("{functionName} - Logging Thread quit successfully"); - } - } - - _prevPowerLogFileName = null; - _prevPowerLogRestTime = 0; - _prevPowerLogCallback = null; - } - - /// - /// Control the power supply internal mechanical relay state - /// - /// True to connect, false to disconnect - public void MechanicalRelayOutputControl(string moduleName, bool shallWeConnect) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } - - _powerModuleNameToObjectMap[moduleName.ToUpper()].MechanicalRelayOutputControl(moduleName, shallWeConnect); - } - - /// - /// Query all power supply data in a single call. - /// - /// The name of the module to query. - /// The voltage that was read. - /// The voltage setpoint that was read. - /// The current that was read. - /// The output status. True if output is enabled, false if output is disabled. - /// The value of the fault status register. See power supply docs for meaning (0 means no fault). - /*public void ReadPowerData(string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool outputStatus, out int faultStatus) + /// + /// Query all power supply data in a single call. + /// + /// The name of the module to query. + /// The voltage that was read. + /// The voltage setpoint that was read. + /// The current that was read. + /// The output status. True if output is enabled, false if output is disabled. + /// The value of the fault status register. See power supply docs for meaning (0 means no fault). + /*public void ReadPowerData(string moduleName, out double voltage, out double voltageSetpoint, out double current, out bool isOutputOn, out int faultStatus) { if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) { throw new Exception("PowerSupplyManager::ReadPowerData() - could not find module: " + moduleName); } - _powerModuleNameToObjectMap[moduleName.ToUpper()].ReadPowerData(moduleName, out voltage, out voltageSetpoint, out current, out outputStatus, out faultStatus); + _powerModuleNameToObjectMap[moduleName.ToUpper()].ReadPowerData(moduleName, out voltage, out voltageSetpoint, out current, out isOutputOn, out faultStatus); }*/ - /// - /// Query all power supply data in a single call. - /// - /// The name of the module to query. - public PowerData ReadPowerData(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Query all power supply data in a single call. + /// + /// The name of the module to query. + public PowerData ReadPowerData(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].ReadPowerData(moduleName); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].ReadPowerData(moduleName); + } - /// - /// - /// - /// - /// - public int ReadProtectionStatus(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// + /// + /// + /// + public int ReadProtectionStatus(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - return _powerModuleNameToObjectMap[moduleName.ToUpper()].ReadProtectionStatus(moduleName); - } + return _powerModuleNameToObjectMap[moduleName.ToUpper()].ReadProtectionStatus(moduleName); + } - /// - /// Resets the setpoint voltage to the value contained in the ini file - /// - /// The module to reset - public void SetInitialVoltage(string moduleName) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Resets the setpoint voltage to the value contained in the ini file + /// + /// The module to reset + public void SetInitialVoltage(string moduleName) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - _powerModuleNameToObjectMap[moduleName.ToUpper()].SetInitialVoltage(moduleName); - } + _powerModuleNameToObjectMap[moduleName.ToUpper()].SetInitialVoltage(moduleName); + } - /// - /// Every power supply gets its voltage set to what was in the ini file - /// - public void SetInitialVoltageAll() - { - List powerModules = GetPowerModuleList(); - foreach (string powerModule in powerModules) - { - SetInitialVoltage(powerModule); - } - } + /// + /// Every power supply gets its voltage set to what was in the ini file + /// + public void SetInitialVoltageAll() + { + List powerModules = GetPowerModuleList(); + foreach (string powerModule in powerModules) + { + SetInitialVoltage(powerModule); + } + } - /// - /// Sets the slew rate in volts per second - /// - /// The name of the power module - /// slew in volts per second - /*public void SetSlewRate(string moduleName, double slewRate) + /// + /// Sets the slew rate in volts per second + /// + /// The name of the power module + /// slew in volts per second + /*public void SetSlewRate(string moduleName, double slewRate) { if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) { @@ -643,79 +561,79 @@ namespace MeasurementManagerLib _powerModuleNameToObjectMap[moduleName.ToUpper()].SetSlewRate(moduleName, slewRate); }*/ - /// - /// - /// - /// - /// - public void SetOverCurrentProtection(string moduleName, double ocpValue) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// + /// + /// + /// + public void SetOverCurrentProtection(string moduleName, double ocpValue) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - _powerModuleNameToObjectMap[moduleName.ToUpper()].SetOverCurrentProtection(moduleName, ocpValue); - } + _powerModuleNameToObjectMap[moduleName.ToUpper()].SetOverCurrentProtection(moduleName, ocpValue); + } - /// - /// - /// - /// - /// - public void SetOverVoltageProtection(string moduleName, double ovpValue) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// + /// + /// + /// + public void SetOverVoltageProtection(string moduleName, double ovpValue) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - _powerModuleNameToObjectMap[moduleName.ToUpper()].SetOverVoltageProtection(moduleName, ovpValue); - } + _powerModuleNameToObjectMap[moduleName.ToUpper()].SetOverVoltageProtection(moduleName, ovpValue); + } - /// - /// Set the setpoint voltage of a module. - /// - /// The module to set. - /// The setpoint voltage. - public void SetVoltageSetpoint(string moduleName, double setpointVoltage) - { - if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) - { - throw new Exception("Could not find module: " + moduleName); - } + /// + /// Set the setpoint voltage of a module. + /// + /// The module to set. + /// The setpoint voltage. + public void SetVoltageSetpoint(string moduleName, double setpointVoltage) + { + if (_powerModuleNameToObjectMap.ContainsKey(moduleName.ToUpper()) == false) + { + throw new Exception("Could not find module: " + moduleName); + } - _powerModuleNameToObjectMap[moduleName.ToUpper()].SetVoltageSetpoint(moduleName, setpointVoltage); - } + _powerModuleNameToObjectMap[moduleName.ToUpper()].SetVoltageSetpoint(moduleName, setpointVoltage); + } - /// - /// Disable the power system watchdog. - /// - /// The power system to act on. - public void WatchdogDisable(string powerSystem) - { - if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) - { - throw new Exception("Could not find power system: " + powerSystem); - } + /// + /// Disable the power system watchdog. + /// + /// The power system to act on. + public void WatchdogDisable(string powerSystem) + { + if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) + { + throw new Exception("Could not find power system: " + powerSystem); + } - _powerSystemNameToObjectMap[powerSystem.ToUpper()].WatchdogDisable(); - } + _powerSystemNameToObjectMap[powerSystem.ToUpper()].WatchdogDisable(); + } - /// - /// Enable the power system watchdog. - /// - /// The system to act on. - /// The number of seconds for the watchdog. - public void WatchdogEnable(string powerSystem, uint timeInSeconds) - { - if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) - { - throw new Exception("Could not find power system: " + powerSystem); - } + /// + /// Enable the power system watchdog. + /// + /// The system to act on. + /// The number of seconds for the watchdog. + public void WatchdogEnable(string powerSystem, uint timeInSeconds) + { + if (_powerSystemNameToObjectMap.ContainsKey(powerSystem.ToUpper()) == false) + { + throw new Exception("Could not find power system: " + powerSystem); + } - _powerSystemNameToObjectMap[powerSystem.ToUpper()].WatchdogEnable(timeInSeconds); - } + _powerSystemNameToObjectMap[powerSystem.ToUpper()].WatchdogEnable(timeInSeconds); + } #endregion @@ -738,29 +656,6 @@ namespace MeasurementManagerLib { _logger.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); - // stop the logging if it is still running - try - { - PowerLogStop(); - } - catch (Exception ex) - { - _logger.Error(ex.Message + "\r\n" + ex.StackTrace); - } - - // dispose the thread - try - { - if (_dataLogWorker != null) - { - _dataLogWorker.Dispose(); - } - } - catch (Exception ex) - { - _logger.Error(ex.Message + "\r\n" + ex.StackTrace); - } - // dispose of the other resources foreach (KeyValuePair entry in _powerSystemNameToObjectMap) { diff --git a/Source/TSRealLib/MAL/Managers/PowerSupplyMeasurementManger/ThreadWorkers/PowerSupplyDataLogWorker.cs b/Source/TSRealLib/MAL/Managers/PowerSupplyMeasurementManger/ThreadWorkers/PowerSupplyDataLogWorker.cs deleted file mode 100644 index 4b1e460..0000000 --- a/Source/TSRealLib/MAL/Managers/PowerSupplyMeasurementManger/ThreadWorkers/PowerSupplyDataLogWorker.cs +++ /dev/null @@ -1,246 +0,0 @@ -// UNCLASSIFIED -/*------------------------------------------------------------------------- -RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION -PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS -AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO -UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO -RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS -CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS -OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON -COMPANY. - -THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. -GOVERNMENT. - -UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. --------------------------------------------------------------------------*/ - -using System; -using System.Collections.Generic; -using System.Threading; -using Raytheon.Common; -using System.IO; -using Raytheon.Instruments; -using Raytheon.Instruments.PowerSupply; - -namespace MeasurementManagerLib -{ - /// - /// A worker for iterating through each supply in the system, querying its' data, logging it out, and issuing callbacks to the host - /// - internal class PowerSupplyDataLogWorker : IWorkerInterface - { - #region PrivateClassMembers - - private bool _threadQuitControl; - private AutoResetEvent _quitEvent; - private StreamWriter _fileWriter; - private readonly string _logFilePath; - private readonly int _threadRestTimeMs; - private readonly PowerSupplyMeasurementManager.PowerMonitorDelegate _callback; - private readonly PowerSupplyMeasurementManager _controller; - - #endregion - - #region PrivateFunctions - - /// - /// Finalizer - /// - ~PowerSupplyDataLogWorker() - { - Dispose(false); - } - - /// - /// Release of resources - /// - /// - protected virtual void Dispose(bool disposing) - { - try - { - if (disposing) - { - _fileWriter.Dispose(); - - _quitEvent.Dispose(); - } - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - #endregion - - #region PublicFuctions - - /// - /// The constructor - /// - /// The controller for the power supplies - /// The file name to log the data to - /// The number os ms to rest after each iteration through the loop - /// The host callback function. If null, no callback is issued - public PowerSupplyDataLogWorker(PowerSupplyMeasurementManager controller, string fileName, int threadRestTimeMs, PowerSupplyMeasurementManager.PowerMonitorDelegate callback) - { - _controller = controller; - - // these gets set in SetControlParams - _logFilePath = fileName; - _callback = callback; - _threadRestTimeMs = threadRestTimeMs; - - _fileWriter = new StreamWriter(_logFilePath, true); - - _threadQuitControl = false; - _quitEvent = new AutoResetEvent(false); - } - - /// - /// Dispose of this object. Needed for releasing thread/comm resources - /// - public void Dispose() - { - try - { - Dispose(true); - - GC.SuppressFinalize(this); - } - catch (Exception err) - { - try - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - catch (Exception) - { - //Do not rethrow. Exception from error logger that has already been garbage collected - } - } - } - - /// - /// Loops thorugh each supply in the system, queries the status, logs it out and calls the host callback - /// - public void DoWork() - { - try - { - //Used to handle the labels at the top of the CSV log file generated - const string LOG_PREFIX = "DateTime,Module,Voltage,VoltageSetpoint,Current,IsOutputOn,fault status"; - - // callback error codes - const int NO_ERROR = 0; - const int ERROR = -1; - - List powerModules = _controller.GetPowerModuleList(); - - _fileWriter.WriteLine(LOG_PREFIX); - - while (_threadQuitControl == false) - { - try - { - if (_quitEvent.WaitOne(_threadRestTimeMs)) - { - _threadQuitControl = true; - } - else - { - //string callbackData = CALLBACK_PREFIX; - List callBackDataList = new List(); - - //get data from each supply - foreach (string powerModule in powerModules) - { - // check for quit event and exit if needed - if (_quitEvent.WaitOne(1) == true) - { - _threadQuitControl = true; - - break; - } - - PowerData data = _controller.ReadPowerData(powerModule); - - PowerMonitorCallbackData callbackData; - callbackData.powerModule = powerModule; - callbackData.voltage = data.Voltage; - callbackData.voltageSetpoint = data.VoltageSetpoint; - callbackData.current = data.Current; - callbackData.outputStatus = data.OutputStatus; - callbackData.ovpocpStatus = data.FaultStatus; - callbackData.overVoltageProtectionValue = data.OverVoltageProtection; - callbackData.overCurrentProtectionValue = data.OverCurrentProtection; - - callBackDataList.Add(callbackData); - - string log = Util.GetTimeString() + "," + powerModule + "," + Convert.ToString(data.Voltage) + "," + Convert.ToString(data.VoltageSetpoint) + "," + Convert.ToString(data.Current) + "," + Convert.ToString(data.OutputStatus) + "," + Convert.ToString(data.FaultStatus); - - // log out the data - _fileWriter.WriteLine(log); - _fileWriter.Flush(); - - // check for quit event and exit if needed - if (_quitEvent.WaitOne(1) == true) - { - _threadQuitControl = true; - - break; - } - } - - // At this point our return and log strings are both built, so return back the data string on the callback - if (_callback != null && _threadQuitControl == false && callBackDataList.Count != 0) - { - _callback(callBackDataList, NO_ERROR); - } - } - } - catch (Exception e) - { - string msg = e.Message; - - ErrorLogger.Instance().Write(msg + "\r\n" + e.StackTrace, ErrorLogger.LogLevel.ERROR); - - _fileWriter.WriteLine(Util.GetTimeString() + ", " + msg); - - // if callbacks are enabled, alert the host to the error - if (_callback != null && _threadQuitControl == false) - { - _callback(null, ERROR); - } - } - } - - ErrorLogger.Instance().Write("PowerSupplyDataLogWorker::DoWork() - exiting", ErrorLogger.LogLevel.INFO); - } - catch (Exception err) - { - ErrorLogger.Instance().Write(err.Message + "\r\n" + err.StackTrace); - } - } - - /// - /// Stops the thread, closes the datalogger and calls move file - /// - public void QuitWork() - { - _threadQuitControl = true; - - _quitEvent.Set(); - } - - #endregion - } -} diff --git a/Source/TSRealLib/MAL/Managers/SpaceChamberLSPSMeasurementManager/SpaceChamberLspsMeasurementManager.cs b/Source/TSRealLib/MAL/Managers/SpaceChamberLSPSMeasurementManager/SpaceChamberLspsMeasurementManager.cs index 79eaa52..4f7abeb 100644 --- a/Source/TSRealLib/MAL/Managers/SpaceChamberLSPSMeasurementManager/SpaceChamberLspsMeasurementManager.cs +++ b/Source/TSRealLib/MAL/Managers/SpaceChamberLSPSMeasurementManager/SpaceChamberLspsMeasurementManager.cs @@ -13,7 +13,7 @@ using System.Threading.Tasks; namespace MeasurementManagerLib { - public class SpaceChamberLSPSMeasurementManager + public class SpaceChamberLspsMeasurementManager { private INetCdfData netCdfData_ = null; private readonly ILspsChamber lspsChamber_; @@ -25,7 +25,7 @@ namespace MeasurementManagerLib /// /// /// - public SpaceChamberLSPSMeasurementManager(IInstrumentManager instrumentManager, string lspsChamber, string netCdfData) + public SpaceChamberLspsMeasurementManager(IInstrumentManager instrumentManager, string lspsChamber, string netCdfData) { _logger = LogManager.GetCurrentClassLogger(); _logger?.Debug($"Entering {this.GetType().Name}::{System.Reflection.MethodBase.GetCurrentMethod().Name}() method..."); diff --git a/Source/TSRealLib/MAL/Managers/SwitchMeasurementManager/SwitchMeasurementManager.cs b/Source/TSRealLib/MAL/Managers/SwitchMeasurementManager/SwitchMeasurementManager.cs index 04c83a2..d15265d 100644 --- a/Source/TSRealLib/MAL/Managers/SwitchMeasurementManager/SwitchMeasurementManager.cs +++ b/Source/TSRealLib/MAL/Managers/SwitchMeasurementManager/SwitchMeasurementManager.cs @@ -15,15 +15,15 @@ GOVERNMENT. UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; using NLog; using Raytheon.Common; using Raytheon.Instruments; using Raytheon.Instruments.Dmm; using Raytheon.Units; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; namespace MeasurementManagerLib { @@ -53,7 +53,10 @@ namespace MeasurementManagerLib AC, }; - public delegate void SwitchMeasurementDelegate(); + public Dictionary _dmmResistancePseudoTypeToTrueTypeMap = new Dictionary() { + { DMMResistanceType.TWO, MeasurementFunction.TwoWireResistance } , + { DMMResistanceType.FOUR, MeasurementFunction.FourWireResistance } + }; /// /// Struct for holding on to DMM measurement definitions @@ -112,21 +115,23 @@ namespace MeasurementManagerLib public readonly double _range; public readonly double _resolution; public readonly double _scaleFactor; - public readonly int _delay; - public List _relays; - public DMMResistanceType _dmmResistanceType; + public readonly int _minDelay; + public readonly int _maxDelay; + public string _relayPath; + public Raytheon.Instruments.Dmm.MeasurementFunction _dmmResistanceType; public readonly string _cableAndPinId; public readonly double _lowerLimit; public readonly double _upperLimit; - public DMMResistanceMeasurementFields(string pcode, double range, double resolution, int delay, double scaleFactor, List relays, DMMResistanceType type, string cableAndPinId, double lowerLimit, double upperLimit) + public DMMResistanceMeasurementFields(string pcode, double range, double resolution, int minDelay, int maxDelay, double scaleFactor, string relayPath, Raytheon.Instruments.Dmm.MeasurementFunction type, string cableAndPinId, double lowerLimit, double upperLimit) { _pcode = pcode; _range = range; _resolution = resolution; - _delay = delay; + _minDelay = minDelay; + _maxDelay = maxDelay; _scaleFactor = scaleFactor; - _relays = relays; + _relayPath = relayPath; _dmmResistanceType = type; _cableAndPinId = cableAndPinId; _lowerLimit = lowerLimit; @@ -134,16 +139,6 @@ namespace MeasurementManagerLib } } - public struct SwitchMeasurementFields - { - public List _relays; - - public SwitchMeasurementFields(List relays) - { - _relays = relays; - } - } - /// /// State for a trigger edge. /// @@ -220,38 +215,15 @@ namespace MeasurementManagerLib } } - //public Dictionary _dmmFrequencyMeasurements = new Dictionary(StringComparer.InvariantCultureIgnoreCase); - public Dictionary DmmFrequencyMeasurements - { - get { return _dmmFrequencyMeasurements; } - set { _dmmFrequencyMeasurements = value; CheckForDmmFrequencyConfigValidity(); } - } - public Dictionary DmmResistanceMeasurements - { - get { return _dmmResistanceMeasurements; } - set { _dmmResistanceMeasurements = value; CheckForDmmResistanceConfigValidity(); } - } - public Dictionary DmmVoltageMeasurements - { - get { return _dmmVoltageMeasurements; } - set { _dmmVoltageMeasurements = value; CheckForDmmVoltageConfigValidity(); } - } - public Dictionary SwitchMeasurements { get; set; } - public Dictionary ScopeFreqMeasurements - { - get { return _scopeFreqMeasurements; } - set { _scopeFreqMeasurements = value; CheckForScopeFrequencyConfigValidity(); } - } - public Dictionary ScopePulseWidthMeasurements - { - get { return _scopePulseWidthMeasurements; } - set { _scopePulseWidthMeasurements = value; CheckForScopePulseWidthConfigValidity(); } - } - public List RelayExclusionList { get; set; } + public Dictionary DmmFrequencyMeasurements { get; private set; } + public Dictionary DmmResistanceMeasurements { get; private set; } + public Dictionary DmmVoltageMeasurements { get; private set; } + public Dictionary ScopeFreqMeasurements { get; private set; } + public Dictionary ScopePulseWidthMeasurements { get; private set; } + public Dictionary RelayMap { get; private set; } #endregion - #region PrivateClassMembers /// /// private class members @@ -265,15 +237,8 @@ namespace MeasurementManagerLib private static NLog.ILogger _logger; - private Dictionary _dmmResistanceMeasurements; - private Dictionary _dmmFrequencyMeasurements; - private Dictionary _dmmVoltageMeasurements; - private Dictionary _scopeFreqMeasurements; - private Dictionary _scopePulseWidthMeasurements; - #endregion - #region PrivateFunctions /// @@ -281,7 +246,7 @@ namespace MeasurementManagerLib /// ~SwitchMeasurementManager() { - Dispose(false); + } /// @@ -291,20 +256,15 @@ namespace MeasurementManagerLib { foreach (KeyValuePair entry in DmmResistanceMeasurements) { - List relays = entry.Value._relays; - - foreach (string relayDef in relays) + string[] relayInfo = entry.Value._relayPath.Split(':'); + if (relayInfo.Length != 2) { - string[] relayInfo = relayDef.Split('-'); - if (relayInfo.Length != 2) - { - throw new Exception("Dmm resistance measurement relay format is not correct: " + relayDef); - } + throw new Exception("Relay format is not correct: " + relayInfo[0]); + } - if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) - { - throw new Exception("Dmm resistance measurement relay card field does not exist: " + relayInfo[0]); - } + if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) + { + throw new Exception("Switch card does not exist: " + relayInfo[0]); } } } @@ -316,20 +276,15 @@ namespace MeasurementManagerLib { foreach (KeyValuePair entry in DmmFrequencyMeasurements) { - List relays = entry.Value._relays; - - foreach (string relayDef in relays) + string[] relayInfo = entry.Value._relays[0].Split(':'); + if (relayInfo.Length != 2) { - string[] relayInfo = relayDef.Split('-'); - if (relayInfo.Length != 2) - { - throw new Exception("Dmm frequency measurement relay format is not correct: " + relayDef); - } + throw new Exception("Relay format is not correct: " + relayInfo[0]); + } - if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) - { - throw new Exception("Dmm frequency measurement relay card field does not exist: " + relayInfo[0]); - } + if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) + { + throw new Exception("Switch card does not exist: " + relayInfo[0]); } } } @@ -341,20 +296,15 @@ namespace MeasurementManagerLib { foreach (KeyValuePair entry in DmmVoltageMeasurements) { - List relays = entry.Value._relays; - - foreach (string relayDef in relays) + string[] relayInfo = entry.Value._relays[0].Split(':'); + if (relayInfo.Length != 2) { - string[] relayInfo = relayDef.Split('-'); - if (relayInfo.Length != 2) - { - throw new Exception("Dmm voltage measurement relay format is not correct: " + relayDef); - } + throw new Exception("Relay format is not correct: " + relayInfo[0]); + } - if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) - { - throw new Exception("Dmm voltage measurement relay card field does not exist: " + relayInfo[0]); - } + if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) + { + throw new Exception("Switch card does not exist: " + relayInfo[0]); } } } @@ -366,20 +316,15 @@ namespace MeasurementManagerLib { foreach (KeyValuePair entry in ScopeFreqMeasurements) { - List relays = entry.Value._relays; - - foreach (string relayDef in relays) + string[] relayInfo = entry.Value._relays[0].Split(':'); + if (relayInfo.Length != 2) { - string[] relayInfo = relayDef.Split('-'); - if (relayInfo.Length != 2) - { - throw new Exception("Scope frequency measurement relay format is not correct: " + relayDef); - } + throw new Exception("Relay format is not correct: " + relayInfo[0]); + } - if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) - { - throw new Exception("Scope frequency measurement relay card field does not exist: " + relayInfo[0]); - } + if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) + { + throw new Exception("Switch card does not exist: " + relayInfo[0]); } } } @@ -391,89 +336,17 @@ namespace MeasurementManagerLib { foreach (KeyValuePair entry in ScopePulseWidthMeasurements) { - List relays = entry.Value._relays; - - foreach (string relayDef in relays) + string[] relayInfo = entry.Value._relays[0].Split(':'); + if (relayInfo.Length != 2) { - string[] relayInfo = relayDef.Split('-'); - if (relayInfo.Length != 2) - { - throw new Exception("Scope pulse width measurement relay format is not correct: " + relayDef); - } - - if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) - { - throw new Exception("Scope pulse width measurement relay card field does not exist: " + relayInfo[0]); - } + throw new Exception("Relay format is not correct: " + relayInfo[0]); } - } - } - /// - /// Check a list of relays against a list of not allowed relays - /// - /// - /// True if everything is good and checks out, false if relaysToCheck contains a relay on the not allowed list - private bool CheckRelayVerificationList(List relaysToCheck) - { - for (int i = 0; i < relaysToCheck.Count; i++) - { - string relayToCheck = relaysToCheck[i]; - - for (int j = 0; j < RelayExclusionList.Count; j++) + if (_switchCards.ContainsKey(relayInfo[0].ToUpper()) == false) { - string notAllowedRelay = RelayExclusionList[j]; - - if (relayToCheck.ToUpper() == notAllowedRelay.ToUpper()) - { - return false; - } + throw new Exception("Switch card does not exist: " + relayInfo[0]); } } - - return true; - } - - /// - /// - /// - /// - /// - /// - /// - /// - private void ConfigureDmmSettingsAndCloseAnyRelays(string measurementName, out List measurementRelays, out DMMResistanceMeasurementFields measurement, out MeasurementFunction type, bool delayAfterClosingRelay = true) - { - if (DmmResistanceMeasurements.ContainsKey(measurementName.ToUpper()) == false) - { - throw new Exception("could not find measurement: " + measurementName); - } - - measurement = DmmResistanceMeasurements[measurementName.ToUpper()]; - measurementRelays = measurement._relays; - - byte desiredMeasurementType = (byte)measurement._dmmResistanceType; - - SwitchRelayClose(measurementRelays); - - if (delayAfterClosingRelay) - { - Thread.Sleep(measurement._delay); - } - - type = Raytheon.Instruments.Dmm.MeasurementFunction.TwoWireResistance; - if (measurement._dmmResistanceType == DMMResistanceType.TWO) - { - type = Raytheon.Instruments.Dmm.MeasurementFunction.TwoWireResistance; - } - else if (measurement._dmmResistanceType == DMMResistanceType.FOUR) - { - type = Raytheon.Instruments.Dmm.MeasurementFunction.FourWireResistance; - } - else - { - throw new Exception("unknown resistance type: " + measurement._dmmResistanceType.ToString()); - } } /// @@ -486,53 +359,23 @@ namespace MeasurementManagerLib { if (_dmm != null) { - try - { - _dmm.Shutdown(); - } - catch (Exception err) - { - _logger?.Error(err.Message + "\r\n" + err.StackTrace); - } + _dmm.Shutdown(); } if (_switchCards != null) { foreach (KeyValuePair switchCard in _switchCards) { - try + if (_switchCards[switchCard.Key] != null) { - if (_switchCards[switchCard.Key] != null) - { - _switchCards[switchCard.Key].Shutdown(); - } - } - catch (Exception err) - { - _logger?.Error(err.Message + "\r\n" + err.StackTrace); + _switchCards[switchCard.Key].Shutdown(); } } } if (_scope != null) { - try - { - _scope.Shutdown(); - } - catch (Exception err) - { - _logger?.Error(err.Message + "\r\n" + err.StackTrace); - } - } - - try - { - ErrorLogger.Instance().Dispose(); - } - catch (Exception) - { - // nothing to do + _scope.Shutdown(); } } } @@ -541,29 +384,55 @@ namespace MeasurementManagerLib /// Will command the switch cards close a specified list of relays /// /// - private void SwitchRelayClose(List relayList) + public void SwitchRelayClose(List relayList) { - // open all relays on the switch. Just extra layer of protection so we don't short out the relays - SwitchRelayOpenAll(); - Thread.Sleep(10); - - // verify none of the relays are on the exclusion list - bool areRelaysOk = CheckRelayVerificationList(relayList); - - if (areRelaysOk == false) - { - throw new Exception("Commanded relay is not allowed"); - } - - foreach (string combo in relayList) + string cardName = String.Empty; + string path = String.Empty; + foreach (string item in relayList) { //break out the card and relay - string[] cardRelay = combo.Split('-'); - string cardObject = cardRelay[0].Trim(); - string relay = cardRelay[1].Trim(); + if (item.Contains(":")) + { + string[] itemArray = item.Split(':'); + cardName = itemArray[0].Trim(); + path = itemArray[1].Trim(); + } + else + path = item.Trim(); + if (!String.IsNullOrEmpty(cardName)) + { + //close the relays + _switchCards[cardName.ToUpper()].Connect(path); + } + } + } + + /// + /// Will command the switch cards close a specified list of relays + /// + /// + public void SwitchRelayClose(string relayPath) + { + string cardName = String.Empty; + string path = String.Empty; + + string[] itemArray = relayPath.Split(':'); + //break out the card and relay + if (itemArray.Length == 2) + { + cardName = itemArray[0].Trim(); + path = itemArray[1].Trim(); + } + else + { + throw new Exception($"Invalid relay path: {relayPath}. Expected format: [Switch_Instance_Name]:[RelayPath]"); + } + + if (!String.IsNullOrEmpty(cardName)) + { //close the relays - _switchCards[cardObject.ToUpper()].Connect(relay); + _switchCards[cardName.ToUpper()].Connect(path); } } @@ -571,17 +440,55 @@ namespace MeasurementManagerLib /// Will command the switch card open all relays or the specified list of relays /// /// Optional list of relays to open - private void SwitchRelayOpen(List relayList) + public void SwitchRelayOpen(List relayList) { - foreach (string combo in relayList) + string cardName = String.Empty; + string path = String.Empty; + foreach (string item in relayList) { //break out the card and relay - string[] cardRelay = combo.Split('-'); - string cardObject = cardRelay[0].Trim(); - string relay = cardRelay[1].Trim(); + if (item.Contains(":")) + { + string[] itemArray = item.Split(':'); + cardName = itemArray[0].Trim(); + path = itemArray[1].Trim(); + } + else + path = item.Trim(); - //open the relays - _switchCards[cardObject.ToUpper()].Disconnect(relay); + if (!String.IsNullOrEmpty(cardName)) + { + //close the relays + _switchCards[cardName.ToUpper()].Disconnect(path); + } + } + } + + /// + /// Will command the switch cards close a specified list of relays + /// + /// + public void SwitchRelayOpen(string relayPath) + { + string cardName = String.Empty; + string path = String.Empty; + + string[] itemArray = relayPath.Split(':'); + //break out the card and relay + if (itemArray.Length == 2) + { + cardName = itemArray[0].Trim(); + path = itemArray[1].Trim(); + } + else + { + throw new Exception($"Invalid relay path: {relayPath}. Expected format: [Switch_Instance_Name]:[RelayPath]"); + } + + if (!String.IsNullOrEmpty(cardName)) + { + //close the relays + _switchCards[cardName.ToUpper()].Disconnect(path); } } @@ -604,11 +511,9 @@ namespace MeasurementManagerLib /// constructor that uses instrument manager for creating an instrument /// /// - /// - /// - /// - /// - public SwitchMeasurementManager(IInstrumentManager instrumentManager) + /// + /// Skip DMM initialzation, since we want to initialize it separately like the SquibMeter + public SwitchMeasurementManager(IInstrumentManager instrumentManager, string switchMeasurementManagerConfigFullPath, bool skipDmmInitialization = false) { _logger = LogManager.GetCurrentClassLogger(); @@ -625,7 +530,9 @@ namespace MeasurementManagerLib if (dmmList.Count > 0) { _dmm = (IDmm)dmmList.First(); - _dmm.Initialize(); + + if (!skipDmmInitialization) + _dmm.Initialize(); } ICollection scopeList = instrumentManager.GetInstruments(typeof(IOscilloScope)); @@ -634,6 +541,256 @@ namespace MeasurementManagerLib _scope = (IOscilloScope)dmmList.First(); _scope.Initialize(); } + + if (switchCardList.Count == 0) + { + throw new Exception("Please add a Switch instrument. Switch manager needs one inder to work properly."); + } + + if (dmmList.Count == 0 && scopeList.Count == 0) + { + throw new Exception("Please add a DMM or Scope instrument. Switch manager needs one of these instruments to inder to work properly."); + } + + RelayMap = new Dictionary(); + DmmFrequencyMeasurements = new Dictionary(); + DmmResistanceMeasurements = new Dictionary(); + DmmVoltageMeasurements = new Dictionary(); + ScopeFreqMeasurements = new Dictionary(); + ScopePulseWidthMeasurements = new Dictionary(); + + ConfigurationFile configurationFile = new ConfigurationFile(switchMeasurementManagerConfigFullPath); + + ParseRelayListDef(configurationFile); + + ParseDmmFrequencyMeasurementDef(configurationFile); + CheckForDmmFrequencyConfigValidity(); + + ParseDmmResistanceMeasurementDef(configurationFile); + CheckForDmmResistanceConfigValidity(); + + ParseDmmVoltageMeasurementDef(configurationFile); + CheckForDmmVoltageConfigValidity(); + + ParseScopeFrequencyMeasurementDef(configurationFile); + CheckForScopeFrequencyConfigValidity(); + + ParseScopePulseWidthMeasurementDef(configurationFile); + CheckForScopePulseWidthConfigValidity(); + } + + /// + /// Parse Relay list defintions from config file + /// + private void ParseRelayListDef(ConfigurationFile configurationFile) + { + const string RELAY_EXCLUSION_SECTION_NAME = "RELAYS"; + + List keys = configurationFile.ReadAllKeys(RELAY_EXCLUSION_SECTION_NAME); + foreach (string key in keys) + { + RelayMap[key] = configurationFile.ReadValue(RELAY_EXCLUSION_SECTION_NAME, key); + } + } + + /// + /// Parse DMM Resistance measurement defintions from config file + /// + private void ParseDmmResistanceMeasurementDef(ConfigurationFile configurationFile) + { + const string DMM_RESISTANCE_SECTION_NAME = "DmmReadResistance"; + + List keys = configurationFile.ReadAllKeys(DMM_RESISTANCE_SECTION_NAME); + foreach (string key in keys) + { + List valueList = configurationFile.ReadList(DMM_RESISTANCE_SECTION_NAME, key); + + int index = 0; + string pcode = valueList[index++]; + double range = Convert.ToDouble(valueList[index++]); + double res = Convert.ToDouble(valueList[index++]); + int minDelay = Convert.ToInt32(valueList[index++]); + int maxDelay = Convert.ToInt32(valueList[index++]); + double scaleFactor = Convert.ToDouble(valueList[index++]); + + string relayPath = valueList[index++]; + string resistanceTypeStr = valueList[index++].Trim(); + DMMResistanceType type = (DMMResistanceType)Enum.Parse(typeof(DMMResistanceType), resistanceTypeStr, true); + string cableAndPinId = valueList[index++]; + double lowerLimit = Convert.ToDouble(valueList[index++]); + double upperLimit = Convert.ToDouble(valueList[index++]); + + DmmResistanceMeasurements.Add(key.ToUpper(), new DMMResistanceMeasurementFields(pcode, range, res, minDelay, maxDelay, scaleFactor, relayPath, _dmmResistancePseudoTypeToTrueTypeMap[type], cableAndPinId, lowerLimit, upperLimit)); + } + } + + /// + /// Parse DMM Frequency measurement defintions from config file + /// + private void ParseDmmFrequencyMeasurementDef(ConfigurationFile configurationFile) + { + const string DMM_FREQUENCY_SECTION_NAME = "DmmReadFrequency"; + + const char BAR_DELIM = '|'; + const char COMMA_DELIM = ','; + + List keys = configurationFile.ReadAllKeys(DMM_FREQUENCY_SECTION_NAME); + foreach (string key in keys) + { + string value = configurationFile.ReadValue(DMM_FREQUENCY_SECTION_NAME, key); + string[] valueList = value.Split(BAR_DELIM); + + int index = 0; + double range = Convert.ToDouble(valueList[index++]); + double res = Convert.ToDouble(valueList[index++]); + int delay = Convert.ToInt32(valueList[index++]); + double scaleFactor = Convert.ToDouble(valueList[index++]); + List relayList = valueList[index++].Split(COMMA_DELIM).ToList(); + for (int i = 0; i < relayList.Count; ++i) + { + relayList[i] = relayList[i].Trim(); + } + double voltRange = Convert.ToDouble(valueList[index++]); + double numReads = Convert.ToDouble(valueList[index++]); + DmmFrequencyMeasurements.Add(key.ToUpper(), new DMMFrequencyMeasurementFields(range, res, delay, scaleFactor, relayList, voltRange, numReads)); + } + } + + /// + /// Parse DMM voltage measurement defintions from config file + /// + private void ParseDmmVoltageMeasurementDef(ConfigurationFile configurationFile) + { + const string DMM_VOLTAGE_SECTION_NAME = "DmmReadVoltage"; + + const char BAR_DELIM = '|'; + const char COMMA_DELIM = ','; + + List keys = configurationFile.ReadAllKeys(DMM_VOLTAGE_SECTION_NAME); + foreach (string key in keys) + { + string value = configurationFile.ReadValue(DMM_VOLTAGE_SECTION_NAME, key); + string[] valueList = value.Split(BAR_DELIM); + + int index = 0; + double range = Convert.ToDouble(valueList[index++]); + double res = Convert.ToDouble(valueList[index++]); + int delay = Convert.ToInt32(valueList[index++]); + double scaleFactor = Convert.ToDouble(valueList[index++]); + List relayList = valueList[index++].Split(COMMA_DELIM).ToList(); + for (int i = 0; i < relayList.Count; ++i) + { + relayList[i] = relayList[i].Trim(); + } + string voltTypeStr = valueList[index++].Trim(); + DMMVoltageType type = (DMMVoltageType)Enum.Parse(typeof(DMMVoltageType), voltTypeStr, true); + + DmmVoltageMeasurements.Add(key.ToUpper(), new DMMVoltageMeasurementFields(range, res, delay, scaleFactor, relayList, type)); + } + } + + /// + /// Parse Scope frequency measurement defintions from config file + /// + private void ParseScopeFrequencyMeasurementDef(ConfigurationFile configurationFile) + { + const string SCOPE_FREQUENCY_SECTION_NAME = "ScopeReadFrequency"; + + const char BAR_DELIM = '|'; + const char COMMA_DELIM = ','; + + List keys = configurationFile.ReadAllKeys(SCOPE_FREQUENCY_SECTION_NAME); + foreach (string key in keys) + { + string value = configurationFile.ReadValue(SCOPE_FREQUENCY_SECTION_NAME, key); + string[] valueList = value.Split(BAR_DELIM); + + int index = 0; + // support for no relays (direct connect to scope) + List relayList = new List(); + if (valueList[index].Trim() == "") + { + // no relays, nothing to do + } + else + { + relayList = valueList[index].Split(COMMA_DELIM).ToList(); + } + index++; + + for (int i = 0; i < relayList.Count; ++i) + { + relayList[i] = relayList[i].Trim(); + } + + int channel = Convert.ToInt32(valueList[index++]); + string edgeStr = valueList[index++].Trim(); + ScopeEdge edge = (ScopeEdge)Enum.Parse(typeof(ScopeEdge), edgeStr, true); + double timePerDivision = Convert.ToDouble(valueList[index++]); + double timeoffset = Convert.ToDouble(valueList[index++]); + double timetriggerLevel = Convert.ToDouble(valueList[index++]); + + double voltageOffset = Convert.ToDouble(valueList[index++]); + double voltageScale = Convert.ToDouble(valueList[index++]); + string inputImpedance = valueList[index++]; + int delay = Convert.ToInt32(valueList[index++]); + bool shallWeSaveImage = Convert.ToBoolean(valueList[index++]); + int maxTriggerWaitTime = Convert.ToInt32(valueList[index++]); + + ScopeFreqMeasurements.Add(key.ToUpper(), new ScopeFrequencyMeasurementFields(relayList, channel, edge, timePerDivision, timeoffset, timetriggerLevel, voltageOffset, voltageScale, inputImpedance, delay, shallWeSaveImage, maxTriggerWaitTime)); + } + } + + /// + /// Parse Scope pulse width measurement defintions from config file + /// + private void ParseScopePulseWidthMeasurementDef(ConfigurationFile configurationFile) + { + const string SCOPE_PULSE_WIDTH_SECTION_NAME = "ScopeReadPulseWidth"; + + const char BAR_DELIM = '|'; + const char COMMA_DELIM = ','; + + List keys = configurationFile.ReadAllKeys(SCOPE_PULSE_WIDTH_SECTION_NAME); + foreach (string key in keys) + { + string value = configurationFile.ReadValue(SCOPE_PULSE_WIDTH_SECTION_NAME, key); + string[] valueList = value.Split(BAR_DELIM); + + int index = 0; + // support for no relays (direct connect to scope) + List relayList = new List(); + if (valueList[index].Trim() == "") + { + // no relays, nothing to do + } + else + { + relayList = valueList[index].Split(COMMA_DELIM).ToList(); + } + index++; + + for (int i = 0; i < relayList.Count; ++i) + { + relayList[i] = relayList[i].Trim(); + } + + int channel = Convert.ToInt32(valueList[index++]); + string edgeStr = valueList[index++].Trim(); + ScopeEdge edge = (ScopeEdge)Enum.Parse(typeof(ScopeEdge), edgeStr, true); + double timePerDivision = Convert.ToDouble(valueList[index++]); + double timeoffset = Convert.ToDouble(valueList[index++]); + double timetriggerLevel = Convert.ToDouble(valueList[index++]); + + double voltageOffset = Convert.ToDouble(valueList[index++]); + double voltageScale = Convert.ToDouble(valueList[index++]); + string inputImpedance = valueList[index++]; + int delay = Convert.ToInt32(valueList[index++]); + bool shallWeSaveImage = Convert.ToBoolean(valueList[index++]); + int maxTriggerWaitTime = Convert.ToInt32(valueList[index++]); + + ScopePulseWidthMeasurements.Add(key.ToUpper(), new ScopePulseWidthMeasurementFields(relayList, channel, edge, timePerDivision, timeoffset, timetriggerLevel, voltageOffset, voltageScale, inputImpedance, delay, shallWeSaveImage, maxTriggerWaitTime)); + } } /// @@ -664,44 +821,6 @@ namespace MeasurementManagerLib } } - /// - /// A getter for the list of frequency measurements (as defined in the input def file) - /// - /// A list of frequency measurements - public List DmmGetFrequencyMeasurementList() - { - lock (_syncObj) - { - List measurements = new List(); - - foreach (KeyValuePair entry in DmmFrequencyMeasurements) - { - measurements.Add(entry.Key); - } - - return measurements; - } - } - - /// - /// A getter for the list of resistance measurements (as defined in the input def file) - /// - /// A list of resistance measurements - public List DmmGetResistanceMeasurementList() - { - lock (_syncObj) - { - List measurements = new List(); - - foreach (KeyValuePair entry in DmmResistanceMeasurements) - { - measurements.Add(entry.Key); - } - - return measurements; - } - } - /// /// Make a DMM frequency measurement /// @@ -765,21 +884,39 @@ namespace MeasurementManagerLib /// The measured resistance public double DmmReadResistance(string measurementName) { - // hold onto the relays for the catch - List measurementRelays = null; + if (DmmResistanceMeasurements.ContainsKey(measurementName.ToUpper()) == false) + { + throw new Exception("Could not find DMM resistance measurement: " + measurementName); + } + + DMMResistanceMeasurementFields measurement = DmmResistanceMeasurements[measurementName.ToUpper()]; try { lock (_syncObj) { - ConfigureDmmSettingsAndCloseAnyRelays(measurementName, out measurementRelays, out DMMResistanceMeasurementFields measurement, out MeasurementFunction type); + SwitchRelayClose(measurement._relayPath); - // make the measurement - _dmm.ConfigureResistanceMeasurement(type, Resistance.FromOhms(measurement._range), Resistance.FromOhms(measurement._resolution)); - double returnValue = _dmm.MeasureResistance(100).Ohms; + double returnValue = 0.0; + int durationMs = 0; + do + { + if (measurement._minDelay > 0) + Thread.Sleep(measurement._minDelay); - // Multiply by the scale factor - returnValue *= measurement._scaleFactor; + // make the measurement + _dmm.ConfigureResistanceMeasurement(measurement._dmmResistanceType, Resistance.FromOhms(measurement._range), Resistance.FromOhms(measurement._resolution)); + returnValue = _dmm.MeasureResistance(100).Ohms; + + // Multiply by the scale factor + returnValue *= measurement._scaleFactor; + + if (measurement._minDelay <= 0) + break; + + durationMs += measurement._minDelay; + + } while (!(returnValue >= measurement._lowerLimit && returnValue <= measurement._upperLimit) && durationMs < measurement._maxDelay); // return the measurement return returnValue; @@ -791,79 +928,7 @@ namespace MeasurementManagerLib } finally { - // open the relays - if (measurementRelays != null) - { - SwitchRelayOpen(measurementRelays); - } - } - } - - /// - /// Make a DMM resistance measurement up to intNumberOfReadings times or when the measurement is within percentRangeToStopInDecimal of the previous measurement - /// - /// The measured resistance - public double DmmReadResistanceAndStopReadingWithinACertainRange(string measurementName, double percentRangeToStopInDecimal, int maxNumberOfReadings = 50) - { - // hold onto the relays for the catch - List measurementRelays = null; - - try - { - lock (_syncObj) - { - ConfigureDmmSettingsAndCloseAnyRelays(measurementName, out measurementRelays, out DMMResistanceMeasurementFields measurement, out MeasurementFunction type, false); - - var returnValue = 0.0; - var lastReadLess = 0.0; - var lastReadPlus = 0.0; - var numOfReadings = 0; - do - { - Thread.Sleep(measurement._delay); - lastReadLess = returnValue * (1 - percentRangeToStopInDecimal); - lastReadPlus = returnValue * (1 + percentRangeToStopInDecimal); - - _dmm.ConfigureResistanceMeasurement(type, Resistance.FromOhms(measurement._range), Resistance.FromOhms(measurement._resolution)); - returnValue = _dmm.MeasureResistance(100).Ohms; - numOfReadings++; - } while (!(lastReadLess <= returnValue && returnValue <= lastReadPlus) && numOfReadings < maxNumberOfReadings); - - returnValue *= measurement._scaleFactor; - - return returnValue; - } - } - catch (Exception) - { - throw; - } - finally - { - // open the relays - if (measurementRelays != null) - { - SwitchRelayOpen(measurementRelays); - } - } - } - - /// - /// A getter for the list of voltage measurements(as defined in the input def file) - /// - /// A list of voltage measurements - public List DmmGetVoltageMeasurementList() - { - lock (_syncObj) - { - List measurements = new List(); - - foreach (KeyValuePair entry in DmmVoltageMeasurements) - { - measurements.Add(entry.Key); - } - - return measurements; + SwitchRelayOpen(measurement._relayPath); } } @@ -925,44 +990,6 @@ namespace MeasurementManagerLib } } - /// - /// A getter for the list of scope freq measurements(as defined in the input def file) - /// - /// A list of scope freq measurements - public List ScopeGetFrequencyMeasurementList() - { - lock (_syncObj) - { - List measurements = new List(); - - foreach (KeyValuePair entry in ScopeFreqMeasurements) - { - measurements.Add(entry.Key); - } - - return measurements; - } - } - - /// - /// A getter for the list of scope freq measurements(as defined in the input def file) - /// - /// A list of scope freq measurements - public List ScopeGetPulseWidthMeasurementList() - { - lock (_syncObj) - { - List measurements = new List(); - - foreach (KeyValuePair entry in ScopePulseWidthMeasurements) - { - measurements.Add(entry.Key); - } - - return measurements; - } - } - /// /// Make a fall time measurement with the scope /// @@ -1335,68 +1362,6 @@ namespace MeasurementManagerLib } } - /// - /// - /// - /// - /// - /*public void SwitchControl(string switchControlName, bool shallWeClose) - { - try - { - lock (_syncObj) - { - } - } - catch (Exception) - { - throw; - } - }*/ - - /// - /// Closes the switches defined in the config file, then issues a callback to the host to invoke some stimulus and make a measurement, then opens the relays - /// - /// The measurement to make(the name from the input def file) - /// The function to call after the switches have been set - public void SwitchMeasurement(string switchMeasurementTestName, SwitchMeasurementDelegate callback) - { - // hold onto the relays for the catch - List measurementRelays = null; - - try - { - lock (_syncObj) - { - if (SwitchMeasurements.ContainsKey(switchMeasurementTestName.ToUpper()) == false) - { - throw new Exception("could not find measurement: " + switchMeasurementTestName); - } - - // grab the relays - measurementRelays = SwitchMeasurements[switchMeasurementTestName]._relays; - - // close the relays - SwitchRelayClose(measurementRelays); - - //Call the Callback for Measurement so the host can do what they need to do - callback(); - } - } - catch (Exception) - { - throw; - } - finally - { - // open the relays - if (measurementRelays != null) - { - SwitchRelayOpen(measurementRelays); - } - } - } - #endregion } } \ No newline at end of file diff --git a/Source/TSRealLib/RINSS/InstrumentManager/GeneralIntsrumentManager/GeneralInstrumentManager.cs b/Source/TSRealLib/RINSS/InstrumentManager/GeneralIntsrumentManager/GeneralInstrumentManager.cs index 8db324f..e97f4e7 100644 --- a/Source/TSRealLib/RINSS/InstrumentManager/GeneralIntsrumentManager/GeneralInstrumentManager.cs +++ b/Source/TSRealLib/RINSS/InstrumentManager/GeneralIntsrumentManager/GeneralInstrumentManager.cs @@ -17,72 +17,71 @@ UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. -------------------------------------------------------------------------*/ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.ComponentModel.Composition; -using Raytheon.Communication; -using Raytheon.Communication.Rpc; -using Raytheon.Logging; -using Raytheon.Composition; -using Raytheon.Common; +using System.IO; +using System.Linq; +using System.Reflection; +using System.ServiceProcess; +using System.Text; using System.Xml.Linq; using Microsoft.Win32; -using System.IO; -using System.ServiceProcess; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Collections.ObjectModel; -using System.Reflection; -using System.IO.Ports; +using Raytheon.Common; +using Raytheon.Communication; +using Raytheon.Communication.Rpc; +using Raytheon.Composition; +using Raytheon.Logging; namespace Raytheon.Instruments { - public enum Mode - { - /// - /// instruments must be managed by the service (like RINSS) - /// - Service, - /// - /// ignore the service and initialize instruments directly - /// - StandAlone, - /// - /// dynamically identify if instrument service is running - /// - Auto - } + public enum Mode + { + /// + /// instruments must be managed by the service (like RINSS) + /// + Service, + /// + /// ignore the service and initialize instruments directly + /// + StandAlone, + /// + /// dynamically identify if instrument service is running + /// + Auto + } - /// - /// hybrid implementation of the instrument manager interface - /// will check if - /// - public class GeneralInstrumentManager : IInstrumentManager, IPartImportsSatisfiedNotification - { - #region Private Fields + /// + /// hybrid implementation of the instrument manager interface + /// will check if + /// + public class GeneralInstrumentManager : IInstrumentManager, IPartImportsSatisfiedNotification + { + #region Private Fields - private readonly bool _haveService; + private readonly bool _haveService; - private IUms _umsHost; - private IUmsClient _instrumentManager; - private IUmsClient _rpcInstrumentManagerHost; + private IUms _umsHost; + private IUmsClient _instrumentManager; + private IUmsClient _rpcInstrumentManagerHost; - private bool _partsLoaded { get; set; } + private bool _partsLoaded { get; set; } - /// - /// PartsLocation - where the instrument manager should get it's MEF components - /// - public string _partsLocation { get; set; } - /// - /// ConfigLocation - where the configuration manager stores config files - /// specifically Instruments.xml - /// - public string _configLocation { get; set; } + /// + /// PartsLocation - where the instrument manager should get it's MEF components + /// + public string _partsLocation { get; set; } - private List _availableInstruments = new List(); - private readonly Dictionary _factoryMap = new Dictionary(); + /// + /// ConfigLocation - where the configuration manager stores config files + /// specifically Instruments.xml + /// + public string _configLocation { get; set; } - private readonly Dictionary _instruments = new Dictionary(); - private readonly HashSet _instrumentTypes = new HashSet(); + private List _availableInstruments = new List(); + private readonly Dictionary _factoryMap = new Dictionary(); + + private readonly Dictionary _instruments = new Dictionary(); + private readonly HashSet _instrumentTypes = new HashSet(); // simulation private readonly bool _isThereHardware; @@ -92,69 +91,69 @@ namespace Raytheon.Instruments #region Constants private const string NO_SERVER = "Client for communication to the server has not been setup"; - private const string SECTION = "RpcClient"; + private const string SECTION = "RpcClient"; - private const string RegistryValue = @"ConsumerInstrumentManagerPartsDirectory"; + private const string RegistryValue = @"ConsumerInstrumentManagerPartsDirectory"; - private const string RegistryValueNoRINSS = @"InstrumentManagerPartsDirectory"; + private const string RegistryValueNoRINSS = @"InstrumentManagerPartsDirectory"; - private const string RegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Raytheon"; + private const string RegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Raytheon"; - private const string DefaultName = "Default"; - private const string DefaultIP = "127.0.0.1"; - private const string DefaultPort = "8006"; - private const string DefaultMedia = "Tcp"; - private const string DefaultSerializer = "Fusion"; + private const string DefaultName = "Default"; + private const string DefaultIP = "127.0.0.1"; + private const string DefaultPort = "8006"; + private const string DefaultMedia = "Tcp"; + private const string DefaultSerializer = "Fusion"; - #endregion + #endregion - #region Imports + #region Imports - [ImportMany(typeof(IInstrumentFactory))] - private Lazy[] InstrumentFactories { get; set; } + [ImportMany(typeof(IInstrumentFactory))] + private Lazy[] InstrumentFactories { get; set; } - [Import(typeof(IUmsFactory))] - private Lazy LazyUmsFactory { get; set; } - private IUmsFactory UmsFactory { get { return LazyUmsFactory?.Value; } } + [Import(typeof(IUmsFactory))] + private Lazy LazyUmsFactory { get; set; } + private IUmsFactory UmsFactory { get { return LazyUmsFactory?.Value; } } - [Import(typeof(IConfigurationManager))] - private Lazy LazyConfigManager { get; set; } - private IConfigurationManager ConfigManager { get { return LazyConfigManager?.Value; } } + [Import(typeof(IConfigurationManager))] + private Lazy LazyConfigManager { get; set; } + private IConfigurationManager ConfigManager { get { return LazyConfigManager?.Value; } } - [Import(typeof(IUmsClientFactory))] - private Lazy LazyUmsClientFactory { get; set; } - private IUmsClientFactory UmsClientFactory { get { return LazyUmsClientFactory?.Value; } } + [Import(typeof(IUmsClientFactory))] + private Lazy LazyUmsClientFactory { get; set; } + private IUmsClientFactory UmsClientFactory { get { return LazyUmsClientFactory?.Value; } } - [Import(typeof(ILogFactory), AllowDefault = true)] - private Lazy LazyLogFactory { get; set; } - private ILogFactory LogFactory { get { return LazyLogFactory?.Value; } } + [Import(typeof(ILogFactory), AllowDefault = true)] + private Lazy LazyLogFactory { get; set; } + private ILogFactory LogFactory { get { return LazyLogFactory?.Value; } } - [ImportMany(typeof(IInstrumentProxyFactory))] - private Lazy[] ProxyFactories { get; set; } + [ImportMany(typeof(IInstrumentProxyFactory))] + private Lazy[] ProxyFactories { get; set; } - #endregion + #endregion - #region Logging - private static ILogger _logger; + #region Logging + private static ILogger _logger; - private static ILogger GetLogger() - { - FusionLogManager.Changed += l => _logger = l.GetLogger(); - return _logger; - } - #endregion + private static ILogger GetLogger() + { + FusionLogManager.Changed += l => _logger = l.GetLogger(); + return _logger; + } + #endregion - /// - /// default constructor - /// in Auto mode the Instrument Manager will use RINSS based on the service running status - /// in Service mode the Instrument Manager must have the RINSS Service running - /// in StandAlone mode the Instrument Manager will ignore RINSS - /// - public GeneralInstrumentManager(Mode mode = Mode.Auto) - { - _haveService = CheckServiceRunningStatus("RINSS"); - if (mode == Mode.Service && !_haveService) + /// + /// default constructor + /// in Auto mode the Instrument Manager will use RINSS based on the service running status + /// in Service mode the Instrument Manager must have the RINSS Service running + /// in StandAlone mode the Instrument Manager will ignore RINSS + /// + public GeneralInstrumentManager(Mode mode = Mode.Auto) + { + _haveService = CheckServiceRunningStatus("RINSS"); + if (mode == Mode.Service && !_haveService) { throw new Exception("RINSS Service is not running for Service mode"); } @@ -165,91 +164,91 @@ namespace Raytheon.Instruments } _logger = GetLogger(); - } - - /// - /// constructor to be used when no RINSS available to set parts location - /// - /// - public GeneralInstrumentManager(string partsLocation, Mode mode = Mode.Auto) - : this(mode) - { - _partsLocation = partsLocation; - } + } - /// - /// constructor to be used when no RINSS available to set parts location and configuration location - /// - /// - /// - /// - public GeneralInstrumentManager(string partsLocation, string configLocation, bool isThereHardware = true, Mode mode = Mode.Auto) - : this(partsLocation, mode) - { - _configLocation= configLocation; - _isThereHardware = isThereHardware; + /// + /// constructor to be used when no RINSS available to set parts location + /// + /// + public GeneralInstrumentManager(string partsLocation, Mode mode = Mode.Auto) + : this(mode) + { + _partsLocation = partsLocation; + } + + /// + /// constructor to be used when no RINSS available to set parts location and configuration location + /// + /// + /// + /// + public GeneralInstrumentManager(string partsLocation, string configLocation, bool isThereHardware = true, Mode mode = Mode.Auto) + : this(partsLocation, mode) + { + _configLocation = configLocation; + _isThereHardware = isThereHardware; } - /// - /// Initializes this instance. - /// - public void Initialize() - { - try - { - //Setup the instrument part path - if (!string.IsNullOrWhiteSpace(_partsLocation) && !Directory.Exists(_partsLocation)) - { - _logger.Error($"Unable to id parts in this location: {_partsLocation}"); - _partsLocation = string.Empty; - } + /// + /// Initializes this instance. + /// + public void Initialize() + { + try + { + //Setup the instrument part path + if (!string.IsNullOrWhiteSpace(_partsLocation) && !Directory.Exists(_partsLocation)) + { + _logger.Error($"Unable to id parts in this location: {_partsLocation}"); + _partsLocation = string.Empty; + } - SetupPath(); + SetupPath(); - //load the instruments - if (!_partsLoaded) - { - LoadParts(); - } + //load the instruments + if (!_partsLoaded) + { + LoadParts(); + } - if(_haveService) - { - // 1. Create the Ums Client - CreateUmsClient(); - _logger.Debug("created client"); + if (_haveService) + { + // 1. Create the Ums Client + CreateUmsClient(); + _logger.Debug("created client"); - // 2. Find out what instruments are available - _availableInstruments = new List(_rpcInstrumentManagerHost.Contract.EnumRpcInstruments()); - _logger.Debug("geting list of availible instruments"); + // 2. Find out what instruments are available + _availableInstruments = new List(_rpcInstrumentManagerHost.Contract.EnumRpcInstruments()); + _logger.Debug("geting list of availible instruments"); - // 3. Find all the instrument interfaces supported by proxy factories - InitializeFactories(); - _logger.Debug("initialized all the factories"); - } - else - { - //configure all the instruments found - ConfigureInstruments(); - } - } - catch (CompositionException) - { - throw; - } - catch (Exception) - { - throw; - } - } + // 3. Find all the instrument interfaces supported by proxy factories + InitializeFactories(); + _logger.Debug("initialized all the factories"); + } + else + { + //configure all the instruments found + ConfigureInstruments(); + } + } + catch (CompositionException) + { + throw; + } + catch (Exception) + { + throw; + } + } - /// - /// InitializeInstruments - init all the instruments - /// - public void InitializeInstruments() - { - _logger.Info("Instrument initialization complete"); - } + /// + /// InitializeInstruments - init all the instruments + /// + public void InitializeInstruments() + { + _logger.Info("Instrument initialization complete"); + } /// /// InitializeInstrument - inits a specific instrument @@ -263,330 +262,330 @@ namespace Raytheon.Instruments /// implementation for IPartImportsSatisfiedNotification interface /// public void OnImportsSatisfied() - { - if (LogFactory != null && LogFactory != null) - { - FusionLogManager.Current = LogFactory; - } - } + { + if (LogFactory != null && LogFactory != null) + { + FusionLogManager.Current = LogFactory; + } + } - /// - /// Gets the generic instrument. - /// - /// The name. - /// - public IInstrument GetGenericInstrument(string name) - { - _logger.Trace("In ConsumerInstrumentManager in method GetGenericInstrument with name: {0} ", name); - return GetInstrument(name); - } + /// + /// Gets the generic instrument. + /// + /// The name. + /// + public IInstrument GetGenericInstrument(string name) + { + _logger.Debug("In ConsumerInstrumentManager in method GetGenericInstrument with name: {0} ", name); + return GetInstrument(name); + } - /// - /// gets a specific instrument by name - /// the name should match one of the names in Instruments.xml file - /// - /// - /// - /// - public T GetInstrument(string name) where T : class - { - _logger.Trace($"Starting GetInstrument with name: {name}"); + /// + /// gets a specific instrument by name + /// the name should match one of the names in Instruments.xml file + /// + /// + /// + /// + public T GetInstrument(string name) where T : class + { + _logger.Debug($"Starting GetInstrument with name: {name}"); - object inst = null; - if (_haveService) - { - try - { - string interfaceName = typeof(T).FullName; - if (typeof(IInstrument).FullName == interfaceName) - { - _logger.Trace($"GetInstrument with typeof(IInstrument).FullName == interfaceName: {interfaceName}"); + object inst = null; + if (_haveService) + { + try + { + string interfaceName = typeof(T).FullName; + if (typeof(IInstrument).FullName == interfaceName) + { + _logger.Debug($"GetInstrument with typeof(IInstrument).FullName == interfaceName: {interfaceName}"); - //get the real interface behind the scenes - //first find the appropriate factory - RpcInstrumentDescriptor correctDesc = _availableInstruments.FirstOrDefault((desc) => 0 == string.Compare(name, desc.InstrumentName, true)); - if (null != correctDesc) - { - _logger.Trace($"GetInstrument with correctDesc.name: {correctDesc.InstrumentName}"); + //get the real interface behind the scenes + //first find the appropriate factory + RpcInstrumentDescriptor correctDesc = _availableInstruments.FirstOrDefault((desc) => 0 == string.Compare(name, desc.InstrumentName, true)); + if (null != correctDesc) + { + _logger.Debug($"GetInstrument with correctDesc.name: {correctDesc.InstrumentName}"); - string temp = correctDesc.InstrumentInterfaces.FirstOrDefault(); - if (!string.IsNullOrWhiteSpace(temp)) - { - interfaceName = temp; - } - } + string temp = correctDesc.InstrumentInterfaces.FirstOrDefault(); + if (!string.IsNullOrWhiteSpace(temp)) + { + interfaceName = temp; + } + } - _logger.Debug("Requested generic instrument, found {0} to be the correct interface", interfaceName); - } + _logger.Debug("Requested generic instrument, found {0} to be the correct interface", interfaceName); + } - if (InstrumentIsAvailable(name) && FactoryIsAvailable(interfaceName)) - { - _logger.Trace($"GetInstrument with InstrumentIsAvailable(name) && FactoryIsAvailable(interfaceName) name: {name}, interfaceName: {interfaceName}"); + if (InstrumentIsAvailable(name) && FactoryIsAvailable(interfaceName)) + { + _logger.Debug($"GetInstrument with InstrumentIsAvailable(name) && FactoryIsAvailable(interfaceName) name: {name}, interfaceName: {interfaceName}"); - IInstrumentProxyFactory factory = _factoryMap.Where((t) => 0 == string.Compare(t.Key, interfaceName, true)) - .Select(t => t.Value) - .FirstOrDefault(); + IInstrumentProxyFactory factory = _factoryMap.Where((t) => 0 == string.Compare(t.Key, interfaceName, true)) + .Select(t => t.Value) + .FirstOrDefault(); - if (null != factory) - { - inst = factory.GetInstrument(name); - _logger.Trace($"GetInstrument got an instrument (name: {name}) from factory: {factory}, interfaceName: {interfaceName}"); - } - else - { - _logger.Warn($"Could not find factory for interface: {interfaceName}, instrument: {name}"); - } - } - } - catch (InstrumentException ex) - { - _logger.WarnException(ex, ex.Message); - } - } - else - { - _instruments.TryGetValue(name.ToLower(), out inst); - } + if (null != factory) + { + inst = factory.GetInstrument(name); + _logger.Debug($"GetInstrument got an instrument (name: {name}) from factory: {factory}, interfaceName: {interfaceName}"); + } + else + { + _logger.Warn($"Could not find factory for interface: {interfaceName}, instrument: {name}"); + } + } + } + catch (InstrumentException ex) + { + _logger.WarnException(ex, ex.Message); + } + } + else + { + _instruments.TryGetValue(name.ToLower(), out inst); + } - _logger.Trace($"GetInstrument returning with inst: {inst}"); + _logger.Debug($"GetInstrument returning with inst: {inst}"); - return inst as T; - } + return inst as T; + } - /// - /// returns a collection of instrument names - /// - /// - public ICollection GetInstrumentNames() - { - _logger.Trace("Returning instrument list"); + /// + /// returns a collection of instrument names + /// + /// + public ICollection GetInstrumentNames() + { + _logger.Debug("Returning instrument list"); - if (_haveService) - { - return _instrumentManager.Contract.GetInstrumentNames(); - } - else - { - return new ReadOnlyCollection(_instruments.Keys.ToList()); - } - } + if (_haveService) + { + return _instrumentManager.Contract.GetInstrumentNames(); + } + else + { + return new ReadOnlyCollection(_instruments.Keys.ToList()); + } + } - public string[] GetInstrumentNamesArray() - { - _logger.Debug("Getting Instrument Names Array"); - return GetInstrumentNames().ToArray(); - } + public string[] GetInstrumentNamesArray() + { + _logger.Debug("Getting Instrument Names Array"); + return GetInstrumentNames().ToArray(); + } - /// - /// Gets instruments collection - /// - /// - public ICollection GetInstruments() - { - _logger.Debug("GetInstruments with null"); - return GetInstruments(null); - } + /// + /// Gets instruments collection + /// + /// + public ICollection GetInstruments() + { + _logger.Debug("GetInstruments with null"); + return GetInstruments(null); + } - /// - /// Gets instruments collection by type - /// - /// - /// - public ICollection GetInstruments(Type type) - { - _logger.Debug($"Entering GetInstruments with type {type}"); + /// + /// Gets instruments collection by type + /// + /// + /// + public ICollection GetInstruments(Type type) + { + _logger.Debug($"Entering GetInstruments with type {type}"); - var instruments = new List(); + var instruments = new List(); - if (_haveService) - { - if (null == _rpcInstrumentManagerHost) - { - _logger.Warn(NO_SERVER); - } - else - { - //gather all the instruments of the requested type - if (null == type) - { - type = typeof(IInstrument); - } + if (_haveService) + { + if (null == _rpcInstrumentManagerHost) + { + _logger.Warn(NO_SERVER); + } + else + { + //gather all the instruments of the requested type + if (null == type) + { + type = typeof(IInstrument); + } - _logger.Debug("GetInstruments geting collection"); + _logger.Debug("GetInstruments geting collection"); - var collection = from avail in _availableInstruments - where avail.InstrumentInterfaces.Contains(type.FullName) - select avail; + var collection = from avail in _availableInstruments + where avail.InstrumentInterfaces.Contains(type.FullName) + select avail; - _logger.Debug("GetInstruments got collection count = " + collection.Count()); + _logger.Debug("GetInstruments got collection count = " + collection.Count()); - MethodInfo method = typeof(GeneralInstrumentManager).GetMethod("GetInstrument"); - MethodInfo generic = method.MakeGenericMethod(type); + MethodInfo method = typeof(GeneralInstrumentManager).GetMethod("GetInstrument"); + MethodInfo generic = method.MakeGenericMethod(type); - foreach (var item in collection) - { - object[] objs = { item.InstrumentName }; - IInstrument created = generic.Invoke(this, objs) as IInstrument; - instruments.Add(created); - } - } - } - else - { - if(type == null) - { - instruments.AddRange(_instruments.Values); - } - else - { - foreach (var inst in _instruments.Values) - { - if (type.IsAssignableFrom(inst.GetType())) - { - instruments.Add(inst); - } - } - } - } + foreach (var item in collection) + { + object[] objs = { item.InstrumentName }; + IInstrument created = generic.Invoke(this, objs) as IInstrument; + instruments.Add(created); + } + } + } + else + { + if (type == null) + { + instruments.AddRange(_instruments.Values); + } + else + { + foreach (var inst in _instruments.Values) + { + if (type.IsAssignableFrom(inst.GetType())) + { + instruments.Add(inst); + } + } + } + } - return new ReadOnlyCollection(instruments); - } + return new ReadOnlyCollection(instruments); + } - /// - /// returns instrument array of specific type - /// - /// - /// - /// - public object[] GetInstrumentsArray(Type type) - { - if (null == type) - { - throw new ArgumentNullException("type", "GetInstrumentsArray, cannot get null instrument types"); - } + /// + /// returns instrument array of specific type + /// + /// + /// + /// + public object[] GetInstrumentsArray(Type type) + { + if (null == type) + { + throw new ArgumentNullException("type", "GetInstrumentsArray, cannot get null instrument types"); + } - _logger.Debug($"GetInstrumentsArray with type {type}"); + _logger.Debug($"GetInstrumentsArray with type {type}"); - return GetInstruments(type).ToArray(); - } + return GetInstruments(type).ToArray(); + } - /// - /// returns instrument array - /// - /// - public object[] GetInstrumentsArray() - { - _logger.Debug("Get Instruments Array"); - return GetInstruments().ToArray(); - } + /// + /// returns instrument array + /// + /// + public object[] GetInstrumentsArray() + { + _logger.Debug("Get Instruments Array"); + return GetInstruments().ToArray(); + } - /// - /// Shuts down this instance. - /// Close out the RPC host connection. Does not close / shutdown RINSS or any - /// - public void Shutdown() - { - _logger.Info("Shutting down instruments"); + /// + /// Shuts down this instance. + /// Close out the RPC host connection. Does not close / shutdown RINSS or any + /// + public void Shutdown() + { + _logger.Debug("Shutting down instruments"); - if (_haveService) - { - _rpcInstrumentManagerHost.Close(); - } - else - { - ShutdownInstruments(); - } - _logger.Info("Instrument shut down complete"); - } + if (_haveService) + { + _rpcInstrumentManagerHost.Close(); + } + else + { + ShutdownInstruments(); + } + _logger.Debug("Instrument shut down complete"); + } - /// - /// Shuts down the instruments. - /// - public void ShutdownInstruments() - { - } + /// + /// Shuts down the instruments. + /// + public void ShutdownInstruments() + { + } - /// - /// Shutdowns the instrument. - /// - /// Name of the inst. - public void ShutdownInstrument(string instName) - { - } + /// + /// Shutdowns the instrument. + /// + /// Name of the inst. + public void ShutdownInstrument(string instName) + { + } - #region Private Functions - - /// - /// for the Auto mode will check if RINSS available - /// - /// - /// - private bool CheckServiceRunningStatus(string serviceName) - { - if(!DoesServiceExist(serviceName)) - return false; + #region Private Functions - ServiceController sc = new ServiceController(serviceName); - return sc.Status == ServiceControllerStatus.Running; - } - private static bool DoesServiceExist(string serviceName) - { - return ServiceController.GetServices().Any(serviceController => serviceController.ServiceName.Equals(serviceName)); - } + /// + /// for the Auto mode will check if RINSS available + /// + /// + /// + private bool CheckServiceRunningStatus(string serviceName) + { + if (!DoesServiceExist(serviceName)) + return false; - /// - /// Load parts with RINSS running or without RINSS - /// - private void LoadParts() - { - _logger.Debug($"Loading Parts from path {_partsLocation}"); + ServiceController sc = new ServiceController(serviceName); + return sc.Status == ServiceControllerStatus.Running; + } + private static bool DoesServiceExist(string serviceName) + { + return ServiceController.GetServices().Any(serviceController => serviceController.ServiceName.Equals(serviceName)); + } - //install we are assuming will put the needed parts into a directory ./Parts just off the - //directory where the assembly is - MefHelper helper = new MefHelper(false, false); - try - { - helper.AddCatalog(_partsLocation, true); - helper.Container.ComposeParts(this); + /// + /// Load parts with RINSS running or without RINSS + /// + private void LoadParts() + { + _logger.Debug($"Loading Parts from path {_partsLocation}"); - if(_haveService) - { - if (null == ConfigManager || null == UmsClientFactory || null == UmsFactory) - { - throw new CompositionException($"General Instrument Manager has null MEF components, please check MEF plugin location: {_partsLocation}"); - } - } - else - { - if (null == ConfigManager || null == InstrumentFactories) - { - throw new CompositionException($"Error during MEF composition, check MEF Part Location: {_partsLocation}"); - } - } + //install we are assuming will put the needed parts into a directory ./Parts just off the + //directory where the assembly is + MefHelper helper = new MefHelper(false, false); + try + { + helper.AddCatalog(_partsLocation, true); + helper.Container.ComposeParts(this); - _partsLoaded = true; - if(!string.IsNullOrEmpty(_configLocation)) - ConfigManager.ConfigurationStoragePath = _configLocation; - } - catch (CompositionException ex) - { - _logger.ErrorException(ex, ex.Message); - } - } + if (_haveService) + { + if (null == ConfigManager || null == UmsClientFactory || null == UmsFactory) + { + throw new CompositionException($"General Instrument Manager has null MEF components, please check MEF plugin location: {_partsLocation}"); + } + } + else + { + if (null == ConfigManager || null == InstrumentFactories) + { + throw new CompositionException($"Error during MEF composition, check MEF Part Location: {_partsLocation}"); + } + } - /// - /// will set up path where either proxy instruments are (in case when RINSS running) - /// or where the actual instruments are (in case RINSS not running) - /// - /// - /// - /// - /// - private void SetupPath() - { + _partsLoaded = true; + if (!string.IsNullOrEmpty(_configLocation)) + ConfigManager.ConfigurationStoragePath = _configLocation; + } + catch (CompositionException ex) + { + _logger.ErrorException(ex, ex.Message); + } + } + + /// + /// will set up path where either proxy instruments are (in case when RINSS running) + /// or where the actual instruments are (in case RINSS not running) + /// + /// + /// + /// + /// + private void SetupPath() + { _logger.Trace("Setting up Instrument Manager parts location"); - if (string.IsNullOrEmpty(_partsLocation)) - { + if (string.IsNullOrEmpty(_partsLocation)) + { string pf86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); string pf = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); @@ -595,281 +594,281 @@ namespace Raytheon.Instruments //to the directory installed to, the PartsLocation property still allows for custom directories //to be used for the Consumer Instrument Manager string defaultPath = _haveService ? $"{pf86}\\Raytheon\\RINSS-ConsumerIM\\Parts" : $"{pf86}\\Raytheon\\RINSS\\Parts\\CommonModuleInstruments"; - if (Environment.OSVersion.Version.Major < 6) - { - //if we are windows xp, then we need to look in a different default directory - defaultPath = _haveService ? $"{pf}\\Raytheon\\RINSS-ConsumerIM\\Parts" : $"{pf}\\Raytheon\\RINSS\\Parts\\CommonModuleInstruments"; - } + if (Environment.OSVersion.Version.Major < 6) + { + //if we are windows xp, then we need to look in a different default directory + defaultPath = _haveService ? $"{pf}\\Raytheon\\RINSS-ConsumerIM\\Parts" : $"{pf}\\Raytheon\\RINSS\\Parts\\CommonModuleInstruments"; + } - var keyName = RegistryKey; - var valueName = _haveService ? RegistryValue : RegistryValueNoRINSS; + var keyName = RegistryKey; + var valueName = _haveService ? RegistryValue : RegistryValueNoRINSS; - string path = (string)Registry.GetValue(keyName, valueName, defaultPath); + string path = (string)Registry.GetValue(keyName, valueName, defaultPath); - if (string.IsNullOrWhiteSpace(path) || !Directory.Exists(path)) - { - path = defaultPath; - } + if (string.IsNullOrWhiteSpace(path) || !Directory.Exists(path)) + { + path = defaultPath; + } - _partsLocation = path; - } - _logger.Trace($"Mef parts load Location is: {_partsLocation}"); - } + _partsLocation = path; + } + _logger.Trace($"Mef parts load Location is: {_partsLocation}"); + } - /// - /// creates Umc client used in remote procedure calls - /// - /// - private void CreateUmsClient() - { - _logger.Trace("Loading Proxy Instrument Configuration Settings"); + /// + /// creates Umc client used in remote procedure calls + /// + /// + private void CreateUmsClient() + { + _logger.Trace("Loading Proxy Instrument Configuration Settings"); - string configName = "ProxyInstruments"; - IConfiguration config = ConfigManager.GetConfiguration(configName); + string configName = "ProxyInstruments"; + IConfiguration config = ConfigManager.GetConfiguration(configName); - if (null == config) - { - string errorMessage = string.Format(@"Could not get configuration file, check configuration location for file: {0}", configName); - _logger.Error(errorMessage); - throw new ArgumentNullException(errorMessage); - } + if (null == config) + { + string errorMessage = string.Format(@"Could not get configuration file, check configuration location for file: {0}", configName); + _logger.Error(errorMessage); + throw new ArgumentNullException(errorMessage); + } - string rpcName = config.GetConfigurationValue(SECTION, "Name", string.Empty); + string rpcName = config.GetConfigurationValue(SECTION, "Name", string.Empty); - //if the configuration element does not exist, then create the defaults - if (string.IsNullOrWhiteSpace(rpcName)) - { - _logger.Info("No Rpc Client Instrument Manager configuration found, creating default"); - config.SetConfigurationValue(SECTION, "Name", DefaultName); - config.SetConfigurationValue(SECTION, "IPAddress", DefaultIP); - config.SetConfigurationValue(SECTION, "Port", DefaultPort); - config.SetConfigurationValue(SECTION, "MediaType", DefaultMedia); - config.SetConfigurationValue(SECTION, "SerializerType", DefaultSerializer); - } + //if the configuration element does not exist, then create the defaults + if (string.IsNullOrWhiteSpace(rpcName)) + { + _logger.Info("No Rpc Client Instrument Manager configuration found, creating default"); + config.SetConfigurationValue(SECTION, "Name", DefaultName); + config.SetConfigurationValue(SECTION, "IPAddress", DefaultIP); + config.SetConfigurationValue(SECTION, "Port", DefaultPort); + config.SetConfigurationValue(SECTION, "MediaType", DefaultMedia); + config.SetConfigurationValue(SECTION, "SerializerType", DefaultSerializer); + } - _logger.Trace("Consumer Instrument Manager is creating Ums Client"); + _logger.Trace("Consumer Instrument Manager is creating Ums Client"); - if (null == UmsClientFactory || null == UmsFactory) - { - var ex = new ArgumentNullException(string.Format("Ums components are null, please check MEF plugin location: {0}", _partsLocation)); - _logger.ErrorException(ex, ex.Message); - throw ex; - } + if (null == UmsClientFactory || null == UmsFactory) + { + var ex = new ArgumentNullException(string.Format("Ums components are null, please check MEF plugin location: {0}", _partsLocation)); + _logger.ErrorException(ex, ex.Message); + throw ex; + } - string name = config.GetConfigurationValue(SECTION, "Name", DefaultName); - string ipAddress = config.GetConfigurationValue(SECTION, "IPAddress", DefaultIP); - string hostPort = config.GetConfigurationValue(SECTION, "Port", DefaultPort); - string mediaType = config.GetConfigurationValue(SECTION, "MediaType", DefaultMedia); - string serializerType = config.GetConfigurationValue(SECTION, "SerializerType", DefaultSerializer); + string name = config.GetConfigurationValue(SECTION, "Name", DefaultName); + string ipAddress = config.GetConfigurationValue(SECTION, "IPAddress", DefaultIP); + string hostPort = config.GetConfigurationValue(SECTION, "Port", DefaultPort); + string mediaType = config.GetConfigurationValue(SECTION, "MediaType", DefaultMedia); + string serializerType = config.GetConfigurationValue(SECTION, "SerializerType", DefaultSerializer); - //we already checked for null above! - _umsHost = UmsFactory.GetInstance(name, ipAddress, hostPort, UmsInstanceType.Client, mediaType, serializerType); + //we already checked for null above! + _umsHost = UmsFactory.GetInstance(name, ipAddress, hostPort, UmsInstanceType.Client, mediaType, serializerType); - //open a client for the instrument manager - _instrumentManager = UmsClientFactory.GetClient(_umsHost); - _instrumentManager.Open(); + //open a client for the instrument manager + _instrumentManager = UmsClientFactory.GetClient(_umsHost); + _instrumentManager.Open(); - //open a client for the host server - _rpcInstrumentManagerHost = UmsClientFactory.GetClient(_umsHost); - _rpcInstrumentManagerHost.Open(); - } + //open a client for the host server + _rpcInstrumentManagerHost = UmsClientFactory.GetClient(_umsHost); + _rpcInstrumentManagerHost.Open(); + } - /// - /// will initialize factories for instuments managed under RINSS - /// - private void InitializeFactories() - { - _logger.Debug($"InitializeFactories ProxyFactories count = {ProxyFactories.Count()}"); + /// + /// will initialize factories for instuments managed under RINSS + /// + private void InitializeFactories() + { + _logger.Debug($"InitializeFactories ProxyFactories count = {ProxyFactories.Count()}"); - foreach (var fact in ProxyFactories) - { - _logger.Debug("InitializeFactories fact=" + fact.Value); - //initialize each factory so it can create the clients - fact.Value.Initialize(_umsHost, UmsClientFactory); + foreach (var fact in ProxyFactories) + { + _logger.Debug("InitializeFactories fact=" + fact.Value); + //initialize each factory so it can create the clients + fact.Value.Initialize(_umsHost, UmsClientFactory); - //map out the factories with their interface names - var availableInterfaces = fact.Value.GetSupportedInterfaces(); - _logger.Debug($"InitializeFactories availableInterfaces count = {availableInterfaces.Count}"); + //map out the factories with their interface names + var availableInterfaces = fact.Value.GetSupportedInterfaces(); + _logger.Debug($"InitializeFactories availableInterfaces count = {availableInterfaces.Count}"); - foreach (var face in availableInterfaces) - { - _logger.Debug($"InitializeFactories Interface = {face}"); - _factoryMap.Add(face.ToLower(), fact.Value); - } - } - } + foreach (var face in availableInterfaces) + { + _logger.Debug($"InitializeFactories Interface = {face}"); + _factoryMap.Add(face.ToLower(), fact.Value); + } + } + } - /// - /// will configure instruments when not managed by Service - /// - /// - private void ConfigureInstruments() - { - _logger.Info("Configuring Instruments"); - IConfiguration config = ConfigManager.GetConfiguration("Instruments"); + /// + /// will configure instruments when not managed by Service + /// + /// + private void ConfigureInstruments() + { + _logger.Info("Configuring Instruments"); + IConfiguration config = ConfigManager.GetConfiguration("Instruments"); - if (null == config) - { - throw new ConfigurationException("could not find configuration file"); - } + if (null == config) + { + throw new ConfigurationException("could not find configuration file"); + } - string rawConfig = config.GetXmlConfiguration("Instruments"); - if (string.IsNullOrWhiteSpace(rawConfig)) - { - _logger.Warn("No RPC configuration found, creating default 'Instruments'"); - config.SetXmlConfiguration("Instruments", new XElement("Instrument", - new XElement("Name", "Sample"), - new XElement("Factory", "Sample")).ToString()); - rawConfig = config.GetXmlConfiguration("Instruments"); - } + string rawConfig = config.GetXmlConfiguration("Instruments"); + if (string.IsNullOrWhiteSpace(rawConfig)) + { + _logger.Warn("No RPC configuration found, creating default 'Instruments'"); + config.SetXmlConfiguration("Instruments", new XElement("Instrument", + new XElement("Name", "Sample"), + new XElement("Factory", "Sample")).ToString()); + rawConfig = config.GetXmlConfiguration("Instruments"); + } - _instrumentTypes.Add(typeof(IInstrument)); - if (0 == InstrumentFactories.Count()) - { - _logger.Warn($"There are no instrument factories registered using the following path: {Path.GetFullPath(_partsLocation)}"); - } + _instrumentTypes.Add(typeof(IInstrument)); + if (0 == InstrumentFactories.Count()) + { + _logger.Warn($"There are no instrument factories registered using the following path: {Path.GetFullPath(_partsLocation)}"); + } - XElement xmlConfig = XElement.Parse(rawConfig); - if (null == xmlConfig) - { - throw new ConfigurationException("could not parse configuration file"); - } + XElement xmlConfig = XElement.Parse(rawConfig); + if (null == xmlConfig) + { + throw new ConfigurationException("could not parse configuration file"); + } - var decendants = xmlConfig.Descendants("Instrument"); - if (null != decendants) - { - foreach (var instrument in decendants) - { - var instName = instrument.Element("Name").Value; - var instFactory = instrument.Element("Factory").Value; - _logger.Trace($"In ConfigureInstruments before factory call with XML name: {instName} and XML factory: {instFactory}"); - var factory = (from f in InstrumentFactories - where !string.IsNullOrWhiteSpace(f.Metadata.ModelNumber) && f.Metadata.ModelNumber.Equals(instFactory, StringComparison.OrdinalIgnoreCase) - select f).FirstOrDefault(); + var decendants = xmlConfig.Descendants("Instrument"); + if (null != decendants) + { + foreach (var instrument in decendants) + { + var instName = instrument.Element("Name").Value; + var instFactory = instrument.Element("Factory").Value; + _logger.Trace($"In ConfigureInstruments before factory call with XML name: {instName} and XML factory: {instFactory}"); + var factory = (from f in InstrumentFactories + where !string.IsNullOrWhiteSpace(f.Metadata.ModelNumber) && f.Metadata.ModelNumber.Equals(instFactory, StringComparison.OrdinalIgnoreCase) + select f).FirstOrDefault(); - if (factory != null) - { - object inst = null; - try - { - // instantiate the applicable instrument + if (factory != null) + { + object inst = null; + try + { + // instantiate the applicable instrument inst = factory.Value.GetInstrument(instName, !_isThereHardware); _logger.Info($"Creating instrument '{instName}'"); } - catch (Exception) - { - throw; - } + catch (Exception) + { + throw; + } - if (null == inst) - { - _logger.Warn($"Could not create the instrument: {instName}"); - } - else - { - var supported = factory.Value.GetSupportedInterfaces(); - if (null != supported) - { - //add the instrument - string txt = $"Adding instrument: Name - {instName}, Type - {inst.GetType()}"; - _instruments.Add(instName.ToLower(), inst); - foreach (var supportedInterface in supported) - { - _instrumentTypes.Add(supportedInterface); - _logger.Info($"{txt}, Interface - {supportedInterface}"); - } - } - else - { - _logger.Warn($"Did not see any supported interfaces for: {instName}"); - } - } - } - else - { - if (InstrumentFactories.Count() > 0) - { - var factories = new StringBuilder(); - factories.Append("Available Factory types loaded: "); - foreach (var kvp in InstrumentFactories) - { - factories.AppendLine(); - factories.AppendFormat(" {0}", kvp.Metadata.ModelNumber); - } - _logger.Info(factories.ToString()); - } + if (null == inst) + { + _logger.Warn($"Could not create the instrument: {instName}"); + } + else + { + var supported = factory.Value.GetSupportedInterfaces(); + if (null != supported) + { + //add the instrument + string txt = $"Adding instrument: Name - {instName}, Type - {inst.GetType()}"; + _instruments.Add(instName.ToLower(), inst); + foreach (var supportedInterface in supported) + { + _instrumentTypes.Add(supportedInterface); + _logger.Info($"{txt}, Interface - {supportedInterface}"); + } + } + else + { + _logger.Warn($"Did not see any supported interfaces for: {instName}"); + } + } + } + else + { + if (InstrumentFactories.Count() > 0) + { + var factories = new StringBuilder(); + factories.Append("Available Factory types loaded: "); + foreach (var kvp in InstrumentFactories) + { + factories.AppendLine(); + factories.AppendFormat(" {0}", kvp.Metadata.ModelNumber); + } + _logger.Info(factories.ToString()); + } throw new Exception($"{instName} did not have a matching factory with supported type {instFactory}"); } - } - } - else - { - _logger.Warn("could not find instrument section of configuration"); - } - } - - /// - /// checks if instrument is available - /// - /// - /// - private bool InstrumentIsAvailable(string name) - { - //check if our host has a instrument by this name available to us - if (!_availableInstruments.Any(t => 0 == string.Compare(t.InstrumentName, name, true))) - { - _logger.Warn($"{name} instrument not available"); - return false; - } - return true; - } + } + } + else + { + _logger.Warn("could not find instrument section of configuration"); + } + } - /// - /// checks if instrument factory is available - /// - /// - /// - private bool FactoryIsAvailable(string interfaceName) - { - bool bReturn = false; + /// + /// checks if instrument is available + /// + /// + /// + private bool InstrumentIsAvailable(string name) + { + //check if our host has a instrument by this name available to us + if (!_availableInstruments.Any(t => 0 == string.Compare(t.InstrumentName, name, true))) + { + _logger.Warn($"{name} instrument not available"); + return false; + } + return true; + } - if (typeof(IInstrument).FullName == interfaceName) - { - _logger.Debug($"In GeneralInstrumentManager in method FactoryIsAvailable with typeof(IInstrument).FullName == interfaceName : {interfaceName}"); - bReturn = true; - } - else - { - //check if we have a factory that supports this interface - var sb = new StringBuilder(); - foreach (KeyValuePair x in _factoryMap) - { - sb.Append("FactoryMap IInstrumentProxyFactory: key = "); - sb.Append(x.Key); - sb.Append(" value = "); - sb.Append(x.Value); - sb.Append(" supportedInterfaces = "); - sb.Append(x.Value.GetSupportedInterfaces()); - sb.Append(Environment.NewLine); - } + /// + /// checks if instrument factory is available + /// + /// + /// + private bool FactoryIsAvailable(string interfaceName) + { + bool bReturn = false; - _logger.Debug(sb.ToString()); + if (typeof(IInstrument).FullName == interfaceName) + { + _logger.Debug($"In GeneralInstrumentManager in method FactoryIsAvailable with typeof(IInstrument).FullName == interfaceName : {interfaceName}"); + bReturn = true; + } + else + { + //check if we have a factory that supports this interface + var sb = new StringBuilder(); + foreach (KeyValuePair x in _factoryMap) + { + sb.Append("FactoryMap IInstrumentProxyFactory: key = "); + sb.Append(x.Key); + sb.Append(" value = "); + sb.Append(x.Value); + sb.Append(" supportedInterfaces = "); + sb.Append(x.Value.GetSupportedInterfaces()); + sb.Append(Environment.NewLine); + } - var kvp = _factoryMap.Where((t) => 0 == string.Compare(t.Key, interfaceName, true)) - .Select(t => new { t.Key, t.Value }) - .FirstOrDefault(); + _logger.Debug(sb.ToString()); - if (null == kvp) - { - _logger.Warn($"{interfaceName} interface proxy factory not found"); - } - bReturn = kvp != null; - } - return bReturn; - } + var kvp = _factoryMap.Where((t) => 0 == string.Compare(t.Key, interfaceName, true)) + .Select(t => new { t.Key, t.Value }) + .FirstOrDefault(); - #endregion + if (null == kvp) + { + _logger.Warn($"{interfaceName} interface proxy factory not found"); + } + bReturn = kvp != null; + } + return bReturn; + } - } + #endregion + + } } diff --git a/Source/TestStand/MTS_COI_Environment.zip b/Source/TestStand/MTS_COI_Environment.zip new file mode 100644 index 0000000..2ddb6f3 Binary files /dev/null and b/Source/TestStand/MTS_COI_Environment.zip differ diff --git a/Source/TestStand/Sequences/MTS/Set01/MSFR.seq b/Source/TestStand/Sequences/MTS/Set01/MSFR.seq new file mode 100644 index 0000000..4287eed --- /dev/null +++ b/Source/TestStand/Sequences/MTS/Set01/MSFR.seq @@ -0,0 +1,31209 @@ + + + + + + + + + + + + + false + + + false + + + "" + + + "" + + + "" + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + 8192 + %#x + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "GENERIC_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "GENERIC_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + GenericSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='Expression' xsi:type='Expression' name='' classname='ExprValue' structureflags='131072'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='FCParameter' xsi:type='FCParameter' name='' classname='FCParameter' structureflags='131072'> + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "EDIT_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "EDIT_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + EditSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + false + + + false + + + + + + + + + + + + Step.Description + (Step.ConditionExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : LocalizeExpression(Step.ConditionExpr)) + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:ApOk00JkFUy4JOZwLQ+X6B + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditWhileStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_While.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_WhileTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + ResStr("NI_STEPTYPES", "ACTION_DESCRIPTION_NAME") + (("%ModuleDescription" == "") ? "" : ", %ModuleDescription") + + + ResStr("NI_STEPTYPES", "ACTION_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "ACTION_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + Action + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + DefaultLabVIEW|DefaultLabVIEWNXG|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetParameter' xsi:type='DotNetParameter' name='' classname='DotNetParameter' structureflags='131072'> + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetCall' xsi:type='DotNetCall' name='' classname='DotNetCall' structureflags='131072'> + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "POST_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "POST_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + ExecSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + DisplayTimerMsgImgPopup + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + buttonArraySize + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 6 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + EditMessageBoxStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 1 + + + + + + + + + 2 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + engine + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.Engine + + + RunState.Engine + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 0 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "EDIT_STEP_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TitleExpr) + + + ResStr("MSG_BOX_STEP_TYPE", "DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("MSG_BOX_STEP_TYPE", "MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "TITLE") + + + Evaluate(Step.TitleExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "MESSAGE") + + + Evaluate(Step.MessageExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + MsgBox.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupOptionsTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupLayoutTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + NameOf(Step) + + + "Your message here" + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_MsgBoxFontData' xsi:type='NI_MsgBoxFontData' name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + false + + + false + + + + + + + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + FlowControl\NI_End.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + NI_Flow_If, NI_Flow_Else, NI_Flow_ElseIf, NI_Flow_For, NI_Flow_While, NI_Flow_DoWhile, NI_Flow_Case, NI_Flow_Select, NI_ Flow_AutoSchedule, NI_Flow_LockResource, NI_Flow_Begin + + + + + + true + + + false + + + false + + + + + + + + + true + + + + + + + + + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + ModelPlugin.Base.Enabled is the preferred property, ReportOptions.DisableReportGeneration is a legacy (pre TS 2012) property. + + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + horizontal.xsl + report.xsl + expand.xsl + + + + + TR_horizontal.xsl + trml.xsl + + + + true + + + + false + + + false + + + false + + + true + + + false + This flag is used by style sheets to decide when to localize decimal points. + + + + Used to decide to generate a default XML report or an "ATML" report. The valid values are empty string and "ATML" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Sequential Model + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for ParallelModel + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Batch Model + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the batch report file path expression for Batch Model + + + false + + + + + + + + + true + + + + tr5_horizontal.xsl + tr5_report.xsl + tr5_expand.xsl + + + + + + true + + + + + + + + + + + + tr6_horizontal.xsl + tr6_report.xsl + tr6_expand.xsl + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + 0 + + + + 0 + + + 0 + + + Used by model plugins that spawn new threads and need to perform controller and socket synchronization in their Batch Done and UUT Done entry points + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginPerSocketRuntimeVariables' xsi:type='NI_ModelPluginPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the model plug-in>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + If the plugin does not require batch controller and socket synchronization, setting this property to False may provide improved performance when executing the Batch Model. + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + false + + + + + This property stores the report file path for the batch report. + + + + + This property stores the report file path for the UUT reports when and if they are all stored in the same file. If they are stored in separate files then the Path property of the NI_ReportGeneratorPerSocketRuntimeVariables type is used instead. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + + + + + UUT Status path map that is local to one batch execution. This is cleared once the batch execution is done. + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ReportGeneratorPerSocketRuntimeVariables' xsi:type='NI_ReportGeneratorPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + <_NAME_IN_ATTRIBUTE_ name='' classname='Objs'> + + + + + + NextUUT + + + 1 + + + + + + + + + Prompt + + + 0 + + + + + + + + + Terminate + + + 2 + + + + + + + + Prompt + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginConfigurationPerSocketRuntimeVariables' xsi:type='NI_ModelPluginConfigurationPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPlugin' xsi:type='NI_ModelPlugin' name='' classname='Obj'> + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + CommonSubsteps.dll + + + EditStatementStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 2 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 2 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EDIT_STEP_MENU_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TS.PostExpr) + + + ResStr("NI_SUBSTEPS", "STATEMENT_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_SUBSTEPS", "STATEMENT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EXPRESSION") + + + LocalizeExpression(Step.PostExpression) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + Statement.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.StatementTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CriticalFailureStackEntry' xsi:type='NI_CriticalFailureStackEntry' name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + This data type exists for symmetry with the batch and parallel models. Currently it has no fields. + + + + + + Valid values for NI models are "Sequential", "Batch", or "Parallel" + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "SC_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "SC_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + SeqAdp.ico + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + true + + + + + + 0 + + + 0 + + + 4 + %#x + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + Step.ArrayExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : +(Step.Description !="" ? Step.Description : +((Step.ArrayElementExpr != "" ? LocalizeExpression(Step.ArrayElementExpr) : ResStr("FLOW_CONTROL_STEPS", "ARRAYELEMENT")) + ResStr("FLOW_CONTROL_STEPS", "IN") + LocalizeExpression(Step.ArrayExpr))) + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:0fUZg4IOtkenNvECPWGh4A + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditForEachStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_ForEach.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_ForEachTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + 0 + + + + + + + false + + + + +
+ + + + + + + + + + + + CoeDeviceNodeTCP + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:7NKuZlN58BG4s4wdltwhQC + + + FlowControl\NI_While.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + ID#:Ukaj15958BG4tIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_Refresh.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + ResetDisplayForStepsInLoop + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:5zoT66kq8BG4QIwdltwhQC + + + ni_cpuAffinity.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + SelectMsfrTestCase + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + endStepComment + + + "EndMsfrWhileLoop" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:g6AGLcpl8BG4kIwdltwhQC + + + NI_OfflineProcessingUtility\profile_active.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOn + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:h5JXDW+D8BG4w4wdltwhQC + + + ni_hourglass.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + DisplayWaitMessage + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + message + + + "Waiting for missile software to boot..." + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + delaySec + + + 7 + + + + + + 12 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:dlzV4qNb8BG4gIwdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutTestPortConnect + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:EX1IG6Rb8BG4gIwdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + SendTestMessageToUut + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + messageName + + + "TestModeMsg" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + configSectionName + + + "DATA_1" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:sNPYhcRc8BG4gowdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + SendTestMessageToUut + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + messageName + + + "MSFRParameterMsg" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + configSectionName + + + "DATA_!" + + + + + + 1 + + + + + + 64 + + + true + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:DeHoMMVc8BG4gowdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutTestPortDisconnect + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:AOeX8ihh8BG4hYwdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + SendCoeAdnucMsgToUut + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + coeDeviceName + + + Locals.CoeDeviceName + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + continueOnError + + + True + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:0WPvVylh8BG4hYwdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + SendCoeUncageMsgToUut + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + coeDeviceName + + + Locals.CoeDeviceName + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + continueOnError + + + True + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:Jsfucylh8BG4hYwdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + SendCoeBatteryGoodMsgToUut + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + coeDeviceName + + + Locals.CoeDeviceName + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + continueOnError + + + True + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:2Tkd2Slh8BG4hYwdltwhQC + + + MsgBox.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + "Message" + + + "Click OK to power off." + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + ID#:9nYXGKoq8BG4QIwdltwhQC + + + NI_OfflineProcessingUtility\profile_errors.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOff + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + EndMsfrWhileLoop + + + + + ID#:7tKuZlN58BG4s4wdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + +
+ + + + + + + + + ID#:y5IUvu+P7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + InitializeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + partNumber + + + "pn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + serialNumber + + + "sn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testType + + + "en" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testName + + + "power on" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + isThereHardware + + + True + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + configSubFolderName + + + "MTS" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testStandSeqContext + + + ThisContext + + + + + + 17 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:H9ImZvCP7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializePowerSupplyMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:CmDjm3kk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSwitchMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:bzjJScNc8BG4gowdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeCoeMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:EMVz/Hkk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeGuiManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:f7RVD3ok8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSupportThreads + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + ID#:9dKwOXok8BG4OIwdltwhQC + + + PropertyLoader\box_checked.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + FinalizeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + openTestDataFolder + + + False + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + true + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + The report generator result processing component calls this from its Begin sequence. Override it to modify the options. + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + false + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:itrC2MUt8BG4RYwdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Parameters.ReportOptions.GeneratePDFReport = True + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + This callback is called after ReportPath is calculated from Post UUT and Post Batch sequences. + + + + + false + + + + + + false + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:t/Wzj3Uv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.SourceTestReportFilePath = Parameters.ReportFilePath + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a pass, fail, error, or terminated banner. Override this in client file to change or replace this action. + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + Call the current model for the default functionality. We don't include the model specific steps in this sequence so the overridden callback works under all models after the user overrides it, copying its steps to their client file. + + + + + ID#:MaVP2nUv8BG4RowdltwhQC + + + SeqAdp.ico + + + + + + + + Runstate.Execution.ModelSequenceFilePath + + + DoPreUUT + + + "DoPostUUT" + + + + + + + false + + + Parameters.Result + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.UUT + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.TestSocket + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelData + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelPluginConfiguration + + + 1 + + + 0 + + + 4 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + true + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:MqVP2nUv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + MoveTestStandTestReportToTestFolder + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + sourceTestReportFilePath + + + FileGlobals.SourceTestReportFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + destinationTestReportPath + + + FileGlobals.DestinationTestReportPath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a dialog box in which the operator enters the UUTserial number. Override this in client file to change or replace this action. + + + + + true + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + +
+ + +
+ + + + + + + + ID#:LSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + #NoValidation(SearchAndReplace(Locals.HeaderConfigFilePath=RunState.ProcessModelClient.Path,".seq","_Header.ini")) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LigwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 4 + + + false + + + TestInformation + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Return Value + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 6 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + title + + + "Test Information" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + headerPath + + + Locals.HeaderConfigFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + processModelType + + + "Sequential" + + + + + + 16 + + + NI_ReportPropertyLib.ProcessModelType + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + RunDialog + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + continueTesting + + + Parameters.ContinueTesting + + + + + + 2 + + + + + + 10 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LygwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 6 + + + false + + + Use Existing Object + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Existing Object + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + GetData + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MCgwT6sv8BG4RowdltwhQC + + + FlowControl\NI_ForEach.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + Parameters.UUT.AdditionalData.GetSubProperties("", PropOption_NoOptions) + + + + Locals.Header + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + false + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Locals.Header.AsPropertyObject.SetFlags("", 0, PropFlags_IncludeInReport) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MigwT6sv8BG4RowdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + + + Warning: if this step is skipped or removed in a Client Sequence PreUUT override, then ATML, and TextReport will not have the custom Headers and Footers from COI settings + + + + + ID#:MygwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Thread.PostUIMessageEx( UIMsg_UserMessageBase+Locals.UseCustomHeaderAndFooter, 0, "", ThisContext, True ) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:3uYS2qsv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.UUT = Parameters.UUT + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + UseStepLoadOpt + + + UnloadAfterSequenceExecution + + + 0.0.0.0 + + + 1 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + diff --git a/Source/TestStand/Sequences/MTS/Set01/MSFR_Header.ini b/Source/TestStand/Sequences/MTS/Set01/MSFR_Header.ini new file mode 100644 index 0000000..8207300 Binary files /dev/null and b/Source/TestStand/Sequences/MTS/Set01/MSFR_Header.ini differ diff --git a/Source/TestStand/Sequences/MTS/Set01/Power_On.seq b/Source/TestStand/Sequences/MTS/Set01/Power_On.seq new file mode 100644 index 0000000..4c200f1 --- /dev/null +++ b/Source/TestStand/Sequences/MTS/Set01/Power_On.seq @@ -0,0 +1,26646 @@ + + + + + + + + + + + + + false + + + false + + + "" + + + "" + + + "" + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + 8192 + %#x + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "GENERIC_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "GENERIC_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + GenericSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='Expression' xsi:type='Expression' name='' classname='ExprValue' structureflags='131072'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='FCParameter' xsi:type='FCParameter' name='' classname='FCParameter' structureflags='131072'> + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "EDIT_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "EDIT_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + EditSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + false + + + false + + + + + + + + + + + + Step.Description + (Step.ConditionExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : LocalizeExpression(Step.ConditionExpr)) + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:ApOk00JkFUy4JOZwLQ+X6B + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditWhileStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_While.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_WhileTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + ResStr("NI_STEPTYPES", "ACTION_DESCRIPTION_NAME") + (("%ModuleDescription" == "") ? "" : ", %ModuleDescription") + + + ResStr("NI_STEPTYPES", "ACTION_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "ACTION_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + Action + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + DefaultLabVIEW|DefaultLabVIEWNXG|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetParameter' xsi:type='DotNetParameter' name='' classname='DotNetParameter' structureflags='131072'> + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetCall' xsi:type='DotNetCall' name='' classname='DotNetCall' structureflags='131072'> + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "POST_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "POST_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + ExecSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + DisplayTimerMsgImgPopup + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + buttonArraySize + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 6 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + EditMessageBoxStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 1 + + + + + + + + + 2 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + engine + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.Engine + + + RunState.Engine + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 0 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "EDIT_STEP_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TitleExpr) + + + ResStr("MSG_BOX_STEP_TYPE", "DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("MSG_BOX_STEP_TYPE", "MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "TITLE") + + + Evaluate(Step.TitleExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "MESSAGE") + + + Evaluate(Step.MessageExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + MsgBox.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupOptionsTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupLayoutTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + NameOf(Step) + + + "Your message here" + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_MsgBoxFontData' xsi:type='NI_MsgBoxFontData' name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + false + + + false + + + + + + + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + FlowControl\NI_End.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + NI_Flow_If, NI_Flow_Else, NI_Flow_ElseIf, NI_Flow_For, NI_Flow_While, NI_Flow_DoWhile, NI_Flow_Case, NI_Flow_Select, NI_ Flow_AutoSchedule, NI_Flow_LockResource, NI_Flow_Begin + + + + + + true + + + false + + + false + + + + + + + + + true + + + + + + + + + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + ModelPlugin.Base.Enabled is the preferred property, ReportOptions.DisableReportGeneration is a legacy (pre TS 2012) property. + + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + horizontal.xsl + report.xsl + expand.xsl + + + + + TR_horizontal.xsl + trml.xsl + + + + true + + + + false + + + false + + + false + + + true + + + false + This flag is used by style sheets to decide when to localize decimal points. + + + + Used to decide to generate a default XML report or an "ATML" report. The valid values are empty string and "ATML" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Sequential Model + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for ParallelModel + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Batch Model + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the batch report file path expression for Batch Model + + + false + + + + + + + + + true + + + + tr5_horizontal.xsl + tr5_report.xsl + tr5_expand.xsl + + + + + + true + + + + + + + + + + + + tr6_horizontal.xsl + tr6_report.xsl + tr6_expand.xsl + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + 0 + + + + 0 + + + 0 + + + Used by model plugins that spawn new threads and need to perform controller and socket synchronization in their Batch Done and UUT Done entry points + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginPerSocketRuntimeVariables' xsi:type='NI_ModelPluginPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the model plug-in>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + If the plugin does not require batch controller and socket synchronization, setting this property to False may provide improved performance when executing the Batch Model. + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + false + + + + + This property stores the report file path for the batch report. + + + + + This property stores the report file path for the UUT reports when and if they are all stored in the same file. If they are stored in separate files then the Path property of the NI_ReportGeneratorPerSocketRuntimeVariables type is used instead. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + + + + + UUT Status path map that is local to one batch execution. This is cleared once the batch execution is done. + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ReportGeneratorPerSocketRuntimeVariables' xsi:type='NI_ReportGeneratorPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + <_NAME_IN_ATTRIBUTE_ name='' classname='Objs'> + + + + + + NextUUT + + + 1 + + + + + + + + + Prompt + + + 0 + + + + + + + + + Terminate + + + 2 + + + + + + + + Prompt + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginConfigurationPerSocketRuntimeVariables' xsi:type='NI_ModelPluginConfigurationPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPlugin' xsi:type='NI_ModelPlugin' name='' classname='Obj'> + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + CommonSubsteps.dll + + + EditStatementStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 2 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 2 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EDIT_STEP_MENU_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TS.PostExpr) + + + ResStr("NI_SUBSTEPS", "STATEMENT_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_SUBSTEPS", "STATEMENT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EXPRESSION") + + + LocalizeExpression(Step.PostExpression) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + Statement.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.StatementTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CriticalFailureStackEntry' xsi:type='NI_CriticalFailureStackEntry' name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + This data type exists for symmetry with the batch and parallel models. Currently it has no fields. + + + + + + Valid values for NI models are "Sequential", "Batch", or "Parallel" + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "SC_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "SC_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + SeqAdp.ico + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + true + + + + + + 0 + + + 0 + + + 4 + %#x + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + Step.ArrayExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : +(Step.Description !="" ? Step.Description : +((Step.ArrayElementExpr != "" ? LocalizeExpression(Step.ArrayElementExpr) : ResStr("FLOW_CONTROL_STEPS", "ARRAYELEMENT")) + ResStr("FLOW_CONTROL_STEPS", "IN") + LocalizeExpression(Step.ArrayExpr))) + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:0fUZg4IOtkenNvECPWGh4A + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditForEachStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_ForEach.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_ForEachTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + 0 + + + + + + + false + + + + +
+ + + + + + + + + + + + false + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:HTlJMp958BG4tIwdltwhQC + + + FlowControl\NI_While.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + ID#:/dXdQJ958BG4tIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_Refresh.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + ResetDisplayForStepsInLoop + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:iOO/b8N68BG4t4wdltwhQC + + + ni_cpuAffinity.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + DisplayConfirmationMessage + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + message + + + "Proceed with power on?" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + leftButtonText + + + "OK" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + rightButtonText + + + "Cancel" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + endStepComment + + + "EndPowerOnWhileLoop" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:5zoT66kq8BG4QIwdltwhQC + + + NI_OfflineProcessingUtility\profile_active.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOn + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:O3D6/t538BG4sIwdltwhQC + + + MsgBox.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + "Message" + + + "Click OK to power off." + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + ID#:9nYXGKoq8BG4QIwdltwhQC + + + NI_OfflineProcessingUtility\profile_errors.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOff + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + EndPowerOnWhileLoop + + + + + ID#:HzlJMp958BG4tIwdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + +
+ + + + + + + + + ID#:y5IUvu+P7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + InitializeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + partNumber + + + "pn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + serialNumber + + + "sn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testType + + + "en" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testName + + + "power on" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + isThereHardware + + + True + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + configSubFolderName + + + "MTS" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testStandSeqContext + + + ThisContext + + + + + + 17 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:H9ImZvCP7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializePowerSupplyMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:CmDjm3kk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSwitchMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:EMVz/Hkk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeGuiManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:f7RVD3ok8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSupportThreads + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + ID#:9dKwOXok8BG4OIwdltwhQC + + + PropertyLoader\box_checked.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + FinalizeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + openTestDataFolder + + + False + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + true + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + The report generator result processing component calls this from its Begin sequence. Override it to modify the options. + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + false + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:itrC2MUt8BG4RYwdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Parameters.ReportOptions.GeneratePDFReport = True + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + This callback is called after ReportPath is calculated from Post UUT and Post Batch sequences. + + + + + false + + + + + + false + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:t/Wzj3Uv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.SourceTestReportFilePath = Parameters.ReportFilePath + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a pass, fail, error, or terminated banner. Override this in client file to change or replace this action. + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + Call the current model for the default functionality. We don't include the model specific steps in this sequence so the overridden callback works under all models after the user overrides it, copying its steps to their client file. + + + + + ID#:MaVP2nUv8BG4RowdltwhQC + + + SeqAdp.ico + + + + + + + + Runstate.Execution.ModelSequenceFilePath + + + DoPreUUT + + + "DoPostUUT" + + + + + + + false + + + Parameters.Result + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.UUT + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.TestSocket + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelData + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelPluginConfiguration + + + 1 + + + 0 + + + 4 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + true + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:MqVP2nUv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + MoveTestStandTestReportToTestFolder + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + sourceTestReportFilePath + + + FileGlobals.SourceTestReportFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + destinationTestReportPath + + + FileGlobals.DestinationTestReportPath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a dialog box in which the operator enters the UUTserial number. Override this in client file to change or replace this action. + + + + + true + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + +
+ + +
+ + + + + + + + ID#:LSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + #NoValidation(SearchAndReplace(Locals.HeaderConfigFilePath=RunState.ProcessModelClient.Path,".seq","_Header.ini")) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LigwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 4 + + + false + + + TestInformation + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Return Value + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 6 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + title + + + "Test Information" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + headerPath + + + Locals.HeaderConfigFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + processModelType + + + "Sequential" + + + + + + 16 + + + NI_ReportPropertyLib.ProcessModelType + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + RunDialog + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + continueTesting + + + Parameters.ContinueTesting + + + + + + 2 + + + + + + 10 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LygwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 6 + + + false + + + Use Existing Object + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Existing Object + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + GetData + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MCgwT6sv8BG4RowdltwhQC + + + FlowControl\NI_ForEach.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + Parameters.UUT.AdditionalData.GetSubProperties("", PropOption_NoOptions) + + + + Locals.Header + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + false + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Locals.Header.AsPropertyObject.SetFlags("", 0, PropFlags_IncludeInReport) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MigwT6sv8BG4RowdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + + + Warning: if this step is skipped or removed in a Client Sequence PreUUT override, then ATML, and TextReport will not have the custom Headers and Footers from COI settings + + + + + ID#:MygwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Thread.PostUIMessageEx( UIMsg_UserMessageBase+Locals.UseCustomHeaderAndFooter, 0, "", ThisContext, True ) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:3uYS2qsv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.UUT = Parameters.UUT + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + UseStepLoadOpt + + + UnloadAfterSequenceExecution + + + 0.0.0.0 + + + 1 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + diff --git a/Source/TestStand/Sequences/MTS/Set01/Power_On_Header.ini b/Source/TestStand/Sequences/MTS/Set01/Power_On_Header.ini new file mode 100644 index 0000000..d75b565 Binary files /dev/null and b/Source/TestStand/Sequences/MTS/Set01/Power_On_Header.ini differ diff --git a/Source/TestStand/Sequences/MTS/Set01/Reset_Power_Supply.seq b/Source/TestStand/Sequences/MTS/Set01/Reset_Power_Supply.seq new file mode 100644 index 0000000..c46aaf7 --- /dev/null +++ b/Source/TestStand/Sequences/MTS/Set01/Reset_Power_Supply.seq @@ -0,0 +1,17730 @@ + + + + + + + + + + + + + + + + + + false + + + false + + + "" + + + "" + + + "" + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + 8192 + %#x + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + ResStr("NI_STEPTYPES", "ACTION_DESCRIPTION_NAME") + (("%ModuleDescription" == "") ? "" : ", %ModuleDescription") + + + ResStr("NI_STEPTYPES", "ACTION_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "ACTION_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + Action + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + DefaultLabVIEW|DefaultLabVIEWNXG|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetParameter' xsi:type='DotNetParameter' name='' classname='DotNetParameter' structureflags='131072'> + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetCall' xsi:type='DotNetCall' name='' classname='DotNetCall' structureflags='131072'> + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + ModelPlugin.Base.Enabled is the preferred property, ReportOptions.DisableReportGeneration is a legacy (pre TS 2012) property. + + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + horizontal.xsl + report.xsl + expand.xsl + + + + + TR_horizontal.xsl + trml.xsl + + + + true + + + + false + + + false + + + false + + + true + + + false + This flag is used by style sheets to decide when to localize decimal points. + + + + Used to decide to generate a default XML report or an "ATML" report. The valid values are empty string and "ATML" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Sequential Model + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for ParallelModel + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Batch Model + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the batch report file path expression for Batch Model + + + false + + + + + + + + + true + + + + tr5_horizontal.xsl + tr5_report.xsl + tr5_expand.xsl + + + + + + true + + + + + + + + + + + + tr6_horizontal.xsl + tr6_report.xsl + tr6_expand.xsl + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + 0 + + + + 0 + + + 0 + + + Used by model plugins that spawn new threads and need to perform controller and socket synchronization in their Batch Done and UUT Done entry points + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginPerSocketRuntimeVariables' xsi:type='NI_ModelPluginPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the model plug-in>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + If the plugin does not require batch controller and socket synchronization, setting this property to False may provide improved performance when executing the Batch Model. + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + false + + + + + This property stores the report file path for the batch report. + + + + + This property stores the report file path for the UUT reports when and if they are all stored in the same file. If they are stored in separate files then the Path property of the NI_ReportGeneratorPerSocketRuntimeVariables type is used instead. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + + + + + UUT Status path map that is local to one batch execution. This is cleared once the batch execution is done. + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ReportGeneratorPerSocketRuntimeVariables' xsi:type='NI_ReportGeneratorPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + <_NAME_IN_ATTRIBUTE_ name='' classname='Objs'> + + + + + + NextUUT + + + 1 + + + + + + + + + Prompt + + + 0 + + + + + + + + + Terminate + + + 2 + + + + + + + + Prompt + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginConfigurationPerSocketRuntimeVariables' xsi:type='NI_ModelPluginConfigurationPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPlugin' xsi:type='NI_ModelPlugin' name='' classname='Obj'> + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "EDIT_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "EDIT_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + EditSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='Expression' xsi:type='Expression' name='' classname='ExprValue' structureflags='131072'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='FCParameter' xsi:type='FCParameter' name='' classname='FCParameter' structureflags='131072'> + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CommonSubsteps.dll + + + EditStatementStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 2 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 2 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EDIT_STEP_MENU_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TS.PostExpr) + + + ResStr("NI_SUBSTEPS", "STATEMENT_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_SUBSTEPS", "STATEMENT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EXPRESSION") + + + LocalizeExpression(Step.PostExpression) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + Statement.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.StatementTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CriticalFailureStackEntry' xsi:type='NI_CriticalFailureStackEntry' name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + This data type exists for symmetry with the batch and parallel models. Currently it has no fields. + + + + + + Valid values for NI models are "Sequential", "Batch", or "Parallel" + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "SC_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "SC_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + SeqAdp.ico + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + true + + + + + + 0 + + + 0 + + + 4 + %#x + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "GENERIC_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "GENERIC_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + GenericSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + Step.ArrayExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : +(Step.Description !="" ? Step.Description : +((Step.ArrayElementExpr != "" ? LocalizeExpression(Step.ArrayElementExpr) : ResStr("FLOW_CONTROL_STEPS", "ARRAYELEMENT")) + ResStr("FLOW_CONTROL_STEPS", "IN") + LocalizeExpression(Step.ArrayExpr))) + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:0fUZg4IOtkenNvECPWGh4A + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditForEachStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_ForEach.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_ForEachTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + 0 + + + + + + + false + + + + + + + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + FlowControl\NI_End.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + NI_Flow_If, NI_Flow_Else, NI_Flow_ElseIf, NI_Flow_For, NI_Flow_While, NI_Flow_DoWhile, NI_Flow_Case, NI_Flow_Select, NI_ Flow_AutoSchedule, NI_Flow_LockResource, NI_Flow_Begin + + + + + + true + + + false + + + false + + + + +
+ + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ +
+ + + + + + + + + ID#:y5IUvu+P7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + InitializeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + partNumber + + + "pn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + serialNumber + + + "sn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testType + + + "en" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testName + + + "power on" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + isThereHardware + + + True + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + configSubFolderName + + + "MTS" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testStandSeqContext + + + ThisContext + + + + + + 17 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:H9ImZvCP7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializePowerSupplyMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + ID#:9dKwOXok8BG4OIwdltwhQC + + + PropertyLoader\box_checked.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + FinalizeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + openTestDataFolder + + + False + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + true + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + The report generator result processing component calls this from its Begin sequence. Override it to modify the options. + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + false + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:itrC2MUt8BG4RYwdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Parameters.ReportOptions.GeneratePDFReport = True + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + This callback is called after ReportPath is calculated from Post UUT and Post Batch sequences. + + + + + false + + + + + + false + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:t/Wzj3Uv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.SourceTestReportFilePath = Parameters.ReportFilePath + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a pass, fail, error, or terminated banner. Override this in client file to change or replace this action. + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + Call the current model for the default functionality. We don't include the model specific steps in this sequence so the overridden callback works under all models after the user overrides it, copying its steps to their client file. + + + + + ID#:MaVP2nUv8BG4RowdltwhQC + + + SeqAdp.ico + + + + + + + + Runstate.Execution.ModelSequenceFilePath + + + DoPreUUT + + + "DoPostUUT" + + + + + + + false + + + Parameters.Result + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.UUT + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.TestSocket + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelData + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelPluginConfiguration + + + 1 + + + 0 + + + 4 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + true + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:MqVP2nUv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + MoveTestStandTestReportToTestFolder + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + sourceTestReportFilePath + + + FileGlobals.SourceTestReportFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + destinationTestReportPath + + + FileGlobals.DestinationTestReportPath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a dialog box in which the operator enters the UUTserial number. Override this in client file to change or replace this action. + + + + + true + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + +
+ + +
+ + + + + + + + ID#:LSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + #NoValidation(SearchAndReplace(Locals.HeaderConfigFilePath=RunState.ProcessModelClient.Path,".seq","_Header.ini")) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LigwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 4 + + + false + + + TestInformation + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Return Value + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 6 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + title + + + "Test Information" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + headerPath + + + Locals.HeaderConfigFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + processModelType + + + "Sequential" + + + + + + 16 + + + NI_ReportPropertyLib.ProcessModelType + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + RunDialog + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + continueTesting + + + Parameters.ContinueTesting + + + + + + 2 + + + + + + 10 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LygwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 6 + + + false + + + Use Existing Object + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Existing Object + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + GetData + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MCgwT6sv8BG4RowdltwhQC + + + FlowControl\NI_ForEach.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + Parameters.UUT.AdditionalData.GetSubProperties("", PropOption_NoOptions) + + + + Locals.Header + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + false + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Locals.Header.AsPropertyObject.SetFlags("", 0, PropFlags_IncludeInReport) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MigwT6sv8BG4RowdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + + + Warning: if this step is skipped or removed in a Client Sequence PreUUT override, then ATML, and TextReport will not have the custom Headers and Footers from COI settings + + + + + ID#:MygwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Thread.PostUIMessageEx( UIMsg_UserMessageBase+Locals.UseCustomHeaderAndFooter, 0, "", ThisContext, True ) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:3uYS2qsv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.UUT = Parameters.UUT + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + UseStepLoadOpt + + + UnloadAfterSequenceExecution + + + 0.0.0.0 + + + 1 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + diff --git a/Source/TestStand/Sequences/MTS/Set01/Reset_Power_Supply_Header.ini b/Source/TestStand/Sequences/MTS/Set01/Reset_Power_Supply_Header.ini new file mode 100644 index 0000000..860fcb3 Binary files /dev/null and b/Source/TestStand/Sequences/MTS/Set01/Reset_Power_Supply_Header.ini differ diff --git a/Source/TestStand/Sequences/MTS/Set01/Run_SelfTest_Header.ini b/Source/TestStand/Sequences/MTS/Set01/Run_SelfTest_Header.ini new file mode 100644 index 0000000..b3ddf0f Binary files /dev/null and b/Source/TestStand/Sequences/MTS/Set01/Run_SelfTest_Header.ini differ diff --git a/Source/TestStand/Sequences/MTS/Set01/Run_Selftest.seq b/Source/TestStand/Sequences/MTS/Set01/Run_Selftest.seq new file mode 100644 index 0000000..9f90b5b --- /dev/null +++ b/Source/TestStand/Sequences/MTS/Set01/Run_Selftest.seq @@ -0,0 +1,26633 @@ + + + + + + + + + + + + + + + + + + false + + + false + + + "" + + + "" + + + "" + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + 8192 + %#x + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + ResStr("NI_STEPTYPES", "ACTION_DESCRIPTION_NAME") + (("%ModuleDescription" == "") ? "" : ", %ModuleDescription") + + + ResStr("NI_STEPTYPES", "ACTION_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "ACTION_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + Action + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + DefaultLabVIEW|DefaultLabVIEWNXG|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetParameter' xsi:type='DotNetParameter' name='' classname='DotNetParameter' structureflags='131072'> + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetCall' xsi:type='DotNetCall' name='' classname='DotNetCall' structureflags='131072'> + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "POST_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "POST_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + ExecSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='Expression' xsi:type='Expression' name='' classname='ExprValue' structureflags='131072'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='FCParameter' xsi:type='FCParameter' name='' classname='FCParameter' structureflags='131072'> + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "EDIT_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "EDIT_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + EditSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + false + + + false + + + + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + DisplayTimerMsgImgPopup + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + buttonArraySize + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 6 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + EditMessageBoxStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 1 + + + + + + + + + 2 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + engine + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.Engine + + + RunState.Engine + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 0 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "EDIT_STEP_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TitleExpr) + + + ResStr("MSG_BOX_STEP_TYPE", "DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("MSG_BOX_STEP_TYPE", "MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "TITLE") + + + Evaluate(Step.TitleExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "MESSAGE") + + + Evaluate(Step.MessageExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + MsgBox.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupOptionsTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupLayoutTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + NameOf(Step) + + + "Your message here" + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_MsgBoxFontData' xsi:type='NI_MsgBoxFontData' name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + false + + + false + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "GENERIC_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "GENERIC_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + GenericSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + Step.Description + Step.ConditionExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : Str(LocalizeExpression(Step.ConditionExpr), "%expr", 0x7) + + + ResStr("FLOW_CONTROL_STEPS", "IF_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "IF_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_If + + + + + + + + + + + + ID#:qLl9dZOgXEmOqMatCabLiB + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditIfStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "IF_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_If.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + false + + + false + + + false + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_IfTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + NI_Flow_Else, NI_Flow_ElseIf, NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + + + + + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + FlowControl\NI_End.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + NI_Flow_If, NI_Flow_Else, NI_Flow_ElseIf, NI_Flow_For, NI_Flow_While, NI_Flow_DoWhile, NI_Flow_Case, NI_Flow_Select, NI_ Flow_AutoSchedule, NI_Flow_LockResource, NI_Flow_Begin + + + + + + true + + + false + + + false + + + + + + + + + true + + + + + + + + + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + ModelPlugin.Base.Enabled is the preferred property, ReportOptions.DisableReportGeneration is a legacy (pre TS 2012) property. + + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + horizontal.xsl + report.xsl + expand.xsl + + + + + TR_horizontal.xsl + trml.xsl + + + + true + + + + false + + + false + + + false + + + true + + + false + This flag is used by style sheets to decide when to localize decimal points. + + + + Used to decide to generate a default XML report or an "ATML" report. The valid values are empty string and "ATML" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Sequential Model + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for ParallelModel + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Batch Model + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the batch report file path expression for Batch Model + + + false + + + + + + + + + true + + + + tr5_horizontal.xsl + tr5_report.xsl + tr5_expand.xsl + + + + + + true + + + + + + + + + + + + tr6_horizontal.xsl + tr6_report.xsl + tr6_expand.xsl + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + 0 + + + + 0 + + + 0 + + + Used by model plugins that spawn new threads and need to perform controller and socket synchronization in their Batch Done and UUT Done entry points + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginPerSocketRuntimeVariables' xsi:type='NI_ModelPluginPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the model plug-in>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + If the plugin does not require batch controller and socket synchronization, setting this property to False may provide improved performance when executing the Batch Model. + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + false + + + + + This property stores the report file path for the batch report. + + + + + This property stores the report file path for the UUT reports when and if they are all stored in the same file. If they are stored in separate files then the Path property of the NI_ReportGeneratorPerSocketRuntimeVariables type is used instead. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + + + + + UUT Status path map that is local to one batch execution. This is cleared once the batch execution is done. + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ReportGeneratorPerSocketRuntimeVariables' xsi:type='NI_ReportGeneratorPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + <_NAME_IN_ATTRIBUTE_ name='' classname='Objs'> + + + + + + NextUUT + + + 1 + + + + + + + + + Prompt + + + 0 + + + + + + + + + Terminate + + + 2 + + + + + + + + Prompt + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginConfigurationPerSocketRuntimeVariables' xsi:type='NI_ModelPluginConfigurationPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPlugin' xsi:type='NI_ModelPlugin' name='' classname='Obj'> + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + CommonSubsteps.dll + + + EditStatementStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 2 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 2 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EDIT_STEP_MENU_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TS.PostExpr) + + + ResStr("NI_SUBSTEPS", "STATEMENT_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_SUBSTEPS", "STATEMENT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EXPRESSION") + + + LocalizeExpression(Step.PostExpression) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + Statement.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.StatementTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CriticalFailureStackEntry' xsi:type='NI_CriticalFailureStackEntry' name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + This data type exists for symmetry with the batch and parallel models. Currently it has no fields. + + + + + + Valid values for NI models are "Sequential", "Batch", or "Parallel" + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "SC_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "SC_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + SeqAdp.ico + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + true + + + + + + 0 + + + 0 + + + 4 + %#x + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + Step.ArrayExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : +(Step.Description !="" ? Step.Description : +((Step.ArrayElementExpr != "" ? LocalizeExpression(Step.ArrayElementExpr) : ResStr("FLOW_CONTROL_STEPS", "ARRAYELEMENT")) + ResStr("FLOW_CONTROL_STEPS", "IN") + LocalizeExpression(Step.ArrayExpr))) + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:0fUZg4IOtkenNvECPWGh4A + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditForEachStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_ForEach.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_ForEachTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + 0 + + + + + + + false + + + + +
+ + + + + + + + + + + + false + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:5zoT66kq8BG4QIwdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + PerformStto + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:OSZpZY178BG4t4wdltwhQC + + + MsgBox.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + Step.Result.ButtonHit==1 ? Locals.ProceedWithPowerOn = True : False + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + "Stop here" + + + "Click OK to power on." + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "Cancel" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 2 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + ID#:Pr7Io82C8BG4wowdltwhQC + + + FlowControl\NI_If.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + Locals.ProceedWithPowerOn == True + + + + + + + + + + + + + + + ID#:MMpnTglG8BG4bIwdltwhQC + + + NI_OfflineProcessingUtility\profile_active.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOn + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:5KsBoN8p8BG4P4wdltwhQC + + + MsgBox.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + "Stop here" + + + "Click OK to power off." + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + ID#:9nYXGKoq8BG4QIwdltwhQC + + + NI_OfflineProcessingUtility\profile_errors.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOff + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:QL7Io82C8BG4wowdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + +
+ + + + + + + + + ID#:y5IUvu+P7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + InitializeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + partNumber + + + "pn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + serialNumber + + + "sn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testType + + + "en" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testName + + + "SelfTest" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + isThereHardware + + + True + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + configSubFolderName + + + "SelfTest" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testStandSeqContext + + + ThisContext + + + + + + 17 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:H9ImZvCP7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializePowerSupplyMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:CmDjm3kk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSwitchMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:EMVz/Hkk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeGuiManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:f7RVD3ok8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSupportThreads + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + ID#:9dKwOXok8BG4OIwdltwhQC + + + PropertyLoader\box_checked.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + FinalizeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + openTestDataFolder + + + False + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + true + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + The report generator result processing component calls this from its Begin sequence. Override it to modify the options. + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + false + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:itrC2MUt8BG4RYwdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Parameters.ReportOptions.GeneratePDFReport = True + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + This callback is called after ReportPath is calculated from Post UUT and Post Batch sequences. + + + + + false + + + + + + false + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:t/Wzj3Uv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.SourceTestReportFilePath = Parameters.ReportFilePath + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a pass, fail, error, or terminated banner. Override this in client file to change or replace this action. + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + Call the current model for the default functionality. We don't include the model specific steps in this sequence so the overridden callback works under all models after the user overrides it, copying its steps to their client file. + + + + + ID#:MaVP2nUv8BG4RowdltwhQC + + + SeqAdp.ico + + + + + + + + Runstate.Execution.ModelSequenceFilePath + + + DoPreUUT + + + "DoPostUUT" + + + + + + + false + + + Parameters.Result + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.UUT + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.TestSocket + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelData + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelPluginConfiguration + + + 1 + + + 0 + + + 4 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + true + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:MqVP2nUv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + MoveTestStandTestReportToTestFolder + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + sourceTestReportFilePath + + + FileGlobals.SourceTestReportFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + destinationTestReportPath + + + FileGlobals.DestinationTestReportPath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a dialog box in which the operator enters the UUTserial number. Override this in client file to change or replace this action. + + + + + true + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + +
+ + +
+ + + + + + + + ID#:LSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + #NoValidation(SearchAndReplace(Locals.HeaderConfigFilePath=RunState.ProcessModelClient.Path,".seq","_Header.ini")) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LigwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 4 + + + false + + + TestInformation + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Return Value + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 6 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + title + + + "Test Information" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + headerPath + + + Locals.HeaderConfigFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + processModelType + + + "Sequential" + + + + + + 16 + + + NI_ReportPropertyLib.ProcessModelType + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + RunDialog + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + continueTesting + + + Parameters.ContinueTesting + + + + + + 2 + + + + + + 10 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LygwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 6 + + + false + + + Use Existing Object + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Existing Object + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + GetData + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MCgwT6sv8BG4RowdltwhQC + + + FlowControl\NI_ForEach.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + Parameters.UUT.AdditionalData.GetSubProperties("", PropOption_NoOptions) + + + + Locals.Header + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + false + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Locals.Header.AsPropertyObject.SetFlags("", 0, PropFlags_IncludeInReport) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MigwT6sv8BG4RowdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + + + Warning: if this step is skipped or removed in a Client Sequence PreUUT override, then ATML, and TextReport will not have the custom Headers and Footers from COI settings + + + + + ID#:MygwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Thread.PostUIMessageEx( UIMsg_UserMessageBase+Locals.UseCustomHeaderAndFooter, 0, "", ThisContext, True ) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:3uYS2qsv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.UUT = Parameters.UUT + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + UseStepLoadOpt + + + UnloadAfterSequenceExecution + + + 0.0.0.0 + + + 1 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + diff --git a/Source/TestStand/Sequences/MTS/Set01/Verify_Umbilical_Uart_Comm.seq b/Source/TestStand/Sequences/MTS/Set01/Verify_Umbilical_Uart_Comm.seq new file mode 100644 index 0000000..4b224f3 --- /dev/null +++ b/Source/TestStand/Sequences/MTS/Set01/Verify_Umbilical_Uart_Comm.seq @@ -0,0 +1,28539 @@ + + + + + + + + + + + + + false + + + false + + + "" + + + "" + + + "" + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + 8192 + %#x + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "GENERIC_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "GENERIC_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + GenericSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='Expression' xsi:type='Expression' name='' classname='ExprValue' structureflags='131072'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='FCParameter' xsi:type='FCParameter' name='' classname='FCParameter' structureflags='131072'> + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "EDIT_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "EDIT_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + EditSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + false + + + false + + + + + + + + + + + + Step.Description + (Step.ConditionExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : LocalizeExpression(Step.ConditionExpr)) + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:ApOk00JkFUy4JOZwLQ+X6B + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditWhileStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_While.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_WhileTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + ResStr("NI_STEPTYPES", "ACTION_DESCRIPTION_NAME") + (("%ModuleDescription" == "") ? "" : ", %ModuleDescription") + + + ResStr("NI_STEPTYPES", "ACTION_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "ACTION_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + Action + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + DefaultLabVIEW|DefaultLabVIEWNXG|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetParameter' xsi:type='DotNetParameter' name='' classname='DotNetParameter' structureflags='131072'> + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetCall' xsi:type='DotNetCall' name='' classname='DotNetCall' structureflags='131072'> + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "POST_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "POST_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + ExecSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + DisplayTimerMsgImgPopup + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + buttonArraySize + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 6 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + EditMessageBoxStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 1 + + + + + + + + + 2 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + engine + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.Engine + + + RunState.Engine + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 0 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "EDIT_STEP_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TitleExpr) + + + ResStr("MSG_BOX_STEP_TYPE", "DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("MSG_BOX_STEP_TYPE", "MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "TITLE") + + + Evaluate(Step.TitleExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "MESSAGE") + + + Evaluate(Step.MessageExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + MsgBox.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupOptionsTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupLayoutTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + NameOf(Step) + + + "Your message here" + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_MsgBoxFontData' xsi:type='NI_MsgBoxFontData' name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + false + + + false + + + + + + + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + FlowControl\NI_End.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + NI_Flow_If, NI_Flow_Else, NI_Flow_ElseIf, NI_Flow_For, NI_Flow_While, NI_Flow_DoWhile, NI_Flow_Case, NI_Flow_Select, NI_ Flow_AutoSchedule, NI_Flow_LockResource, NI_Flow_Begin + + + + + + true + + + false + + + false + + + + + + + + + true + + + + + + + + + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + ModelPlugin.Base.Enabled is the preferred property, ReportOptions.DisableReportGeneration is a legacy (pre TS 2012) property. + + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + horizontal.xsl + report.xsl + expand.xsl + + + + + TR_horizontal.xsl + trml.xsl + + + + true + + + + false + + + false + + + false + + + true + + + false + This flag is used by style sheets to decide when to localize decimal points. + + + + Used to decide to generate a default XML report or an "ATML" report. The valid values are empty string and "ATML" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Sequential Model + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for ParallelModel + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Batch Model + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the batch report file path expression for Batch Model + + + false + + + + + + + + + true + + + + tr5_horizontal.xsl + tr5_report.xsl + tr5_expand.xsl + + + + + + true + + + + + + + + + + + + tr6_horizontal.xsl + tr6_report.xsl + tr6_expand.xsl + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + 0 + + + + 0 + + + 0 + + + Used by model plugins that spawn new threads and need to perform controller and socket synchronization in their Batch Done and UUT Done entry points + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginPerSocketRuntimeVariables' xsi:type='NI_ModelPluginPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the model plug-in>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + If the plugin does not require batch controller and socket synchronization, setting this property to False may provide improved performance when executing the Batch Model. + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + false + + + + + This property stores the report file path for the batch report. + + + + + This property stores the report file path for the UUT reports when and if they are all stored in the same file. If they are stored in separate files then the Path property of the NI_ReportGeneratorPerSocketRuntimeVariables type is used instead. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + + + + + UUT Status path map that is local to one batch execution. This is cleared once the batch execution is done. + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ReportGeneratorPerSocketRuntimeVariables' xsi:type='NI_ReportGeneratorPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + <_NAME_IN_ATTRIBUTE_ name='' classname='Objs'> + + + + + + NextUUT + + + 1 + + + + + + + + + Prompt + + + 0 + + + + + + + + + Terminate + + + 2 + + + + + + + + Prompt + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginConfigurationPerSocketRuntimeVariables' xsi:type='NI_ModelPluginConfigurationPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPlugin' xsi:type='NI_ModelPlugin' name='' classname='Obj'> + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + CommonSubsteps.dll + + + EditStatementStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 2 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 2 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EDIT_STEP_MENU_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TS.PostExpr) + + + ResStr("NI_SUBSTEPS", "STATEMENT_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_SUBSTEPS", "STATEMENT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EXPRESSION") + + + LocalizeExpression(Step.PostExpression) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + Statement.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.StatementTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CriticalFailureStackEntry' xsi:type='NI_CriticalFailureStackEntry' name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + This data type exists for symmetry with the batch and parallel models. Currently it has no fields. + + + + + + Valid values for NI models are "Sequential", "Batch", or "Parallel" + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "SC_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "SC_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + SeqAdp.ico + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + true + + + + + + 0 + + + 0 + + + 4 + %#x + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + Step.ArrayExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : +(Step.Description !="" ? Step.Description : +((Step.ArrayElementExpr != "" ? LocalizeExpression(Step.ArrayElementExpr) : ResStr("FLOW_CONTROL_STEPS", "ARRAYELEMENT")) + ResStr("FLOW_CONTROL_STEPS", "IN") + LocalizeExpression(Step.ArrayExpr))) + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:0fUZg4IOtkenNvECPWGh4A + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditForEachStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_ForEach.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_ForEachTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + 0 + + + + + + + false + + + + +
+ + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:rBSIoMJ68BG4t4wdltwhQC + + + FlowControl\NI_While.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + ID#:9taKr8J68BG4t4wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_Refresh.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + ResetDisplayForStepsInLoop + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:99aKr8J68BG4t4wdltwhQC + + + ni_cpuAffinity.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + DisplayConfirmationMessage + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + message + + + "Proceed with power on?" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + leftButtonText + + + "OK" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + rightButtonText + + + "Cancel" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + endStepComment + + + "EndPowerOnWhileLoop" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:BMOUMYSY8BG4z4wdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + StartTacticalUartReadThreadAction + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:5zoT66kq8BG4QIwdltwhQC + + + NI_OfflineProcessingUtility\profile_active.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOn + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:dlzV4qNb8BG4gIwdltwhQC + + + ni_hourglass.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + DisplayWaitMessage + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + message + + + "Waiting for missile software to boot and execute PBIT..." + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + delaySec + + + 7.5 + + + + + + 12 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:YiOE22qD8BG4w4wdltwhQC + + + ExecutionArrow.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + PerformTacticalUartCommAction + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:hP+S6cJ68BG4t4wdltwhQC + + + MsgBox.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + "Message" + + + "Click OK to power off" + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + ID#:9nYXGKoq8BG4QIwdltwhQC + + + NI_OfflineProcessingUtility\profile_errors.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOff + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + EndPowerOnWhileLoop + + + + + ID#:rhSIoMJ68BG4t4wdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + +
+ + + + + + + + + ID#:y5IUvu+P7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + InitializeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + partNumber + + + "pn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + serialNumber + + + "sn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testType + + + "en" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testName + + + "power on" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + isThereHardware + + + True + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + configSubFolderName + + + "MTS" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testStandSeqContext + + + ThisContext + + + + + + 17 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:H9ImZvCP7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializePowerSupplyMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:CmDjm3kk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSwitchMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:idJLWaZo8BG4k4wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSerialDevices + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:EMVz/Hkk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeGuiManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:f7RVD3ok8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSupportThreads + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + ID#:9dKwOXok8BG4OIwdltwhQC + + + PropertyLoader\box_checked.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + FinalizeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + openTestDataFolder + + + False + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + true + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + The report generator result processing component calls this from its Begin sequence. Override it to modify the options. + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + false + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:itrC2MUt8BG4RYwdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Parameters.ReportOptions.GeneratePDFReport = True + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + This callback is called after ReportPath is calculated from Post UUT and Post Batch sequences. + + + + + false + + + + + + false + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:t/Wzj3Uv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.SourceTestReportFilePath = Parameters.ReportFilePath + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a pass, fail, error, or terminated banner. Override this in client file to change or replace this action. + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + Call the current model for the default functionality. We don't include the model specific steps in this sequence so the overridden callback works under all models after the user overrides it, copying its steps to their client file. + + + + + ID#:MaVP2nUv8BG4RowdltwhQC + + + SeqAdp.ico + + + + + + + + Runstate.Execution.ModelSequenceFilePath + + + DoPreUUT + + + "DoPostUUT" + + + + + + + false + + + Parameters.Result + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.UUT + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.TestSocket + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelData + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelPluginConfiguration + + + 1 + + + 0 + + + 4 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + true + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:MqVP2nUv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + MoveTestStandTestReportToTestFolder + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + sourceTestReportFilePath + + + FileGlobals.SourceTestReportFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + destinationTestReportPath + + + FileGlobals.DestinationTestReportPath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a dialog box in which the operator enters the UUTserial number. Override this in client file to change or replace this action. + + + + + true + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + +
+ + +
+ + + + + + + + ID#:LSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + #NoValidation(SearchAndReplace(Locals.HeaderConfigFilePath=RunState.ProcessModelClient.Path,".seq","_Header.ini")) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LigwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 4 + + + false + + + TestInformation + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Return Value + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 6 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + title + + + "Test Information" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + headerPath + + + Locals.HeaderConfigFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + processModelType + + + "Sequential" + + + + + + 16 + + + NI_ReportPropertyLib.ProcessModelType + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + RunDialog + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + continueTesting + + + Parameters.ContinueTesting + + + + + + 2 + + + + + + 10 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LygwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 6 + + + false + + + Use Existing Object + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Existing Object + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + GetData + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MCgwT6sv8BG4RowdltwhQC + + + FlowControl\NI_ForEach.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + Parameters.UUT.AdditionalData.GetSubProperties("", PropOption_NoOptions) + + + + Locals.Header + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + false + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Locals.Header.AsPropertyObject.SetFlags("", 0, PropFlags_IncludeInReport) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MigwT6sv8BG4RowdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + + + Warning: if this step is skipped or removed in a Client Sequence PreUUT override, then ATML, and TextReport will not have the custom Headers and Footers from COI settings + + + + + ID#:MygwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Thread.PostUIMessageEx( UIMsg_UserMessageBase+Locals.UseCustomHeaderAndFooter, 0, "", ThisContext, True ) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:3uYS2qsv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.UUT = Parameters.UUT + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + UseStepLoadOpt + + + UnloadAfterSequenceExecution + + + 0.0.0.0 + + + 1 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + diff --git a/Source/TestStand/Sequences/MTS/Set01/Verify_Umbilical_Uart_Comm_Header.ini b/Source/TestStand/Sequences/MTS/Set01/Verify_Umbilical_Uart_Comm_Header.ini new file mode 100644 index 0000000..ac48759 Binary files /dev/null and b/Source/TestStand/Sequences/MTS/Set01/Verify_Umbilical_Uart_Comm_Header.ini differ diff --git a/Source/TestStand/Sequences/MTS_Sim/Set01/Power_On.seq b/Source/TestStand/Sequences/MTS_Sim/Set01/Power_On.seq new file mode 100644 index 0000000..5a4adc9 --- /dev/null +++ b/Source/TestStand/Sequences/MTS_Sim/Set01/Power_On.seq @@ -0,0 +1,27525 @@ + + + + + + + + + + + + + false + + + false + + + "" + + + "" + + + "" + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + 8192 + %#x + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "GENERIC_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "GENERIC_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + GenericSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='Expression' xsi:type='Expression' name='' classname='ExprValue' structureflags='131072'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='FCParameter' xsi:type='FCParameter' name='' classname='FCParameter' structureflags='131072'> + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "EDIT_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "EDIT_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + EditSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + false + + + false + + + + + + + + + + + + Step.Description + (Step.ConditionExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : LocalizeExpression(Step.ConditionExpr)) + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:ApOk00JkFUy4JOZwLQ+X6B + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditWhileStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "WHILE_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_While.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_WhileTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + ResStr("NI_STEPTYPES", "ACTION_DESCRIPTION_NAME") + (("%ModuleDescription" == "") ? "" : ", %ModuleDescription") + + + ResStr("NI_STEPTYPES", "ACTION_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "ACTION_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + Action + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + DefaultLabVIEW|DefaultLabVIEWNXG|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetParameter' xsi:type='DotNetParameter' name='' classname='DotNetParameter' structureflags='131072'> + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetCall' xsi:type='DotNetCall' name='' classname='DotNetCall' structureflags='131072'> + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "POST_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "POST_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + ExecSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + DisplayTimerMsgImgPopup + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + buttonArraySize + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 6 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + msgbox.dll + + + EditMessageBoxStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 1 + + + + + + + + + 2 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + engine + + + 4 + + + 4 + + + 1 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.Engine + + + RunState.Engine + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 0 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "EDIT_STEP_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TitleExpr) + + + ResStr("MSG_BOX_STEP_TYPE", "DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("MSG_BOX_STEP_TYPE", "MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "TITLE") + + + Evaluate(Step.TitleExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("MSG_BOX_STEP_TYPE", "MESSAGE") + + + Evaluate(Step.MessageExpr) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + MsgBox.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupOptionsTabInfo + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.MessagePopupLayoutTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + NameOf(Step) + + + "Your message here" + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_MsgBoxFontData' xsi:type='NI_MsgBoxFontData' name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + false + + + false + + + + + + + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + FlowControl\NI_End.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + NI_Flow_If, NI_Flow_Else, NI_Flow_ElseIf, NI_Flow_For, NI_Flow_While, NI_Flow_DoWhile, NI_Flow_Case, NI_Flow_Select, NI_ Flow_AutoSchedule, NI_Flow_LockResource, NI_Flow_Begin + + + + + + true + + + false + + + false + + + + + + + + + true + + + + + + + + + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + ModelPlugin.Base.Enabled is the preferred property, ReportOptions.DisableReportGeneration is a legacy (pre TS 2012) property. + + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + horizontal.xsl + report.xsl + expand.xsl + + + + + TR_horizontal.xsl + trml.xsl + + + + true + + + + false + + + false + + + false + + + true + + + false + This flag is used by style sheets to decide when to localize decimal points. + + + + Used to decide to generate a default XML report or an "ATML" report. The valid values are empty string and "ATML" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Sequential Model + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for ParallelModel + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Batch Model + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the batch report file path expression for Batch Model + + + false + + + + + + + + + true + + + + tr5_horizontal.xsl + tr5_report.xsl + tr5_expand.xsl + + + + + + true + + + + + + + + + + + + tr6_horizontal.xsl + tr6_report.xsl + tr6_expand.xsl + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + 0 + + + + 0 + + + 0 + + + Used by model plugins that spawn new threads and need to perform controller and socket synchronization in their Batch Done and UUT Done entry points + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginPerSocketRuntimeVariables' xsi:type='NI_ModelPluginPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the model plug-in>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + If the plugin does not require batch controller and socket synchronization, setting this property to False may provide improved performance when executing the Batch Model. + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + false + + + + + This property stores the report file path for the batch report. + + + + + This property stores the report file path for the UUT reports when and if they are all stored in the same file. If they are stored in separate files then the Path property of the NI_ReportGeneratorPerSocketRuntimeVariables type is used instead. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + + + + + UUT Status path map that is local to one batch execution. This is cleared once the batch execution is done. + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ReportGeneratorPerSocketRuntimeVariables' xsi:type='NI_ReportGeneratorPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + <_NAME_IN_ATTRIBUTE_ name='' classname='Objs'> + + + + + + NextUUT + + + 1 + + + + + + + + + Prompt + + + 0 + + + + + + + + + Terminate + + + 2 + + + + + + + + Prompt + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginConfigurationPerSocketRuntimeVariables' xsi:type='NI_ModelPluginConfigurationPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPlugin' xsi:type='NI_ModelPlugin' name='' classname='Obj'> + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + CommonSubsteps.dll + + + EditStatementStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 2 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 2 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EDIT_STEP_MENU_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TS.PostExpr) + + + ResStr("NI_SUBSTEPS", "STATEMENT_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_SUBSTEPS", "STATEMENT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EXPRESSION") + + + LocalizeExpression(Step.PostExpression) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + Statement.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.StatementTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CriticalFailureStackEntry' xsi:type='NI_CriticalFailureStackEntry' name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + This data type exists for symmetry with the batch and parallel models. Currently it has no fields. + + + + + + Valid values for NI models are "Sequential", "Batch", or "Parallel" + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "SC_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "SC_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + SeqAdp.ico + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + true + + + + + + 0 + + + 0 + + + 4 + %#x + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + Step.ArrayExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : +(Step.Description !="" ? Step.Description : +((Step.ArrayElementExpr != "" ? LocalizeExpression(Step.ArrayElementExpr) : ResStr("FLOW_CONTROL_STEPS", "ARRAYELEMENT")) + ResStr("FLOW_CONTROL_STEPS", "IN") + LocalizeExpression(Step.ArrayExpr))) + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:0fUZg4IOtkenNvECPWGh4A + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditForEachStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_ForEach.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_ForEachTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + 0 + + + + + + + false + + + + +
+ + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:1LA6OGZ58BG4s4wdltwhQC + + + FlowControl\NI_While.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + ID#:5zoT66kq8BG4QIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_Refresh.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + ResetDisplayForStepsInLoop + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:BwFulbh68BG4t4wdltwhQC + + + ni_cpuAffinity.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + DisplayConfirmationMessage + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + message + + + "Proceed with on power?" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + leftButtonText + + + "OK" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + rightButtonText + + + "Cancel" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + endStepComment + + + "EndPowerOnWhileLoop" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:AX4U+Zh58BG4tIwdltwhQC + + + NI_OfflineProcessingUtility\profile_active.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOn + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:5KsBoN8p8BG4P4wdltwhQC + + + MsgBox.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + 0 + + + + + + + + + + + + "Message" + + + "Click OK to power off" + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + "OK" + + + "" + + + "" + + + "" + + + "" + + + "" + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + false + + + 1 + + + 4096 + + + + + 0 + + + -1 + + + -1 + + + false + + + false + + + false + + + false + + + + + + true + + + + + + + + + + + + + + + + false + + + + + + 0 + + + + + + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + + + + + + + + + + + true + + + false + + + false + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + ID#:9nYXGKoq8BG4QIwdltwhQC + + + NI_OfflineProcessingUtility\profile_errors.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ActionManager + + + 1 + + + true + + + UutPowerOff + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ActionManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + EndPowerOnWhileLoop + + + + + ID#:1rA6OGZ58BG4s4wdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + +
+ + + + + + + + + ID#:y5IUvu+P7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + InitializeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + partNumber + + + "pn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + serialNumber + + + "sn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testType + + + "en" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testName + + + "power on" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + isThereHardware + + + False + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + configSubFolderName + + + "MTS" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testStandSeqContext + + + ThisContext + + + + + + 17 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:H9ImZvCP7xG384wdltwhQC + + + NI_SequenceEditor\StepSettings\ni_build.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializePowerSupplyMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:z1zFbXkk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeDioMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:CmDjm3kk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSwitchMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:bzXv1Xkk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeCoeMeasurementManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:EMVz/Hkk8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeGuiManager + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:f7RVD3ok8BG4OIwdltwhQC + + + NI_SequenceEditor\StepSettings\ni_advance.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.SetupManager + + + 1 + + + true + + + InitializeSupportThreads + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.SetupManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + ID#:9dKwOXok8BG4OIwdltwhQC + + + PropertyLoader\box_checked.ico + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + FinalizeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + openTestDataFolder + + + False + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + true + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + The report generator result processing component calls this from its Begin sequence. Override it to modify the options. + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + false + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:itrC2MUt8BG4RYwdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Parameters.ReportOptions.GeneratePDFReport = True + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + This callback is called after ReportPath is calculated from Post UUT and Post Batch sequences. + + + + + false + + + + + + false + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:t/Wzj3Uv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.SourceTestReportFilePath = Parameters.ReportFilePath + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a pass, fail, error, or terminated banner. Override this in client file to change or replace this action. + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + Call the current model for the default functionality. We don't include the model specific steps in this sequence so the overridden callback works under all models after the user overrides it, copying its steps to their client file. + + + + + ID#:MaVP2nUv8BG4RowdltwhQC + + + SeqAdp.ico + + + + + + + + Runstate.Execution.ModelSequenceFilePath + + + DoPreUUT + + + "DoPostUUT" + + + + + + + false + + + Parameters.Result + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.UUT + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.TestSocket + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelData + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelPluginConfiguration + + + 1 + + + 0 + + + 4 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + true + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:MqVP2nUv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + MoveTestStandTestReportToTestFolder + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + sourceTestReportFilePath + + + FileGlobals.SourceTestReportFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + destinationTestReportPath + + + FileGlobals.DestinationTestReportPath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a dialog box in which the operator enters the UUTserial number. Override this in client file to change or replace this action. + + + + + true + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + +
+ + +
+ + + + + + + + ID#:LSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + #NoValidation(SearchAndReplace(Locals.HeaderConfigFilePath=RunState.ProcessModelClient.Path,".seq","_Header.ini")) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LigwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 4 + + + false + + + TestInformation + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Return Value + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 6 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + title + + + "Test Information" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + headerPath + + + Locals.HeaderConfigFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + processModelType + + + "Sequential" + + + + + + 16 + + + NI_ReportPropertyLib.ProcessModelType + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + RunDialog + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + continueTesting + + + Parameters.ContinueTesting + + + + + + 2 + + + + + + 10 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LygwT6sv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 6 + + + false + + + Use Existing Object + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Existing Object + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + GetData + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MCgwT6sv8BG4RowdltwhQC + + + FlowControl\NI_ForEach.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + Parameters.UUT.AdditionalData.GetSubProperties("", PropOption_NoOptions) + + + + Locals.Header + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + false + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MSgwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Locals.Header.AsPropertyObject.SetFlags("", 0, PropFlags_IncludeInReport) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:MigwT6sv8BG4RowdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + + + Warning: if this step is skipped or removed in a Client Sequence PreUUT override, then ATML, and TextReport will not have the custom Headers and Footers from COI settings + + + + + ID#:MygwT6sv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Thread.PostUIMessageEx( UIMsg_UserMessageBase+Locals.UseCustomHeaderAndFooter, 0, "", ThisContext, True ) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:3uYS2qsv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.UUT = Parameters.UUT + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + UseStepLoadOpt + + + UnloadAfterSequenceExecution + + + 0.0.0.0 + + + 1 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + diff --git a/Source/TestStand/Sequences/MTS_Sim/Set01/Power_On_Header.ini b/Source/TestStand/Sequences/MTS_Sim/Set01/Power_On_Header.ini new file mode 100644 index 0000000..b60cebe Binary files /dev/null and b/Source/TestStand/Sequences/MTS_Sim/Set01/Power_On_Header.ini differ diff --git a/Source/TestStand/Template/sub_sequence.seq b/Source/TestStand/Template/sub_sequence.seq new file mode 100644 index 0000000..7e07f5e --- /dev/null +++ b/Source/TestStand/Template/sub_sequence.seq @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ +
+ + + + + + + + true + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+
+
+ + + + + + + + + + + + + + + + UseStepLoadOpt + + + UnloadAfterSequenceExecution + + + 0.0.0.0 + + + 1 + + + 0 + + + 0 + + + 0 + + + + + + + + +
+
+
diff --git a/Source/TestStand/Template/top_level_sequence.seq b/Source/TestStand/Template/top_level_sequence.seq new file mode 100644 index 0000000..d3d4bcc --- /dev/null +++ b/Source/TestStand/Template/top_level_sequence.seq @@ -0,0 +1,17289 @@ + + + + + + + + + + + + + + + + + + false + + + false + + + "" + + + "" + + + "" + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + 8192 + %#x + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + ResStr("NI_STEPTYPES", "ACTION_DESCRIPTION_NAME") + (("%ModuleDescription" == "") ? "" : ", %ModuleDescription") + + + ResStr("NI_STEPTYPES", "ACTION_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "ACTION_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + Action + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + DefaultLabVIEW|DefaultLabVIEWNXG|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetParameter' xsi:type='DotNetParameter' name='' classname='DotNetParameter' structureflags='131072'> + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='DotNetCall' xsi:type='DotNetCall' name='' classname='DotNetCall' structureflags='131072'> + + + + + + 0 + + + false + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + ModelPlugin.Base.Enabled is the preferred property, ReportOptions.DisableReportGeneration is a legacy (pre TS 2012) property. + + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + horizontal.xsl + report.xsl + expand.xsl + + + + + TR_horizontal.xsl + trml.xsl + + + + true + + + + false + + + false + + + false + + + true + + + false + This flag is used by style sheets to decide when to localize decimal points. + + + + Used to decide to generate a default XML report or an "ATML" report. The valid values are empty string and "ATML" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Sequential Model + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for ParallelModel + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the report file path expression for Batch Model + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + Used to store the batch report file path expression for Batch Model + + + false + + + + + + + + + true + + + + tr5_horizontal.xsl + tr5_report.xsl + tr5_expand.xsl + + + + + + true + + + + + + + + + + + + tr6_horizontal.xsl + tr6_report.xsl + tr6_expand.xsl + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + 0 + + + + 0 + + + 0 + + + Used by model plugins that spawn new threads and need to perform controller and socket synchronization in their Batch Done and UUT Done entry points + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginPerSocketRuntimeVariables' xsi:type='NI_ModelPluginPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the model plug-in>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + If the plugin does not require batch controller and socket synchronization, setting this property to False may provide improved performance when executing the Batch Model. + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + false + + + + + This property stores the report file path for the batch report. + + + + + This property stores the report file path for the UUT reports when and if they are all stored in the same file. If they are stored in separate files then the Path property of the NI_ReportGeneratorPerSocketRuntimeVariables type is used instead. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + false + This property is used when writing the UUT report to determine whether or not to append a UUT report to the file at the current report file path, or to create a new file at that path. + + + + + + + UUT Status path map that is local to one batch execution. This is cleared once the batch execution is done. + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ReportGeneratorPerSocketRuntimeVariables' xsi:type='NI_ReportGeneratorPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + <_NAME_IN_ATTRIBUTE_ name='' classname='Objs'> + + + + + + NextUUT + + + 1 + + + + + + + + + Prompt + + + 0 + + + + + + + + + Terminate + + + 2 + + + + + + + + Prompt + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPluginConfigurationPerSocketRuntimeVariables' xsi:type='NI_ModelPluginConfigurationPerSocketRuntimeVariables' name='' classname='Obj'> + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_ModelPlugin' xsi:type='NI_ModelPlugin' name='' classname='Obj'> + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "EDIT_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "EDIT_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + EditSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='Expression' xsi:type='Expression' name='' classname='ExprValue' structureflags='131072'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='FCParameter' xsi:type='FCParameter' name='' classname='FCParameter' structureflags='131072'> + + + _notNamed + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CommonSubsteps.dll + + + EditStatementStep + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 2 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + context + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + reserved + + + 0 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + 0 + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + changed + + + 0 + + + 4 + + + 2 + + + + + + 1 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + RunState.InitialSelection.SelectedFile.ChangeCount + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EDIT_STEP_MENU_NAME") + + + true + + + true + + + + + + + + LocalizeExpression(Step.TS.PostExpr) + + + ResStr("NI_SUBSTEPS", "STATEMENT_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_SUBSTEPS", "STATEMENT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + ResStr("NI_SUBSTEPS", "STATEMENT_EXPRESSION") + + + LocalizeExpression(Step.PostExpression) + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + Statement.ico + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.StatementTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CriticalFailureStackEntry' xsi:type='NI_CriticalFailureStackEntry' name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + This data type exists for symmetry with the batch and parallel models. Currently it has no fields. + + + + + + Valid values for NI models are "Sequential", "Batch", or "Parallel" + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "SC_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("NI_STEPTYPES", "SC_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_Miscellaneous + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + SeqAdp.ico + + + + + + + + + + + + + + + + + false + + + false + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + RunState.Engine.Is64Bit? -1ui64 : -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + + + + + + + + + + 8192 + %#x + + + 1 + + + + + + + + + true + + + + + + 0 + + + 0 + + + 4 + %#x + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + "%ModuleDescription" + + + ResStr("NI_STEPTYPES", "GENERIC_DEF_SUBSTEP_NAME") + + + + + + + + + false + + + + + true + + + true + + + "" + + + ResStr("NI_STEPTYPES", "GENERIC_SUBSTEP_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + GenericSubsteps + + + + + + + + DefaultLabVIEWNXG|DefaultLabVIEW|DefaultCVI|DefaultVB.NET|DefaultCSharp.NET|DefaultC++.NET|DefaultVC++_Template|DefaultHTB72_Template|DefaultHTB80_Template|Default_Template + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + false + + + + + + + + + Step.ArrayExpr == "" ? ResStr("FLOW_CONTROL_STEPS", "UNSPECIFIED") : +(Step.Description !="" ? Step.Description : +((Step.ArrayElementExpr != "" ? LocalizeExpression(Step.ArrayElementExpr) : ResStr("FLOW_CONTROL_STEPS", "ARRAYELEMENT")) + ResStr("FLOW_CONTROL_STEPS", "IN") + LocalizeExpression(Step.ArrayExpr))) + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl_Loop + + + + + + + + + + + + ID#:0fUZg4IOtkenNvECPWGh4A + + + + + + + + + + NIFlowControl.dll + + + ?OnNewStepWithEndStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:ny3+UymIz0KMmddc0LFNWB + + + + + + + + + + NIFlowControl.dll + + + ?EditForEachStep@@YAXPAUIDispatch@@@Z + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='FCParameter' structureflags='0'/> + + + + + + Return Value + + + 3 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + _notNamed + + + 4 + + + 4 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='ExprValue' structureflags='0'> + 1024 + + + + + + 1024 + + + 0 + + + ThisContext + + + + + + 0 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + ResStr("FLOW_CONTROL_STEPS", "FOREACH_EDIT_MENU_ITEM_NAME") + + + true + + + true + + + + + + + + + + + + + + + + FlowControl\NI_ForEach.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + NIStepTypeControls.dll|NationalInstruments.TestStand.StepTypeControls.NI_Flow_ForEachTabInfo + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + NI_Flow_End + + + true + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + true + + + 0 + + + + + + + false + + + + + + + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_DEF_STEP_NAME") + + + + + false + + + false + + + "" + + + ResStr("FLOW_CONTROL_STEPS", "END_INSERT_MENU_ITEM_NAME") + + + "" + + + false + + + false + + + NI_FlowControl + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ typename='NI_CustomResult' xsi:type='NI_CustomResult' name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + FlowControl\NI_End.ico + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + NI_Flow_If, NI_Flow_Else, NI_Flow_ElseIf, NI_Flow_For, NI_Flow_While, NI_Flow_DoWhile, NI_Flow_Case, NI_Flow_Select, NI_ Flow_AutoSchedule, NI_Flow_LockResource, NI_Flow_Begin + + + + + + true + + + false + + + false + + + + +
+ + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ +
+ + + + + + + + + ID#:y5IUvu+P7xG384wdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + InitializeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + partNumber + + + "pn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + serialNumber + + + "sn" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testType + + + "en" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testName + + + "power on" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + isThereHardware + + + False + + + + + + 2 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + configSubFolderName + + + "MTS" + + + + + + 1 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + testStandSeqContext + + + ThisContext + + + + + + 17 + + + + + + 64 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + ID#:9dKwOXok8BG4OIwdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + FinalizeProgram + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + openTestDataFolder + + + + + + + + + 2 + + + + + + 64 + + + true + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + true + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + The report generator result processing component calls this from its Begin sequence. Override it to modify the options. + + + + + + + true + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + false + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:itrC2MUt8BG4RYwdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Parameters.ReportOptions.GeneratePDFReport = True + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + This callback is called after ReportPath is calculated from Post UUT and Post Batch sequences. + + + + + false + + + + + + false + + + + + + + + + false + + + false + + + true + + + true + + + 2 + + + 3 + + + 100 + + + true + + + xml + + + %$.13g + + + True + + + true + + + false + + + true + + + true + + + false + + + true + + + false + + + SequenceFileDirectory + + + + + + Report + + + true + + + + + + + + + false + + + true + + + DLL + + + + + #FFFFFF + + + #32FFFF + + + #0000E0 + + + #8000CC + + + #000000 + + + #00C4C4 + + + #FF8000 + + + #ADD8E6 + + + #FF32CC + + + #000080 + + + #FF0000 + + + #FF0000 + + + #008000 + + + #B98028 + + + #008000 + + + #FFCC33 + + + #0000FF + + + #FF0000 + + + #FF0000 + + + #00FF00 + + + #FFFF00 + + + #00FFCC + + + #FFCC33 + + + #FF2020 + + + #D0D0D0 + + + #00C4C4 + + + + + TimeFirst + + + false + + + false + + + false + + + true + + + BatchReport + + + 26 + + + horizontal.xsl + + + + + + + + + + + + true + + + false + + + false + + + false + + + true + + + false + + + + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + "<ClientFileDir>\\<ClientFileName>_BatchReport[<FileTime>][<FileDate>]<Unique>.<FileExtension>" + + + false + + + + + + + + + true + + + + + + + + true + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + false + + + false + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + + + + + ID#:t/Wzj3Uv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.SourceTestReportFilePath = Parameters.ReportFilePath + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + false + + + + + 0 + + + true + + + "Unnamed Entry Point" + + + True + + + + + + false + + + false + + + true + + + false + + + true + + + false + + + false + + + false + + + true + + + 2953567917 + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a pass, fail, error, or terminated banner. Override this in client file to change or replace this action. + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + +
+ + + + Call the current model for the default functionality. We don't include the model specific steps in this sequence so the overridden callback works under all models after the user overrides it, copying its steps to their client file. + + + + + ID#:MaVP2nUv8BG4RowdltwhQC + + + SeqAdp.ico + + + + + + + + Runstate.Execution.ModelSequenceFilePath + + + DoPreUUT + + + "DoPostUUT" + + + + + + + false + + + Parameters.Result + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.UUT + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.TestSocket + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelData + + + 1 + + + 0 + + + 132 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + Parameters.ModelPluginConfiguration + + + 1 + + + 0 + + + 4 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + false + + + true + + + + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + false + + + false + + + false + + + + + + + + + true + + + false + + + + + + false + + + 0 + + + -1 + + + 0 + + + 1 + + + 0 + + + + + + False + + + + + + + + + false + + + Don't Change + + + false + + + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + (Step.Result.Status == "Done" && (Step.TS.SData.ThreadOpt == 0 || Step.TS.SData.ThreadOpt == 3)) ? "Passed" : Step.Result.Status + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:MqVP2nUv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + TestStand.ProgramManager + + + 1 + + + true + + + MoveTestStandTestReportToTestFolder + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + sourceTestReportFilePath + + + FileGlobals.SourceTestReportFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + destinationTestReportPath + + + FileGlobals.DestinationTestReportPath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + ..\..\Program\bin\Debug\net472\Program.dll + + + + + + 0 + + + TestStand.ProgramManager + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + +
+
+
+ + + Displays a dialog box in which the operator enters the UUTserial number. Override this in client file to change or replace this action. + + + + + true + + + + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + 0 + + + + + + + + + + + -1 + + + + + + + + + + + Sequential + + + + + + + + 4 + + + false + + + true + + + 0 + + + false + + + true + + + true + + + false + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + false + + + true + + + "<replace with a string expression which describes an instance of the component>" + + + false + + + true + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + false + + + true + + + 0 + + + + + 0 + + + + 0 + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + Prompt + 0 + + + + + false + + + false + + + + + 0 + + + + + + false + + + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='Obj'> + + + + + + + + + + + + + + -1.5 + + + 500 + + + + + + + + 0 + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='TEResult'/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + +
+ + +
+ + + + + + + + ID#:2HIcfqwv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + #NoValidation(SearchAndReplace(Locals.HeaderConfigFilePath=RunState.ProcessModelClient.Path,".seq","_Header.ini")) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:2XIcfqwv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 4 + + + false + + + TestInformation + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Return Value + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 6 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + title + + + "Test Information" + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + headerPath + + + Locals.HeaderConfigFilePath + + + + + + 1 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + processModelType + + + "Sequential" + + + + + + 16 + + + NI_ReportPropertyLib.ProcessModelType + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + RunDialog + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + continueTesting + + + Parameters.ContinueTesting + + + + + + 2 + + + + + + 10 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:2nIcfqwv8BG4RowdltwhQC + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetCall' structureflags='0'/> + + + + + + PreUUT.TestInformation + + + 6 + + + false + + + Use Existing Object + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + Existing Object + + + Locals.ObjRef + + + + + + 0 + + + PreUUT.TestInformation + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + PreUUT.TestInformation + + + 1 + + + false + + + GetData + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='DotNetParameter' structureflags='0'/> + + + + + + context + + + ThisContext + + + + + + 0 + + + NationalInstruments.TestStand.Interop.API.SequenceContext + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + PreUUT.dll + + + + + + 0 + + + PreUUT.TestInformation + + + false + + + + + _notNamed + + + + + + + + + 0 + + + + + + 0 + + + false + + + false + + + + + + + + + + + + + + + + 8192 + + + 1 + + + + + + + + + + 8192 + + + 1 + + + + + + + + + false + + + false + + + + + + + + + + + + + + + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:23Icfqwv8BG4RowdltwhQC + + + FlowControl\NI_ForEach.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + Parameters.UUT.AdditionalData.GetSubProperties("", PropOption_NoOptions) + + + + Locals.Header + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + + false + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:3HIcfqwv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Locals.Header.AsPropertyObject.SetFlags("", 0, PropFlags_IncludeInReport) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + WARNING: This step ensures that the standard PDEL headers are included in the test reports(ATML, PDEL, TEXT). Removing this step will remove the headers + + + + + ID#:3XIcfqwv8BG4RowdltwhQC + + + FlowControl\NI_End.ico + + + + + + DynamicLoad + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 4 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + + + + + + + true + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + 0 + + + false + + + + + + + Warning: if this step is skipped or removed in a Client Sequence PreUUT override, then ATML, and TextReport will not have the custom Headers and Footers from COI settings + + + + + ID#:3nIcfqwv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + Thread.PostUIMessageEx( UIMsg_UserMessageBase+Locals.UseCustomHeaderAndFooter, 0, "", ThisContext, True ) + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + + + + + + + ID#:LKBRhqwv8BG4RowdltwhQC + + + Statement.ico + + + + + + PreloadWhenExecuted + + + UnloadWithFile + + + Normal + + + None + + + 1 + + + true + + + false + + + false + + + + + + 0 + + + false + + + + + + 1 + + + + + + + + + 1 + + + 2 + + + 0 + + + true + + + Next + + + Next + + + + + + + + + + + + Next + + + Next + + + + + + + + + NoLooping + + + + + + + + + RunState.LoopIndex += 1 + + + RunState.LoopIndex = 0 + + + 0 + + + + + + FileGlobals.UUT = Parameters.UUT + + + + + + false + + + true + + + true + + + true + + + 0 + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + <_NAME_IN_ATTRIBUTE_ name='' classname='CustomResult'> + + + + + + + + + + + + 8192 + + + 2 + + + + + 3 + + + true + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + true + + + + + + + + + + + + + + 0 + + + + + + false + + + + + + + + + + + + + + + + +
+ + + + + + + + true + + + false + + + + + 0 + + + + + + + + + + + + false + + + false + + + true + + + true + + + false + + + true + + + true + + + 2953567917 + + + false + + + false + + + false + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + UseStepLoadOpt + + + UnloadAfterSequenceExecution + + + 0.0.0.0 + + + 1 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + diff --git a/Source/TestStand/Template/top_level_sequence_Header.ini b/Source/TestStand/Template/top_level_sequence_Header.ini new file mode 100644 index 0000000..b60cebe Binary files /dev/null and b/Source/TestStand/Template/top_level_sequence_Header.ini differ diff --git a/Source/TestStand/power_on.ini b/Source/TestStand/power_on.ini deleted file mode 100644 index 3b81706..0000000 Binary files a/Source/TestStand/power_on.ini and /dev/null differ diff --git a/Source/TestStand/power_on.seq b/Source/TestStand/power_on.seq deleted file mode 100644 index ac6efb4..0000000 Binary files a/Source/TestStand/power_on.seq and /dev/null differ diff --git a/Source/TestStand/readme.txt b/Source/TestStand/readme.txt new file mode 100644 index 0000000..3612370 --- /dev/null +++ b/Source/TestStand/readme.txt @@ -0,0 +1,14 @@ +1. DO NOT create a top-level sequence from scratch, make a copy of top_level_sequence.seq from the Template folder. + DO NOT edit GetReportFilePath, PostUUT, ReportOptions sequences unless you know what you're doing. +2. Every top-level sequence requires a *_Header.ini file +3. DO NOT create sub-sequence from scratch, make a copy of sub_sequence.seq from the Template folder +4. Sub-sequence does not require a *_Header.ini file +5. DO NOT modify the folder structure unless you know what you are doing. + Folder structure is set up for COI to display sequences for their corresponding projects. + Read COI manual to understand how it wants the folder structure to be set up for teststand sequences +6. Copy MTS_COI_Environment folder to C:\ProgramData\Raytheon\COI\ +7. If running sequences in TestStand, make sure environment path points to: + C:\ProgramData\Raytheon\COI\MTS_COI_Environment\COIEnvironment.tsenv + To set it in TestStand: Configure -> Environment + Or + run "C:\Program Files (x86)\National Instruments\TestStand 2019\Bin\SeqEdit.exe" /env "C:\ProgramData\Raytheon\COI\MTS_COI_Environment\COIEnvironment.tsenv" \ No newline at end of file diff --git a/Source/UnitTests/Common/Util.cs b/Source/UnitTests/Common/Util.cs new file mode 100644 index 0000000..080dbf5 --- /dev/null +++ b/Source/UnitTests/Common/Util.cs @@ -0,0 +1,29 @@ +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UnitTests +{ + public class Util + { + public static void LogException(Exception ex, ILogger logger) + { + string errorMsg = ex.Message; + string stackTrace = ex.StackTrace; + + Exception innerEx = ex.InnerException; + while (innerEx != null) + { + errorMsg = innerEx.Message; + stackTrace = innerEx.StackTrace + "\r\n" + stackTrace; + + innerEx = innerEx.InnerException; + } + + logger.Error(errorMsg + "\r\n" + stackTrace); + } + } +} diff --git a/Source/UnitTests/MtsUnitTest.cs b/Source/UnitTests/MtsUnitTest.cs new file mode 100644 index 0000000..55cd6ec --- /dev/null +++ b/Source/UnitTests/MtsUnitTest.cs @@ -0,0 +1,163 @@ +/*------------------------------------------------------------------------- +// UNCLASSIFIED +/*------------------------------------------------------------------------- +RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION +PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS +AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO +UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO +RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS +CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS +OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON +COMPANY. + +THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. +GOVERNMENT. + +UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. +-------------------------------------------------------------------------*/ +using System; +using System.Threading; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NLog; +using ProgramLib; + +namespace UnitTests +{ + [TestClass] + public class MtsUnitTest + { + private ILogger _logger; + + public MtsUnitTest() + { + _logger = LogManager.GetCurrentClassLogger(); + } + + [TestMethod] + public void PowerOnTest() + { + try + { + ProgramLib.Program.Instance("partNumber", "SerialNumber", "EN", "Power On Test", false, "MTS"); + ProgramLib.Program.Instance().InitializeDioMeasurementManager(); + ProgramLib.Program.Instance().InitializePowerSupplyMeasurementManager(); + ProgramLib.Program.Instance().InitializeSwitchMeasurementManager(); + ProgramLib.Program.Instance().InitializeCoeMeasurementManager(); + ProgramLib.Program.Instance().InitializeGuiManager(); + ProgramLib.Program.Instance().InitializeSupportThreads(); + + while (true) + Thread.Sleep(1000); + + int runs = 2; + int i = 0; + ProgramLib.BasicAction sttoAction = new ProgramLib.PerformSttoAction(); + sttoAction.Run(); + ProgramLib.BasicAction powerOnAction = new ProgramLib.UutPowerOnAction(); + ProgramLib.BasicAction powerOffAction = new ProgramLib.UutPowerOffAction(); + while (i++ < runs) + { + powerOnAction.Run(); + Thread.Sleep(10000); + powerOffAction.Run(); + Thread.Sleep(5000); + powerOnAction.Run(); + Thread.Sleep(10000); + powerOffAction.Run(); + Thread.Sleep(5000); + } + } + catch (Exception ex) + { + Util.LogException(ex, _logger); + } + } + + [TestMethod] + public void SendTestMessageToUut() + { + try + { + ProgramLib.Program.Instance("partNumber", "SerialNumber", "EN", "Power On Test", false, "MTS"); + ProgramLib.Program.Instance().InitializeDioMeasurementManager(); + ProgramLib.Program.Instance().InitializePowerSupplyMeasurementManager(); + ProgramLib.Program.Instance().InitializeSwitchMeasurementManager(); + ProgramLib.Program.Instance().InitializeCoeMeasurementManager(); + ProgramLib.Program.Instance().InitializeGuiManager(); + ProgramLib.Program.Instance().InitializeSupportThreads(); + + ProgramLib.Program.Instance().GuiManager[ProgramGuiManager.WINDOWS.DEFAULT].Dispatcher.Invoke((Action)delegate + { + ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.LIVE_DATA].Hide(); + ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.MSFR_TEST_CASES].ShowDialog(); + ProgramLib.Program.Instance().GuiManager[ProgramLib.ProgramGuiManager.WINDOWS.LIVE_DATA].Show(); + }); + + ProgramLib.BasicAction powerOnAction = new ProgramLib.UutPowerOnAction(); + + powerOnAction.Run(); + + ProgramLib.BasicAction connectToUutAction = new ProgramLib.UutTestPortConnectAction(); + connectToUutAction.Run(); + + Thread.Sleep(5000); + + ProgramLib.BasicAction sendMessageToUut = new ProgramLib.SendTestMessageToUutAction("MSFRParameterMsg"); + sendMessageToUut.Run(); + + } + catch (Exception ex) + { + Util.LogException(ex, _logger); + } + } + + [TestMethod] + public void PerformUartLoopBackTest() + { + try + { + ProgramLib.Program.Instance("partNumber", "SerialNumber", "EN", "Power On Test", true, "MTS"); + ProgramLib.Program.Instance().InitializeSerialDevices(); + + ProgramLib.BasicAction action = new ProgramLib.UartLoopBackAction(); + action.Run(); + } + catch (Exception ex) + { + Util.LogException(ex, _logger); + } + } + + [TestMethod] + public void SendCoeMessageToUut() + { + try + { + ProgramLib.Program.Instance("partNumber", "SerialNumber", "EN", "Power On Test", false, "MTS"); + ProgramLib.Program.Instance().InitializePowerSupplyMeasurementManager(); + ProgramLib.Program.Instance().InitializeSwitchMeasurementManager(); + ProgramLib.Program.Instance().InitializeCoeMeasurementManager(); + ProgramLib.Program.Instance().InitializeGuiManager(); + ProgramLib.Program.Instance().InitializeSupportThreads(); + + ProgramLib.BasicAction powerOnAction = new ProgramLib.UutPowerOnAction(); + + powerOnAction.Run(); + + ProgramLib.BasicAction action = new ProgramLib.SendCoeAdnucMsgToUutAction("CoeDeviceNodeTCP"); + + action.Run(); + + } + catch (Exception ex) + { + ProgramLib.BasicAction action = new ProgramLib.UutPowerOffAction(); + + action.Run(); + + Util.LogException(ex, _logger); + } + } + } +} diff --git a/Source/UnitTests/ProgramUnitTest.cs b/Source/UnitTests/ProgramUnitTest.cs deleted file mode 100644 index c50df66..0000000 --- a/Source/UnitTests/ProgramUnitTest.cs +++ /dev/null @@ -1,83 +0,0 @@ -/*------------------------------------------------------------------------- -// UNCLASSIFIED -/*------------------------------------------------------------------------- -RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION -PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS -AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO -UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO -RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS -CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS -OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON -COMPANY. - -THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. -GOVERNMENT. - -UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY. --------------------------------------------------------------------------*/ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NLog; -using System; -using System.Threading; - -namespace UnitTests -{ - [TestClass] - public class ProgramUnitTest - { - private ILogger _logger; - - public ProgramUnitTest() - { - _logger = LogManager.GetCurrentClassLogger(); - } - - [TestMethod] - public void PowerSupplyTest() - { - try - { - ProgramLib.Program.Instance("partNumber", "SerialNumber", false); - ProgramLib.Program.Instance().InitializeDioMeasurementManager(); - ProgramLib.Program.Instance().InitializePowerSupplyMeasurementManager(); - ProgramLib.Program.Instance().InitializeGuiManager(); - ProgramLib.Program.Instance().InitializeSupportThreads(); - - int runs = 2; - int i = 0; - while (i++ < runs) - { - ProgramLib.Program.Instance().UutPowerOn(); - Thread.Sleep(10000); - ProgramLib.Program.Instance().UutPowerOff(); - Thread.Sleep(5000); - ProgramLib.Program.Instance().UutPowerOn(); - Thread.Sleep(10000); - ProgramLib.Program.Instance().UutPowerOff(); - Thread.Sleep(5000); - } - } - catch (Exception ex) - { - _logger.Error(ex.Message + "\r\n" + ex.StackTrace); - } - } - - [TestMethod] - public void SttoTest() - { - try - { - ProgramLib.Program.Instance("partNumber", "SerialNumber", false); - ProgramLib.Program.Instance().InitializeSwitchMeasurementManager(); - ProgramLib.Program.Instance().InitializeGuiManager(); - - ProgramLib.Program.Instance().Perform_GMA_ATP_001_UUT_STTO(); - } - catch (Exception ex) - { - _logger.Error(ex.Message + "\r\n" + ex.StackTrace); - } - } - } -} diff --git a/Source/UnitTests/Properties/launchSettings.json b/Source/UnitTests/Properties/launchSettings.json new file mode 100644 index 0000000..57de983 --- /dev/null +++ b/Source/UnitTests/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "UnitTests": { + "commandName": "Project", + "nativeDebugging": true + } + } +} \ No newline at end of file diff --git a/Source/UnitTests/UnitTests.csproj b/Source/UnitTests/UnitTests.csproj index 85246f3..dc4bbf0 100644 --- a/Source/UnitTests/UnitTests.csproj +++ b/Source/UnitTests/UnitTests.csproj @@ -2,6 +2,7 @@ net472 + x86 8.0 true en-US @@ -29,25 +30,6 @@ 3.0.2 - - - {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52} - 2 - 8 - 0 - primary - False - True - - - {00020813-0000-0000-C000-000000000046} - 1 - 9 - 0 - primary - False - True - @@ -66,32 +48,22 @@ - - - - - + + - - - - - + + + + - - + - diff --git a/Source/readme.txt b/Source/readme.txt index e22e76b..defff38 100644 --- a/Source/readme.txt +++ b/Source/readme.txt @@ -1,24 +1,5 @@ -Issue 1: -On initial check-in or doing a new pull, Git will fail with long file name issue - -Add the following to registry (there's alreawdy a longpath.reg in the how-to folder file created so just run that): - "LongPathsEnabled"=dword:00000001 to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem - -Make sure Git for Windows is installed -Open command prompt in admin mode and run: git config --system core.longpaths true - ------------------------------------------------------------------------------------------ -Issue 2: - -If the solution folder is located in some long path, Visual Studio will not be able to extract Raytheon.Instruments.InstrumentManager.GeneralInstrumentManager.1.4.1.nupkg -to cache folder. Even if we manually move the DLL to the cache folder, Visuao Studio will not see it - -Find a location where the path is not too long and it will build. So work out of there instead - ------------------------------------------------------------------------------------------ -Issue 3: If building for the first time after doing a Git pull, it will fail because there are a few packages that need to be built first and published to the "SolutionPackages" folder since other projects that depend on packages in that folder. -So if the build fails, keep building until succeeds. Takes about 5 tries +So if the build fails, try building again until all the projects are built.