45 , m_currentBaudRate(-1)
46 , m_imageAddress(0){};
75 int32_t
GetBaudRate(
size_t index) {
return m_baudRate.at(index); };
95 for (std::vector<int32_t>::iterator it = m_baudRate.begin(); it != m_baudRate.end(); it++)
104 m_baudRate.push_back(baudrate);
114 for (std::vector<int32_t>::iterator it = m_baudRate.begin(); it != m_baudRate.end(); it++)
122 else if (baudrate == *it)
130 m_baudRate.insert(it, baudrate);
136 m_baudRate.push_back(baudrate);
146 uint16_t
GetVid(
size_t index) {
return m_vids.at(index); };
157 for (std::vector<uint16_t>::iterator it = m_vids.begin(); it != m_vids.end(); it++)
166 m_vids.push_back(vid);
176 for (std::vector<uint16_t>::iterator it = m_vids.begin(); it != m_vids.end(); it++)
186 m_vids.insert(m_vids.begin(), vid);
194 uint16_t vid = m_vids.at(index);
195 m_vids.erase(m_vids.begin() + index);
196 m_vids.insert(m_vids.begin(), vid);
204 uint16_t
GetPid(
size_t index) {
return m_pids.at(index); };
215 for (std::vector<uint16_t>::iterator it = m_pids.begin(); it != m_pids.end(); it++)
224 m_pids.push_back(pid);
234 for (std::vector<uint16_t>::iterator it = m_pids.begin(); it != m_pids.end(); it++)
244 m_pids.insert(m_pids.begin(), pid);
252 uint16_t pid = m_pids.at(index);
253 m_pids.erase(m_pids.begin() + index);
254 m_pids.insert(m_pids.begin(), pid);
270 CString fullPath = m_imageFile.at(index);
271 int pos = fullPath.ReverseFind(_T(
'\\'));
272 return fullPath.Right(fullPath.GetLength() - pos - 1);
282 CString extension = PathFindExtension(m_imageFile.at(index));
283 if (extension.CompareNoCase(_T(
".bin")) == 0)
287 else if (extension.CompareNoCase(_T(
".sb")) == 0)
291 else if (extension.CompareNoCase(_T(
".hex")) == 0)
295 else if ((extension.CompareNoCase(_T(
".srec")) == 0) || (extension.CompareNoCase(_T(
".s19")) == 0))
314 for (std::vector<CString>::iterator it = m_imageFile.begin(); it != m_imageFile.end(); it++)
317 if (fullPath.Compare(*it) == 0)
323 m_imageFile.push_back(fullPath);
333 for (std::vector<CString>::iterator it = m_imageFile.begin(); it != m_imageFile.end(); it++)
336 if (fullPath.Compare(*it) == 0)
343 m_imageFile.insert(m_imageFile.begin(), fullPath);
351 CString file = m_imageFile.at(index);
352 m_imageFile.erase(m_imageFile.begin() + index);
353 m_imageFile.insert(m_imageFile.begin(), file);
373 int32_t m_currentDevice;
374 std::vector<int32_t> m_baudRate;
375 int32_t m_currentBaudRate;
376 std::vector<uint16_t> m_vids;
377 std::vector<uint16_t> m_pids;
378 std::vector<CString> m_imageFile;
379 uint32_t m_imageAddress;
380 CString m_backdoorKey;
virtual ~HistoryData()
Generated standard destructor.
Definition: HistoryData.h:49
void BubbleSelectedVid(size_t index)
bubble the VID at the specified index to the head of the VID list
Definition: HistoryData.h:192
uint32_t GetImageAddress()
Get image address previous used.
Definition: HistoryData.h:359
int32_t GetCurrentDevice()
Get current selected device index at device list.
Definition: HistoryData.h:65
size_t GetFileCount()
Get count of the files in the list .
Definition: HistoryData.h:307
Unsupported file type.
Definition: HistoryData.h:58
HistoryData class stores the operation history. Save users operation steps.
Definition: HistoryData.h:39
Binary file.(.bin)
Definition: HistoryData.h:54
HistoryData()
Generated standard constructor.
Definition: HistoryData.h:43
Intel hex file.(.hex)
Definition: HistoryData.h:56
void BubbleSelectedFile(int32_t index)
bubble the file at the specified index to the head of the file list
Definition: HistoryData.h:349
CString GetBackdoorKey()
Get the string of backdoor key previous used.
Definition: HistoryData.h:367
uint16_t GetPid(size_t index)
Get the PID at the specified index.
Definition: HistoryData.h:204
void SetBackdoorKey(CString backdoorKey)
Change the string of backdoor key.
Definition: HistoryData.h:371
FileType GetFileType(int index)
Get the file type of the file at the specified index of the file list.
Definition: HistoryData.h:280
void BubbleSelectedPid(size_t index)
bubble the PID at the specified index to the head of the PID list
Definition: HistoryData.h:250
size_t GetPidCount()
Get count of the PID in the list .
Definition: HistoryData.h:208
void AddPid(uint16_t pid)
Append a new PID at the end of the list.
Definition: HistoryData.h:212
CString GetFilePath(int index)
Get the file full path at the specified index of the file list.
Definition: HistoryData.h:262
void SetCurrentBaudRate(int32_t index)
Change the index of current selected baud rate.
Definition: HistoryData.h:88
FileType
File types.
Definition: HistoryData.h:52
void AddFile(CString fullPath)
Append a new file at the end of the list.
Definition: HistoryData.h:311
uint16_t GetVid(size_t index)
Get the VID at the specified index.
Definition: HistoryData.h:146
void InsertFile(CString fullPath)
Insert a file at the head of the list. If the file already exists in the list, only bubble that file ...
Definition: HistoryData.h:330
void InsertBaudRate(int32_t baudrate)
Insert a new baud rate, and change the current selected baud rate. If the baud rate already exists in...
Definition: HistoryData.h:111
void InsertVid(uint16_t vid)
Insert a VID at the head of the list. If the VID already exists in the list, only bubble that VID to ...
Definition: HistoryData.h:173
void InsertPid(uint16_t pid)
Insert a PID at the head of the list. If the PID already exists in the list, only bubble it to list h...
Definition: HistoryData.h:231
size_t GetBaudRateCount()
Get count of the baud rates in the list.
Definition: HistoryData.h:79
void AddBaudRate(int32_t baudrate)
Append a new baud rate at the end of the list.
Definition: HistoryData.h:92
int32_t GetCurrentBaudRate()
Get current selected baud rate index at the list.
Definition: HistoryData.h:84
size_t GetVidCount()
Get count of the VID in the list .
Definition: HistoryData.h:150
void SetImageAddress(uint32_t imageAddress)
Change image address.
Definition: HistoryData.h:363
void AddVid(uint16_t vid)
Append a new VID at the end of the list.
Definition: HistoryData.h:154
void SetCurrentDevice(int32_t index)
Change the index of current selected device.
Definition: HistoryData.h:69
SB file.(.sb)
Definition: HistoryData.h:55
CString GetFileName(int index)
Get the file name at the specified index of the file list.
Definition: HistoryData.h:268
Srecord file.(.srec, s19)
Definition: HistoryData.h:57
int32_t GetBaudRate(size_t index)
Get the baud rate at the specified index.
Definition: HistoryData.h:75