QT_BEGIN_NAMESPACE QGeoMap::QGeoMap(QGeoMapData *mapData, QObject *parent) : QObject(parent), mapData_(mapData) { connect(mapData_, SIGNAL(cameraDataChanged(const QGeoCameraData&)), this, SIGNAL(cameraDataChanged(const QGeoCameraData&))); connect(mapData_, SIGNAL(updateRequired()), this, SIGNAL(updateRequired())); connect(mapData_, SIGNAL(activeMapTypeChanged()), this, SIGNAL(activeMapTypeChanged())); connect(mapData_, SIGNAL(copyrightsChanged(const QImage&, const QPoint&)), this, SIGNAL(copyrightsChanged(const QImage&, const QPoint&))); }
void MeshWidgetChart::init() { setFont(QFont("Sans Serif", 11, QFont::Bold)); m_action = new QAction(m_title, this); m_action->setCheckable(true); m_action->setChecked(true); m_spacing = 7; connect(m_action, SIGNAL(toggled(bool)), this, SLOT(setVisible(bool))); connect(&m_topItem, SIGNAL(updateRequired()), this, SLOT(updateItems())); }
/*! \internal this function will only be ever called once */ void QDeclarativeGeoMap::mappingManagerInitialized() { m_mappingManagerInitialized = true; m_map = m_mappingManager->createMap(this); m_gestureArea->setMap(m_map); // once mappingManagerInitilized_ is set zoomLevel() returns the default initialised // zoom level of the map controller. Overwrite it here to whatever the user chose. m_map->mapController()->setZoom(m_zoomLevel); //The zoom level limits are only restricted by the plugins values, if the user has set a more //strict zoom level limit before initialization nothing is done here. if (m_mappingManager->cameraCapabilities().minimumZoomLevel() > m_gestureArea->minimumZoomLevel()) setMinimumZoomLevel(m_mappingManager->cameraCapabilities().minimumZoomLevel()); if (m_gestureArea->maximumZoomLevel() < 0 || m_mappingManager->cameraCapabilities().maximumZoomLevel() < m_gestureArea->maximumZoomLevel()) setMaximumZoomLevel(m_mappingManager->cameraCapabilities().maximumZoomLevel()); m_map->setActiveMapType(QGeoMapType()); m_copyrights = new QDeclarativeGeoMapCopyrightNotice(this); connect(m_map, SIGNAL(copyrightsChanged(QImage)), m_copyrights.data(), SLOT(copyrightsChanged(QImage))); connect(m_map, SIGNAL(copyrightsChanged(QString)), m_copyrights.data(), SLOT(copyrightsChanged(QString))); connect(m_copyrights.data(), SIGNAL(linkActivated(QString)), this, SIGNAL(copyrightLinkActivated(QString))); connect(m_map, SIGNAL(updateRequired()), this, SLOT(update())); connect(m_map->mapController(), SIGNAL(centerChanged(QGeoCoordinate)), this, SLOT(mapCenterChanged(QGeoCoordinate))); connect(m_map->mapController(), SIGNAL(zoomChanged(qreal)), this, SLOT(mapZoomLevelChanged(qreal))); m_map->mapController()->setCenter(m_center); QList<QGeoMapType> types = m_mappingManager->supportedMapTypes(); for (int i = 0; i < types.size(); ++i) { QDeclarativeGeoMapType *type = new QDeclarativeGeoMapType(types[i], this); m_supportedMapTypes.append(type); } if (!m_supportedMapTypes.isEmpty()) { QDeclarativeGeoMapType *type = m_supportedMapTypes.at(0); m_activeMapType = type; m_map->setActiveMapType(type->mapType()); } // Map tiles are built in this call m_map->resize(width(), height()); // This prefetches a buffer around the map m_map->prefetchData(); m_map->update(); connect(m_mappingManager, SIGNAL(supportedMapTypesChanged()), this, SLOT(onSupportedMapTypesChanged())); emit minimumZoomLevelChanged(); emit maximumZoomLevelChanged(); emit supportedMapTypesChanged(); emit activeMapTypeChanged(); // Any map items that were added before the plugin was ready // need to have setMap called again foreach (const QPointer<QDeclarativeGeoMapItemBase> &item, m_mapItems) { if (item) item.data()->setMap(this, m_map); } }
/*! \internal this function will only be ever called once */ void QDeclarativeGeoMap::mappingManagerInitialized() { mappingManagerInitialized_ = true; map_ = mappingManager_->createMap(this); gestureArea_->setMap(map_); //The zoom level limits are only restricted by the plugins values, if the user has set a more //strict zoom level limit before initialization nothing is done here. if (mappingManager_->cameraCapabilities().minimumZoomLevel() > gestureArea_->minimumZoomLevel()) setMinimumZoomLevel(mappingManager_->cameraCapabilities().minimumZoomLevel()); if (gestureArea_->maximumZoomLevel() < 0 || mappingManager_->cameraCapabilities().maximumZoomLevel() < gestureArea_->maximumZoomLevel()) setMaximumZoomLevel(mappingManager_->cameraCapabilities().maximumZoomLevel()); map_->setActiveMapType(QGeoMapType()); copyrightsWPtr_ = new QDeclarativeGeoMapCopyrightNotice(this); connect(map_, SIGNAL(copyrightsChanged(QImage,QPoint)), copyrightsWPtr_.data(), SLOT(copyrightsChanged(QImage,QPoint))); connect(map_, SIGNAL(updateRequired()), this, SLOT(update())); connect(map_->mapController(), SIGNAL(centerChanged(QGeoCoordinate)), this, SIGNAL(centerChanged(QGeoCoordinate))); connect(map_->mapController(), SIGNAL(zoomChanged(qreal)), this, SLOT(mapZoomLevelChanged(qreal))); map_->mapController()->setCenter(center_); map_->mapController()->setZoom(zoomLevel_); QList<QGeoMapType> types = mappingManager_->supportedMapTypes(); for (int i = 0; i < types.size(); ++i) { QDeclarativeGeoMapType *type = new QDeclarativeGeoMapType(types[i], this); supportedMapTypes_.append(type); } if (!supportedMapTypes_.isEmpty()) { QDeclarativeGeoMapType *type = supportedMapTypes_.at(0); activeMapType_ = type; map_->setActiveMapType(type->mapType()); } // Map tiles are built in this call map_->resize(width(), height()); // This prefetches a buffer around the map map_->cameraStopped(); map_->update(); emit minimumZoomLevelChanged(); emit maximumZoomLevelChanged(); emit supportedMapTypesChanged(); emit activeMapTypeChanged(); // Any map items that were added before the plugin was ready // need to have setMap called again foreach (const QPointer<QDeclarativeGeoMapItemBase> &item, mapItems_) { if (item) item.data()->setMap(this, map_); } }
void EmsData::flashBlockUpdate(unsigned short locationid, QByteArray header, QByteArray payload) { QLOG_TRACE() << "Flash Block retrieved:" << "0x" + QString::number(locationid,16).toUpper(); Q_UNUSED(header) for (int l=0;l<getChildrenOfLocalFlashLocation(locationid).size();l++) { unsigned short childid = getChildrenOfLocalFlashLocation(locationid)[l]; QList<ConfigBlock> configlist = m_memoryMetaData->getConfigMetaData(QString::number(childid,16).toUpper()); QLOG_TRACE() << "Location" << QString::number(childid,16).toUpper() << "Size:" << configlist.size(); for (int i=0;i<configlist.size();i++) { //configlist[i].offset() QString valstr = ""; QString bytestr = ""; for (int k=0;k<configlist[i].size();k++) { unsigned int value = 0; for (int j=0;j<configlist[i].elementSize();j++) { //QLOG_DEBUG() << (unsigned char)block[m_fieldConfigList[i].second.offset() + (k * m_fieldConfigList[i].second.elementSize()) + j]; bytestr += QString::number((unsigned char)payload[configlist[i].offset() + (k * configlist[i].elementSize()) + j],16).toUpper() + ","; value += ((unsigned char)payload[configlist[i].offset() + (k * configlist[i].elementSize()) + j]) << (8 * (configlist[i].elementSize() - (j+1))); } //userValue = (ecuValue + translate) * scale valstr += QString::number(calcAxis(value,configlist[i].calc())) + ","; } valstr = valstr.mid(0,valstr.length()-1); QLOG_DEBUG() << "Pre value:" << "0x" + QString::number(locationid,16) << bytestr; //valstr == variable. emit configRecieved(configlist[i],QVariant(valstr)); } } if (!verifyMemoryBlock(locationid,header,payload)) { //QMessageBox::information(this,"Error","Flash Location ID 0x" + QString::number(locationid,16).toUpper() + " should be 1024 sized, but it is " + QString::number(payload.size()) + ". This should never happen"); QLOG_ERROR() << "Flash Location ID 0x" + QString::number(locationid,16).toUpper() + " should be 1024 sized, but it is " + QString::number(payload.size()) + ". This should never happen"; return; } if (hasDeviceFlashBlock(locationid)) { if (getDeviceFlashBlock(locationid).isEmpty()) { setLocalFlashBlock(locationid,payload); setDeviceFlashBlock(locationid,payload); emit updateRequired(locationid); return; } else { if (m_interrogationInProgress) { //checkEmsData->setDeviceFlashBlock(locationid,payload); for (int i=0;i<m_duplicateFlashMemoryList.size();i++) { if (m_duplicateFlashMemoryList[i]->locationid == locationid) { m_duplicateFlashMemoryList[i]->setData(payload); break; } } m_checkEmsDataInUse = true; } else { if (getDeviceFlashBlock(locationid) != payload) { QLOG_ERROR() << "Flash block in memory does not match flash block on tuner! This should not happen!"; QLOG_ERROR() << "Flash size:" << getDeviceFlashBlock(locationid).size(); QLOG_ERROR() << "Flash ID:" << "0x" + QString::number(locationid,16).toUpper(); setDeviceFlashBlock(locationid,payload); } if (getLocalFlashBlock(locationid) != payload) { setLocalFlashBlock(locationid,payload); } } } } emit updateRequired(locationid); //updateDataWindows(locationid); return; }
void EmsData::ramBlockUpdate(unsigned short locationid, QByteArray header, QByteArray payload) { Q_UNUSED(header) QLOG_TRACE() << "Ram Block retrieved:" << "0x" + QString::number(locationid,16).toUpper(); QList<ConfigBlock> configlist = m_memoryMetaData->getConfigMetaData(QString::number(locationid,16).toUpper()); for (int i=0;i<configlist.size();i++) { //configlist[i].offset() QString valstr = ""; QString bytestr = ""; for (int k=0;k<configlist[i].size();k++) { unsigned int value = 0; for (int j=0;j<configlist[i].elementSize();j++) { //QLOG_DEBUG() << (unsigned char)block[m_fieldConfigList[i].second.offset() + (k * m_fieldConfigList[i].second.elementSize()) + j]; bytestr += QString::number((unsigned char)payload[configlist[i].offset() + (k * configlist[i].elementSize()) + j],16).toUpper() + ","; value += ((unsigned char)payload[configlist[i].offset() + (k * configlist[i].elementSize()) + j]) << (8 * (configlist[i].elementSize() - (j+1))); } //userValue = (ecuValue + translate) * scale valstr += QString::number(calcAxis(value,configlist[i].calc())) + ","; } valstr = valstr.mid(0,valstr.length()-1); QLOG_DEBUG() << "Pre value:" << "0x" + QString::number(locationid,16) << bytestr; //valstr == variable. emit configRecieved(configlist[i],QVariant(valstr)); } if (!hasDeviceRamBlock(locationid)) { //This should not happen /*RawDataBlock *block = new RawDataBlock(); block->locationid = locationid; block->header = header; block->data = payload; //m_flashRawBlockList.append(block); m_deviceRamRawBlockList.append(block);*/ } else { //Check to see if it's supposed to be a table, and if so, check size if (!verifyMemoryBlock(locationid,header,payload)) { //QMessageBox::information(this,"Error","RAM Location ID 0x" + QString::number(locationid,16).toUpper() + " should be 1024 sized, but it is " + QString::number(payload.size()) + ". This should never happen"); QLOG_ERROR() << "RAM Location ID 0x" + QString::number(locationid,16).toUpper() + " should be 1024 sized, but it is " + QString::number(payload.size()) + ". This should never happen"; return; } if (getDeviceRamBlock(locationid).isEmpty()) { //This should not happen QLOG_ERROR() << "Ram block on device while ram block on tuner is empty! This should not happen" << "0x" + QString::number(locationid,16).toUpper(); QLOG_ERROR() << "Current block size:" << getDeviceRamBlock(locationid).size(); setLocalRamBlock(locationid,payload); setDeviceRamBlock(locationid,payload); } else { if (m_interrogationInProgress) { //checkEmsData->setDeviceRamBlock(locationid,payload); for (int i=0;i<m_duplicateRamMemoryList.size();i++) { if (m_duplicateRamMemoryList[i]->locationid == locationid) { m_duplicateRamMemoryList[i]->setData(payload); break; } } m_checkEmsDataInUse = true; } else { if (getDeviceRamBlock(locationid) != payload) { QLOG_ERROR() << "Ram block on device does not match ram block on tuner! This should ONLY happen during a manual update!"; QLOG_ERROR() << "Tuner ram size:" << getDeviceRamBlock(locationid).size(); setDeviceRamBlock(locationid,payload); } if (payload != getLocalRamBlock(locationid)) { //We need to prompt the user, local ram is out of date. setLocalRamBlock(locationid,payload); } } } //updateDataWindows(locationid); emit updateRequired(locationid); } return; }
void QGeoMapData::update() { emit updateRequired(); }