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

Fix export to CSV for D-STAR #732

Merged
merged 1 commit into from
Jul 17, 2023
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
7 changes: 7 additions & 0 deletions chirp/drivers/generic_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,13 @@ def match_model(cls, filedata, filename):
(filedata.startswith("Location,") or filedata == "")


# This is not enough to actually behave like a D-STAR radio because we need
# to use this class when opening files. However, it's enough for export to
# CSV
class DSTARCSVRadio(CSVRadio, chirp_common.IcomDstarSupport):
pass


@directory.register
class CommanderCSVRadio(CSVRadio):
"""A driver for reading CSV files generated by KG-UV Commander software"""
Expand Down
5 changes: 4 additions & 1 deletion chirp/wxui/memedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,10 @@ def export_to_file(self, filename):
selected = self._grid.GetSelectedRows()
if len(selected) <= 1:
selected = range(0, self._grid.GetNumberRows())
r = generic_csv.CSVRadio(None)
if isinstance(self.radio, chirp_common.IcomDstarSupport):
r = generic_csv.DSTARCSVRadio(None)
else:
r = generic_csv.CSVRadio(None)
# The CSV driver defaults to a single non-empty memory at location
# zero, so delete it before we go to export.
r.erase_memory(0)
Expand Down