コード例 #1
0
void setupScriptApi(QScriptEngine *engine)
{
  setupAddressCluster(engine);
  setupAlarms(engine);
  setupCLineEdit(engine);
  setupCRMAcctLineEdit(engine);
  setupComments(engine);
  setupContactWidget(engine);
  setupCurrDisplay(engine);
  setupDocuments(engine);
  setupGLCluster(engine);
  setupInclude(engine);
  setupItemLineEdit(engine);
  setupMetaSQLHighlighterProto(engine);
  setupOrderLineEdit(engine);
  setupOrReportProto(engine);
  setupParameterEditProto(engine);
  setupParameterGroup(engine);
  setupParameterList(engine);
  setupPeriodListViewItem(engine);
  setupPoLineEdit(engine);
  setupProjectLineEdit(engine);
  setupQActionProto(engine);
  setupQBoxLayoutProto(engine);
  setupQByteArrayProto(engine);
  setupQDialog(engine);
  setupQDomAttrProto(engine);
  setupQDomCDATASectionProto(engine);
  setupQDomCharacterDataProto(engine);
  setupQDomCommentProto(engine);
  setupQDomDocumentFragmentProto(engine);
  setupQDomDocumentProto(engine);
  setupQDomDocumentTypeProto(engine);
  setupQDomElementProto(engine);
  setupQDomEntityProto(engine);
  setupQDomEntityReferenceProto(engine);
  setupQDomImplementationProto(engine);
  setupQDomNamedNodeMapProto(engine);
  setupQDomNodeListProto(engine);
  setupQDomNodeProto(engine);
  setupQDomNotationProto(engine);
  setupQDomProcessingInstructionProto(engine);
  setupQDomTextProto(engine);
  setupQDoubleValidatorProto(engine);
  setupQEventProto(engine);
  setupQFontProto(engine);
  setupQGridLayoutProto(engine);
  setupQIconProto(engine);
  setupQItemDelegateProto(engine);
  setupQLayoutItemProto(engine);
  setupQLayoutProto(engine);
  setupQMenuProto(engine);
  setupQMessageBox(engine);
  setupQNetworkAccessManagerProto(engine);
  setupQNetworkReplyProto(engine);
  setupQNetworkRequestProto(engine);
  setupQPrinterProto(engine);
  setupQSizePolicy(engine);
  setupQSpacerItem(engine);
  setupQSqlDatabaseProto(engine);
  setupQSqlErrorProto(engine);
  setupQSqlRecordProto(engine);
  setupQStackedWidgetProto(engine);
  setupQTabWidgetProto(engine);
  setupQTextDocumentProto(engine);
  setupQTextEditProto(engine);
  setupQTimerProto(engine);
  setupQToolBarProto(engine);
  setupQTreeWidgetItemProto(engine);
  setupQt(engine);
  setupQUrlProto(engine);
  setupQValidatorProto(engine);
  setupQWidgetProto(engine);
  setupRaLineEdit(engine);
  setupRevisionLineEdit(engine);
  setupScreen(engine);
  setupShipmentClusterLineEdit(engine);
  setupSoLineEdit(engine);
  setupToLineEdit(engine);
  setupUsernameCluster(engine);
  setupUsernameLineEdit(engine);
  setupVendorGroup(engine);
  setupWComboBox(engine);
  setupWoCluster(engine);
  setupWomatlCluster(engine);
  setupXCheckBox(engine);
  setupXComboBox(engine);
  setupXDataWidgetMapperProto(engine);
  setupXDateEdit(engine);
  setupXSqlTableModelProto(engine);
  setupXSqlQueryProto(engine);
  setupXTreeWidget(engine);
  setupXTreeWidgetItem(engine);

}
コード例 #2
0
void ProfilePlotView::setProfile(Profile::Ptr profile)
{
	m_pltDepth->clearGraphs();
	m_pltDepth->clearItems();

	m_cbxAuxKeys->clear();
	m_cbxAuxKeys->setEnabled(false);

	m_curProfile = profile;
	if (! m_curProfile)
	{
		loadAuxPlotData(std::string());
		return;
	}

	/*
	 * Check for the "depth" key and remove it
	 */
	std::set<std::string> keys(m_curProfile->keys());
	bool hasDepth = (keys.find("depth") != keys.end());
	if (! hasDepth)
		logging::getLogger("gui.plot")->warning("Profile does not have depth data");
	else
		keys.erase("depth");

	/*
	 * Load the Aux Key Combo Box
	 */
	std::set<std::string>::const_iterator itk;
	for (itk = keys.begin(); itk != keys.end(); itk++)
	{
		QString key(QString::fromStdString(* itk));
		QString name(profileKeyLabel(* itk));
		m_cbxAuxKeys->addItem(name, key);
	}

	/*
	 * Load the Depth Profile
	 */
	if (hasDepth)
	{
		bool hasUnit = false;
		unit_t unit;

		try
		{
			unit = unitForQuantity(qtDepth);
			hasUnit = true;
		}
		catch (std::runtime_error & e)
		{
		}

		QVector<double> time;
		QVector<double> depth;

		unsigned int lastAlarm = 0;
		AlarmPlotItem * curAlarm = 0;

		std::list<waypoint>::const_iterator it;
		for (it = m_curProfile->profile().begin(); it != m_curProfile->profile().end(); it++)
		{
			time.push_back(it->time / 60.0f);
			if (! hasUnit)
				depth.push_back(it->data.at("depth"));
			else
				depth.push_back(unit.conv->fromNative(it->data.at("depth")));

			if (it->alarms.size() > 0)
			{
				std::set<std::string>::const_iterator ait;

				// Group alarms within the same 60 seconds into one item
				if (((it->time - lastAlarm) > 60) || ! curAlarm)
				{
					if (curAlarm)
					{
						curAlarm->finalize();
						m_pltDepth->addItem(curAlarm);
					}

					curAlarm = new AlarmPlotItem(m_pltDepth);
					lastAlarm = it->time;
				}

				for (ait = it->alarms.begin(); ait != it->alarms.end(); ait++)
					curAlarm->addAlarm(it->time, alarmLabel(* ait), QString());
			}
		}

		if (curAlarm)
		{
			curAlarm->finalize();
			m_pltDepth->addItem(curAlarm);
		}

		if (! hasUnit)
			m_pltDepth->yAxis->setLabel(tr("Depth"));
		else
			m_pltDepth->yAxis->setLabel(tr("Depth (%1)").arg(QString(unit.name).toLower()));

		QLinearGradient lg(0, 0, 0, 1);
		lg.setCoordinateMode(QGradient::StretchToDeviceMode);
		lg.setColorAt(0, QColor(255, 255, 255, 255));
		lg.setColorAt(0.6, QColor(0, 64, 112, 255));

		m_pltDepth->addGraph();
		m_pltDepth->graph(0)->setBrush(lg);
		m_pltDepth->graph(0)->setPen(QColor(192, 192, 192, 255));
		m_pltDepth->graph(0)->setData(time, depth);
		m_pltDepth->graph(0)->rescaleAxes();
		setupTimeAxis();
		setupDepthAxis();
		setupAlarms();
		m_pltDepth->replot();
	}

	/*
	 * Initialize the Aux Plot
	 */
	if ((m_cbxAuxKeys->count() == 1) || (keys.find(m_auxKey.toStdString()) == keys.end()))
	{
		setAuxKey(m_cbxAuxKeys->itemData(0).toString());
	}
	else if (keys.find(m_auxKey.toStdString()) != keys.end())
	{
		m_cbxAuxKeys->setCurrentIndex(m_cbxAuxKeys->findText(m_auxKey, Qt::MatchFlags()));
		loadAuxPlotData(m_auxKey.toStdString());
	}
}
コード例 #3
0
void setupScriptApi(QScriptEngine *engine)
{
  setupAddressCluster(engine);
  setupAlarms(engine);
  setupCLineEdit(engine);
  setupCRMAcctLineEdit(engine);
  setupComments(engine);
  setupContactCluster(engine);
  setupCurrDisplay(engine);
  setupDocuments(engine);
  setupGLCluster(engine);
  setupItemLineEdit(engine);
  setupMetaSQLHighlighterProto(engine);
  setupOrderLineEdit(engine);
  setupParameterGroup(engine);
  setupPoLineEdit(engine);
  setupProjectLineEdit(engine);
  setupQActionProto(engine);
  setupQDomAttrProto(engine);
  setupQDomCDATASectionProto(engine);
  setupQDomCharacterDataProto(engine);
  setupQDomCommentProto(engine);
  setupQDomDocumentFragmentProto(engine);
  setupQDomDocumentProto(engine);
  setupQDomDocumentTypeProto(engine);
  setupQDomElementProto(engine);
  setupQDomEntityProto(engine);
  setupQDomEntityReferenceProto(engine);
  setupQDomImplementationProto(engine);
  setupQDomNamedNodeMapProto(engine);
  setupQDomNodeListProto(engine);
  setupQDomNodeProto(engine);
  setupQDomNotationProto(engine);
  setupQDomProcessingInstructionProto(engine);
  setupQDomTextProto(engine);
  setupQMenuProto(engine);
  setupQMessageBox(engine);
  setupQNetworkAccessManagerProto(engine);
  setupQNetworkReplyProto(engine);
  setupQNetworkRequestProto(engine);
  setupQSqlDatabaseProto(engine);
  setupQSqlRecordProto(engine);
  setupQStackedWidgetProto(engine);
  setupQTabWidgetProto(engine);
  setupQTextDocumentProto(engine);
  setupQTextEditProto(engine);
  setupQTreeWidgetItemProto(engine);
  setupQUrlProto(engine);
  setupRaLineEdit(engine);
  setupRevisionLineEdit(engine);
  setupScreen(engine);
  setupShipmentClusterLineEdit(engine);
  setupSoLineEdit(engine);
  setupToLineEdit(engine);
  setupUsernameLineEdit(engine);
  setupVendorGroup(engine);
  setupWComboBox(engine);
  setupWoLineEdit(engine);
  setupWomatlCluster(engine);
  setupXComboBox(engine);
  setupXDataWidgetMapperProto(engine);
  setupXDateEdit(engine);
  setupXSqlTableModelProto(engine);
  setupXTreeWidgetItemProto(engine);

}
コード例 #4
0
void ProfilePlotView::pltDepthBeforeReplot()
{
	setupAlarms();
}