コード例 #1
0
ファイル: BratSettings.cpp プロジェクト: BRAT-DEV/main
bool CBratSettings::LoadConfig()
{
	return
	base_t::LoadConfig()
	&&
	ReadSection( GROUP_COMMON, 

		k_v( ENTRY_LAST_DATA_PATH,			&m_lastDataPath ),
		k_v( ENTRY_LAST_PAGE_REACHED,		&m_lastPageReached ),
		k_v( ENTRY_ADVANCED_OPERATIONS,		&mAdvancedOperations, false ),

		k_v( ENTRY_LOAD_WKSPC_AT_STARTUP,	&mLoadLastWorkspaceAtStartUp ),
        k_v( ENTRY_MAIN_LAYER_BASE_TYPE,	(int*)&mMainLayerBaseType, (int)smDefaultLayerBaseType ),
        k_v( ENTRY_VIEWS_LAYER_BASE_TYPE,	(int*)&mViewsLayerBaseType, (int)smDefaultLayerBaseType ),
		k_v( ENTRY_VECTOR_SIMPLIFY_METHOD,	&mVectorSimplifyMethod, true ),
		k_v( ENTRY_DESKTOP_MANAGER_SDI,		&mDesktopManagerSdi, true ),
		k_v( ENTRY_CHECK_OPENGL,			&mCheckOpenGL, true )
	)
	&&
	ReadValues( GROUP_WKS, 
	{ 
		{ ENTRY_LAST, m_lastWksPath },
	} 
	)
	&&
	ReadValues( GROUP_COLORTABLE, 
	{ 
		{ ENTRY_LAST, m_lastColorTable },
	}
	)
	&&
	LoadPaths();
}
コード例 #2
0
ファイル: TaskPointDialog.cpp プロジェクト: DRIZO/xcsoar
bool
dlgTaskPointShowModal(OrderedTask **task,
                      const unsigned index)
{
  ordered_task = *task;
  task_modified = false;
  active_index = index;

  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                  Layout::landscape ? _T("IDR_XML_TASKPOINT_L") :
                                      _T("IDR_XML_TASKPOINT"));
  assert(wf != nullptr);

  wTaskView = (WndFrame*)wf->FindByName(_T("frmTaskView"));
  assert(wTaskView != nullptr);

  dock = (DockWindow *)wf->FindByName(_T("properties"));
  assert(dock != nullptr);

  RefreshView();
  if (wf->ShowModal() == mrOK)
    ReadValues();

  delete wf;

  if (*task != ordered_task) {
    *task = ordered_task;
    task_modified = true;
  } 
  if (task_modified) {
    ordered_task->ClearName();
    ordered_task->UpdateGeometry();
  }
  return task_modified;
}
コード例 #3
0
bool
PDBFileObject::GetIntegerArray(const char *name, int **i, int *nvals)
{
    int *dims = 0;
    int nDims = 0;
    int length = 0;
    TypeEnum t = NO_TYPE;

    // Initially set the return value to zero.
    *i = 0;
    *nvals = 0;

    if(AutoOpen())
    {
        // Read the variable.
        void *val = ReadValues(name, &t, &length, &dims, &nDims);

        // Set up the return array.
        if(val)
        {
            free_mem(dims);
            if(t == INTEGER_TYPE || t == INTEGERARRAY_TYPE)
            {
                *i = (int *)val;
                *nvals = length;
            }
            else
                pdb_free_void_mem(val, t);
        }
    }

    return *i != 0;
}
コード例 #4
0
static void
OnOZLineLengthData(gcc_unused DataField *Sender, gcc_unused DataField::DataAccessKind_t Mode)
{
  if (!Refreshing)
    ReadValues();
  wTaskView->invalidate();
}
コード例 #5
0
static void
OnOZSectorFinishRadialData(gcc_unused DataField *Sender, gcc_unused DataField::DataAccessKind_t Mode)
{
  if (!Refreshing)
    ReadValues();
  wTaskView->invalidate();
}
コード例 #6
0
ファイル: config.cpp プロジェクト: euler0/Helium
void ConfigTestCase::RecordingDefaultsTest()
{
    wxString app = wxT("wxConfigTestCaseRD");
    wxString vendor = wxT("wxWidgets");
    wxConfig *config = new wxConfig(app, vendor, wxT(""), wxT(""),
                                    wxCONFIG_USE_LOCAL_FILE);
    config->DeleteAll();
    config->SetRecordDefaults(false); // by default it is false
    ReadValues(config, false);
    CPPUNIT_ASSERT_EQUAL( 0, config->GetNumberOfEntries() );
    config->SetRecordDefaults(true);
    int read = ReadValues(config, false);
    CPPUNIT_ASSERT_EQUAL( read, config->GetNumberOfEntries() );
    ReadValues(config, true);
    config->DeleteAll();
    delete config;
}
コード例 #7
0
bool
TaskPropertiesPanel::Leave()
{
  ReadValues();
  if (orig_taskType != ordered_task->GetFactoryType())
    ordered_task->GetFactory().MutateTPsToTaskType();

  return true;
}
コード例 #8
0
ファイル: TaskPointDialog.cpp プロジェクト: DRIZO/xcsoar
static void
OnNextClicked()
{
  if (active_index >= ordered_task->TaskSize() - 1 || !ReadValues())
    return;

  ++active_index;
  RefreshView();
}
コード例 #9
0
ファイル: TaskPointDialog.cpp プロジェクト: DRIZO/xcsoar
static void
OnPreviousClicked()
{
  if (active_index == 0 || !ReadValues())
    return;

  --active_index;
  RefreshView();
}
コード例 #10
0
ファイル: TaskPointDialog.cpp プロジェクト: kwtskran/XCSoar
inline void
TaskPointWidget::OnPreviousClicked()
{
  if (active_index == 0 || !ReadValues())
    return;

  --active_index;
  RefreshView();
}
コード例 #11
0
ファイル: TaskPointDialog.cpp プロジェクト: kwtskran/XCSoar
inline void
TaskPointWidget::OnNextClicked()
{
  if (active_index >= ordered_task.TaskSize() - 1 || !ReadValues())
    return;

  ++active_index;
  RefreshView();
}
コード例 #12
0
ファイル: pnlTaskProperties.cpp プロジェクト: macsux/XCSoar
bool
pnlTaskProperties::OnTabPreHide()
{
  ReadValues();
  if (orig_taskType != ordered_task->get_factory_type())
    ordered_task->get_factory().mutate_tps_to_task_type();

  return true;
}
コード例 #13
0
ファイル: mpivrad.cpp プロジェクト: Baer42/source-sdk-2013
//--------------------------------------------------
// UnSerialize face data
//
void UnSerializeFace( MessageBuffer * pmb, int facenum, int iSource )
{
	int i, n;

	dface_t     * f  = &g_pFaces[facenum];
	facelight_t * fl = &facelight[facenum];

	if (pmb->read(f, sizeof(dface_t)) < 0) 
		Error("UnSerializeFace - invalid dface_t from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() );

	if (pmb->read(fl, sizeof(facelight_t)) < 0) 
		Error("UnSerializeFace - invalid facelight_t from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() );

	fl->sample = (sample_t *) calloc(fl->numsamples, sizeof(sample_t));
	if (pmb->read(fl->sample, sizeof(sample_t) * fl->numsamples) < 0) 
		Error("UnSerializeFace - invalid sample_t from %s (mb len: %d, offset: %d, fl->numsamples: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset(), fl->numsamples );

	//
	// Read the light information
	// 
	for (i=0; i<MAXLIGHTMAPS; ++i) {
		for (n=0; n<NUM_BUMP_VECTS+1; ++n) {
			if (fl->light[i][n])
			{
				fl->light[i][n] = (LightingValue_t *) calloc( fl->numsamples, sizeof(LightingValue_t ) );
				if ( ReadValues( pmb, fl->light[i][n], fl->numsamples) < 0)
					Error("UnSerializeFace - invalid fl->light from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() );
			}
		}
	}

	if (fl->luxel) {
		fl->luxel = (Vector *) calloc(fl->numluxels, sizeof(Vector));
		if (ReadValues( pmb, fl->luxel, fl->numluxels) < 0)
			Error("UnSerializeFace - invalid fl->luxel from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() );
	}

	if (fl->luxelNormals) {
		fl->luxelNormals = (Vector *) calloc(fl->numluxels, sizeof( Vector ));
		if ( ReadValues( pmb, fl->luxelNormals, fl->numluxels) < 0)
			Error("UnSerializeFace - invalid fl->luxelNormals from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() );
	}

}
コード例 #14
0
void
TaskPropertiesPanel::OnTaskTypeChange(DataFieldEnum &df)
{
  const TaskFactoryType newtype =
    (TaskFactoryType)df.GetAsInteger();
  if (newtype != ordered_task->GetFactoryType()) {
    ReadValues();
    ordered_task->SetFactory(newtype);
    *task_changed =true;
    RefreshView();
  }
}
コード例 #15
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: bugburner/xcsoar
static void OnAATEnabled(DataField *Sender, DataField::DataAccessKind_t Mode) {
  switch(Mode){
    case DataField::daGet:
    break;
    case DataField::daPut:
    case DataField::daChange:
      ReadValues();
      SetValues();
      GetWaypointValues();
      SetWaypointValues();
    break;
  }
}
コード例 #16
0
ファイル: pnlTaskProperties.cpp プロジェクト: macsux/XCSoar
void
pnlTaskProperties::OnTaskTypeData(DataField *Sender, DataField::DataAccessKind_t Mode)
{
  if (Mode == DataField::daChange) {
    const DataFieldEnum &df = *(DataFieldEnum *)Sender;
    const TaskBehaviour::Factory_t newtype =
       (TaskBehaviour::Factory_t)df.GetAsInteger();
    if (newtype != ordered_task->get_factory_type()) {
      ReadValues();
      ordered_task->set_factory(newtype);
      *task_changed =true;
      RefreshView();
    }
  }
}
コード例 #17
0
bool
PDBFileObject::GetDoubleArray(const char *name, double **d, int *nvals)
{
    int *dims = 0;
    int nDims = 0;
    int length = 0;
    TypeEnum t = NO_TYPE;

    // Initially set the return value to zero.
    *d = 0;
    *nvals = 0;

    if(AutoOpen())
    {
        // Read the variable.
        void *val = ReadValues(name, &t, &length, &dims, &nDims);

        // Set up the return array.
        if(val)
        {
            free_mem(dims);
            if(t == DOUBLE_TYPE || t == DOUBLEARRAY_TYPE)
            {
                *d = (double *)val;
                *nvals = length;
            }
            else if(t == FLOAT_TYPE || t == FLOATARRAY_TYPE)
            {
                float *fptr = (float *)val;
                double *dstorage = new double[length];
                double *dptr = dstorage;
                for(int i = 0; i < length; ++i)
                    *dptr++ = double(*fptr++);
                pdb_free_void_mem(val, t);

                *d = dstorage;
                *nvals = length;
            }
            else
                pdb_free_void_mem(val, t);
        }
    }

    return *d != 0;
}
コード例 #18
0
bool
dlgTaskPointShowModal(SingleWindow &parent, OrderedTask** task,
                      const unsigned index)
{
  ordered_task = *task;
  task_modified = false;
  active_index = index;

  wf = LoadDialog(CallBackTable, parent,
                  Layout::landscape ? _T("IDR_XML_TASKPOINT_L") :
                                      _T("IDR_XML_TASKPOINT"));
  assert(wf != NULL);

  wTaskView = (WndFrame*)wf->FindByName(_T("frmTaskView"));
  assert(wTaskView != NULL);

  WndFrame* wType = (WndFrame*) wf->FindByName(_T("lblType"));
  assert (wType);
  wType->SetFont(Fonts::MapBold);

  WndFrame* wLocation = (WndFrame*) wf->FindByName(_T("lblLocation"));
  assert (wLocation);
  wLocation->SetFont(Fonts::MapBold);

  do {
    RefreshView();
    next_previous=0;
    if (wf->ShowModal() == mrOK)
      ReadValues();
    active_index += next_previous;
  } while (next_previous != 0);

  delete wf;

  if (*task != ordered_task) {
    *task = ordered_task;
    task_modified = true;
  } 
  if (task_modified) {
    ordered_task->update_geometry();
  }
  return task_modified;
}
コード例 #19
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: LK8000/LK8000
static void OnTaskPointPicto(WindowControl * Sender, LKSurface& Surface) {
    (void) Sender;

    WndFrame *wPicto = ((WndFrame *) wf->FindByName(TEXT("frmTaskPointPicto")));
    if(wPicto) {
        /********************/
        ReadValues();
        GetWaypointValues();
        //  CalculateTaskSectors();
        //  if (AATEnabled)
        //    CalculateAATTaskSectors();
        RefreshTask();
        /*******************/
        const RECT rc = wPicto->GetClientRect();

        MapWindow::DrawWaypointPictoBg(Surface, rc);
        MapWindow::DrawTaskPicto(Surface, twItemIndex, rc, 2000);
    }
}
コード例 #20
0
bool
PDBFileObject::GetString(const char *name, char **str, int *len)
{
    int *dims = 0;
    int nDims = 0;
    int length = 0;
    TypeEnum t = NO_TYPE;

    // Initially set the return value to zero.
    *str = 0;

    if(AutoOpen())
    {
        // Read the variable.
        void *val = ReadValues(name, &t, &length, &dims, &nDims, 1);

        // Set up the return array.
        if(val)
        {
            free_mem(dims);
            if(t == CHAR_TYPE || t == CHARARRAY_TYPE)
            {
                *str = (char *)val;
                // We allocated the array so it can hold the extra
                // character required for a NULL terminator.
                (*str)[length] = '\0';

                if(len != 0)
                    *len = length;
            }
            else
                pdb_free_void_mem(val, t);
        }
    }

    return *str != 0;
}
コード例 #21
0
ファイル: TaskPointDialog.cpp プロジェクト: kwtskran/XCSoar
void
TaskPointWidget::OnModified(ObservationZoneEditWidget &widget)
{
  ReadValues();
  map.Invalidate();
}
コード例 #22
0
ファイル: config.cpp プロジェクト: coconutxin/citra
void Config::Reload() {
    LoadINI(DefaultINI::sdl2_config_file);
    ReadValues();
}
コード例 #23
0
ファイル: TaskPointDialog.cpp プロジェクト: kwtskran/XCSoar
 bool Save(bool &changed) override {
   ReadValues();
   changed = task_modified;
   return true;
 }
コード例 #24
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: Acrobot/LK8000
void dlgTaskWaypointShowModal(int itemindex, int tasktype, bool addonly){
  wf = NULL;
 
  if (!ScreenLandscape) {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgTaskWaypoint_L.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_TASKWAYPOINT_L"));
  } else {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgTaskWaypoint.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_TASKWAYPOINT"));    
  }

  if (ISPARAGLIDER) {
    if(DoOptimizeRoute()) 
		AATEnabled=TRUE;
	EnableMultipleStartPoints=false;
  }

  twItemIndex = itemindex;
  twType = tasktype;

  if (!wf) return;

  //ASSERT(wf!=NULL);
  //  wf->SetKeyDownNotify(FormKeyDown);

  wStart     = ((WndFrame *)wf->FindByName(TEXT("frmStart")));
  wTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmTurnpoint")));
  wAATTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmAATTurnpoint")));
  wFinish    = ((WndFrame *)wf->FindByName(TEXT("frmFinish")));

  //ASSERT(wStart!=NULL);
  //ASSERT(wTurnpoint!=NULL);
  //ASSERT(wAATTurnpoint!=NULL);
  //ASSERT(wFinish!=NULL);

  WndButton* wb;
  if (addonly) {
    wb = (WndButton *)wf->FindByName(TEXT("butSelect"));
    if (wb) {
      wb->SetVisible(false);
    }
    wb = (WndButton *)wf->FindByName(TEXT("butRemove"));
    if (wb) {
      wb->SetVisible(false);
    }
    wb = (WndButton *)wf->FindByName(TEXT("butDetails"));
    if (wb) {
      wb->SetVisible(false);
    }
    wb = (WndButton *)wf->FindByName(TEXT("butDown"));
    if (wb) {
      wb->SetVisible(false);
    }
    wb = (WndButton *)wf->FindByName(TEXT("butUp"));
    if (wb) {
      wb->SetVisible(false);
    }
  } else {
    if (!ValidTaskPoint(twItemIndex-1)) {
      wb = (WndButton *)wf->FindByName(TEXT("butUp"));
      if (wb) {
        wb->SetVisible(false);
      }
    }
    if (!ValidTaskPoint(twItemIndex+1)) {
      wb = (WndButton *)wf->FindByName(TEXT("butDown"));
      if (wb) {
        wb->SetVisible(false);
      }
    }
  }

  SetWaypointValues(true);

  switch (twType) {
    case 0:
      wStart->SetVisible(1);
      wTurnpoint->SetVisible(0);
      wAATTurnpoint->SetVisible(0);
      wFinish->SetVisible(0);
      break;
    case 1:
      wStart->SetVisible(0);
      if (AATEnabled) {
	wTurnpoint->SetVisible(0);
	wAATTurnpoint->SetVisible(1);
      } else {
	wTurnpoint->SetVisible(1);
	wAATTurnpoint->SetVisible(0);
      }
      wFinish->SetVisible(0);
    break;
    case 2:
      wStart->SetVisible(0);
      wTurnpoint->SetVisible(0);
      wAATTurnpoint->SetVisible(0);
      wFinish->SetVisible(1);
    break;
  }

  // set properties...

  SetValues(true);

  UpdateCaption();

  wf->ShowModal();

  // now retrieve changes

  GetWaypointValues();

  ReadValues();

  delete wf;

  wf = NULL;

}
コード例 #25
0
ファイル: config.cpp プロジェクト: archshift/citra
void Config::Reload() {
    ReadValues();
}
コード例 #26
0
ファイル: eccFileVersionInfo.cpp プロジェクト: ChakaZulu/ecc
TFileVersionInfo::TFileVersionInfo(String fname)
{
	ReadValues(fname);
}
コード例 #27
0
ファイル: config.cpp プロジェクト: Corleon15/citra
void Config::Reload() {
    LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file);
    ReadValues();
}
コード例 #28
0
ファイル: TaskPointDialog.cpp プロジェクト: DRIZO/xcsoar
void
TPOZListener::OnModified(ObservationZoneEditWidget &widget)
{
  ReadValues();
  wTaskView->Invalidate();
}
コード例 #29
0
ファイル: dlgTaskWaypoint.cpp プロジェクト: bugburner/xcsoar
void dlgTaskWaypointShowModal(int itemindex, int tasktype, bool addonly){
  wf = NULL;

  if (!Layout::landscape) {
    wf = dlgLoadFromXML(CallBackTable,
                        _T("dlgTaskWaypoint_L.xml"),
                        XCSoarInterface::main_window,
                        _T("IDR_XML_TASKWAYPOINT_L"));
  } else {
    wf = dlgLoadFromXML(CallBackTable,
                        _T("dlgTaskWaypoint.xml"),
                        XCSoarInterface::main_window,
                        _T("IDR_XML_TASKWAYPOINT"));
  }

  twItemIndex = itemindex;
  twType = tasktype;

  if (!wf) return;

  assert(wf!=NULL);
  //  wf->SetKeyDownNotify(FormKeyDown);

  settings_task = task.getSettings();

  wStart     = ((WndFrame *)wf->FindByName(_T("frmStart")));
  wTurnpoint = ((WndFrame *)wf->FindByName(_T("frmTurnpoint")));
  wAATTurnpoint = ((WndFrame *)wf->FindByName(_T("frmAATTurnpoint")));
  wFinish    = ((WndFrame *)wf->FindByName(_T("frmFinish")));

  assert(wStart!=NULL);
  assert(wTurnpoint!=NULL);
  assert(wAATTurnpoint!=NULL);
  assert(wFinish!=NULL);

  WndButton* wb;
  if (addonly) {
    wb = (WndButton *)wf->FindByName(_T("butSelect"));
    if (wb) {
      wb->hide();
    }
    wb = (WndButton *)wf->FindByName(_T("butRemove"));
    if (wb) {
      wb->hide();
    }
    wb = (WndButton *)wf->FindByName(_T("butDetails"));
    if (wb) {
      wb->hide();
    }
    wb = (WndButton *)wf->FindByName(_T("butDown"));
    if (wb) {
      wb->hide();
    }
    wb = (WndButton *)wf->FindByName(_T("butUp"));
    if (wb) {
      wb->hide();
    }
  } else {
    if (!task.ValidTaskPoint(twItemIndex-1)) {
      wb = (WndButton *)wf->FindByName(_T("butUp"));
      if (wb) {
        wb->hide();
      }
    }
    if (!task.ValidTaskPoint(twItemIndex+1)) {
      wb = (WndButton *)wf->FindByName(_T("butDown"));
      if (wb) {
        wb->hide();
      }
    }
  }

  SetWaypointValues(true);

  switch (twType) {
    case 0:
      wStart->show();
      wTurnpoint->hide();
      wAATTurnpoint->hide();
      wFinish->hide();
      break;
    case 1:
      wStart->hide();
      wTurnpoint->set_visible(!settings_task.AATEnabled);
      wAATTurnpoint->set_visible(settings_task.AATEnabled);
      wFinish->hide();
    break;
    case 2:
      wStart->hide();
      wTurnpoint->hide();
      wAATTurnpoint->hide();
      wFinish->show();
    break;
  }

  // set properties...

  SetValues(true);

  UpdateCaption();

  wf->ShowModal();

  // now retrieve changes

  GetWaypointValues();

  ReadValues();

  delete wf;

  wf = NULL;

}