本文整理汇总了C++中WndProperty::RefreshDisplay方法的典型用法代码示例。如果您正苦于以下问题:C++ WndProperty::RefreshDisplay方法的具体用法?C++ WndProperty::RefreshDisplay怎么用?C++ WndProperty::RefreshDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WndProperty
的用法示例。
在下文中一共展示了WndProperty::RefreshDisplay方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: temptask
void
TaskDefaultsConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
WndProperty *wp;
const ComputerSettings &settings_computer = XCSoarInterface::GetComputerSettings();
const TaskBehaviour &task_behaviour = settings_computer.task;
OrderedTask temptask(task_behaviour);
temptask.SetFactory(TaskFactoryType::RACING);
RowFormWidget::Prepare(parent, rc);
wp = AddEnum(_("Start point"),
_("Default start type for new tasks you create."),
this);
if (wp) {
const auto point_types = temptask.GetFactory().GetValidStartTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (auto i = point_types.begin(), end = point_types.end();
i != end; ++i) {
const AbstractTaskFactory::LegalPointType type = *i;
dfe->addEnumText(OrderedTaskPointName(type), (unsigned)type,
OrderedTaskPointDescription(type));
if (type == task_behaviour.sector_defaults.start_type)
dfe->Set((unsigned)type);
}
wp->RefreshDisplay();
}
AddFloat(Caption_GateWidth, _("Default radius or gate width of the start zone for new tasks."),
_T("%.1f %s"), _T("%.1f"), fixed(0.1), fixed(100), fixed(1.0), true, UnitGroup::DISTANCE,
task_behaviour.sector_defaults.start_radius);
AddSpacer();
wp = AddEnum(_("Finish point"),
_("Default finish type for new tasks you create."),
this);
if (wp) {
const auto point_types = temptask.GetFactory().GetValidFinishTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (auto i = point_types.begin(), end = point_types.end();
i != end; ++i) {
const AbstractTaskFactory::LegalPointType type = *i;
dfe->addEnumText(OrderedTaskPointName(type), (unsigned)type,
OrderedTaskPointDescription(type));
if (type == task_behaviour.sector_defaults.finish_type)
dfe->Set((unsigned)type);
}
wp->RefreshDisplay();
}
AddFloat(Caption_GateWidth, _("Default radius or gate width of the finish zone in new tasks."),
_T("%.1f %s"), _T("%.1f"), fixed(0.1), fixed(100), fixed(1.0), true, UnitGroup::DISTANCE,
task_behaviour.sector_defaults.finish_radius);
AddSpacer();
wp = AddEnum(_("Turn point"), _("Default turn point type for new tasks you create."));
if (wp) {
const auto point_types = temptask.GetFactory().GetValidIntermediateTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (auto i = point_types.begin(), end = point_types.end();
i != end; ++i) {
const AbstractTaskFactory::LegalPointType type = *i;
dfe->addEnumText(OrderedTaskPointName(type), (unsigned)type,
OrderedTaskPointDescription(type));
if (type == task_behaviour.sector_defaults.turnpoint_type) {
dfe->Set((unsigned)type);
}
}
wp->RefreshDisplay();
}
AddFloat(Caption_Radius, _("Default radius of turnpoint cylinders and sectors in new tasks."),
_T("%.1f %s"), _T("%.1f"), fixed(0.1), fixed(100), fixed(1.0), true, UnitGroup::DISTANCE,
task_behaviour.sector_defaults.turnpoint_radius);
AddSpacer();
wp = AddEnum(_("Task"), _("Default task type for new tasks you create."));
if (wp) {
const std::vector<TaskFactoryType> factory_types =
temptask.GetFactoryTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < factory_types.size(); i++) {
dfe->addEnumText(OrderedTaskFactoryName(factory_types[i]),
(unsigned)factory_types[i], OrderedTaskFactoryDescription(
factory_types[i]));
if (factory_types[i] == task_behaviour.task_type_default)
dfe->Set((unsigned)factory_types[i]);
}
wp->RefreshDisplay();
//.........这里部分代码省略.........
示例2:
static void
RefreshCalculator(void)
{
WndProperty* wp;
// update outputs
wp = (WndProperty*)wf->FindByName(_T("prpAATEst"));
if (wp) {
wp->GetDataField()->SetAsFloat((
XCSoarInterface::Calculated().common_stats.task_time_remaining +
XCSoarInterface::Calculated().common_stats.task_time_elapsed) / 60);
wp->RefreshDisplay();
}
// update outputs
wp = (WndProperty*)wf->FindByName(_T("prpAATTime"));
if (wp) {
if (XCSoarInterface::Calculated().task_stats.has_targets) {
wp->GetDataField()->SetAsFloat(
protected_task_manager.get_ordered_task_behaviour().aat_min_time / 60);
wp->RefreshDisplay();
} else {
wp->hide();
}
}
wp = (WndProperty*)wf->FindByName(_T("prpDistance"));
if (wp) {
wp->GetDataField()->SetAsFloat(Units::ToUserDistance(
XCSoarInterface::Calculated().task_stats.total.solution_planned.Vector.Distance));
wp->GetDataField()->SetUnits(Units::GetDistanceName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpMacCready"));
if (wp) {
wp->GetDataField()->SetUnits(Units::GetVerticalSpeedName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpEffectiveMacCready"));
if (wp) {
wp->GetDataField()->SetUnits(Units::GetVerticalSpeedName());
wp->GetDataField()->SetAsFloat(Units::ToUserVSpeed(emc));
wp->RefreshDisplay();
}
/*
wp = (WndProperty*)wf->FindByName(_T("prpRange"));
if (wp) {
wp->RefreshDisplay();
wp->set_visible(task.getSettings().AATEnabled &&
task.ValidTaskPoint(task.getActiveIndex() + 1));
wp->GetDataField()->SetAsFloat(Range*100.0);
wp->RefreshDisplay();
}
fixed v1;
if (XCSoarInterface::Calculated().TaskTimeToGo>0) {
v1 = XCSoarInterface::Calculated().TaskDistanceToGo/
XCSoarInterface::Calculated().TaskTimeToGo;
} else {
v1 = 0;
}
*/
wp = (WndProperty*)wf->FindByName(_T("prpSpeedRemaining"));
if (wp) {
wp->GetDataField()->SetAsFloat(Units::ToUserTaskSpeed(
XCSoarInterface::Calculated().task_stats.total.remaining_effective.get_speed()));
wp->GetDataField()->SetUnits(Units::GetTaskSpeedName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpSpeedAchieved"));
if (wp) {
wp->GetDataField()->SetAsFloat(Units::ToUserTaskSpeed(
XCSoarInterface::Calculated().task_stats.total.travelled.get_speed()));
wp->GetDataField()->SetUnits(Units::GetTaskSpeedName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpCruiseEfficiency"));
if (wp) {
wp->GetDataField()->SetAsFloat(cruise_efficiency * 100);
wp->RefreshDisplay();
}
}
示例3: UpdateValuesSystem
static void UpdateValuesSystem() {
static unsigned extGPSCONNECT_last = XCSoarInterface::Basic().Connected;
static int NAVWarning_last = XCSoarInterface::Basic().NAVWarning;
static int SatellitesUsed_last = XCSoarInterface::Basic().SatellitesUsed;
static int VarioAvailable_last = XCSoarInterface::Basic().VarioAvailable;
static int FLARM_Available_last = XCSoarInterface::Basic().FLARM_Available;
static bool LoggerActive_last = logger.isLoggerActive();
static bool DeclaredToDevice_last = logger.isTaskDeclared();
static double SupplyBatteryVoltage_last = XCSoarInterface::Basic().SupplyBatteryVoltage;
static int PDABatteryPercent_last = PDABatteryPercent;
if (first ||
(extGPSCONNECT_last != XCSoarInterface::Basic().Connected) ||
(NAVWarning_last != XCSoarInterface::Basic().NAVWarning) ||
(SatellitesUsed_last != XCSoarInterface::Basic().SatellitesUsed) ||
(VarioAvailable_last != XCSoarInterface::Basic().VarioAvailable) ||
(FLARM_Available_last != XCSoarInterface::Basic().FLARM_Available) ||
(LoggerActive_last != logger.isLoggerActive()) ||
(DeclaredToDevice_last != logger.isTaskDeclared()) ||
(SupplyBatteryVoltage_last != XCSoarInterface::Basic().SupplyBatteryVoltage) ||
(PDABatteryPercent_last != PDABatteryPercent)) {
first = false;
extGPSCONNECT_last = XCSoarInterface::Basic().Connected;
NAVWarning_last = XCSoarInterface::Basic().NAVWarning;
SatellitesUsed_last = XCSoarInterface::Basic().SatellitesUsed;
VarioAvailable_last = XCSoarInterface::Basic().VarioAvailable;
FLARM_Available_last = XCSoarInterface::Basic().FLARM_Available;
LoggerActive_last = logger.isLoggerActive();
DeclaredToDevice_last = logger.isTaskDeclared();
SupplyBatteryVoltage_last = XCSoarInterface::Basic().SupplyBatteryVoltage;
PDABatteryPercent_last = PDABatteryPercent;
} else {
return;
}
TCHAR Temp[80];
TCHAR Temp2[80];
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpGPS"));
if (wp) {
if (XCSoarInterface::Basic().Connected) {
if (XCSoarInterface::Basic().NAVWarning) {
wp->SetText(gettext(TEXT("Fix invalid")));
} else {
if (XCSoarInterface::Basic().SatellitesUsed==0) {
wp->SetText(gettext(TEXT("No fix")));
} else {
wp->SetText(gettext(TEXT("3D fix")));
}
}
wp->RefreshDisplay();
wp = (WndProperty*)wf->FindByName(TEXT("prpNumSat"));
if (wp) {
if (XCSoarInterface::Basic().SatellitesUsed >= 0) { // known numer of sats
_stprintf(Temp,TEXT("%d"),XCSoarInterface::Basic().SatellitesUsed);
} else { // valid but unknown number of sats
_stprintf(Temp,TEXT(">3"));
}
wp->SetText(Temp);
wp->RefreshDisplay();
}
} else {
wp->SetText(gettext(TEXT("Disconnected")));
wp->RefreshDisplay();
}
}
wp = (WndProperty*)wf->FindByName(TEXT("prpVario"));
if (wp) {
if (XCSoarInterface::Basic().VarioAvailable) {
wp->SetText(gettext(TEXT("Connected")));
} else {
wp->SetText(gettext(TEXT("Disconnected")));
}
wp->RefreshDisplay();
}
if (wp) {
wp = (WndProperty*)wf->FindByName(TEXT("prpFLARM"));
if (XCSoarInterface::Basic().FLARM_Available) {
wp->SetText(gettext(TEXT("Connected")));
} else {
wp->SetText(gettext(TEXT("Disconnected")));
}
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpLogger"));
if (wp) {
logger.LinkGRecordDLL();
if (logger.LoggerGActive()) {
if (logger.isLoggerActive()) {
wp->SetText(gettext(TEXT("ON (G)")));
} else {
wp->SetText(gettext(TEXT("OFF (G)")));
}
//.........这里部分代码省略.........
示例4: OnSaveClicked
static void OnSaveClicked(WindowControl * Sender, WndListFrame::ListInfo_t *ListInfo){
(void)ListInfo; (void)Sender;
int file_index;
TCHAR task_name[MAX_PATH];
TCHAR file_name[MAX_PATH];
WndProperty* wp;
DataFieldFileReader *dfe;
wp = (WndProperty*)wf->FindByName(TEXT("prpFile"));
if (!wp) return;
dfe = (DataFieldFileReader*)wp->GetDataField();
file_index = dfe->GetAsInteger();
// if (file_index==0) {
if (1) {
// TODO enhancement: suggest a good new name not already in the list
_tcscpy(task_name,TEXT("NEW")); // 091216 era 0
dlgTextEntryShowModal(task_name, 10); // max length
if (_tcslen(task_name)>0) {
_tcscat(task_name, TEXT(LKS_TSK));
#if (!defined(WINDOWSPC) || (WINDOWSPC <=0) )
LocalPath(file_name,TEXT(LKD_TASKS));
_tcscat(file_name,TEXT("\\"));
_tcscat(file_name,task_name); // 091101
#else
SHGetSpecialFolderPath(hWndMainWindow, file_name, CSIDL_PERSONAL, false);
_tcscat(file_name,TEXT("\\"));
_tcscat(file_name,TEXT(XCSDATADIR));
_tcscat(file_name,_T("\\"));
_tcscat(file_name,TEXT(LKD_TASKS)); // 091101
_tcscat(file_name,_T("\\"));
_tcscat(file_name,task_name); // 091101
#endif
dfe->Lookup(file_name);
file_index = dfe->GetAsInteger();
if (file_index==0) {
// good, this file is unique..
dfe->addFile(task_name, file_name);
dfe->Lookup(file_name);
wp->RefreshDisplay();
}
} else {
// TODO code: report error, task not saved since no name was given
return;
}
}
if (file_index>0) {
// file already exists! ask if want to overwrite
_stprintf(file_name, TEXT("%s: '%s'"),
// LKTOKEN [email protected]_ = "Task file already exists"
gettext(TEXT("[email protected]_")),
dfe->GetAsString());
if(MessageBoxX(hWndMapWindow,
file_name,
// LKTOKEN [email protected]_ = "Overwrite?"
gettext(TEXT("[email protected]_")),
MB_YESNO|MB_ICONQUESTION) != IDYES) {
return;
}
}
SaveTask(dfe->GetPathFile());
UpdateCaption();
}
示例5: setVariables
static void setVariables(void) {
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpIP11"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP11);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP12"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP12);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP13"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP13);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP14"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP14);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP15"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP15);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP16"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP16);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP17"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP17);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP21"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP21);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP22"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP22);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP23"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP23);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP24"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP24);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP31"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP31);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP32"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP32);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpIP33"));
if (wp) {
DataFieldBoolean * dfb = (DataFieldBoolean*) wp->GetDataField();
dfb->Set(ConfIP33);
wp->RefreshDisplay();
}
}
示例6: FillAllAudioEnums
static void
FillEnums(void)
{
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(_T("prpBaudRateA"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T("Auto"));
dfe->addEnumText(_T("4800"));
dfe->addEnumText(_T("9600"));
dfe->addEnumText(_T("19200"));
dfe->addEnumText(_T("38400"));
dfe->addEnumText(_T("57600"));
dfe->addEnumText(_T("115200"));
dfe->Set(0);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpHasTemperature"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T("Off"));
dfe->addEnumText(_T("On"));
dfe->addEnumText(_T("AUTO"));
dfe->Set(0);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpToneClimbComparisonType"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T("None"));
dfe->addEnumText(_T("Gross>MacCready"));
dfe->addEnumText(_T("Gross>Average"));
dfe->Set(0);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpToneCruiseLiftDetectionType"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T("Disabled"));
dfe->addEnumText(_T("Relative>0"));
dfe->addEnumText(_T("Relative>MacCready/2"));
dfe->addEnumText(_T("Gross>0"));
dfe->addEnumText(_T("Net>MacCready/2"));
dfe->addEnumText(_T("Relative>MacCready"));
dfe->addEnumText(_T("Net>MacCready"));
dfe->Set(0);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpVarioTimeConstantCircling"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T(" 1.0s"));
dfe->addEnumText(_T(" 1.3s"));
dfe->addEnumText(_T(" 1.8s"));
dfe->addEnumText(_T(" 2.7s"));
dfe->Set(0);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpVarioTimeConstantCruise"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T(" 1.0s"));
dfe->addEnumText(_T(" 1.3s"));
dfe->addEnumText(_T(" 1.8s"));
dfe->addEnumText(_T(" 2.7s"));
dfe->Set(0);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpToneAveragerVarioTimeScale"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T(" 0.0s"));
dfe->addEnumText(_T(" 0.8s"));
dfe->addEnumText(_T(" 1.7s"));
dfe->addEnumText(_T(" 3.5s"));
dfe->addEnumText(_T(" 7.5s"));
dfe->addEnumText(_T("15.0s"));
dfe->addEnumText(_T("30.0s"));
dfe->Set(0);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpToneAveragerCruiseTimeScale"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
//.........这里部分代码省略.........
示例7: SetValues
static void SetValues(int indexid) {
//TCHAR *name = 0;
//TCHAR *cn = 0;
WndProperty* wp;
TCHAR buffer[80];
//TCHAR status[10];
//static TCHAR Name[MAXFLARMNAME+1];
//static TCHAR Cn[MAXFLARMCN+1];
int wlen;
if (indexid<0 || indexid>MAXTRAFFIC) {
StartupStore(_T("--- LK setvalues invalid indexid=%d%s"),indexid,NEWLINE);
// DoStatusMessage(_T("ERR-216 INVALID INDEXID"));
return;
}
if ( LKTraffic[indexid].ID <=0 || LKTraffic[indexid].Status <LKT_REAL) {
StartupStore(_T("--- LK setvalues invalid indexid=%d%s"),indexid,NEWLINE);
// DoStatusMessage(_T("ERR-217 INVALID INDEXID"));
return;
}
wp = (WndProperty*)wf->FindByName(TEXT("prpRegName"));
if (wp) {
wlen=wcslen(LKTraffic[indexid].Name);
// a ? probably
if (wlen==1) {
_stprintf(buffer,_T("%06x"),LKTraffic[indexid].ID);
buffer[MAXFLARMNAME]='\0';
} else {
LK_tcsncpy(buffer,LKTraffic[indexid].Name,MAXFLARMNAME);
ConvToUpper(buffer);
}
//name=Name;
wp->SetText(buffer);
wp->RefreshDisplay();
}
#if 0
wp = (WndProperty*)wf->FindByName(TEXT("prpStatus"));
if (wp) {
switch(LKTraffic[indexid].Status) {
case LKT_REAL:
_tcscpy(status,_T("LIVE"));
break;
case LKT_GHOST:
_tcscpy(status,_T("GHOST"));
break;
case LKT_ZOMBIE:
_tcscpy(status,_T("ZOMBIE"));
break;
default:
_tcscpy(status,_T("UNKNOWN"));
break;
}
wp->SetText(status);
wp->RefreshDisplay();
}
#endif
wp = (WndProperty*)wf->FindByName(TEXT("prpCn"));
if (wp) {
if ( _tcslen(LKTraffic[indexid].Cn) == 1 ) {
if (LKTraffic[indexid].Cn[0] == _T('?')) {
_tcscpy(buffer,_T(""));
} else {
LK_tcsncpy(buffer,LKTraffic[indexid].Cn,MAXFLARMCN);
}
} else {
LK_tcsncpy(buffer,LKTraffic[indexid].Cn,MAXFLARMCN);
}
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpDistance"));
if (wp) {
_stprintf(buffer,_T("%.1f %s"),LKTraffic[indexid].Distance*DISTANCEMODIFY, Units::GetDistanceName());
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpAltitude"));
if (wp) {
_stprintf(buffer,_T("%.0f %s"),LKTraffic[indexid].Altitude*ALTITUDEMODIFY, Units::GetAltitudeName());
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpAltDiff"));
if (wp) {
// this has to be reverted, because it is a relative altitude to us
_stprintf(buffer,_T("%+.0f %s"),(CALCULATED_INFO.NavAltitude - LKTraffic[indexid].Altitude)*ALTITUDEMODIFY*-1, Units::GetAltitudeName());
wp->SetText(buffer);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpSpeed"));
if (wp) {
_stprintf(buffer,_T("%.0f %s"),LKTraffic[indexid].Speed*SPEEDMODIFY, Units::GetHorizontalSpeedName());
wp->SetText(buffer);
wp->RefreshDisplay();
//.........这里部分代码省略.........
示例8: if
static void
Update()
{
WndProperty* wp;
TCHAR Text[100];
Angle teammateBearing = XCSoarInterface::Calculated().TeammateBearing;
double teammateRange = XCSoarInterface::Calculated().TeammateRange;
if (XCSoarInterface::SettingsComputer().TeamCodeRefWaypoint >= 0) {
double Value = (teammateBearing - XCSoarInterface::Basic().TrackBearing).
as_delta().value_degrees();
if (Value > 1)
_stprintf(Text, _T("%2.0f")_T(DEG)_T(">"), Value);
else if (Value < -1)
_stprintf(Text, _T("<%2.0f")_T(DEG), -Value);
else
_tcscpy(Text, _T("<>"));
} else {
_tcscpy(Text, _T("---"));
}
wp = (WndProperty*)wf->FindByName(_T("prpRelBearing"));
if (wp) {
wp->SetText(Text);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpBearing"));
if (wp) {
wp->GetDataField()->SetAsFloat(teammateBearing.value_degrees());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpRange"));
if (wp) {
wp->GetDataField()->SetAsFloat(Units::ToUserDistance(fixed(teammateRange)));
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpOwnCode"));
if (wp) {
_tcsncpy(Text, XCSoarInterface::Calculated().OwnTeamCode, 5);
Text[5] = '\0';
wp->SetText(Text);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpMateCode"));
if (wp) {
wp->SetText(XCSoarInterface::SettingsComputer().TeammateCode);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpFlarmLock"));
if (wp) {
wp->SetText(XCSoarInterface::SettingsComputer().TeamFlarmTracking ?
XCSoarInterface::SettingsComputer().TeamFlarmCNTarget : _T(""));
wp->RefreshDisplay();
}
}
示例9: lfv
void
InterfaceConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
const UISettings &settings = CommonInterface::GetUISettings();
RowFormWidget::Prepare(parent, rc);
AddInteger(_("Text size"),
nullptr,
_T("%d %%"), _T("%d"), 75, 200, 5,
settings.scale);
AddFile(_("Events"),
_("The Input Events file defines the menu system and how XCSoar responds to "
"button presses and events from external devices."),
ProfileKeys::InputFile, _T("*.xci\0"));
SetExpertRow(InputFile);
#ifndef HAVE_NATIVE_GETTEXT
WndProperty *wp;
wp = AddEnum(_("Language"),
_("The language options selects translations for English texts to other "
"languages. Select English for a native interface or Automatic to localise "
"XCSoar according to the system settings."));
if (wp != nullptr) {
DataFieldEnum &df = *(DataFieldEnum *)wp->GetDataField();
df.addEnumText(_("Automatic"));
df.addEnumText(_T("English"));
#ifdef HAVE_BUILTIN_LANGUAGES
for (const BuiltinLanguage *l = language_table;
l->resource != nullptr; ++l) {
StaticString<100> display_string;
display_string.Format(_T("%s (%s)"), l->name, l->resource);
df.addEnumText(l->resource, display_string);
}
#endif
LanguageFileVisitor lfv(df);
VisitDataFiles(_T("*.mo"), lfv);
df.Sort(2);
auto value_buffer = Profile::GetPath(ProfileKeys::LanguageFile);
Path value = value_buffer;
if (value.IsNull())
value = Path(_T(""));
if (value == Path(_T("none")))
df.Set(1);
else if (!value.IsEmpty() && value != Path(_T("auto"))) {
const Path base = value.GetBase();
if (base != nullptr)
df.Set(base.c_str());
}
wp->RefreshDisplay();
}
#endif /* !HAVE_NATIVE_GETTEXT */
AddTime(_("Menu timeout"),
_("This determines how long menus will appear on screen if the user does not make any button "
"presses or interacts with the computer."),
1, 60, 1, settings.menu_timeout / 2);
SetExpertRow(MenuTimeout);
static constexpr StaticEnumChoice text_input_list[] = {
{ (unsigned)DialogSettings::TextInputStyle::Default, N_("Default") },
{ (unsigned)DialogSettings::TextInputStyle::Keyboard, N_("Keyboard") },
{ (unsigned)DialogSettings::TextInputStyle::HighScore,
N_("HighScore Style") },
{ 0 }
};
AddEnum(_("Text input style"),
_("Determines how the user is prompted for text input (filename, teamcode etc.)"),
text_input_list, (unsigned)settings.dialog.text_input_style);
SetExpertRow(TextInput);
/* on-screen keyboard doesn't work without a pointing device
(mouse or touch screen) */
SetRowVisible(TextInput, HasPointer());
#ifdef HAVE_VIBRATOR
static constexpr StaticEnumChoice haptic_feedback_list[] = {
{ (unsigned)UISettings::HapticFeedback::DEFAULT, N_("OS settings") },
{ (unsigned)UISettings::HapticFeedback::OFF, N_("Off") },
{ (unsigned)UISettings::HapticFeedback::ON, N_("On") },
{ 0 }
};
wp = AddEnum(_("Haptic feedback"),
_("Determines if haptic feedback like vibration is used."),
haptic_feedback_list, (unsigned)settings.haptic_feedback);
SetExpertRow(HapticFeedback);
#endif /* HAVE_VIBRATOR */
}
示例10: SetValues
static void SetValues(bool first=false) {
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskFinishLine"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (first) {
// LKTOKEN [email protected]_ = "Cylinder"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "Line"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "FAI Sector"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
}
dfe->Set(FinishLine);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskFinishRadius"));
if (wp) {
wp->GetDataField()->SetAsFloat(lround(FinishRadius*DISTANCEMODIFY*DISTANCE_ROUNDING)/DISTANCE_ROUNDING);
wp->GetDataField()->SetUnits(Units::GetDistanceName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskStartLine"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (first) {
// LKTOKEN [email protected]_ = "Cylinder"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "Line"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "FAI Sector"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
}
dfe->SetDetachGUI(true); // disable call to OnAATEnabled
dfe->Set(StartLine);
dfe->SetDetachGUI(false);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskStartRadius"));
if (wp) {
wp->GetDataField()->SetAsFloat(lround(StartRadius*DISTANCEMODIFY*DISTANCE_ROUNDING)/DISTANCE_ROUNDING);
wp->GetDataField()->SetUnits(Units::GetDistanceName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskFAISector"));
if (wp) {
// 110223 CAN ANYONE PLEASE CHECK WHAT THE HACK IS A BOOL FOR BILL GATES? BECAUSE IF FALSE IS -1 THEN
// WE HAVE MANY PROBLEMS! I THINK IT IS TIME TO GO BACK TO bool AND GET RID OF MS BOOLS!!
wp->SetVisible(AATEnabled==0);
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (first) {
// LKTOKEN [email protected]_ = "Cylinder"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "FAI Sector"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
dfe->addEnumText(gettext(TEXT("DAe 0.5/10")));
}
dfe->SetDetachGUI(true); // disable call to OnAATEnabled
dfe->Set(SectorType);
dfe->SetDetachGUI(false);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskSectorRadius"));
if (wp) {
wp->SetVisible(AATEnabled==0);
wp->GetDataField()->SetAsFloat(lround(SectorRadius*DISTANCEMODIFY*DISTANCE_ROUNDING)/DISTANCE_ROUNDING);
wp->GetDataField()->SetUnits(Units::GetDistanceName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpAutoAdvance"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (first) {
// LKTOKEN [email protected]_ = "Manual"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ "Auto"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "Arm"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "Arm start"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
}
dfe->Set(AutoAdvance);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMinTime"));
if (wp) {
wp->SetVisible(AATEnabled>0 && !ISPARAGLIDER);
//.........这里部分代码省略.........
示例11: AddEnum
void
WindSettingsPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
RowFormWidget::Prepare(parent, rc);
const WindSettings &settings = CommonInterface::GetComputerSettings().wind;
const MapSettings &map_settings = CommonInterface::GetMapSettings();
static constexpr StaticEnumChoice auto_wind_list[] = {
{ AUTOWIND_NONE, N_("Manual"),
N_("When the algorithm is switched off, the pilot is responsible for setting the wind estimate.") },
{ AUTOWIND_CIRCLING, N_("Circling"),
N_("Requires only a GPS source.") },
{ AUTOWIND_ZIGZAG, N_("ZigZag"),
N_("Requires GPS and an intelligent vario with airspeed output.") },
{ AUTOWIND_CIRCLING | AUTOWIND_ZIGZAG, N_("Both"),
N_("Use ZigZag and circling.") },
{ 0 }
};
AddEnum(_("Auto wind"),
_("This allows switching on or off the automatic wind algorithm."),
auto_wind_list, settings.GetLegacyAutoWindMode());
AddBoolean(_("Prefer external wind"),
_("If enabled, then the wind vector received from external devices overrides "
"XCSoar's internal wind calculation."),
settings.use_external_wind,
this);
if (edit_trail_drift)
AddBoolean(_("Trail drift"),
_("Determines whether the snail trail is drifted with the wind "
"when displayed in circling mode. Switched Off, "
"the snail trail stays uncompensated for wind drift."),
map_settings.trail.wind_drift_enabled);
else
AddDummy();
if (edit_manual_wind) {
SpeedVector manual_wind = CommonInterface::Calculated().GetWindOrZero();
AddReadOnly(_("Source"));
WndProperty *wp =
AddFloat(_("Speed"), _("Manual adjustment of wind speed."),
_T("%.0f %s"), _T("%.0f"),
fixed(0),
Units::ToUserWindSpeed(Units::ToSysUnit(fixed(200),
Unit::KILOMETER_PER_HOUR)),
fixed(1), false,
Units::ToUserWindSpeed(manual_wind.norm),
this);
DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
df.SetUnits(Units::GetWindSpeedName());
wp->RefreshDisplay();
wp = AddAngle(_("Direction"), _("Manual adjustment of wind direction."),
manual_wind.bearing, 5u, false,
this);
manual_modified = false;
}
if (clear_manual_button)
AddButton(_("Clear"), *this, CLEAR_MANUAL);
UpdateVector();
}
示例12: setVariables
static void setVariables(void) {
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpCustomKeyTime"));
if (wp) {
wp->GetDataField()->SetAsFloat(CustomKeyTime);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpCustomKeyModeLeftUpCorner"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
AddCustomKeyList(dfe);
dfe->Set(CustomKeyModeLeftUpCorner);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpCustomKeyModeRightUpCorner"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
AddCustomKeyList(dfe);
dfe->Set(CustomKeyModeRightUpCorner);
dfe->Set(CustomKeyModeRightUpCorner);
// if (ISPARAGLIDER) wp->SetReadOnly(true); 2.3q also PGs can use it
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpCustomKeyModeCenter"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
AddCustomKeyList(dfe);
dfe->Set(CustomKeyModeCenter);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpCustomKeyModeCenterScreen"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
AddCustomKeyList(dfe);
dfe->Set(CustomKeyModeCenterScreen);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpCustomKeyModeLeft"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
AddCustomKeyList(dfe);
dfe->Set(CustomKeyModeLeft);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpCustomKeyModeRight"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
AddCustomKeyList(dfe);
dfe->Set(CustomKeyModeRight);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpCustomKeyModeAircraftIcon"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
AddCustomKeyList(dfe);
dfe->Set(CustomKeyModeAircraftIcon);
wp->RefreshDisplay();
}
}
示例13: if
static void
SetValues()
{
LoadFormProperty(*wf, _T("Name"), global_wpt->name.c_str());
LoadFormProperty(*wf, _T("Comment"), global_wpt->comment.c_str());
WndProperty* wp;
bool sign;
unsigned dd,mm,ss;
global_wpt->location.longitude.ToDMS(dd, mm, ss, sign);
wp = (WndProperty*)wf->FindByName(_T("prpLongitudeSign"));
assert(wp != NULL);
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText((_T("W")));
dfe->addEnumText((_T("E")));
dfe->Set(sign);
wp->RefreshDisplay();
LoadFormProperty(*wf, _T("prpLongitudeD"), dd);
switch (CommonInterface::GetUISettings().coordinate_format) {
case CoordinateFormat::DDMMSS: // ("DDMMSS");
case CoordinateFormat::DDMMSS_SS: // ("DDMMSS.ss");
LoadFormProperty(*wf, _T("prpLongitudeM"), mm);
LoadFormProperty(*wf, _T("prpLongitudeS"), ss);
break;
case CoordinateFormat::DDMM_MMM: // ("DDMM.mmm");
LoadFormProperty(*wf, _T("prpLongitudeM"), mm);
LoadFormProperty(*wf, _T("prpLongitudemmm"), 1000 * fixed(ss) / 60);
break;
case CoordinateFormat::DD_DDDD: // ("DD.dddd");
LoadFormProperty(*wf, _T("prpLongitudeDDDD"),
10000 * (fixed)(mm + ss) / 3600);
break;
case CoordinateFormat::UTM:
break;
}
global_wpt->location.latitude.ToDMS(dd, mm, ss, sign);
LoadFormProperty(*wf, _T("prpLatitudeD"), dd);
wp = (WndProperty*)wf->FindByName(_T("prpLatitudeSign"));
assert(wp != NULL);
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText((_T("S")));
dfe->addEnumText((_T("N")));
dfe->Set(sign);
wp->RefreshDisplay();
wp = (WndProperty*)wf->FindByName(_T("prpLatitudeD"));
assert(wp != NULL);
wp->GetDataField()->SetAsInteger(dd);
wp->RefreshDisplay();
switch (CommonInterface::GetUISettings().coordinate_format) {
case CoordinateFormat::DDMMSS: // ("DDMMSS");
case CoordinateFormat::DDMMSS_SS: // ("DDMMSS.ss");
LoadFormProperty(*wf, _T("prpLatitudeM"), mm);
LoadFormProperty(*wf, _T("prpLatitudeS"), ss);
break;
case CoordinateFormat::DDMM_MMM: // ("DDMM.mmm");
LoadFormProperty(*wf, _T("prpLatitudeM"), mm);
LoadFormProperty(*wf, _T("prpLatitudemmm"), 1000 * fixed(ss) / 60);
break;
case CoordinateFormat::DD_DDDD: // ("DD.dddd");
LoadFormProperty(*wf, _T("prpLatitudeDDDD"),
10000 * (fixed)(mm + ss) / 3600);
break;
case CoordinateFormat::UTM:
break;
}
LoadFormProperty(*wf, _T("prpAltitude"), UnitGroup::ALTITUDE, global_wpt->elevation);
wp = (WndProperty*)wf->FindByName(_T("prpFlags"));
assert(wp != NULL);
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T("Turnpoint"));
dfe->addEnumText(_T("Airport"));
dfe->addEnumText(_T("Landpoint"));
if (global_wpt->IsAirport())
dfe->Set(1u);
else if (global_wpt->IsLandable())
dfe->Set(2u);
else
dfe->Set(0u);
wp->RefreshDisplay();
}
示例14: assert
void
TaskDefaultsConfigPanel::Init(WndForm *_wf)
{
assert(_wf != NULL);
wf = _wf;
WndProperty *wp;
const SETTINGS_COMPUTER &settings_computer = XCSoarInterface::SettingsComputer();
OrderedTask* temptask = protected_task_manager->task_blank();
temptask->set_factory(TaskBehaviour::FACTORY_RT);
wp = (WndProperty*)wf->FindByName(_T("prpStartType"));
if (wp) {
const AbstractTaskFactory::LegalPointVector point_types =
temptask->get_factory().getValidStartTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < point_types.size(); i++) {
dfe->addEnumText(OrderedTaskPointName(point_types[i]), (unsigned)point_types[i],
OrderedTaskPointDescription(point_types[i]));
if (point_types[i] == settings_computer.sector_defaults.start_type)
dfe->Set((unsigned)point_types[i]);
}
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpStartRadius"), ugDistance,
settings_computer.sector_defaults.start_radius);
wp = (WndProperty*)wf->FindByName(_T("prpFinishType"));
if (wp) {
const AbstractTaskFactory::LegalPointVector point_types =
temptask->get_factory().getValidFinishTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < point_types.size(); i++) {
dfe->addEnumText(OrderedTaskPointName(point_types[i]), (unsigned)point_types[i],
OrderedTaskPointDescription(point_types[i]));
if (point_types[i] == settings_computer.sector_defaults.finish_type)
dfe->Set((unsigned)point_types[i]);
}
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpFinishRadius"), ugDistance,
settings_computer.sector_defaults.finish_radius);
wp = (WndProperty*)wf->FindByName(_T("prpTurnpointType"));
if (wp) {
const AbstractTaskFactory::LegalPointVector point_types =
temptask->get_factory().getValidIntermediateTypes();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < point_types.size(); i++) {
dfe->addEnumText(OrderedTaskPointName(point_types[i]),
(unsigned)point_types[i],
OrderedTaskPointDescription(point_types[i]));
if (point_types[i] == settings_computer.sector_defaults.turnpoint_type) {
dfe->Set((unsigned)point_types[i]);
}
}
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpTurnpointRadius"), ugDistance,
settings_computer.sector_defaults.turnpoint_radius);
wp = (WndProperty*)wf->FindByName(_T("prpTaskType"));
if (wp) {
const std::vector<TaskBehaviour::Factory_t> factory_types =
temptask->get_factory_types();
DataFieldEnum* dfe = (DataFieldEnum*)wp->GetDataField();
dfe->EnableItemHelp(true);
for (unsigned i = 0; i < factory_types.size(); i++) {
dfe->addEnumText(OrderedTaskFactoryName(factory_types[i]),
(unsigned)factory_types[i], OrderedTaskFactoryDescription(
factory_types[i]));
if (factory_types[i] == settings_computer.task_type_default)
dfe->Set((unsigned)factory_types[i]);
}
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpAATMinTime"),
(unsigned)(settings_computer.ordered_defaults.aat_min_time / 60));
LoadFormProperty(*wf, _T("prpAATTimeMargin"),
(unsigned)(settings_computer.optimise_targets_margin / 60));
delete temptask;
}
示例15: SetValues
static void SetValues(void) {
WndProperty* wp;
bool sign;
int dd,mm,ss;
Units::LongitudeToDMS(global_wpt->Location.Longitude,
&dd, &mm, &ss, &sign);
wp = (WndProperty*)wf->FindByName(_T("prpLongitudeSign"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText((_T("W")));
dfe->addEnumText((_T("E")));
dfe->Set(sign);
wp->RefreshDisplay();
}
LoadFormProperty(*wf, _T("prpLongitudeD"), dd);
switch (Units::GetCoordinateFormat()) {
case 0: // ("DDMMSS");
case 1: // ("DDMMSS.ss");
LoadFormProperty(*wf, _T("prpLongitudeM"), mm);
LoadFormProperty(*wf, _T("prpLongitudeS"), ss);
break;
case 2: // ("DDMM.mmm");
LoadFormProperty(*wf, _T("prpLongitudeM"), mm);
LoadFormProperty(*wf, _T("prpLongitudemmm"), 1000 * fixed(ss) / 60);
break;
case 3: // ("DD.dddd");
LoadFormProperty(*wf, _T("prpLongitudeDDDD"),
10000 * (fixed)(mm + ss) / 3600);
break;
}
Units::LatitudeToDMS(global_wpt->Location.Latitude,
&dd, &mm, &ss, &sign);
LoadFormProperty(*wf, _T("prpLatitudeD"), dd);
wp = (WndProperty*)wf->FindByName(_T("prpLatitudeSign"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText((_T("S")));
dfe->addEnumText((_T("N")));
dfe->Set(sign);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpLatitudeD"));
if (wp) {
wp->GetDataField()->SetAsInteger(dd);
wp->RefreshDisplay();
}
switch (Units::GetCoordinateFormat()) {
case 0: // ("DDMMSS");
case 1: // ("DDMMSS.ss");
LoadFormProperty(*wf, _T("prpLatitudeM"), mm);
LoadFormProperty(*wf, _T("prpLatitudeS"), ss);
break;
case 2: // ("DDMM.mmm");
LoadFormProperty(*wf, _T("prpLatitudeM"), mm);
LoadFormProperty(*wf, _T("prpLatitudemmm"), 1000 * fixed(ss) / 60);
break;
case 3: // ("DD.dddd");
LoadFormProperty(*wf, _T("prpLatitudeDDDD"),
10000 * (fixed)(mm + ss) / 3600);
break;
}
wp = (WndProperty*)wf->FindByName(_T("prpAltitude"));
if (wp) {
wp->GetDataField()->SetAsInteger(iround(
Units::ToUserUnit(global_wpt->Altitude, Units::AltitudeUnit)));
wp->GetDataField()->SetUnits(Units::GetAltitudeName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(_T("prpFlags"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
dfe->addEnumText(_T("Turnpoint"));
dfe->addEnumText(_T("Airport"));
dfe->addEnumText(_T("Landpoint"));
if (global_wpt->Flags.Airport) {
dfe->Set(1);
} else if (global_wpt->Flags.LandPoint) {
dfe->Set(2);
} else {
dfe->Set(0);
}
wp->RefreshDisplay();
}
}