-
Notifications
You must be signed in to change notification settings - Fork 16
Add Blimp, AntennaTracker, and AP_Periph #12
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
base: main
Are you sure you want to change the base?
Conversation
|
@ES-Alexander what else do I need to add to this PR? I know I'm missing something but not sure what |
ES-Alexander
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @HTRamsey - sorry I didn't see this earlier!
A couple of suggestions, one for slightly cleaner code, and the other to fix the MAVLink message generation for Tracker :-)
| path1 = Path(f'{self.repository_path}/{tag["matches"]["name"]}/version.h') | ||
| path2 = Path(f'{self.repository_path}/{self.valid_name_map[tag["matches"]["name"]]}/version.h') | ||
| file = path1 if path1.exists() else path2 | ||
| path3 = Path(f'{self.repository_path}/Tools/{tag["matches"]["name"]}/version.h') | ||
| path4 = Path(f'{self.repository_path}/Tools/{self.valid_name_map[tag["matches"]["name"]]}/version.h') | ||
| if path1.exists(): | ||
| file = path1 | ||
| elif path2.exists(): | ||
| file = path2 | ||
| elif path3.exists(): | ||
| file = path3 | ||
| elif path4.exists(): | ||
| file = path4 | ||
| else: | ||
| raise FileNotFoundError(f'No version.h found for tag {tag["matches"]["name"]}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| path1 = Path(f'{self.repository_path}/{tag["matches"]["name"]}/version.h') | |
| path2 = Path(f'{self.repository_path}/{self.valid_name_map[tag["matches"]["name"]]}/version.h') | |
| file = path1 if path1.exists() else path2 | |
| path3 = Path(f'{self.repository_path}/Tools/{tag["matches"]["name"]}/version.h') | |
| path4 = Path(f'{self.repository_path}/Tools/{self.valid_name_map[tag["matches"]["name"]]}/version.h') | |
| if path1.exists(): | |
| file = path1 | |
| elif path2.exists(): | |
| file = path2 | |
| elif path3.exists(): | |
| file = path3 | |
| elif path4.exists(): | |
| file = path4 | |
| else: | |
| raise FileNotFoundError(f'No version.h found for tag {tag["matches"]["name"]}') | |
| potential_paths = ( | |
| f'{self.repository_path}/{tag["matches"]["name"]}/version.h', | |
| f'{self.repository_path}/{self.valid_name_map[tag["matches"]["name"]]}/version.h', | |
| f'{self.repository_path}/Tools/{tag["matches"]["name"]}/version.h', | |
| f'{self.repository_path}/Tools/{self.valid_name_map[tag["matches"]["name"]]}/version.h', | |
| ) | |
| if (file := next((p for p in potential_paths if Path(p).exists()), None)) is None: | |
| raise FileNotFoundError(f'No version.h found for tag {tag["matches"]["name"]}') |
This isn't particularly necessary, but it does make it easier to add additional options in future...
|
|
||
| # Run MAVLink messages parser | ||
| vehicle = f'{"Ardu" if vehicle_type != "Rover" else ""}{vehicle_type}' | ||
| vehicle = f'{"Ardu" if vehicle_type in ["Copter", "Plane", "Sub"] else ""}{vehicle_type}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| vehicle = f'{"Ardu" if vehicle_type in ["Copter", "Plane", "Sub"] else ""}{vehicle_type}' | |
| prefix = 'Ardu' if vehicle_type in ('Copter', 'Plane', 'Sub') else 'Antenna' if vehicle_type == 'Tracker' else '' | |
| vehicle = f'{prefix}{vehicle_type}' |
No description provided.