diff --git a/RTKLib.pri b/RTKLib.pri new file mode 100644 index 000000000..19a9f352b --- /dev/null +++ b/RTKLib.pri @@ -0,0 +1,5 @@ +DEFINES += _RTLDLL NO_STRICT TRACE ENAGLO ENAQZS ENAGAL ENACMP ENAIRN NFREQ=5 NEXOBS=3 SVR_REUSEADDR #IERS_MODEL + +win32{ + DEFINES += WIN32 +} diff --git a/app/app.pri b/app/app.pri new file mode 100644 index 000000000..15589a1f1 --- /dev/null +++ b/app/app.pri @@ -0,0 +1,21 @@ +include(../RTKLib.pri) + +# save root directory +ROOT_DIRECTORY = $${PWD}/../ +OUTPUT_DIRECTORY = $${OUT_PWD} + +LIBS += -L$${ROOT_DIRECTORY}/lib/ -lRTKLib + +IERS_MODEL { + LIBS += -liers -lgfortran +} + +win* { + LIBS += -lws2_32 -lwinmm +} + +QMAKE_RPATHDIR *= $${ROOT_DIRECTORY}/lib + +PRE_TARGETDEPS = $${ROOT_DIRECTORY}/src/rtklib.h + +CONFIG += c++11 debug diff --git a/app/qtapp/appcmn_qt/aboutdlg.cpp b/app/qtapp/appcmn_qt/aboutdlg.cpp new file mode 100644 index 000000000..d9b313850 --- /dev/null +++ b/app/qtapp/appcmn_qt/aboutdlg.cpp @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +// ported to Qt by Jens Reimann + +#include "aboutdlg.h" +#include "rtklib.h" + +//--------------------------------------------------------------------------- +AboutDialog::AboutDialog(QWidget *parent) + : QDialog(parent) +{ + setupUi(this); +} + +void AboutDialog::showEvent(QShowEvent *event) +{ + if (event->spontaneous()) return; + + QPixmap icon[] = { QPixmap(":/icons/rtk1.bmp"), + QPixmap(":/icons/rtk2.bmp"), + QPixmap(":/icons/rtk3.bmp"), + QPixmap(":/icons/rtk4.bmp"), + QPixmap(":/icons/rtk5.bmp"), + QPixmap(":/icons/rtk6.bmp"), + QPixmap(":/icons/rtk7.bmp") }; + + if ((IconIndex > 0) && (IconIndex < 7)) wgIcon->setPixmap(icon[IconIndex - 1]); + lbAbout->setText(About); + lbVersion->setText(QString(tr("with RTKLIB ver.%1 %2")).arg(VER_RTKLIB).arg(PATCH_LEVEL)); + lbCopyright->setText(COPYRIGHT_RTKLIB); + + connect(pbOkay, SIGNAL(clicked(bool)), this, SLOT(accept())); +} diff --git a/app/qtapp/appcmn_qt/aboutdlg.h b/app/qtapp/appcmn_qt/aboutdlg.h new file mode 100644 index 000000000..82d9b0cc8 --- /dev/null +++ b/app/qtapp/appcmn_qt/aboutdlg.h @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- +#ifndef aboutdlgH +#define aboutdlgH +//--------------------------------------------------------------------------- +#include +#include +#include +#include + +#include "ui_aboutdlg.h" + +//--------------------------------------------------------------------------- +class AboutDialog : public QDialog, private Ui::AboutDlg +{ + Q_OBJECT + +protected: + void showEvent(QShowEvent *); + +public: + int IconIndex; + QString About; + + explicit AboutDialog(QWidget*); +}; +#endif diff --git a/app/qtapp/appcmn_qt/aboutdlg.ui b/app/qtapp/appcmn_qt/aboutdlg.ui new file mode 100644 index 000000000..c04b97acb --- /dev/null +++ b/app/qtapp/appcmn_qt/aboutdlg.ui @@ -0,0 +1,62 @@ + + + AboutDlg + + + + 0 + 0 + 300 + 179 + + + + About + + + + + + &Okay + + + true + + + true + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + + + + + + + + + diff --git a/app/qtapp/appcmn_qt/cmdoptdlg.cpp b/app/qtapp/appcmn_qt/cmdoptdlg.cpp new file mode 100644 index 000000000..7692e8961 --- /dev/null +++ b/app/qtapp/appcmn_qt/cmdoptdlg.cpp @@ -0,0 +1,123 @@ +//--------------------------------------------------------------------------- +// ported to Qt by Jens Reimann + +#include + +#include +#include + +#include "cmdoptdlg.h" + +//--------------------------------------------------------------------------- +CmdOptDialog::CmdOptDialog(QWidget *parent) + : QDialog(parent) +{ + setupUi(this); + + CmdEna[0] = CmdEna[1] = 1; + + connect(BtnOk, SIGNAL(clicked()), this, SLOT(BtnOkClick())); + connect(BtnCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(BtnLoad, SIGNAL(clicked()), this, SLOT(BtnLoadClick())); + connect(BtnSave, SIGNAL(clicked()), this, SLOT(BtnSaveClick())); + connect(ChkCloseCmd, SIGNAL(clicked(bool)), this, SLOT(ChkCloseCmdClick())); + connect(ChkOpenCmd, SIGNAL(clicked(bool)), this, SLOT(ChkOpenCmdClick())); + connect(ChkPeriodicCmd, SIGNAL(clicked(bool)), this, SLOT(ChkPeriodicCmdClick())); +} + +//--------------------------------------------------------------------------- +void CmdOptDialog::showEvent(QShowEvent *event) +{ + if (event->spontaneous()) return; + + OpenCmd->clear(); + CloseCmd->clear(); + + OpenCmd->appendPlainText(Cmds[0]); + CloseCmd->appendPlainText(Cmds[1]); + PeriodicCmd->appendPlainText(Cmds[2]); + ChkOpenCmd->setChecked(CmdEna[0]); + ChkCloseCmd->setChecked(CmdEna[1]); + ChkPeriodicCmd->setChecked(CmdEna[2]); + + UpdateEnable(); +} +//--------------------------------------------------------------------------- +void CmdOptDialog::BtnOkClick() +{ + Cmds[0] = OpenCmd->toPlainText(); + Cmds[1] = CloseCmd->toPlainText(); + Cmds[2] = PeriodicCmd->toPlainText(); + CmdEna[0] = ChkOpenCmd->isChecked(); + CmdEna[1] = ChkCloseCmd->isChecked(); + CmdEna[2] = ChkPeriodicCmd->isChecked(); + + accept(); +} +//--------------------------------------------------------------------------- +void CmdOptDialog::BtnLoadClick() +{ + QString OpenDialog_FileName; + QPlainTextEdit *cmd[] = { OpenCmd, CloseCmd , PeriodicCmd }; + QByteArray buff; + int n = 0; + + OpenDialog_FileName = QDir::toNativeSeparators(QFileDialog::getOpenFileName(this)); + QFile f(OpenDialog_FileName); + + f.open(QIODevice::ReadOnly); + + cmd[0]->clear(); + cmd[1]->clear(); + cmd[2]->clear(); + + while (!f.atEnd() && n < 3) { + buff = f.readLine(0); + if (buff.at(0) == '@') { + n ++; continue; + } + if (buff[buff.length() - 1] == '\n') buff[buff.length() - 1] = '\0'; + cmd[n]->appendPlainText(buff); + } +} +//--------------------------------------------------------------------------- +void CmdOptDialog::BtnSaveClick() +{ + QString SaveDialog_FileName; + QByteArray OpenCmd_Text = OpenCmd->toPlainText().toLatin1(), CloseCmd_Text = CloseCmd->toPlainText().toLatin1(), PeriodicCmd_Text = PeriodicCmd->toPlainText().toLatin1(); + + SaveDialog_FileName = QDir::toNativeSeparators(QFileDialog::getSaveFileName(this)); + QFile fp(SaveDialog_FileName); + + if (!fp.open(QIODevice::WriteOnly)) return; + + fp.write(OpenCmd_Text); + fp.write("\n@\n"); + fp.write(CloseCmd_Text); + fp.write("\n@\n"); + fp.write(PeriodicCmd_Text); +} + +//--------------------------------------------------------------------------- +void CmdOptDialog::ChkCloseCmdClick() +{ + UpdateEnable(); +} + +//--------------------------------------------------------------------------- +void CmdOptDialog::ChkOpenCmdClick() +{ + UpdateEnable(); +} +//--------------------------------------------------------------------------- +void CmdOptDialog::ChkPeriodicCmdClick() +{ + UpdateEnable(); +} +//--------------------------------------------------------------------------- +void CmdOptDialog::UpdateEnable() +{ + OpenCmd->setEnabled(ChkOpenCmd->isChecked()); + CloseCmd->setEnabled(ChkCloseCmd->isChecked()); + PeriodicCmd->setEnabled(ChkPeriodicCmd->isChecked()); +} diff --git a/app/qtapp/appcmn_qt/cmdoptdlg.h b/app/qtapp/appcmn_qt/cmdoptdlg.h new file mode 100644 index 000000000..1f04a6273 --- /dev/null +++ b/app/qtapp/appcmn_qt/cmdoptdlg.h @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +#ifndef cmdoptdlgH +#define cmdoptdlgH +//--------------------------------------------------------------------------- +#include + +#include "ui_cmdoptdlg.h" + +//--------------------------------------------------------------------------- +class CmdOptDialog : public QDialog, private Ui_CmdOptDialog +{ + Q_OBJECT + +protected: + void showEvent(QShowEvent *); + void UpdateEnable(); + +public slots: + void BtnOkClick(); + void ChkCloseCmdClick(); + void ChkOpenCmdClick(); + void ChkPeriodicCmdClick(); + void BtnLoadClick(); + void BtnSaveClick(); + +public: + QString Cmds[3]; + bool CmdEna[3]; + explicit CmdOptDialog(QWidget* parent); +}; +#endif diff --git a/app/qtapp/appcmn_qt/cmdoptdlg.ui b/app/qtapp/appcmn_qt/cmdoptdlg.ui new file mode 100644 index 000000000..64c2c9d7d --- /dev/null +++ b/app/qtapp/appcmn_qt/cmdoptdlg.ui @@ -0,0 +1,159 @@ + + + CmdOptDialog + + + + 0 + 0 + 385 + 361 + + + + Serial/TCP Commands + + + + + + + + + + + + Commands at startup + + + false + + + + + + + true + + + + + + + + + + + + + + + + Commands at shutdown + + + + + + + true + + + + + + + + + + + + + Periodic Commands : <command> # cycle (ms) + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + + + &Load... + + + + + + + true + + + + + + &Save... + + + + + + + true + + + + + + &OK + + + true + + + true + + + + + + + true + + + + + + &Cancel + + + + + + + + + + + diff --git a/app/qtapp/appcmn_qt/console.cpp b/app/qtapp/appcmn_qt/console.cpp new file mode 100644 index 000000000..5a8e9c170 --- /dev/null +++ b/app/qtapp/appcmn_qt/console.cpp @@ -0,0 +1,92 @@ +//--------------------------------------------------------------------------- +#include +#include + +#include "console.h" + +#include + +#define MAXLEN 256 +#define MAXLINE 2048 + +//--------------------------------------------------------------------------- +Console::Console(QWidget *parent) + : QDialog(parent) +{ + setupUi(this); + + ConBuff.reserve(MAXLINE); + ConBuff.append(""); + + BtnHex->setChecked(true); + BtnAsc->setChecked(false); + + connect(BtnClose,SIGNAL(clicked(bool)),this,SLOT(BtnCloseClick())); + connect(BtnClear,SIGNAL(clicked(bool)),this,SLOT(BtnClearClick())); + connect(BtnAsc,SIGNAL(clicked(bool)),this,SLOT(BtnAscClick())); + connect(BtnDown,SIGNAL(clicked(bool)),this,SLOT(BtnDownClick())); + connect(BtnHex,SIGNAL(clicked(bool)),this,SLOT(BtnHexClick())); +} +//--------------------------------------------------------------------------- +void Console::BtnCloseClick() +{ + close(); +} +//--------------------------------------------------------------------------- +void Console::BtnAscClick() +{ + BtnHex->setChecked(!BtnAsc->isChecked()); +} +//--------------------------------------------------------------------------- +void Console::BtnHexClick() +{ + BtnAsc->setChecked(!BtnHex->isChecked()); +} +//--------------------------------------------------------------------------- +void Console::BtnClearClick() +{ + ConBuff.clear(); + ConBuff.reserve(MAXLINE); + ConBuff.append(""); + textEdit->setPlainText(""); +} +//--------------------------------------------------------------------------- +void Console::BtnDownClick() +{ + textEdit->verticalScrollBar()->setValue(textEdit->verticalScrollBar()->maximum()); +} +//--------------------------------------------------------------------------- +void Console::AddMsg(uint8_t *msg, int n) +{ + char buff[MAXLEN+16],*p=buff; + int mode=BtnAsc->isChecked(); + + if (n<=0) return; + + if (BtnStop->isChecked()) return; + + p+=sprintf(p,"%s",qPrintable(ConBuff.last())); + + for (int i=0;i=67) p+=sprintf(p,"\n"); + } + if (p-buff>=MAXLEN) p+=sprintf(p,"\n"); + + if (*(p-1)=='\n') { + ConBuff.last()=buff; + ConBuff.append(""); + *(p=buff)=0; + if (ConBuff.count()>=MAXLINE) ConBuff.removeFirst(); + } + } + ConBuff.last()=buff; + + textEdit->setPlainText(ConBuff.join(QString())); +} +//--------------------------------------------------------------------------- diff --git a/app/qtapp/appcmn_qt/console.h b/app/qtapp/appcmn_qt/console.h new file mode 100644 index 000000000..508854a89 --- /dev/null +++ b/app/qtapp/appcmn_qt/console.h @@ -0,0 +1,32 @@ +//--------------------------------------------------------------------------- +#ifndef consoleH +#define consoleH +//--------------------------------------------------------------------------- +#include +#include "ui_console.h" +//--------------------------------------------------------------------------- + +class Console : public QDialog, private Ui::Console +{ + Q_OBJECT + +public slots: + void BtnCloseClick(); + void BtnClearClick(); + void BtnAscClick(); + void BtnHexClick(); + void BtnDownClick(); + +protected: + void ScrollChange(); + void FormResize(); + +private: + QStringList ConBuff; + +public: + explicit Console(QWidget* parent); + void AddMsg(uint8_t *msg, int n); +}; +//--------------------------------------------------------------------------- +#endif diff --git a/app/qtapp/appcmn_qt/freqdlg.cpp b/app/qtapp/appcmn_qt/freqdlg.cpp new file mode 100644 index 000000000..feaecde5a --- /dev/null +++ b/app/qtapp/appcmn_qt/freqdlg.cpp @@ -0,0 +1,15 @@ +//--------------------------------------------------------------------------- + + +#include "freqdlg.h" +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- +FreqDialog::FreqDialog(QWidget* parent) + : QDialog(parent) +{ + setupUi(this); + + connect(BtnOk, SIGNAL(clicked(bool)), this, SLOT(accept())); + +} +//--------------------------------------------------------------------------- diff --git a/app/qtapp/appcmn_qt/freqdlg.h b/app/qtapp/appcmn_qt/freqdlg.h new file mode 100644 index 000000000..d50787327 --- /dev/null +++ b/app/qtapp/appcmn_qt/freqdlg.h @@ -0,0 +1,15 @@ +//--------------------------------------------------------------------------- + +#ifndef freqdlgH +#define freqdlgH +//--------------------------------------------------------------------------- +#include "ui_freqdlg.h" + +//--------------------------------------------------------------------------- +class FreqDialog : public QDialog, private Ui::FreqDialog +{ +public: + FreqDialog(QWidget* parent); +}; +//--------------------------------------------------------------------------- +#endif diff --git a/app/qtapp/appcmn_qt/freqdlg.ui b/app/qtapp/appcmn_qt/freqdlg.ui new file mode 100644 index 000000000..151df2252 --- /dev/null +++ b/app/qtapp/appcmn_qt/freqdlg.ui @@ -0,0 +1,360 @@ + + + FreqDialog + + + + 0 + 0 + 436 + 320 + + + + GNSS Signals + + + + + + L5 + + + + + + + - + + + + + + + - + + + + + + + - + + + + + + + Galileo + + + + + + + GPS + + + + + + + L1 + + + + + + + - + + + + + + + L5 + + + + + + + L1 + + + + + + + SBAS + + + + + + + L3 + + + + + + + L6 + + + + + + + L5 + + + + + + + E5b + + + + + + + G3 + + + + + + + S + + + + + + + - + + + + + + + L1 + + + + + + + G2/a + + + + + + + E1 + + + + + + + L2 + + + + + + + E5 + + + + + + + - + + + + + + + L4 + + + + + + + Qt::Horizontal + + + + + + + L5 + + + + + + + Qt::Vertical + + + + + + + L2 + + + + + + + L1 + + + + + + + - + + + + + + + - + + + + + + + L5 + + + + + + + GLONASS + + + + + + + L2 + + + + + + + - + + + + + + + G1/a + + + + + + + - + + + + + + + - + + + + + + + E6 + + + + + + + NavIC + + + + + + + QZSS + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Ok + + + + + + + + + + E5a+b + + + + + + + + diff --git a/app/qtapp/appcmn_qt/glofcndlg.cpp b/app/qtapp/appcmn_qt/glofcndlg.cpp new file mode 100644 index 000000000..f2ad1fbe5 --- /dev/null +++ b/app/qtapp/appcmn_qt/glofcndlg.cpp @@ -0,0 +1,112 @@ +//--------------------------------------------------------------------------- + +#include +#include + +#include "rtklib.h" +#include "glofcndlg.h" + +//--------------------------------------------------------------------------- +GloFcnDialog::GloFcnDialog(QWidget* parent) : QDialog(parent) +{ + setupUi(this); + EnaGloFcn=0; + + for (int i=0;i<27;i++) { + GloFcn[i]=0; + } + + connect(BtnCancel, SIGNAL(clicked(bool)), this, SLOT(reject())); + connect(BtnOk, SIGNAL(clicked(bool)), this, SLOT(BtnOkClick())); + connect(BtnClear, SIGNAL(clicked(bool)), this, SLOT(BtnClearClick())); + connect(BtnRead, SIGNAL(clicked(bool)), this, SLOT(BtnReadClick())); + connect(EnaFcn, SIGNAL(stateChanged(int)), this, SLOT(UpdateEnable())); +} +//--------------------------------------------------------------------------- + +void GloFcnDialog::showEvent(QShowEvent*) +{ + QString text; + + EnaFcn->setChecked(EnaGloFcn); + + for (int i=0;i<27;i++) { + if (GloFcn[i]) GetFcn(i+1)->setText(QString::number(GloFcn[i]-8)); + else GetFcn(i+1)->setText(""); + } + UpdateEnable(); +} +//--------------------------------------------------------------------------- +void GloFcnDialog::BtnOkClick() +{ + QString text; + int no; + bool ok; + + EnaGloFcn=EnaFcn->isChecked(); + + for (int i=0;i<27;i++) { + text=GetFcn(i+1)->text(); + no = text.toInt(&ok); + if (ok&&no>=-7&&no<=6) { + GloFcn[i]=no+8; + } + else GloFcn[i]=0; // GLONASS FCN+8 (0:none) + } + accept(); +} +//--------------------------------------------------------------------------- +void GloFcnDialog::BtnReadClick() +{ + QString file,text; + nav_t nav; + int prn; + + memset(&nav, 0, sizeof(nav_t)); + + file=QFileDialog::getOpenFileName(this); + + if (!readrnx(qPrintable(file),0,"",NULL,&nav,NULL)) return; + + for (int i=0;isetText(QString::number(nav.geph[i].frq)); + } + freenav(&nav,0xFF); +} +//--------------------------------------------------------------------------- +void GloFcnDialog::BtnClearClick() +{ + for (int i=0;i<27;i++) { + GetFcn(i+1)->setText(""); + } +} +//--------------------------------------------------------------------------- +void GloFcnDialog::EnaFcnClick() +{ + UpdateEnable(); +} +//--------------------------------------------------------------------------- +void GloFcnDialog::UpdateEnable(void) +{ + BtnClear->setEnabled(EnaFcn->isChecked()); + BtnRead ->setEnabled(EnaFcn->isChecked()); + Label21 ->setEnabled(EnaFcn->isChecked()); + Label22 ->setEnabled(EnaFcn->isChecked()); + + for (int i=0;i<27;i++) { + GetFcn(i+1)->setEnabled(EnaFcn->isChecked()); + } +} +//--------------------------------------------------------------------------- +QLineEdit * GloFcnDialog::GetFcn(int prn) +{ + QLineEdit *fcn[]={ + Fcn01,Fcn02,Fcn03,Fcn04,Fcn05,Fcn06,Fcn07,Fcn08,Fcn09,Fcn10, + Fcn11,Fcn12,Fcn13,Fcn14,Fcn15,Fcn16,Fcn17,Fcn18,Fcn19,Fcn20, + Fcn21,Fcn22,Fcn23,Fcn24,Fcn25,Fcn26,Fcn27 + }; + return fcn[prn-1]; +} +//--------------------------------------------------------------------------- + diff --git a/app/qtapp/appcmn_qt/glofcndlg.h b/app/qtapp/appcmn_qt/glofcndlg.h new file mode 100644 index 000000000..b9935da0f --- /dev/null +++ b/app/qtapp/appcmn_qt/glofcndlg.h @@ -0,0 +1,35 @@ +//--------------------------------------------------------------------------- + +#ifndef glofcndlgH +#define glofcndlgH +//--------------------------------------------------------------------------- + +#include +#include +#include "ui_glofcndlg.h" + +//--------------------------------------------------------------------------- +class GloFcnDialog : public QDialog, private Ui::GloFcnDialog +{ + Q_OBJECT + +public slots: + void BtnOkClick(); + void BtnReadClick(); + void BtnClearClick(); + void EnaFcnClick(); + void UpdateEnable(void); +private: + QLineEdit * GetFcn(int prn); + +protected: + void showEvent(QShowEvent*); + +public: + GloFcnDialog(QWidget *parent); + + int EnaGloFcn,GloFcn[27]; +}; + +//--------------------------------------------------------------------------- +#endif diff --git a/app/qtapp/appcmn_qt/glofcndlg.ui b/app/qtapp/appcmn_qt/glofcndlg.ui new file mode 100644 index 000000000..3cd651e31 --- /dev/null +++ b/app/qtapp/appcmn_qt/glofcndlg.ui @@ -0,0 +1,374 @@ + + + GloFcnDialog + + + + 0 + 0 + 612 + 276 + + + + GLONASS Frequency Channel Number + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + R01 + + + + + + + + + + R17 + + + + + + + R05 + + + + + + + R16 + + + + + + + R14 + + + + + + + + + + + + + + + + R04 + + + + + + + + + + R10 + + + + + + + R07 + + + + + + + + + + R20 + + + + + + + R09 + + + + + + + R22 + + + + + + + + + + + + + + + + + + + R24 + + + + + + + + + + R23 + + + + + + + R15 + + + + + + + + + + + + + R21 + + + + + + + + + + + + + R06 + + + + + + + + + + R18 + + + + + + + R13 + + + + + + + + + + + + + R11 + + + + + + + + + + + + + + + + R27 + + + + + + + + + + R19 + + + + + + + R12 + + + + + + + + + + R03 + + + + + + + + + + R26 + + + + + + + + + + + + + R08 + + + + + + + R25 + + + + + + + R02 + + + + + + + + + + FCN: + + + Qt::AlignCenter + + + + + + + -7 ... 6 + + + Qt::AlignCenter + + + + + + + + + + Read + + + + + + + Clear + + + + + + + Cancel + + + + + + + Ok + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Use FCN Table + + + + + + + + diff --git a/app/qtapp/appcmn_qt/gm_template.h b/app/qtapp/appcmn_qt/gm_template.h new file mode 100644 index 000000000..f3701e313 --- /dev/null +++ b/app/qtapp/appcmn_qt/gm_template.h @@ -0,0 +1,127 @@ +#ifndef gm_templateH +#define gm_templateH + +#include + +static QString htmlPage = R"~~~( + + + + +RTKLIB_GM + + + + + + +
+ + + +)~~~"; +#endif diff --git a/app/qtapp/appcmn_qt/mntpoptdlg.cpp b/app/qtapp/appcmn_qt/mntpoptdlg.cpp new file mode 100644 index 000000000..53e714823 --- /dev/null +++ b/app/qtapp/appcmn_qt/mntpoptdlg.cpp @@ -0,0 +1,51 @@ +//--------------------------------------------------------------------------- +#include + +#include + +#include "rtklib.h" +#include "mntpoptdlg.h" +//--------------------------------------------------------------------------- + + +//--------------------------------------------------------------------------- +MntpOptDialog::MntpOptDialog(QWidget* parent) + : QDialog(parent) +{ + setupUi(this); +} +//--------------------------------------------------------------------------- +void MntpOptDialog::showEvent(QShowEvent* event) +{ + if (event->spontaneous()) return; + QLineEdit *edit[]={ + SrcTbl1,SrcTbl2,SrcTbl3,NULL,SrcTbl5,SrcTbl6,SrcTbl7,SrcTbl8,SrcTbl9, + NULL,NULL,SrcTbl12,SrcTbl13,NULL,NULL,SrcTbl16 + }; + QComboBox *box[]={ + NULL,NULL,NULL,SrcTbl4,NULL,NULL,NULL,NULL,NULL,SrcTbl10,SrcTbl11,NULL, + NULL,SrcTbl14,SrcTbl15,NULL + }; + + MntPntE->setText(MntPnt); + + QStringList tokens=MntpStr.split(";"); + + for (int i=0;i<16;i++) { + if (edit[i]==NULL) edit[i]->setText(""); else box[i]->setCurrentIndex(0); + } + + for (int i=0;isetText(tokens.at(i)); else box[i]->setCurrentText(tokens.at(i)); + } +} +//--------------------------------------------------------------------------- +void MntpOptDialog::BtnOkClick() +{ + MntPnt=MntPntE->text(); + MntpStr=SrcTbl1->text()+";"+SrcTbl2->text()+";"+SrcTbl3->text()+";"+SrcTbl4->currentText()+";"+ + SrcTbl5->text()+";"+SrcTbl6->text()+";"+SrcTbl7->text()+";"+SrcTbl8->text()+";"+ + SrcTbl9->text()+";"+SrcTbl10->currentText()+";"+SrcTbl11->currentText()+";"+SrcTbl12->text()+";"+ + SrcTbl13->text()+";"+SrcTbl14->currentText()+";"+SrcTbl15->currentText()+";"+SrcTbl16->text(); +} +//--------------------------------------------------------------------------- diff --git a/app/qtapp/appcmn_qt/mntpoptdlg.h b/app/qtapp/appcmn_qt/mntpoptdlg.h new file mode 100644 index 000000000..fd19f3464 --- /dev/null +++ b/app/qtapp/appcmn_qt/mntpoptdlg.h @@ -0,0 +1,25 @@ +//--------------------------------------------------------------------------- +#ifndef mntpoptdlgH +#define mntpoptdlgH +//--------------------------------------------------------------------------- + +#define MAXHIST 10 +#include "ui_mntpoptdlg.h" + + +//--------------------------------------------------------------------------- +class MntpOptDialog : public QDialog, private Ui::MntpOptDialog +{ + Q_OBJECT +protected: + void showEvent(QShowEvent*); +public slots: + void BtnOkClick(); + +public: + QString MntPnt,MntpStr; + MntpOptDialog(QWidget* parent); +}; + +//--------------------------------------------------------------------------- +#endif diff --git a/app/qtapp/appcmn_qt/mntpoptdlg.ui b/app/qtapp/appcmn_qt/mntpoptdlg.ui new file mode 100644 index 000000000..2a9aac63b --- /dev/null +++ b/app/qtapp/appcmn_qt/mntpoptdlg.ui @@ -0,0 +1,302 @@ + + + MntpOptDialog + + + + 0 + 0 + 420 + 692 + + + + Mountpoint Options + + + + + + Carrier + + + + + + + + + + + + + + N + + + + + B + + + + + D + + + + + + + + Network + + + + + + + + 0 + + + + + 1 + + + + + + + + Country + + + + + + + + + + + + + Generator + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Ok + + + true + + + + + + + &Cancel + + + + + + + + + + Bitrate + + + + + + + + + + + + + + + + + + + Latitude + + + + + + + Compr-encryp + + + + + + + Nav-System + + + + + + + Format + + + + + + + + + + Solution + + + + + + + + 0 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + + + + + 0 + + + + + 1 + + + + + + + + Source ID + + + + + + + Longitude + + + + + + + + + + + + + Format Details + + + + + + + Free + + + + + + + + + + Auth + + + + + + + + N + + + + + Y + + + + + + + + Mountpoint + + + + + + + + diff --git a/app/qtapp/rtklaunch_qt/launchoptdlg.cpp b/app/qtapp/rtklaunch_qt/launchoptdlg.cpp new file mode 100644 index 000000000..c6067ab42 --- /dev/null +++ b/app/qtapp/rtklaunch_qt/launchoptdlg.cpp @@ -0,0 +1,45 @@ +//--------------------------------------------------------------------------- + +#include "launchmain.h" +#include "launchoptdlg.h" + +#include + +extern MainForm *mainForm; + +//--------------------------------------------------------------------------- +LaunchOptDialog::LaunchOptDialog(QWidget *parent) + : QDialog(parent) +{ + setupUi(this); +} +//--------------------------------------------------------------------------- +void LaunchOptDialog::showEvent(QShowEvent *event) +{ + if (event->spontaneous()) return; + + if (mainForm->Option == 1) { + OptMkl->setChecked(true); + } + else if (mainForm->Option == 2) { + OptWin64->setChecked(true); + } + else { + OptNormal->setChecked(true); + } + Minimize->setChecked(mainForm->Minimize); +} +//--------------------------------------------------------------------------- +void LaunchOptDialog::BtnOkClick() +{ + if (OptMkl->isChecked()) { + mainForm->Option = 1; + } + else if (OptWin64->isChecked()) { + mainForm->Option = 2; + } + else { + mainForm->Option = 0; + } + mainForm->Minimize=Minimize->isChecked(); +}//--------------------------------------------------------------------------- diff --git a/app/qtapp/rtklaunch_qt/launchoptdlg.h b/app/qtapp/rtklaunch_qt/launchoptdlg.h new file mode 100644 index 000000000..a67935ba8 --- /dev/null +++ b/app/qtapp/rtklaunch_qt/launchoptdlg.h @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- + +#ifndef launchoptdlgH +#define launchoptdlgH +//--------------------------------------------------------------------------- +#include "ui_launchoptdlg.h" +#include + +class QShowEvent; +//--------------------------------------------------------------------------- +class LaunchOptDialog : public QDialog, private Ui::LaunchOptDialog +{ + Q_OBJECT +public slots: + void BtnOkClick(); + +protected: + void showEvent(QShowEvent *); +public: + LaunchOptDialog(QWidget* parent); +}; +//--------------------------------------------------------------------------- +#endif diff --git a/app/qtapp/rtklaunch_qt/launchoptdlg.ui b/app/qtapp/rtklaunch_qt/launchoptdlg.ui new file mode 100644 index 000000000..306bebcdf --- /dev/null +++ b/app/qtapp/rtklaunch_qt/launchoptdlg.ui @@ -0,0 +1,123 @@ + + + LaunchOptDialog + + + + 0 + 0 + 264 + 147 + + + + Options + + + + + + + + + true + + + + + + Qt::LeftToRight + + + &Normal APs (32 bit without MKL) + + + false + + + + + + + true + + + + + + Qt::LeftToRight + + + RTKPOST_&MKL, RTKNAVI_MKL + + + false + + + + + + + true + + + + + + Qt::LeftToRight + + + RTKPOST_WIN&64, RTKNAVI_WIN64 + + + false + + + + + + + + + + Minimize + + + false + + + + + + + true + + + + + + &OK + + + true + + + + + + + true + + + + + + &Cancel + + + + + + + + diff --git a/app/qtapp/rtknavi_qt/gmview_notes.txt b/app/qtapp/rtknavi_qt/gmview_notes.txt new file mode 100644 index 000000000..1017b1f2d --- /dev/null +++ b/app/qtapp/rtknavi_qt/gmview_notes.txt @@ -0,0 +1,14 @@ +Map View by Google Maps Notes + +2020/11/30 + +To enable Map View of RTKPLOT by Google Maps API, add Windows registry +keys by using REGEDIT as follows: + +Key +\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\ +FEATURE_BROWSER_EMULATION + +Name Type Data +... +rtkplot.exe REG_DWORD 0x00002af8 (11000) diff --git a/app/qtapp/rtknavi_qt/rtknavi_Icon.ico b/app/qtapp/rtknavi_qt/rtknavi_Icon.ico new file mode 100644 index 000000000..bb85e8c25 Binary files /dev/null and b/app/qtapp/rtknavi_qt/rtknavi_Icon.ico differ diff --git a/app/qtapp/rtkplot_qt/image/marker_blue.png b/app/qtapp/rtkplot_qt/image/marker_blue.png new file mode 100644 index 000000000..042db5755 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_blue.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_bluegreen.png b/app/qtapp/rtkplot_qt/image/marker_bluegreen.png new file mode 100644 index 000000000..590675e59 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_bluegreen.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_bluegreenx2.png b/app/qtapp/rtkplot_qt/image/marker_bluegreenx2.png new file mode 100644 index 000000000..7bf6d3944 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_bluegreenx2.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_bluex2.png b/app/qtapp/rtkplot_qt/image/marker_bluex2.png new file mode 100644 index 000000000..1148c059e Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_bluex2.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_green.png b/app/qtapp/rtkplot_qt/image/marker_green.png new file mode 100644 index 000000000..f2f20e99d Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_green.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_greenx2.png b/app/qtapp/rtkplot_qt/image/marker_greenx2.png new file mode 100644 index 000000000..f76450aec Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_greenx2.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_magenta.png b/app/qtapp/rtkplot_qt/image/marker_magenta.png new file mode 100644 index 000000000..562a5cb39 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_magenta.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_magentax2.png b/app/qtapp/rtkplot_qt/image/marker_magentax2.png new file mode 100644 index 000000000..52a0b90e8 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_magentax2.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_orange.png b/app/qtapp/rtkplot_qt/image/marker_orange.png new file mode 100644 index 000000000..d2b79e564 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_orange.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_orangex2.png b/app/qtapp/rtkplot_qt/image/marker_orangex2.png new file mode 100644 index 000000000..d2b79e564 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_orangex2.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_red.png b/app/qtapp/rtkplot_qt/image/marker_red.png new file mode 100644 index 000000000..fb46f2f91 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_red.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_redx2.png b/app/qtapp/rtkplot_qt/image/marker_redx2.png new file mode 100644 index 000000000..741b55b90 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_redx2.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_yellow.png b/app/qtapp/rtkplot_qt/image/marker_yellow.png new file mode 100644 index 000000000..84b183d3e Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_yellow.png differ diff --git a/app/qtapp/rtkplot_qt/image/marker_yellowx2.png b/app/qtapp/rtkplot_qt/image/marker_yellowx2.png new file mode 100644 index 000000000..0384f86f5 Binary files /dev/null and b/app/qtapp/rtkplot_qt/image/marker_yellowx2.png differ diff --git a/app/qtapp/rtkplot_qt/leaflet/images/layers-2x.png b/app/qtapp/rtkplot_qt/leaflet/images/layers-2x.png new file mode 100644 index 000000000..200c333dc Binary files /dev/null and b/app/qtapp/rtkplot_qt/leaflet/images/layers-2x.png differ diff --git a/app/qtapp/rtkplot_qt/leaflet/images/layers.png b/app/qtapp/rtkplot_qt/leaflet/images/layers.png new file mode 100644 index 000000000..1a72e5784 Binary files /dev/null and b/app/qtapp/rtkplot_qt/leaflet/images/layers.png differ diff --git a/app/qtapp/rtkplot_qt/leaflet/images/marker-icon-2x.png b/app/qtapp/rtkplot_qt/leaflet/images/marker-icon-2x.png new file mode 100644 index 000000000..88f9e5018 Binary files /dev/null and b/app/qtapp/rtkplot_qt/leaflet/images/marker-icon-2x.png differ diff --git a/app/qtapp/rtkplot_qt/leaflet/images/marker-icon.png b/app/qtapp/rtkplot_qt/leaflet/images/marker-icon.png new file mode 100644 index 000000000..950edf246 Binary files /dev/null and b/app/qtapp/rtkplot_qt/leaflet/images/marker-icon.png differ diff --git a/app/qtapp/rtkplot_qt/leaflet/images/marker-shadow.png b/app/qtapp/rtkplot_qt/leaflet/images/marker-shadow.png new file mode 100644 index 000000000..9fd297953 Binary files /dev/null and b/app/qtapp/rtkplot_qt/leaflet/images/marker-shadow.png differ diff --git a/app/qtapp/rtkplot_qt/leaflet/leaflet.css b/app/qtapp/rtkplot_qt/leaflet/leaflet.css new file mode 100644 index 000000000..384f5c8a2 --- /dev/null +++ b/app/qtapp/rtkplot_qt/leaflet/leaflet.css @@ -0,0 +1,640 @@ +/* required styles */ + +.leaflet-pane, +.leaflet-tile, +.leaflet-marker-icon, +.leaflet-marker-shadow, +.leaflet-tile-container, +.leaflet-pane > svg, +.leaflet-pane > canvas, +.leaflet-zoom-box, +.leaflet-image-layer, +.leaflet-layer { + position: absolute; + left: 0; + top: 0; + } +.leaflet-container { + overflow: hidden; + } +.leaflet-tile, +.leaflet-marker-icon, +.leaflet-marker-shadow { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + -webkit-user-drag: none; + } +/* Prevents IE11 from highlighting tiles in blue */ +.leaflet-tile::selection { + background: transparent; +} +/* Safari renders non-retina tile on retina better with this, but Chrome is worse */ +.leaflet-safari .leaflet-tile { + image-rendering: -webkit-optimize-contrast; + } +/* hack that prevents hw layers "stretching" when loading new tiles */ +.leaflet-safari .leaflet-tile-container { + width: 1600px; + height: 1600px; + -webkit-transform-origin: 0 0; + } +.leaflet-marker-icon, +.leaflet-marker-shadow { + display: block; + } +/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ +/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ +.leaflet-container .leaflet-overlay-pane svg, +.leaflet-container .leaflet-marker-pane img, +.leaflet-container .leaflet-shadow-pane img, +.leaflet-container .leaflet-tile-pane img, +.leaflet-container img.leaflet-image-layer, +.leaflet-container .leaflet-tile { + max-width: none !important; + max-height: none !important; + } + +.leaflet-container.leaflet-touch-zoom { + -ms-touch-action: pan-x pan-y; + touch-action: pan-x pan-y; + } +.leaflet-container.leaflet-touch-drag { + -ms-touch-action: pinch-zoom; + /* Fallback for FF which doesn't support pinch-zoom */ + touch-action: none; + touch-action: pinch-zoom; +} +.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { + -ms-touch-action: none; + touch-action: none; +} +.leaflet-container { + -webkit-tap-highlight-color: transparent; +} +.leaflet-container a { + -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4); +} +.leaflet-tile { + filter: inherit; + visibility: hidden; + } +.leaflet-tile-loaded { + visibility: inherit; + } +.leaflet-zoom-box { + width: 0; + height: 0; + -moz-box-sizing: border-box; + box-sizing: border-box; + z-index: 800; + } +/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */ +.leaflet-overlay-pane svg { + -moz-user-select: none; + } + +.leaflet-pane { z-index: 400; } + +.leaflet-tile-pane { z-index: 200; } +.leaflet-overlay-pane { z-index: 400; } +.leaflet-shadow-pane { z-index: 500; } +.leaflet-marker-pane { z-index: 600; } +.leaflet-tooltip-pane { z-index: 650; } +.leaflet-popup-pane { z-index: 700; } + +.leaflet-map-pane canvas { z-index: 100; } +.leaflet-map-pane svg { z-index: 200; } + +.leaflet-vml-shape { + width: 1px; + height: 1px; + } +.lvml { + behavior: url(#default#VML); + display: inline-block; + position: absolute; + } + + +/* control positioning */ + +.leaflet-control { + position: relative; + z-index: 800; + pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ + pointer-events: auto; + } +.leaflet-top, +.leaflet-bottom { + position: absolute; + z-index: 1000; + pointer-events: none; + } +.leaflet-top { + top: 0; + } +.leaflet-right { + right: 0; + } +.leaflet-bottom { + bottom: 0; + } +.leaflet-left { + left: 0; + } +.leaflet-control { + float: left; + clear: both; + } +.leaflet-right .leaflet-control { + float: right; + } +.leaflet-top .leaflet-control { + margin-top: 10px; + } +.leaflet-bottom .leaflet-control { + margin-bottom: 10px; + } +.leaflet-left .leaflet-control { + margin-left: 10px; + } +.leaflet-right .leaflet-control { + margin-right: 10px; + } + + +/* zoom and fade animations */ + +.leaflet-fade-anim .leaflet-tile { + will-change: opacity; + } +.leaflet-fade-anim .leaflet-popup { + opacity: 0; + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; + } +.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { + opacity: 1; + } +.leaflet-zoom-animated { + -webkit-transform-origin: 0 0; + -ms-transform-origin: 0 0; + transform-origin: 0 0; + } +.leaflet-zoom-anim .leaflet-zoom-animated { + will-change: transform; + } +.leaflet-zoom-anim .leaflet-zoom-animated { + -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); + -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); + transition: transform 0.25s cubic-bezier(0,0,0.25,1); + } +.leaflet-zoom-anim .leaflet-tile, +.leaflet-pan-anim .leaflet-tile { + -webkit-transition: none; + -moz-transition: none; + transition: none; + } + +.leaflet-zoom-anim .leaflet-zoom-hide { + visibility: hidden; + } + + +/* cursors */ + +.leaflet-interactive { + cursor: pointer; + } +.leaflet-grab { + cursor: -webkit-grab; + cursor: -moz-grab; + cursor: grab; + } +.leaflet-crosshair, +.leaflet-crosshair .leaflet-interactive { + cursor: crosshair; + } +.leaflet-popup-pane, +.leaflet-control { + cursor: auto; + } +.leaflet-dragging .leaflet-grab, +.leaflet-dragging .leaflet-grab .leaflet-interactive, +.leaflet-dragging .leaflet-marker-draggable { + cursor: move; + cursor: -webkit-grabbing; + cursor: -moz-grabbing; + cursor: grabbing; + } + +/* marker & overlays interactivity */ +.leaflet-marker-icon, +.leaflet-marker-shadow, +.leaflet-image-layer, +.leaflet-pane > svg path, +.leaflet-tile-container { + pointer-events: none; + } + +.leaflet-marker-icon.leaflet-interactive, +.leaflet-image-layer.leaflet-interactive, +.leaflet-pane > svg path.leaflet-interactive, +svg.leaflet-image-layer.leaflet-interactive path { + pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ + pointer-events: auto; + } + +/* visual tweaks */ + +.leaflet-container { + background: #ddd; + outline: 0; + } +.leaflet-container a { + color: #0078A8; + } +.leaflet-container a.leaflet-active { + outline: 2px solid orange; + } +.leaflet-zoom-box { + border: 2px dotted #38f; + background: rgba(255,255,255,0.5); + } + + +/* general typography */ +.leaflet-container { + font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; + } + + +/* general toolbar styles */ + +.leaflet-bar { + box-shadow: 0 1px 5px rgba(0,0,0,0.65); + border-radius: 4px; + } +.leaflet-bar a, +.leaflet-bar a:hover { + background-color: #fff; + border-bottom: 1px solid #ccc; + width: 26px; + height: 26px; + line-height: 26px; + display: block; + text-align: center; + text-decoration: none; + color: black; + } +.leaflet-bar a, +.leaflet-control-layers-toggle { + background-position: 50% 50%; + background-repeat: no-repeat; + display: block; + } +.leaflet-bar a:hover { + background-color: #f4f4f4; + } +.leaflet-bar a:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + } +.leaflet-bar a:last-child { + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border-bottom: none; + } +.leaflet-bar a.leaflet-disabled { + cursor: default; + background-color: #f4f4f4; + color: #bbb; + } + +.leaflet-touch .leaflet-bar a { + width: 30px; + height: 30px; + line-height: 30px; + } +.leaflet-touch .leaflet-bar a:first-child { + border-top-left-radius: 2px; + border-top-right-radius: 2px; + } +.leaflet-touch .leaflet-bar a:last-child { + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; + } + +/* zoom control */ + +.leaflet-control-zoom-in, +.leaflet-control-zoom-out { + font: bold 18px 'Lucida Console', Monaco, monospace; + text-indent: 1px; + } + +.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out { + font-size: 22px; + } + + +/* layers control */ + +.leaflet-control-layers { + box-shadow: 0 1px 5px rgba(0,0,0,0.4); + background: #fff; + border-radius: 5px; + } +.leaflet-control-layers-toggle { + background-image: url(qrc:/leaflet/images/layers.png); + width: 36px; + height: 36px; + } +.leaflet-retina .leaflet-control-layers-toggle { + background-image: url(qrc:/leaflet/images/layers-2x.png); + background-size: 26px 26px; + } +.leaflet-touch .leaflet-control-layers-toggle { + width: 44px; + height: 44px; + } +.leaflet-control-layers .leaflet-control-layers-list, +.leaflet-control-layers-expanded .leaflet-control-layers-toggle { + display: none; + } +.leaflet-control-layers-expanded .leaflet-control-layers-list { + display: block; + position: relative; + } +.leaflet-control-layers-expanded { + padding: 6px 10px 6px 6px; + color: #333; + background: #fff; + } +.leaflet-control-layers-scrollbar { + overflow-y: scroll; + overflow-x: hidden; + padding-right: 5px; + } +.leaflet-control-layers-selector { + margin-top: 2px; + position: relative; + top: 1px; + } +.leaflet-control-layers label { + display: block; + } +.leaflet-control-layers-separator { + height: 0; + border-top: 1px solid #ddd; + margin: 5px -10px 5px -6px; + } + +/* Default icon URLs */ +.leaflet-default-icon-path { + background-image: url(qrc:/leaflet/images/marker-icon.png); + } + + +/* attribution and scale controls */ + +.leaflet-container .leaflet-control-attribution { + background: #fff; + background: rgba(255, 255, 255, 0.7); + margin: 0; + } +.leaflet-control-attribution, +.leaflet-control-scale-line { + padding: 0 5px; + color: #333; + } +.leaflet-control-attribution a { + text-decoration: none; + } +.leaflet-control-attribution a:hover { + text-decoration: underline; + } +.leaflet-container .leaflet-control-attribution, +.leaflet-container .leaflet-control-scale { + font-size: 11px; + } +.leaflet-left .leaflet-control-scale { + margin-left: 5px; + } +.leaflet-bottom .leaflet-control-scale { + margin-bottom: 5px; + } +.leaflet-control-scale-line { + border: 2px solid #777; + border-top: none; + line-height: 1.1; + padding: 2px 5px 1px; + font-size: 11px; + white-space: nowrap; + overflow: hidden; + -moz-box-sizing: border-box; + box-sizing: border-box; + + background: #fff; + background: rgba(255, 255, 255, 0.5); + } +.leaflet-control-scale-line:not(:first-child) { + border-top: 2px solid #777; + border-bottom: none; + margin-top: -2px; + } +.leaflet-control-scale-line:not(:first-child):not(:last-child) { + border-bottom: 2px solid #777; + } + +.leaflet-touch .leaflet-control-attribution, +.leaflet-touch .leaflet-control-layers, +.leaflet-touch .leaflet-bar { + box-shadow: none; + } +.leaflet-touch .leaflet-control-layers, +.leaflet-touch .leaflet-bar { + border: 2px solid rgba(0,0,0,0.2); + background-clip: padding-box; + } + + +/* popup */ + +.leaflet-popup { + position: absolute; + text-align: center; + margin-bottom: 20px; + } +.leaflet-popup-content-wrapper { + padding: 1px; + text-align: left; + border-radius: 12px; + } +.leaflet-popup-content { + margin: 13px 19px; + line-height: 1.4; + } +.leaflet-popup-content p { + margin: 18px 0; + } +.leaflet-popup-tip-container { + width: 40px; + height: 20px; + position: absolute; + left: 50%; + margin-left: -20px; + overflow: hidden; + pointer-events: none; + } +.leaflet-popup-tip { + width: 17px; + height: 17px; + padding: 1px; + + margin: -10px auto 0; + + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + } +.leaflet-popup-content-wrapper, +.leaflet-popup-tip { + background: white; + color: #333; + box-shadow: 0 3px 14px rgba(0,0,0,0.4); + } +.leaflet-container a.leaflet-popup-close-button { + position: absolute; + top: 0; + right: 0; + padding: 4px 4px 0 0; + border: none; + text-align: center; + width: 18px; + height: 14px; + font: 16px/14px Tahoma, Verdana, sans-serif; + color: #c3c3c3; + text-decoration: none; + font-weight: bold; + background: transparent; + } +.leaflet-container a.leaflet-popup-close-button:hover { + color: #999; + } +.leaflet-popup-scrolled { + overflow: auto; + border-bottom: 1px solid #ddd; + border-top: 1px solid #ddd; + } + +.leaflet-oldie .leaflet-popup-content-wrapper { + -ms-zoom: 1; + } +.leaflet-oldie .leaflet-popup-tip { + width: 24px; + margin: 0 auto; + + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; + filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); + } +.leaflet-oldie .leaflet-popup-tip-container { + margin-top: -1px; + } + +.leaflet-oldie .leaflet-control-zoom, +.leaflet-oldie .leaflet-control-layers, +.leaflet-oldie .leaflet-popup-content-wrapper, +.leaflet-oldie .leaflet-popup-tip { + border: 1px solid #999; + } + + +/* div icon */ + +.leaflet-div-icon { + background: #fff; + border: 1px solid #666; + } + + +/* Tooltip */ +/* Base styles for the element that has a tooltip */ +.leaflet-tooltip { + position: absolute; + padding: 6px; + background-color: #fff; + border: 1px solid #fff; + border-radius: 3px; + color: #222; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + pointer-events: none; + box-shadow: 0 1px 3px rgba(0,0,0,0.4); + } +.leaflet-tooltip.leaflet-clickable { + cursor: pointer; + pointer-events: auto; + } +.leaflet-tooltip-top:before, +.leaflet-tooltip-bottom:before, +.leaflet-tooltip-left:before, +.leaflet-tooltip-right:before { + position: absolute; + pointer-events: none; + border: 6px solid transparent; + background: transparent; + content: ""; + } + +/* Directions */ + +.leaflet-tooltip-bottom { + margin-top: 6px; +} +.leaflet-tooltip-top { + margin-top: -6px; +} +.leaflet-tooltip-bottom:before, +.leaflet-tooltip-top:before { + left: 50%; + margin-left: -6px; + } +.leaflet-tooltip-top:before { + bottom: 0; + margin-bottom: -12px; + border-top-color: #fff; + } +.leaflet-tooltip-bottom:before { + top: 0; + margin-top: -12px; + margin-left: -6px; + border-bottom-color: #fff; + } +.leaflet-tooltip-left { + margin-left: -6px; +} +.leaflet-tooltip-right { + margin-left: 6px; +} +.leaflet-tooltip-left:before, +.leaflet-tooltip-right:before { + top: 50%; + margin-top: -6px; + } +.leaflet-tooltip-left:before { + right: 0; + margin-right: -12px; + border-left-color: #fff; + } +.leaflet-tooltip-right:before { + left: 0; + margin-left: -12px; + border-right-color: #fff; + } diff --git a/app/qtapp/rtkplot_qt/leaflet/leaflet.js b/app/qtapp/rtkplot_qt/leaflet/leaflet.js new file mode 100644 index 000000000..21f499c3e --- /dev/null +++ b/app/qtapp/rtkplot_qt/leaflet/leaflet.js @@ -0,0 +1,6 @@ +/* @preserve + * Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com + * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade + */ +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";function h(t){for(var i,e,n=1,o=arguments.length;n=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=O(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=O(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.xi.y&&n.y=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=N(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=N(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lati.lng&&n.lng';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}();function kt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var Bt={ie:tt,ielt9:it,edge:et,webkit:nt,android:ot,android23:st,androidStock:at,opera:ht,chrome:ut,gecko:lt,safari:ct,phantom:_t,opera12:dt,win:pt,ie3d:mt,webkit3d:ft,gecko3d:gt,any3d:vt,mobile:yt,mobileWebkit:xt,mobileWebkit3d:wt,msPointer:Pt,pointer:Lt,touch:bt,mobileOpera:Tt,mobileGecko:Mt,retina:zt,passiveEvents:Ct,canvas:St,svg:Zt,vml:Et},At=Pt?"MSPointerDown":"pointerdown",It=Pt?"MSPointerMove":"pointermove",Ot=Pt?"MSPointerUp":"pointerup",Rt=Pt?"MSPointerCancel":"pointercancel",Nt={},Dt=!1;function jt(t,i,e,n){function o(t){Ut(t,r)}var s,r,a,h,u,l,c,_;function d(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Ut(t,h)}return"touchstart"===i?(u=t,l=e,c=n,_=p(function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Ri(t),Ut(t,l)}),u["_leaflet_touchstart"+c]=_,u.addEventListener(At,_,!1),Dt||(document.addEventListener(At,Wt,!0),document.addEventListener(It,Ht,!0),document.addEventListener(Ot,Ft,!0),document.addEventListener(Rt,Ft,!0),Dt=!0)):"touchmove"===i?(h=e,(a=t)["_leaflet_touchmove"+n]=d,a.addEventListener(It,d,!1)):"touchend"===i&&(r=e,(s=t)["_leaflet_touchend"+n]=o,s.addEventListener(Ot,o,!1),s.addEventListener(Rt,o,!1)),this}function Wt(t){Nt[t.pointerId]=t}function Ht(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function Ft(t){delete Nt[t.pointerId]}function Ut(t,i){for(var e in t.touches=[],Nt)t.touches.push(Nt[e]);t.changedTouches=[t],i(t)}var Vt=Pt?"MSPointerDown":Lt?"pointerdown":"touchstart",qt=Pt?"MSPointerUp":Lt?"pointerup":"touchend",Gt="_leaflet_";var Kt,Yt,Xt,Jt,$t,Qt,ti=fi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ii=fi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ei="webkitTransition"===ii||"OTransition"===ii?ii+"End":"transitionend";function ni(t){return"string"==typeof t?document.getElementById(t):t}function oi(t,i){var e,n=t.style[i]||t.currentStyle&&t.currentStyle[i];return n&&"auto"!==n||!document.defaultView||(n=(e=document.defaultView.getComputedStyle(t,null))?e[i]:null),"auto"===n?null:n}function si(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function ri(t){var i=t.parentNode;i&&i.removeChild(t)}function ai(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function hi(t){var i=t.parentNode;i&&i.lastChild!==t&&i.appendChild(t)}function ui(t){var i=t.parentNode;i&&i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function li(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=pi(t);return 0this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,N(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},panInside:function(t,i){var e,n,o=A((i=i||{}).paddingTopLeft||i.padding||[0,0]),s=A(i.paddingBottomRight||i.padding||[0,0]),r=this.getCenter(),a=this.project(r),h=this.project(t),u=this.getPixelBounds(),l=u.getSize().divideBy(2),c=O([u.min.add(o),u.max.subtract(s)]);return c.contains(h)||(this._enforcingBounds=!0,e=a.subtract(h),n=A(h.x+e.x,h.y+e.y),(h.xc.max.x)&&(n.x=a.x-e.x,0c.max.y)&&(n.y=a.y-e.y,0=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,n=[],o="mouseout"===i||"mouseover"===i,s=t.target||t.srcElement,r=!1;s;){if((e=this._targets[m(s)])&&("click"===i||"preclick"===i)&&!t._simulated&&this._draggableMoved(e)){r=!0;break}if(e&&e.listens(i,!0)){if(o&&!Vi(s,t))break;if(n.push(e),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Vi(s,t)||(n=[this]),n},_handleDOMEvent:function(t){var i;this._loaded&&!Ui(t)&&("mousedown"!==(i=t.type)&&"keypress"!==i&&"keyup"!==i&&"keydown"!==i||Pi(t.target||t.srcElement),this._fireDOMEvent(t,i))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,e){var n;if("click"===t.type&&((n=h({},t)).type="preclick",this._fireDOMEvent(n,n.type,e)),!t._stopped&&(e=(e||[]).concat(this._findEventTargets(t,i))).length){var o=e[0];"contextmenu"===i&&o.listens(i,!0)&&Ri(t);var s,r={originalEvent:t};"keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(s=o.getLatLng&&(!o._radius||o._radius<=10),r.containerPoint=s?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=s?o.getLatLng():this.layerPointToLatLng(r.layerPoint));for(var a=0;athis.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o))&&(M(function(){this._moveStart(!0,!1)._animateZoom(t,i,!0)},this),!0)},_animateZoom:function(t,i,e,n){this._mapPane&&(e&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,ci(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:n}),setTimeout(p(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_i(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),M(function(){this._moveEnd(!0)},this))}});function Yi(t){return new Xi(t)}var Xi=S.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return ci(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(ri(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=n):i=this._createRadioElement("leaflet-base-layers_"+m(this),n),this._layerControlInputs.push(i),i.layerId=m(t.layer),zi(i,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return e.appendChild(s),s.appendChild(i),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;0<=s;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;si.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),$i=Xi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=si("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=si("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),Oi(s),zi(s,"click",Ni),zi(s,"click",o,this),zi(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";_i(this._zoomInButton,i),_i(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMinZoom()||ci(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMaxZoom()||ci(this._zoomInButton,i)}});Ki.mergeOptions({zoomControl:!0}),Ki.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new $i,this.addControl(this.zoomControl))});var Qi=Xi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=si("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=si("div",i,e)),t.imperial&&(this._iScale=si("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;5280Leaflet'},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var i in(t.attributionControl=this)._container=si("div","leaflet-control-attribution"),Oi(this._container),t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t=[];for(var i in this._attributions)this._attributions[i]&&t.push(i);var e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(" | ")}}});Ki.mergeOptions({attributionControl:!0}),Ki.addInitHook(function(){this.options.attributionControl&&(new te).addTo(this)});Xi.Layers=Ji,Xi.Zoom=$i,Xi.Scale=Qi,Xi.Attribution=te,Yi.layers=function(t,i,e){return new Ji(t,i,e)},Yi.zoom=function(t){return new $i(t)},Yi.scale=function(t){return new Qi(t)},Yi.attribution=function(t){return new te(t)};var ie=S.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});ie.addTo=function(t,i){return t.addHandler(i,this),this};var ee,ne={Events:Z},oe=bt?"touchstart mousedown":"mousedown",se={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},re={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ae=E.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){c(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(zi(this._dragStartTarget,oe,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ae._dragging===this&&this.finishDrag(),Si(this._dragStartTarget,oe,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var i,e;!t._simulated&&this._enabled&&(this._moved=!1,li(this._element,"leaflet-zoom-anim")||ae._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((ae._dragging=this)._preventOutline&&Pi(this._element),xi(),Xt(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=bi(this._element),this._startPoint=new k(i.clientX,i.clientY),this._parentScale=Ti(e),zi(document,re[t.type],this._onMove,this),zi(document,se[t.type],this._onUp,this))))},_onMove:function(t){var i,e;!t._simulated&&this._enabled&&(t.touches&&1i&&(e.push(t[n]),o=n);oi.max.x&&(e|=2),t.yi.max.y&&(e|=8),e}function de(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,u=a*a+h*h;return 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(u=!u);return u||Oe.prototype._containsPoint.call(this,t,!0)}});var Ne=Ce.extend({initialize:function(t,i){c(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=g(t)?t:t.features;if(o){for(i=0,e=o.length;iu.x&&(l=s.x+n-u.x+h.x),s.x-l-a.x<0&&(l=s.x-a.x),s.y+e+h.y>u.y&&(c=s.y+e-u.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c]))},_onCloseButtonClick:function(t){this._close(),Ni(t)},_getAnchor:function(){return A(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ki.mergeOptions({closePopupOnClick:!0}),Ki.include({openPopup:function(t,i,e){return t instanceof tn||(t=new tn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Me.include({bindPopup:function(t,i){return t instanceof tn?(c(t,i),(this._popup=t)._source=this):(this._popup&&!i||(this._popup=new tn(i,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,i){return this._popup&&this._map&&(i=this._popup._prepareOpen(this,t,i),this._map.openPopup(this._popup,i)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i=t.layer||t.target;this._popup&&this._map&&(Ni(t),i instanceof Be?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===i?this.closePopup():this.openPopup(i,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var en=Qe.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Qe.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Qe.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Qe.prototype.getEvents.call(this);return bt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=si("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i,e=this._map,n=this._container,o=e.latLngToContainerPoint(e.getCenter()),s=e.layerPointToContainerPoint(t),r=this.options.direction,a=n.offsetWidth,h=n.offsetHeight,u=A(this.options.offset),l=this._getAnchor(),c="top"===r?(i=a/2,h):"bottom"===r?(i=a/2,0):(i="center"===r?a/2:"right"===r?0:"left"===r?a:s.xthis.options.maxZoom||nthis.options.maxZoom||void 0!==this.options.minZoom&&oe.max.x)||!i.wrapLat&&(t.ye.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return N(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e);return[i.unproject(n,t.z),i.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var i=this._tileCoordsToNwSe(t),e=new R(i[0],i[1]);return this.options.noWrap||(e=this._map.wrapLatLngBounds(e)),e},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new k(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(ri(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ci(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=a,t.onmousemove=a,it&&this.options.opacity<1&&mi(t,this.options.opacity),ot&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,i){var e=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),p(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&M(p(this._tileReady,this,t,null,o)),vi(o,e),this._tiles[n]={el:o,coords:t,current:!0},i.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,i,e){i&&this.fire("tileerror",{error:i,tile:e,coords:t});var n=this._tileCoordsToKey(t);(e=this._tiles[n])&&(e.loaded=+new Date,this._map._fadeAnimated?(mi(e.el,0),z(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(e.active=!0,this._pruneTiles()),i||(ci(e.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:e.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),it||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(p(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new k(this._wrapX?o(t.x,this._wrapX):t.x,this._wrapY?o(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new I(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var sn=on.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,i){this._url=t,(i=c(this,i)).detectRetina&&zt&&0')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_n={_initContainer:function(){this._container=si("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(hn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=cn("shape");ci(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=cn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[m(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;ri(i),t.removeInteractiveTarget(i),delete this._layers[m(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i=i||(t._stroke=cn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=g(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e=e||(t._fill=cn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){hi(t._container)},_bringToBack:function(t){ui(t._container)}},dn=Et?cn:J,pn=hn.extend({getEvents:function(){var t=hn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=dn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=dn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ri(this._container),Si(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){var t,i,e;this._map._animatingZoom&&this._bounds||(hn.prototype._update.call(this),i=(t=this._bounds).getSize(),e=this._container,this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),vi(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update"))},_initPath:function(t){var i=t._path=dn("path");t.options.className&&ci(i,t.options.className),t.options.interactive&&ci(i,"leaflet-interactive"),this._updateStyle(t),this._layers[m(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ri(t._path),t.removeInteractiveTarget(t._path),delete this._layers[m(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,$(t._parts,i))},_updateCircle:function(t){var i=t._point,e=Math.max(Math.round(t._radius),1),n="a"+e+","+(Math.max(Math.round(t._radiusY),1)||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){hi(t._path)},_bringToBack:function(t){ui(t._path)}});function mn(t){return Zt||Et?new pn(t):null}Et&&pn.include(_n),Ki.include({getRenderer:function(t){var i=(i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=this._createRenderer({pane:t}),this._paneRenderers[t]=i),i},_createRenderer:function(t){return this.options.preferCanvas&&ln(t)||mn(t)}});var fn=Re.extend({initialize:function(t,i){Re.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=N(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});pn.create=dn,pn.pointsToPath=$,Ne.geometryToLayer=De,Ne.coordsToLatLng=We,Ne.coordsToLatLngs=He,Ne.latLngToCoords=Fe,Ne.latLngsToCoords=Ue,Ne.getFeature=Ve,Ne.asFeature=qe,Ki.mergeOptions({boxZoom:!0});var gn=ie.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){zi(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Si(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ri(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Xt(),xi(),this._startPoint=this._map.mouseEventToContainerPoint(t),zi(document,{contextmenu:Ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=si("div","leaflet-zoom-box",this._container),ci(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new I(this._point,this._startPoint),e=i.getSize();vi(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(ri(this._box),_i(this._container,"leaflet-crosshair")),Jt(),wi(),Si(document,{contextmenu:Ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){var i;1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(p(this._resetState,this),0),i=new R(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})))},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});Ki.addInitHook("addHandler","boxZoom",gn),Ki.mergeOptions({doubleClickZoom:!0});var vn=ie.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});Ki.addInitHook("addHandler","doubleClickZoom",vn),Ki.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yn=ie.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new ae(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),ci(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_i(this._map._container,"leaflet-grab"),_i(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,i=this._map;i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=N(this._map.options.maxBounds),this._offsetLimit=O(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var i,e;this._map.options.inertia&&(i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(e),this._times.push(i),this._prunePositions(i)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1i.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)i.getMaxZoom()&&1 +#include "rtklib.h" + +#include +#include +#include +#include +#include + +#include "plotmain.h" +#include "mapoptdlg.h" + +extern Plot *plot; + +#define INC_LATLON 0.000001 +#define INC_SCALE 0.0001 + +//--------------------------------------------------------------------------- +MapOptDialog::MapOptDialog(QWidget* parent) + : QDialog(parent) +{ + setupUi(this); + connect(BtnSave, SIGNAL(clicked(bool)), this, SLOT(BtnSaveClick())); + connect(BtnClose, SIGNAL(clicked(bool)), this, SLOT(close())); +} +//--------------------------------------------------------------------------- +void MapOptDialog::showEvent(QShowEvent*) +{ + UpdateField(); + UpdateEnable(); +} +//--------------------------------------------------------------------------- +void MapOptDialog::BtnSaveClick() +{ + QString file=plot->MapImageFile; + if (file=="") return; + file=file+".tag"; + + QFile fp(file); + if (!fp.open(QIODevice::WriteOnly | QIODevice::Text)) { + if (QMessageBox::question(this, file, tr("File exists. Overwrite it?")) != QMessageBox::Yes) return; + } + QTextStream out(&fp); + out << QString("%% map image tag file: rtkplot %1 %2\n\n").arg(VER_RTKLIB).arg(PATCH_LEVEL); + out << QString("scalex = %1\n").arg(plot->MapScaleX,0,'g',6); + out << QString("scaley = %1\n").arg(plot->MapScaleEq?plot->MapScaleX:plot->MapScaleY,0,'g',6); + out << QString("scaleeq = %1\n").arg(plot->MapScaleEq); + out << QString("lat = %1\n").arg(plot->MapLat,0,'g',9); + out << QString("lon = %1\n").arg(plot->MapLon,0,'g',9); + +} +//--------------------------------------------------------------------------- +void MapOptDialog::BtnCenterClick() +{ + QString s; + double rr[3],pos[3]; + if (!plot->GetCenterPos(rr)) return; + ecef2pos(rr,pos); + Lat->setValue(pos[0]*R2D); + Lon->setValue(pos[1]*R2D); + UpdateMap(); +} +//--------------------------------------------------------------------------- +void MapOptDialog::BtnUpdateClick() +{ + UpdateMap(); +} +//--------------------------------------------------------------------------- +void MapOptDialog::BtnCloseClick() +{ + close(); +} +//--------------------------------------------------------------------------- +void MapOptDialog::ScaleEqClick() +{ + UpdateMap(); + UpdateEnable(); +} +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- +void MapOptDialog::UpdateField(void) +{ + QString s; + setWindowTitle(plot->MapImageFile); + MapSize1->setValue(plot->MapSize[0]); + MapSize2->setValue(plot->MapSize[1]); + ScaleX->setValue(plot->MapScaleX); + ScaleY->setValue(plot->MapScaleY); + Lat->setValue(plot->MapLat); + Lon->setValue(plot->MapLon); + ScaleEq->setChecked(plot->MapScaleEq); +} +//--------------------------------------------------------------------------- +void MapOptDialog::UpdateMap(void) +{ + plot->MapScaleX=ScaleX->value(); + plot->MapScaleY=ScaleY->value(); + plot->MapLat=Lat->value(); + plot->MapLon=Lon->value(); + plot->MapScaleEq=ScaleEq->isChecked(); + plot->UpdatePlot(); +} +//--------------------------------------------------------------------------- +void MapOptDialog::UpdateEnable(void) +{ + ScaleY ->setEnabled(!ScaleEq->isChecked()); +} +//--------------------------------------------------------------------------- + diff --git a/app/qtapp/rtkplot_qt/mapoptdlg.h b/app/qtapp/rtkplot_qt/mapoptdlg.h new file mode 100644 index 000000000..e00c23d58 --- /dev/null +++ b/app/qtapp/rtkplot_qt/mapoptdlg.h @@ -0,0 +1,39 @@ +//--------------------------------------------------------------------------- +#ifndef mapoptdlgH +#define mapoptdlgH +//--------------------------------------------------------------------------- +#include "ui_mapoptdlg.h" + +#include + +class QKeyEvent; +class QShowEvent; + +//--------------------------------------------------------------------------- +class MapOptDialog : public QDialog, private Ui::MapAreaDialog +{ + Q_OBJECT + +protected: + void showEvent(QShowEvent*); + +public slots: + void BtnCloseClick(); + void BtnUpdateClick(); + void BtnSaveClick(); + + void BtnCenterClick(); + void ScaleEqClick(); + +private: + void UpdateMap(void); + void UpdatePlot(void); + void UpdateEnable(void); + +public: + MapOptDialog(QWidget* parent); + void UpdateField(void); +}; + +//--------------------------------------------------------------------------- +#endif diff --git a/app/qtapp/rtkplot_qt/mapoptdlg.ui b/app/qtapp/rtkplot_qt/mapoptdlg.ui new file mode 100644 index 000000000..3a0cc2601 --- /dev/null +++ b/app/qtapp/rtkplot_qt/mapoptdlg.ui @@ -0,0 +1,331 @@ + + + MapAreaDialog + + + + 0 + 0 + 489 + 197 + + + + Map Image + + + + + + + + + true + + + + 0 + 0 + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + + + Image Size W/H (pixels) + + + + + + + + + + true + + + + 0 + 0 + + + + + + + x + + + + + + + + + + + + + true + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + true + + + + + + Image Center Lon/Lat (°) + + + + + + + true + + + + + + 9 + + + -180.000000000000000 + + + 180.000000000000000 + + + 0.000001000000000 + + + + + + + true + + + + + + 9 + + + -90.000000000000000 + + + 90.000000000000000 + + + 0.000001000000000 + + + + + + + true + + + + + + Scale X/Y (m/pixel) + + + + + + + + + + X=Y + + + false + + + + + + + true + + + + + + 4 + + + 1.000000000000000 + + + 0.000100000000000 + + + + + + + true + + + + + + 4 + + + 8.000000000000000 + + + 0.000100000000000 + + + + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + + + &Save Tag + + + + + + + true + + + + + + &Center + + + + + + + true + + + + + + &Update + + + + + + + true + + + + + + &Close + + + true + + + true + + + + + + + + + + + diff --git a/app/qtapp/rtkplot_qt/mapview.cpp b/app/qtapp/rtkplot_qt/mapview.cpp new file mode 100644 index 000000000..fd77ce8bf --- /dev/null +++ b/app/qtapp/rtkplot_qt/mapview.cpp @@ -0,0 +1,414 @@ +//--------------------------------------------------------------------------- +// gmview.c: map view +//--------------------------------------------------------------------------- +#ifdef QWEBKIT +#include +#include +#include +#endif +#ifdef QWEBENGINE +#include +#include +#include +#include +#endif +#include +#include +#include +#include "mapviewopt.h" +#include "plotmain.h" +#include "mapview.h" +#include "rtklib.h" + + +// instance of Plot -------------------------------------------------------- +extern Plot *plot; + +#define RTKLIB_GM_TEMP ":/html/rtkplot_gm.htm" +#define RTKLIB_GM_FILE "rtkplot_gm_a.htm" +#define RTKLIB_LL_TEMP ":/html/rtkplot_ll.htm" +#define RTKLIB_LL_FILE "rtkplot_ll_a.htm" +#define URL_GM_API "http://maps.google.com/maps/api/js" +#define MAP_OPACITY 0.8 +#define INIT_ZOOM 12 // initial zoom level + +//--------------------------------------------------------------------------- +MapView::MapView(QWidget *parent) + : QDialog(parent) +{ + loaded = false; + setupUi(this); + + MapSel=0; + Lat=Lon=0.0; + for (int i=0;i<2;i++) { + MarkState[0]=MarkState[1]=0; + MarkPos[i][0]=MarkPos[i][1]=0.0; + } + mapViewOptDialog = new MapViewOptDialog(this); + + connect(BtnClose, SIGNAL(clicked(bool)), this, SLOT(BtnCloseClick())); + connect(BtnOpt, SIGNAL(clicked(bool)), this, SLOT(BtnOptClick())); + connect(BtnShrink, SIGNAL(clicked(bool)), this, SLOT(BtnZoomOutClick())); + connect(BtnExpand, SIGNAL(clicked(bool)), this, SLOT(BtnZoomInClick())); + connect(BtnSync, SIGNAL(clicked(bool)), this, SLOT(BtnSyncClick())); + connect(&Timer1, SIGNAL(timeout()), this, SLOT(Timer1Timer())); + connect(&Timer2, SIGNAL(timeout()), this, SLOT(Timer2Timer())); + connect(MapSel1, SIGNAL(clicked(bool)), this, SLOT(MapSel1Click())); + connect(MapSel2, SIGNAL(clicked(bool)), this, SLOT(MapSel2Click())); + +#ifdef QWEBKIT + WebBrowser = new QWebView(Panel2); + QHBoxLayout *layout = new QHBoxLayout(); + layout->addWidget(WebBrowser); + Panel2->setLayout(layout); +#endif +#ifdef QWEBENGINE + WebBrowser = new QWebEngineView(Panel2); + QHBoxLayout *layout = new QHBoxLayout(); + layout->addWidget(WebBrowser); + Panel2->setLayout(layout); + pageState = new MapViewPageState(this); + + connect(WebBrowser, SIGNAL(loadFinished(bool)), this, SLOT(PageLoaded(bool))); +#endif +} +//--------------------------------------------------------------------------- +void MapView::showEvent(QShowEvent*) +{ + MapSel1->setChecked(!MapSel); + MapSel2->setChecked(MapSel); + SelectMap(MapSel); + ShowMap(MapSel); +} +//--------------------------------------------------------------------------- +void MapView::BtnCloseClick() +{ + close(); +} +//--------------------------------------------------------------------------- +void MapView::MapSel1Click() +{ + SelectMap(0); +} +//--------------------------------------------------------------------------- +void MapView::MapSel2Click() +{ + SelectMap(1); +} +//--------------------------------------------------------------------------- +void MapView::BtnOptClick() +{ + mapViewOptDialog->move(x()+width()/2-mapViewOptDialog->width()/2, + y()+height()/2-mapViewOptDialog->height()/2); + + mapViewOptDialog->ApiKey=plot->ApiKey; + for (int i=0;i<6;i++) for (int j=0;j<3;j++) { + mapViewOptDialog->MapStrs[i][j]=plot->MapStrs[i][j]; + } + if (mapViewOptDialog->exec()!=QDialog::Accepted) return; + + plot->ApiKey=mapViewOptDialog->ApiKey; + for (int i=0;i<6;i++) for (int j=0;j<3;j++) { + plot->MapStrs[i][j]=mapViewOptDialog->MapStrs[i][j]; + } + ShowMap(MapSel); +} +//--------------------------------------------------------------------------- +void MapView::PageLoaded(bool ok) +{ + if (!ok) return; + +#ifdef QWEBENGINE + QFile webchannel(":/html/qwebchannel.js"); + webchannel.open(QIODevice::ReadOnly); + WebBrowser->page()->runJavaScript(webchannel.readAll()); + WebBrowser->page()->runJavaScript("new QWebChannel(qt.webChannelTransport,function(channel) {channel.objects.state.text=document.getElementById('state').value;});"); +#endif + loaded = true; +} +//--------------------------------------------------------------------------- +void MapView::BtnZoomOutClick() +{ + ExecFunc(MapSel,"ZoomOut()"); +} +//--------------------------------------------------------------------------- +void MapView::BtnZoomInClick() +{ + ExecFunc(MapSel,"ZoomIn()"); +} +//--------------------------------------------------------------------------- +void MapView::BtnSyncClick() +{ + if (BtnSync->isChecked()) { + SetCent(Lat,Lon); + } +} +//--------------------------------------------------------------------------- +void MapView::resizeEvent(QResizeEvent *) +{ + if (BtnSync->isChecked()) SetCent(Lat, Lon); +} +//--------------------------------------------------------------------------- +void MapView::ShowMap(int map) +{ + if (map==0) { + ShowMapLL(); + } + else if (map==1) { + ShowMapGM(); + } + else { + UpdateMap(); + } +} +//--------------------------------------------------------------------------- +void MapView::ShowMapLL(void) +{ + QString pageSource; + int i, j; + + QFile ifp(RTKLIB_LL_TEMP); + + if (!ifp.open(QIODevice::ReadOnly | QIODevice::Text)) { + return; + } + + QTextStream out(&pageSource); + while (!ifp.atEnd()) { + QString buff = ifp.readLine(); + out<")) out << "\n"; + if (!buff.contains("// start map tiles")) continue; + for (i=0,j=1;i<6;i++) { + if (plot->MapStrs[i][0]=="") continue; + QString title=plot->MapStrs[i][0]; + QString url =plot->MapStrs[i][1]; + QString attr =plot->MapStrs[i][2]; + + out << QString("var tile%1 = L.tileLayer('%2', {\n").arg(j).arg(url); + out << QString(" attribution: \"%2\",\n") + .arg(attr).arg(title); + out << QString(" opacity: %1});\n").arg(MAP_OPACITY,0,'f',1); + j++; + } + out << "var basemaps = {"; + for (i=0,j=1;i<6;i++) { + if (plot->MapStrs[i][0]=="") continue; + QString title=plot->MapStrs[i][0]; + out << QString("%1\"%2\":tile%3").arg((j==1)?"":",").arg(title).arg(j); + j++; + } + out << "};\n"; + } + ifp.close(); + + +#ifdef QWEBKIT + WebBrowser->load(QUrl::fromLocalFile(ofile)); + WebBrowser->show(); + loaded = true; +#endif +#ifdef QWEBENGINE + WebBrowser->setHtml(pageSource); + QWebChannel *channel = new QWebChannel(this); + channel->registerObject(QStringLiteral("state"), pageState); + + WebBrowser->page()->setWebChannel(channel); + + WebBrowser->show(); +#endif + + Timer1.start(); +} +//--------------------------------------------------------------------------- +void MapView::Timer1Timer() +{ + if (!GetState(0)) return; + + SetView(0,Lat,Lon,INIT_ZOOM); + AddMark(0,1,MarkPos[0][0],MarkPos[0][1],MarkState[0]); + AddMark(0,2,MarkPos[1][0],MarkPos[1][1],MarkState[1]); + + Timer1.stop(); +} +void MapView::ShowMapGM(void) +{ + QString pageSource; + int p; + + QFile ifp(RTKLIB_GM_TEMP); + + if (!ifp.open(QIODevice::ReadOnly | QIODevice::Text)) { + return; + } + + QTextStream out(&pageSource); + while (!ifp.atEnd()) { + QString buff = ifp.readLine(); + + if ((!plot->ApiKey.isEmpty())&&(p=buff.indexOf(QLatin1String(URL_GM_API)))!=-1) { + p+=strlen(URL_GM_API); + buff.insert(p, QString("?key=%1").arg(plot->ApiKey)); + } + + out<load(QUrl::fromLocalFile(ofile)); + WebBrowser->show(); + loaded = true; +#endif +#ifdef QWEBENGINE + WebBrowser->setHtml(pageSource); + QWebChannel *channel = new QWebChannel(this); + channel->registerObject(QStringLiteral("state"), pageState); + + WebBrowser->page()->setWebChannel(channel); + + WebBrowser->show(); +#endif + + Timer2.start(); + +} +//--------------------------------------------------------------------------- +void MapView::Timer2Timer() +{ + if (!GetState(1)) return; + + SetView(1,Lat,Lon,INIT_ZOOM); + AddMark(1,1,MarkPos[0][0],MarkPos[0][1],MarkState[0]); + AddMark(1,2,MarkPos[1][0],MarkPos[1][1],MarkState[1]); + Timer2.stop(); +} + +//--------------------------------------------------------------------------- +void MapView::SetView(int map, double lat, double lon, int zoom) +{ + ExecFunc(map, QString("SetView(%1,%2,%3)").arg(lat, 0, 'f', 9).arg(lon, 0, 'f', 9).arg(zoom)); +} + +//--------------------------------------------------------------------------- +void MapView::AddMark(int map, int index, double lat, double lon, + int state) +{ + QString func = QString("AddMark(%1,%2,'SOL%3','SOLUTION %4')").arg(lat, 0, 'f', 9).arg(lon, 0, 'f', 9).arg(index).arg(index); + + ExecFunc(map,func); + if (state) func = QString("ShowMark('SOL%1')").arg(index); + else func = QString("HideMark('SOL%1')").arg(index); + ExecFunc(map,func); +} +//--------------------------------------------------------------------------- +void MapView::UpdateMap(void) +{ + SetCent(Lat,Lon); + for (int i=0;i<2;i++) { + SetMark(i+1,MarkPos[i][0],MarkPos[i][1]); + if (MarkState[i]) ShowMark(i+1); else HideMark(i+1); + } +} +//--------------------------------------------------------------------------- +void MapView::SelectMap(int map) +{ + MapSel=map; + ShowMap(map); +} + +//--------------------------------------------------------------------------- +void MapView::SetCent(double lat, double lon) +{ + QString func=QString("SetCent(%1,%2)").arg(lat, 0, 'f', 9).arg(lon, 0, 'f', 9); + Lat = lat; Lon = lon; + + if (BtnSync->isChecked()) { + ExecFunc(MapSel,func); + } +} +//--------------------------------------------------------------------------- +void MapView::SetMark(int index, double lat, double lon) +{ + QString func = QString("PosMark(%1,%2,'SOL%3')").arg(lat, 0, 'f', 9).arg(lon, 0, 'f', 9).arg(index); + + MarkPos[index-1][0]=lat; + MarkPos[index-1][1]=lon; + + ExecFunc(MapSel,func); + +} +//--------------------------------------------------------------------------- +void MapView::ShowMark(int index) +{ + QString func = QString("ShowMark('SOL%1')").arg(index); + + MarkState[index-1]=1; + ExecFunc(MapSel,func); +} +//--------------------------------------------------------------------------- +void MapView::HideMark(int index) +{ + QString func = QString("HideMark('SOL%1')").arg(index); + + MarkState[index-1]=0; + ExecFunc(MapSel,func); +} +//--------------------------------------------------------------------------- +int MapView::GetState(int map) +{ + Q_UNUSED(map) +#ifdef QWEBKIT + QWebElement ele; + int state = 0; + + if (!WebBrowser->page()) return 0; + if (!WebBrowser->page()->mainFrame()) return 0; + + QWebFrame *frame = WebBrowser->page()->mainFrame(); + + qDebug() << frame; + + ele = frame->findFirstElement("#state"); + + if (ele.isNull()) return 0; + if (!ele.hasAttribute("value")) return 0; + + state = ele.attribute("value").toInt(); + + return state; +#else +#ifdef QWEBENGINE + if (!loaded) return 0; + return pageState->getText().toInt(); +#else + return 0; +#endif +#endif +} +//--------------------------------------------------------------------------- +void MapView::ExecFunc(int map, const QString &func) +{ + Q_UNUSED(map) +#ifdef QWEBKIT + if (!WebBrowser->page()) return; + if (!WebBrowser->page()->mainFrame()) return; + + QWebFrame *frame = WebBrowser->page()->mainFrame(); + + frame->evaluateJavaScript(func); +#else +#ifdef QWEBENGINE + if (!loaded) return; + + QWebEnginePage *page = WebBrowser->page(); + if (page == NULL) return; + + page->runJavaScript(func); +#else + Q_UNUSED(func) +#endif +#endif +} +//--------------------------------------------------------------------------- diff --git a/app/qtapp/rtkplot_qt/mapview.h b/app/qtapp/rtkplot_qt/mapview.h new file mode 100644 index 000000000..6d0064fe0 --- /dev/null +++ b/app/qtapp/rtkplot_qt/mapview.h @@ -0,0 +1,90 @@ +//--------------------------------------------------------------------------- +#ifndef gmviewH +#define gmviewH +//--------------------------------------------------------------------------- +#include +#include + +#include "ui_mapview.h" + +#ifdef QWEBKIT +class QWebView; +#endif +#ifdef QWEBENGINE +class QWebEngineView; +class MapViewPageState : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString text MEMBER text NOTIFY textChanged) +public: + explicit MapViewPageState(QObject *parent = NULL): QObject(parent){} + QString getText() {return text;} +signals: + void textChanged(const QString &text); +private: + QString text; +}; +#endif + +class QResizeEvent; +class QShowEvent; +class MapViewOptDialog; +//--------------------------------------------------------------------------- +class MapView : public QDialog, private Ui::MapView +{ + Q_OBJECT + +public slots: + void BtnCloseClick(); + void Timer1Timer(); + void BtnZoomOutClick(); + void BtnZoomInClick(); + void BtnSyncClick(); + void PageLoaded(bool); + + void BtnOptClick(); + void MapSel1Click(); + void MapSel2Click(); + void Timer2Timer(); + +protected: + void resizeEvent(QResizeEvent*); + void showEvent(QShowEvent*); + +private: +#ifdef QWEBKIT + QWebView *WebBrowser; +#endif +#ifdef QWEBENGINE + QWebEngineView *WebBrowser; + MapViewPageState *pageState; +#endif + int MarkState[2]; + double Lat,Lon; + double MarkPos[2][2]; + QTimer Timer1, Timer2; + bool loaded; + + MapViewOptDialog *mapViewOptDialog; + + void ShowMapLL(void); + void ShowMapGM(void); + void ShowMap(int map); + void SetView(int map, double lat, double lon, int zoom); + void AddMark(int map, int index, double lat, double lon, int state); + void UpdateMap(void); + void SelectMap(int map); + int GetState(int map); + void ExecFunc(int map, const QString &func); + +public: + int MapSel; + + explicit MapView(QWidget *parent = NULL); + void SetCent(double lat, double lon); + void SetMark(int index, double lat, double lon); + void ShowMark(int index); + void HideMark(int index); +}; +//--------------------------------------------------------------------------- +#endif diff --git a/app/qtapp/rtkplot_qt/mapview.ui b/app/qtapp/rtkplot_qt/mapview.ui new file mode 100644 index 000000000..312bd4469 --- /dev/null +++ b/app/qtapp/rtkplot_qt/mapview.ui @@ -0,0 +1,209 @@ + + + MapView + + + + 0 + 0 + 504 + 506 + + + + Google Map View + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + 0 + 0 + + + + + + + Qt::LeftToRight + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + Fix Plot Center + + + + + + + :/buttons/trackc.bmp:/buttons/trackc.bmp + + + true + + + true + + + + + + + true + + + + + + + + + + :/buttons/shrink.bmp:/buttons/shrink.bmp + + + true + + + + + + + true + + + + + + + + + + :/buttons/expand.bmp:/buttons/expand.bmp + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Leaflet + + + + + + + Google Maps + + + + + + + Options... + + + + + + + true + + + + + + Close + + + true + + + true + + + + + + + + + + true + + + + + + Qt::LeftToRight + + + + + + + + + + + + + diff --git a/app/qtapp/rtkplot_qt/mapviewopt.cpp b/app/qtapp/rtkplot_qt/mapviewopt.cpp new file mode 100644 index 000000000..d6063ada0 --- /dev/null +++ b/app/qtapp/rtkplot_qt/mapviewopt.cpp @@ -0,0 +1,65 @@ +//--------------------------------------------------------------------------- + +#include + +#include "viewer.h" +#include "mapviewopt.h" + +//--------------------------------------------------------------------------- +MapViewOptDialog::MapViewOptDialog(QWidget* parent) + : QDialog(parent) +{ + setupUi(this); + + connect(BtnOk, SIGNAL(clicked(bool)), this, SLOT(BtnOkClick())); + connect(BtnCancel, SIGNAL(clicked(bool)), this, SLOT(close())); + connect(BtnNotes, SIGNAL(clicked(bool)), this, SLOT(BtnNotesClick())); +} +//--------------------------------------------------------------------------- +void MapViewOptDialog::showEvent(QShowEvent *) +{ + QLineEdit *titles[]={ + MapTitle1,MapTitle2,MapTitle3,MapTitle4,MapTitle5,MapTitle6 + }; + QLineEdit *tiles[]={ + MapTile1,MapTile2,MapTile3,MapTile4,MapTile5,MapTile6 + }; + for (int i=0;i<6;i++) { + titles[i]->setText(MapStrs[i][0]); + tiles [i]->setText(MapStrs[i][1]); + } + EditApiKey->setText(ApiKey); +} +//--------------------------------------------------------------------------- +void MapViewOptDialog::BtnOkClick() +{ + QLineEdit *titles[]={ + MapTitle1,MapTitle2,MapTitle3,MapTitle4,MapTitle5,MapTitle6 + }; + QLineEdit *tiles[]={ + MapTile1,MapTile2,MapTile3,MapTile4,MapTile5,MapTile6 + }; + for (int i=0;i<6;i++) { + MapStrs[i][0]=titles[i]->text(); + MapStrs[i][1]=tiles [i]->text(); + } + ApiKey=EditApiKey->text(); + accept(); +} +//--------------------------------------------------------------------------- +void MapViewOptDialog::BtnNotesClick() +{ + QString file, dir; + TextViewer *viewer; + + dir = qApp->applicationDirPath(); // exe directory + file=dir+"/gmview_notes.txt"; + viewer=new TextViewer(this); + viewer->setWindowTitle(file); + viewer->Option=0; + viewer->exec(); + viewer->Read(file); +} +//--------------------------------------------------------------------------- + + diff --git a/app/qtapp/rtkplot_qt/mapviewopt.h b/app/qtapp/rtkplot_qt/mapviewopt.h new file mode 100644 index 000000000..4746dd4d8 --- /dev/null +++ b/app/qtapp/rtkplot_qt/mapviewopt.h @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- + +#ifndef mapviewoptH +#define mapviewoptH +//--------------------------------------------------------------------------- +#include "ui_mapviewopt.h" + +#include + +//--------------------------------------------------------------------------- +class MapViewOptDialog : public QDialog, private Ui::MapViewOpt +{ + Q_OBJECT + +protected: + void showEvent(QShowEvent*); + +public slots: + void BtnOkClick(); + void BtnNotesClick(); +public: + QString MapStrs[6][3]; + QString ApiKey; + MapViewOptDialog(QWidget* parent); +}; + +//--------------------------------------------------------------------------- +#endif diff --git a/app/qtapp/rtkplot_qt/mapviewopt.ui b/app/qtapp/rtkplot_qt/mapviewopt.ui new file mode 100644 index 000000000..491cd354f --- /dev/null +++ b/app/qtapp/rtkplot_qt/mapviewopt.ui @@ -0,0 +1,137 @@ + + + MapViewOpt + + + + 0 + 0 + 606 + 396 + + + + Map View Options + + + + + + + + + + + + Title + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Ok + + + + + + + Cancel + + + + + + + + + + Google Maps API Key + + + + + + + + + + Map Tile URL + + + + + + + + + + Leaflet Map Tiles + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + ? + + + true + + + + + + + + diff --git a/app/qtapp/rtkplot_qt/rtkplot_gm.htm b/app/qtapp/rtkplot_qt/rtkplot_gm.htm new file mode 100644 index 000000000..d5e168985 --- /dev/null +++ b/app/qtapp/rtkplot_qt/rtkplot_gm.htm @@ -0,0 +1,117 @@ + + + +RTKLIB_GM + + + + + + +
+ + + diff --git a/app/qtapp/rtkplot_qt/rtkplot_ll.htm b/app/qtapp/rtkplot_qt/rtkplot_ll.htm new file mode 100644 index 000000000..f87b748f2 --- /dev/null +++ b/app/qtapp/rtkplot_qt/rtkplot_ll.htm @@ -0,0 +1,108 @@ + + + +RTKPLOT_MAP + + + + + + + + + +
+ + + diff --git a/app/qtapp/rtkplot_qt/rtkplot_ll_a.htm b/app/qtapp/rtkplot_qt/rtkplot_ll_a.htm new file mode 100644 index 000000000..e69de29bb diff --git a/app/qtapp/strsvr_qt/mondlg.cpp b/app/qtapp/strsvr_qt/mondlg.cpp new file mode 100644 index 000000000..0e2d715d0 --- /dev/null +++ b/app/qtapp/strsvr_qt/mondlg.cpp @@ -0,0 +1,157 @@ +//--------------------------------------------------------------------------- +#include +#include + +#include + +#include "mondlg.h" +//--------------------------------------------------------------------------- + +#define MAXLEN 200 +#define MAXLINE 2048 +#define TOPMARGIN 2 +#define LEFTMARGIN 3 + +//--------------------------------------------------------------------------- +StrMonDialog::StrMonDialog(QWidget *parent) + : QDialog(parent) +{ + setupUi(this); + + connect(BtnClose, SIGNAL(clicked(bool)), this, SLOT(BtnCloseClick())); + connect(BtnClear, SIGNAL(clicked(bool)), this, SLOT(BtnClearClick())); + connect(BtnDown, SIGNAL(clicked(bool)), this, SLOT(BtnDownClick())); + connect(SelFmt, SIGNAL(currentIndexChanged(int)), this, SLOT(SelFmtChange())); + + ConBuff.clear(); + Console->clear(); + Stop = 0; + StrFmt = 0; + for (int i = 0; i <= MAXRCVFMT; i++) { + SelFmt->addItem(formatstrs[i]); + } + rtcm.outtype = raw.outtype = 1; +} +//--------------------------------------------------------------------------- +void StrMonDialog::BtnCloseClick() +{ + accept(); +} +//--------------------------------------------------------------------------- +void StrMonDialog::SelFmtChange() +{ + if ((StrFmt-3 == STRFMT_RTCM2) || (StrFmt-3 == STRFMT_RTCM3)) { + free_rtcm(&rtcm); + } + else if (StrFmt >= 3) { + free_raw(&raw); + } + StrFmt = SelFmt->currentIndex(); + ConBuff.clear(); + + if ((StrFmt - 3 == STRFMT_RTCM2)|| (StrFmt - 3 == STRFMT_RTCM3)) { + init_rtcm(&rtcm); + rtcm.outtype = 1; + } + else if (StrFmt >= 3) { + init_raw(&raw, StrFmt - 3); + raw.outtype = 1; + } + Console->clear(); +} +//--------------------------------------------------------------------------- +void StrMonDialog::AddMsg(unsigned char *msg, int len) +{ + int i; + + if (len <= 0) return; + + else if (StrFmt - 3 == STRFMT_RTCM2) { + for (i = 0; i < len; i++) { + input_rtcm2(&rtcm, msg[i]); + if (rtcm.msgtype[0]) { + QString buff=QString("%1\n").arg(rtcm.msgtype); + AddConsole((unsigned char*)qPrintable(buff), buff.size(), 1); + rtcm.msgtype[0] = '\0'; + } + } + } + else if (StrFmt - 3 == STRFMT_RTCM3) { + for (i = 0; i < len; i++) { + input_rtcm3(&rtcm, msg[i]); + if (rtcm.msgtype[0]) { + QString buff=QString("%1\n").arg(rtcm.msgtype); + AddConsole((unsigned char*)qPrintable(buff), buff.size(), 1); + rtcm.msgtype[0] = '\0'; + } + } + } + else if (StrFmt >= 3) { // raw + for (i = 0; i < len; i++) { + input_raw(&raw,StrFmt - 3, msg[i]); + if (raw.msgtype[0]) { + QString buff=QString("%1\n").arg(raw.msgtype); + AddConsole((unsigned char*)qPrintable(buff), buff.size(), 1); + raw.msgtype[0] = '\0'; + } + } + } + else if (StrFmt>=1) { // HEX/ASC + AddConsole(msg,len,StrFmt-1); + } + else { // Streams + ConBuff.clear(); + AddConsole(msg,len,1); + } +} +//--------------------------------------------------------------------------- +void StrMonDialog::AddConsole(unsigned char *msg, int n, int mode) +{ + char buff[MAXLEN + 16], *p = buff; + + if (BtnStop->isChecked()) return; + + if (n <= 0) return; + + if (ConBuff.count() == 0) ConBuff.append(""); + p += sprintf(p, "%s", qPrintable(ConBuff.at(ConBuff.count() - 1))); + + for (int i = 0; i < n; i++) { + if (mode) { + if (msg[i] == '\r') continue; + p += sprintf(p, "%c", msg[i] == '\n' || isprint(msg[i]) ? msg[i] : '.'); + } else { + p += sprintf(p, "%s%02X", (p - buff) % 17 == 16 ? " " : "", msg[i]); + if (p - buff >= 67) p += sprintf(p, "\n"); + } + if (p - buff >= MAXLEN) p += sprintf(p, "\n"); + + if (*(p - 1) == '\n') { + ConBuff[ConBuff.count() - 1] = buff; + ConBuff.append(""); + *(p = buff) = 0; + if (ConBuff.count() >= MAXLINE) ConBuff.removeFirst(); + } + } + ConBuff[ConBuff.count() - 1] = buff; + + Console->setColumnCount(1); + Console->setRowCount(ConBuff.size()); + for (int i = 0; i < ConBuff.size(); i++) + Console->setItem(i, 0, new QTableWidgetItem(ConBuff.at(i))); + + if (BtnDown->isChecked()) Console->verticalScrollBar()->setValue(Console->verticalScrollBar()->maximum()); +} +//--------------------------------------------------------------------------- +void StrMonDialog::BtnClearClick() +{ + ConBuff.clear(); + Console->clear(); + Console->setRowCount(0); +} +//--------------------------------------------------------------------------- +void StrMonDialog::BtnDownClick() +{ + Console->verticalScrollBar()->setValue(Console->verticalScrollBar()->maximum()); +} +//--------------------------------------------------------------------------- diff --git a/app/qtapp/strsvr_qt/mondlg.h b/app/qtapp/strsvr_qt/mondlg.h new file mode 100644 index 000000000..9641797e6 --- /dev/null +++ b/app/qtapp/strsvr_qt/mondlg.h @@ -0,0 +1,38 @@ +//--------------------------------------------------------------------------- +#ifndef mondlgH +#define mondlgH +//--------------------------------------------------------------------------- +#include +#include + +#include "rtklib.h" + +#include "ui_mondlg.h" + +#define MAX_MSG_BUFF 4096 + +//--------------------------------------------------------------------------- +class StrMonDialog : public QDialog, private Ui::StrMonDialog +{ + Q_OBJECT +public slots: + void BtnCloseClick(); + void BtnClearClick(); + void BtnDownClick(); + void SelFmtChange(); + +private: + QStringList ConBuff; + int Stop; + rtcm_t rtcm; + raw_t raw; + + void AddConsole(unsigned char *msg, int len, int mode); + +public: + int StrFmt; + explicit StrMonDialog(QWidget *parent); + void AddMsg(unsigned char *buff, int n); +}; +//--------------------------------------------------------------------------- +#endif diff --git a/app/qtapp/strsvr_qt/mondlg.ui b/app/qtapp/strsvr_qt/mondlg.ui new file mode 100644 index 000000000..92506be24 --- /dev/null +++ b/app/qtapp/strsvr_qt/mondlg.ui @@ -0,0 +1,197 @@ + + + StrMonDialog + + + + 0 + 0 + 623 + 415 + + + + Input Stream Monitor + + + + + + + + + true + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + + + + Stream + + + + + HEX + + + + + ASCII + + + + + + + + true + + + Clear + + + + + + + :/buttons/del.bmp:/buttons/del.bmp + + + true + + + + + + + true + + + Pause + + + + + + + :/buttons/pause.bmp:/buttons/pause.bmp + + + true + + + true + + + + + + + true + + + Scroll Down + + + + + + + :/buttons/fitd.bmp:/buttons/fitd.bmp + + + true + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + true + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + + + &Close + + + + + + + + + + + + + + + + + + +