window id.
Change-Id: Icd4921538c5e15a2ef98ff9d5febf19a0bcef1e1
* bug 7479 fixed - The diagram did not update its origin on block moving.
+* bug 8630 fixed - Scopes crashed Scilab on simulation when they had the same
+ window id.
+
* bug 8692 fixed - Null block parameters was not checked before encoding.
* bug 8735 fixed - Mixed (Implicit-Explicit) superblocks I/O blocks produced
}
scicos_free(colors);
- /* use only single buffering to be sure to draw on the screen */
- sciSetJavaUseSingleBuffer(scoGetPointerScopeWindow(*pScopeMemory), TRUE);
+ /* use only single buffering to be sure to draw on the screen */
+ if (scoGetPointerScopeWindow(*pScopeMemory) != NULL) {
+ sciSetJavaUseSingleBuffer(scoGetPointerScopeWindow(*pScopeMemory), TRUE);
+ }
}
/*--------------------------------------------------------------------------*/
/** \fn void cevscpe(scicos_block * block, int flag)
/* pFIGURE_FEATURE(pShortDraw)->user_data = NULL; */
/* pFIGURE_FEATURE(pShortDraw)->size_of_user_data = 0; */
/* restore double buffering */
- sciSetJavaUseSingleBuffer(pShortDraw, FALSE);
- scoDelCoupleOfSegments(pScopeMemory);
+ if (pShortDraw) {
+ sciSetJavaUseSingleBuffer(pShortDraw, FALSE);
+ }
}
}
scoFreeScopeMemory(block->work,&pScopeMemory);
scicos_free(xmax);
/* use only single buffering to be sure to draw on the screen */
- sciSetJavaUseSingleBuffer(scoGetPointerScopeWindow(*pScopeMemory), TRUE);
+ if (scoGetPointerScopeWindow(*pScopeMemory) != NULL) {
+ sciSetJavaUseSingleBuffer(scoGetPointerScopeWindow(*pScopeMemory), TRUE);
+ }
}
/*--------------------------------------------------------------------------*/
/** \fn void cmscope(scicos_block * block, int flag)
/*pShortDraw = scoGetPointerScopeWindow(pScopeMemory);*/
clearUserData(figure);
- sciSetJavaUseSingleBuffer(figure, FALSE);
- scoDelCoupleOfPolylines(pScopeMemory);
+ /* restore double buffering */
+ if (figure) {
+ sciSetJavaUseSingleBuffer(figure, FALSE);
+ }
}
}
if (figure != NULL)
{
clearUserData(figure);
+
/* restore double buffering */
- sciSetJavaUseSingleBuffer(figure, FALSE);
- scoDelCoupleOfPolylines(pScopeMemory);
+ if (figure) {
+ sciSetJavaUseSingleBuffer(figure, FALSE);
+ }
}
}
scoAddTitlesScope(*pScopeMemory,label,"x","y",NULL);
}
- /* use only single buffering to be sure to draw on the screen */
- sciSetJavaUseSingleBuffer(scoGetPointerScopeWindow(*pScopeMemory), TRUE);
+ /* use only single buffering to be sure to draw on the screen */
+ if (scoGetPointerScopeWindow(*pScopeMemory) != NULL) {
+ sciSetJavaUseSingleBuffer(scoGetPointerScopeWindow(*pScopeMemory), TRUE);
+ }
}
/*--------------------------------------------------------------------------*/
/** \fn void cscopxy(scicos_block * block, int flag)
/*pFIGURE_FEATURE(Pinceau)->user_data = NULL;
pFIGURE_FEATURE(Pinceau)->size_of_user_data = 0;*/
clearUserData(figure);
+
/* restore double buffering */
- sciSetJavaUseSingleBuffer(figure, FALSE);
+ if (figure) {
+ sciSetJavaUseSingleBuffer(figure, FALSE);
+ }
}
}
scoFreeScopeMemory(block->work, &pScopeMemory);
pSUBWIN_FEATURE(pTemp2)->SRect[1] = xmax[i];
break;
default:
- sciprint(_("SCOPE ERROR : scoInitOfWindow incorrect value for dimension argument.\n"));
+ Coserror(_("Incorrect value for dimension argument."));
break;
}
forceRedraw(pTemp2);
}
else
{
- sciprint(_("This Scope (block number : %d) has same number than another. It has been deactivated!\n"),block_number);
+ Coserror(_("This scope has the same window id than another."));
}
}
/*--------------------------------------------------------------------------*/
break;
}
default:
- sciprint(_("SCOPE ERROR : Cannot use scoRefreshDataBoundsX() with this type of object\n"));
+ Coserror(_("Cannot use %s with this type of object."), "scoRefreshDataBoundsX");
break;
}
/* Dont forget to reinit it */
break;
default:
- sciprint(_("SCOPE ERROR : Cannot use scoDrawScopeAmplitudeTimeStyle() with this type of object\n"));
+ Coserror(_("Cannot use %s with this type of object."), "scoDrawScopeAmplitudeTimeStyle");
break;
}
break;
default:
- sciprint(_("SCOPE ERROR : Cannot use scoDrawScopeAmplitudeTimeStyle() with this type of object\n"));
+ Coserror(_("Cannot use %s with this type of object."), "scoDrawScopeAmplitudeTimeStyle");
break;
}
NbrPtsLong = pSEGS_FEATURE(pLongDraw)->Nbr1;
break;
default:
- sciprint(_("SCOPE ERROR : Cannot use scoDrawScopeAmplitudeTimeStyle() with this type of object\n"));
+ Coserror(_("Cannot use %s with this type of object."), "scoDrawScopeAmplitudeTimeStyle");
break;
}
NbrPtsShort = pSEGS_FEATURE(pShortDraw)->Nbr1;
break;
default:
- sciprint(_("SCOPE ERROR : Cannot use scoDrawScopeAmplitudeTimeStyle() with this type of object\n"));
+ Coserror(_("Cannot use %s with this type of object."), "scoDrawScopeAmplitudeTimeStyle");
break;
}
if (force_update[i] == 1) //** scope need a redraw
NbrPtsLong = pSEGS_FEATURE(pLongDraw)->Nbr1;
break;
default:
- sciprint(_("SCOPE ERROR : Cannot use scoDrawScopeAmplitudeTimeStyle() with this type of object\n"));
+ Coserror(_("Cannot use %s with this type of object."), "scoDrawScopeAmplitudeTimeStyle");
break;
}
pSEGS_FEATURE(pLongDraw)->Nbr2 = NbrPtsLong+NbrPtsShort;
break;
default:
- sciprint(_("SCOPE ERROR : Cannot use scoDrawScopeAmplitudeTimeStyle() with this type of object\n"));
+ Coserror(_("Cannot use %s with this type of object."), "scoDrawScopeAmplitudeTimeStyle");
break;
}
/*End of Block for Memory*/
/* Do Nothing */
break;
default:
- sciprint(_("SCOPE ERROR : Cannot use scoDrawScopeAmplitudeTimeStyle() with this type of object\n"));
+ Coserror(_("Cannot use %s with this type of object."), "scoDrawScopeAmplitudeTimeStyle");
break;
}
}
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+//
+// <-- Non-regression test for bug 8630 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=8630
+//
+// <-- Short Description -->
+// Scilab crash when simulating scopes with the same window ids.
+loadXcosLibs();
+status = importXcosDiagram(SCI + "/modules/xcos/tests/nonreg_tests/bug_8630.xcos");
+if ~status then bugmes();quit;end
+prot = funcprot();
+funcprot(0);
+deff("disp(str)", "");
+funcprot(prot);
+// compile and simulate
+xcos_simulate(scs_m, 4);
+clear disp;
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+//
+// <-- Non-regression test for bug 8630 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=8630
+//
+// <-- Short Description -->
+// Scilab crash when simulating scopes with the same window ids.
+
+loadXcosLibs();
+
+status = importXcosDiagram(SCI + "/modules/xcos/tests/nonreg_tests/bug_8630.xcos");
+if ~status then pause, end
+
+prot = funcprot();
+funcprot(0);
+deff("disp(str)", "");
+funcprot(prot);
+
+// compile and simulate
+xcos_simulate(scs_m, 4);
+
+clear disp;
+