MiniDisplay/minidisplay.cpp
changeset 11 b935de604982
parent 10 64cfde8062c7
child 12 f0c61338a2e8
     1.1 --- a/MiniDisplay/minidisplay.cpp	Wed May 28 17:08:47 2014 +0200
     1.2 +++ b/MiniDisplay/minidisplay.cpp	Wed May 28 18:44:15 2014 +0200
     1.3 @@ -19,6 +19,7 @@
     1.4  MiniDisplay::~MiniDisplay()
     1.5  {
     1.6      //qDebug() << "Delete MiniDisplay";
     1.7 +    close();
     1.8  }
     1.9  
    1.10  
    1.11 @@ -39,6 +40,18 @@
    1.12  
    1.13  void MiniDisplay::close()
    1.14  {
    1.15 +    //qDebug() << "MiniDisplay::close";
    1.16 +    //Try to put back ourframe position to RAM 0,0 which is a multiple of 128
    1.17 +    if (iDisplay.IsOpen())
    1.18 +    {
    1.19 +        emit closing();
    1.20 +
    1.21 +        if (iDisplay.DisplayPositionY()%128!=0)
    1.22 +        {
    1.23 +            //qDebug() << "SwapBuffer to put back our frame position to zero " << iDisplay.DisplayPositionY();
    1.24 +            iDisplay.SwapBuffers();
    1.25 +        }
    1.26 +    }
    1.27      iDisplay.Close();
    1.28      emit closed();
    1.29      emit statusChanged();
    1.30 @@ -234,4 +247,19 @@
    1.31      iDisplay.SetBrightness(aBrightness);
    1.32  }
    1.33  
    1.34 +QPoint MiniDisplay::framePosition() const
    1.35 +{
    1.36 +    return QPoint(iDisplay.DisplayPositionX(),iDisplay.DisplayPositionX());
    1.37 +}
    1.38  
    1.39 +void MiniDisplay::setFramePosition(const QPoint& aPoint)
    1.40 +{
    1.41 +    iFramePosition = aPoint;
    1.42 +
    1.43 +    if (!iDisplay.IsOpen()) return;
    1.44 +
    1.45 +    iDisplay.SetDisplayPosition(aPoint.x(),aPoint.y());
    1.46 +}
    1.47 +
    1.48 +
    1.49 +