Garmin Fleet Management Controller
2.19.0
|
File conversion tool to support various GPS file formats. More...
#include <CFileConverterDlg.h>
Classes | |
struct | conversion_type |
Defines conversion type. More... | |
Public Types | |
enum | { IDD = IDD_FILECONVERTER } |
Public Member Functions | |
CFileConverterDlg (CWnd *aParent, FmiApplicationLayer &aCom) | |
Constructor. More... | |
virtual | ~CFileConverterDlg () |
Destructor. More... | |
Protected Member Functions | |
BOOL | CreateChildProcess (CString dstFilePath) |
Create a child process to execute the file conversion. More... | |
virtual void | DoDataExchange (CDataExchange *aDataExchange) |
Perform dialog data exchange and validation. More... | |
CString | FormatArguments (CString dstFilePath) |
Helper function to format the command line arguments. More... | |
afx_msg void | OnBnClickedChoose () |
Click handler for Choose (destination folder) button. More... | |
afx_msg void | OnBnClickedFind () |
Click handler for Find (file to convert) button. More... | |
afx_msg void | OnBnClickedOk () |
Click handler for OK button. More... | |
afx_msg void | OnComboChanged () |
Change Handler for the combo box. More... | |
afx_msg void | OnEnChangeFile () |
Edit Change handler for all text boxes. More... | |
BOOL | OnInitDialog () |
Initialize the dialog. More... | |
void | ReadFromPipe (void) |
Read output from the child process's pipe for STDOUT. More... | |
Protected Attributes | |
HANDLE | hChildStd_OUT_Rd |
Handles for the redirection of the child process stdout. More... | |
HANDLE | hChildStd_OUT_Wr |
FmiApplicationLayer & | mCom |
Reference to the FMI communication controller. More... | |
int | mConversionIndex |
Index of the chosen combo box item. More... | |
int | mConversionType |
Type of file conversion to be attempted, as specified by the user. More... | |
BOOL | mDstCoords |
CString | mDstFileName |
File name of the converted file specified by the user. Defaults as the same name as Src file with new extension. More... | |
CString | mDstFolder |
Destination folder for the converted file. Defaults to the same folder as Src file. More... | |
CString | mRouteName |
Route name (Stop Text) of the PSR (limited to 200 bytes) More... | |
BOOL | mSrcCoords |
Flags identify the format of the the source and destination files coords. More... | |
CString | mSrcFilePath |
Path and file name of the file to be converted, as specified by the user. More... | |
CString | mStopId |
Unique Stop ID for the PSR. More... | |
File conversion tool to support various GPS file formats.
Definition at line 19 of file CFileConverterDlg.h.
anonymous enum |
Enumerator | |
---|---|
IDD |
Definition at line 42 of file CFileConverterDlg.h.
CFileConverterDlg::CFileConverterDlg | ( | CWnd * | aParent, |
FmiApplicationLayer & | aCom | ||
) |
Constructor.
aParent | The parent of this dialog |
aCom | Reference to the FMI communication controller |
Definition at line 65 of file CFileConverterDlg.cpp.
|
virtual |
|
protected |
Create a child process to execute the file conversion.
Executes the FleetFileUtility executable. Any output from the tool is collected and displayed via message box. Much of the following is based on example code provided by MSDN.
Definition at line 467 of file CFileConverterDlg.cpp.
|
protectedvirtual |
Perform dialog data exchange and validation.
aDataExchange | The DDX context |
Definition at line 95 of file CFileConverterDlg.cpp.
References CONV_CSV_TO_PSR, CONV_GPX_TO_PSR, IDC_FILE_CONVERT_EDIT_DST_FILENAME, IDC_FILE_CONVERT_EDIT_DST_FOLDER, IDC_FILE_CONVERT_EDIT_ROUTE_NAME, IDC_FILE_CONVERT_EDIT_SRC_FILENAME, and IDC_FILE_CONVERT_EDIT_STOPID.
Referenced by ~CFileConverterDlg().
|
protected |
Helper function to format the command line arguments.
Definition at line 223 of file CFileConverterDlg.cpp.
References CONV_CSV_TO_PSR, CONV_GPX_TO_PSR, and CONV_PSR_TO_CSV.
|
protected |
Click handler for Choose (destination folder) button.
Lets the user select a folder location to save the converted file.
Definition at line 326 of file CFileConverterDlg.cpp.
References FALSE.
|
protected |
Click handler for Find (file to convert) button.
Displays a File..Open dialog allowing the user to select the file to convert.
Definition at line 279 of file CFileConverterDlg.cpp.
|
protected |
Click handler for OK button.
Initiates the file conversion process. The type of file conversion is selected by the user. A post-processing popup alerts the user if the conversion was successful or unsuccessful.
Definition at line 154 of file CFileConverterDlg.cpp.
References FALSE, IDC_FILE_CONVERT_RADB_1, IDC_FILE_CONVERT_RADB_3, and TRUE.
|
protected |
Change Handler for the combo box.
This is needed because all messages for combo box changing are sent before the text has acutally changed. This workaround addresses that issue.
Definition at line 371 of file CFileConverterDlg.cpp.
References CONV_CSV_TO_PSR, CONV_GPX_TO_PSR, FALSE, IDC_FILE_CONVERT_CBO_TYPE, IDC_FILE_CONVERT_EDIT_DST_FILENAME, IDC_FILE_CONVERT_EDIT_DST_FOLDER, IDC_FILE_CONVERT_EDIT_ROUTE_NAME, IDC_FILE_CONVERT_EDIT_SRC_FILENAME, IDC_FILE_CONVERT_EDIT_STOPID, IDC_FILE_CONVERT_RADB_1, IDC_FILE_CONVERT_RADB_2, IDC_FILE_CONVERT_RADB_3, IDC_FILE_CONVERT_RADB_4, CFileConverterDlg::conversion_type::index, and TRUE.
|
protected |
Edit Change handler for all text boxes.
Enables the OK button if all three edit controls are populated.
Definition at line 432 of file CFileConverterDlg.cpp.
References CONV_CSV_TO_PSR, CONV_GPX_TO_PSR, FALSE, and TRUE.
|
protected |
Initialize the dialog.
This function is called when the window is created. It sets up the parent, so it can get info from and send a message to FmiApplicationLayer.
Definition at line 123 of file CFileConverterDlg.cpp.
References cnt_of_array, FALSE, IDC_FILE_CONVERT_CBO_TYPE, IDC_FILE_CONVERT_RADB_1, IDC_FILE_CONVERT_RADB_2, IDC_FILE_CONVERT_RADB_3, IDC_FILE_CONVERT_RADB_4, CFileConverterDlg::conversion_type::index, and TRUE.
|
protected |
Read output from the child process's pipe for STDOUT.
Displays any of the tool's output in message box
Definition at line 547 of file CFileConverterDlg.cpp.
References FALSE.
|
protected |
Handles for the redirection of the child process stdout.
Definition at line 97 of file CFileConverterDlg.h.
|
protected |
Definition at line 98 of file CFileConverterDlg.h.
|
protected |
Reference to the FMI communication controller.
Definition at line 65 of file CFileConverterDlg.h.
|
protected |
Index of the chosen combo box item.
Definition at line 75 of file CFileConverterDlg.h.
|
protected |
Type of file conversion to be attempted, as specified by the user.
Definition at line 72 of file CFileConverterDlg.h.
|
protected |
Definition at line 93 of file CFileConverterDlg.h.
|
protected |
File name of the converted file specified by the user. Defaults as the same name as Src file with new extension.
Definition at line 79 of file CFileConverterDlg.h.
|
protected |
Destination folder for the converted file. Defaults to the same folder as Src file.
Definition at line 83 of file CFileConverterDlg.h.
|
protected |
Route name (Stop Text) of the PSR (limited to 200 bytes)
Definition at line 89 of file CFileConverterDlg.h.
|
protected |
Flags identify the format of the the source and destination files coords.
Definition at line 92 of file CFileConverterDlg.h.
|
protected |
Path and file name of the file to be converted, as specified by the user.
Definition at line 69 of file CFileConverterDlg.h.
|
protected |
Unique Stop ID for the PSR.
Definition at line 86 of file CFileConverterDlg.h.