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

ElementCache #145

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@ghost

ghost commented Dec 3, 2014

  • Made ElementCache Qt4 conform. Exchange Q3PtrList to QList and QMutableListIterator.
  • Was a bad boy: Add mutualx.h to cmake file in this PR.
@guitorri

View changes

Show outdated Hide outdated qucs/qucs/schematic.cpp
@@ -1040,7 +1040,7 @@ bool Schematic::rotateElements()
int x1=INT_MAX, y1=INT_MAX;
int x2=INT_MIN, y2=INT_MIN;
Q3PtrList<Element> ElementCache;
QList<Element> ElementCache;

This comment has been minimized.

@guitorri

guitorri Dec 4, 2014

Member

Can you use QList<Element *> ElementCache; instead?
We are using list of pointers everywhere else.

@guitorri

guitorri Dec 4, 2014

Member

Can you use QList<Element *> ElementCache; instead?
We are using list of pointers everywhere else.

@guitorri

View changes

Show outdated Hide outdated qucs/qucs/schematic.cpp
@@ -1059,8 +1059,9 @@ bool Schematic::rotateElements()
Painting *pp;
Component *pc;
WireLabel *pl;
QMutableListIterator<Element> elementCacheIter(ElementCache);

This comment has been minimized.

@guitorri

guitorri Dec 4, 2014

Member

Does it need to be a mutable iterator? Only if the ElementCache is being modified. I did not check ;)

@guitorri

guitorri Dec 4, 2014

Member

Does it need to be a mutable iterator? Only if the ElementCache is being modified. I did not check ;)

@guitorri

View changes

Show outdated Hide outdated qucs/qucs/schematic.cpp
// re-insert elements
for(Element *pe = ElementCache.first(); pe != 0; pe = ElementCache.next())
for(Element *pe = &ElementCache.first(); pe != 0; pe = &elementCacheIter.next())

This comment has been minimized.

@guitorri

guitorri Dec 4, 2014

Member

Perhaps a foreach(Element *pe, ElementCache) is more readable.

@guitorri

guitorri Dec 4, 2014

Member

Perhaps a foreach(Element *pe, ElementCache) is more readable.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Dec 5, 2014

Will do it as soon as possible. It's christmas time :(, family and friends... and I am so tiered...will take some time. :)

ghost commented Dec 5, 2014

Will do it as soon as possible. It's christmas time :(, family and friends... and I am so tiered...will take some time. :)

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Dec 8, 2014

If all is fine, which PtrList you would recommend as next?

ghost commented Dec 8, 2014

If all is fine, which PtrList you would recommend as next?

@yodalee yodalee referenced this pull request Dec 8, 2014

Closed

Refactor worklist #125

3 of 15 tasks complete
@guitorri

This comment has been minimized.

Show comment
Hide comment
@guitorri

guitorri Dec 8, 2014

Member

There is an issue:

  1. add a component to the schematic
  2. select the the component
  3. press rotate/mirroY/mirroX from toolbar or menu
  4. component disappear (!)

If you first select the rotate/mirroY/mirroX and then press over a component it seems to work.

Member

guitorri commented Dec 8, 2014

There is an issue:

  1. add a component to the schematic
  2. select the the component
  3. press rotate/mirroY/mirroX from toolbar or menu
  4. component disappear (!)

If you first select the rotate/mirroY/mirroX and then press over a component it seems to work.

@guitorri

This comment has been minimized.

Show comment
Hide comment
@guitorri

guitorri Dec 8, 2014

Member

Also, can you squash the last two commits?

Member

guitorri commented Dec 8, 2014

Also, can you squash the last two commits?

global667 global667
Q3PtrList to QList for ElementCache
* Made ElementCache Qt4 conform. Exchange the Q3PtrList with QList and
QMutableListIterator.
* Was a bad boy: Add mutualx.h to cmake file.
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Dec 10, 2014

Bug seems fixed to me (Pointer issue). Squashed...

ghost commented Dec 10, 2014

Bug seems fixed to me (Pointer issue). Squashed...

@guitorri

This comment has been minimized.

Show comment
Hide comment
@guitorri

guitorri Dec 11, 2014

Member

Please try to figure out a way to run/exercise the code you just changed.
The last two actions of the menu Positioning are crashing the application. See below:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.qucs                        0x0000000106198012 Schematic::distributeHorizontal() + 866 (schematic_element.cpp:2172)
1   org.qucs                        0x00000001061aba22 QucsApp::slotDistribHoriz() + 66 (qucs_actions.cpp:530)
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.qucs                        0x000000010d5405df Schematic::distributeVertical() + 335 (schematic_element.cpp:2254)
1   org.qucs                        0x000000010d553a92 QucsApp::slotDistribVert() + 66 (qucs_actions.cpp:542)
Member

guitorri commented Dec 11, 2014

Please try to figure out a way to run/exercise the code you just changed.
The last two actions of the menu Positioning are crashing the application. See below:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.qucs                        0x0000000106198012 Schematic::distributeHorizontal() + 866 (schematic_element.cpp:2172)
1   org.qucs                        0x00000001061aba22 QucsApp::slotDistribHoriz() + 66 (qucs_actions.cpp:530)
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.qucs                        0x000000010d5405df Schematic::distributeVertical() + 335 (schematic_element.cpp:2254)
1   org.qucs                        0x000000010d553a92 QucsApp::slotDistribVert() + 66 (qucs_actions.cpp:542)
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Dec 11, 2014

Ah I get it.

Please try to figure out a way to run/exercise the code you just changed.

I test what I know, but I am not very familiar with the qucs interface...will learn it by the way.

ghost commented Dec 11, 2014

Ah I get it.

Please try to figure out a way to run/exercise the code you just changed.

I test what I know, but I am not very familiar with the qucs interface...will learn it by the way.

@guitorri

This comment has been minimized.

Show comment
Hide comment
@guitorri

guitorri Dec 11, 2014

Member

Drop 3 resistors at random in the schematic. Select all of them. Try to distribute horizontally or vertically.

If you do modifications on distributeHorizontal() try to see where it is being used. With a few mouse clicks or grep commands you can trace it to the menu action that triggers that code. For the moment this is the only way to test the UI, manually following the code path. 😄

Member

guitorri commented Dec 11, 2014

Drop 3 resistors at random in the schematic. Select all of them. Try to distribute horizontally or vertically.

If you do modifications on distributeHorizontal() try to see where it is being used. With a few mouse clicks or grep commands you can trace it to the menu action that triggers that code. For the moment this is the only way to test the UI, manually following the code path. 😄

@nvdl nvdl referenced this pull request Apr 22, 2015

Closed

GUI related issues #238

18 of 31 tasks complete
@guitorri

This comment has been minimized.

Show comment
Hide comment
@guitorri

guitorri Apr 24, 2015

Member

Should be fixed in #241

Member

guitorri commented Apr 24, 2015

Should be fixed in #241

@guitorri guitorri closed this Apr 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment