Fix problems when importing new Data
AbandonedPublic

Authored by Murmele on Aug 25 2019, 8:04 AM.

Details

Reviewers
asemke
Summary

When importing new data into a workboot with the "replace" option, the spreadsheeds are reused. In this case the reused columns change their names and so the curve is affected too, because the column is connected to it. When reusing the column, disconnect all signals to it first.

  • [Column] Disconnect columns, when they are reused or deleted
  • [Spreadsheet] if there are more spreadsheets than needed for the new import, delete the unused spreadsheets
  • [XYCurve] create macro to connect new columns to curves, disconnect old column
  • add comments to understand some processes better
  • [Project] add column as formula variable column to column, when columnName(description) changed
  • [Column] respect masked and invalid values

Diff Detail

Repository
R262 LabPlot
Lint
Lint Skipped
Unit
Unit Tests Skipped
Murmele created this revision.Aug 25 2019, 8:04 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptAug 25 2019, 8:04 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
Murmele requested review of this revision.Aug 25 2019, 8:04 AM

Thanks in advance for fixing these minor issues.

src/backend/core/Project.cpp
204

Typo: it's -> its (twice)

src/backend/lib/macrosXYCurve.h
45

Typo: should be have -> should have

asemke added inline comments.Aug 25 2019, 2:46 PM
src/backend/core/Project.cpp
268

where is the pointer column defined?

src/backend/core/column/Column.cpp
92

maskingChanged is nowhere called in your patch.

src/backend/core/column/ColumnPrivate.h
122

this new function can be made private.

src/backend/spreadsheet/Spreadsheet.cpp
908

where is this signal consumed?

src/backend/worksheet/plots/cartesian/XYCurve.h
136–140

do I see it correctly that with this patch the connection of a column with a curve is lost if the column is renamed? At the moment it's possible to rename the columns (for example from "my great y-data" to "my great and fancy y-data") without affecting the curves - is this not possible anymore since we work now with your patch with names and not with the pointers anymore?

Murmele updated this revision to Diff 64609.Aug 25 2019, 7:21 PM
Murmele marked 6 inline comments as done.

fix comments

Murmele added inline comments.Aug 25 2019, 7:33 PM
src/backend/core/Project.cpp
268

at the beginning of the function:

void Project::descriptionChanged(const AbstractAspect* aspect) {
if (isLoading())

		return;

if (this != aspect) {

		const AbstractColumn* column = dynamic_cast<const AbstractColumn*>(aspect);
src/backend/spreadsheet/Spreadsheet.cpp
908

In macrosXYCurve.h
it is connected to ColumnAboutToBeRemoved

src/backend/worksheet/plots/cartesian/XYCurve.h
136–140

This makes the call of reset() from the column. This signal is connected to ColumnAboutToBeRemoved in XYCurve
see macrosXYCurve.h

template instead of a macro would be better, but I don't know how to create one in this case

Murmele updated this revision to Diff 64615.Aug 25 2019, 8:48 PM
  • force sending aspectDescriptionChanged()
Murmele abandoned this revision.Sep 6 2019, 6:09 PM