12#ifndef WSFSECTORSCANSENSORSCHEDULER_HPP
13#define WSFSECTORSCANSENSORSCHEDULER_HPP
15#include "wsf_export.h"
36 static std::unique_ptr<WsfSensorScheduler>
ObjectFactory(
const std::string& aTypeName);
50 void RemoveTarget(
double aSimTime,
size_t aTargetIndex)
override;
58 void TurnOff(
double aSimTime)
override;
59 void TurnOn(
double aSimTime)
override;
65 void AdvanceScan(
double aSimTime);
67 void ResetSearchList();
70 std::vector<WsfSensorMode*> mModeList;
73 size_t mLastExplicitModeIndex;
77 std::vector<size_t> mSearchModeIndex;
84 SensorTarget() =
default;
85 SensorTarget(
size_t aTargetIndex,
size_t aModeIndex,
double aDetectTime)
86 : mTargetIndex(aTargetIndex)
87 , mModeIndex(aModeIndex)
88 , mDetectTime(aDetectTime)
93 bool operator<(
const SensorTarget& rhs)
const {
return mDetectTime > rhs.mDetectTime; }
95 size_t mTargetIndex{0};
97 double mDetectTime{0.0};
101 using SensorTargetQueue = std::priority_queue<SensorTarget>;
102 SensorTargetQueue mSensorTargetQueue;
105 double mSensorUpdateInterval;
110 double mLastUpdateTime;
128 bool ProcessInput(UtInput& aInput);
131 bool CheckTransition(
double aAz,
double aEl);
133 Type GetType()
const {
return mType; }
134 void SetType(Type aType) { mType = aType; }
135 double GetStartAz()
const {
return mStartAz; }
136 double GetEndAz()
const {
return mEndAz; }
137 void SetEndAz(
double aEndAz) { mEndAz = aEndAz; }
138 void SetStartAz(
double aStartAz) { mStartAz = aStartAz; }
139 double GetStartEl()
const {
return mStartEl; }
140 double GetEndEl()
const {
return mEndEl; }
141 void SetStartEl(
double aStartEl) { mStartEl = aStartEl; }
142 void SetEndEl(
double aEndEl) { mEndEl = aEndEl; }
143 double GetAzScanRate()
const {
return mAzScanRate; }
144 double GetElScanRate()
const {
return mElScanRate; }
145 void SetAzScanRate(
double aRate) { mAzScanRate = aRate; }
146 void SetElScanRate(
double aRate) { mElScanRate = aRate; }
150 double GetScanTime()
const {
return mScanTime; }
151 bool Validate()
const;
154 static const double cUNINITIALIZED;
168 void BeginSlew(
double aSimTime, Sector& aSector);
170 void SlewToSector(
double aSimTime, Sector& aSector);
172 double EstimateDetectTime(
double aSimTime, WsfPlatform& aTarget);
174 void InitializeScan(
double aSimTime);
176 using Sectors = std::list<Sector>;
178 bool mSlewingToNextSector;
179 bool mIsContinuousAz;
180 bool mFrameBasedScheduling;
181 Sector mSlewTransition;
182 Sector* mCurrentSectorPtr;
184 Sectors::iterator mSectorIter;
185 Sectors::iterator mNextSectorIter;
186 std::set<size_t> mTargetsSelectedThisFrame;
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
SlewDirection
Definition WsfArticulatedPart.hpp:52
static std::unique_ptr< WsfSensorScheduler > ObjectFactory(const std::string &aTypeName)
Definition WsfSectorScanSensorScheduler.cpp:89
WsfSectorScanSensorScheduler()
Definition WsfSectorScanSensorScheduler.cpp:42
~WsfSectorScanSensorScheduler() override=default
void TransitionSector(double aSimTime)
Definition WsfSectorScanSensorScheduler.cpp:429
virtual void RemoveTarget(double aSimTime, size_t aTargetIndex)
Definition WsfSensorScheduler.cpp:150
virtual void PlatformAdded(double aSimTime, WsfPlatform *aPlatformPtr)
Definition WsfSensorScheduler.cpp:122
virtual void TurnOff(double aSimTime)
Definition WsfSensorScheduler.cpp:213
virtual bool Initialize(double aSimTime, WsfSensor *aSensorPtr, WsfSensorTracker *aTrackerPtr)
Definition WsfSensorScheduler.cpp:91
virtual bool SelectTarget(double aSimTime, double &aNextSimTime, size_t &aTargetIndex, WsfTrackId &aRequestId, WsfSensor::Settings &aSettings)
Definition WsfSensorScheduler.cpp:176
WsfSensorScheduler()
Definition WsfSensorScheduler.cpp:26
virtual void ModeDeselected(double aSimTime, WsfStringId aModeNameId)
Definition WsfSensorScheduler.cpp:106
virtual void TurnOn(double aSimTime)
Definition WsfSensorScheduler.cpp:219
virtual WsfSensorScheduler * Clone() const
Definition WsfSensorScheduler.cpp:45
WsfSensorScheduler & operator=(const WsfSensorScheduler &aSrc)=delete
virtual void ModeSelected(double aSimTime, WsfStringId aModeNameId)
Definition WsfSensorScheduler.cpp:115
virtual bool ProcessInput(UtInput &aInput)
Definition WsfSensorScheduler.cpp:132
Definition WsfSensorTracker.hpp:75
Definition WsfSensor.hpp:133
Definition WsfSensor.hpp:92
Definition WsfTrackId.hpp:33
Type
Definition P6DofVehicleData.hpp:182
WSF_EXPORT InitializeCallback & Initialize(const WsfSimulation *aSimulationPtr)