mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
@@ -20,6 +20,7 @@ public:
|
||||
public:
|
||||
virtual std::unique_ptr<Fluxmap> readFlux(int track, int side) = 0;
|
||||
virtual void recalibrate() {}
|
||||
virtual bool retryable() { return false; }
|
||||
};
|
||||
|
||||
extern void setHardwareFluxReaderRevolutions(int revolutions);
|
||||
|
||||
@@ -29,10 +29,16 @@ public:
|
||||
return usbRead(side, revolutions);
|
||||
}
|
||||
|
||||
void recalibrate() {
|
||||
void recalibrate()
|
||||
{
|
||||
usbRecalibrate();
|
||||
}
|
||||
|
||||
bool retryable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned _drive;
|
||||
unsigned _revolutions;
|
||||
|
||||
@@ -65,6 +65,11 @@ void Track::recalibrate()
|
||||
_fluxReader->recalibrate();
|
||||
}
|
||||
|
||||
bool Track::retryable()
|
||||
{
|
||||
return _fluxReader->retryable();
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<Track>> readTracks()
|
||||
{
|
||||
const DataSpec& dataSpec = source.value;
|
||||
@@ -172,6 +177,9 @@ void readDiskCommand(AbstractDecoder& decoder, const std::string& outputFilename
|
||||
|
||||
std::cout << std::endl
|
||||
<< " ";
|
||||
|
||||
if (!track->retryable())
|
||||
break;
|
||||
if (retry == 0)
|
||||
std::cout << "giving up" << std::endl
|
||||
<< " ";
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
public:
|
||||
std::unique_ptr<Fluxmap> read();
|
||||
void recalibrate();
|
||||
bool retryable();
|
||||
|
||||
unsigned track;
|
||||
unsigned side;
|
||||
|
||||
Reference in New Issue
Block a user