QtnPropertyIntSpinBoxHandler(QtnPropertyIntBase& property, QSpinBox& editor)
        : QtnPropertyEditorHandlerType(property, editor)
    {
        if (!property.isEditableByUser())
            editor.setReadOnly(true);

        editor.setRange(property.minValue(), property.maxValue());
        editor.setSingleStep(property.stepValue());

        updateEditor();

        QObject::connect(  &editor, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged)
                         , this, &QtnPropertyIntSpinBoxHandler::onValueChanged);
    }
void PrimaryGPSStatusTab::readPacket(std::shared_ptr<Packet> packet) {
  if (packet->instanceOfGroup()) {
    const Group& group = packet->groupCast();
    if (group.instanceOf<PrimaryGPSStatus>()) {
      enableFields(true);
      const PrimaryGPSStatus& msg = group.typeCast<PrimaryGPSStatus>();
      mUi->navPrimGPSText->setText(
        mStatusMsg[msg.mNavigationSolutionStatus].c_str());
      mUi->satPrimGPSSpinBox->setValue(msg.mNumberOfSVTracked);
      mUi->primGPSTypeText->setText(mGPSTypeMsg[msg.mGPSReceiverType].c_str());
      mUi->geoidalPrimGPSSpinBox->setValue(msg.mGeoidalSeparation);
      mUi->hdopSpinBox->setValue(msg.mHDOP);
      mUi->vdopSpinBox->setValue(msg.mVDOP);
      mUi->dgpsIDSpinBox->setValue(msg.mDGPSReferenceID);
      mUi->corrLatencySpinBox->setValue(msg.mDGPSCorrectionLatency);
      mUi->navLatencySpinBox->setValue(msg.mGPSNavigationMessageLatency);
      mUi->weekSpinBox->setValue(msg.mGPSUTCWeekNumber);
      mUi->offsetSpinBox->setValue(msg.mGPSUTCTimeOffset);
      while (mUi->channelsTable->rowCount())
        mUi->channelsTable->removeRow(mUi->channelsTable->rowCount() - 1);
      for (size_t i = 0; i < msg.mChannelNumber; ++i) {
        mUi->channelsTable->insertRow(mUi->channelsTable->rowCount());
        QSpinBox* PRN = new QSpinBox;
        PRN->setReadOnly(true);
        PRN->setValue(msg.mChannelStatusData[i].mSVPRN);
        PRN->setButtonSymbols(QAbstractSpinBox::NoButtons);
        mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 0,
          PRN);
        QLineEdit* status = new QLineEdit;
        status->setReadOnly(true);
        status->setText(mChannelStatusMsg[
          msg.mChannelStatusData[i].mChannelTrackingStatus].c_str());
        mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 1,
          status);
        QDoubleSpinBox* azimuth = new QDoubleSpinBox;
        azimuth->setReadOnly(true);
        azimuth->setValue(msg.mChannelStatusData[i].mSVAzimuth);
        azimuth->setButtonSymbols(QAbstractSpinBox::NoButtons);
        mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 2,
          azimuth);
        QDoubleSpinBox* elevation = new QDoubleSpinBox;
        elevation->setReadOnly(true);
        elevation->setValue(msg.mChannelStatusData[i].mSVElevation);
        elevation->setButtonSymbols(QAbstractSpinBox::NoButtons);
        mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 3,
          elevation);
        QDoubleSpinBox* l1snr = new QDoubleSpinBox;
        l1snr->setReadOnly(true);
        l1snr->setValue(msg.mChannelStatusData[i].mSVL1SNR);
        l1snr->setButtonSymbols(QAbstractSpinBox::NoButtons);
        mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 4,
          l1snr);
        QDoubleSpinBox* l2snr = new QDoubleSpinBox;
        l2snr->setReadOnly(true);
        l2snr->setValue(msg.mChannelStatusData[i].mSVL2SNR);
        l2snr->setButtonSymbols(QAbstractSpinBox::NoButtons);
        mUi->channelsTable->setCellWidget(mUi->channelsTable->rowCount() - 1, 5,
          l2snr);
      }
    }
    if (group.instanceOf<PPSTimeRecoveryStatus>()) {
      const PPSTimeRecoveryStatus& msg =
        group.typeCast<PPSTimeRecoveryStatus>();
      mUi->ppsSpinBox->setValue(msg.mPPSCount);
      mUi->timeStatusText->setText(
        mTimeSyncMsg[msg.mTimeSynchroStatus].c_str());
    }
  }
}