# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

Add all new changes to [Unreleased] version. The CHANGELOG will be updated when
packaging a new release using the version defined in setup.py.

## [Unreleased]

## [1.31.3]

### Changed
- The `requires-python` in pyproject.toml updated to allow Python 3.13.
- Improved code style and formatting in several files for better readability and maintainability.
- Updated docstrings and argument types for configuration IDs to accept both int and str in Device Manager and HIL APIs.
- Updated Schematic Editor API docstrings to clarify return types and argument types (e.g., configuration_id as str).

### Added
- Added `SchApiInvalidDeviceConfigurationException` to Schematic Editor API exceptions.
- Added hil_configuration_only argument to get_hw_property in Schematic Editor API for filtering by HIL device configuration.
- Added error handling for XML parsing in parse_scl_file in IEC 61869 SV API.
- Added support for hexadecimal VLAN IDs in IEC 61869 SV API.

### Fixed
- Fixed VLAN ID parsing in IEC 61869 SV API to handle hexadecimal values.
- Fixed docstring and parameter inconsistencies in Schematic Editor and HIL APIs.


## [1.31.2]

### Added
- Schematic Editor API: Added `create_schematic_area` function for creating schematic areas, with support for title, position, font, color, and parent subsystem.
- Schematic Editor API: Added `set_background_color` function for setting background color in component masks.

### Changed
- Updated numpy dependency for Python >=3.11 to version 2.2 instead of fix 2.2.3.
- Schematic Editor API: Improved handling of model dependencies and conditional compilation.

### Fixed
- IEC 61869 SV API: Improved parsing and error handling.
- Schematic Editor API: Fixed duplicate/legacy model dependency methods.

### Deprecation
- Python 3.9 version support

## [1.31.1]

### Added
- Added `set_configuration_from_file` API function to `typhoon.api.iec_61869.sv_utils.py`

### Changed
- Improved parameter documentation in HIL API's `set_source_sine_waveform` function to clarify `ramp_time` is float

### Removed
- Configuration Manager API was removed after deprecation.
- Removed deprecated Schematic Editor API function `export_c_from_selection`

### Deprecation
- Configuration manager API is deprecated and will be removed in next software release (2025.4)
- Updated Package Manager API exception handling with detailed error codes and messages

## [1.30.1]

### Added
- Schematic Editor API function `replace_component`: Replaces a component in the schematic with a component of the provided type name.
- New IEC 61869 SV API modules: `typhoon.api.iec_61869` package, including `exceptions.py` and `sv_utils.py`.
- Support for macOS (`Darwin`) in utility functions (`os_compat_guard`, `get_user_folder_path`).

### Removed
- Removed deprecated Schematic Editor API function `export_c_from_selection`.

## [1.30.0]

### Added
- Example script `bypass_component.example` demonstrating the use of the `bypass_component` and `is_bypassed` functions in the `SchematicAPI`.
  
- New utility functions `serialize_data_frame` and `deserialize_data_frame` for efficient serialization and deserialization of pandas DataFrames using Feather format with compression.
- New methods in `SchematicAPI`:
  - `bypass_component`: Disables a component and bypasses its terminals if their number matches on opposite sides.
  - `is_bypassed`: Checks if a component is bypassed.

### Changes
- Updated `pyproject.toml` dependencies:
  - Added `pyarrow` for pandas Feather file support.
  - Updated `textx`, `numpy`, and `pandas` dependencies for compatibility with Python 3.11.
- Modified `serialize_obj` in `common/__init__.py` to use the new `serialize_data_frame` function for pandas DataFrame serialization.
- Updated `ClientAPIStub` in `schematic_editor/stub.py` to use `deserialize_data_frame` for handling serialized DataFrames.
- Schematic Editor API: A signal processing tag created with the `create_tag()` method
  will have the direction DIRECTION_IN if no value is passed for the direction parameter.


### Deprecated
- Marked the `ConfigurationManagerAPI` and its functions as deprecated with warnings added for future removal.

### Fixed
- Corrected documentation formatting in `get_device_features` to improve clarity and consistency.

## [1.29.1]
    - No changed add into this version

## [1.29.0]
### Changes
    - Configuration manager API is now marked as deprecated (pending for removal in
      some of the future versions of Typhoon HIL Control Center).
### Added
    - New ConfigurationAPI added with functions:
        - 'get'
        - 'set'
        - 'reset'
        - 'subscribe'
        - 'unsubscribe'

## [1.28.0]
### Changes
    - Dependecies updated: numpy, pandas
    - Remain Python 2 code removed
    - lru_cache from functools was replaced by the previous function cache function, due to Python 3.8/3.9 compatibility issues.
    - Ruff fixes
    - Documentation and example updates

### Added
    - Method `__getattr__` on DeviceManagerAPI class
    - Attributes on `SchematicAPI.create_property` method:
        - `supported`,
        - `ignored`,
        - `allowed_values`,
        - `context_typhoonsim`, and
        - `context_real_time`.
    - Constants on schematic_editor/const.py: CONTEXT_REAL_TIME, and CONTEXT_TYPHOONSIM

