Line 53... |
Line 53... |
setWindowTitle(tr("Map"));
|
setWindowTitle(tr("Map"));
|
|
|
posinfoSize = QSize(340, 200);
|
posinfoSize = QSize(340, 200);
|
posinfoPixmap = QPixmap(posinfoSize);
|
posinfoPixmap = QPixmap(posinfoSize);
|
|
|
AttributeType serial_name;
|
const AttributeType *cfg = igui_->getpConfig();
|
igui_->getWidgetsAttribute("Serial", &serial_name);
|
const AttributeType &serial_name = (*cfg)["Serial"];
|
if (serial_name.is_string()) {
|
if (serial_name.is_string()) {
|
uart_ = static_cast<ISerial *>
|
uart_ = static_cast<ISerial *>
|
(RISCV_get_service_iface(serial_name.to_string(), IFACE_SERIAL));
|
(RISCV_get_service_iface(serial_name.to_string(), IFACE_SERIAL));
|
if (uart_) {
|
if (uart_) {
|
uart_->registerRawListener(static_cast<IRawListener *>(this));
|
uart_->registerRawListener(static_cast<IRawListener *>(this));
|
Line 68... |
Line 68... |
QDateTime sd = QDateTime::currentDateTime();
|
QDateTime sd = QDateTime::currentDateTime();
|
qsrand(sd.toTime_t());
|
qsrand(sd.toTime_t());
|
int pos_init_idx =
|
int pos_init_idx =
|
qrand() % static_cast<int>(sizeof(defaultPos)/sizeof(QPointF));
|
qrand() % static_cast<int>(sizeof(defaultPos)/sizeof(QPointF));
|
|
|
|
#if 0
|
|
pos_init_idx = 0;
|
|
double lat = defaultPos[pos_init_idx].x() + (double)(rand() & 0x1f)/100000.0;
|
|
double lon = defaultPos[pos_init_idx].y()+ (double)(rand() & 0x1f)/100000.0;
|
|
for (int x = 0; x < 20; x++) {
|
|
gpsLat_.put(lat);
|
|
gpsLon_.put(lon);
|
|
lat = defaultPos[pos_init_idx].x() + (double)(rand() & 0x1f)/100000.0;
|
|
lon = defaultPos[pos_init_idx].y() + (double)(rand() & 0x1f)/100000.0;
|
|
}
|
|
#endif
|
m_normalMap->setCenterCoord(defaultPos[pos_init_idx]);
|
m_normalMap->setCenterCoord(defaultPos[pos_init_idx]);
|
m_miniMap->setCenterCoord(defaultPos[pos_init_idx]);
|
m_miniMap->setCenterCoord(defaultPos[pos_init_idx]);
|
}
|
}
|
|
|
MapWidget::~MapWidget() {
|
MapWidget::~MapWidget() {
|
Line 120... |
Line 131... |
}
|
}
|
AttributeType &lms = gps["LMS"];
|
AttributeType &lms = gps["LMS"];
|
if (!lms.is_list() || lms.size() < 8) {
|
if (!lms.is_list() || lms.size() < 8) {
|
return;
|
return;
|
}
|
}
|
|
if (lms[0u].to_int() == 0) {
|
|
return;
|
|
}
|
double lat, lon;
|
double lat, lon;
|
lat = static_cast<double>(lms[1].to_int());
|
lat = static_cast<double>(lms[1].to_int());
|
lat += lms[2].to_float() / 60.0;
|
lat += lms[2].to_float() / 60.0;
|
if (lms[3].is_equal("S")) {
|
if (lms[3].is_equal("S")) {
|
lat = -lat;
|
lat = -lat;
|
Line 156... |
Line 170... |
|
|
void MapWidget::slotActionClear() {
|
void MapWidget::slotActionClear() {
|
//for (int i=0; i<DataTotal; i++) {
|
//for (int i=0; i<DataTotal; i++) {
|
//pPosTrack[i]->clear();
|
//pPosTrack[i]->clear();
|
//}
|
//}
|
|
gpsLat_.clear();
|
|
gpsLon_.clear();
|
renderAll();
|
renderAll();
|
update();
|
update();
|
}
|
}
|
|
|
void MapWidget::slotActionNightMode() {
|
void MapWidget::slotActionNightMode() {
|
Line 279... |
Line 295... |
p.drawLine(startx, starty + 2, startx, starty - 2);
|
p.drawLine(startx, starty + 2, startx, starty - 2);
|
p.drawLine(endx - 2, endy, endx + 2, endy);
|
p.drawLine(endx - 2, endy, endx + 2, endy);
|
p.drawLine(endx, endy + 2, endx, endy - 2);
|
p.drawLine(endx, endy + 2, endx, endy - 2);
|
|
|
trackTextColor.setRgb(0xff, 0xff, 0xff, 0xc0);
|
trackTextColor.setRgb(0xff, 0xff, 0xff, 0xc0);
|
|
p.setPen(trackTextColor);
|
p.drawText(endx + 6, h + trkIdx*(h + 5) + 1, strPosition);
|
p.drawText(endx + 6, h + trkIdx*(h + 5) + 1, strPosition);
|
trackTextColor.setRgb(0x20, 0x20, 0x20, 0xff);
|
trackTextColor.setRgb(0x20, 0x20, 0x20, 0xff);
|
p.setPen(trackTextColor);
|
p.setPen(trackTextColor);
|
p.drawText(endx + 5, h + trkIdx*(h + 5), strPosition);
|
p.drawText(endx + 5, h + trkIdx*(h + 5), strPosition);
|
}
|
}
|