提交 b527d001 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

change containers, to test the new features.

上级 d86c5bd5
......@@ -8,6 +8,10 @@ testcontainer::testcontainer(QWidget *parent) :
ui(new Ui::testcontainer)
{
ui->setupUi(this);
QFont ft;
ft.setPixelSize(9);
ui->tableView_msg->setFont(ft);
ui->tableView_msg->verticalHeader()->setDefaultSectionSize(16);
Qt::WindowFlags flg = this->windowFlags();
flg |= Qt::WindowMinMaxButtonsHint;
this->setWindowFlags(flg);
......@@ -306,6 +310,7 @@ void testcontainer::on_pushButton_test_mark_clicked()
"function=update_icon;name=ID7;"
"lat=1.233;lon=2.28373;"
"scale=2;rotate=0;smooth=1;"
"color_label=255,0,0,128;weight_label=99;size_label=9;"
"icon=default;").toString();
if (res.contains("error"))
......@@ -313,9 +318,9 @@ void testcontainer::on_pushButton_test_mark_clicked()
res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=update_props;name=ID7;"
"LABEL=COSCO;EXPRESS=YangChunHe;Pero=IMMD;"
"LABEL=COSCO;EXPRESS=TianTian;Pero=IMMD;"
"CheckTime=2012-12-30 07:18:32;"
"From=PEKING;To=YIKH").toString();
"From=PEKING;To=LONDON;CAR=Apple Watch;").toString();
if (res.contains("error"))
QMessageBox::information(this,"geomarker1::update_props",res);
......@@ -380,23 +385,26 @@ void testcontainer::timerEvent(QTimerEvent * e)
{
if (e->timerId()==m_nAnTimer)
{
static double tposlat = rand()%1700/10.0-85 , tposlon= rand()%3600/10.0-180;
tposlat += sin(tposlon * 3.14/180.0)/5+0.1;
tposlon -= cos(tposlat * 3.14/180.0)/5+0.1;
if (tposlat > 85 ) tposlat = -85;
if (tposlat < -85 ) tposlat = 85;
if (tposlon < -180 ) tposlon = 180;
if (tposlon > 180 ) tposlon = -180;
QString res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=exists;name=ID1;").toString();
"function=exists;name=ID7;").toString();
QMap<QString, QVariant> mres = string_to_map(res);
if (mres["return"].toInt())
{
//Get info of this mark
res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=mark;name=ID7").toString();
QMap<QString, QVariant> mparas = string_to_map(res);
double lat = mparas["lat"].toDouble() + 0.173245467333;
double lon = mparas["lon"].toDouble() + 0.245546767673;
qreal rot = mparas["rotate"].toReal()+1.38745738457;
if (rot>360) rot = 0;
if (lat >=85) lat = -85;
if (lon >=180) lon = -180;
ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
QString("function=update_point;name=ID1;type=1;lat=%1;lon=%2;")
.arg(tposlat)
.arg(tposlon)
).toString();
QString("function=update_icon;name=ID7;lat=%1;lon=%2;rotate=%4;")
.arg(lat)
.arg(lon).arg(rot)
);
}
......@@ -407,28 +415,30 @@ void testcontainer::on_pushButton_test_request_clicked()
{
QString res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=mark_names;").toString();
res.replace(";",";\n");
res.replace("=","\t=");
QMessageBox::information(this,"geomarker1::mark_names",res);
slot_message("geomarker1::mark_names:"+res);
QMap<QString,QVariant> mp = string_to_map(res);
foreach (QString key, mp.keys())
{
res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=mark;name="+mp[key].toString()).toString();
slot_message("geomarker1::mark:"+res);
res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=props;name="+mp[key].toString()).toString();
slot_message("geomarker1::props:"+res);
}
res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=mark;name=ID1").toString();
res.replace(";",";\n");
res.replace("=","\t=");
QMessageBox::information(this,"geomarker1::mark",res);
res = ui->axWidget_map1->dynamicCall("osm_layer_call_function(QString,QString)","geomarker1",
"function=props;name=ID1").toString();
res.replace(";",";\n");
res.replace("=","\t=");
QMessageBox::information(this,"geomarker1::props",res);
}
void testcontainer::on_pushButton_test_cache_clicked()
{
//Get the address of local cache
QString res = ui->axWidget_map1->dynamicCall("osm_get_local_cache(QString)","OSM").toString();
QMessageBox::information(this,"geomarker1::osm_get_local_cache",res);
//set it to /
res = ui->axWidget_map1->dynamicCall("osm_set_local_cache(QString, QString)","OSM","/OSMCache").toString();
QMessageBox::information(this,"geomarker1::osm_set_local_cache",res);
//Get expire Days
res = ui->axWidget_map1->dynamicCall("osm_get_cache_expire_days(QString)","OSM").toString();
QMessageBox::information(this,"geomarker1::osm_get_cache_expire_days",res);
res = ui->axWidget_map1->dynamicCall("osm_set_cache_expire_days(QString,int)","OSM",res.toInt()+1).toString();
......@@ -444,3 +454,7 @@ void testcontainer::on_pushButton_test_xml_clicked()
QMessageBox::information(this,"geomarker1::save_xml",res);
}
void testcontainer::on_pushButton_test_resource_clicked()
{
}
......@@ -38,6 +38,7 @@ protected slots:
void on_pushButton_test_polygon_clicked();
void on_pushButton_test_request_clicked();
void on_pushButton_test_xml_clicked();
void on_pushButton_test_resource_clicked();
};
#endif // TESTCONTAINER_H
......@@ -6,178 +6,244 @@
<rect>
<x>0</x>
<y>0</y>
<width>973</width>
<width>1054</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>testcontainer</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Map1</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QAxWidget" name="axWidget_map1"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Map2</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QAxWidget" name="axWidget_map2">
<property name="sizePolicy" stdset="0">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_Message">
<attribute name="title">
<string>Message</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTableView" name="tableView_msg">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton_test_adds">
<layout class="QGridLayout" name="gridLayout">
<item row="6" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>test_addr</string>
<string>Layer control</string>
</property>
</widget>
</item>
<item>
<item row="5" column="0">
<widget class="QPushButton" name="pushButton_test_navigate">
<property name="text">
<string>navigate</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_test_cache">
<property name="text">
<string>test_cache</string>
<string>cache Folder</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_test_autodl">
<item row="15" column="0">
<widget class="QPushButton" name="pushButton_test_xml">
<property name="text">
<string>test_auto_download</string>
<string>marks save/load</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_test_navigate">
<item row="11" column="0">
<widget class="QPushButton" name="pushButton_test_mark">
<property name="text">
<string>test_navigate</string>
<string>add marks</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_test_layers">
<item row="8" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>test_layers</string>
<string>Plugin test:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>background osm conn</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_test_autodl">
<property name="text">
<string>connect</string>
</property>
</spacer>
</widget>
</item>
<item>
<item row="9" column="1">
<widget class="QPushButton" name="pushButton_test_grid_getPolygon">
<property name="text">
<string>get polygon</string>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QPushButton" name="pushButton_test_resource">
<property name="text">
<string>res save/load</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QPushButton" name="pushButton_test_grid_enable">
<property name="text">
<string>grid_measure</string>
<string>measure on/off</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_test_grid_getPolygon">
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_test_adds">
<property name="text">
<string>grid_polygon</string>
<string>address</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_test_mark">
<item row="7" column="0">
<widget class="QPushButton" name="pushButton_test_layers">
<property name="text">
<string>mark</string>
<string>enum layers</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_test_line">
<item row="10" column="1">
<widget class="QLabel" name="label_7">
<property name="text">
<string>line</string>
<string>geo marker</string>
</property>
</widget>
</item>
<item>
<item row="7" column="1">
<widget class="QPushButton" name="pushButton_test_layer_move">
<property name="text">
<string>order a layer</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Grid measure</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Plugin test:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Navigate</string>
</property>
</widget>
</item>
<item row="16" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="13" column="0">
<widget class="QPushButton" name="pushButton_test_polygon">
<property name="text">
<string>polygon</string>
<string>add a polygon</string>
</property>
</widget>
</item>
<item>
<item row="13" column="1">
<widget class="QPushButton" name="pushButton_test_request">
<property name="text">
<string>request</string>
<string>get info</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_test_xml">
<item row="11" column="1">
<widget class="QPushButton" name="pushButton_test_line">
<property name="text">
<string>xml</string>
<string>add a line</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_mouseMove">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Map1</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QAxWidget" name="axWidget_map1"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Map2</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QAxWidget" name="axWidget_map2">
<property name="sizePolicy" stdset="0">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QTableView" name="tableView_msg">
<property name="minimumSize">
<size>
<width>0</width>
<height>128</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>128</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_mouseMove">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册