Exemple #1
0
void dlgMultimapsShowModal(void){
  WndProperty *wp;
  char filename[MAX_PATH];
  LocalPathS(filename, TEXT("dlgMultimaps.xml"));
  wf = dlgLoadFromXML(CallBackTable,                        
		      filename, 
		      hWndMainWindow,
		      TEXT("IDR_XML_MULTIMAPS"));

  if (!wf) return;

  setVariables();

  wf->ShowModal();

  wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap1"));
  if (wp) Multimap1 = (wp->GetDataField()->GetAsInteger());
 
  wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap2"));
  if (wp) Multimap2 = (wp->GetDataField()->GetAsInteger());
 
  wp = (WndProperty*)wf->FindByName(TEXT("prpMultimap3"));
  if (wp) Multimap3 = (wp->GetDataField()->GetAsInteger());

  UpdateMultimapOrient();

  delete wf;
  wf = NULL;

}
//
// Init runtime variables using _Config variables
// This is needed after loading a new profile, and
// also on startup after loading a reset configuration.
//
// LK8000 is (normally!) separating config values from runtime values.
// For example, ActiveMap can be configured disabled by default in System Config,
// but enabled at runtime with a button or a customkey. However the configuration
// will still be "disabled" and saved as disabled in profile. 
// It is important to keep runtime and config variables separated, if a config
// variable can be changed with a button out of System Config!
// 
// Be careful, like AdjustVariables this function is called twice or more times on startup
//
void LKProfileInitRuntime(void) {

  #if TESTBENCH
  StartupStore(_T("... LKProfileInitRuntime\n"));
  #endif

  // Todo: use _Config values for files, and then we can compare if they changed
  WAYPOINTFILECHANGED = TRUE;
  TERRAINFILECHANGED = TRUE;
  TOPOLOGYFILECHANGED = TRUE;
  AIRSPACEFILECHANGED = TRUE;
  AIRFIELDFILECHANGED = TRUE;
  POLARFILECHANGED = TRUE;


  //
  // Runtime from Config
  //

  Appearance.InverseInfoBox	= InverseInfoBox_Config;
  AutoAdvance			= AutoAdvance_Config;
  AutoMcMode			= AutoMcMode_Config;
  BgMapColor			= BgMapColor_Config;
  EnableNavBaroAltitude		= EnableNavBaroAltitude_Config;
  Orbiter			= Orbiter_Config;
  Shading			= Shading_Config;
  TerrainRamp			= TerrainRamp_Config;
  TrailActive			= TrailActive_Config;
  UseTotalEnergy		= UseTotalEnergy_Config;
  AutoWindMode			= AutoWindMode_Config;
  MapWindow::EnableTrailDrift	= EnableTrailDrift_Config;
  AltitudeMode			= AltitudeMode_Config;
  OutlinedTp			= OutlinedTp_Config;
  BUGS				= BUGS_Config;

  MapWindow::zoom.AutoZoom(AutoZoom_Config);

  CALCULATED_INFO.AutoMacCready = AutoMacCready_Config==true?1:0;
  DisplayOrientation = DisplayOrientation_Config;
  MapWindow::SetAutoOrientation(true); // reset old autoorientation

  MapWindow::GliderScreenPositionY = MapWindow::GliderScreenPosition;

  GlobalModelType=Appearance.InfoBoxModel;

  //
  // Units
  //
  switch(SpeedUnit_Config) {
    case 0 :
	SPEEDMODIFY = TOMPH;
	break;
    case 1 :
	SPEEDMODIFY = TOKNOTS;
	break;
    case 2 :
    default:
	SPEEDMODIFY = TOKPH;
	break;
  }
  switch(TaskSpeedUnit_Config) {
    case 0 :
      TASKSPEEDMODIFY = TOMPH;
      break;
    case 1 :
      TASKSPEEDMODIFY = TOKNOTS;
      break;
    case 2 :
    default:
      TASKSPEEDMODIFY = TOKPH;
      break;
  }
  switch(DistanceUnit_Config) {
    case 0 : DISTANCEMODIFY = TOMILES; break;
    case 1 : DISTANCEMODIFY = TONAUTICALMILES; break;
    default:
    case 2 : DISTANCEMODIFY = TOKILOMETER; break;
  }
  switch(AltitudeUnit_Config) {
    case 0 : ALTITUDEMODIFY = TOFEET; break;
    default:
    case 1 : ALTITUDEMODIFY = TOMETER; break;
  }
  switch(LiftUnit_Config) {
    case 0 : LIFTMODIFY = TOKNOTS; break;
    case 2 : LIFTMODIFY = TOKNOTS; break;
    default:
    case 1 : LIFTMODIFY = TOMETER; break;
  }
  Units::NotifyUnitChanged(); // set unit strings


  SetOverColorRef();

  InitActiveGate();


  if ( ISPARAGLIDER ) {
	if(PGOptimizeRoute)	AATEnabled=true;
	LoggerTimeStepCruise=1;
  } else {
	AATEnabled=FALSE;
  }

  if ( ISPARAGLIDER || ISCAR ) {
	// paragliders can takeoff at 5kmh ground with some head wind!
	TakeOffSpeedThreshold=1.39;	// 5kmh
	if (ISCAR) TakeOffSpeedThreshold=0.83; // 3 kmh
  } else {
	TakeOffSpeedThreshold=11.12; // 40kmh
  }

  //
  // ModelType specials for PNAs
  //
  #if (WINDOWSPC<1)
  if (GlobalModelType == MODELTYPE_PNA_HP31X ) {
	DeviceNeedClipping=true;
	// key transcoding for this one
  	#if TESTBENCH
	StartupStore(TEXT(". Loading HP31X settings%s"),NEWLINE);
	#endif
  }
  else
  if (GlobalModelType == MODELTYPE_PNA_PN6000 ) {
	// key transcoding for this one
  }
  else
  if (GlobalModelType == MODELTYPE_PNA_MIO ) {
  	#if TESTBENCH
	StartupStore(TEXT(". Loading MIO settings%s"),NEWLINE);
	#endif
	// currently no special settings from MIO but need to handle hw keys
  }
  else
  if (GlobalModelType == MODELTYPE_PNA_NOKIA_500 ) {
  	#if TESTBENCH
	StartupStore(TEXT(". Loading Nokia500 settings%s"),NEWLINE);
	#endif
	// key transcoding is made
  }
  else
  if (GlobalModelType == MODELTYPE_PNA_MEDION_P5 ) {
  	#if TESTBENCH
	StartupStore(TEXT(".Loading Medion settings%s"),NEWLINE);
	#endif
	DeviceNeedClipping=true;
  }
  if (GlobalModelType == MODELTYPE_PNA_NAVIGON ) {
  	#if TESTBENCH
	StartupStore(TEXT(".Loading Navigon settings%s"),NEWLINE);
	#endif
	DeviceNeedClipping=true;
  }
  else
  if (GlobalModelType == MODELTYPE_PNA_PNA ) {
  	#if TESTBENCH
	StartupStore(TEXT(". Loading default PNA settings%s"),NEWLINE);
	#endif
		
  }
  #if TESTBENCH
  else
	StartupStore(TEXT(". No special regsets for this device%s"),NEWLINE);
  #endif

  #endif // ModelType specials



  LKalarms[0].triggervalue=(int)AlarmMaxAltitude1/1000;
  LKalarms[1].triggervalue=(int)AlarmMaxAltitude2/1000;
  LKalarms[2].triggervalue=(int)AlarmMaxAltitude3/1000;

  UpdateConfBB();
  UpdateConfIP();
  UpdateMultimapOrient();

}