|
|
|
@ -94,7 +94,7 @@ BEGIN_MESSAGE_MAP(CTestLibDlgDlg, CDialogEx) |
|
|
|
ON_WM_CLOSE() |
|
|
|
ON_WM_PAINT() |
|
|
|
ON_WM_QUERYDRAGICON() |
|
|
|
ON_BN_CLICKED(IDC_BUTTON1, &CTestLibDlgDlg::OnBnClickedButton1) |
|
|
|
ON_BN_CLICKED(IDC_BUTTON_OPEN, &CTestLibDlgDlg::OnBnClickedButtonOpen) |
|
|
|
END_MESSAGE_MAP() |
|
|
|
|
|
|
|
|
|
|
|
@ -222,13 +222,6 @@ BOOL CTestLibDlgDlg::CanExit() |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CTestLibDlgDlg::OnBnClickedButton1() |
|
|
|
{ |
|
|
|
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
|
|
|
|
loadA2lFile("C:\\Users\\oilvirus\\Downloads\\example-a2l-file.a2l"); |
|
|
|
} |
|
|
|
|
|
|
|
void CTestLibDlgDlg::loadA2lFile(std::string strFilePath) |
|
|
|
{ |
|
|
|
std::string strLogData; |
|
|
|
@ -280,6 +273,7 @@ void CTestLibDlgDlg::loadA2lFile(std::string strFilePath) |
|
|
|
std::cout << module_list.size() << " : " << module_list.size(); |
|
|
|
AddLogString(string_format("module_list.size() : %d", module_list.size())); |
|
|
|
|
|
|
|
if (module_list.size() > 0) { |
|
|
|
|
|
|
|
const auto& module = module_list.cbegin()->second; |
|
|
|
//ASSERT_TRUE(module);
|
|
|
|
@ -291,6 +285,46 @@ void CTestLibDlgDlg::loadA2lFile(std::string strFilePath) |
|
|
|
|
|
|
|
AddLogString(""); |
|
|
|
|
|
|
|
const auto& modPar = module->ModPar(); |
|
|
|
AddLogString(string_format("modPar.Comment() : %s", modPar.Comment.c_str())); |
|
|
|
AddLogString(string_format("modPar.epk : %s", modPar.Epk.c_str())); |
|
|
|
AddLogString(string_format("modPar.addr_epk size : %d", modPar.AddressEpkList.size())); |
|
|
|
for (int i = 0; i < modPar.AddressEpkList.size(); i++) { |
|
|
|
AddLogString(string_format("modPar.addr_epk (%d) addr (0x%X)",i, modPar.AddressEpkList.at(i))); |
|
|
|
} |
|
|
|
AddLogString(string_format("modPar.memory layout size : %d", modPar.MemoryLayoutList.size())); |
|
|
|
/*
|
|
|
|
for (int i = 0; i < modPar.MemoryLayoutList.size(); i++) { |
|
|
|
AddLogString(string_format("modPar.MemoryLayoutList (%d) addr (0x%X)", i, modPar.MemoryLayoutList.at(i))); |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
AddLogString(string_format("modPar.memory segment size : %d", modPar.MemorySegmentList.size())); |
|
|
|
|
|
|
|
for (int i = 0; i < modPar.MemorySegmentList.size(); i++) { |
|
|
|
AddLogString(string_format("(%d) modPar.Memory sement description=[%s] segment_type=[%d] memory_type=[%d] attribution=[%d] addr (0x%X) size(0x%X) offset_list=[%d] ifDataList=[%d]", |
|
|
|
i, modPar.MemorySegmentList.at(i).Description.c_str(), modPar.MemorySegmentList.at(i).SegmentType, modPar.MemorySegmentList.at(i).MemoryType, |
|
|
|
modPar.MemorySegmentList.at(i).Attribute, modPar.MemorySegmentList.at(i).Address, modPar.MemorySegmentList.at(i).Size, |
|
|
|
modPar.MemorySegmentList.at(i).OffsetList.size(), modPar.MemorySegmentList.at(i).IfDataList.size())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
AddLogString(""); |
|
|
|
|
|
|
|
const auto& modComm = module->ModCommon(); |
|
|
|
AddLogString(string_format("modComm.Comment() : %s", modComm.Comment.c_str())); |
|
|
|
AddLogString(string_format("modComm.Deposit : %d", modComm.Deposit)); |
|
|
|
AddLogString(string_format("modComm.ByteOrder : %d", modComm.ByteOrder)); |
|
|
|
AddLogString(string_format("modComm.AlignmentByte : %d", modComm.AlignmentByte)); |
|
|
|
AddLogString(string_format("modComm.AlignmentFloat16 : %d", modComm.AlignmentFloat16)); |
|
|
|
AddLogString(string_format("modComm.AlignmentFloat32 : %d", modComm.AlignmentFloat32)); |
|
|
|
AddLogString(string_format("modComm.AlignmentFloat64 : %d", modComm.AlignmentFloat64)); |
|
|
|
AddLogString(string_format("modComm.AlignmentInt64 : %d", modComm.AlignmentInt64)); |
|
|
|
AddLogString(string_format("modComm.AlignmentLong : %d", modComm.AlignmentLong)); |
|
|
|
AddLogString(string_format("modComm.AlignmentWord : %d", modComm.AlignmentWord)); |
|
|
|
|
|
|
|
AddLogString(""); |
|
|
|
|
|
|
|
for (const auto& [protocol, if_data] : module->IfDatas()) { |
|
|
|
a2l::IfDataBlock block(if_data); |
|
|
|
//EXPECT_TRUE(block.IsOk()) << block.LastError();
|
|
|
|
@ -317,13 +351,13 @@ void CTestLibDlgDlg::loadA2lFile(std::string strFilePath) |
|
|
|
} |
|
|
|
|
|
|
|
if (bIsDigit) |
|
|
|
AddLogString(string_format("%d : Address 0x%X (%d) : ", j, atoi(block.ItemList()[i].ItemList[j].Value.c_str()), atoi(block.ItemList()[i].ItemList[j].Value.c_str()))); |
|
|
|
AddLogString(string_format("%d : Address 0x%X (%d) : %s itemlist=%d", j, atoi(block.ItemList()[i].ItemList[j].Value.c_str()), atoi(block.ItemList()[i].ItemList[j].Value.c_str()), block.ItemList()[i].ItemList[j].BlockName.c_str(), block.ItemList()[i].ItemList[j].ItemList.size())); |
|
|
|
else |
|
|
|
AddLogString(string_format("%d : %s", j, block.ItemList()[i].ItemList[j].Value.c_str())); |
|
|
|
AddLogString(string_format("%d : %s : %s itemlist=%d", j, block.ItemList()[i].ItemList[j].Value.c_str(), block.ItemList()[i].ItemList[j].BlockName.c_str(), block.ItemList()[i].ItemList[j].ItemList.size())); |
|
|
|
|
|
|
|
|
|
|
|
for (int k = 0; k < (block.ItemList()[i].ItemList[j].ItemList.size()); k++) { |
|
|
|
|
|
|
|
AddLogString(string_format(" %d : %s : %s", k, block.ItemList()[i].ItemList[j].ItemList[k].Value.c_str(), block.ItemList()[i].ItemList[j].ItemList[k].BlockName.c_str())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -351,14 +385,22 @@ void CTestLibDlgDlg::loadA2lFile(std::string strFilePath) |
|
|
|
} |
|
|
|
std::cout << std::endl; |
|
|
|
|
|
|
|
AddLogString(""); |
|
|
|
|
|
|
|
const auto& characteristic_list = module->Characteristics(); |
|
|
|
//EXPECT_GT(characteristic_list.size(), 0);
|
|
|
|
std::cout << "\t\tCHARACTERISTIC" << std::endl; |
|
|
|
|
|
|
|
AddLogString(string_format("chracteristics : %d", characteristic_list.size())); |
|
|
|
int i = 0; |
|
|
|
for (const auto& [char_name, characteristic] : characteristic_list) { |
|
|
|
std::cout << char_name << " " << characteristic->Description() << std::endl; |
|
|
|
AddLogString(string_format(" %d : %s", i, characteristic->Description().c_str())); |
|
|
|
} |
|
|
|
std::cout << std::endl; |
|
|
|
|
|
|
|
AddLogString(""); |
|
|
|
|
|
|
|
const auto& compu_method_list = module->CompuMethods(); |
|
|
|
//EXPECT_GT(compu_method_list.size(), 0);
|
|
|
|
std::cout << "\t\tCOMPU METHOD" << std::endl; |
|
|
|
@ -423,14 +465,23 @@ void CTestLibDlgDlg::loadA2lFile(std::string strFilePath) |
|
|
|
} |
|
|
|
std::cout << std::endl; |
|
|
|
|
|
|
|
AddLogString(""); |
|
|
|
|
|
|
|
const auto& meas_list = module->Measurements(); |
|
|
|
//EXPECT_GT(meas_list.size(), 0);
|
|
|
|
std::cout << "\t\tMEASUREMENT" << std::endl; |
|
|
|
|
|
|
|
AddLogString(string_format("measurement : %d", meas_list.size())); |
|
|
|
|
|
|
|
i = 0; |
|
|
|
for (const auto& [meas_name, meas] : meas_list) { |
|
|
|
std::cout << meas_name << " " << meas->Description() << std::endl; |
|
|
|
AddLogString(string_format(" %d : %s", i, meas->Description().c_str())); |
|
|
|
} |
|
|
|
std::cout << std::endl; |
|
|
|
|
|
|
|
AddLogString(""); |
|
|
|
|
|
|
|
const auto& rec_list = module->RecordLayouts(); |
|
|
|
//EXPECT_GT(rec_list.size(), 0);
|
|
|
|
std::cout << "\t\tRECORD LAYOUT" << std::endl; |
|
|
|
@ -508,6 +559,7 @@ void CTestLibDlgDlg::loadA2lFile(std::string strFilePath) |
|
|
|
} |
|
|
|
*/ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void CTestLibDlgDlg::AddLogString(std::string strMessage) |
|
|
|
{ |
|
|
|
@ -517,3 +569,19 @@ void CTestLibDlgDlg::AddLogString(std::string strMessage) |
|
|
|
|
|
|
|
pListBox->AddString(message_w.c_str()); |
|
|
|
} |
|
|
|
void CTestLibDlgDlg::OnBnClickedButtonOpen() |
|
|
|
{ |
|
|
|
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
|
|
|
|
TCHAR a2lExt[] = _T("*.a2l"); |
|
|
|
TCHAR a2lBaseFilter[] = _T("A2L file(*.A2L) | *.a2l;*.A2L | 모든파일(*.*) | *.* ||"); |
|
|
|
CFileDialog dlg(TRUE, a2lExt, NULL, OFN_HIDEREADONLY, a2lBaseFilter); |
|
|
|
|
|
|
|
if (dlg.DoModal() == IDOK) { |
|
|
|
std::wstring strPath = dlg.GetPathName().GetBuffer(); |
|
|
|
|
|
|
|
std::string strA2lPath; |
|
|
|
strA2lPath.assign(strPath.begin(), strPath.end()); |
|
|
|
|
|
|
|
loadA2lFile(strA2lPath.c_str()); |
|
|
|
} |
|
|
|
} |
|
|
|
|