add nmea2000 dependency. Fix CSV parsing
This commit is contained in:
parent
16466ed754
commit
0d2668bac5
|
|
@ -45,5 +45,9 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
|||
${clipp_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
||||
CANBOAT_JSON_PATH="${canboat_SOURCE_DIR}/docs/canboat.json"
|
||||
)
|
||||
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ftxui::component ftxui::screen ftxui::dom tiny-process-library xlnt sqlite3_lib z Boost::regex ${Boost_LIBRARIES} lely::coapp lely::co lely::can lely::io2 lely::ev lely::util)
|
||||
|
||||
|
|
|
|||
|
|
@ -121,6 +121,19 @@ FetchContent_Declare(
|
|||
GIT_PROGRESS TRUE
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
canboat
|
||||
GIT_REPOSITORY https://github.com/canboat/canboat.git
|
||||
GIT_TAG v6.1.6
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(canboat)
|
||||
if(NOT canboat_POPULATED)
|
||||
FetchContent_Populate(canboat)
|
||||
endif()
|
||||
|
||||
FetchContent_GetProperties(lely_core)
|
||||
if(NOT lely_core_POPULATED)
|
||||
FetchContent_Populate(lely_core)
|
||||
|
|
|
|||
|
|
@ -92,6 +92,14 @@ std::unique_ptr<sqlite::database> parseCsv(const std::string &file) {
|
|||
if (line.empty())
|
||||
continue;
|
||||
|
||||
while (std::count(line.begin(), line.end(), '"') % 2 != 0) {
|
||||
std::string next;
|
||||
if (!std::getline(ifs, next))
|
||||
break;
|
||||
line += '\n';
|
||||
line += next;
|
||||
}
|
||||
|
||||
auto fields = parseCsvLine(line);
|
||||
std::map<std::string, std::string> pgn_row_map, spn_row_map;
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,10 @@ void initJ1939Database(sqlite::database &db) {
|
|||
db << "PRAGMA journal_mode = OFF";
|
||||
db << "PRAGMA synchronous = OFF";
|
||||
db << "PRAGMA foreign_keys = ON;";
|
||||
|
||||
db << "CREATE INDEX IF NOT EXISTS idx_spns_pgn ON spns(pgn);";
|
||||
db << "CREATE INDEX IF NOT EXISTS idx_spn_fragments_spn ON spn_fragments(spn);";
|
||||
db << "CREATE INDEX IF NOT EXISTS idx_spn_fragments_spn_pgn ON spn_fragments(spn, pgn);";
|
||||
}
|
||||
|
||||
std::string buildPgnInsertSql() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue