QCAD

QCAD - 2D CAD System.

Click here for a documentation of the DokuWiki formatting syntax that can be used in reports

Please search for existing tasks (also closed ones) before opening a new task.

Please make sure that you are using the latest Version of QCAD before posting a bug (menu Help - Check for Updates)

Tasklist

FS#157 - rotate causes uncaught exception

Attached to Project: QCAD
Opened by Martin (martin) - Friday, 05 August 2011, 14:30 GMT+2
Last edited by Martin (martin) - Monday, 08 August 2011, 17:27 GMT+2
Task Type Bug Report
Category Main
Status Closed
Assigned To Andrew (andrew)
Operating System All
Severity Medium
Priority Normal
Reported Version Development
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

  1. draw line
  2. Modify → Rotate
    • center point: line end point
    • delete original
    • angle 90°
Uncaught exception at scripts/Modify/Rotate/Rotate.js:117: Error: :-1:-1: Wrong number/types of arguments
for RDocumentInterface.applyOperation().
<native>(undefined) at -1
<anonymous>(event = RCoordinateEvent(0xbfffd478), preview = false) at scripts/Modify/Rotate/Rotate.js:117
<anonymous>(event = RCoordinateEvent(0xbfffd478)) at
/home/martin/workspace/rsframework/scripts/Modify/../EAction.js:1197
<global>() at -1
117	                di.applyOperation(this.getOperation(false));
This task depends upon

Closed by  Martin (martin)
Monday, 08 August 2011, 17:27 GMT+2
Reason for closing:  Fixed
Comment by Andrew (andrew) - Friday, 05 August 2011, 15:34 GMT+2

I cannot reproduce that.
Can you try again?
If the debugger shows, what is the return value of "this.getOperation(false)"?
If that is undefined, can you try to step into this.getOperation(false) and see where it fails?

Comment by Martin (martin) - Friday, 05 August 2011, 15:45 GMT+2
.eval this.getOperation(false)==undefined
Rotate.prototype.getOperation = function(preview) {
    if (!isValidVector(this.centerPoint)) {
=>        return undefined;
    }
...
qsdb> this.centerPoint == undefined
true
Comment by Andrew (andrew) - Friday, 05 August 2011, 15:51 GMT+2

Committed potential fix. The tool might not do anything anymore though, if this.centerPoint is NULL.

Comment by Martin (martin) - Friday, 05 August 2011, 16:23 GMT+2

nope, still the same

Comment by Martin (martin) - Monday, 08 August 2011, 16:27 GMT+2

similar problem with scale:

Uncaught exception at scripts/Modify/Scale/Scale.js:123: Error: :-1:-1: Wrong number/types of arguments for RDocumentInterface.applyOperation().
<native>(undefined) at -1
<anonymous>(event = RCoordinateEvent(0xbfffd478), preview = false) at scripts/Modify/Scale/Scale.js:123
<anonymous>(event = RCoordinateEvent(0xbfffd478)) at /home/martin/workspace/rsframework/scripts/Modify/../EAction.js:1197
<global>() at -1
123	                di.applyOperation(op);
Scale.prototype.getOperation = function(preview) {
    if (!isValidVector(this.focusPoint)) {
=>        return undefined;
    }
Comment by Andrew (andrew) - Monday, 08 August 2011, 16:35 GMT+2

I still cannot reproduce this here.

I've added some debugging output to Rotate.js. Can you pls post the output here? Thx.

Edit: I've also added some fail safe code, it might not show the same symptoms anymore.

Comment by Martin (martin) - Monday, 08 August 2011, 16:47 GMT+2

doesn't crash anymore, but does nothing now

Debug:    updateScenes... 
Debug:    updateGuiActions... 
Debug:    notifyListenersSlot... 
Debug:    setActiveSubwindow... 
Warning:  QScriptEngine::newVariant(): changing class of non-QScriptObject not supported
Warning:  RScriptHandlerEcma::createActionDocumentLevel():  "scripts/Snap/Auto/Auto.js" : Engine is busy. Aborting... 
Warning:  RScriptHandlerEcma::createActionDocumentLevel():  "scripts/Snap/RestrictOff/RestrictOff.js" : Engine is busy. Aborting... 
Debug:    Rotate.setState: setting this.centerPoint to undefined 
Debug:    Rotate.pickCoordinate: setting this.centerPoint to  RVector(12, 16, 0)  
Debug:    updateScenes... 
Debug:    updateGuiActions... 
Debug:    notifyListenersSlot... 
Warning:  RScriptHandlerEcma::createActionDocumentLevel():  "scripts/Snap/Auto/Auto.js" : Engine is busy. Aborting... 
Warning:  RScriptHandlerEcma::createActionDocumentLevel():  "scripts/Snap/RestrictOff/RestrictOff.js" : Engine is busy. Aborting... 
Debug:    setActiveSubwindow... 
Debug:    Rotate.setState: setting this.centerPoint to undefined 
Debug:    Rotate.getOperation: failed, this.centerPoint is not valid 
Debug:    updateScenes... 
Debug:    updateGuiActions... 
Debug:    notifyListenersSlot... 
Debug:    setActiveSubwindow... 
Debug:    Rotate.setState: setting this.centerPoint to undefined 
Debug:    updateScenes... 
Debug:    updateGuiActions... 
Debug:    notifyListenersSlot... 
Warning:  QScriptEngine::newVariant(): changing class of non-QScriptObject not supported
Warning:  QScriptEngine::newVariant(): changing class of non-QScriptObject not supported
Debug:    setActiveSubwindow... 
Comment by Andrew (andrew) - Monday, 08 August 2011, 16:58 GMT+2

Thanks. I can reproduce it now. Looks like under Linux there's a focus change when the dialog opens. I can simulate that by switching applications. Will try to fix.

Comment by Andrew (andrew) - Monday, 08 August 2011, 17:01 GMT+2

rotate should be fixed now, please confirm, then I'll fix scale

Comment by Martin (martin) - Monday, 08 August 2011, 17:01 GMT+2

yes, the dialog is surrounded with a blue border, means it has he focus (the focus taken away from the main window)

Comment by Martin (martin) - Monday, 08 August 2011, 17:03 GMT+2

rotate is OK now

Comment by Andrew (andrew) - Monday, 08 August 2011, 17:12 GMT+2

OK, updated scale as well.

Loading...