zarfld / LinuxCnc_PokeysLibComp

Pokeys comp for LinuxCnc using https://bitbucket.org/mbosnak/pokeyslib.git
MIT License
5 stars 0 forks source link

Feature: UI Setup for Converting Existing LinuxCNC Configurations to PoKeys Devices #95

Open zarfld opened 6 hours ago

zarfld commented 6 hours ago

Feature: UI Setup for Converting Existing LinuxCNC Configurations to PoKeys Devices

Description:

This feature introduces a user-friendly UI Setup Tool that allows users to convert their existing LinuxCNC configurations to work with PoKeys devices. The setup tool connects directly to the PoKeys device, detecting its capabilities and pin assignments in real-time to present only relevant options to the user.

The tool ensures that users can only select options supported by the connected PoKeys device. For example, if a kbd48CNC module is not connected or if there are dedicated pins for specific subfunctions in PoKeys57CNC, the tool will recognize this and adjust the available settings accordingly.

Additionally, the tool supports the PoExtBusOC16CNC module in combination with PoKeys57E, enabling the PoKeys57E device to utilize the Pulse Engine. The setup tool will detect this configuration and provide options accordingly.

Key Features:

  1. Device Detection and Capabilities Check:

    • The UI setup tool connects to the PoKeys device upon launch and retrieves its capabilities, including available I/O pins, supported features (e.g., kbd48CNC, PoExtBusOC16CNC, PWM), and connected modules.
    • Supports manual and automatic detection of PoKeys devices over USB or network interfaces.
    • Only hardware options present on the PoKeys device are selectable.
  2. Pinout and Configuration Based on Device Type:

    • Depending on the detected PoKeys model (e.g., PoKeys57CNC, PoKeys57E with PoExtBusOC16CNC), the UI loads predefined configurations for pinouts and device-specific features.
    • For PoKeys57E connected with PoExtBusOC16CNC, the tool enables Pulse Engine configurations, allowing for motion control and stepper motor setup.
    • The UI ensures that only features supported by the connected device and modules are available for configuration.
  3. Modular Support Based on Detected Capabilities:

    • If modules like kbd48CNC, PoExtBusOC16, or PoExtBusOC16CNC are not detected, the corresponding setup options are hidden or disabled.
    • The tool dynamically enables support for features like analog I/O, digital I/O, counters, PWM, and PoNET devices based on the detected hardware.
  4. Configurable Options Based on User Selection:

    • Allows users to map I/O pins, configure stepper motors, and enable relevant features (e.g., homing, limit switches) according to the device's capabilities.
    • Guides users to set up configurations properly, preventing selection of unsupported options and avoiding configuration errors.
    • Scans and converts existing LinuxCNC HAL and INI configurations to match the PoKeys device hardware layout, including the integration of PoExtBusOC16CNC for motion control.
  5. Real-Time Feedback and Validation:

    • Validates configurations as users make changes, ensuring no conflicts between the existing LinuxCNC settings and the detected PoKeys hardware.
    • Notifies users if the selected configuration is valid or if adjustments are needed (e.g., incompatible pin assignments).
  6. Seamless Integration with LinuxCNC:

    • Generates HAL and INI files compatible with LinuxCNC's configuration structure, simplifying the integration of PoKeys devices into existing or new LinuxCNC setups.
    • Pre-configures custom homing, digital I/O, counters, PWM, and other PoKeys features in the generated HAL file.
    • Supports motion control configurations when PoKeys57E is used with PoExtBusOC16CNC, enabling the Pulse Engine functionality in LinuxCNC.

User Flow:

  1. Connect the PoKeys device (USB/Network) and launch the UI setup tool.
  2. The tool detects the PoKeys device and any connected modules (e.g., PoExtBusOC16CNC), retrieving their capabilities and displaying relevant options.
  3. Users can load existing LinuxCNC configurations or start a new configuration.
  4. Based on the detected device type and connected modules:
    • For PoKeys57E with PoExtBusOC16CNC, the UI presents options for configuring the Pulse Engine, stepper motors, and motion control features.
    • For other devices or configurations, appropriate options are displayed.
  5. Select options based on available hardware features, such as configuring axes, I/O pins, and enabling peripherals.
  6. Validate the configuration with real-time feedback, ensuring compatibility with the hardware capabilities.
  7. Generate and export the LinuxCNC HAL and INI configuration files for use in LinuxCNC.

References for Pinouts and Hardware Capabilities:

Acceptance Criteria: