Skip to content

Commit

Permalink
Add help system to Road graph plugin. Please check english text.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15499 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
stopa85 committed Mar 15, 2011
1 parent 904213d commit 786330e
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 11 deletions.
30 changes: 30 additions & 0 deletions resources/context_help/RgSettingsDlg-en_US
@@ -0,0 +1,30 @@
<h3>Road graph plugin settings</h3>
<p>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.</p>
<p>
<a href="#creating">Units plugin</a><br/>
<a href="#topologyTolerance">Topology tolerance</a><br/>
<a href="#layerSettings">Transport layer settings</a><br/>
</p>

<a name="creating">
<h4>Units plugin</h4>
</a>
<p>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 <label>Distance unit</label> and <label>Time unit</label>.</p>

<a name="topologyTolerance">
<h4>Topology tolerance</h4>
</a>
<p><label>Topology tolerance</label> - 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.</p>

<h5>Note</h5>
<p>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.</p>

<a name="LayerSettings">
<h4>Transport layer settings</h4>
</a>
<p><label>Layer</label> - the data layer of roads.</p>
<p><label>Field direction</label> - the value of this field indicates how to interpret the Road graph plugin layers feature. <label>Value for forward direction</label> - the direction of movement corresponds to the order of points in a feature. <label>Value for reverse direction</label> - the direction of movement corresponds to the inverse order of points in the figure. <label>Value for two-way direction</label> - both possible.</p>
<p>Speed field</p> - a field in which the recorded speed on the road.</p>

<h5>Default settings</h5>
<p>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 <label>Default settings</label>.</p>
30 changes: 30 additions & 0 deletions resources/context_help/RgSettingsDlg-ru_RU
@@ -0,0 +1,30 @@
<h3>Настройки расширения Road graph</h3>
<p>Road graph — расширение для Quantum GIS, позволяющее осуществлять поиск кратчайшего маршрута на заданном графе дорог.</p>
<p>
<a href="#creating">Единицы измерения плагина</a><br/>
<a href="#topologyTolerance">Топологическая толерантность</a><br/>
<a href="#layerSettings">Настройка транспортного слоя</a><br/>
</p>

<a name="creating">
<h4>Единицы измерения плагина</h4>
</a>
<p>Вы можете настроить вывод вычисленного расстояния и времени пути в желаемых единицах измерения. Для этого укажите значение полей <label>Единица измерения расстояния</label> и <label>Единица измерения времени</label>.</p>

<a name="topologyTolerance">
<h4>Топологическая толерантность</h4>
</a>
<p><label>Топологическая толерантность</label> – расстояние в единицах проекта. Если две точки находятся на расстоянии меньше чем топологическая толерантность, то они идентифицируются как одна вершина графа. Значение топологической толерантности большее нуля замедляет работу плагина, однако позволяет использовать не идеальные источники данных.</p>

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

<a name="LayerSettings">
<h4>Транспортный слой</h4>
</a>
<p><label>Слой</label> – слой данных, слой дорог.</p>
<p><label>Поле направления</label> – значение этого поля указывает Road graph как интерпретировать фигуру. <label>Значение прямого направления</label> - направление движения соответствует порядку точек в фигуре. <label>Значение обратного направления</label> – направление движения соответствует обратному порядку точек в фигуре. <label>Двухстороннее направление</label> – возможны оба варианта.</p>
<p><label>Поле скорости</label> – поле в котором содержится скорость движения по дороге.</p>

<h5>Значения по умолчанию</h5>
<p>Если атрибутивная таблица Вашего линейного слоя не содержит необходимых полей или поля содержат непредусмотренные значения, то плагин будет использовать значения по умолчанию. Вы можете задать значения по умолчанию на вкладке <label>По умолчанию</label>.</p>
15 changes: 15 additions & 0 deletions resources/context_help/RgShortestPathWidget-en_US
@@ -0,0 +1,15 @@
<h3>Finding shortest path</h3>
<p>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 <label>Plugins -> Road graph -> Settings</label></p>
<p>
<a href="#howto">How to</a><br/>
</p>

<a name="howto">
<h4>How to</h4>
</a>
<p>You can select start and end points with special buttons Select points tool
near the fields.
Pressing <label>Calculate</label> button will run shortest path calculation using optimization criterion, selected in <label>Criterion</label> combobox. Button <label>Export</label> allow you exporting calculated path into new vector layer, and button <label>Clear</label> will erase all fields, remove points and calculated path from map canvas.</p>

<h5>Note</h5>
<p>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.</p>
14 changes: 14 additions & 0 deletions resources/context_help/RgShortestPathWidget-ru_RU
@@ -0,0 +1,14 @@
<h3>Поиск кратчайшего пути</h3>
<p>Road graph — расширение для Quantum GIS, позволяющее осуществлять поиск кратчайшего маршрута на заданном графе дорог. <br />Перед использованием плагина нужно его настроить. Это можно сделать в меню <label>плагины -> Road graph -> настройки модуля</label></p>
<p>
<a href="#hotwo">Как это сделать</a><br/>
</p>

<a name="howto">
<h4>Как сделать это</h4>
</a>
<p>Выберите начальную и конечную точку маршрута при помощи соответствующих кнопок возле полей ввода.
Нажатие на кнопку <label>Рассчитать</label> запустит поиск кратчайшего маршрута с использованием критерия оптимизации, заданного выпадающим списком <label>Критерий</label>. Кнопка <label>Экспорт</label> служит для экспорта построенного маршрута в новый векторный слой, а при помощи кнопки <label>Очистить</label> выполняется очистка полей с координатами начальной и конечной точек, а также из области карты удаляются сами точки и построенный маршрут.</p>

<h5>Примечание</h5>
<p>Для того чтобы привязать начальную и конечную точки маршрута к дорожной сети Road graph выбирает между ближайшей точкой или дугой графа. Фактически это позволяет привязать любую точку к дорожной сети. Тем не менее проложенный маршрут и его характеристики не будут учитывать расстояние от начальной точки до дорожной сети и от дорожной сети до конечной точки.</p>
15 changes: 4 additions & 11 deletions src/plugins/roadgraph/settingsdlg.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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" ) );
Expand All @@ -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()
Expand Down
14 changes: 14 additions & 0 deletions src/plugins/roadgraph/shortestpathwidget.cpp
Expand Up @@ -25,6 +25,7 @@
#include <qlineedit.h>
#include <QToolButton>
#include <QMessageBox>
#include <qgscontexthelp.h>

// Qgis includes
#include <qgsmapcanvas.h>
Expand Down Expand Up @@ -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() );
Expand All @@ -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() ) );

Expand Down Expand Up @@ -367,3 +376,8 @@ void RgShortestPathWidget::exportPath()
mPlugin->iface()->mapCanvas()->update();

}

void RgShortestPathWidget::helpRequested()
{
QgsContextHelp::run( metaObject()->className() );
}
5 changes: 5 additions & 0 deletions src/plugins/roadgraph/shortestpathwidget.h
Expand Up @@ -96,6 +96,11 @@ class RgShortestPathWidget : public QDockWidget
*/
void clear();

/**
* help requested
*/
void helpRequested();

private:
/**
* retrun path as a graph
Expand Down

0 comments on commit 786330e

Please sign in to comment.