-
-
Notifications
You must be signed in to change notification settings - Fork 747
Add automatic detection and merging of separate date/time column (#1220) #1259
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
0c6bec9
7fc2532
aaf59a0
0a7615b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1881,7 +1881,7 @@ std::tuple<double, double, int> MainWindow::calculateVisibleRangeX() | |
| const double t1 = data.back().x; | ||
| min_time = std::min(min_time, t0); | ||
| max_time = std::max(max_time, t1); | ||
| max_steps = std::max(max_steps, (int)data.size()); | ||
| max_steps = std::max(max_steps, (int)data.size() - 1); | ||
| } | ||
| } | ||
| }); | ||
|
|
@@ -1898,7 +1898,7 @@ std::tuple<double, double, int> MainWindow::calculateVisibleRangeX() | |
| const double t1 = data.back().x; | ||
| min_time = std::min(min_time, t0); | ||
| max_time = std::max(max_time, t1); | ||
| max_steps = std::max(max_steps, (int)data.size()); | ||
| max_steps = std::max(max_steps, (int)data.size() - 1); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here the other fix (Timeline slider fix) |
||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -391,6 +391,75 @@ void DataLoadCSV::parseHeader(QFile& file, std::vector<std::string>& column_name | |||||||||||||||||||||||||
| _ui->rawText->setPlainText(preview_lines); | ||||||||||||||||||||||||||
| _ui->tableView->resizeColumnsToContents(); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // Auto-detect DATE_ONLY and TIME_ONLY column pairs and create combined virtual columns | ||||||||||||||||||||||||||
| _combined_columns.clear(); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if (lines.size() > 0) | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| if (lines.size() > 0) | |
| { | |
| if (lines.empty()) | |
| { | |
| return; | |
| } |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my suggestion is to limit to consecutive columns only, therefore change this to
| for (size_t date_idx = 0; date_idx < column_types.size(); date_idx++) | |
| using PJ::CSV::ColumnType; | |
| for (size_t index = 0; (index + 1) < column_types.size(); index++) | |
| { | |
| const auto date_idx = index; | |
| const auto tie_idx = index + 1; | |
| if((column_types[date_idx].type!= ColumnType::DATE_ONLY) || | |
| (column_types[time_idx].type!= ColumnType::TIME_ONLY)) | |
| { | |
| continue; // early return is easier to read | |
| } | |
| // is_adjacent is implicitly true |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure that I want to add a column in the UI. At most a not in a QLabel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the purpose? also, do not include in the PR changes that are not related
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've included two small fixes as reported in the PR description (Fix tooltip display at end of time series data)