From 40701c3e843c0efafe63e85c6e5f58adaaa6d2b7 Mon Sep 17 00:00:00 2001 From: stopa85 Date: Tue, 15 Mar 2011 15:00:52 +0000 Subject: [PATCH] Add help system to Road graph plugin. Please check english text. git-svn-id: http://svn.osgeo.org/qgis/trunk@15499 c8812cc2-4d05-0410-92ff-de0c093fc19c --- resources/context_help/RgSettingsDlg-en_US | 30 +++++++++++++++++++ resources/context_help/RgSettingsDlg-ru_RU | 30 +++++++++++++++++++ .../context_help/RgShortestPathWidget-en_US | 15 ++++++++++ .../context_help/RgShortestPathWidget-ru_RU | 14 +++++++++ src/plugins/roadgraph/settingsdlg.cpp | 15 +++------- src/plugins/roadgraph/shortestpathwidget.cpp | 14 +++++++++ src/plugins/roadgraph/shortestpathwidget.h | 5 ++++ 7 files changed, 112 insertions(+), 11 deletions(-) create mode 100644 resources/context_help/RgSettingsDlg-en_US create mode 100644 resources/context_help/RgSettingsDlg-ru_RU create mode 100644 resources/context_help/RgShortestPathWidget-en_US create mode 100644 resources/context_help/RgShortestPathWidget-ru_RU diff --git a/resources/context_help/RgSettingsDlg-en_US b/resources/context_help/RgSettingsDlg-en_US new file mode 100644 index 00000000000..2c5e61e8e98 --- /dev/null +++ b/resources/context_help/RgSettingsDlg-en_US @@ -0,0 +1,30 @@ +

Road graph plugin settings

+

Road graph is a C++ plugin for QGIS, that calculates the shortest path between two points on any polyline layer and plots this path over the road network.

+

+Units plugin
+Topology tolerance
+Transport layer settings
+

+ + +

Units plugin

+
+

You can adjust the output of the calculated distance and time of their way to the desired units. To do this, specify the value of field and .

+ + +

Topology tolerance

+
+

- the distance in units of the project. If two points are located at a distance less than the topological tolerance, they are identified as a vertex. The value of the topological tolerance greater than zero slows down the plug, but you can use not ideal data sources.

+ +
Note
+

Road graph plugin view that the two roads are linked, if they have a common node. Nodes are uniquely identified by its coordinates. However, in the process of digitizing error may occur. The errors sometimes occur, and when converted from one coordinate reference system to another. This effect leads to the fact that the associated roads are interpreted as Road graph plugin is not connected. Decision in this case is to set the value of the topological tolerance is greater than zero.

+ + +

Transport layer settings

+
+

- the data layer of roads.

+

- the value of this field indicates how to interpret the Road graph plugin layers feature. - the direction of movement corresponds to the order of points in a feature. - the direction of movement corresponds to the inverse order of points in the figure. - both possible.

+

Speed field

- a field in which the recorded speed on the road.

+ +
Default settings
+

If the attribute table of your linear layer does not contain the required fields or fields contain unexpected values, the plugin will use the default values. You can specify the default tab .

diff --git a/resources/context_help/RgSettingsDlg-ru_RU b/resources/context_help/RgSettingsDlg-ru_RU new file mode 100644 index 00000000000..7b627a0a2ff --- /dev/null +++ b/resources/context_help/RgSettingsDlg-ru_RU @@ -0,0 +1,30 @@ +

Настройки расширения Road graph

+

Road graph — расширение для Quantum GIS, позволяющее осуществлять поиск кратчайшего маршрута на заданном графе дорог.

+

+Единицы измерения плагина
+Топологическая толерантность
+Настройка транспортного слоя
+

+ + +

Единицы измерения плагина

+
+

Вы можете настроить вывод вычисленного расстояния и времени пути в желаемых единицах измерения. Для этого укажите значение полей и .

+ + +

Топологическая толерантность

+
+

– расстояние в единицах проекта. Если две точки находятся на расстоянии меньше чем топологическая толерантность, то они идентифицируются как одна вершина графа. Значение топологической толерантности большее нуля замедляет работу плагина, однако позволяет использовать не идеальные источники данных.