## [1.27.0]
### Changed
    - Installation, and build process uses pyproject.toml. Build package is needed for packaging for now on.
    - Version function now gets version from package metadata

### Added
    - New function: create_c_library
    - Added option to select time format that will be returned by the ``start_capture()`` function.
    By default ``relative`` time is returned and new ``absolute`` time can be selected from now one
    by setting the new ``timeFormat`` function argument.

## [1.26.0]
### Changed
    - Moved component size and terminal position calculation out of ComponentView class
    - Item type checking with _perform_valid_object_check
    - Slight modifications on existing functions:
        get_size
        get_position
        set_position

### Added
    - New functions:
        get_rotation
        set_rotation
        get_flip
        set_flip
        get_calculated_terminal_position
        get_item_visual_properties
        set_item_visual_properties

## [1.25.0]
### Added
    - Offline Simulator code

### Changed
    - Documentation and examples updated
    - Requirements updated for Python 3.11 support
    - `ClientStub`, `DeviceManagerAPI` and `TCPModbusClient` classes updated

## [1.24.0]
### Fixed
    - Source code review by "ruff check"

### Changed
    - Documentation configurations updated
    - PackageManagerAPI Class parameters for create_package method

### Removed
    - Python 2 code compatibility

## [1.23.1]
### Added:
    - Function sync_firmware, which syncs (updates or downgrades) the firmware of the selected devices with the
    running version of the software.

### Changed:
    - get_device_feature function - feature browsing will now work in a key-insensitive manner.
    Some of the device features have changed names, see the table in the function documentation.
    Search by old names will not work.

## [1.23.0]
### Added:
    - Package Manager API, documentation and examples
    - Parameter exclude_from_encryption  to export_library function from Schematic Editor API

### Changed:
    - Documentation for Device and Firmware Manager API

## [1.22.0]
### Changed:
    - Minor changes on internal API functionality

## [1.21.0]
### Added:
    - precompile_fmu example on documentation
    - Schematic API new functions: (_generate_model_name, fqn, set_property_value_type, precompile_fmu)

### Fixed:
    - Capture/Scope documentation
    - Windows MODBUS small fix

### Changed:
    - Configuration Manager API

### Deprecated
    - base.py file from Schematic Editor API

## [1.20.0]
### Fixed:
    - Requirements upgraded
    - CHANGELOG in the correct template

## [1.19.0]
### Changed:
    - Dependencies with some version increased for Python 3.10

### Added:
    - Support for COMTRADE (.cff) and ASAMMDF (.mf4) files for start_capture() function

## [1.18.0]
### Added:
    - Schematic API new functions: get_handler_code

### Changed:
    - create_component function - Added size parameter.

## [1.16.0]
### Added:
    - SCADA API new functions:
        - create_new_library_panel()
        - load_library_panel()
        - add_library_path()
        - get_library_path()
        - remove_library_path()
        - reload_libraries()
    - SCADA API new properties:
	    - PROP_MODEL_COMP_TYPES
		- PROP_MODEL_COMP
### Changed:
    - SCADA API create_widget: Added support for creating new Library Widgets
    - SCADA API create_widget: New argument 'link_to_model_comp'

## [1.15.0]
### Added:
    - Schematic API new functions:
        - set_model_dependencies()
        - get_model_dependencies()
### Changed:
    - compile() - Added conditional_compile bool parameter that's used
    for compilation skipping in case of model being unchanged since
    last successful compilation.

### Removed:
   - Test Executor API.

## [1.14.0]
### Added:
    - Schematic API new functions:
        - set_property_values()
        - get_property_values()
### Changed:
    - get_item() raises SchApiException instead of returning None
    when elements from locked component are aquired.
    - get_items(), the same as above, with difference that exception
    is raised instead of returning empty list ([]).
    - add_library_path and remove_library_path got persist parameter,
    which indicate if changes to library path will be permanent
    after function call.

## [1.13.0]
### Added:
    - SCADA API new properties:
        - PROP_FQN (Read-only property)
        - PROP_USE_LABEL
        - PROP_LABEL
        - PROP_SUB_PANEL_MODE
    - SCADA API new function: get_widget_by_fqn()

    - Schematic API new functions:
        - show_name()
        - hide_name()
        - set_tunable()
        - is_tunable()
        - is_name_visible()
        - get_mask()
        - get_size()
        - set_size()

   - HIL API new functions: get_num_of_connected_hils()

## [1.12.0]
### Added:
    - Schematic API new functions:
        - create_library_model()
        - enable_items()
        - disable_items()
        - is_enabled()

## [1.11.0]
### Added:
    - HIL API new functions:
        - model_write()
        - model_read()
        - get_model_variables()

    - Firmware Manager API new functions: get_hil_info()
    - Schematic API new function: get_model_information().

## [1.10.2]
### Added:
    - HIL API: Support for reading of the PSU flag status on get_flag_status()

## [1.10.1]
### Fixed
    - Documentation: Added missing function descriptions in
    configuration manager section.

## [1.10.0]
### Added
    - Configuration manager API.
    - Schematic API new functions:
        - get_breakpoints()
        - get_comment_text(): Internal error code provided in case of exceptions
    - HIL API new functions: check_hil_hwid()

