本文整理汇总了C++中LockTaskData函数的典型用法代码示例。如果您正苦于以下问题:C++ LockTaskData函数的具体用法?C++ LockTaskData怎么用?C++ LockTaskData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LockTaskData函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ClearTask
void ClearTask(void) {
LockTaskData();
TaskModified = true;
TargetModified = true;
if (ISPARAGLIDER) PGOptimizeRoute = PGOptimizeRoute_Config;
LastTaskFileName[0] = _T('\0');
ActiveWayPoint = -1;
EnableMultipleStartPoints = false;
std::for_each(std::begin(Task), std::end(Task), ResetTaskWpt);
std::for_each(std::begin(TaskStats), std::end(TaskStats), ResetTaskStat);
std::for_each(std::begin(StartPoints), std::end(StartPoints), ResetStartPoint);
UnlockTaskData();
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:17,代码来源:ClearTask.cpp
示例2: LKASSERT
/**
* @brief Sets requested zoom scale for AUTO_ZOOM mode
*/
void MapWindow::Zoom::CalculateAutoZoom()
{
static int autoMapScaleWaypointIndex = -1;
static int wait_for_new_wpt_distance = 0;
double wpd = DerivedDrawInfo.ZoomDistance;
if (wait_for_new_wpt_distance>0) wait_for_new_wpt_distance--; //This counter is needed to get new valid waypoint distance after wp changes
if ( (wpd > 0) && (wait_for_new_wpt_distance==0) ) {
double AutoZoomFactor;
if( (DisplayOrientation == NORTHTRACK && !mode.Is(Mode::MODE_CIRCLING)) ||
DisplayOrientation == NORTHUP ||
DisplayOrientation == NORTHSMART ||
((DisplayOrientation == NORTHCIRCLE || DisplayOrientation == TRACKCIRCLE) && mode.Is(Mode::MODE_CIRCLING)) )
AutoZoomFactor = 2.5;
else
AutoZoomFactor = 4;
if ( ( !ISPARAGLIDER && (wpd < AutoZoomFactor * _scaleOverDistanceModify) ) ||
( ISPARAGLIDER && (wpd < PGAutoZoomThreshold)) ) {
// waypoint is too close, so zoom in
LKASSERT(AutoZoomFactor!=0);
_modeScale[SCALE_CRUISE] = LimitMapScale(wpd * DISTANCEMODIFY / AutoZoomFactor);
}
}
LockTaskData(); // protect from external task changes
// if we aren't looking at a waypoint, see if we are now
if(autoMapScaleWaypointIndex == -1) {
if(ValidTaskPoint(ActiveWayPoint))
autoMapScaleWaypointIndex = Task[ActiveWayPoint].Index;
}
if(ValidTaskPoint(ActiveWayPoint)) {
// if the current zoom focused waypoint has changed...
if(autoMapScaleWaypointIndex != Task[ActiveWayPoint].Index) {
autoMapScaleWaypointIndex = Task[ActiveWayPoint].Index;
wait_for_new_wpt_distance = 3;
// zoom back out to where we were before
_modeScale[SCALE_CRUISE] = _modeScale[SCALE_AUTO_ZOOM];
}
}
{
UnlockTaskData();
}
}
开发者ID:Acrobot,项目名称:LK8000,代码行数:48,代码来源:MapWindowZoom.cpp
示例3: OnRemoveClicked
static void OnRemoveClicked(WndButton* pWnd) {
LockTaskData();
RemoveTaskPoint(twItemIndex);
SetWaypointValues();
if (ActiveTaskPoint>=twItemIndex) {
ActiveTaskPoint--;
}
if (ActiveTaskPoint<0) {
ActiveTaskPoint= -1;
}
UnlockTaskData();
if(pWnd) {
WndForm * pForm = pWnd->GetParentWndForm();
if(pForm) {
pForm->SetModalResult(mrOK);
}
}
}
开发者ID:LK8000,项目名称:LK8000,代码行数:18,代码来源:dlgTaskWaypoint.cpp
示例4: OnSelectClicked
static void OnSelectClicked(WindowControl * Sender){
(void)Sender;
int res;
res = dlgWayPointSelect();
if (res != -1){
SelectedWaypoint = res;
if (Task[twItemIndex].Index != res) {
if (CheckDeclaration()) {
LockTaskData();
ResetTaskWaypoint(twItemIndex);
Task[twItemIndex].Index = res;
TaskModified = true;
UnlockTaskData();
}
}
UpdateCaption();
};
}
开发者ID:Acrobot,项目名称:LK8000,代码行数:18,代码来源:dlgTaskWaypoint.cpp
示例5: dlgStartPointShowModal
void dlgStartPointShowModal(void) {
ItemIndex = -1;
wf = dlgLoadFromXML(CallBackTable,
ScreenLandscape ? TEXT("dlgStartPoint_L.xml") : TEXT("dlgStartPoint_P.xml"),
ScreenLandscape ? IDR_XML_STARTPOINT_L : IDR_XML_STARTPOINT_P);
if (!wf) return;
//ASSERT(wf!=NULL);
CheckStartPointInTask();
wStartPointList = (WndListFrame*)wf->FindByName(TEXT("frmStartPointList"));
//ASSERT(wStartPointList!=NULL);
wStartPointList->SetBorderKind(BORDERLEFT);
wStartPointList->SetEnterCallback(OnStartPointListEnter);
wStartPointListEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmStartPointListEntry"));
//ASSERT(wStartPointListEntry!=NULL);
wStartPointListEntry->SetCanFocus(true);
UpdateList();
changed = false;
wf->ShowModal();
// now retrieve back the properties...
if (changed) {
LockTaskData();
TaskModified = true;
RefreshTask();
UnlockTaskData();
};
delete wf;
wf = NULL;
}
开发者ID:PhilColbert,项目名称:LK8000,代码行数:44,代码来源:dlgStartPoint.cpp
示例6: OnSelectClicked
static void OnSelectClicked(WndButton* pWnd){
int res;
res = dlgWayPointSelect();
if (res != -1){
SelectedWaypoint = res;
LKASSERT(twItemIndex>=0);
if (Task[twItemIndex].Index != res) {
if (CheckDeclaration()) {
LockTaskData();
ResetTaskWaypoint(twItemIndex);
Task[twItemIndex].Index = res;
Task[twItemIndex].PGConeBase = WayPointList[res].Altitude;
TaskModified = true;
UnlockTaskData();
}
}
UpdateCaption();
};
}
开发者ID:LK8000,项目名称:LK8000,代码行数:19,代码来源:dlgTaskWaypoint.cpp
示例7: LockTaskData
double AATDistance::DistanceCovered_internal(double longitude,
double latitude,
bool insector) {
double achieved;
if (!ValidTaskPoint(ActiveTaskPoint) || (ActiveTaskPoint==0)) {
// max_achieved_distance = 0;
return 0.0;
}
LockTaskData();
if (insector) {
achieved = DistanceCovered_inside(longitude, latitude);
} else {
achieved = DistanceCovered_outside(longitude, latitude);
}
UnlockTaskData();
// max_achieved_distance = max(achieved, max_achieved_distance);
return achieved;
}
开发者ID:LK8000,项目名称:LK8000,代码行数:19,代码来源:AATDistance.cpp
示例8: ResetScale
void Statistics::RenderBarograph(HDC hdc, RECT rc)
{
ResetScale();
ScaleXFromData(rc, &flightstats.Altitude);
ScaleYFromData(rc, &flightstats.Altitude);
ScaleXFromData(rc, &flightstats.Altitude_Base);
ScaleYFromData(rc, &flightstats.Altitude_Base);
ScaleXFromData(rc, &flightstats.Altitude_Ceiling);
ScaleYFromData(rc, &flightstats.Altitude_Ceiling);
DrawXGrid(hdc, rc,
0.25, flightstats.Altitude.x_min,
STYLE_THINDASHPAPER);
DrawYGrid(hdc, rc, 1000/ALTITUDEMODIFY, 0, STYLE_THINDASHPAPER);
DrawLineGraph(hdc, rc, &flightstats.Altitude,
STYLE_MEDIUMBLACK);
LockTaskData();
for(int j=0;j<MAXTASKPOINTS;j++) {
if (ValidTaskPoint(j) && (LegStartTime[j]>=0)) {
double xx = (LegStartTime[j]-Calculated->TakeOffTime)/3600;
if (xx>=0) {
DrawLine(hdc, rc,
xx, flightstats.Altitude.y_min,
xx, flightstats.Altitude.y_max,
STYLE_THINDASHPAPER);
}
}
}
UnlockTaskData();
DrawTrend(hdc, rc, &flightstats.Altitude_Base, STYLE_BLUETHIN);
DrawTrend(hdc, rc, &flightstats.Altitude_Ceiling, STYLE_BLUETHIN);
DrawXLabel(hdc, rc, TEXT("t"));
DrawYLabel(hdc, rc, TEXT("h"));
}
开发者ID:JanezKolar,项目名称:LK8000,代码行数:42,代码来源:Statistics.cpp
示例9: LockTaskData
/*
* Currently even if set for FIVV, colors are not used.
*/
TCHAR *FormatterAlternate::Render(int *color) {
//int active=ActiveAlternate; REMOVE
LockTaskData();
if(Valid && ValidWayPoint(ActiveAlternate)) {
switch (WayPointCalc[ActiveAlternate].VGR ) {
case 0:
// impossible, give a magenta debug color;
*color = 5;
break;
case 1:
#ifdef FIVV
*color = 0; // green
#else
*color = 0; // blue
#endif
break;
case 2:
#ifdef FIVV
*color = 0; // yellow 4
#else
*color = 0; // normale white
#endif
break;
case 3:
*color = 1; // red
break;
default:
// even more impossible, give debug color magenta
*color = 5;
break;
}
// Value=WayPointCalc[ActiveAlternate].GR; BUGFIX 090918
_stprintf(Text,Format,Value);
} else {
Valid = false;
RenderInvalid(color);
}
UnlockTaskData();
return(Text);
}
开发者ID:jarda-manana,项目名称:LK8000,代码行数:45,代码来源:Process.cpp
示例10: FlyDirectTo
void FlyDirectTo(int index) {
if (!CheckDeclaration())
return;
LockTaskData();
TaskModified = true;
TargetModified = true;
ActiveWayPoint = -1;
AATEnabled = FALSE;
InsertRecentList(index);
Task[0].Index = index;
for (int i=1; i<=MAXTASKPOINTS; i++) {
Task[i].Index = -1;
}
ActiveWayPoint = 0;
RefreshTask();
UnlockTaskData();
}
开发者ID:Turbo87,项目名称:LK8000,代码行数:22,代码来源:FlyDirectTo.cpp
示例11: OnStartPointListEnter
static void OnStartPointListEnter(WindowControl * Sender,
WndListFrame::ListInfo_t *ListInfo) {
(void)Sender;
ItemIndex = ListInfo->ItemIndex + ListInfo->ScrollIndex;
if (ItemIndex>=MAXSTARTPOINTS) {
ItemIndex = -1;
while(ValidStartPoint(ItemIndex++)) { }
}
if (ItemIndex>=0) {
int res;
res = dlgWayPointSelect();
if (res>=0) {
// TODO bug: don't add it if it's already present!
LockTaskData();
StartPoints[ItemIndex].Index = res;
StartPoints[ItemIndex].Active = true;
UnlockTaskData();
changed = true;
UpdateList();
}
}
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:22,代码来源:dlgStartPoint.cpp
示例12: CorrectSide
// Are we on the correct side of start cylinder?
bool CorrectSide() {
// Remember that IsInSector works reversed...
#if DEBUGTGATES
StartupStore(_T("CorrectSide: PGstartout=%d InSector=%d\n"),PGStartOut,CALCULATED_INFO.IsInSector);
#endif
if (ActiveWayPoint==0 && PGStartOut && CALCULATED_INFO.IsInSector)
return false;
if (ActiveWayPoint==0 && !PGStartOut && !CALCULATED_INFO.IsInSector)
return false;
LockTaskData();
bool ExitWpt = Task[ActiveWayPoint].OutCircle;
UnlockTaskData();
if (ExitWpt==0 && PGStartOut && CALCULATED_INFO.IsInSector)
return false;
if (ExitWpt==0 && !PGStartOut && !CALCULATED_INFO.IsInSector)
return false;
return true;
}
开发者ID:eonezhang,项目名称:LK8000,代码行数:23,代码来源:TimeGates.cpp
示例13: OnSelectClicked
static void OnSelectClicked(WindowControl * Sender){
(void)Sender;
int res;
res = dlgWayPointSelect();
if (res != -1){
SelectedWaypoint = res;
if (Task[twItemIndex].Index != res) {
if (CheckDeclaration()) {
LockTaskData();
Task[twItemIndex].Index = res;
Task[twItemIndex].AATTargetOffsetRadius = 0.0;
Task[twItemIndex].AATTargetOffsetRadial = 0.0;
Task[twItemIndex].AATSectorRadius = SectorRadius;
Task[twItemIndex].AATCircleRadius = SectorRadius;
Task[twItemIndex].AATTargetLocked = false;
TaskModified = true;
UnlockTaskData();
}
}
UpdateCaption();
};
}
开发者ID:miza,项目名称:LK8000,代码行数:22,代码来源:dlgTaskWaypoint.cpp
示例14: CalculateOptimizedTargetPos
void CalculateOptimizedTargetPos(NMEA_INFO *Basic, DERIVED_INFO *Calculated) {
if (!DoOptimizeRoute())
return;
LockTaskData();
gPGTask.Optimize(Basic, Calculated);
for(size_t i=0; i<gPGTask.Count(); ++i) {
gPGTask.UpdateTaskPoint(i, Task[i]);
}
int stdwp=Task[ActiveTaskPoint].Index;
WayPointList[RESWP_OPTIMIZED].Latitude = Task[ActiveTaskPoint].AATTargetLat;
WayPointList[RESWP_OPTIMIZED].Longitude = Task[ActiveTaskPoint].AATTargetLon;
WayPointList[RESWP_OPTIMIZED].Altitude = Task[ActiveTaskPoint].AATTargetAltitude;
_stprintf(WayPointList[RESWP_OPTIMIZED].Name, _T("!%s"),WayPointList[stdwp].Name);
UnlockTaskData();
}
开发者ID:PhilColbert,项目名称:LK8000,代码行数:23,代码来源:OptimizedTargetPos.cpp
示例15: ClearOptimizedTargetPos
// Clear PG
void ClearOptimizedTargetPos() {
if (!DoOptimizeRoute())
return;
LockTaskData();
WayPointList[RESWP_OPTIMIZED].Latitude=RESWP_INVALIDNUMBER;
WayPointList[RESWP_OPTIMIZED].Longitude=RESWP_INVALIDNUMBER;
WayPointList[RESWP_OPTIMIZED].Altitude=RESWP_INVALIDNUMBER;
// name will be assigned by function dynamically
_tcscpy(WayPointList[RESWP_OPTIMIZED].Name, _T("OPTIMIZED") );
for(int i = 0; ValidWayPoint(Task[i].Index); ++i) {
Task[i].AATTargetLat = WayPointList[Task[i].Index].Latitude;
Task[i].AATTargetLon = WayPointList[Task[i].Index].Longitude;
Task[i].AATTargetAltitude = WayPointList[Task[i].Index].Altitude;
Task[i].AATTargetLocked = false;
}
gPGTask.Initialize();
UnlockTaskData();
}
开发者ID:PhilColbert,项目名称:LK8000,代码行数:25,代码来源:OptimizedTargetPos.cpp
示例16: _T
/**
* @brief Returns task file name
*
* Function obtains task file path and strips the directory part and file
* extension from it.
*
* @param bufferLen The length of the buffer
* @param buffer Buffer for the task file name
*
* @return Buffer with filled data
*/
const TCHAR *TaskFileName(unsigned bufferLen, TCHAR buffer[])
{
TCHAR name[MAX_PATH] = { _T('\0') };
#if BUGSTOP
LKASSERT(buffer!=NULL);
#endif
if (buffer==NULL) return NULL;
LockTaskData();
int len = _tcslen(LastTaskFileName);
if(len > 0) {
int index = 0;
TCHAR *src = LastTaskFileName;
while ((*src != _T('\0')) && (*src != _T('.'))) {
if ((*src == _T('\\')) || (*src == _T('/'))) {
index = 0;
}
else {
name[index] = *src;
index++;
}
src++;
}
name[index] = _T('\0');
}
UnlockTaskData();
_tcsncpy(buffer, name, bufferLen);
#if BUGSTOP
LKASSERT(bufferLen>0);
#endif
if (bufferLen>0)
buffer[bufferLen - 1] = _T('\0');
return buffer;
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:47,代码来源:LKUtils.cpp
示例17: dlgStartPointShowModal
void dlgStartPointShowModal(void) {
ItemIndex = -1;
if (!ScreenLandscape) {
TCHAR filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgStartPoint_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
TEXT("IDR_XML_STARTPOINT_L"));
} else {
TCHAR filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgStartPoint.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
TEXT("IDR_XML_STARTPOINT"));
}
if (!wf) return;
//ASSERT(wf!=NULL);
CheckStartPointInTask();
wStartPointList = (WndListFrame*)wf->FindByName(TEXT("frmStartPointList"));
//ASSERT(wStartPointList!=NULL);
wStartPointList->SetBorderKind(BORDERLEFT);
wStartPointList->SetEnterCallback(OnStartPointListEnter);
wStartPointList->SetWidth(wf->GetWidth() - wStartPointList->GetLeft()-2);
wStartPointListEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmStartPointListEntry"));
if ( wStartPointList->ScrollbarWidth == -1) {
#if defined (PNA)
#define SHRINKSBFACTOR 1.0 // shrink width factor. Range .1 to 1 where 1 is very "fat"
#else
#define SHRINKSBFACTOR 0.75 // shrink width factor. Range .1 to 1 where 1 is very "fat"
#endif
wStartPointList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale * SHRINKSBFACTOR);
}
wStartPointListEntry->SetWidth(wStartPointList->GetWidth() - wStartPointList->ScrollbarWidth - 5);
//ASSERT(wStartPointListEntry!=NULL);
wStartPointListEntry->SetCanFocus(true);
UpdateList();
changed = false;
wf->ShowModal();
// now retrieve back the properties...
if (changed) {
LockTaskData();
TaskModified = true;
RefreshTask();
UnlockTaskData();
};
delete wf;
wf = NULL;
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:64,代码来源:dlgStartPoint.cpp
示例18: ReadValues
static void ReadValues(void) {
WndProperty* wp;
bool changed = false;
LockTaskData();
wp = (WndProperty*)wf->FindByName(TEXT("prpEnableMultipleStartPoints"));
if (wp) {
CHECK_CHANGED(EnableMultipleStartPoints,
wp->GetDataField()->GetAsBoolean());
}
wp = (WndProperty*)wf->FindByName(TEXT("prpAATEnabled"));
if (wp) {
CHECK_CHANGED(AATEnabled,
wp->GetDataField()->GetAsInteger());
if (DoOptimizeRoute()) AATEnabled=true; // force it on
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskFinishLine"));
if (wp) {
CHECK_CHANGED(FinishLine,
wp->GetDataField()->GetAsInteger());
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskFinishRadius"));
if (wp) {
CHECK_CHANGED(FinishRadius,
(DWORD)iround(wp->GetDataField()->GetAsFloat()
/DISTANCEMODIFY));
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskStartLine"));
if (wp) {
CHECK_CHANGED(StartLine,
wp->GetDataField()->GetAsInteger());
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskStartRadius"));
if (wp) {
CHECK_CHANGED(StartRadius,
(DWORD)iround(wp->GetDataField()->GetAsFloat()
/DISTANCEMODIFY));
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskFAISector"));
if (wp) {
CHECK_CHANGED(SectorType,
wp->GetDataField()->GetAsInteger());
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskSectorRadius"));
if (wp) {
CHECK_CHANGED(SectorRadius,
(DWORD)iround(wp->GetDataField()->GetAsFloat()
/DISTANCEMODIFY));
}
wp = (WndProperty*)wf->FindByName(TEXT("prpAutoAdvance"));
if (wp) {
CHECK_CHANGED(AutoAdvance,
wp->GetDataField()->GetAsInteger());
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMinTime"));
if (wp) {
CHECK_CHANGED(AATTaskLength,
wp->GetDataField()->GetAsInteger());
if (changed) CALCULATED_INFO.AATTimeToGo=AATTaskLength*60;
}
if (changed) {
TaskModified = true;
}
UnlockTaskData();
}
开发者ID:Acrobot,项目名称:LK8000,代码行数:76,代码来源:dlgTaskWaypoint.cpp
示例19: OnTaskPaintListItem
static void OnTaskPaintListItem(WindowControl * Sender, LKSurface& Surface){
int n = UpLimit - LowLimit;
TCHAR sTmp[120];
TCHAR wpName[120];
TCHAR landableStr[5] = TEXT(" [X]");
// LKTOKEN [email protected]_ "L"
landableStr[2] = MsgToken(1238)[0];
LockTaskData();
const PixelRect rcClient(Sender->GetClientRect());
const int w0 = rcClient.GetSize().cx - DLGSCALE(1);
const int w1 = Surface.GetTextWidth(TEXT(" 000km"));
_stprintf(sTmp, _T(" 000%s"), MsgToken(2179));
const int w2 = Surface.GetTextWidth(sTmp);
const int TextMargin = (rcClient.GetSize().cy - Surface.GetTextHeight(TEXT("A"))) / 2;
const int p1 = w0-w1-w2- rcClient.GetSize().cy - DLGSCALE(2);
const int p2 = w0-w2- rcClient.GetSize().cy - DLGSCALE(2);
const PixelRect rc = {
0,
0,
rcClient.GetSize().cy,
rcClient.GetSize().cy
};
if (DrawListIndex < n){
int i = LowLimit + DrawListIndex;
// if ((WayPointList[Task[i].Index].Flags & LANDPOINT) >0)
// MapWindow::DrawRunway(hDC, &WayPointList[Task[i].Index], rc, 3000,true);
MapWindow::DrawTaskPicto(Surface, DrawListIndex, rc, 2500);
if (Task[i].Index>=0) {
_stprintf(wpName, TEXT("%s%s"),
WayPointList[Task[i].Index].Name,
(WayPointList[Task[i].Index].Flags & LANDPOINT) ? landableStr : TEXT(""));
if (AATEnabled && ValidTaskPoint(i+1) && (i>0)) {
if (Task[i].AATType==0 || Task[i].AATType==3) {
_stprintf(sTmp, TEXT("%s %.1f"),
wpName, Task[i].AATCircleRadius*DISTANCEMODIFY);
} else {
if(Task[i].AATType==2 && DoOptimizeRoute()) {
_stprintf(sTmp, TEXT("%s %.1f/1"),
wpName, Task[i].PGConeSlope);
} else {
_stprintf(sTmp, TEXT("%s %.1f"),
wpName, Task[i].AATSectorRadius*DISTANCEMODIFY);
}
}
} else {
_stprintf(sTmp, TEXT("%s"), wpName);
}
Surface.SetBackgroundTransparent();
Surface.SetTextColor(RGB_BLACK);
Surface.DrawTextClip(rc.right + DLGSCALE(2), TextMargin, sTmp, p1-DLGSCALE(4));
_stprintf(sTmp, TEXT("%.0f %s"),Task[i].Leg*DISTANCEMODIFY,Units::GetDistanceName());
Surface.DrawText(rc.right+p1+w1-Surface.GetTextWidth(sTmp), TextMargin, sTmp);
_stprintf(sTmp, TEXT("%d%s"), iround(Task[i].InBound),MsgToken(2179));
Surface.DrawText(rc.right +p2+w2-Surface.GetTextWidth(sTmp), TextMargin, sTmp);
}
} else {
Surface.SetTextColor(RGB_BLACK);
// if (DrawListIndex==n) { // patchout 091126
if (DrawListIndex==n && UpLimit < MAXTASKPOINTS) { // patch 091126
// LKTOKEN [email protected]_ = "add waypoint"
_stprintf(sTmp, TEXT(" (%s)"), MsgToken(832));
Surface.DrawText(rc.right +DLGSCALE(2), TextMargin, sTmp);
} else if ((DrawListIndex==n+1) && ValidTaskPoint(0)) {
if (!AATEnabled || ISPARAGLIDER) {
// LKTOKEN [email protected]_ = "Total:"
Surface.DrawText(rc.right +DLGSCALE(2), TextMargin, MsgToken(735));
_stprintf(sTmp, TEXT("%.0f %s%s"), lengthtotal*DISTANCEMODIFY, Units::GetDistanceName(), fai_ok?_T(" FAI"):_T(""));
Surface.DrawText(rc.right +p1+w1-Surface.GetTextWidth(sTmp), TextMargin, sTmp);
} else {
double d1 = CALCULATED_INFO.TaskDistanceToGo;
if ((CALCULATED_INFO.TaskStartTime>0.0) && (CALCULATED_INFO.Flying) && (ActiveTaskPoint>0)) {
d1 += CALCULATED_INFO.TaskDistanceCovered;
}
if (d1==0.0) {
d1 = CALCULATED_INFO.AATTargetDistance;
}
_stprintf(sTmp, TEXT("%s %.0f min %.0f (%.0f) %s"),
// LKTOKEN [email protected]_ = "Total:"
//.........这里部分代码省略.........
开发者ID:lshachar,项目名称:LK8000,代码行数:101,代码来源:dlgTaskOverview.cpp
示例20: OnTaskListEnter
static void OnTaskListEnter(WindowControl * Sender,
WndListFrame::ListInfo_t *ListInfo) {
(void)Sender;
bool isfinish = false;
ItemIndex = ListInfo->ItemIndex+ListInfo->ScrollIndex;
// If we are clicking on Add Waypoint
if ((ItemIndex>=0) && (ItemIndex == UpLimit) && (UpLimit<MAXTASKPOINTS)) {
// add new waypoint
if (CheckDeclaration()) {
if (ItemIndex>0) {
#ifdef LAST_TASKPOINT_QUESTION
if (MessageBoxX(
// LKTOKEN [email protected]_ = "Will this be the finish?"
MsgToken(817),
// LKTOKEN [email protected]_ = "Add Waypoint"
MsgToken(54),
mbYesNo) == IdYes)
#else
if(0)
#endif
{
isfinish = true;
// Set initial wp as the finish by default, or home if nonex
LockTaskData();
// ItemIndex is already checked for > 0 no need to test twice
Task[ItemIndex].Index = Task[0].Index;
UnlockTaskData();
} else {
isfinish = false;
}
}
int res;
res = dlgWayPointSelect();
if (ValidWayPoint(res)){
LockTaskData();
ResetTaskWaypoint(ItemIndex);
Task[ItemIndex].Index = res;
Task[ItemIndex].PGConeBase = WayPointList[res].Altitude;
UnlockTaskData();
if (ItemIndex==0) {
dlgTaskWaypointShowModal(ItemIndex, 0, true); // start waypoint
} else if (isfinish) {
dlgTaskWaypointShowModal(ItemIndex, 2, true); // finish waypoint
} else {
if (AATEnabled || DoOptimizeRoute()) {
// only need to set properties for finish
dlgTaskWaypointShowModal(ItemIndex, 1, true); // normal waypoint
}
}
} // ValidWaypoint
OverviewRefreshTask();
} // CheckDeclaration
return;
} // Index==UpLimit, clicking on Add Waypoint
if (ItemIndex<UpLimit) {
if (ItemIndex==0) {
dlgTaskWaypointShowModal(ItemIndex, 0); // start waypoint
} else {
if (ItemIndex==UpLimit-1) {
dlgTaskWaypointShowModal(ItemIndex, 2); // finish waypoint
} else {
dlgTaskWaypointShowModal(ItemIndex, 1); // turnpoint
}
}
OverviewRefreshTask();
}
} // OnTaskListEnter
开发者ID:lshachar,项目名称:LK8000,代码行数:85,代码来源:dlgTaskOverview.cpp
注:本文中的LockTaskData函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论