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

Graph rework #370

Closed
wants to merge 18 commits into from
Closed

Conversation

felix-salfelder
Copy link
Member

continuing #314.... rebased

@in3otd i did not manage to disable qDebug per-file. i cleaned up some unnecessary output, does this improve the situation on your end?

storing indeps only. move dep into VarDep during schematic read-in.
with this, VarPos.size() equals numAxes.
the dashed lines used to introduce unpredictable sizes. now Qt takes
care of dashes.
a list of graphs is not a graph in the implied sense. hence the class
that holds lists of graphs must be renamed. this makes room for a class
dedicated to graphs, replacing the previous "Graph" class. a Graph
object is now an iterable that yields sampling points.

- rename Graph class to GraphDeque
- implement new (iterable) Graph class dedicated to graphs
ScrPoints is supposed to hold the data required for plotting.
previously, the ScrPoints were screen coordinates with an implicit
correspondence to dat ('qucsdata') file contents.
Diagram (Painter, Marker) shall operate with the data held by these
Graphs.
dissect parts of Marker::createText for later (re)use.
a marker position is a reference to a graph and a reference to a
sampling point within this graph. currently, the graphs are one
dimensional.

change getSelected to return iterator, not int
move code from Marker::initText into GraphDeque::samplePos.
just assign Text, do not recompute coordinates. reuse code from
Marker::initText put into GraphDeque::samplePos.
i'm wondering how this ever worked...
@felix-salfelder
Copy link
Member Author

rebased ... (minor conflict)

@felix-salfelder felix-salfelder changed the title Graph rework Graph rework (WIP) Sep 29, 2015
@in3otd
Copy link
Contributor

in3otd commented Sep 29, 2015

uh, oh, I get a qucs: graph.cpp:464: void Graph::ScrPt::setIndep(double): Assertion ScrX>=0 failed. with some graph here... did we already saw this in the past (cannot remember for sure) ??
Can try to put together a small failing example if you need (current one is quite big)

@felix-salfelder
Copy link
Member Author

@in3otd i hope this is about a 3d plot. otherwise, an examples will likely be helpful.

