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

Dc bias points bug #277

Closed
wants to merge 1 commit into from
Closed

Dc bias points bug #277

wants to merge 1 commit into from

Conversation

nvdl
Copy link
Contributor

@nvdl nvdl commented Jun 16, 2015

@@ -46,12 +46,16 @@ mySpinBox::mySpinBox(int Min, int Max, int Step, double *Val, QWidget *Parent)
using namespace std;
QString mySpinBox::textFromValue(int Val) const
{
if (Values == NULL) return "";

cout<<"Values + Val"<<*(Values+Val)<<endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use qDebug() << "message"; , so we can silence this on the released code.

@guitorri
Copy link
Member

Your patch seems to fix the crash. Please squash to a single commit.

@guitorri
Copy link
Member

For some reason, with your example, the spinbox does not update the net bias values... ?!

@in3otd
Copy link
Contributor

in3otd commented Jun 18, 2015

...the values do not change because the sweep parameter R4 is not used...
@nvdl, the parameter R4 needs to be used as the value of a property, so if you would like to sweep the value of R4 you should assign R4 to its R property, i.e. have R=R4 in its properties.

@nvdl
Copy link
Contributor Author

nvdl commented Jun 18, 2015

@in3otd I agree, realized that later.
But, did not consider that important to upload the edited one.
Can upload the edited example later if needed.

@guitorri You know now.
Better use qDebug() << "message"; , so we can silence this on the released code.
I did not write this but can update it.
Or better scan all the code for "cout" and replace that with "qDebug".

Current squash: 51ab6de

@in3otd
Copy link
Contributor

in3otd commented Jun 19, 2015

@nvdl, no need to upload the edited example, just a comment when you spotted the unused sweep parameter would have been enough.

I see that 51ab6de contains the squashed commits but your branch dc-bias-points-bug still contains also the old commits plus a merge commit on top, which is strange.
I expected to see just a single commit after squashing all the commits.
I think you could do, on the dc-bias-points-bug branch
git rebase -i ced40f9
then leave just the line
pick 51ab6de D.C bias points calculation bug fix.
when selecting the commits to keep, and only the commit 51ab6de should remain.
Then use git push -f to update the branch on your work, to rewrite it with this single commit. This will be automatically reflected in this pull request.

@nvdl nvdl force-pushed the dc-bias-points-bug branch 2 times, most recently from 5b11c71 to 67a8fbc Compare June 20, 2015 09:26
D.C bias points calculation bug fix; cleanup.

Removed commented out test code.
@nvdl nvdl force-pushed the dc-bias-points-bug branch from 67a8fbc to 320a17e Compare June 20, 2015 09:49
@nvdl
Copy link
Contributor Author

nvdl commented Jun 20, 2015

@in3otd
then leave just the line
pick 51ab6de D.C bias points calculation bug fix.
when selecting the commits to keep, and only the commit 51ab6de should remain.

I lost previous commits this way. The others need to be "squahed" or "fixed" in.
So it is not just one line that should be left in the "rebase" configuration.

Or possibly I did not follow you.

Nevertheless, I started from scratch and squashed commits.

@in3otd
Copy link
Contributor

in3otd commented Jun 20, 2015

sorry @nvdl my understanding was that 51ab6de was already the result of the squashed commits. In any case your old commits should not have been completely lost, they are just not "linked" to the other commits anymore, Using git reflog you should be able to find their reference and access them. In the worst case, I still have a local copy of your branch, as it was when you opened the PR.

@nvdl
Copy link
Contributor Author

nvdl commented Jun 20, 2015

@in3otd I did git reflog and squashed the commits again. Nothing lost on my side. Now, there is only one commit in the PR. Git is amazing once one figures out where the accelerator and brake is.

@in3otd
Copy link
Contributor

in3otd commented Jun 20, 2015

Git is amazing once one figures out where the accelerator and brake is.

100% agree, the problem is when one mistakenly swaps the two; it happens, sometimes 😁

@guitorri
Copy link
Member

Two things.

  • @nvdl please try to keep commits independent of each other. You mixed up the fix for the issue with code formatting. This makes it hard to spot where the fix start/end. Two commits would be better in this case. Furthermore, we are planing to use a code formatting tool (clang-format) to format the whole codebase at once...
  • after merging the code from @felix-salfelder the patch in this PR is not working anymore.

The crash is still happening when dereferencing the double pointers:
https://github.com/Qucs/qucs/blob/master/qucs/qucs/dialogs/sweepdialog.cpp#L49
https://github.com/Qucs/qucs/blob/master/qucs/qucs/dialogs/sweepdialog.cpp#L140
https://github.com/Qucs/qucs/blob/master/qucs/qucs/dialogs/sweepdialog.cpp#L194
https://github.com/Qucs/qucs/blob/master/qucs/qucs/dialogs/sweepdialog.cpp#L223

Need to sleep now...

@nvdl
Copy link
Contributor Author

nvdl commented Jun 22, 2015

OK. I will have a look later.

@in3otd
Copy link
Contributor

in3otd commented Jun 23, 2015

yeah, I was also taking a look at this yesterday evening, then almost fell asleep on the keyboard. My impression was that the problem might be in Graph::loadDatFile but I am really not sure. It might explain why the problem was also present in 0.0.18 .

I agree for the commit formatting, it was quite difficult to understand where the functional modifications and the "cosmetic" ones were. My suggestion is to avoid altogether to change the code formatting around: as guitorri said, we will (hopefully soon) have an automatic code formatting, as we know that the current style is not consistent.
Also I will suggest to use more descriptive commit messages. There are many guides around best practices for commit messages, see here and here. Also this is rather subjective, but the underlying principle is that code is read much more often than it is written. Imagine your commit message will be read a few months or years later, maybe by someone not familiar with that code and try explain in detail what you did and why. Sure, sometimes we do not follow this ourselves, but strive to improve our coding practices and set a higher standard. 😁
I suggest to update your master to pull in the latest changes and restart anew your branch from there.

@felix-salfelder
Copy link
Member

guitorri: yes, i've run into the dc_bias code when experimenting with the data backend... i do not understand either the dc bias code nor the proposed PR -- now waiting for the cleaned up commit that in3otd is pointing to (i wouldn't mind to do the rebase to the current master).

@guitorri
Copy link
Member

I will close this. Let us go back to the issue #272.

@guitorri guitorri closed this Jun 23, 2015
@nvdl
Copy link
Contributor Author

nvdl commented Jun 23, 2015

Sure, looks like it needs a deeper dive.
Ofcourse, just checking for NULL pointers was hackish as I did not want to go to the origin of the function calls before the data was available.

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