Skip to content
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

Setup plots through text document, to store/load settings on application startup/shutdown #26

Open
Biehrer opened this issue Oct 21, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Biehrer
Copy link
Owner

Biehrer commented Oct 21, 2020

Setup plots(Create a InitializePlotsFromText(..) method inside jones_plot_app.cpp) through a external document:

Read and parse a text file, in which the specifications for the plots are

  • Make it possible to store the current plot configuration in such a file
  • Make it possible to load settings from this file inside a method:
    InitializePlotsFromText(const std::string& plot_settings_file)

Example format, which I think can be serialized easily(should be discussed) :

// Begin
[PLOT_SETTINGS] // the identifier of a plot settings page
NUM_OF_PLOTS = 2
….
[PLOT0]

[POSITION]
TOP_LEFT_X = 10
TOP_LEFT_Y = 20
WIDTH = 400
HEIGHT = 200
[AXES]
MIN_Y = -10
MAX_Y = 10
[PLOT1]
...
[POSITION]
TOP_LEFT_X = ..
TOP_LEFT_Y =..

[AXES]
MIN_Y=…

// End

  • write a class, which can serialize/deserialize(write/read) from or to such a text file:

Serializer::Write(const std::string plot_num,
const std::string category,
const std::string property,
QVariant value);

// example usage:
// write:
Serializer.Open("filepath")
Serializer.Write('0', 'POSITION', 'TOP_LEFT_X', 10)
Serializer.Write('1', 'AXES', 'TOP_LEFT_X', 10)
Serializer.Close();
// read:
auto top_left_x_mm = Serializer.Read('1', 'POSITION', 'TOP_LEFT_X')

@Biehrer Biehrer added good first issue Good for newcomers enhancement New feature or request labels Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant