version = 4.2

//
// Saved by sw version: 2025.4
//

model "example" {
    configuration {
        hil_device = "HIL606"
        hil_configuration_id = 3
        simulation_method = exact
        simulation_time_step = auto
        simulation_discret_scaling = 1.0
        dsp_timer_periods = 100e-6, 50e-3
        ss_calc_method = "systematic elimination"
        enb_pole_shift = True
        enb_gds_oversampling = True
        show_modes = False
        device_ao_limit_enable = False
        reset_analog_outputs_on_sim_stop = True
        reset_analog_outputs_on_sim_stop_mode = Offset values
        reset_digital_outputs_on_sim_stop = True
        vhil_adio_loopback = False
        dma_enable = False
        cpl_stb = False
        enb_dep_sw_detect = False
        code_section = "internal memory"
        data_section = "internal memory"
        sys_sp_rate_1 = 0.0001
        sys_sp_rate_2 = 0.05
        sys_real_type_precision = "default"
        user_real_type_precision = "default"
        sys_cpu_optimization = "high"
        user_cpu_optimization = "high"
        user_cpu_part_option = "default"
        matrix_based_reduction = True
        cpl_dynamics_analysis = False
        export_ss_to_pickle = False
        ground_scope_core = False
        dss_num_tol = 1e-15
        cce_platform = "generic"
        cce_use_relative_names = False
        cce_type_mapping_real = "double"
        cce_type_mapping_uint = "unsigned int"
        cce_type_mapping_int = "int"
        cce_platform = "generic"
        cce_use_relative_names = False
        cce_type_mapping_real = "double"
        cce_type_mapping_uint = "unsigned int"
        cce_type_mapping_int = "int"
        cce_term_var_location = "local"
        cce_directory = ""
        cce_custom_type_int = ""
        cce_custom_type_uint = ""
        cce_custom_type_real = ""
        tunable_params = "component defined"
        sp_compiler_type = "C compiler"
        sig_stim = "off"
        export_resource_list = ""
        export_dependency_list = ""
        excluded_resource_list = ""
        excluded_component_from_locking_list = ""
        export_out_file = ""
        export_lock_top_level = True
        export_encrypt_library = True
        export_encrypt_resources = True
        solver_type = "DAE"
        integration_method = "BDF"
        max_sim_step = 1e-4
        simulation_time = 1.0
        abs_tol = 1e-3
        rel_tol = 1e-3
        init_sim_step = 1e-6
        r_on_sw = 1e-3
        v_on_diode = 0.1
        data_sampling_rate = 0
        feedthrough_validation_error_level = error
    }

    component Subsystem Root {
        component Subsystem Example {
            layout = dynamic
            component "core/ETH VE Send" "ETH VE Send1" {
                dest_ip = "192.168.20.100"
                sample_time = "1"
                signal_names_dict = ""
            }
            [
                position = 8028, 8136
                size = 72, 72
            ]

            port In1 {
                position = auto:auto
                kind = sp
                direction =  out
                sp_type {
                    default = auto
                    readonly = True
                }
            }
            [
                position = 7892, 8128
            ]

            connect In1 "ETH VE Send1.in" as Connection1

            mask {
                description = "<html><head><meta name=\"qrichtext\" content=\"1\"></meta><meta charset=\"utf-8\"></meta><style type=\"text/css\">p, li { white-space: pre-wrap; }hr { height: 1px; border-width: 0; }li.unchecked::marker { content: \"\2610\"; }li.checked::marker { content: \"\2612\"; }</style></head><body style=\"\"><p style=\"margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Edit the description</p></body></html>"

                CODE pre_compile
                    parent_name = mdl.get_fqn(mdl.get_parent(item_handle))
                    comp_handle = mdl.get_sub_level_handle(item_handle)
                    ip = a
                    EthVeSend = mdl.get_item(name="ETH VE Send1", parent=comp_handle, item_type="component")
                    
                    
                    Test = mdl.get_property_value(mdl.prop(EthVeSend, "dest_ip"))
                    mdl.info(Test)
                    
                    mdl.set_property_value(mdl.prop(EthVeSend, "dest_ip"), a)
                    
                    Test = mdl.get_property_value(mdl.prop(EthVeSend, "dest_ip"))
                    mdl.info(Test)
                ENDCODE

                CODE open
                    from typhoon.apps.schematic_editor.dialogs.component_property_dialogs.general import RegularComponentPropertiesDialog
                
                    dialog = RegularComponentPropertiesDialog(
                        component=component,
                        property_container=component.masks[-1],
                        current_diagram=current_diagram
                    )
                    dialog.exec()
                    
                ENDCODE
            }
        }
        [
            position = 8592, 8256
            size = 128, 104
        ]

        component "core/ETH VE Setup" "ETH VE Setup1" {
            eth_port = "2"
            eth_port0 = "2"
            eth_port1 = "2"
            eth_port10 = "2"
            eth_port11 = "2"
            eth_port12 = "2"
            eth_port13 = "2"
            eth_port14 = "2"
            eth_port15 = "2"
            eth_port2 = "2"
            eth_port3 = "2"
            eth_port4 = "2"
            eth_port5 = "2"
            eth_port6 = "2"
            eth_port7 = "2"
            eth_port8 = "2"
            eth_port9 = "2"
            ethernet_port_per_device = "{\'HIL100\': {}, \'HIL104\': {}, \'HIL402\': {\'0\': \'1\', \'1\': \'1\', \'2\': \'1\', \'3\': \'1\', \'4\': \'1\', \'5\': \'1\', \'6\': \'1\', \'7\': \'1\', \'8\': \'1\', \'9\': \'1\', \'10\': \'1\', \'11\': \'1\', \'12\': \'1\', \'13\': \'1\', \'14\': \'1\', \'15\': \'1\'}, \'HIL404\': {\'0\': \'2\', \'1\': \'2\', \'2\': \'2\', \'3\': \'2\', \'4\': \'2\', \'5\': \'2\', \'6\': \'2\', \'7\': \'2\', \'8\': \'2\', \'9\': \'2\', \'10\': \'2\', \'11\': \'2\', \'12\': \'2\', \'13\': \'2\', \'14\': \'2\', \'15\': \'2\'}, \'HIL602+\': {}, \'HIL603\': {}, \'HIL604\': {}, \'HIL606\': {\'0\': \'2\', \'1\': \'2\', \'2\': \'2\', \'3\': \'2\', \'4\': \'2\', \'5\': \'2\', \'6\': \'2\', \'7\': \'2\', \'8\': \'2\', \'9\': \'2\', \'10\': \'2\', \'11\': \'2\', \'12\': \'2\', \'13\': \'2\', \'14\': \'2\', \'15\': \'2\'}, \'VHIL+\': {}, \'HIL101\': {}, \'HIL506\': {}}"
            ip_addr = "192.2.10.10"
            ip_addr2 = "192.168.0.1"
            ip_addr3 = "192.168.0.1"
            ip_addr4 = "192.168.0.1"
            ip_addr5 = "192.168.0.1"
            ip_addr6 = "192.168.0.1"
            ip_addr7 = "192.168.0.1"
        }
        [
            position = 8424, 8108
        ]

        component "core/Termination" Termination1 {
        }
        [
            position = 8504, 8108
            hide_name = True
        ]

        component "core/Constant" Constant1 {
        }
        [
            position = 8384, 8256
        ]

        connect Termination1.in "ETH VE Setup1.out" as Connection54
        connect Constant1.out Example.In1 as Connection55
    }

    default {
        "core/Constant" {
            value = "1"
            signal_type = "real"
            execution_rate = "100e-6"
            _tunable = "False"
        }

        "core/ETH VE Setup" {
            eth_port = ""
            override_device_id = "False"
            device_id = "0"
            ip_addr = "192.168.0.10"
            ip_addr0 = "None"
            eth_port0 = ""
            device_id0 = "0"
            ip_addr1 = "192.168.0.2"
            eth_port1 = ""
            device_id1 = "1"
            ip_addr2 = "192.168.0.3"
            eth_port2 = ""
            device_id2 = "2"
            ip_addr3 = "192.168.0.4"
            eth_port3 = ""
            device_id3 = "3"
            ip_addr4 = "192.168.0.5"
            eth_port4 = ""
            device_id4 = "4"
            ip_addr5 = "192.168.0.6"
            eth_port5 = ""
            device_id5 = "5"
            ip_addr6 = "192.168.0.7"
            eth_port6 = ""
            device_id6 = "6"
            ip_addr7 = "192.168.0.8"
            eth_port7 = ""
            device_id7 = "7"
            ip_addr8 = "192.168.0.9"
            eth_port8 = ""
            device_id8 = "8"
            ip_addr9 = "192.168.0.10"
            eth_port9 = ""
            device_id9 = "9"
            ip_addr10 = "192.168.0.11"
            eth_port10 = ""
            device_id10 = "10"
            ip_addr11 = "192.168.0.12"
            eth_port11 = ""
            device_id11 = "11"
            ip_addr12 = "192.168.0.13"
            eth_port12 = ""
            device_id12 = "12"
            ip_addr13 = "192.168.0.14"
            eth_port13 = ""
            device_id13 = "13"
            ip_addr14 = "192.168.0.15"
            eth_port14 = ""
            device_id14 = "14"
            ip_addr15 = "192.168.0.16"
            eth_port15 = ""
            device_id15 = "15"
            subnet_mask = "255.255.255.0"
            execution_rate = "100e-6"
            hil_id = "0"
            num_of_variables = "10"
            ethernet_port_per_device = "{ \"HIL100\": {}, \"HIL101\": {}, \"HIL104\": {}, \"HIL402\": {}, \"HIL404\": {}, \"HIL506\": {}, \"HIL602+\": {}, \"HIL603\": {}, \"HIL604\": {}, \"HIL606\": {}, \"VHIL+\": {} }"
            hil_device_config = "{
                \'0\' : {
                },
                \'1\' : {
                },
                \'2\' : {
                },
                \'3\' : {
                },
                \'4\' : {
                },
                \'5\' : {
                },
                \'6\' : {
                },
                \'7\' : {
                },
                \'8\' : {
                },
                \'9\' : {
                },
                \'10\' : {
                },
                \'11\' : {
                },
                \'12\' : {
                },
                \'13\' : {
                },
                \'14\' : {
                },
                \'15\' : {
                }
            }"
        }

        "core/Termination" {
            execution_rate = "inherit"
        }

        "core/ETH VE Send" {
            hil_id = "0"
            protocol = "UDP"
            endianness = "Little Endian"
            specify_local_port = "False"
            local_send_port = "55055"
            dest_ip = "192.168.0.1"
            destination_port = "55000"
            stream_source = "New data stream"
            stream_source_id = "1000"
            append_index = "1"
            choose_stream_source = ""
            sample_time = "1e-3"
            execution_rate = "inherit"
            number_of_inputs = "1"
            configuration = "[{\'signal_name\': \'in\', \'signal_type\': \'variable\', \'signal_value\': \'From input port\', \'data_type\': \'inherit\', \'length\': \'4\', \'endianess\': \'little_endian\', \'dimension\': \'inherit\'}]"
            signal_names_dict = "{}"
            generate_configuration = "Generate configuration"
            _supported_platforms = "[\'hil\']"
        }
    }

    CODE model_init
        # Numpy module is imported as 'np'
        # Scipy module is imported as 'sp'
        # The Schematic API is imported as 'mdl'
        # To get the model file path, use 'mdl.get_model_file_path()'
        # To print information to the console, use info()
        er = 100e-6
        
        a = '192.168.2.11'
        
    ENDCODE
}