+ +
Примечание
+

Road graph считает что две дороги связаны между собой, если они имеют общий узел. Узлы однозначно идентифицируются своими координатами. Однако, в процессе оцифровки могут возникают погрешности. Погрешности иногда возникаю и при пересчете из одной системы координат в другую. Данный эффект приводит к тому, что связанные дороги интерпретируются плагином как не связанные. Решением в таком случае является установка значения топологической толерантности больше нуля.

+ + +

Транспортный слой

+
+

– слой данных, слой дорог.

+

– значение этого поля указывает Road graph как интерпретировать фигуру. - направление движения соответствует порядку точек в фигуре. – направление движения соответствует обратному порядку точек в фигуре. – возможны оба варианта.

+

– поле в котором содержится скорость движения по дороге.

+ +
Значения по умолчанию
+

Если атрибутивная таблица Вашего линейного слоя не содержит необходимых полей или поля содержат непредусмотренные значения, то плагин будет использовать значения по умолчанию. Вы можете задать значения по умолчанию на вкладке .

diff --git a/resources/context_help/RgShortestPathWidget-en_US b/resources/context_help/RgShortestPathWidget-en_US new file mode 100644 index 00000000000..bd061cba664 --- /dev/null +++ b/resources/context_help/RgShortestPathWidget-en_US @@ -0,0 +1,15 @@ +

Finding shortest path

+

Road graph is a C++ plugin for Quantum GIS, that calculates the shortest path between two points on any line layer and plots this path over the road network. Before using the plugin to configure it. This can be done in the menu

+

+How to
+

+ + +

How to

+
+

You can select start and end points with special buttons Select points tool +near the fields. +Pressing button will run shortest path calculation using optimization criterion, selected in combobox. Button allow you exporting calculated path into new vector layer, and button will erase all fields, remove points and calculated path from map canvas.

+ +
Note
+

In order to bind the start and stop points of the route to the road network Road graph selects between the nearest point or an arc of the graph. In fact it can bind to any part of the road network. Nevertheless, their route and its characteristics are not taken into account the distance from the starting point to the road network and road network to the stoping point.

diff --git a/resources/context_help/RgShortestPathWidget-ru_RU b/resources/context_help/RgShortestPathWidget-ru_RU new file mode 100644 index 00000000000..76bf8b335cc --- /dev/null +++ b/resources/context_help/RgShortestPathWidget-ru_RU @@ -0,0 +1,14 @@ +

Поиск кратчайшего пути

+

Road graph — расширение для Quantum GIS, позволяющее осуществлять поиск кратчайшего маршрута на заданном графе дорог.
Перед использованием плагина нужно его настроить. Это можно сделать в меню

+

+Как это сделать
+

+ + +

Как сделать это

+
+

Выберите начальную и конечную точку маршрута при помощи соответствующих кнопок возле полей ввода. +Нажатие на кнопку запустит поиск кратчайшего маршрута с использованием критерия оптимизации, заданного выпадающим списком . Кнопка служит для экспорта построенного маршрута в новый векторный слой, а при помощи кнопки выполняется очистка полей с координатами начальной и конечной точек, а также из области карты удаляются сами точки и построенный маршрут.

+ +
Примечание
+

Для того чтобы привязать начальную и конечную точки маршрута к дорожной сети Road graph выбирает между ближайшей точкой или дугой графа. Фактически это позволяет привязать любую точку к дорожной сети. Тем не менее проложенный маршрут и его характеристики не будут учитывать расстояние от начальной точки до дорожной сети и от дорожной сети до конечной точки.

