本文整理汇总了C++中TPositionInfo类的典型用法代码示例。如果您正苦于以下问题:C++ TPositionInfo类的具体用法?C++ TPositionInfo怎么用?C++ TPositionInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TPositionInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NotifyPositionUpdate
// ---------------------------------------------------------
// CT_LbsTestTimerPsy::NotifyPositionUpdate
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsTestTimerPsy::NotifyPositionUpdate(
TPositionInfoBase& aPosInfo,
TRequestStatus& aStatus)
{
TPositionInfo* position = NULL;
position = static_cast<TPositionInfo*> (&aPosInfo);
iStatus = &aStatus;
*iStatus = KRequestPending;
TUid implUid = { KPosImplementationUid };
position->SetModuleId(implUid);
if (iTrackingEnabled)
{
// Set this position when tracking is enabled (on-going)
TCoordinate coor(55.0, 55.0, 55.0);
TLocality loc (coor, 1.0, 1.0);
TPosition pos (loc, TTime(0));
position -> SetPosition(pos);
}
else
{
// Set a dummy position
TCoordinate coor(20.0, 20.0, 20.0);
TLocality loc (coor, 1.0, 1.0);
TPosition pos (loc, TTime(0));
position -> SetPosition(pos);
User::RequestComplete(iStatus, KErrNone);
}
}
示例2: returned
/**
GetLastPosition
@param aPos container for the position being returned (with KErrNone return)
@param aOldestValidTime the oldest valid time for a position being returned. If there is a valid position no older than this time, it should be returned.
@param aAllowPartial whether partial updates should be considered
@return ETrue if the fix fulfills the requirements,
*/
TBool CNETResponseHandler::GetLastPosition(TPositionInfoBase& aPos, TTime aOldestValidTime, TBool aAllowPartial)
{
TBool ret = EFalse;
TTime actualTime;
TPositionInfo posInfo;
TPosition pos;
TInt err;
err = iNETDataBus->GetLastPositionInfo(posInfo, actualTime);
if( err == KErrNone && actualTime >= aOldestValidTime) // got a recent enough position
{
posInfo.GetPosition(pos);
if(aAllowPartial || !Partial(pos))// complete enough
{
TRAPD(error, CopyPositionTypes(aPos, posInfo));
if(!error)
{
ret = ETrue;
}
else
{
LBSLOG(ELogP1, "CNetResponseHandler::GetLastPosition() failed to copy position ");
ret = EFalse;
}
}
}
return ret;
}
示例3: latitude
//
// This test checks that a SetLastKnowPosition request
// results in a request to store a position sent to the DB
//
TVerdict CTe_LocMonitorStep11::doTestStepL()
{
if (TestStepResult()==EPass)
{
TPositionInfo positionInfo;
TPosition position;
TReal64 latitude(11), longitude(21);
position.SetCoordinate(latitude, longitude);
positionInfo.SetPosition(position);
RLbsLocMonitorSession locMonSession;
User::LeaveIfError(locMonSession.Connect());
RLbsLocMonitorAreaPositioner areaPositioner;
areaPositioner.OpenL(locMonSession);
CleanupClosePushL(areaPositioner);
iLocMonDbListener->ListenForLocMonDbFeedback();
areaPositioner.SetLastKnownPosition(positionInfo);
iLocMonDbListener->WaitForDbFeedback();
// Check that the position received by the DB is the position
// sent by the test
TESTL(latitude == iLocMonDbListener->iDbData.iPosition.Latitude());
TESTL(longitude == iLocMonDbListener->iDbData.iPosition.Longitude());
CleanupStack::PopAndDestroy(&areaPositioner);
locMonSession.Close();
}
return TestStepResult();
}
示例4: TransmitPosition
void RNrhSession::TransmitPosition(const TDesC& aDestinationId,
TUint aTransmitPriority,
TRequestStatus& aStatus,
TPositionInfo& aTransmittedPosInfo)
{
// iDestinationId is too big to fit in the buffer;
// complete the request early with an error code
if (aDestinationId.Length() > iTransmitPositionParams.iDestinationId.MaxLength())
{
TRequestStatus* status = &aStatus;
User::RequestComplete(status, KErrTooBig);
}
iTransmitPositionParams.iDestinationId = aDestinationId;
iTransmitPositionParams.iPriority = aTransmitPriority;
iTransmitPositionParams.iPositionInfoClassType = aTransmittedPosInfo.PositionClassType();
iTransmitPositionParams.iPositionInfoClassSize = aTransmittedPosInfo.PositionClassSize();
iTransmitPositionParamsPtr.Set(reinterpret_cast<TUint8*>(&iTransmitPositionParams),
sizeof(iTransmitPositionParams),
sizeof(iTransmitPositionParams));
iTransmittedPosInfoPtr.Set(reinterpret_cast<TUint8*>(&aTransmittedPosInfo),
aTransmittedPosInfo.PositionClassSize(),
aTransmittedPosInfo.PositionClassSize());
TIpcArgs args(&iTransmitPositionParamsPtr, &iTransmittedPosInfoPtr);
SendReceive(EX3pTransmitPosition, args, aStatus);
}
示例5:
// ---------------------------------------------------------
// CT_LbsInstallPsyTp273::NotifyPositionUpdate
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsInstallPsyTp273::NotifyPositionUpdate(
TPositionInfoBase& aPosInfo,
TRequestStatus& aStatus)
{
TInt err = KErrNone;
TTime tt;
tt.UniversalTime();
//Request ID must be unique, use universalime as seed
// to give a random number
TInt64 seed = tt.Int64();
TReal lat = 90 * Math::FRand(seed);
TReal lon = 90 * Math::FRand(seed);
TReal32 alt = (TReal32)(90 * Math::FRand(seed));
TPositionInfo* position = static_cast<TPositionInfo*> (&aPosInfo);
TUid implUid = { KPosImplementationUid };
position->SetModuleId(implUid);
TTime now;
now.UniversalTime();
TPosition posse;
posse.SetCoordinate(lat, lon, alt);
posse.SetTime(now);
position->SetPosition(posse);
TRequestStatus* status = &aStatus;
User::RequestComplete(status, err);
}
示例6: NotifyPositionUpdate
// ---------------------------------------------------------
// CT_LbsTestPsySimulateIsa::NotifyPositionUpdate
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsTestPsySimulateIsa::NotifyPositionUpdate(
TPositionInfoBase& aPosInfo,
TRequestStatus& /*aStatus*/)
{
TPositionInfo* iPosition = static_cast<TPositionInfo*> (&aPosInfo);
TUid implUid = { KPosImplementationUid };
iPosition->SetModuleId(implUid);
}
示例7: NotifyPositionUpdate
// ---------------------------------------------------------
// CT_LbsStubPositioner::NotifyPositionUpdate
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsStubPositioner::NotifyPositionUpdate(
TPositionInfoBase& aPosInfo,
TRequestStatus& aStatus)
{
TPositionInfo* position = static_cast<TPositionInfo*> (&aPosInfo);
TUid implUid = { KPosImplementationUid };
position->SetModuleId(implUid);
TRequestStatus* status = &aStatus;
User::RequestComplete(status, KErrNone);
}
示例8: ReportReferenceLocation
void RNrhSession::ReportReferenceLocation(TRequestStatus& aRefPosStatus, TPositionInfo& aReferencePosInfo)
{
iReferencePositionParams.iPositionInfoClassType = aReferencePosInfo.PositionClassType();
iReferencePositionParams.iPositionInfoClassSize = aReferencePosInfo.PositionClassSize();
iReferencePositionParamsPtr.Set(reinterpret_cast<TUint8*>(&iReferencePositionParams),
sizeof(iReferencePositionParams),
sizeof(iReferencePositionParams));
iReferencePosInfoPtr.Set(reinterpret_cast<TUint8*>(&aReferencePosInfo),
aReferencePosInfo.PositionClassSize(),
aReferencePosInfo.PositionClassSize());
TIpcArgs args(&iReferencePositionParamsPtr, &iReferencePosInfoPtr);
SendReceive(EX3pReportReferenceLocation , args, aRefPosStatus);
}
示例9: switch
// ---------------------------------------------------------
// CTestPsy4Positioner::NotifyPositionUpdate
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsTestProxyPsy4Positioner::NotifyPositionUpdate(TPositionInfoBase& aPosInfo, TRequestStatus& aStatus)
{
TPositionInfo* posInfo = static_cast<TPositionInfo*> (&aPosInfo);
TUint32 request = posInfo->UpdateType();
switch (request)
{
case 12:
iRequestHandler->SetErrorCode(KErrNone);
break;
default:
iRequestHandler->SetErrorCode(KErrUnknown);
break;
}
iRequestHandler->NotifyPositionUpdate(posInfo, &aStatus);
}
示例10: CompleteRequest
void CNetworkPsy2::CompleteRequestByDefault()
{
if(!iRequestStatus)
{
return;
}
if(iPositionInfoBase->PositionClassType() & EPositionInfoClass)
{
TPositionInfo* posInfo = static_cast<TPositionInfo*>(iPositionInfoBase);
TPosition pos;
pos.SetCoordinate(1.0, 1.0, 1.0);
pos.SetAccuracy(1.0, 1.0);
posInfo->SetPosition(pos);
}
CompleteRequest(KErrNone);
}
示例11: GetLastPositionInfo
/**
Get the last position from the bus
*/
TInt CFinalNetDataBus::GetLastPositionInfo(TPositionInfo& aFNPInfo, TTime& aActualTime)
{
TLbsNetSessionIdInt sessionId;
TTime targetTime;
TInt error = iFinalNetDataBus.GetPositionInfo(sessionId, aFNPInfo, targetTime, aActualTime);
if(error == KErrNone && (aFNPInfo.PositionMode() & TPositionModuleInfo::ETechnologyTerminal))
{
error = KErrNotFound; // filter out terminal assisted FNPs
}
return error;
}
示例12: _L
QGeoPositionInfo CPsyContainer::lastKnownPosition(bool aFromSatellitePositioningMethodsOnly)
{
QGeoPositionInfo posUpdate;
TPosition pos;
TInt error = KErrNone;
RPositioner lastKnownpositioner;
TRequestStatus status;
error = lastKnownpositioner.Open(PosServer());
//request for lastknown position update and wait for the request to complete
if (error == KErrNone) {
TPositionInfo posInfo;
lastKnownpositioner.SetRequestor(CRequestor::ERequestorService ,
CRequestor::EFormatApplication, _L("QTmobility_Location"));
lastKnownpositioner.GetLastKnownPosition(posInfo, status);
//Sub-optimal implementation inherited from the previous implementation
//Since this is a 'once in a while' usecase, this should be ok
//An optimal implementation will be much more complex and will need changes
//in the symbian locaiton stack
User::WaitForRequest(status);
error = status.Int();
lastKnownpositioner.Close();
if ((error == KErrNone) || (error == KPositionPartialUpdate)) {
TPositionModuleInfo modInfo;
iPosServer.GetModuleInfoById(posInfo.ModuleId(), modInfo);
if (!aFromSatellitePositioningMethodsOnly ||
(aFromSatellitePositioningMethodsOnly && (modInfo.Capabilities() & TPositionModuleInfo::ECapabilitySatellite))) {
PsyUtils::TPositionInfo2QGeoPositionInfo(posInfo, posUpdate);
}
}
}
return posUpdate;
}
示例13:
void CLcfPsyDummy1::GetBasicPositionInfoL(TPositionInfoBase& aPosInfo)
{
// The position info object is at least a TPositionInfo
TPositionInfo* posInfo =
static_cast<TPositionInfo*>(&aPosInfo);
TPosition pos;
// Calculate the position and fill in the position info
// object
// Latitude, Longtitude, altitude
pos.SetCoordinate(57.1, 11.3, 32.5);
// set horizontal and vertical accuracy
pos.SetAccuracy(40.0, 40.0);
// set time of fix
pos.SetCurrentTime();
// Set position in position info.
posInfo->SetPosition(pos);
// Set the implementation uid
posInfo->SetModuleId(ImplementationUid());
}
示例14: INFO_PRINTF1
/** Called at the end of the test to verify the correct position data has been returned to the
client.
Each test case SHOULD implement a version of this.
*/
void CT_LbsConflictStep_X3PMenuPush::VerifyPosInfos()
{
T_LbsUtils utils;
RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr;
RPointerArray<TAny>& currPosInfoArr = iParent.iSharedData->iCurrentPosInfoArr;
TPositionInfo* currPosInfo;
// Verify both the self locate and X3P MOLR position information.
// Verify entry 0 for the self locate. We expect a position containing NaNs.
currPosInfo = reinterpret_cast<TPositionInfo*>(currPosInfoArr[0]);
TPosition pos;
currPosInfo->GetPosition(pos);
if (!Math::IsNaN(pos.Latitude()))
{
INFO_PRINTF1(_L("Failed test, Position does not contain NANs"));
SetTestStepResult(EFail);
}
if (!Math::IsNaN(pos.Longitude()))
{
INFO_PRINTF1(_L("Failed test, Position does not contain NANs"));
SetTestStepResult(EFail);
}
// Verify entry 1 for the X3P. We expect a real location value, compare using the data
// sent to the test APGS module.
TPositionInfo* verifyPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]);
currPosInfo = reinterpret_cast<TPositionInfo*>(currPosInfoArr[1]);
if (!utils.Compare_PosInfo(*verifyPosInfo, *currPosInfo))
{
INFO_PRINTF1(_L("Failed test, X3P position incorrect."));
SetTestStepResult(EFail);
}
}
示例15:
void CLcfPsyDummy3::GetBasicPositionInfoL(TPositionInfoBase& aPosInfo)
{
// The position info object is at least a TPositionInfo
TPositionInfo* posInfo =
static_cast<TPositionInfo*>(&aPosInfo);
TPosition pos;
// Calculate the position and fill in the position info
// object
pos.SetCoordinate(67.567, -12.34, 45.32);
// set horizontal and vertical accuracy
pos.SetAccuracy(150.0, 500.0);
// set time of fix
pos.SetCurrentTime();
// Set position in position info.
posInfo->SetPosition(pos);
// Set the implementation uid
posInfo->SetModuleId(ImplementationUid());
}