-
Notifications
You must be signed in to change notification settings - Fork 213
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
Enhanced markers #407
Enhanced markers #407
Conversation
a1d100a
to
eccc5f1
Compare
Uhm, Travis-CI crashed and left this message: |
TravisCI crashes while running netlist test. To be certain, it cannot run test on |
Ok, thank you @ra3xdh, I've just found what's going on |
I got this one rebased locally. I see you also performed a few Qt3Support fixes. I guess I will wait till #662 gets merged do rebase again. |
Also, the color picker button can be the one from #672. |
Is it absolutely necessary to create the [data set].Markers.dat file? |
I did not actually test the code but I do not like that the line connecting the marker box and the graph has the same color as the graph line. The colored box around the marker already gives a visual cue about which marker belongs to which line and IMHO everything that has the color of a graph line inside a diagram must come from the data. Then one can think of pathological cases where the marker line superposes/interferes with the actual waveform shape (for rectangular/triangular waves, etc.). Opinions? Extra bonus: it may be nice to have the delta markers with two lines, one to each point used for computing the delta; this will make immediately clear where it is actually measured. I guess this is what you were referring to above, guitorri? |
Good point. I didn't think about that case. Anyway, the default color can be changed.
Hum,... I didn't found another way to store the marker data, but I need to think about it. |
that (among others) was the intent of the new marker code and the graph_deque. need to check what state it is in right now. (iirc, the 2d plots are already using qt routines for the drawing, which was a fairly big lift) |
Hello, I'm working again on this branch. I totally agree that it is not convenient to create a separate file to store markers: I'm thinking about a practical case of sharing a schematic by just copying & pasting it as raw text... Using an additional file to save the markers would force to share the markers file too and it would be quite annoying... I'll think about an alternative solution... |
779043d
to
ba0995e
Compare
I need to do some cleanup, but so far:
|
thanks! I got it to segfault a couple of times opening an exiting Data Display but it doesn't happen all the time; try to open and close the Data Display in the project below a couple of times - here it crashes usually the first or second time. I also notice a message on the console
not sure if it was there before or it appeared with this PR. |
No, it was a bug... Now it is fixed
I didn't think about that... I've just added a check to as to avoid empty names. Thank you
Of course, I've set the default marker color to 'Qt::darkMagenta'
I cannot reproduce that segfault here, but I noticed that when opening that .dpl file, the console output is filled with warnings like this: These warnings also appear in the master and develop branches. Maybe they're related to the segfault... or not
Uhm, I've seen that this also happens in the develop branch (but not in master). The warning is thrown just when you pick a qucs project from the projects tab. In this sense, I've been tracking it down and it seems to appear at 2e9f7d1 |
thanks!
Anyway, with another example the backtrace points to a call to
last debug messages on terminal were
The segfault does not happen very often, usually when switching between Data Display tabs with lot of graphs |
qucs/qucs/diagrams/marker.cpp
Outdated
@@ -363,18 +496,24 @@ void Marker::paint(ViewPainter *p, int x0, int y0) | |||
x2_ = p->drawText(Text, x0+x1+3, y0+y1+3, &y2_); | |||
x2_ += int(6.0*p->Scale); | |||
y2_ += int(6.0*p->Scale); | |||
if(!transparent) { |
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.
why the logic of 'transparent' was changed? Previously the marker border was always drawn and 'transparent' referred to the rectangle area, which was not transparent by default.
Now selecting 'transparent' removes the border and makes the rectangle area non-transparent.
|
doing some more testing, found a little bug:
I guess it looks/points to the old reference marker name and so something goes wrong |
I also see that marker names with spaces do not work... I'll take a look at this. |
I've fixed the problems above but some more general issues remain
need to think how all this can be handled |
This commit fixes the issues described by in3otd (Qucs#407 (comment)) The fix consist on updating the ActiveMarkers map in the paint() event so as to know if the reference marker has been removed or if its name has changed. In these cases, the marker pointing to that reference is set to be a convenitional marker. In the same line, if the user activates the delta mode for the reference marker, those markers pointing to that reference are converted into conventional markers
Hi, https://drive.google.com/open?id=0BwDjrwGfd_z7WEdLNl81RXdVS0E |
I've pushed some commits, one allows spaces in the Marker ID string: you may need to recreate/modify any existing schematic using Enhanced Markers as the marker ID is now enclosed in quotes in the schematic file. Another thing I did is to keep the markers map in the diagram object only and not in every marker; I didn't see the need to have a copy in every marker and thought that only the markers parent needs to know all the markers characteristics. There are some other points that in the long term may need to be addressed, e.g. now you can create delta markers between different graphs even if this does rarely make sense IMHO but nothing urgent at present. |
17b0e0d
to
66167da
Compare
This commit fixes the issues described by in3otd (Qucs#407 (comment)) The fix consist on updating the ActiveMarkers map in the paint() event so as to know if the reference marker has been removed or if its name has changed. In these cases, the marker pointing to that reference is set to be a convenitional marker. In the same line, if the user activates the delta mode for the reference marker, those markers pointing to that reference are converted into conventional markers
I've just pushed two commits. The first one fixes a bug: the reference marker combobox was being activated after placing three or more markers Then after rebasing against develop, I made minor changes to extend the delta marker feature to the recently added phasor and AC temporal diagrams |
The last commit fixes this |
In this commit, the way the marker information (value, color and other properties) was changed so as to avoid Marker.dat files which polluted the file system and involved an unnecessary number of I/O file operations. In this sense, the Marker.dat table was replaced by a QMap structure in 'Diagram' class. This way, each diagram contains the necessary info of its markers and it is updated when calling the paint() event. Moreover, this table is passed to every marker in order to let 'markerdialog' know what markers can be used as reference markers. Regarding backwards compatibility, this code contains a legacy function for loading the old marker format from the .dpl file. Finally, it was added an extra (dotted) line to the delta markers so as to give a visual clue about where the reference marker is.
* The marker format used until this commit was changed in order to guarantee that a .dpl sheet with delta markers can be readed using old versions of Qucs. Obviously, the old versions cannot handle the delta feature, but at least the marker is loaded. * On the other hand, it was found a segfault when doing ctrl+Z in Smith Chart plots with delta markers. That happened because the data related to the ref. marker was empty...
In this commit it was fixed a bug which prevented the marker from updating the color and the width of the line. Moreover, the default marker color was set to 'Qt::darkMagenta' and it was added a check for preventing the user from removing the name of the marker
This commit fixes an unfortunate alteration of the transparency logic. Moreover, in order to try to fix the segfault issues noticed by in3otd, it was removed an extra autoincrement in nVarPos...
This commit fixes the issues described by in3otd (Qucs#407 (comment)) The fix consist on updating the ActiveMarkers map in the paint() event so as to know if the reference marker has been removed or if its name has changed. In these cases, the marker pointing to that reference is set to be a convenitional marker. In the same line, if the user activates the delta mode for the reference marker, those markers pointing to that reference are converted into conventional markers
and emit a warning if user tries to assign an emtpy string.
to avoid having to sync all the markers map copies in the markers.
This also fixes an unreported bug: after placing 3 or more markers, the ref marker combobox was activated because improper initialization
c5a6999
to
db606bb
Compare
In line with #701 it was added a impedance/admittance selection box for those markers pointing at a Smith chart diagram |
I've applied the fix 428b687 here... |
Testing. |
IIRC from my latest testing, it was working fine - I was modifying the code to make, IMHO, a little straightforward; now the markers info are kept in the Diagram, moving that to the Graphs will automatically remove the possibility to create cross-graph delta markers, without the need to check on which Graph the marker is, since every Graph will have separate marker info, only for their own markers. But these modification can be done later. |
I checked out the
Any idea why? |
um, I guess it actually comes from here |
You guys are more familiar with the marker code. Please document the latest marker line format in qucs-help. |
Are there plans to write also the absolute values of the point where the delta mode marker is, to the label? |
Hum, I didn't t have that feature in mind, but if it doesn't overpopulate the text display I don't see much inconvenience on implementing that. |
Hello all,
This PR modifies the existing code of the Marker class so as to allow the marker objects to work as delta markers. Additionally, it was modified the MarkerDialog class to let the user to decide de line width and the color of the markers.
It is not a big contribution, but I hope it helps ;)
Normal mode
Delta mode
MarkerDialog window
P.S.: Originally, my idea was to include the markers in the dataset to perform math operations in the display window, like the ADS does,... but, at some point, I've realized that Qucs cannot handle equations after the simulation :(