DialogObject::DialogObject(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogObject), dialogItem(this)
{
    ui->setupUi(this);
    ui->dialog->setEnabled(false);

    for (short i = 0 ; i < 4 ; ++i)
      ui->type->addItem(objectTypes[i]);

    connect(ui->interactionTalkTo, SIGNAL(toggled(bool)), ui->dialog, SLOT(setEnabled(bool)));
    connect(ui->type, SIGNAL(currentIndexChanged(QString)), this, SLOT(UpdateType(QString)));
    connect(this, SIGNAL(accepted()), this, SLOT(Apply()));
    connect(ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked()), this, SLOT(Reset()));

    connect(ui->itemList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(ItemAdd()));
    connect(ui->inventory, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(OpenItemDialog()));
    connect(&dialogItem, SIGNAL(accepted()), this, SLOT(ItemSave()));

    connect(ui->toolSelectCharsheet, SIGNAL(clicked()), this, SLOT(SelectCharsheet()));
    connect(ui->toolSelectScript,    SIGNAL(clicked()), this, SLOT(SelectScript()));
    connect(ui->toolSelectDialog,    SIGNAL(clicked()), this, SLOT(SelectDialog()));

    connect(ui->modelPick,   SIGNAL(clicked()), this, SLOT(SelectModel()));
    connect(ui->texturePick, SIGNAL(clicked()), this, SLOT(SelectTexture()));
}
Example #2
0
void LNBConfig::SetPreset(const QString &value)
{
    uint index = value.toUInt();
    if (index >= (sizeof(lnb_presets) / sizeof(lnb_preset)))
        return;

    lnb_preset &preset = lnb_presets[index];
    if (preset.name.isEmpty())
    {
        m_type->setEnabled(true);
        UpdateType();
    }
    else
    {
        m_type->setValue(m_type->getValueIndex(
                             QString::number((uint)preset.type)));
        m_lof_switch->setValue(QString::number(preset.lof_sw / 1000));
        m_lof_lo->setValue(QString::number(preset.lof_lo / 1000));
        m_lof_hi->setValue(QString::number(preset.lof_hi / 1000));
        m_pol_inv->setValue(preset.pol_inv);
        m_type->setEnabled(false);
        m_lof_switch->setEnabled(false);
        m_lof_hi->setEnabled(false);
        m_lof_lo->setEnabled(false);
        m_pol_inv->setEnabled(false);
    }
}
Example #3
0
// read observation data ----------------------------------------------------
void __fastcall TPlot::ReadObs(TStrings *files)
{
    obs_t obs={0};
    nav_t nav={0};
    sta_t sta={0};
    AnsiString s;
    char file[1024];
    int i,nobs;
    
    trace(3,"ReadObs\n");
    
    if (files->Count<=0) return;
    
    ReadWaitStart();
    ShowLegend(NULL);
    
    if ((nobs=ReadObsRnx(files,&obs,&nav,&sta))<=0) {
        ReadWaitEnd();
        return;
    }
    ClearObs();
    Obs=obs;
    Nav=nav;
    Sta=sta;
    SimObs=0;
    UpdateObs(nobs);
    UpdateMp();
    
    if (ObsFiles!=files) {
        ObsFiles->Assign(files);
    }
    NavFiles->Clear();
    
    strcpy(file,U2A(files->Strings[0]).c_str());
    
    Caption=s.sprintf("%s%s",file,files->Count>1?"...":"");
    
    BtnSol1->Down=true;
    time2gpst(Obs.data[0].time,&Week);
    SolIndex[0]=SolIndex[1]=ObsIndex=0;
    
    if (PlotType<PLOT_OBS||PLOT_DOP<PlotType) {
        UpdateType(PLOT_OBS);
    }
    else {
        UpdatePlotType();
    }
    FitTime();
    
    ReadWaitEnd();
    UpdateObsType();
    UpdateTime();
    UpdatePlot();
}
Example #4
0
// clear data ---------------------------------------------------------------
void __fastcall TPlot::Clear(void)
{
    AnsiString s;
    double ep[]={2010,1,1,0,0,0};
    int i;
    
    trace(3,"Clear\n");
    
    Week=NObs=0;
    
    for (i=0;i<2;i++) {
        freesolbuf(SolData+i);
        free(SolStat[i].data);
        SolStat[i].n=0;
        SolStat[i].data=NULL;
    }
    freeobs(&Obs);
    freenav(&Nav,0xFF);
    delete [] IndexObs;
    delete [] Az;
    delete [] El;
    IndexObs=NULL;
    Az=NULL;
    El=NULL;
    SolFiles[0]->Clear();
    SolFiles[1]->Clear();
    ObsFiles->Clear();
    NavFiles->Clear();
    NObs=0;
    SolIndex[0]=SolIndex[1]=ObsIndex=0;
    
    for (i=0;i<3;i++) {
        TimeEna[i]=0;
    }
    TimeStart=TimeEnd=epoch2time(ep);
    BtnAnimate->Down=false;
    
    if (PlotType>PLOT_NSAT) {
        UpdateType(PLOT_TRK);
    }
    if (!ConnectState) {
        initsolbuf(SolData  ,0,0);
        initsolbuf(SolData+1,0,0);
        Caption=Title!=""?Title:s.sprintf("%s ver.%s",PRGNAME,VER_RTKLIB);
    }
    else {
        initsolbuf(SolData  ,1,RtBuffSize+1);
        initsolbuf(SolData+1,1,RtBuffSize+1);
    }
    UpdateTime();
    UpdatePlot();
}
Example #5
0
void CTile::AddLinked(CTile* _link)
{
	if (0 != _link)
	{
		_link->AddRef();
		m_linked.push_back(_link);
	}

	UpdateType();

	for (UInt16 i = 0; i < m_linked.size(); ++i)
	{
		m_linked[i]->UpdateType();
	}
}
Example #6
0
ezRTTI::ezRTTI(const char* szName, const ezRTTI* pParentType, ezUInt32 uiTypeSize, ezUInt32 uiTypeVersion, ezUInt32 uiVariantType,
               ezBitflags<ezTypeFlags> flags, ezRTTIAllocator* pAllocator, ezArrayPtr<ezAbstractProperty*> properties,
               ezArrayPtr<ezAbstractFunctionProperty*> functions, ezArrayPtr<ezPropertyAttribute*> attributes,
               ezArrayPtr<ezAbstractMessageHandler*> messageHandlers, ezArrayPtr<ezMessageSenderInfo> messageSenders,
               const ezRTTI* (*fnVerifyParent)())
{
  UpdateType(pParentType, uiTypeSize, uiTypeVersion, uiVariantType, flags);

  m_bGatheredDynamicMessageHandlers = false;
  m_szPluginName = nullptr;
  m_szTypeName = szName;
  m_pAllocator = pAllocator;
  m_Properties = properties;
  m_Functions = functions;
  m_Attributes = attributes;
  m_MessageHandlers = messageHandlers;
  m_uiMsgIdOffset = 0;
  m_MessageSenders = messageSenders;

  m_fnVerifyParent = fnVerifyParent;

  // This part is not guaranteed to always work here!
  // pParentType is (apparently) always the correct pointer to the base class BUT it is not guaranteed to have been constructed at this
  // point in time! Therefore the message handler hierarchy is initialized delayed in DispatchMessage
  //
  // However, I don't know where we could do these debug checks where they are guaranteed to be executed.
  // For now they are executed here and one might also do that in e.g. the game application
  {
#if EZ_ENABLED(EZ_COMPILE_FOR_DEVELOPMENT)
    VerifyCorrectness();
#endif
  }

  if (m_szTypeName)
    RegisterType(this);
}
Example #7
0
// clear data ------------------------------------------------------------------
void __fastcall TPlot::Clear(void)
{
    AnsiString s;
    double ep[]={2010,1,1,0,0,0};
    int i;
    
    trace(3,"Clear\n");
    
    Week=0;
    
    ClearObs();
    ClearSol();
    
    for (i=0;i<3;i++) {
        TimeEna[i]=0;
    }
    TimeStart=TimeEnd=epoch2time(ep);
    BtnAnimate->Down=false;
    
    if (PlotType>PLOT_NSAT) {
        UpdateType(PLOT_TRK);
    }
    if (!ConnectState) {
        initsolbuf(SolData  ,0,0);
        initsolbuf(SolData+1,0,0);
        Caption=Title!=""?Title:s.sprintf("%s ver.%s",PRGNAME,VER_RTKLIB);
    }
    else {
        initsolbuf(SolData  ,1,RtBuffSize+1);
        initsolbuf(SolData+1,1,RtBuffSize+1);
    }
    GoogleEarthView->Clear();
    
    UpdateTime();
    UpdatePlot();
}
void KSceneSFXEditorBillboardPage::UpdateBillboardUI()
{
    GET_SFX_EDITOR();

    int nSelect = m_comboBillboard.GetCurSel();
    if (nSelect == CB_ERR)
    {
        m_editBillboardName.EnableWindow(FALSE);
        m_checkSpecialAdjustAxis.EnableWindow(FALSE);
        m_comboBlendMode.EnableWindow(FALSE);
        m_comboType.EnableWindow(FALSE);
        m_radioWidth.EnableWindow(FALSE);
        m_editWidth.EnableWindow(FALSE);
        m_radioHeight.EnableWindow(FALSE);
        m_editHeight.EnableWindow(FALSE);
        m_radioColor.EnableWindow(FALSE);
        m_picColor.EnableWindow(FALSE);
        m_radioTextureFrameIndex.EnableWindow(FALSE);
        m_editTextureFrameIndex.EnableWindow(FALSE);
        m_radioTexture2FrameIndex.EnableWindow(FALSE);
        m_editTexture2FrameIndex.EnableWindow(FALSE);
        m_checkRotationAnimation.EnableWindow(FALSE);
        m_radioRotationAnimation.EnableWindow(FALSE);
        m_editRotationAnimation.EnableWindow(FALSE);
        m_radioUVOffset.EnableWindow(FALSE);
        m_editOffsetU.EnableWindow(FALSE);
        m_editOffsetV.EnableWindow(FALSE);
        m_editTextureName.EnableWindow(FALSE);
        m_editTexture2Name.EnableWindow(FALSE);
        m_buttonBrowseTextureName.EnableWindow(FALSE);
        m_buttonBrowseTexture2Name.EnableWindow(FALSE);
        m_editTextureCut.EnableWindow(FALSE);
        m_editTexture2Cut.EnableWindow(FALSE);
        return;
    }
    else
    {
        m_editBillboardName.EnableWindow();
        m_checkSpecialAdjustAxis.EnableWindow();
        m_comboBlendMode.EnableWindow();
        m_comboType.EnableWindow();
        m_radioWidth.EnableWindow();
        m_editWidth.EnableWindow();
        m_radioHeight.EnableWindow();
        m_editHeight.EnableWindow();
        m_radioColor.EnableWindow();
        m_picColor.EnableWindow();
        m_radioTextureFrameIndex.EnableWindow();
        m_editTextureFrameIndex.EnableWindow();
        m_radioTexture2FrameIndex.EnableWindow();
        m_editTexture2FrameIndex.EnableWindow();
        m_checkRotationAnimation.EnableWindow();
        m_radioRotationAnimation.EnableWindow();
        m_editRotationAnimation.EnableWindow();
        m_radioUVOffset.EnableWindow();
        m_editOffsetU.EnableWindow();
        m_editOffsetV.EnableWindow();
        m_editTextureName.EnableWindow();
        m_editTexture2Name.EnableWindow();
        m_buttonBrowseTextureName.EnableWindow();
        m_buttonBrowseTexture2Name.EnableWindow();
        m_editTextureCut.EnableWindow();
        m_editTexture2Cut.EnableWindow();
    }

    IEKG3DSFX *pSFX = NULL;
    pScene->GetSFX(&pSFX);
    IEKG3DSFXBillboard *pBillboard = NULL;
    pSFX->GetBillboard(nSelect, &pBillboard);
    ASSERT(pBillboard);
    int nFrame = pFrame->GetKeysFrame()->m_Slider.GetCurPos();

    UpdateBlendMode(pBillboard);
    UpdateBillboardName(pScene, nSelect);
    UpdateBillboardColor(pBillboard, nFrame);
    UpdateBillboardWidth(pBillboard, nFrame);
    UpdateBillboardHeight(pBillboard, nFrame);
    UpdateTextureFrameIndex1(pBillboard, nFrame);
    UpdateTextureFrameIndex2(pBillboard, nFrame);
    UpdateRotation(pBillboard, nFrame);
    UpdateUV(pBillboard, nFrame);
    UpdateTextureName1(pBillboard);
    UpdateTextureName2(pBillboard);
    UpdateTextureCut1(pBillboard);
    UpdateTextureCut2(pBillboard);
    UpdateType(pBillboard);
}
Example #9
0
// read solutions -----------------------------------------------------------
void __fastcall TPlot::ReadSol(TStrings *files, int sel)
{
    solbuf_t sol={0};
    AnsiString s;
    gtime_t ts,te;
    double tint;
    int i,n=0;
    char *paths[MAXNFILE]={""};
    
    trace(3,"ReadSol: sel=%d\n",sel);
    
    if (files->Count<=0) return;
    
    ReadWaitStart();
    
    for (i=0;i<files->Count&&n<MAXNFILE;i++) {
        paths[n++]=files->Strings[i].c_str();
    }
    TimeSpan(&ts,&te,&tint);
    
    ShowMsg(s.sprintf("reading %s...",paths[0]));
    ShowLegend(NULL);
    
    if (!readsolt(paths,n,ts,te,tint,0,&sol)) {
        ShowMsg(s.sprintf("no solution data : %s...",paths[0]));
        ShowLegend(NULL);
        ReadWaitEnd();
        return;
    }
    freesolbuf(SolData+sel);
    SolData[sel]=sol;
    
    if (SolFiles[sel]!=files) {
        SolFiles[sel]->Assign(files);
    }
    Caption="";
    
    ReadSolStat(files,sel);
    
    for (i=0;i<2;i++) {
        if (SolFiles[i]->Count==0) continue;
        Caption=Caption+SolFiles[i]->Strings[0]+(SolFiles[i]->Count>1?"... ":" ");
    }
    BtnSol12->Down=False;
    if (sel==0) BtnSol1->Down=true;
    else        BtnSol2->Down=true;
    
    if (sel==0||SolData[0].n<=0) {
        time2gpst(SolData[sel].data[0].time,&Week);
        UpdateOrigin();
    }
    SolIndex[0]=SolIndex[1]=ObsIndex=0;
    
    if (PlotType>PLOT_NSAT) {
        UpdateType(PLOT_TRK);
    }
    else {
        UpdatePlotType();
    }
    FitTime();
    if (AutoScale&&PlotType<=PLOT_SOLA) {
        FitRange(1);
    }
    else {
        SetRange(1,YRange);
    }
    UpdateTime();
    UpdatePlot();
    
    ReadWaitEnd();
}
Example #10
0
void CGame::ComputerRender(CDrawPort *pdp)
{
  // if playing a demo
  if (_pNetwork->IsPlayingDemo()) {
    // never call computer
    cmp_ppenPlayer = NULL;
  }

  // disable netricsa for non-local players
  if (cmp_ppenPlayer!=NULL && !_pNetwork->IsPlayerLocal(cmp_ppenPlayer)) {
    cmp_ppenPlayer = NULL;
  }
  if (cmp_ppenDHPlayer!=NULL && !_pNetwork->IsPlayerLocal(cmp_ppenDHPlayer)) {
    cmp_ppenDHPlayer = NULL;
  }
  if (cmp_ppenDHPlayer!=NULL && !pdp->IsDualHead()) {
    cmp_ppenDHPlayer = NULL;
  }

  // initially - no player
  _ppenPlayer=NULL;

  // if player calls computer
  if (cmp_ppenPlayer!=NULL) {
    // use that player
    _ppenPlayer = cmp_ppenPlayer;
    // if computer is on in background
    if (_pGame->gm_csComputerState==CS_ONINBACKGROUND) {
      // just toggle to on
      _pGame->gm_csComputerState=CS_ON;
      // find group with some unread messages
      FindGroupWithUnread();
      // force reinit
      _cmtCurrentType = (enum CompMsgType)-1;
    }
  // if using dualhead to render computer on second display
  } else if (cmp_ppenDHPlayer!=NULL) {
    // use that player
    _ppenPlayer = cmp_ppenDHPlayer;
    // clear dualhead request - it has to be reinitialized every frame
    cmp_ppenDHPlayer = NULL;

    // if viewing statistics
    if (_cmtWantedType == CMT_STATISTICS) {
      // fill in fresh player statistics
      _ppenPlayer->GetStats(_strStatsDetails, CST_DETAIL, _ctTextCharsPerRow);
      // force updating
      UpdateType(TRUE);
    }

    // if computer is not on or on in background
    if (_pGame->gm_csComputerState!=CS_ON && _pGame->gm_csComputerState!=CS_ONINBACKGROUND) {
      // switch on fast
      ComputerOn();
      fComputerFadeValue = 1.0f;
      _pGame->gm_csComputerState = CS_ONINBACKGROUND;
      cmp_bInitialStart = FALSE; // end of eventual initial start
    }

    // if should update to new message
    if (cmp_bUpdateInBackground) {
      cmp_bUpdateInBackground = FALSE;
      FindGroupWithUnread();
      // force reinit
      _cmtCurrentType = (enum CompMsgType)-1;
    }
  }

  // if no player
  if (_ppenPlayer==NULL) {
    // make sure computer is off
    _pGame->gm_csComputerState=CS_OFF;
    // do nothing more
    return;
  }

  // if computer is not active
  if (_pGame->gm_csComputerState==CS_OFF) {
    // just remember time
    tvComputerLast = _pTimer->GetHighPrecisionTimer();
    // if a player wants computer
    if (_ppenPlayer!=NULL) {
      // start turning on
      _pGame->gm_csComputerState=CS_TURNINGON;
      ComputerOn();
    } else {
      return;
    }
  }
 
  // calculate up-down speed to be independent of refresh speed
  CTimerValue tvNow   = _pTimer->GetHighPrecisionTimer();
  CTimerValue tvDelta = tvNow - tvComputerLast;
  tvComputerLast      = tvNow;
  FLOAT fFadeSpeed    = (FLOAT)(tvDelta.GetSeconds() / tmComputerFade);

  // if computer is dropping down
  if( _pGame->gm_csComputerState==CS_TURNINGON) {
    // move it down
    fComputerFadeValue += fFadeSpeed;
    // if finished moving
    if( fComputerFadeValue>1.0f) {
      // stop
      fComputerFadeValue = 1.0f;
      _pGame->gm_csComputerState   = CS_ON;
      cmp_bInitialStart  = FALSE; // end of eventual initial start
    }
  }
  // if computer is pulling up
  if( _pGame->gm_csComputerState==CS_TURNINGOFF) {
    // move it up
    fComputerFadeValue -= fFadeSpeed;
    // if finished moving
    if( fComputerFadeValue<0.0f) {
      // stop
      fComputerFadeValue = 0.0f;
      _pGame->gm_csComputerState   = CS_OFF;
      ComputerOff();
      cmp_ppenPlayer = NULL;
      // exit computer
      return;
    }
  }

  // safety check -> do not proceed if no player
  if (_ppenPlayer==NULL) {
    return;
  }

  // lock drawport
  CDrawPort dpComp(pdp, FALSE);
  if(!dpComp.Lock()) {
    // do nothing
    return;
  }

  // if in fullscreen
  CDisplayMode dmCurrent;
  _pGfx->GetCurrentDisplayMode(dmCurrent);
  if (dmCurrent.IsFullScreen() && dmCurrent.IsDualHead()) {
    // clamp mouse pointer
    _vpixMouse(1) = Clamp(_vpixMouse(1), 0L, dpComp.GetWidth());
    _vpixMouse(2) = Clamp(_vpixMouse(2), 0L, dpComp.GetHeight());
  // if in window
  } else {
    // use same mouse pointer as windows
    _vpixMouse = _vpixExternMouse;
    // if dualhead
    if (dpComp.dp_MinI>0) {
      // offset by half screen
      _vpixMouse(1) -= dpComp.GetWidth();
    }
    // if widescreen
    if (dpComp.dp_MinJ>0) {
      // offset by screen top
      _vpixMouse(2) -= dpComp.dp_MinJ;
    }
  }

  TIME tmOld     = _pTimer->CurrentTick();
  FLOAT fLerpOld = _pTimer->GetLerpFactor();

  FLOAT fSec = tvNow.GetSeconds();
  TIME tmTick = floor(fSec/_pTimer->TickQuantum)*_pTimer->TickQuantum;
  FLOAT fLerp = (fSec-tmTick)/_pTimer->TickQuantum;
  _pTimer->SetCurrentTick(tmTick);
  _pTimer->SetLerp(fLerp);

  LCDPrepare(1.0f);//ClampUp(fComputerFadeValue*10,1.0f));
  LCDSetDrawport(&dpComp);
  // if initial start
  if (cmp_bInitialStart) {
    // do not allow game to show through
    dpComp.Fill(C_BLACK|255);
  // if normal start
  } else {
    // fade over game view
    dpComp.Fill(LCDFadedColor(C_BLACK|255));
  }
  dpComp.FillZBuffer(1.0f);

  // update screen geometry
  UpdateSize(&dpComp);
  // update scroll positions
  UpdateType();
  UpdateFirstOnScreen();
  // check for message change
  UpdateMessageAppearing();
  // mark current message as read
  MarkCurrentRead();

  // get current time and alpha value
  FLOAT tmNow = (FLOAT)tvNow.GetSeconds();
  ULONG ulA   = NormFloatToByte(fComputerFadeValue);

  _colLight  = LCDFadedColor(C_WHITE|255);
  _colMedium = LCDFadedColor(SE_COL_BLUE_LIGHT|255);
  _colDark   = LCDFadedColor(LerpColor(SE_COL_BLUE_DARK, SE_COL_BLUE_LIGHT, 0.5f)|255);
  _colBoxes  = LCDFadedColor(LerpColor(SE_COL_BLUE_DARK, SE_COL_BLUE_LIGHT, 0.5f)|255);

  // background
  LCDRenderCloudsForComp();
//  dpComp.DrawLine( 0, pixSizeJ-1, pixSizeI, pixSizeJ-1, C_GREEN|ulA);

  // all done
  dpComp.Unlock();

  // print title
  CDrawPort dpTitle(&dpComp, _boxTitle);
  if (dpTitle.Lock()) {
    LCDSetDrawport(&dpTitle);
    LCDRenderCompGrid();
    LCDRenderClouds2();
    LCDScreenBoxOpenLeft(_colBoxes);
    PrintTitle(&dpTitle);
    dpTitle.Unlock();
  }

  // print exit button
  CDrawPort dpExit(&dpComp, _boxExit);
  if (dpExit.Lock()) {
    LCDSetDrawport(&dpExit);
    LCDRenderCompGrid();
    LCDRenderClouds2();
    LCDScreenBoxOpenRight(_colBoxes);
    PrintExit(&dpExit);
    dpExit.Unlock();
  }

  // print buttons
  for (INDEX i=0; i<CMT_COUNT; i++) {
    PrintButton(&dpComp, i);
  }
  // print list of messages
  CDrawPort dpMsgList(&dpComp, _boxMsgList);
  if (dpMsgList.Lock()) {
    LCDSetDrawport(&dpMsgList);
    LCDRenderCompGrid();
    LCDRenderClouds2();
    LCDScreenBox(_colBoxes);
    PrintMessageList(&dpMsgList);
    dpMsgList.Unlock();
  }
  // print text of current message
  CDrawPort dpMsgText(&dpComp, _boxMsgText);
  if (dpMsgText.Lock()) {
    LCDSetDrawport(&dpMsgText);
    LCDRenderCompGrid();
    LCDRenderClouds2();
    LCDScreenBox(_colBoxes);
    PrintMessageText(&dpMsgText);
    dpMsgText.Unlock();
  }
  // draw image of current message
  CDrawPort dpMsgImage(&dpComp, _boxMsgImage);
  if (dpMsgImage.Lock()) {
    LCDSetDrawport(&dpMsgImage);
    RenderMessageImage(&dpMsgImage);
    dpMsgImage.Unlock();
  }

  // render mouse pointer on top of everything else
  if (_pGame->gm_csComputerState != CS_ONINBACKGROUND) {
    if (dpComp.Lock()) {
      LCDSetDrawport(&dpComp);
      LCDDrawPointer(_vpixMouse(1), _vpixMouse(2));
      dpComp.Unlock();
    }
  }

  _pTimer->SetCurrentTick(tmOld);
  _pTimer->SetLerp(fLerpOld);
}
Example #11
0
// generate visibility data ----------------------------------------------------
void __fastcall TPlot::GenVisData(void)
{
    gtime_t time,ts,te;
    obsd_t data={{0}};
    sta_t sta={0};
    double tint,r,pos[3],rr[3],rs[6],e[3],azel[2];
    int i,j,nobs=0;
    char name[16];
    
    trace(3,"GenVisData\n");
    
    ClearObs();
    SimObs=1;
    
    ts=TimeStart;
    te=TimeEnd;
    tint=TimeInt;
    matcpy(pos,OOPos,3,1);
    pos2ecef(pos,rr);
    
    ReadWaitStart();
    ShowLegend(NULL);
    ShowMsg("generating satellite visibility...");
    Application->ProcessMessages();
    
    for (time=ts;timediff(time,te)<=0.0;time=timeadd(time,tint)) {
        for (i=0;i<MAXSAT;i++) {
            satno2id(i+1,name);
            if (!tle_pos(time,name,"","",&TLEData,NULL,rs)) continue;
            if ((r=geodist(rs,rr,e))<=0.0) continue;
            if (satazel(pos,e,azel)<=0.0) continue;
            if (Obs.n>=Obs.nmax) {
                Obs.nmax=Obs.nmax<=0?4096:Obs.nmax*2;
                Obs.data=(obsd_t *)realloc(Obs.data,sizeof(obsd_t)*Obs.nmax);
                if (!Obs.data) {
                    Obs.n=Obs.nmax=0;
                    break;
                }
            }
            data.time=time;
            data.sat=i+1;
            
            for (j=0;j<NFREQ;j++) {
                data.P[j]=data.L[j]=0.0;
                data.code[j]=CODE_NONE;
            }
            data.code[0]=CODE_L1C;
            Obs.data[Obs.n++]=data;
        }
        if (++nobs>=MAX_SIMOBS) break;
    }
    if (Obs.n<=0) {
        ReadWaitEnd();
        ShowMsg("no satellite visibility");
        return;
    }
    UpdateObs(nobs);
    
    Caption="Satellite Visibility (Predicted)";
    BtnSol1->Down=true;
    time2gpst(Obs.data[0].time,&Week);
    SolIndex[0]=SolIndex[1]=ObsIndex=0;
    if (PlotType<PLOT_OBS||PLOT_DOP<PlotType) {
        UpdateType(PLOT_OBS);
    }
    else {
        UpdatePlotType();
    }
    FitTime();
    ReadWaitEnd();
    UpdateObsType();
    UpdateTime();
    UpdatePlot();
}
Example #12
0
void CChangeGroup::Add(CChangeBase* pItem)
{
	CHECK_NOT_ABOUT_TO_USE_NULL_POINTER(pItem);
	UpdateType(pItem->GetType());
	theChanges.push_back(pItem);
}