Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further improval of controls #42

Merged
merged 47 commits into from
May 22, 2023

Commits on Mar 22, 2023

  1. Control: change is_readable/is_writable to is_writeonly/is_readonly.

    These two methods were not well-thought. While a control that has the
    read-only flag set is certainly not writeable, a control with the
    write-only flag set could still be unwriteable because of being inactive.
    
    The original intention for these two methods was to check for the flags,
    so adjust their behaviour and naming accordingly.
    otaku42 committed Mar 22, 2023
    Configuration menu
    Copy the full SHA
    000696e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b798ed8 View commit details
    Browse the repository at this point in the history
  3. Control: reimplement method is_writeable, with correct behaviour.

    Before 000696e, a control was assumed (and reported by this method) to be
    writeable when the read-only was not set. However, such a control would
    still be unwriteable when being flagged as inactive, which was not taken
    into account before.
    
    In other words, is_writeable now checks that a control can *actually* be
    written to.
    otaku42 committed Mar 22, 2023
    Configuration menu
    Copy the full SHA
    6144213 View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2023

  1. Configuration menu
    Copy the full SHA
    b8d3a15 View commit details
    Browse the repository at this point in the history
  2. Fix flake8 complaint

    otaku42 committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    88cabd5 View commit details
    Browse the repository at this point in the history
  3. Controls: add alternative constructor from_device.

    This will be used later to facilitate instantiation of a Controls object with diverse Control sub-classes.
    otaku42 committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    d5e9dde View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2023

  1. Remove stand-alone function config_name; the functionality has been m…

    …oved into a method of class Control
    otaku42 committed Mar 25, 2023
    Configuration menu
    Copy the full SHA
    f8629d9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    79fd14d View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2023

  1. Begin implementation of inheritance-based class model for controls.

    This commit covers the part up to LegacyControl, as discussed in #15.
    The upgrade path for existing code is:
    
    Use LegacyControl instead of Control for instantiations, and use either
    BaseControl or BaseSingleControl for isinstance() checks (see Controls).
    otaku42 committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    20a8cda View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dea5cbe View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2023

  1. Configuration menu
    Copy the full SHA
    5640d4e View commit details
    Browse the repository at this point in the history
  2. Add support for checking all currently defined control flags.

    is_<flag> is working for many of the flags, but is weird for stuff like
    V4L2_CTRL_FLAG_HAS_PAYLOAD or V4L2_CTRL_FLAG_UPDATE. Switching to
    is_flagged_<flag> to check if a flag is set, e.g. is_flagged_has_payload,
    is still not perfect, but better.
    otaku42 committed Apr 5, 2023
    Configuration menu
    Copy the full SHA
    2b57f1c View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2023

  1. Configuration menu
    Copy the full SHA
    2d68a2c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5580d4b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    685acc2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    99d79b3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ee38673 View commit details
    Browse the repository at this point in the history
  6. These checks need to be moved to BaseNumericControl, since BaseContro…

    …l doesn't have the attributes minimum and maximum.
    otaku42 committed Apr 7, 2023
    Configuration menu
    Copy the full SHA
    ff66c02 View commit details
    Browse the repository at this point in the history
  7. Introduce LegacyControls as backward-compatible controls 'factory', w…

    …hich is used by default.
    otaku42 committed Apr 7, 2023
    Configuration menu
    Copy the full SHA
    395f4ec View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2023

  1. Controls: introduce a ControlType to class mapping, to support instan…

    …tiation of different control class objects without a messy if/elif construct.
    otaku42 committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    877709c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ed23474 View commit details
    Browse the repository at this point in the history
  3. BaseNumericControl: make clipping of written values to minimum/maximu…

    …m optional (default: on)
    otaku42 committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    6c9532f View commit details
    Browse the repository at this point in the history
  4. BaseControl: value to be written should be converted to target type b…

    …efore trying to mangle it
    otaku42 committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    bd9dd8b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    608954e View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2023

  1. Configuration menu
    Copy the full SHA
    7e47ec0 View commit details
    Browse the repository at this point in the history
  2. Initial implementation of class MenuControl.

    This class inherits from UserDict and thus can be used like a dict to access
    the items defined for the menu. For the sake of this dict-like behaviour the
    MenuItem class is not used in MenuControl; the names of the menu items will
    be transformed straight to either string or integer, depending on the menu
    type.
    
    MenuItem is kept for now, but renamed to LegacyMenuItem to signal it should
    not be used except for legacy code.
    otaku42 committed Apr 17, 2023
    Configuration menu
    Copy the full SHA
    6e0f5f6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bbac364 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2023

  1. Configuration menu
    Copy the full SHA
    832a4a2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d2fc7ff View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9392f16 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    43c33e7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d18bf00 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    430d947 View commit details
    Browse the repository at this point in the history
  7. Update examples in README.md for new control interface.

    This will most probably be the last patch in the current series of the
    improve_controls branch for now. This series closes #15 and closes #12.
    otaku42 committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    d6aa811 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2023

  1. Configuration menu
    Copy the full SHA
    8e4ca97 View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2023

  1. Configuration menu
    Copy the full SHA
    10eadd4 View commit details
    Browse the repository at this point in the history
  2. Apply some black magic

    otaku42 committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    62bef57 View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2023

  1. Configuration menu
    Copy the full SHA
    d485978 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2023

  1. Configuration menu
    Copy the full SHA
    e910562 View commit details
    Browse the repository at this point in the history
  2. Initial "implementation" of GenericControl. Use this now instead of L…

    …egacyControl for control types not found in ctrl_type_map.
    otaku42 committed Apr 29, 2023
    Configuration menu
    Copy the full SHA
    22c17d9 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2023

  1. Reduce BaseControl to the bare minimum of control features, and move

    the rest to the new derived class BaseMonoControl. The latter is more
    or less a reprise of BaseSingleControl, which had been removed in
    5640d4e. It's similar but not identical, and used to prepare for the
    upcoming ButtonControl.
    otaku42 committed May 2, 2023
    Configuration menu
    Copy the full SHA
    654e47d View commit details
    Browse the repository at this point in the history
  2. Initial implementation of ButtonControl. Not yet tested, since I have

    no real device that provides a button control and trying vivid did
    not work (see #17).
    otaku42 committed May 2, 2023
    Configuration menu
    Copy the full SHA
    da53ed6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a9d5f3a View commit details
    Browse the repository at this point in the history

Commits on May 15, 2023

  1. Configuration menu
    Copy the full SHA
    93fc9b3 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2023

  1. Configuration menu
    Copy the full SHA
    67a6e3b View commit details
    Browse the repository at this point in the history
  2. Update installation instructions for extra dependencies: OpenCV package

    is named opencv-python; call pip as module, as suggested in the pip
    manual. Closes #22.
    otaku42 committed May 19, 2023
    Configuration menu
    Copy the full SHA
    398f9b3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a98df12 View commit details
    Browse the repository at this point in the history