QTfrontend/hwmap.cpp
changeset 1790 c84223511ca8
parent 1066 1f1b3686a2b0
child 1791 7c9d645d2591
--- a/QTfrontend/hwmap.cpp	Sat Feb 14 16:23:51 2009 +0000
+++ b/QTfrontend/hwmap.cpp	Sat Feb 14 16:24:20 2009 +0000
@@ -17,7 +17,7 @@
 
 #include "hwconsts.h"
 #include "hwmap.h"
-
+										#include <QDebug>
 HWMap::HWMap() :
   TCPBase(false)
 {
@@ -44,9 +44,14 @@
 
 void HWMap::onClientDisconnect()
 {
-  QImage im((uchar*)(readbuffer.constData()), 256, 128, QImage::Format_Mono);
-  im.setNumColors(2);
-  emit ImageReceived(im);
+	if (readbuffer.size() == 128 * 32 + 1)
+	{
+		quint8 *buf = (quint8*) readbuffer.constData();
+		QImage im(buf, 256, 128, QImage::Format_Mono);
+		im.setNumColors(2);
+		emit HHLimitReceived(buf[128 * 32 + 1]);
+		emit ImageReceived(im);
+	}
 }
 
 void HWMap::SendToClientFirst()