diff --git a/src/plugins/roadgraph/settingsdlg.cpp b/src/plugins/roadgraph/settingsdlg.cpp index 768903557f1..98650ed9e61 100644 --- a/src/plugins/roadgraph/settingsdlg.cpp +++ b/src/plugins/roadgraph/settingsdlg.cpp @@ -29,6 +29,7 @@ RgSettingsDlg::RgSettingsDlg( RgSettings *settings, QWidget* parent, Qt::WFlags : QDialog( parent, fl ) , mSettings( settings ) { + // create base widgets; setWindowTitle( tr( "Road graph plugin settings" ) ); QVBoxLayout *v = new QVBoxLayout( this ); @@ -56,21 +57,13 @@ RgSettingsDlg::RgSettingsDlg( RgSettings *settings, QWidget* parent, Qt::WFlags h->addWidget( msbTopologyTolerance ); v->addLayout( h ); - /* - h = new QHBoxLayout(); - l = new QLabel( tr("Select graph source:"), this); - h->addWidget(l); - mcbGraphDirector = new QComboBox( this ); - h->addWidget(mcbGraphDirector); - v->addLayout(h); - */ - mSettingsWidget = mSettings->getGui( this ); v->addWidget( mSettingsWidget ); - QDialogButtonBox *bb = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this ); + QDialogButtonBox *bb = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, Qt::Horizontal, this ); connect( bb, SIGNAL( accepted() ), this, SLOT( on_buttonBox_accepted() ) ); connect( bb, SIGNAL( rejected() ), this, SLOT( on_buttonBox_rejected() ) ); + connect( bb, SIGNAL( helpRequested() ), this, SLOT( on_buttonBox_helpRequested() ) ); v->addWidget( bb ); mcbPluginsTimeUnit->addItem( tr( "second" ), QVariant( "s" ) ); @@ -97,7 +90,7 @@ void RgSettingsDlg::on_buttonBox_rejected() void RgSettingsDlg::on_buttonBox_helpRequested() { - QgsContextHelp::run( context_id ); + QgsContextHelp::run( metaObject()->className() ); } QString RgSettingsDlg::timeUnitName() diff --git a/src/plugins/roadgraph/shortestpathwidget.cpp b/src/plugins/roadgraph/shortestpathwidget.cpp index a4a96c3c7ca..fe9ea38755b 100644 --- a/src/plugins/roadgraph/shortestpathwidget.cpp +++ b/src/plugins/roadgraph/shortestpathwidget.cpp @@ -25,6 +25,7 @@ #include #include #include +#include // Qgis includes #include @@ -122,6 +123,13 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin mClear = new QPushButton( tr( "Clear" ), myWidget ); h->addWidget( mClear ); v->addLayout( h ); + + h = new QHBoxLayout( myWidget ); + QPushButton *helpButton = new QPushButton( tr( "Help" ), this ); + helpButton->setIcon( this->style()->standardIcon( QStyle::SP_DialogHelpButton ) ); + h->addWidget( helpButton ); + v->addLayout( h ); + v->addStretch(); mFrontPointMapTool = new QgsMapToolEmitPoint( mPlugin->iface()->mapCanvas() ); @@ -138,6 +146,7 @@ RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin connect( mBackPointMapTool, SIGNAL( canvasClicked( const QgsPoint&, Qt::MouseButton ) ), this, SLOT( setBackPoint( const QgsPoint& ) ) ); + connect( helpButton, SIGNAL( clicked( bool ) ), this, SLOT( helpRequested() ) ); connect( mCalculate, SIGNAL( clicked( bool ) ), this, SLOT( findingPath() ) ); connect( mClear, SIGNAL( clicked( bool ) ), this, SLOT( clear() ) ); @@ -367,3 +376,8 @@ void RgShortestPathWidget::exportPath() mPlugin->iface()->mapCanvas()->update(); } + +void RgShortestPathWidget::helpRequested() +{ + QgsContextHelp::run( metaObject()->className() ); +} diff --git a/src/plugins/roadgraph/shortestpathwidget.h b/src/plugins/roadgraph/shortestpathwidget.h index 936ef6d8f22..dcccaff818a 100644 --- a/src/plugins/roadgraph/shortestpathwidget.h +++ b/src/plugins/roadgraph/shortestpathwidget.h @@ -96,6 +96,11 @@ class RgShortestPathWidget : public QDockWidget */ void clear(); + /** + * help requested + */ + void helpRequested(); + private: /** * retrun path as a graph