27 { |
27 { |
28 } |
28 } |
29 |
29 |
30 void HWMap::getImage(std::string seed, int filter) |
30 void HWMap::getImage(std::string seed, int filter) |
31 { |
31 { |
32 m_seed = seed; |
32 m_seed = seed; |
33 templateFilter = filter; |
33 templateFilter = filter; |
34 Start(); |
34 Start(); |
35 } |
35 } |
36 |
36 |
37 QStringList HWMap::setArguments() |
37 QStringList HWMap::setArguments() |
38 { |
38 { |
39 QStringList arguments; |
39 QStringList arguments; |
40 arguments << cfgdir->absolutePath(); |
40 arguments << cfgdir->absolutePath(); |
41 arguments << QString("%1").arg(ipc_port); |
41 arguments << QString("%1").arg(ipc_port); |
42 arguments << "landpreview"; |
42 arguments << "landpreview"; |
43 return arguments; |
43 return arguments; |
44 } |
44 } |
45 |
45 |
46 void HWMap::onClientDisconnect() |
46 void HWMap::onClientDisconnect() |
47 { |
47 { |
48 if (readbuffer.size() == 128 * 32 + 1) |
48 if (readbuffer.size() == 128 * 32 + 1) |
49 { |
49 { |
50 quint8 *buf = (quint8*) readbuffer.constData(); |
50 quint8 *buf = (quint8*) readbuffer.constData(); |
51 QImage im(buf, 256, 128, QImage::Format_Mono); |
51 QImage im(buf, 256, 128, QImage::Format_Mono); |
52 im.setNumColors(2); |
52 im.setNumColors(2); |
53 emit HHLimitReceived(buf[128 * 32]); |
53 emit HHLimitReceived(buf[128 * 32]); |
54 emit ImageReceived(im); |
54 emit ImageReceived(im); |
55 } |
55 } |
56 } |
56 } |
57 |
57 |
58 void HWMap::SendToClientFirst() |
58 void HWMap::SendToClientFirst() |
59 { |
59 { |
60 SendIPC(QString("eseed %1").arg(m_seed.c_str()).toLatin1()); |
60 SendIPC(QString("eseed %1").arg(m_seed.c_str()).toLatin1()); |
61 SendIPC(QString("e$template_filter %1").arg(templateFilter).toLatin1()); |
61 SendIPC(QString("e$template_filter %1").arg(templateFilter).toLatin1()); |
62 SendIPC("!"); |
62 SendIPC("!"); |
63 } |
63 } |