Fetching the flux source is now done through Config.

This commit is contained in:
dg
2023-05-12 21:25:54 +00:00
parent 68d22e7f54
commit e61eeb8c6f
25 changed files with 85 additions and 56 deletions

View File

@@ -2,6 +2,7 @@
#define FLUXSOURCE_H
#include "flags.h"
#include "lib/config.pb.h"
class A2rFluxSourceProto;
class CwfFluxSourceProto;
@@ -58,14 +59,34 @@ public:
static std::unique_ptr<FluxSource> create(const FluxSourceProto& spec);
public:
/* Returns any configuration this flux source might be carrying (e.g. tpi
* of the drive which made the capture). */
const ConfigProto& getConfig() const
{ return _fluxConfig; }
/* Read flux from a given track and side. */
virtual std::unique_ptr<FluxSourceIterator> readFlux(
int track, int side) = 0;
/* Recalibrates; seeks to track 0 and ensures the head is in the right place. */
virtual void recalibrate() {}
/* Seeks to a given track (without recalibrating). */
virtual void seek(int track) {}
/* Is this real hardware? If so, then flux can be read indefinitely (among other things). */
virtual bool isHardware()
{
return false;
}
protected:
ConfigProto _fluxConfig;
};
class EmptyFluxSourceIterator : public FluxSourceIterator