## [1.9.0]
### Added:
    - HIL API new functions: read_streaming_signals()
    - SCADA API new functions: execute_action()

### Changed:
    - HIL API: set_pv_amb_params(): Added ramping support for PV ambiental parameter changes
    - HIL API: set_pv_amb_params(): Added support for the new PV model type: Normalized IV

    - PV Generator API: Added support for the new PV model type: Normalized IV

## [1.8.0]
### Added:
    - HIL API new functions:
        - get_model_file_path()
        - read_streaming_signals()

    - SCADA API new functions: execute_action()
    - SCADA API properties: Sub-Panel Widget: PROP_USE_IMAGE

### Changed
    - Schematic API: add/remove_library_path functions now properly handling relative paths

## [1.7.0]
### Added:
    - SCADA API new functions:
        - create_widget()
        - delete_widget()
        - copy()
        - create_new_panel()

    - HIL API new functions: is_simulation_running()

### Fixed:
    - Schematic API: bug for functions where bool is returned instead of None

### Deprecated:
    - Backward incompatible changes: in create_property(), parameter
    button_label had no effect, and it's removed.

## [1.6.0]
### Added:
    - SCADA API first implementation

    - Schematic API new functions:
        - get_connectable_direction()
        - get_connectable_kind()

    - HIL API new functions:
          - set_machine_encoder_offset(): Replaces set_machine_inc_encoder_offset()
          - set_machine_resolver_offset(): Replaces set_machine_sin_encoder_offset()

### Deprecated:
    - HIL API functions:
        - set_machine_inc_encoder_offset()
        - set_machine_sin_encoder_offset()

## [1.5.0]
### Added:
    - Schematic API new functions:
        - set_model_init_code()
        - unlink_component()
        - get_available_library_components()
        - get_library_resource_dir_path()
        - export_c_from_subsystem()
        - export_c_from_selection()

    - HIL API new functions:
        - reboot_hil()
        - upload_standalone_model()
        - set_boot_configuration()

## [1.4.0]
### Added:
    - Schematic API new functions:
        - add_library_path()
        - remove_library_path()
        - reload_libraries()

    - PV Generator API: 'User defined' technology parameters to EN50530 PV panel type.

## [1.3.0]
### Added:
    - Firmware Manager API
    - Schematic API new functions:
        - create_mask()
        - remove_mask()
        - set_description()
        - get_description()
        - set_icon_drawing_commands()
        - get_icon_drawing_commands()
        - set_handler_code()
        - create_property()
        - remove_property()
        - get_compiled_model_file()
        - get_sub_level_handle()

### Deprecated:
    - Backward incompatible changes:
        - prop() - first parameter is now called 'item_handle' instead of 'component'.
        - disp_component_icon_text - comp_handle parameter name is changed to item_handle.
        - refresh_icon - comp_handle parameter name is changed to item_handle.
        - set_color - comp_handle parameter name is changed to item_handle.
        - set_component_icon_image - comp_handle parameter name is changed to item_handle.

## [1.2.0]
### Added:
    - Schematic API new functions:
        - set_port_properties()
        - get_model_file_path()

    - HIL API new functions:
        - add_data_logger()
        - remove_data_logger()
        - start_data_logger()
        - stop_data_logger()
        - get_data_logger_status()
        - get_streaming_analog_signals()
        - get_streaming_digital_signals()

### Changed:
    - Updated API documentations.

    - HIL API: Added vector support for the following functions:
        - set_source_scaling()
		- set_source_sine_waveform()
		- prepare_source_sine_waveform()
		- set_source_constant_value()
		- prepare_source_constant_value()
		- set_source_arbitrary_waveform()
		- prepare_source_arbitrary_waveform()

    -  HIL API: Added ramping support for the following functions:
        - set_source_scaling()
        - set_source_sine_waveform()
        - set_source_constant_value()

### Fixed:
        - Minor bug fixes.

## [1.1.4]
### Fixed:
    - typhoon_hil.exe locking log files when using RotatingFileHandler from logging module.

## [1.1.3]
### Fixed:
    - Minor bug fixes.

## [1.1.2]
### Fixed:
    - HIL API: capture data endianness issue.

## [1.1.1]
### Fixed
    - Minor bug fixes.

## [1.1.0]
### Added:
    - Schematic API new functions: get_component_type_name()
    - HIL API new functions:
        - enable_ao_limiting()
        - disable_ao_limiting()

    - typhoon.api module __version__ attribute.

### Depreacated:
    - Functions Deprecated:
        - available_sources()
        - available_pvs()
        - available_analog_signals()
        - available_digital_signals()
        - available_contactors()
        - available_machines()
        - available_pe_switching_blocks()

### Changed:
    - Updated API documentations.

### Fixed:
    - RPC debugs logs won't propagate to higher-level handlers (e.g. root) anymore.

## [1.0.2]
#### Fixed:
    - Bugfix release.

## [1.0.1]
### Changed:
    - Updated documentation.

## [1.0.0]
### Added:
    - Initial release.
