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

FEATURE: close bitmask window when out-of-focus #116

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ After installing it you must also:

## MS Windows Installation

Download the [latest MethodicConfiguratorSetup-x.x.x.exe installer file](https://github.com/ArduPilot/MethodicConfigurator/releases/tag/latest).
Download the [latest ardupilot_methodic_configurator_setup_x.x.x.exe installer file](https://github.com/ArduPilot/MethodicConfigurator/releases/latest).

Do the steps highlighted in red.

Expand Down Expand Up @@ -82,13 +82,7 @@ ardupilot_methodic_configurator

## MacOS Installation

Install [git](https://git-scm.com/) and [python](https://www.python.org/downloads/). Then execute the command lines:

```bash
git clone https://github.com/ArduPilot/MethodicConfigurator.git
cd MethodicConfigurator
./install_macos.sh
```
Follow the linux installation instructions above.

## Install *Mission Planner* software on a PC or Mac

Expand Down
12 changes: 6 additions & 6 deletions TUNING_GUIDE_ArduCopter.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ Your vehicle will be different as your application will have different requireme

To configure and operate your vehicle you need at least these software:

- [Install ArduPilot Methodic Configurator](README.md#install-ardupilot-methodic-configurator-software-on-a-pc-or-mac)
- [Install Mission Planner](README.md#3-install-mission-planner-software-on-a-pc-or-mac)
- [Install ArduPilot](README.md#4-install-ardupilot-firmware-on-the-flight-controller)
- [Install ArduPilot Methodic Configurator](INSTALL.md)
- [Install Mission Planner](INSTALL.md#install-mission-planner-software-on-a-pc-or-mac)
- [Install ArduPilot](INSTALL.md#install-ardupilot-firmware-on-the-flight-controller)

Use Mission Planner to flash the latest stable [ArduCopter](https://firmware.ardupilot.org/Copter/stable/), [ArduPlane](https://firmware.ardupilot.org/Plane/stable/), [ArduRover](https://firmware.ardupilot.org/Rover/stable/), [ArduSub](https://firmware.ardupilot.org/Sub/stable/) or [ArduBlimp](https://firmware.ardupilot.org/Blimp/latest/) firmware for your flight controller.

Expand All @@ -108,7 +108,7 @@ The table bellow summarizes the software used in this guide. Download and instal
|:----|:----|:----|
| [Mission Planner](https://firmware.ardupilot.org/Tools/MissionPlanner/MissionPlanner-latest.msi) | latest beta | Ground control station (PC software) used for configuring and operating the vehicle |
| [ArduPilot Methodic Configurator](https://github.com/ArduPilot/MethodicConfigurator) | latest | A clear ArduPilot configuration sequence |
| [ArduCopter](https://firmware.ardupilot.org/Copter/stable/) | 4.4.4 or 4.5.5 | Flight controller firmware |
| [ArduCopter](https://firmware.ardupilot.org/Copter/stable/) | 4.4.4 or 4.5.7 | Flight controller firmware |
| [BLHeliSuite32](https://www.mediafire.com/file/fj1p9qlbzo5bl5g/BLHeliSuite32_32.9.0.6.zip/file) | 32.9.06 | PC software to flash and configure ESCs with BLHeli_32 ARM firmware |
| [BLHeli_32 ARM](https://github.com/bitdump/BLHeli/tree/master/BLHeli_32%20ARM) | 32.8 | ESC firmware with Bidir Dshot support |
| [EdgeTx companion](https://edgetx.org/getedgetx/) | 2.9.2 | PC software for configuring and updating EdgeTX based RC transmitters |
Expand All @@ -132,7 +132,7 @@ The table bellow summarizes the software used in this guide. Download and instal
The ArduPilot Methodic Configurator needs to know which components you used/plan to use and how you connected/plan to connect them to the flight controller (autopilot).
It uses this information to automatically pre-select configuration settings relevant to your specific vehicle.

So, [start the ArduPilot Methodic Configurator and input select a vehicle that resembles yours](README.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) and input vehicle components and component connections information into the ArduPilot Methodic Configurator *component editor window*:
So, [start the ArduPilot Methodic Configurator and select a vehicle that resembles yours](USECASES.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) and input vehicle components and component connections information into the ArduPilot Methodic Configurator *component editor window*:

1. Close Mission Planner, if it is open on the PC.
1. Connect the flight controller to the PC via a USB cable and wait 7 seconds.
Expand All @@ -157,7 +157,7 @@ That is harder to do once the autopilot is assembled inside the vehicle, hence i

## 4.1 Setup IMU temperature calibration

1. [Start the software](README.md#6-configure-the-vehicles-parameters-in-a-traceable-way)
1. [Start the software](USECASES.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) if not already running.
1. On *ArduPilot Methodic Configurator* select `02_imu_temperature_calibration_setup.param` on the *Current intermediate parameter file:* Combobox if not already selected.
1. Read the *Forum Blog:* and *Wiki:* documentation by pressing on the blue URL links.
1. Edit the `02_imu_temperature_calibration_setup.param` parameters' `New Value` and `Change Reason` using the *ArduPilot Methodic Configurator* parameter editor and press `Upload selected params to FC, and advance to next file`.
Expand Down
12 changes: 6 additions & 6 deletions TUNING_GUIDE_ArduPlane.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ Your vehicle will be different as your application will have different requireme

To configure and operate your vehicle you need at least these software:

- [Install ArduPilot Methodic Configurator](README.md#install-ardupilot-methodic-configurator-software-on-a-pc-or-mac)
- [Install Mission Planner](README.md#3-install-mission-planner-software-on-a-pc-or-mac)
- [Install ArduPilot](README.md#4-install-ardupilot-firmware-on-the-flight-controller)
- [Install ArduPilot Methodic Configurator](INSTALL.md)
- [Install Mission Planner](INSTALL.md#install-mission-planner-software-on-a-pc-or-mac)
- [Install ArduPilot](INSTALL.md#install-ardupilot-firmware-on-the-flight-controller)

Use Mission Planner to flash the latest stable [ArduCopter](https://firmware.ardupilot.org/Copter/stable/), [ArduPlane](https://firmware.ardupilot.org/Plane/stable/), [ArduRover](https://firmware.ardupilot.org/Rover/stable/), [ArduSub](https://firmware.ardupilot.org/Sub/stable/) or [ArduBlimp](https://firmware.ardupilot.org/Blimp/latest/) firmware for your flight controller.

Expand All @@ -108,7 +108,7 @@ The table bellow summarizes the software used in this guide. Download and instal
|:----|:----|:----|
| [Mission Planner](https://firmware.ardupilot.org/Tools/MissionPlanner/MissionPlanner-latest.msi) | latest beta | Ground control station (PC software) used for configuring and operating the vehicle |
| [ArduPilot Methodic Configurator](https://github.com/ArduPilot/MethodicConfigurator) | latest | A clear ArduPilot configuration sequence |
| [ArduCopter](https://firmware.ardupilot.org/Copter/stable/) | 4.4.4 or 4.5.5 | Flight controller firmware |
| [ArduCopter](https://firmware.ardupilot.org/Copter/stable/) | 4.4.4 or 4.5.7 | Flight controller firmware |
| [BLHeliSuite32](https://www.mediafire.com/file/fj1p9qlbzo5bl5g/BLHeliSuite32_32.9.0.6.zip/file) | 32.9.06 | PC software to flash and configure ESCs with BLHeli_32 ARM firmware |
| [BLHeli_32 ARM](https://github.com/bitdump/BLHeli/tree/master/BLHeli_32%20ARM) | 32.8 | ESC firmware with Bidir Dshot support |
| [EdgeTx companion](https://edgetx.org/getedgetx/) | 2.9.2 | PC software for configuring and updating EdgeTX based RC transmitters |
Expand All @@ -132,7 +132,7 @@ The table bellow summarizes the software used in this guide. Download and instal
The ArduPilot Methodic Configurator needs to know which components you used/plan to use and how you connected/plan to connect them to the flight controller (autopilot).
It uses this information to automatically pre-select configuration settings relevant to your specific vehicle.

So, [start the ArduPilot Methodic Configurator and input select a vehicle that resembles yours](README.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) and input vehicle components and component connections information into the ArduPilot Methodic Configurator *component editor window*:
So, [start the ArduPilot Methodic Configurator and select a vehicle that resembles yours](USECASES.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) and input vehicle components and component connections information into the ArduPilot Methodic Configurator *component editor window*:

1. Close Mission Planner, if it is open on the PC.
1. Connect the flight controller to the PC via a USB cable and wait 7 seconds.
Expand All @@ -157,7 +157,7 @@ That is harder to do once the autopilot is assembled inside the vehicle, hence i

## 4.1 Setup IMU temperature calibration

1. [Start the software](README.md#6-configure-the-vehicles-parameters-in-a-traceable-way)
1. [Start the software](USECASES.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) if not already running.
1. On *ArduPilot Methodic Configurator* select `02_imu_temperature_calibration_setup.param` on the *Current intermediate parameter file:* Combobox if not already selected.
1. Read the *Forum Blog:* and *Wiki:* documentation by pressing on the blue URL links.
1. Edit the `02_imu_temperature_calibration_setup.param` parameters' `New Value` and `Change Reason` using the *ArduPilot Methodic Configurator* parameter editor and press `Upload selected params to FC, and advance to next file`.
Expand Down
12 changes: 6 additions & 6 deletions TUNING_GUIDE_Heli.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ Your vehicle will be different as your application will have different requireme

To configure and operate your vehicle you need at least these software:

- [Install ArduPilot Methodic Configurator](README.md#install-ardupilot-methodic-configurator-software-on-a-pc-or-mac)
- [Install Mission Planner](README.md#3-install-mission-planner-software-on-a-pc-or-mac)
- [Install ArduPilot](README.md#4-install-ardupilot-firmware-on-the-flight-controller)
- [Install ArduPilot Methodic Configurator](INSTALL.md)
- [Install Mission Planner](INSTALL.md#install-mission-planner-software-on-a-pc-or-mac)
- [Install ArduPilot](INSTALL.md#install-ardupilot-firmware-on-the-flight-controller)

Use Mission Planner to flash the latest stable [ArduCopter](https://firmware.ardupilot.org/Copter/stable/), [ArduPlane](https://firmware.ardupilot.org/Plane/stable/), [ArduRover](https://firmware.ardupilot.org/Rover/stable/), [ArduSub](https://firmware.ardupilot.org/Sub/stable/) or [ArduBlimp](https://firmware.ardupilot.org/Blimp/latest/) firmware for your flight controller.

Expand All @@ -107,7 +107,7 @@ The table bellow summarizes the software used in this guide. Download and instal
|:----|:----|:----|
| [Mission Planner](https://firmware.ardupilot.org/Tools/MissionPlanner/MissionPlanner-latest.msi) | latest beta | Ground control station (PC software) used for configuring and operating the vehicle |
| [ArduPilot Methodic Configurator](https://github.com/ArduPilot/MethodicConfigurator) | latest | A clear ArduPilot configuration sequence |
| [ArduCopter](https://firmware.ardupilot.org/Copter/stable/) | 4.4.4 or 4.5.5 | Flight controller firmware |
| [ArduCopter](https://firmware.ardupilot.org/Copter/stable/) | 4.4.4 or 4.5.7 | Flight controller firmware |
| [BLHeliSuite32](https://www.mediafire.com/file/fj1p9qlbzo5bl5g/BLHeliSuite32_32.9.0.6.zip/file) | 32.9.06 | PC software to flash and configure ESCs with BLHeli_32 ARM firmware |
| [BLHeli_32 ARM](https://github.com/bitdump/BLHeli/tree/master/BLHeli_32%20ARM) | 32.8 | ESC firmware with Bidir Dshot support |
| [EdgeTx companion](https://edgetx.org/getedgetx/) | 2.9.2 | PC software for configuring and updating EdgeTX based RC transmitters |
Expand All @@ -131,7 +131,7 @@ The table bellow summarizes the software used in this guide. Download and instal
The ArduPilot Methodic Configurator needs to know which components you used/plan to use and how you connected/plan to connect them to the flight controller (autopilot).
It uses this information to automatically pre-select configuration settings relevant to your specific vehicle.

So, [start the ArduPilot Methodic Configurator and input select a vehicle that resembles yours](README.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) and input vehicle components and component connections information into the ArduPilot Methodic Configurator *component editor window*:
So, [start the ArduPilot Methodic Configurator and select a vehicle that resembles yours](USECASES.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) and input vehicle components and component connections information into the ArduPilot Methodic Configurator *component editor window*:

1. Close Mission Planner, if it is open on the PC.
1. Connect the flight controller to the PC via a USB cable and wait 7 seconds.
Expand All @@ -156,7 +156,7 @@ That is harder to do once the autopilot is assembled inside the vehicle, hence i

## 4.1 Setup IMU temperature calibration

1. [Start the software](README.md#6-configure-the-vehicles-parameters-in-a-traceable-way)
1. [Start the software](USECASES.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) if not already running.
1. On *ArduPilot Methodic Configurator* select `02_imu_temperature_calibration_setup.param` on the *Current intermediate parameter file:* Combobox if not already selected.
1. Read the *Forum Blog:* and *Wiki:* documentation by pressing on the blue URL links.
1. Edit the `02_imu_temperature_calibration_setup.param` parameters' `New Value` and `Change Reason` using the *ArduPilot Methodic Configurator* parameter editor and press `Upload selected params to FC, and advance to next file`.
Expand Down
12 changes: 6 additions & 6 deletions TUNING_GUIDE_Rover.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ Your vehicle will be different as your application will have different requireme

To configure and operate your vehicle you need at least these software:

- [Install ArduPilot Methodic Configurator](README.md#install-ardupilot-methodic-configurator-software-on-a-pc-or-mac)
- [Install Mission Planner](README.md#3-install-mission-planner-software-on-a-pc-or-mac)
- [Install ArduPilot](README.md#4-install-ardupilot-firmware-on-the-flight-controller)
- [Install ArduPilot Methodic Configurator](INSTALL.md)
- [Install Mission Planner](INSTALL.md#install-mission-planner-software-on-a-pc-or-mac)
- [Install ArduPilot](INSTALL.md#install-ardupilot-firmware-on-the-flight-controller)

Use Mission Planner to flash the latest stable [ArduCopter](https://firmware.ardupilot.org/Copter/stable/), [ArduPlane](https://firmware.ardupilot.org/Plane/stable/), [ArduRover](https://firmware.ardupilot.org/Rover/stable/), [ArduSub](https://firmware.ardupilot.org/Sub/stable/) or [ArduBlimp](https://firmware.ardupilot.org/Blimp/latest/) firmware for your flight controller.

Expand All @@ -108,7 +108,7 @@ The table bellow summarizes the software used in this guide. Download and instal
|:----|:----|:----|
| [Mission Planner](https://firmware.ardupilot.org/Tools/MissionPlanner/MissionPlanner-latest.msi) | latest beta | Ground control station (PC software) used for configuring and operating the vehicle |
| [ArduPilot Methodic Configurator](https://github.com/ArduPilot/MethodicConfigurator) | latest | A clear ArduPilot configuration sequence |
| [ArduCopter](https://firmware.ardupilot.org/Copter/stable/) | 4.4.4 or 4.5.5 | Flight controller firmware |
| [ArduCopter](https://firmware.ardupilot.org/Copter/stable/) | 4.4.4 or 4.5.7 | Flight controller firmware |
| [BLHeliSuite32](https://www.mediafire.com/file/fj1p9qlbzo5bl5g/BLHeliSuite32_32.9.0.6.zip/file) | 32.9.06 | PC software to flash and configure ESCs with BLHeli_32 ARM firmware |
| [BLHeli_32 ARM](https://github.com/bitdump/BLHeli/tree/master/BLHeli_32%20ARM) | 32.8 | ESC firmware with Bidir Dshot support |
| [EdgeTx companion](https://edgetx.org/getedgetx/) | 2.9.2 | PC software for configuring and updating EdgeTX based RC transmitters |
Expand All @@ -132,7 +132,7 @@ The table bellow summarizes the software used in this guide. Download and instal
The ArduPilot Methodic Configurator needs to know which components you used/plan to use and how you connected/plan to connect them to the flight controller (autopilot).
It uses this information to automatically pre-select configuration settings relevant to your specific vehicle.

So, [start the ArduPilot Methodic Configurator and input select a vehicle that resembles yours](README.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) and input vehicle components and component connections information into the ArduPilot Methodic Configurator *component editor window*:
So, [start the ArduPilot Methodic Configurator and select a vehicle that resembles yours](USECASES.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) and input vehicle components and component connections information into the ArduPilot Methodic Configurator *component editor window*:

1. Close Mission Planner, if it is open on the PC.
1. Connect the flight controller to the PC via a USB cable and wait 7 seconds.
Expand All @@ -157,7 +157,7 @@ That is harder to do once the autopilot is assembled inside the vehicle, hence i

## 4.1 Setup IMU temperature calibration

1. [Start the software](README.md#6-configure-the-vehicles-parameters-in-a-traceable-way)
1. [Start the software](USECASES.md#use-the-ardupilot-methodic-configurator-software-for-the-first-time) if not already running.
1. On *ArduPilot Methodic Configurator* select `02_imu_temperature_calibration_setup.param` on the *Current intermediate parameter file:* Combobox if not already selected.
1. Read the *Forum Blog:* and *Wiki:* documentation by pressing on the blue URL links.
1. Edit the `02_imu_temperature_calibration_setup.param` parameters' `New Value` and `Change Reason` using the *ArduPilot Methodic Configurator* parameter editor and press `Upload selected params to FC, and advance to next file`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,14 @@ def __create_new_value_entry( # pylint: disable=too-many-arguments, too-many-po
new_value_entry.bind(
"<FocusIn>", lambda event: self.__open_bitmask_selection_window(event, param_name, bitmask_dict, old_value)
)
# pylint: disable=line-too-long
new_value_entry.bind(
"<FocusOut>",
lambda event, current_file=self.current_file, param_name=param_name: self.__on_parameter_value_change( # type: ignore[misc]
event, current_file, param_name
),
)
# pylint: enable=line-too-long
else:
# pylint: disable=line-too-long
new_value_entry.bind(
Expand Down Expand Up @@ -417,6 +425,13 @@ def on_close() -> None:
"<FocusIn>", lambda event: self.__open_bitmask_selection_window(event, param_name, bitmask_dict, old_value)
)

def is_widget_visible(widget: Union[tk.Misc, None]) -> bool:
return bool(widget and widget.winfo_ismapped())

def focus_out_handler(_event: tk.Event) -> None:
if not is_widget_visible(window.focus_get()):
on_close()

def get_param_value_msg(_param_name: str, checked_keys: set) -> str:
_new_decimal_value = sum(1 << key for key in checked_keys)
text = _("{_param_name} Value: {_new_decimal_value}")
Expand Down Expand Up @@ -452,6 +467,9 @@ def update_label() -> None:

# Bind the on_close function to the window's WM_DELETE_WINDOW protocol
window.protocol("WM_DELETE_WINDOW", on_close)
window.bind("<FocusOut>", focus_out_handler)
for child in window.winfo_children():
child.bind("<FocusOut>", focus_out_handler)

# Make sure the window is visible before disabling the parent window
window.deiconify()
Expand Down
2 changes: 0 additions & 2 deletions install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ git config --local sequence.editor "code --wait"
# install pre-commit git hooks
pre-commit install

# setuptools has a bug and refuses to install these files, so do it manually
cp ardupilot_methodic_configurator/vehicle_templates ~/.local/lib/python3.12/site-packages/ardupilot_methodic_configurator/

echo "Installation complete."
echo ""
Expand Down
Loading
Loading