the assertion is probably too harsh, in some intermediate stages it might be legal to insert negative coordinates. this makes sure that the code cannot be debugged easily. still a lot of guesswork involved here :(.

@in3otd
Copy link
Contributor

in3otd commented Sep 29, 2015

no, it's a plain 2D plot.
With your latest commit, I get another assertion fail, qucs: graph.cpp:471: void Graph::ScrPt::setDep(cplx_t): Assertion ScrX>=0 failed

Here is a Qucs package with a small example (remove the .docx extension, GitHub needed that...)
Unpack, open the Data Display and follow the instructions there.

z_tmp_plot.qucs.docx

@felix-salfelder
Copy link
Member Author

thank you.

just to be sure: what does "Unpack" mean?

$ file z_tmp_plot.qucs 
z_tmp_plot.qucs: data

my qucs open dielog does not list .qucs in the extensions dropdown.

@in3otd
Copy link
Contributor

in3otd commented Sep 29, 2015

...sloppy description, I meant "Extract Package", from the GUI, Project->Extract Package (and no, I'm not sure to have seen this feature described in the docs...)

@felix-salfelder
Copy link
Member Author

outch. functionally this appears to be a plain file archive. the extract thing created a directory and some files in $HOME/.qucs. shouldn't we switch to a more common format?! okay that was off topic.

@in3otd yes, i could reproduce the problem. see the latest commit for a workaround. let me think about how to fix this properly.

the warnings and asserts will not rescue us. remove them.
this does not fix the magic number collision bug.

currently points with negative screen coordinates are used as control
tokens. need to get rid of that.
it does not work. must be implemented as part of the drawing routine.
@guitorri guitorri changed the base branch from master to develop February 18, 2017 13:07
@felix-salfelder felix-salfelder mentioned this pull request Feb 18, 2017
@felix-salfelder felix-salfelder added this to the 0.0.20 milestone May 7, 2017
@guitorri
Copy link
Member

Thank you. I was about to ask you to rebase (or merge forward).
I read the changes. Seems fine, but I did not run yet.

@felix-salfelder
Copy link
Member Author

i merged, because the rebase turned out to be messy. will rebase/squash when reviewed.

@guitorri
Copy link
Member

I know, I tried to rebase myself... went ok till the 7/15 conflicts.

@felix-salfelder felix-salfelder changed the title Graph rework (WIP) Graph rework Oct 13, 2017
@guitorri
Copy link
Member

Something is not right.

develop:
develop
graph_rework:
graph_rework

Another example.
develop:
develop2
graph_rework:
graph_rework2

I just loaded an exiting schematic. The Markers are gone and some Diagrams are painted elsewhere. I mean, if i scroll I see some outlines of diagrams moving around as if the Diagrams are being moved relative to the mouse cursor position.
It is algo giving a the following on the console Warning: QPainter::end: Painter ended with 5 saved states
Diagram axes are missing and sometimes the traces are plotted outside.

@felix-salfelder
Copy link
Member Author

must be a side effect of the rebase. will have a look. thanks for the test.

:|

@andresmmera
Copy link
Contributor

Hello,

I'm taking a look at this and I think that we should go back to ba8c29b and repeat the rebase against develop. I've already done that (several times...) but the branches have diverged a lot, so it is rather difficult to merge them properly...

Now I clearly see that the phasor and waveac diagrams need to be removed. Despite the fact that I honestly appreciate the effort of @gildias, these additions entangle (even more) the qucs code :-S

@andresmmera
Copy link
Contributor

My intention is to create a branch removing #682 and then try to rebase this PR against that branch... WIP...

@felix-salfelder
Copy link
Member Author

thanks a lot Andres.

@andresmmera
Copy link
Contributor

Hello,

I created a branch (GRAPH_REWORK_wo_682) from ba8c29b which contains the latest commits from @felix-salfelder before merging "graph_rework" into develop. Then, as I said above, I created a branch (Remove682) identical to develop, but removing (manually) the features from #682

Then I rebased "GRAPH_REWORK_wo_682" against "Remove682", made some fixes to make it compile and tested the final result. It works and I didn't find bugs related to the merging process. However, I found a bug coming from ba8c29b (or even before). Please take a look at this, I guess this is related to the macro in marker.cpp, but I need to take a closer look.

At the light of these results, I think we should follow these steps:

  1. Test "Remove682", open the corresponding PR and merge it into develop
  2. In "GRAPH_REWORK_wo_682", fix the segfault I pointed out before, do more testing, open a PR and merge that into develop

And I think that's all 😄
@felix-salfelder @in3otd @ra3xdh @guitorri Do you agree?

370diagram

@felix-salfelder
Copy link
Member Author

wow. this looks promising.

about Remove682... maybe it makes sense to keep the code in some form, so it will be easier to add back later. e.g. move all the code to some diagrams/*.cpp, with some comments, and just remove these from the makefiles.

ba8c29b: will have a look!

@andresmmera
Copy link
Contributor

e.g. move all the code to some diagrams/*.cpp, with some comments, and just remove these from the makefiles.

I agree to keep waveac.h/cpp and phasordiagram.h/cpp and remove them from the building system.
However, IMHO the other code related to #682 (I mean, those pieces of code that affect other files: diagram.cpp, etc.) could be removed since we'll need to figure out an alternative (non-intrusive) way to implement those diagrams.

@guitorri
Copy link
Member

guitorri commented Feb 5, 2018

@andresmmera the first PR is merged.

What about https://github.com/andresmmera/qucs/tree/GRAPH_REWORK_wo_PR682
Does it need rebase or just a PR?

Please prepare the PR and we hunt the crash/bug later on.

@andresmmera
Copy link
Contributor

It needs a rebase. I'm working on that, but it might take me a few days to have it done.

@andresmmera andresmmera mentioned this pull request Feb 8, 2018
@guitorri
Copy link
Member

Moving to next milestone.

@guitorri guitorri modified the milestones: 0.0.20, 0.0.21 Jul 25, 2018
@felix-salfelder felix-salfelder deleted the branch Qucs:develop July 2, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants