Skip to content

Commit

Permalink
*Updated to make compatible with omc changes
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2942 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Henrik Eriksson committed Oct 9, 2007
1 parent ab51bdd commit e77e12a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 23 deletions.
31 changes: 16 additions & 15 deletions OMNotebook/Pltpkg2/Pltpkg2.vcproj
Expand Up @@ -77,8 +77,9 @@
Optimization="2"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
ImproveFloatingPointConsistency="FALSE"
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
OptimizeForProcessor="0"
AdditionalIncludeDirectories=""$(QTHOME)\include\QtCore";"$(QTHOME)\include\QtGui";"$(QTHOME)\include";.;"$(QTHOME)\include\ActiveQt";debug;"$(QTHOME)\mkspecs\win32-msvc.net""
PreprocessorDefinitions="NDEBUG,_WINDOWS,UNICODE,QT_LARGEFILE_SUPPORT,WIN32,QT_DLL,QT_NO_DEBUG,QT_GUI_LIB,QT_CORE_LIB,QT_THREAD_SUPPORT"
GeneratePreprocessedFile="0"
Expand Down Expand Up @@ -160,18 +161,18 @@
RelativePath="lineGroup.cpp">
</File>
<File
RelativePath="debug\moc_compoundWidget.cpp">
RelativePath="release\moc_compoundWidget.cpp">
<FileConfiguration
Name="Release|Win32"
Name="Debug|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="release\moc_compoundWidget.cpp">
RelativePath="debug\moc_compoundWidget.cpp">
<FileConfiguration
Name="Debug|Win32"
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
Expand All @@ -195,6 +196,15 @@
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="debug\moc_graphWindow.cpp">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath="release\moc_graphWindow.cpp">
<FileConfiguration
Expand All @@ -205,7 +215,7 @@
</FileConfiguration>
</File>
<File
RelativePath="debug\moc_graphWindow.cpp">
RelativePath=".\debug\moc_legendLabel.cpp">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
Expand All @@ -229,15 +239,6 @@
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
</FileConfiguration>
</File>
<File
RelativePath=".\debug\moc_legendLabel.cpp">
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\release\moc_preferenceWindow.cpp">
<FileConfiguration
Expand Down
27 changes: 20 additions & 7 deletions OMNotebook/Pltpkg2/graphWidget.cpp
Expand Up @@ -488,6 +488,7 @@ fitInView(graphicsScene->sceneRect());
void GraphWidget::getData()
{
disconnect(activeSocket, SIGNAL(readyRead()), 0, 0);
connect(activeSocket, SIGNAL(readyRead()), this, SLOT(getData()));

while(activeSocket->bytesAvailable())
{
Expand Down Expand Up @@ -529,6 +530,7 @@ void GraphWidget::getData()
else if(command == QString("drawEllipse"))
{
drawEllipse(ds);
activeSocket->disconnect();
}
else if(command == QString("closeServer"))
{
Expand Down Expand Up @@ -694,17 +696,21 @@ void GraphWidget::mouseReleaseEvent ( QMouseEvent * event )
bottom = zoomEnd.y();
}

bottom += mapToScene(0,0,0,this->horizontalScrollBar()->height()).boundingRect().height();
right += mapToScene(0,0,this->verticalScrollBar()->width(), 0).boundingRect().width();
// bottom += mapToScene(0,0,0,this->horizontalScrollBar()->height()).boundingRect().height();
// right += mapToScene(0,0,this->verticalScrollBar()->width(), 0).boundingRect().width();


QRectF r(left, bottom, right-left, top-bottom);

// QRectF r(left, bottom, right-left, top-bottom);

QRectF r(QPointF(left,top),QPointF(right, bottom));
if(!r.width() || !r.height())
return;


// fitInView(r);
// setArea(r);

zoomIn(r);

double xScale = matrix().m11()/125;
Expand Down Expand Up @@ -741,6 +747,8 @@ void GraphWidget::zoomIn(QRectF r)

// if(graphicsScene->gridVisible)
// showGrid(true);


showGrid(graphicsScene->gridVisible);
}

Expand Down Expand Up @@ -1003,6 +1011,7 @@ void GraphWidget::createGrid(bool numbersOnly)
}
else
{

if(!numbersOnly)
{
for(qreal y = yMin-yMajorDist; y < 1.5* yMajorDist + yMax ; y+= yMinorDist)
Expand Down Expand Up @@ -1141,12 +1150,14 @@ void GraphWidget::setArea(const QRectF& r)
current.setBottom(r.bottom());


graphicsScene->setSceneRect(current);
setSceneRect(current);

fitInView(r);
graphicsScene->setSceneRect(current);
setSceneRect(current);

fitInView(r); //uu

setCurrentArea(mapToScene(rect()).boundingRect());
// setCurrentArea(r);
update(rect());
}

Expand Down Expand Up @@ -1710,7 +1721,9 @@ void GraphWidget::plotPtolemyDataStream()
showGrid(grid);

double xmin, xmax, ymin, ymax;
ds >> xmin >> xmax >> ymin >> ymax;
if(dataStreamVersion < 1.2)
ds >> xmin >> xmax >> ymin >> ymax;

int logX, logY;
ds >> logX >> logY;
QString interpolation;
Expand Down
2 changes: 1 addition & 1 deletion OMNotebook/Pltpkg2/graphWidget.h
Expand Up @@ -211,7 +211,7 @@ public slots:
return currentArea_;
}

void setCurrentArea(QRectF& r)
void setCurrentArea(const QRectF& r)
{
currentArea_ = r;
}
Expand Down

0 comments on commit e77e12a

Please sign in to comment.