You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1136 lines
46 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "SettingsLgsDialog.h"
  2. #include "../../components/object/objectSystemAnchor.h"
  3. DialogSettingsLGS::DialogSettingsLGS(QWidget *parent) :QDialog( parent ){
  4. m_pParent = parent;
  5. m_bRBlocker = false;
  6. m_bSettingsAreChanged = false;
  7. m_bLocationByWGS84 = true;
  8. setWindowModality(Qt::WindowModal);
  9. //resize( 485, 510 );
  10. //setModal( true );
  11. //https://www.youtube.com/watch?v=T15mFICDV-U
  12. setFixedSize( 725, 740 );
  13. setWindowTitle(QApplication::translate("DTSettings", "LRF Device Settings", 0 ));
  14. /* Begin of Device Info Group */
  15. m_pInfoGroupBox = new QGroupBox(this);
  16. m_pInfoGroupBox->setGeometry(QRect(6, 0, 335, 285));
  17. m_pInfoGroupBox->setTitle(QApplication::translate("DTSettings", "LIDAR Info", 0));
  18. /* Begin of Info Frame */
  19. m_pFlagsFrame = new QFrame(m_pInfoGroupBox);
  20. m_pFlagsFrame->setGeometry(QRect(10, 20, 140, 255));
  21. m_pFlagsFrame->setFrameShape(QFrame::Box);
  22. m_pFlagsFrame->setFrameShadow(QFrame::Raised);
  23. m_pFlagsLA = new QVBoxLayout(m_pFlagsFrame);
  24. m_pInfoMaster = new QLabel("Master", m_pFlagsFrame);
  25. m_pInfoMaster->setFrameShape(QFrame::Box);
  26. m_pInfoMaster->setAlignment(Qt::AlignCenter);
  27. m_pInfoMaster->setFixedSize(120, 20);
  28. m_pFlagsLA->addWidget(m_pInfoMaster);
  29. m_pInfoNoBlackTargets = new QLabel("No Black Targets", m_pFlagsFrame);
  30. m_pInfoNoBlackTargets->setFrameShape(QFrame::Box);
  31. m_pInfoNoBlackTargets->setAlignment(Qt::AlignCenter);
  32. m_pInfoNoBlackTargets->setFixedSize(120, 20);
  33. m_pFlagsLA->addWidget(m_pInfoNoBlackTargets);
  34. m_pInfoEUmode = new QLabel("SafeShore Mode", m_pFlagsFrame);
  35. m_pInfoEUmode->setFrameShape(QFrame::Box);
  36. m_pInfoEUmode->setAlignment(Qt::AlignCenter);
  37. m_pInfoEUmode->setFixedSize(120, 20);
  38. m_pFlagsLA->addWidget(m_pInfoEUmode);
  39. m_pInfoTGDmotors = new QLabel("TGD Motors", m_pFlagsFrame);
  40. m_pInfoTGDmotors->setFrameShape(QFrame::Box);
  41. m_pInfoTGDmotors->setAlignment(Qt::AlignCenter);
  42. m_pInfoTGDmotors->setFixedSize(120, 20);
  43. m_pFlagsLA->addWidget(m_pInfoTGDmotors);
  44. m_pInfoDebug = new QLabel("Debug Version", m_pFlagsFrame);
  45. m_pInfoDebug->setFrameShape(QFrame::Box);
  46. m_pInfoDebug->setAlignment(Qt::AlignCenter);
  47. m_pInfoDebug->setFixedSize(120, 20);
  48. m_pFlagsLA->addWidget(m_pInfoDebug);
  49. m_pInfoNoTargetLog = new QLabel("No Targets Log", m_pFlagsFrame);
  50. m_pInfoNoTargetLog->setFrameShape(QFrame::Box);
  51. m_pInfoNoTargetLog->setAlignment(Qt::AlignCenter);
  52. m_pInfoNoTargetLog->setFixedSize(120, 20);
  53. m_pFlagsLA->addWidget(m_pInfoNoTargetLog);
  54. m_pInfoEnaHibernate = new QLabel("Enable Hibernating", m_pFlagsFrame);
  55. m_pInfoEnaHibernate->setFrameShape(QFrame::Box);
  56. m_pInfoEnaHibernate->setAlignment(Qt::AlignCenter);
  57. m_pInfoEnaHibernate->setFixedSize(120, 20);
  58. m_pFlagsLA->addWidget(m_pInfoEnaHibernate);
  59. m_pInfoEnaMotorCtrl = new QLabel("Enable Motor Control", m_pFlagsFrame);
  60. m_pInfoEnaMotorCtrl->setFrameShape(QFrame::Box);
  61. m_pInfoEnaMotorCtrl->setAlignment(Qt::AlignCenter);
  62. m_pInfoEnaMotorCtrl->setFixedSize(120, 20);
  63. m_pFlagsLA->addWidget(m_pInfoEnaMotorCtrl);
  64. m_pInfoTGDVer2 = new QLabel("CAN Bus protocol V2", m_pFlagsFrame);
  65. m_pInfoTGDVer2->setFrameShape(QFrame::Box);
  66. m_pInfoTGDVer2->setAlignment(Qt::AlignCenter);
  67. m_pInfoTGDVer2->setFixedSize(120, 20);
  68. m_pFlagsLA->addWidget(m_pInfoTGDVer2);
  69. m_pInfoThreadFlips = new QLabel("Threadded Flip", m_pFlagsFrame);
  70. m_pInfoThreadFlips->setFrameShape(QFrame::Box);
  71. m_pInfoThreadFlips->setAlignment(Qt::AlignCenter);
  72. m_pInfoThreadFlips->setFixedSize(120, 20);
  73. m_pFlagsLA->addWidget(m_pInfoThreadFlips);
  74. m_pVersionFrame = new QFrame(m_pInfoGroupBox);
  75. m_pVersionFrame->setGeometry(QRect(155, 20, 170, 255));
  76. m_pVersionFrame->setFrameShape(QFrame::Box);
  77. m_pVersionFrame->setFrameShadow(QFrame::Raised);
  78. m_pVersionLA = new QVBoxLayout(m_pVersionFrame);
  79. m_pBuildDate = new QLabel("-- Device is --", m_pVersionFrame);
  80. m_pBuildDate->setFrameShape(QFrame::Box);
  81. m_pBuildDate->setAlignment(Qt::AlignCenter);
  82. m_pBuildDate->setFixedSize(148, 20);
  83. m_pVersionLA->addWidget( m_pBuildDate );
  84. m_pBuildCode = new QLabel("-- Not Connected --", m_pVersionFrame);
  85. m_pBuildCode->setFrameShape(QFrame::Box);
  86. m_pBuildCode->setAlignment(Qt::AlignCenter);
  87. m_pBuildCode->setFixedSize(148, 20);
  88. m_pVersionLA->addWidget( m_pBuildCode );
  89. m_pPRU1LA = new QHBoxLayout(m_pVersionFrame);
  90. m_pPRU0Code = new QLabel("-UNKNOWN-", m_pVersionFrame);
  91. m_pPRU0Code->setFrameShape(QFrame::Box);
  92. m_pPRU0Code->setAlignment(Qt::AlignCenter);
  93. m_pPRU0Code->setFixedSize(70, 60);
  94. m_pPRU1LA->addWidget( m_pPRU0Code );
  95. m_pPRU1LA->addItem( new QSpacerItem(5,5,QSizePolicy::Expanding, QSizePolicy::Minimum ));
  96. m_pPRU2Code = new QLabel("-UNKNOWN-", m_pVersionFrame);
  97. m_pPRU2Code->setFrameShape(QFrame::Box);
  98. m_pPRU2Code->setAlignment(Qt::AlignCenter);
  99. m_pPRU2Code->setFixedSize(70, 60);
  100. m_pPRU1LA->addWidget( m_pPRU2Code );
  101. m_pPRU2LA = new QHBoxLayout(m_pVersionFrame);
  102. m_pPRU1Code = new QLabel("-UNKNOWN-", m_pVersionFrame);
  103. m_pPRU1Code->setFrameShape(QFrame::Box);
  104. m_pPRU1Code->setAlignment(Qt::AlignCenter);
  105. m_pPRU1Code->setFixedSize(70, 60);
  106. m_pPRU2LA->addWidget( m_pPRU1Code );
  107. m_pPRU2LA->addItem( new QSpacerItem(5,5,QSizePolicy::Expanding, QSizePolicy::Minimum ));
  108. m_pPRU3Code = new QLabel("-UNKNOWN-", m_pVersionFrame);
  109. m_pPRU3Code->setFrameShape(QFrame::Box);
  110. m_pPRU3Code->setAlignment(Qt::AlignCenter);
  111. m_pPRU3Code->setFixedSize(70, 60);
  112. m_pPRU2LA->addWidget( m_pPRU3Code );
  113. m_pVersionLA->addItem( m_pPRU1LA );
  114. m_pVersionLA->addItem( m_pPRU2LA );
  115. /* Begin of Detection Settings Group */
  116. m_pDetectionGroupBox = new QGroupBox( this );
  117. m_pDetectionGroupBox->setGeometry(QRect(339, 0, 180, 285));
  118. m_pDetectionGroupBox->setTitle(QApplication::translate("DTSettings", "Detection Settings", 0));
  119. m_pDetectFrame = new QFrame(m_pDetectionGroupBox);
  120. m_pDetectFrame->setGeometry(QRect(10, 20, 160, 255));
  121. m_pDetectFrame->setFrameShape(QFrame::Box);
  122. m_pDetectFrame->setFrameShadow(QFrame::Raised);
  123. m_pFlipLabel = new QLabel(m_pDetectFrame);
  124. m_pFlipLabel->setGeometry(QRect(10, 15, 60, 13));
  125. m_pFlipLabel->setText(QApplication::translate("DTSettings", "Flip Size", 0 ));
  126. m_pFlipSpinBox = new QSpinBox(m_pDetectFrame);
  127. m_pFlipSpinBox->setGeometry(QRect(80, 10, 70, 22));
  128. m_pFlipSpinBox->setMinimum(8);
  129. m_pFlipSpinBox->setMaximum(1024);
  130. m_pFlipSpinBox->setProperty("displayIntegerBase", QVariant(10));
  131. m_pSSTLabel = new QLabel(m_pDetectFrame);
  132. m_pSSTLabel->setGeometry(QRect(10, 40, 60, 13));
  133. m_pSSTLabel->setText(QApplication::translate("DTSettings", "SST Value", 0 ));
  134. m_pSSTSpinBox = new QSpinBox(m_pDetectFrame);
  135. m_pSSTSpinBox->setGeometry(QRect(80, 35, 70, 22));
  136. m_pSSTSpinBox->setMinimum(0);
  137. m_pSSTSpinBox->setMaximum(3);
  138. m_pSSTSpinBox->setProperty("displayIntegerBase", QVariant(10));
  139. m_pOrderLabel = new QLabel(m_pDetectFrame);
  140. m_pOrderLabel->setGeometry(QRect(10, 65, 60, 13));
  141. m_pOrderLabel->setText(QApplication::translate("DTSettings", "Order Value", 0 ));
  142. m_pOrderSpinBox = new QSpinBox(m_pDetectFrame);
  143. m_pOrderSpinBox->setGeometry(QRect(80, 60, 70, 22));
  144. m_pOrderSpinBox->setMinimum(1);
  145. m_pOrderSpinBox->setMaximum(7);
  146. m_pOrderSpinBox->setProperty("displayIntegerBase", QVariant(10));
  147. m_pOffsetLabel = new QLabel(m_pDetectFrame);
  148. m_pOffsetLabel->setGeometry(QRect(10, 90, 60, 13));
  149. m_pOffsetLabel->setText(QApplication::translate("DTSettings", "Offset Value", 0 ));
  150. m_pOffsetSpinBox = new QSpinBox(m_pDetectFrame);
  151. m_pOffsetSpinBox->setGeometry(QRect(80, 85, 70, 22));
  152. m_pOffsetSpinBox->setMinimum(10);
  153. m_pOffsetSpinBox->setMaximum(64);
  154. m_pOffsetSpinBox->setProperty("displayIntegerBase", QVariant(10));
  155. m_pWidthLabel = new QLabel(m_pDetectFrame);
  156. m_pWidthLabel->setGeometry(QRect(10, 115, 60, 13));
  157. m_pWidthLabel->setText(QApplication::translate("DTSettings", "Width Value", 0));
  158. m_pWidthSpinBox = new QSpinBox(m_pDetectFrame);
  159. m_pWidthSpinBox->setGeometry(QRect(80, 110, 70, 22));
  160. m_pWidthSpinBox->setMinimum(100);
  161. m_pWidthSpinBox->setMaximum(12000);
  162. m_pWidthSpinBox->setSingleStep(100);
  163. m_pWidthSpinBox->setProperty("displayIntegerBase", QVariant(10));
  164. m_pGoodPointsLabel = new QLabel(m_pDetectFrame);
  165. m_pGoodPointsLabel->setGeometry(QRect(10, 140, 60, 13));
  166. m_pGoodPointsLabel->setText(QApplication::translate("DTSettings", "Good Points", 0));
  167. m_pGoodPointsSpinBox = new QSpinBox(m_pDetectFrame);
  168. m_pGoodPointsSpinBox->setGeometry(QRect(80, 135, 70, 22));
  169. m_pGoodPointsSpinBox->setMinimum(4);
  170. m_pGoodPointsSpinBox->setMaximum(24);
  171. //m_pMGoodPointsSpinBox->setSingleStep(1);
  172. m_pGoodPointsSpinBox->setProperty("displayIntegerBase", QVariant(10));
  173. m_pSunBitFiltering = new QCheckBox("Sun Bit Filtering", m_pDetectFrame );
  174. m_pSunBitFiltering->setGeometry(QRect(10, 155, 140, 32));
  175. m_pButtonCmdApplyDetectionSettings = new QPushButton(m_pDetectFrame);
  176. m_pButtonCmdApplyDetectionSettings->setGeometry(QRect(10, 185, 140, 32));
  177. m_pButtonCmdApplyDetectionSettings->setText(QApplication::translate("DTSettings", "Apply Settings", 0));
  178. m_pButtonCmdApplyDetectionSettings->setIcon( QIcon(":pictures/appbar.repeat.png"));
  179. m_pButtonCmdApplyDetectionSettings->setIconSize(QSize(32,32));
  180. m_pButtonCmdApplyDetectionSettings->setStyleSheet(QStringLiteral("Text-align:left"));
  181. m_pButtonCmdFullReset = new QPushButton(m_pDetectFrame);
  182. m_pButtonCmdFullReset->setGeometry(QRect(10, 220, 140, 32));
  183. m_pButtonCmdFullReset->setText(QApplication::translate("DTSettings", "Full Reset", 0));
  184. m_pButtonCmdFullReset->setIcon( QIcon(":pictures/appbar.reset.png"));
  185. m_pButtonCmdFullReset->setIconSize(QSize(32,32));
  186. m_pButtonCmdFullReset->setStyleSheet("Text-align:left");
  187. connect( m_pButtonCmdFullReset, &QPushButton::clicked, this, &DialogSettingsLGS::onFullReset );
  188. /* End of Master detection settings Frame */
  189. /* Begin of Master hardware settings Frame */
  190. m_pHardwareGroupBox = new QGroupBox(this);
  191. m_pHardwareGroupBox->setGeometry(QRect(517, 0, 198, 680 ));
  192. m_pHardwareGroupBox->setTitle(QApplication::translate("DTSettings", "Hardware Control", 0));
  193. QVBoxLayout *tVLayout;
  194. tVLayout = new QVBoxLayout(m_pHardwareGroupBox);
  195. tVLayout->setContentsMargins(5,0,5,0);
  196. tVLayout->setSpacing(3);
  197. m_pHWGeneralFrame = new QFrame(m_pHardwareGroupBox);
  198. m_pHWGeneralFrame->setFixedSize( 185, 90 );
  199. //m_pHWGeneralFrame->setGeometry(QRect(10, 20, 185, 90 ));
  200. m_pHWGeneralFrame->setFrameShape(QFrame::Box);
  201. m_pHWGeneralFrame->setFrameShadow(QFrame::Raised);
  202. tVLayout->addWidget( m_pHWGeneralFrame );
  203. m_pLrfEnableToggle = new QToolButton(m_pHWGeneralFrame);
  204. m_pLrfEnableToggle->setGeometry(QRect(10, 10, 165, 32 ));
  205. QIcon icon1;
  206. icon1.addFile( QStringLiteral(":pictures/appbar.new.png"), QSize(), QIcon::Normal, QIcon::Off);
  207. icon1.addFile( QStringLiteral(":pictures/appbar.laser.png"), QSize(), QIcon::Normal, QIcon::On);
  208. m_pLrfEnableToggle->setIcon(icon1);
  209. m_pLrfEnableToggle->setText(QApplication::translate("DTSettings", "Laser Beam", 0));
  210. m_pLrfEnableToggle->setIconSize(QSize(32, 32));
  211. m_pLrfEnableToggle->setCheckable(true);
  212. m_pLrfEnableToggle->setChecked(false);
  213. m_pLrfEnableToggle->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
  214. m_pLrfEnableToggle->setStyleSheet("Text-align:left");
  215. connect(m_pLrfEnableToggle, &QToolButton::clicked, this, &DialogSettingsLGS::onEnableBeam);
  216. m_pMotorsEnableToggle = new QToolButton(m_pHWGeneralFrame);
  217. m_pMotorsEnableToggle->setGeometry(QRect(10, 50, 165, 32 ));
  218. QIcon icon2;
  219. icon2.addFile( QStringLiteral(":pictures/appbar.base.select.png"), QSize(), QIcon::Normal, QIcon::Off);
  220. icon2.addFile( QStringLiteral(":pictures/appbar.base.png"), QSize(), QIcon::Normal, QIcon::On);
  221. m_pMotorsEnableToggle->setIcon(icon2);
  222. m_pMotorsEnableToggle->setText(QApplication::translate("DTSettings", "Base/Mirror Run", 0));
  223. m_pMotorsEnableToggle->setIconSize(QSize(32, 32));
  224. m_pMotorsEnableToggle->setCheckable(true);
  225. m_pMotorsEnableToggle->setChecked(false);
  226. m_pMotorsEnableToggle->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
  227. m_pMotorsEnableToggle->setStyleSheet("Text-align:left");
  228. connect(m_pMotorsEnableToggle, &QToolButton::clicked, this, &DialogSettingsLGS::onEnableMotors);
  229. m_pHWShiftFrame = new QFrame(m_pHardwareGroupBox);
  230. m_pHWShiftFrame->setFixedSize( 185, 55 );
  231. m_pHWShiftFrame->setFrameShape(QFrame::Box);
  232. m_pHWShiftFrame->setFrameShadow(QFrame::Raised);
  233. tVLayout->addWidget( m_pHWShiftFrame );
  234. m_pQ_ShiftLabel = new QLabel("Mirror Shift:", m_pHWShiftFrame);
  235. m_pQ_ShiftLabel->setGeometry(QRect(20, 5, 60, 22));
  236. m_pQ_ShiftSpinBox = new QSpinBox(m_pHWShiftFrame);
  237. m_pQ_ShiftSpinBox->setGeometry(QRect(100, 5, 60, 22));
  238. m_pQ_ShiftSpinBox->setMinimum(0);
  239. m_pQ_ShiftSpinBox->setMaximum(287);
  240. m_pQ_ShiftSpinBox->setSingleStep(1);
  241. connect(m_pQ_ShiftSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &DialogSettingsLGS::onUpdateQMotorSpinBox);
  242. m_pB_ShiftLabel = new QLabel("Base Shift:", m_pHWShiftFrame);
  243. m_pB_ShiftLabel->setGeometry(QRect(20, 30, 60, 22));
  244. m_pB_ShiftSpinBox = new QSpinBox(m_pHWShiftFrame);
  245. m_pB_ShiftSpinBox->setGeometry(QRect(100, 30, 60, 22));
  246. m_pB_ShiftSpinBox->setMinimum(0);
  247. m_pB_ShiftSpinBox->setMaximum(2303);
  248. m_pB_ShiftSpinBox->setSingleStep(1);
  249. connect(m_pB_ShiftSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &DialogSettingsLGS::onUpdateQMotorSpinBox);
  250. m_pHWMotorFrame = new QFrame(m_pHardwareGroupBox);
  251. m_pHWMotorFrame->setFixedSize( 185, 70 );
  252. //m_pHWMotorFrame->setGeometry(QRect(10, 114, 185, 80 ));
  253. m_pHWMotorFrame->setFrameShape(QFrame::Box);
  254. m_pHWMotorFrame->setFrameShadow(QFrame::Raised);
  255. tVLayout->addWidget( m_pHWMotorFrame );
  256. m_pNoMotorCtrl = new QRadioButton(m_pHWMotorFrame);
  257. m_pNoMotorCtrl->setGeometry(QRect(10, 5, 165, 18 ));
  258. m_pNoMotorCtrl->setIcon(QIcon(":pictures/appbar.cog.png"));
  259. m_pNoMotorCtrl->setText(QApplication::translate("DTSettings", "No Motor Controll", 0));
  260. m_pPwmMotorCtrl = new QRadioButton(m_pHWMotorFrame);
  261. m_pPwmMotorCtrl->setGeometry(QRect(10, 25, 165, 18 ));
  262. m_pPwmMotorCtrl->setIcon(QIcon(":pictures/appbar.cog.png"));
  263. m_pPwmMotorCtrl->setText(QApplication::translate("DTSettings", "PWM Motor Controll", 0));
  264. m_pTgzMotorCtrl = new QRadioButton(m_pHWMotorFrame);
  265. m_pTgzMotorCtrl->setGeometry(QRect(10, 45, 165, 18 ));
  266. m_pTgzMotorCtrl->setIcon(QIcon(":pictures/appbar.cog.png"));
  267. m_pTgzMotorCtrl->setText(QApplication::translate("DTSettings", "TGZ Motor Controll", 0));
  268. connect(m_pNoMotorCtrl, &QRadioButton::clicked, this, &DialogSettingsLGS::onRadioNoMotors);
  269. connect(m_pPwmMotorCtrl, &QRadioButton::clicked, this, &DialogSettingsLGS::onRadioPwmMotors);
  270. connect(m_pTgzMotorCtrl, &QRadioButton::clicked, this, &DialogSettingsLGS::onRadioTgzMotors);
  271. m_pHWPwmFrame = new QFrame(m_pHardwareGroupBox);
  272. m_pHWPwmFrame->setFixedSize( 185, 110 );
  273. //m_pHWPwmFrame->setGeometry(QRect(10, 200, 185, 110));
  274. m_pHWPwmFrame->setFrameShape(QFrame::Box);
  275. m_pHWPwmFrame->setFrameShadow(QFrame::Raised);
  276. tVLayout->addWidget( m_pHWPwmFrame );
  277. QLabel *tLab1 = new QLabel("Mirror Block Encoder Frequency", m_pHWPwmFrame);
  278. tLab1->setGeometry(QRect(20, 5, 160, 15));
  279. m_pQMotorFreqLabel = new QLabel("Hertz:", m_pHWPwmFrame);
  280. m_pQMotorFreqLabel->setGeometry(QRect(20, 25, 30, 22));
  281. m_pQMotorFreqSpinBox = new QSpinBox(m_pHWPwmFrame);
  282. m_pQMotorFreqSpinBox->setGeometry(QRect(55, 25, 100, 22));
  283. m_pQMotorFreqSpinBox->setMinimum(3000);
  284. m_pQMotorFreqSpinBox->setMaximum(80000);
  285. m_pQMotorFreqSpinBox->setSingleStep(100);
  286. connect( m_pQMotorFreqSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged) , this, &DialogSettingsLGS::onUpdateQMotorSpinBox );
  287. QLabel *tLab2 = new QLabel("Base Block Encoder Frequency", m_pHWPwmFrame);
  288. tLab2->setGeometry(QRect(20, 53, 160, 15));
  289. m_pBMotorFreqLabel = new QLabel("Hertz:", m_pHWPwmFrame);
  290. m_pBMotorFreqLabel->setGeometry(QRect(20, 75, 30, 22));
  291. m_pBMotorFreqSpinBox = new QSpinBox(m_pHWPwmFrame);
  292. m_pBMotorFreqSpinBox->setGeometry(QRect(55, 75, 100, 22));
  293. m_pBMotorFreqSpinBox->setMinimum(1000);
  294. m_pBMotorFreqSpinBox->setMaximum(200000);
  295. m_pBMotorFreqSpinBox->setSingleStep(100);
  296. connect(m_pBMotorFreqSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &DialogSettingsLGS::onUpdateBMotorSpinBox);
  297. m_pHWTgzFrame = new QFrame(m_pHardwareGroupBox);
  298. m_pHWTgzFrame->setFixedSize( 185, 200 );
  299. //m_pHWTgzFrame->setGeometry(QRect(10, 315, 185, 139));
  300. m_pHWTgzFrame->setFrameShape(QFrame::Box);
  301. m_pHWTgzFrame->setFrameShadow(QFrame::Raised);
  302. tVLayout->addWidget( m_pHWTgzFrame );
  303. QLabel *tLab3 = new QLabel("CAN Bus Communication Settings", m_pHWTgzFrame);
  304. tLab3->setGeometry(QRect(15, 5, 160, 15));
  305. m_pTGZ_CanBusID = new QLabel("CAN Bus ID:", m_pHWTgzFrame);
  306. m_pTGZ_CanBusID->setGeometry(QRect(20, 25, 80, 15));
  307. m_pTGZ_CanBusIDSpinBox = new QSpinBox(m_pHWTgzFrame);
  308. m_pTGZ_CanBusIDSpinBox->setGeometry(QRect(90, 25, 60, 22));
  309. m_pTGZ_CanBusIDSpinBox->setMinimum(0);
  310. m_pTGZ_CanBusIDSpinBox->setMaximum(255);
  311. m_pTGZ_CanBusIDSpinBox->setSingleStep(1);
  312. m_pTGZ_CanHHID = new QLabel("CAN Host ID:", m_pHWTgzFrame);
  313. m_pTGZ_CanHHID->setGeometry(QRect(20, 45, 80, 15));
  314. m_pTGZ_CanHHIDSpinBox = new QSpinBox(m_pHWTgzFrame);
  315. m_pTGZ_CanHHIDSpinBox->setGeometry(QRect(90, 50, 60, 22));
  316. m_pTGZ_CanHHIDSpinBox->setMinimum(0);
  317. m_pTGZ_CanHHIDSpinBox->setMaximum(65535);
  318. m_pTGZ_CanHHIDSpinBox->setSingleStep(1);
  319. m_pTGZ_CanDDID = new QLabel("CAN TGZ ID:", m_pHWTgzFrame);
  320. m_pTGZ_CanDDID->setGeometry(QRect(20, 65, 80, 15));
  321. m_pTGZ_CanDDIDSpinBox = new QSpinBox(m_pHWTgzFrame);
  322. m_pTGZ_CanDDIDSpinBox->setGeometry(QRect(90, 75, 60, 22));
  323. m_pTGZ_CanDDIDSpinBox->setMinimum(0);
  324. m_pTGZ_CanDDIDSpinBox->setMaximum(65535);
  325. m_pTGZ_CanDDIDSpinBox->setSingleStep(1);
  326. QLabel *tLab4 = new QLabel("TGZ Controller Settings", m_pHWTgzFrame);
  327. tLab4->setGeometry(QRect(35, 100, 160, 15));
  328. m_pTGZ_ParamA = new QLabel("TGZ Param A:", m_pHWTgzFrame);
  329. m_pTGZ_ParamA->setGeometry(QRect(20, 120, 80, 15));
  330. m_pTGZ_ParamASpinBox= new QSpinBox(m_pHWTgzFrame);
  331. m_pTGZ_ParamASpinBox->setGeometry(QRect(90, 120, 60, 22));
  332. m_pTGZ_ParamASpinBox->setMinimum(0);
  333. m_pTGZ_ParamASpinBox->setMaximum(65535);
  334. m_pTGZ_ParamASpinBox->setSingleStep(1);
  335. m_pTGZ_ParamB = new QLabel("TGZ Param B:", m_pHWTgzFrame);
  336. m_pTGZ_ParamB->setGeometry(QRect(20, 145, 80, 15));
  337. m_pTGZ_ParamBSpinBox= new QSpinBox(m_pHWTgzFrame);
  338. m_pTGZ_ParamBSpinBox->setGeometry(QRect(90, 145, 60, 22));
  339. m_pTGZ_ParamBSpinBox->setMinimum(0);
  340. m_pTGZ_ParamBSpinBox->setMaximum(65535);
  341. m_pTGZ_ParamBSpinBox->setSingleStep(1);
  342. m_pTGZ_ParamC = new QLabel("TGZ Param C:", m_pHWTgzFrame);
  343. m_pTGZ_ParamC->setGeometry(QRect(20, 170, 80, 15));
  344. m_pTGZ_ParamCSpinBox= new QSpinBox(m_pHWTgzFrame);
  345. m_pTGZ_ParamCSpinBox->setGeometry(QRect(90, 170, 60, 22));
  346. m_pTGZ_ParamCSpinBox->setMinimum(0);
  347. m_pTGZ_ParamCSpinBox->setMaximum(65535);
  348. m_pTGZ_ParamCSpinBox->setSingleStep(1);
  349. m_pHWSeashoreFrame = new QFrame(m_pHardwareGroupBox);
  350. m_pHWSeashoreFrame->setFixedSize( 185, 55 );
  351. //m_pHWSeashoreFrame->setGeometry(QRect(10, 490, 185, 139));
  352. m_pHWSeashoreFrame->setFrameShape(QFrame::Box);
  353. m_pHWSeashoreFrame->setFrameShadow(QFrame::Raised);
  354. tVLayout->addWidget( m_pHWSeashoreFrame );
  355. m_pSeashoreCheckBox = new QCheckBox("SafeShore Server Enabled", m_pHWSeashoreFrame );
  356. m_pSeashoreCheckBox->setGeometry(20, 5, 150, 22);
  357. m_pSeashoreIP4Address = new QLineEdit( m_pHWSeashoreFrame );
  358. m_pSeashoreIP4Address->setGeometry(20, 25, 100, 22);
  359. m_pSeashoreIP4Port = new QLineEdit( m_pHWSeashoreFrame );
  360. m_pSeashoreIP4Port->setGeometry(123, 25, 40, 22);
  361. m_pButtonCmdApplyMotorSettings = new QPushButton( m_pHardwareGroupBox );
  362. m_pButtonCmdApplyMotorSettings->setFixedSize(185, 32 );
  363. //m_pButtonCmdApplyMotorSettings->setGeometry(QRect(10, 410, 165, 32));
  364. m_pButtonCmdApplyMotorSettings->setIcon(QIcon(":pictures/appbar.transit.hazard.png"));
  365. m_pButtonCmdApplyMotorSettings->setIconSize(QSize(32, 32));
  366. m_pButtonCmdApplyMotorSettings->setText(QApplication::translate("DTSettings", "Apply Settings", 0));
  367. connect( m_pButtonCmdApplyMotorSettings, &QPushButton::clicked, this, &DialogSettingsLGS::onUpdateDevice );
  368. tVLayout->addWidget( m_pButtonCmdApplyMotorSettings );
  369. // End of Master Settings Group
  370. m_pConPosGroupBox = new QGroupBox( this );
  371. m_pConPosGroupBox->setGeometry(QRect(6, 285, 512, 450));
  372. m_pConPosGroupBox->setTitle(QApplication::translate("DTSettings", "Sensor Position/Connection", 0));
  373. // Map Controll
  374. m_pMapControl = new MapControl( QSize(490, 300), MapControl::Panning, true, true, m_pConPosGroupBox );
  375. m_pMapAdapter = new OSMMapAdapter();
  376. m_pMapLayer = new MapLayer("Custom Layer", m_pMapAdapter);
  377. m_pMapControl->addLayer( m_pMapLayer );
  378. m_pMapControl->setView(QPointF(35.095117, 32.904578));
  379. m_pMapControl->setZoom(22);
  380. m_pMapControl->setGeometry(10, 20, 490, 300);
  381. //m_pMapControl->enablePersistentCache(QDir());
  382. connect( m_pMapControl, &MapControl::viewChanged, this, &DialogSettingsLGS::onMapChanged );
  383. // POSITION GROUP
  384. m_pPositionGroupBox = new QGroupBox(m_pConPosGroupBox);
  385. m_pPositionGroupBox->setGeometry(QRect(8, 320, 300, 124));
  386. m_pPositionGroupBox->setTitle(QApplication::translate("DTSettings", "Position", 0));
  387. m_pPosByWGS84 = new QRadioButton("Absolute by WGS84", m_pPositionGroupBox );
  388. m_pPosByWGS84->setGeometry(QRect(10, 20, 115, 13));
  389. m_pPosByWGS84->setChecked( true );
  390. m_pPosByMeters = new QRadioButton("Delta from Main Anchor", m_pPositionGroupBox );
  391. m_pPosByMeters->setGeometry(QRect(130, 20, 130, 13));
  392. connect(m_pPosByWGS84, &QRadioButton::clicked, this, &DialogSettingsLGS::onPositionWGS84);
  393. connect(m_pPosByMeters, &QRadioButton::clicked, this, &DialogSettingsLGS::onPositionMeters);
  394. m_pLonLabel = new QLabel(m_pPositionGroupBox);
  395. m_pLonLabel->setGeometry(QRect(10, 45, 25, 13));
  396. m_pLonLabel->setText(QApplication::translate("DTSettings", "Lon:", 0));
  397. m_pLongitude = new QDoubleSpinBox(m_pPositionGroupBox);
  398. m_pLongitude->setGeometry(QRect(35, 40, 75, 22));
  399. m_pLongitude->setDecimals(6);
  400. m_pLongitude->setMinimum(-99.0);
  401. m_pLongitude->setMaximum(99.0);
  402. m_pLongitude->setSingleStep(1e-05);
  403. m_pLongitude->setValue(35.095117);
  404. connect(m_pLongitude, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, &DialogSettingsLGS::onPositionLonChange);
  405. m_pLatLabel = new QLabel(m_pPositionGroupBox);
  406. m_pLatLabel->setGeometry(QRect(115, 45, 25, 13));
  407. m_pLatLabel->setText(QApplication::translate("DTSettings", "Lat:", 0));
  408. m_pLatitude = new QDoubleSpinBox(m_pPositionGroupBox);
  409. m_pLatitude->setGeometry(QRect(138, 40, 75, 22));
  410. m_pLatitude->setDecimals(6);
  411. m_pLatitude->setMinimum(-99);
  412. m_pLatitude->setSingleStep(1e-05);
  413. m_pLatitude->setValue(32.904578);
  414. connect(m_pLatitude, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, &DialogSettingsLGS::onPositionLatChange);
  415. m_pAltLabel = new QLabel(m_pPositionGroupBox);
  416. m_pAltLabel->setGeometry(QRect(220, 45, 25, 13));
  417. m_pAltLabel->setText(QApplication::translate("DTSettings", "Alt:", 0));
  418. m_pAltitude = new QDoubleSpinBox(m_pPositionGroupBox);
  419. m_pAltitude->setGeometry(QRect(240, 40, 50, 22));
  420. m_pAltitude->setDecimals(2);
  421. m_pAltitude->setMinimum(-99);
  422. m_pAltitude->setSingleStep(0.01);
  423. m_pAltitude->setValue(18.0);
  424. connect(m_pAltitude, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, &DialogSettingsLGS::onPositionAltChange);
  425. /* Orientation */
  426. m_pYawLabel = new QLabel(m_pPositionGroupBox);
  427. m_pYawLabel->setGeometry(QRect(10, 70, 25, 13));
  428. m_pYawLabel->setText(QApplication::translate("DTSettings", "Yaw:", 0));
  429. m_pYaw = new QDoubleSpinBox(m_pPositionGroupBox);
  430. m_pYaw->setGeometry(QRect(35, 65, 60, 22));
  431. m_pYaw->setDecimals(3);
  432. m_pYaw->setMinimum(-99);
  433. m_pYaw->setSingleStep(1e-03);
  434. m_pYaw->setValue(0.0);
  435. connect(m_pYaw, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, &DialogSettingsLGS::onOrientationYawChange);
  436. m_pRollLabel = new QLabel(m_pPositionGroupBox);
  437. m_pRollLabel->setGeometry(QRect(115, 70, 25, 13));
  438. m_pRollLabel->setText(QApplication::translate("DTSettings", "Roll:", 0));
  439. m_pRoll = new QDoubleSpinBox(m_pPositionGroupBox);
  440. m_pRoll->setGeometry(QRect(138, 65, 60, 22));
  441. m_pRoll->setDecimals(3);
  442. m_pRoll->setMinimum(-99);
  443. m_pRoll->setSingleStep(1e-03);
  444. m_pRoll->setValue(0.0);
  445. connect(m_pRoll, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, &DialogSettingsLGS::onOrientationRollChange);
  446. m_pPitchLabel = new QLabel(m_pPositionGroupBox);
  447. m_pPitchLabel->setGeometry(QRect(220, 70, 25, 13));
  448. m_pPitchLabel->setText(QApplication::translate("DTSettings", "Pitch:", 0));
  449. m_pPitch = new QDoubleSpinBox(m_pPositionGroupBox);
  450. m_pPitch->setGeometry(QRect(240, 65, 50, 22));
  451. m_pPitch->setDecimals(3);
  452. m_pPitch->setMinimum(-99);
  453. m_pPitch->setSingleStep(1e-03);
  454. m_pPitch->setValue(0.0);
  455. connect(m_pPitch, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, &DialogSettingsLGS::onOrientationPitchChange);
  456. m_pButtonCmdSetToMainAnchore = new QPushButton(m_pPositionGroupBox);
  457. m_pButtonCmdSetToMainAnchore->setGeometry(QRect(10, 90, 32, 32));
  458. m_pButtonCmdSetToMainAnchore->setIcon(QIcon(":pictures/appbar.centerline.png"));
  459. m_pButtonCmdSetToMainAnchore->setIconSize(QSize(32, 32));
  460. //m_pButtonCmdSetToMainAnchore->setText("");
  461. connect(m_pButtonCmdSetToMainAnchore, &QPushButton::clicked, this, &DialogSettingsLGS::setPositionSystemAnchor);
  462. m_pButtonCmdSetPosition = new QPushButton(m_pPositionGroupBox);
  463. m_pButtonCmdSetPosition->setGeometry(QRect(50, 90, 100, 32));
  464. m_pButtonCmdSetPosition->setIcon(QIcon(":pictures/appbar.map.treasure.png"));
  465. m_pButtonCmdSetPosition->setIconSize(QSize(32, 32));
  466. m_pButtonCmdSetPosition->setText(QApplication::translate("DTSettings", "Set Position", 0));
  467. connect(m_pButtonCmdSetPosition, &QPushButton::clicked, this, &DialogSettingsLGS::onSetPosition);
  468. // Connection
  469. m_pConmunicationGroupBox = new QGroupBox(m_pConPosGroupBox);
  470. //517, 0, 210, 700
  471. m_pConmunicationGroupBox->setGeometry(QRect(315, 320, 210, 124));
  472. //m_pConmunicationGroupBox->setFixedSize(185, 120);
  473. m_pConmunicationGroupBox->setTitle(QApplication::translate("DTSettings", "Connection", 0));
  474. m_pIP4Address = new QLineEdit(m_pConmunicationGroupBox);
  475. m_pIP4Address->setGeometry(QRect(20, 20, 113, 20));
  476. m_pIP4Address->setMaxLength(15);
  477. m_pIP4Address->setPlaceholderText(QApplication::translate("DTSettings", "IP4 Address", 0));
  478. m_pIP4Port = new QLineEdit(m_pConmunicationGroupBox);
  479. m_pIP4Port->setGeometry(QRect(135, 20, 40, 20));
  480. m_pIP4Port->setMaxLength(5);
  481. m_pIP4Port->setPlaceholderText(QApplication::translate("DTSettings", "Port", 0));
  482. m_pButtonCmdSetConnection = new QPushButton(m_pConmunicationGroupBox);
  483. m_pButtonCmdSetConnection->setGeometry(QRect(20, 45, 165, 32));
  484. m_pButtonCmdSetConnection->setIcon(QIcon(":pictures/appbar.calendar.tomorrow.png"));
  485. m_pButtonCmdSetConnection->setIconSize(QSize(32, 32));
  486. m_pButtonCmdSetConnection->setText(QApplication::translate("DTSettings", "Apply Settings", 0));
  487. connect(m_pButtonCmdSetConnection, &QPushButton::clicked, this, &DialogSettingsLGS::onSetCommunication);
  488. m_pButtonCmdRemoveDevice = new QPushButton(m_pConmunicationGroupBox);
  489. m_pButtonCmdRemoveDevice->setGeometry(QRect(20, 80, 165, 32));
  490. m_pButtonCmdRemoveDevice->setIcon(QIcon(":pictures/appbar.delete.png"));
  491. m_pButtonCmdRemoveDevice->setIconSize(QSize(32, 32));
  492. m_pButtonCmdRemoveDevice->setText(QApplication::translate("DTSettings", "Remove Device", 0));
  493. connect(m_pButtonCmdRemoveDevice, &QPushButton::clicked, this, &DialogSettingsLGS::onSetCommunication);
  494. /* Status Bar */
  495. //m_pStatusBar = new QStatusBar(this);
  496. //m_pStatusBar->setObjectName(QStringLiteral("statusBar"));
  497. //m_pStatusBar->setStyleSheet(QStringLiteral("background-color: rgb(255, 170, 0);"));
  498. //m_pProgressBar = new QProgressBar(m_pStatusBar);
  499. //m_pProgressBar->setGeometry(QRect(10, 2, 118, 16));
  500. //m_pProgressBar->setValue(100);
  501. //m_pProgressBar->setEnabled(false);
  502. //setStatusBar(m_pStatusBar);
  503. };
  504. DialogSettingsLGS::~DialogSettingsLGS(){
  505. delete(m_pFlipLabel);
  506. };
  507. void DialogSettingsLGS::attachDevice(objectLGS *ptr){
  508. m_pDevice = ptr;
  509. if( m_pDevice != NULL ){
  510. // Enable Master Controls
  511. //m_pGroupBox->setEnabled(true);
  512. m_pPositionGroupBox->setEnabled(true);
  513. m_pMapControl->setEnabled(true);
  514. } else {
  515. //m_pGroupBox->setEnabled(false);
  516. };
  517. };
  518. void DialogSettingsLGS::onUpdateQMotorSpinBox( int value ){
  519. //m_pQMotorFreq->setValue( ( value - m_pQMotorFreqSpinBox->minimum() ) * 100.0 / (m_pQMotorFreqSpinBox->maximum() - m_pQMotorFreqSpinBox->minimum()) );
  520. };
  521. void DialogSettingsLGS::onUpdateBMotorSpinBox(int value){
  522. //m_pBMotorFreq->setValue((value - m_pBMotorFreqSpinBox->minimum()) * 100.0 / (m_pBMotorFreqSpinBox->maximum() - m_pBMotorFreqSpinBox->minimum()));
  523. };
  524. void DialogSettingsLGS::onBMotorControlClicked(void){
  525. //if (m_pBMotorCheckBox->checkState()){
  526. //m_pBMotorFreq->setEnabled(true);
  527. m_pBMotorFreqSpinBox->setEnabled(true);
  528. //} else {
  529. // m_pBMotorFreq->setEnabled(false);
  530. // m_pBMotorFreqSpinBox->setEnabled(false);
  531. //};
  532. };
  533. void DialogSettingsLGS::onQMotorControlClicked(void){
  534. //if (m_pQMotorCheckBox->checkState()){
  535. //m_pQMotorFreq->setEnabled(true);
  536. m_pQMotorFreqSpinBox->setEnabled(true);
  537. //} else {
  538. // m_pQMotorFreq->setEnabled(false);
  539. // m_pQMotorFreqSpinBox->setEnabled(false);
  540. //};
  541. };
  542. void DialogSettingsLGS::onSetCommunication(void){
  543. if (m_pDevice != NULL){
  544. char tBuf[64];
  545. int tPort;
  546. sprintf(tBuf, "%s", m_pIP4Address->text().toStdString().c_str());
  547. m_pDevice->setHost(tBuf);
  548. tPort = atoi(m_pIP4Port->text().toStdString().c_str());
  549. m_pDevice->setPort(tPort);
  550. m_pDevice->updateSettings();
  551. };
  552. };
  553. void DialogSettingsLGS::onFullReset(void){
  554. if( m_pDevice != NULL ){
  555. m_pDevice->startDeviceReset( true );
  556. };
  557. };
  558. void DialogSettingsLGS::onRadioNoMotors(void){
  559. m_pMotorsEnableToggle->setEnabled( false );
  560. m_pHWPwmFrame->setEnabled( false );
  561. m_pHWTgzFrame->setEnabled( false );
  562. m_pHWSeashoreFrame->setEnabled( false );
  563. };
  564. void DialogSettingsLGS::onRadioPwmMotors(void){
  565. m_pMotorsEnableToggle->setEnabled( true );
  566. m_pHWPwmFrame->setEnabled( true );
  567. m_pHWTgzFrame->setEnabled( false );
  568. m_pHWSeashoreFrame->setEnabled( false );
  569. };
  570. void DialogSettingsLGS::onRadioTgzMotors(void){
  571. m_pMotorsEnableToggle->setEnabled( true );
  572. m_pHWPwmFrame->setEnabled( false );
  573. m_pHWTgzFrame->setEnabled( true );
  574. m_pHWSeashoreFrame->setEnabled( true );
  575. };
  576. void DialogSettingsLGS::onEnableBeam(void){
  577. if( m_pLrfEnableToggle->isChecked() ){
  578. QMessageBox *msgBox = new QMessageBox(this);
  579. msgBox->setText("Are you sure to turn on laser beam?");
  580. msgBox->setWindowModality(Qt::NonModal);
  581. msgBox->setWindowTitle("Turn On Laser Beam");
  582. msgBox->setFixedSize(400, 200);
  583. msgBox->setInformativeText("Be sure that all motors are running!");
  584. msgBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel );
  585. msgBox->setDefaultButton(QMessageBox::Cancel);
  586. int ret = msgBox->exec();
  587. if (ret == QMessageBox::Ok){
  588. //m_pDevice->startBeam();
  589. } else {
  590. m_pLrfEnableToggle->setChecked(false);
  591. };
  592. } else {
  593. QMessageBox *msgBox = new QMessageBox(this);
  594. msgBox->setText("Are you sure to turn off laser beam?");
  595. msgBox->setWindowModality(Qt::NonModal);
  596. msgBox->setWindowTitle("Turn Off Laser Beam");
  597. msgBox->setFixedSize(400, 200);
  598. msgBox->setInformativeText("This will make stop the detection process.");
  599. msgBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
  600. msgBox->setDefaultButton(QMessageBox::Cancel);
  601. int ret = msgBox->exec();
  602. if (ret == QMessageBox::Ok){
  603. //m_pDevice->stopBeam();
  604. } else {
  605. m_pLrfEnableToggle->setChecked(true);
  606. };
  607. };
  608. };
  609. void DialogSettingsLGS::onEnableMotors(void){
  610. if (m_pMotorsEnableToggle->isChecked()){
  611. QMessageBox *msgBox = new QMessageBox(this);
  612. msgBox->setText("Are you sure to turn on motors?");
  613. msgBox->setWindowModality(Qt::NonModal);
  614. msgBox->setWindowTitle("Turn On Motors");
  615. msgBox->setFixedSize(400, 200);
  616. msgBox->setInformativeText("Be sure that all parameters are correct and device is not blocked.");
  617. msgBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel );
  618. msgBox->setDefaultButton(QMessageBox::Cancel);
  619. int ret = msgBox->exec();
  620. if (ret == QMessageBox::Ok){
  621. m_pDevice->startStartMotors();
  622. } else {
  623. m_pMotorsEnableToggle->setChecked(false);
  624. };
  625. } else {
  626. QMessageBox *msgBox = new QMessageBox(this);
  627. msgBox->setText("Are you sure to turn off motors?");
  628. msgBox->setWindowModality(Qt::NonModal);
  629. msgBox->setWindowTitle("Turn Off Motors");
  630. msgBox->setFixedSize(400, 200);
  631. msgBox->setInformativeText("This will make stop the detection process.");
  632. msgBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
  633. msgBox->setDefaultButton(QMessageBox::Cancel);
  634. int ret = msgBox->exec();
  635. if (ret == QMessageBox::Ok){
  636. m_pDevice->startStopMotors();
  637. } else {
  638. m_pMotorsEnableToggle->setChecked(true);
  639. };
  640. };
  641. };
  642. void DialogSettingsLGS::onMapChanged(const QPointF &coordinate, int zoom){
  643. if (m_bRBlocker)return;
  644. m_bRBlocker = true;
  645. m_tPosition.setPositionWGS84(coordinate.y(), coordinate.x(), m_tPosition.getAlt());
  646. if (m_pPosByWGS84->isChecked()){
  647. m_pLatitude->setValue(m_tPosition.getLat());
  648. m_pLongitude->setValue(m_tPosition.getLon());
  649. } else {
  650. m_pLatitude->setValue(m_tPosition.getY() - systemAnchor::getInstance()->getY());
  651. m_pAltitude->setValue(m_tPosition.getZ() - systemAnchor::getInstance()->getZ());
  652. };
  653. m_bRBlocker = false;
  654. };
  655. void DialogSettingsLGS::onPositionLonChange(double value){
  656. if (m_bRBlocker)return;
  657. m_bRBlocker = true;
  658. if (m_pPosByWGS84->isChecked()){
  659. m_tPosition.setPositionWGS84(m_tPosition.getLat(), value, m_tPosition.getAlt());
  660. } else {
  661. m_tPosition.setPositionXYZ(systemAnchor::getInstance()->getX() + value, m_tPosition.getY(), m_tPosition.getZ(), systemAnchor::getInstance()->getUTMZone());
  662. };
  663. m_pMapControl->setView(QPointF(m_tPosition.getLon(), m_tPosition.getLat()));
  664. m_bRBlocker = false;
  665. };
  666. void DialogSettingsLGS::onPositionLatChange(double value){
  667. if (m_bRBlocker)return;
  668. m_bRBlocker = true;
  669. if (m_pPosByWGS84->isChecked()){
  670. m_tPosition.setPositionWGS84(value, m_tPosition.getLon(), m_tPosition.getAlt());
  671. } else {
  672. m_tPosition.setPositionXYZ(m_tPosition.getX(), systemAnchor::getInstance()->getY() + value, m_tPosition.getZ(), systemAnchor::getInstance()->getUTMZone());
  673. };
  674. m_pMapControl->setView(QPointF(m_tPosition.getLon(), m_tPosition.getLat()));
  675. m_bRBlocker = false;
  676. };
  677. void DialogSettingsLGS::onPositionAltChange(double value){
  678. if (m_bRBlocker)return;
  679. m_bRBlocker = true;
  680. if (m_pPosByWGS84->isChecked()){
  681. m_tPosition.setPositionWGS84(m_tPosition.getLat(), m_tPosition.getLon(), value);
  682. } else {
  683. m_tPosition.setPositionXYZ(m_tPosition.getX(), m_tPosition.getY(), systemAnchor::getInstance()->getZ() + value, systemAnchor::getInstance()->getUTMZone());
  684. };
  685. m_bRBlocker = false;
  686. };
  687. void DialogSettingsLGS::onOrientationRollChange(double value){
  688. if (m_bRBlocker)return;
  689. m_bRBlocker = true;
  690. m_tPosition.setOrientationDeg(m_tPosition.getRotX_deg(), value, m_tPosition.getRotZ_deg());
  691. m_bRBlocker = false;
  692. };
  693. void DialogSettingsLGS::onOrientationPitchChange(double value){
  694. if (m_bRBlocker)return;
  695. m_bRBlocker = true;
  696. m_tPosition.setOrientationDeg(value, m_tPosition.getRotY_deg(), m_tPosition.getRotZ_deg());
  697. m_bRBlocker = false;
  698. };
  699. void DialogSettingsLGS::onOrientationYawChange(double value){
  700. if (m_bRBlocker)return;
  701. m_bRBlocker = true;
  702. m_tPosition.setOrientationDeg(m_tPosition.getRotX_deg(), m_tPosition.getRotY_deg(), value);
  703. m_bRBlocker = false;
  704. };
  705. void DialogSettingsLGS::onSetPosition(void){
  706. m_pDevice->getPosition()->setPositionRad(m_tPosition.getLat(), m_tPosition.getLon(), m_tPosition.getAlt(),m_tPosition.getRotX_rad(), m_tPosition.getRotY_rad(), m_tPosition.getRotZ_rad());
  707. m_pDevice->updateSettings();
  708. };
  709. void DialogSettingsLGS::onPositionWGS84(void){
  710. if (m_bLocationByWGS84) return;
  711. m_bLocationByWGS84 = true;
  712. m_pLonLabel->setText(QApplication::translate("DTSettings", "Lon:", 0));
  713. m_pLatLabel->setText(QApplication::translate("DTSettings", "Lat:", 0));
  714. m_pAltLabel->setText(QApplication::translate("DTSettings", "Alt:", 0));
  715. if( m_pDevice!= NULL ){
  716. m_bRBlocker = true;
  717. m_pLongitude->setDecimals(6);
  718. m_pLongitude->setMinimum(-99.0);
  719. m_pLongitude->setMaximum(99.0);
  720. m_pLongitude->setSingleStep(1e-05);
  721. m_pLongitude->setValue(m_tPosition.getLon());
  722. m_pLatitude->setDecimals(6);
  723. m_pLatitude->setMinimum(-99.0);
  724. m_pLatitude->setMaximum(99.0);
  725. m_pLatitude->setSingleStep(1e-05);
  726. m_pLatitude->setValue(m_tPosition.getLat());
  727. m_pAltitude->setValue(m_tPosition.getAlt());
  728. //m_pMapControl->setView(QPointF(m_tPosition.getLon(), m_tPosition.getLat()));
  729. m_bRBlocker = false;
  730. };
  731. };
  732. void DialogSettingsLGS::onPositionMeters(void){
  733. if (!m_bLocationByWGS84)return;
  734. m_bLocationByWGS84 = false;
  735. m_pLonLabel->setText(QApplication::translate("DTSettings", "X:", 0));
  736. m_pLatLabel->setText(QApplication::translate("DTSettings", "Y:", 0));
  737. m_pAltLabel->setText(QApplication::translate("DTSettings", "Z:", 0));
  738. if( m_pDevice!= NULL ){
  739. m_bRBlocker = true;
  740. m_pLongitude->setDecimals(2);
  741. m_pLongitude->setMinimum(-1000.0);
  742. m_pLongitude->setMaximum(1000.0);
  743. m_pLongitude->setSingleStep(1e-02);
  744. m_pLongitude->setValue(m_tPosition.getX() - systemAnchor::getInstance()->getX());
  745. m_pLatitude->setDecimals(2);
  746. m_pLatitude->setMinimum(-1000.0);
  747. m_pLatitude->setMaximum(1000.0);
  748. m_pLatitude->setSingleStep(1e-02);
  749. m_pLatitude->setValue(m_tPosition.getY() - systemAnchor::getInstance()->getY());
  750. m_pAltitude->setValue(m_tPosition.getZ() - systemAnchor::getInstance()->getZ());
  751. //m_pMapControl->setView(QPointF(m_tPosition.getLon(), m_tPosition.getLat()));
  752. m_bRBlocker = false;
  753. };
  754. };
  755. void DialogSettingsLGS::setPositionSystemAnchor(void){
  756. m_tPosition.setPositionWGS84(systemAnchor::getInstance()->getLat(), systemAnchor::getInstance()->getLon(), systemAnchor::getInstance()->getAlt());
  757. if( m_pPosByWGS84->isChecked() ){
  758. m_pLatitude->setValue(m_tPosition.getLat());
  759. m_pLongitude->setValue(m_tPosition.getLon());
  760. m_pAltitude->setValue(m_tPosition.getAlt());
  761. } else {
  762. m_pLongitude->setValue( 0 );
  763. m_pLatitude->setValue( 0 );
  764. m_pAltitude->setValue( 0 );
  765. };
  766. };
  767. void DialogSettingsLGS::updateValues(){
  768. if( m_pDevice != NULL ){
  769. E_LGS_STAGE tSTG;
  770. m_bRBlocker = true;
  771. tSTG = m_pDevice->getCurrentSTG();
  772. m_tPosition.setPositionWGS84(m_pDevice->getPosition()->getLat(), m_pDevice->getPosition()->getLon(), m_pDevice->getPosition()->getAlt());
  773. m_tPosition.setOrientationRad(m_pDevice->getPosition()->getRotX_rad(), m_pDevice->getPosition()->getRotY_rad(), m_pDevice->getPosition()->getRotZ_rad());
  774. m_pLatitude->setValue(m_tPosition.getLat());
  775. m_pLongitude->setValue(m_tPosition.getLon());
  776. m_pAltitude->setValue(m_tPosition.getAlt());
  777. m_pPitch->setValue(m_tPosition.getRotX_deg());
  778. m_pRoll->setValue(m_tPosition.getRotY_deg());
  779. m_pYaw->setValue(m_tPosition.getRotZ_deg());
  780. m_pPositionGroupBox->setEnabled(true);
  781. m_pMapControl->setEnabled(true);
  782. //m_pConnectionCheckBox->setChecked(true);
  783. m_pIP4Address->setText(QString(m_pDevice->getHost()));
  784. char tBuf[64];
  785. sprintf(tBuf, "%d", m_pDevice->getPort());
  786. m_pIP4Port->setText(QString(tBuf));
  787. char *enabledStyle = "background-color: #00ff00; color: black;";
  788. char *disabledStyle = "background-color: gray; color: black;";
  789. char *abnormalStyle = "background-color: #ff0000; color: yellow;";
  790. if( tSTG >= STG_CONNECTED ){
  791. // Set Compiled Options First
  792. SOFTWARE_INFO *tSINFO;
  793. tSINFO = m_pDevice->getSoftwareInfo();
  794. if (tSINFO->DATA_VALID){
  795. if((tSINFO->SW_MODE_FLAGS & SW_INFO_FLAG_MASTER) != 0 ){
  796. m_pInfoMaster->setStyleSheet(enabledStyle);
  797. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_MOTOR_CTRL_ENA) != 0){
  798. m_pInfoEnaMotorCtrl->setStyleSheet(enabledStyle);
  799. m_pMotorsEnableToggle->setEnabled( true );
  800. } else {
  801. m_pInfoEnaMotorCtrl->setStyleSheet(disabledStyle);
  802. onRadioNoMotors();
  803. //m_pNoMotorCtrl->setChecked( true );
  804. m_pNoMotorCtrl->setEnabled( true );
  805. m_pPwmMotorCtrl->setEnabled( false );
  806. m_pTgzMotorCtrl->setEnabled( false );
  807. };
  808. } else {
  809. m_pInfoMaster->setStyleSheet(disabledStyle);
  810. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_MOTOR_CTRL_ENA) != 0){
  811. m_pInfoEnaMotorCtrl->setStyleSheet(abnormalStyle);
  812. } else {
  813. m_pInfoEnaMotorCtrl->setStyleSheet(disabledStyle);
  814. };
  815. onRadioNoMotors();
  816. m_pNoMotorCtrl->setEnabled( true );
  817. m_pPwmMotorCtrl->setEnabled( false );
  818. m_pTgzMotorCtrl->setEnabled( false );
  819. //m_pHWMotorFrame->setEnabled( false );
  820. };
  821. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_NO_BLACK_TARGETS) != 0){
  822. m_pInfoNoBlackTargets->setStyleSheet(enabledStyle);
  823. } else {
  824. m_pInfoNoBlackTargets->setStyleSheet(disabledStyle);
  825. };
  826. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_EU_PROJECT) != 0){
  827. m_pInfoEUmode->setStyleSheet(enabledStyle);
  828. m_pPwmMotorCtrl->setEnabled( false );
  829. m_pPwmMotorCtrl->setChecked( false );
  830. m_pTgzMotorCtrl->setEnabled( true );
  831. } else {
  832. m_pInfoEUmode->setStyleSheet(disabledStyle);
  833. m_pTgzMotorCtrl->setEnabled( false );
  834. };
  835. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_TGD_MOTORS) != 0){
  836. m_pInfoTGDmotors->setStyleSheet(enabledStyle);
  837. m_pPwmMotorCtrl->setEnabled(false);
  838. m_pPwmMotorCtrl->setChecked(false);
  839. m_pTgzMotorCtrl->setEnabled(true);
  840. } else {
  841. m_pInfoTGDmotors->setStyleSheet(disabledStyle);
  842. m_pTgzMotorCtrl->setChecked(false);
  843. m_pTgzMotorCtrl->setEnabled(false);
  844. };
  845. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_DEBUG_MODE) != 0){
  846. m_pInfoDebug->setStyleSheet(enabledStyle);
  847. } else {
  848. m_pInfoDebug->setStyleSheet(disabledStyle);
  849. };
  850. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_NO_TARGET_LOG) != 0){
  851. m_pInfoNoTargetLog->setStyleSheet(enabledStyle);
  852. } else {
  853. m_pInfoNoTargetLog->setStyleSheet(disabledStyle);
  854. };
  855. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_HIBERNATE_ENA) != 0){
  856. m_pInfoEnaHibernate->setStyleSheet(enabledStyle);
  857. } else {
  858. m_pInfoEnaHibernate->setStyleSheet(disabledStyle);
  859. };
  860. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_TGD_VER_2) != 0){
  861. m_pInfoTGDVer2->setStyleSheet(enabledStyle);
  862. } else {
  863. m_pInfoTGDVer2->setStyleSheet(disabledStyle);
  864. };
  865. if ((tSINFO->SW_MODE_FLAGS & SW_INFO_THREAD_FLIP) != 0){
  866. m_pInfoThreadFlips->setStyleSheet(enabledStyle);
  867. } else {
  868. m_pInfoThreadFlips->setStyleSheet(disabledStyle);
  869. }
  870. char tBuff[120];
  871. time_t t = tSINFO->SW_BUILD_DATE;
  872. struct tm *tm = localtime(&t);
  873. strftime(tBuff, sizeof(tBuff), "%Y-%m-%d %H:%M:%S", tm);
  874. m_pBuildDate->setText(tBuff);
  875. sprintf( tBuff, "0x%X", tSINFO->SW_MODE_FLAGS );
  876. m_pBuildCode->setText( tBuff );
  877. sprintf( tBuff, "%08X\n%08X", tSINFO->FW_CORE1_VER, tSINFO->FW_CORE1_TYP );
  878. m_pPRU0Code->setText( tBuff );
  879. sprintf( tBuff, "%08X\n%08X", tSINFO->FW_CORE2_VER, tSINFO->FW_CORE2_TYP );
  880. m_pPRU1Code->setText( tBuff );
  881. sprintf( tBuff, "%08X\n%08X", tSINFO->FW_CORE3_VER, tSINFO->FW_CORE3_TYP );
  882. m_pPRU2Code->setText( tBuff );
  883. sprintf( tBuff, "%08X\n%08X", tSINFO->FW_CORE4_VER, tSINFO->FW_CORE4_TYP );
  884. m_pPRU3Code->setText( tBuff );
  885. };
  886. // Set Parametric Option second
  887. // Enable Master Controls
  888. m_pHardwareGroupBox->setEnabled(true);
  889. m_pDetectionGroupBox->setEnabled(true);
  890. PLGS_PARAMETERS tPARAMS;
  891. //m_pProgressBar->setValue(30);
  892. tPARAMS = m_pDevice->getSettings();
  893. m_pFlipSpinBox->setValue( tPARAMS->nFlip );
  894. //tPARAMS->nDelta;
  895. m_pSSTSpinBox->setValue(tPARAMS->bSST);
  896. m_pGoodPointsSpinBox->setValue( tPARAMS->nGPointSamples );
  897. m_pOffsetSpinBox->setValue( tPARAMS->nOffset );
  898. m_pOrderSpinBox->setValue( tPARAMS->nOrder );
  899. m_pSunBitFiltering->setChecked(tPARAMS->flags.Sunbit_filter);
  900. m_pQ_ShiftSpinBox->setValue(tPARAMS->flags.Q_shift);
  901. m_pB_ShiftSpinBox->setValue(tPARAMS->flags.B_shift);
  902. //tPARAMS->nSun;
  903. m_pWidthSpinBox->setValue( tPARAMS->nWidth );
  904. m_pLrfEnableToggle->setChecked( tPARAMS->flags.LaserPulsesOn );
  905. m_pQMotorFreqSpinBox->setValue( tPARAMS->flags.VerticalFreq );
  906. m_pBMotorFreqSpinBox->setValue( tPARAMS->flags.HorizontalFreq );
  907. m_pTGZ_CanBusIDSpinBox->setValue( tPARAMS->flags.TGZ_canBus );
  908. m_pTGZ_CanHHIDSpinBox->setValue( tPARAMS->flags.TGZ_canSRC );
  909. m_pTGZ_CanDDIDSpinBox->setValue( tPARAMS->flags.TGZ_canDST );
  910. if( tPARAMS->flags.TGZ_canENA ){
  911. };
  912. if( tPARAMS->flags.LaserPulsesOn ) {
  913. m_pLrfEnableToggle->setChecked(true);
  914. m_pLrfEnableToggle->setIcon(QIcon(":pictures/appbar.laser.png"));
  915. } else {
  916. m_pLrfEnableToggle->setChecked(false);
  917. m_pLrfEnableToggle->setIcon(QIcon(":pictures/appbar.new.png"));
  918. };
  919. if( tPARAMS->flags.AutostartMotors ){
  920. m_pMotorsEnableToggle->setChecked(true);
  921. m_pMotorsEnableToggle->setIcon(QIcon(":pictures/appbar.base.png"));
  922. } else {
  923. m_pMotorsEnableToggle->setChecked(false);
  924. m_pMotorsEnableToggle->setIcon(QIcon(":pictures/appbar.base.select.png"));
  925. };
  926. if( tPARAMS->flags.HorizontalMotorOn == 0 && tPARAMS->flags.VerticalMotorOn == 0 ){
  927. m_pNoMotorCtrl->setChecked( true );
  928. onRadioNoMotors();
  929. };
  930. } else {
  931. m_pInfoMaster->setStyleSheet(disabledStyle);
  932. m_pInfoNoBlackTargets->setStyleSheet(disabledStyle);
  933. m_pInfoEUmode->setStyleSheet(disabledStyle);
  934. m_pInfoTGDmotors->setStyleSheet(disabledStyle);
  935. m_pInfoDebug->setStyleSheet(disabledStyle);
  936. m_pInfoNoTargetLog->setStyleSheet(disabledStyle);
  937. m_pInfoEnaHibernate->setStyleSheet(disabledStyle);
  938. m_pInfoEnaMotorCtrl->setStyleSheet(disabledStyle);
  939. m_pInfoTGDVer2->setStyleSheet(disabledStyle);
  940. m_pInfoThreadFlips->setStyleSheet(disabledStyle);
  941. // Disable Controls
  942. m_pInfoGroupBox->setEnabled(false);
  943. m_pDetectionGroupBox->setEnabled(false);
  944. m_pHardwareGroupBox->setEnabled(false);
  945. };
  946. };
  947. m_bSettingsAreChanged = false;
  948. m_bRBlocker = false;
  949. };
  950. void DialogSettingsLGS::onUpdateDevice(void){
  951. if( m_pDevice != NULL ){
  952. E_LGS_STAGE tSTG;
  953. tSTG = m_pDevice->getCurrentSTG();
  954. if( tSTG >= STG_CONNECTED ){
  955. // Check Master Controls
  956. if( 1 ){//m_pMGroupBox->isEnabled() ){
  957. PLGS_PARAMETERS tPARAMS;
  958. tPARAMS = (PLGS_PARAMETERS) malloc(sizeof( LGS_PARAMETERS ));
  959. memset( tPARAMS, 0, sizeof( LGS_PARAMETERS ));
  960. tPARAMS->nFlip = m_pFlipSpinBox->value();
  961. tPARAMS->nDelta = 0;
  962. tPARAMS->bSST = m_pSSTSpinBox->value();
  963. tPARAMS->nGPointSamples = m_pGoodPointsSpinBox->value();
  964. tPARAMS->nOffset = m_pOffsetSpinBox->value();
  965. tPARAMS->nOrder = m_pOrderSpinBox->value();
  966. tPARAMS->nSun = 0;
  967. tPARAMS->nWidth = m_pWidthSpinBox->value();
  968. tPARAMS->flags.LaserPulsesOn = m_pLrfEnableToggle->isChecked();
  969. tPARAMS->flags.VerticalMotorOn = 1;// m_pQMotorCheckBox->isChecked();
  970. tPARAMS->flags.HorizontalMotorOn = 1;// m_pBMotorCheckBox->isChecked();
  971. tPARAMS->flags.VerticalFreq = m_pQMotorFreqSpinBox->value();
  972. tPARAMS->flags.HorizontalFreq = m_pBMotorFreqSpinBox->value();
  973. // Send Data to device
  974. m_pDevice->setSettings( tPARAMS );
  975. };
  976. };
  977. };
  978. };