mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Rename FluxReader and FluxWriter to FluxSource and FluxSink.
This commit is contained in:
@@ -1,30 +0,0 @@
|
|||||||
#ifndef FLUXREADER_H
|
|
||||||
#define FLUXREADER_H
|
|
||||||
|
|
||||||
class Fluxmap;
|
|
||||||
class DataSpec;
|
|
||||||
|
|
||||||
class FluxReader
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~FluxReader() {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
static std::unique_ptr<FluxReader> createSqliteFluxReader(const std::string& filename);
|
|
||||||
static std::unique_ptr<FluxReader> createHardwareFluxReader(unsigned drive);
|
|
||||||
static std::unique_ptr<FluxReader> createStreamFluxReader(const std::string& path);
|
|
||||||
|
|
||||||
public:
|
|
||||||
static std::unique_ptr<FluxReader> create(const DataSpec& spec);
|
|
||||||
|
|
||||||
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);
|
|
||||||
extern void setHardwareFluxReaderDensity(bool high_density);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
#include "dataspec.h"
|
#include "dataspec.h"
|
||||||
#include "fluxwriter.h"
|
#include "fluxsink.h"
|
||||||
|
|
||||||
static bool ends_with(const std::string& value, const std::string& ending)
|
static bool ends_with(const std::string& value, const std::string& ending)
|
||||||
{
|
{
|
||||||
@@ -10,15 +10,15 @@ static bool ends_with(const std::string& value, const std::string& ending)
|
|||||||
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
|
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<FluxWriter> FluxWriter::create(const DataSpec& spec)
|
std::unique_ptr<FluxSink> FluxSink::create(const DataSpec& spec)
|
||||||
{
|
{
|
||||||
const auto& filename = spec.filename;
|
const auto& filename = spec.filename;
|
||||||
|
|
||||||
if (filename.empty())
|
if (filename.empty())
|
||||||
return createHardwareFluxWriter(spec.drive);
|
return createHardwareFluxSink(spec.drive);
|
||||||
else if (ends_with(filename, ".flux"))
|
else if (ends_with(filename, ".flux"))
|
||||||
return createSqliteFluxWriter(filename);
|
return createSqliteFluxSink(filename);
|
||||||
|
|
||||||
Error() << "unrecognised flux filename extension";
|
Error() << "unrecognised flux filename extension";
|
||||||
return std::unique_ptr<FluxWriter>();
|
return std::unique_ptr<FluxSink>();
|
||||||
}
|
}
|
||||||
26
lib/fluxsink/fluxsink.h
Normal file
26
lib/fluxsink/fluxsink.h
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#ifndef FLUXSINK_H
|
||||||
|
#define FLUXSINK_H
|
||||||
|
|
||||||
|
class Fluxmap;
|
||||||
|
class DataSpec;
|
||||||
|
|
||||||
|
class FluxSink
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~FluxSink() {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::unique_ptr<FluxSink> createSqliteFluxSink(const std::string& filename);
|
||||||
|
static std::unique_ptr<FluxSink> createHardwareFluxSink(unsigned drive);
|
||||||
|
|
||||||
|
public:
|
||||||
|
static std::unique_ptr<FluxSink> create(const DataSpec& spec);
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void writeFlux(int track, int side, Fluxmap& fluxmap) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void setHardwareFluxSinkDensity(bool high_density);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
@@ -2,24 +2,24 @@
|
|||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
#include "fluxmap.h"
|
#include "fluxmap.h"
|
||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
#include "fluxwriter.h"
|
#include "fluxsink.h"
|
||||||
|
|
||||||
static bool high_density = false;
|
static bool high_density = false;
|
||||||
|
|
||||||
void setHardwareFluxWriterDensity(bool high_density)
|
void setHardwareFluxSinkDensity(bool high_density)
|
||||||
{
|
{
|
||||||
::high_density = high_density;
|
::high_density = high_density;
|
||||||
}
|
}
|
||||||
|
|
||||||
class HardwareFluxWriter : public FluxWriter
|
class HardwareFluxSink : public FluxSink
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HardwareFluxWriter(unsigned drive):
|
HardwareFluxSink(unsigned drive):
|
||||||
_drive(drive)
|
_drive(drive)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~HardwareFluxWriter()
|
~HardwareFluxSink()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,9 +37,9 @@ private:
|
|||||||
unsigned _drive;
|
unsigned _drive;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<FluxWriter> FluxWriter::createHardwareFluxWriter(unsigned drive)
|
std::unique_ptr<FluxSink> FluxSink::createHardwareFluxSink(unsigned drive)
|
||||||
{
|
{
|
||||||
return std::unique_ptr<FluxWriter>(new HardwareFluxWriter(drive));
|
return std::unique_ptr<FluxSink>(new HardwareFluxSink(drive));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "fluxmap.h"
|
#include "fluxmap.h"
|
||||||
#include "sql.h"
|
#include "sql.h"
|
||||||
#include "fluxwriter.h"
|
#include "fluxsink.h"
|
||||||
#include "fmt/format.h"
|
#include "fmt/format.h"
|
||||||
|
|
||||||
class SqliteFluxWriter : public FluxWriter
|
class SqliteFluxSink : public FluxSink
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SqliteFluxWriter(const std::string& filename)
|
SqliteFluxSink(const std::string& filename)
|
||||||
{
|
{
|
||||||
_outdb = sqlOpen(filename, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
|
_outdb = sqlOpen(filename, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
|
||||||
int oldVersion = sqlReadIntProperty(_outdb, "version");
|
int oldVersion = sqlReadIntProperty(_outdb, "version");
|
||||||
@@ -20,7 +20,7 @@ public:
|
|||||||
sqlWriteIntProperty(_outdb, "version", FLUX_VERSION_CURRENT);
|
sqlWriteIntProperty(_outdb, "version", FLUX_VERSION_CURRENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
~SqliteFluxWriter()
|
~SqliteFluxSink()
|
||||||
{
|
{
|
||||||
if (_outdb)
|
if (_outdb)
|
||||||
{
|
{
|
||||||
@@ -39,9 +39,9 @@ private:
|
|||||||
sqlite3* _outdb;
|
sqlite3* _outdb;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<FluxWriter> FluxWriter::createSqliteFluxWriter(const std::string& filename)
|
std::unique_ptr<FluxSink> FluxSink::createSqliteFluxSink(const std::string& filename)
|
||||||
{
|
{
|
||||||
return std::unique_ptr<FluxWriter>(new SqliteFluxWriter(filename));
|
return std::unique_ptr<FluxSink>(new SqliteFluxSink(filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
#include "dataspec.h"
|
#include "dataspec.h"
|
||||||
#include "fluxreader.h"
|
#include "fluxsource.h"
|
||||||
|
|
||||||
static bool ends_with(const std::string& value, const std::string& ending)
|
static bool ends_with(const std::string& value, const std::string& ending)
|
||||||
{
|
{
|
||||||
@@ -10,17 +10,17 @@ static bool ends_with(const std::string& value, const std::string& ending)
|
|||||||
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
|
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<FluxReader> FluxReader::create(const DataSpec& spec)
|
std::unique_ptr<FluxSource> FluxSource::create(const DataSpec& spec)
|
||||||
{
|
{
|
||||||
const auto& filename = spec.filename;
|
const auto& filename = spec.filename;
|
||||||
|
|
||||||
if (filename.empty())
|
if (filename.empty())
|
||||||
return createHardwareFluxReader(spec.drive);
|
return createHardwareFluxSource(spec.drive);
|
||||||
else if (ends_with(filename, ".flux"))
|
else if (ends_with(filename, ".flux"))
|
||||||
return createSqliteFluxReader(filename);
|
return createSqliteFluxSource(filename);
|
||||||
else if (ends_with(filename, "/"))
|
else if (ends_with(filename, "/"))
|
||||||
return createStreamFluxReader(filename);
|
return createStreamFluxSource(filename);
|
||||||
|
|
||||||
Error() << "unrecognised flux filename extension";
|
Error() << "unrecognised flux filename extension";
|
||||||
return std::unique_ptr<FluxReader>();
|
return std::unique_ptr<FluxSource>();
|
||||||
}
|
}
|
||||||
30
lib/fluxsource/fluxsource.h
Normal file
30
lib/fluxsource/fluxsource.h
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#ifndef FLUXSOURCE_H
|
||||||
|
#define FLUXSOURCE_H
|
||||||
|
|
||||||
|
class Fluxmap;
|
||||||
|
class DataSpec;
|
||||||
|
|
||||||
|
class FluxSource
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~FluxSource() {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::unique_ptr<FluxSource> createSqliteFluxSource(const std::string& filename);
|
||||||
|
static std::unique_ptr<FluxSource> createHardwareFluxSource(unsigned drive);
|
||||||
|
static std::unique_ptr<FluxSource> createStreamFluxSource(const std::string& path);
|
||||||
|
|
||||||
|
public:
|
||||||
|
static std::unique_ptr<FluxSource> create(const DataSpec& spec);
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual std::unique_ptr<Fluxmap> readFlux(int track, int side) = 0;
|
||||||
|
virtual void recalibrate() {}
|
||||||
|
virtual bool retryable() { return false; }
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void setHardwareFluxSourceRevolutions(int revolutions);
|
||||||
|
extern void setHardwareFluxSourceDensity(bool high_density);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
#include "fluxmap.h"
|
#include "fluxmap.h"
|
||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
#include "fluxreader.h"
|
#include "fluxsource.h"
|
||||||
|
|
||||||
static IntFlag revolutions(
|
static IntFlag revolutions(
|
||||||
{ "--revolutions" },
|
{ "--revolutions" },
|
||||||
@@ -11,20 +11,20 @@ static IntFlag revolutions(
|
|||||||
|
|
||||||
static bool high_density = false;
|
static bool high_density = false;
|
||||||
|
|
||||||
void setHardwareFluxReaderDensity(bool high_density)
|
void setHardwareFluxSourceDensity(bool high_density)
|
||||||
{
|
{
|
||||||
::high_density = high_density;
|
::high_density = high_density;
|
||||||
}
|
}
|
||||||
|
|
||||||
class HardwareFluxReader : public FluxReader
|
class HardwareFluxSource : public FluxSource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HardwareFluxReader(unsigned drive):
|
HardwareFluxSource(unsigned drive):
|
||||||
_drive(drive)
|
_drive(drive)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~HardwareFluxReader()
|
~HardwareFluxSource()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,14 +54,14 @@ private:
|
|||||||
unsigned _revolutions;
|
unsigned _revolutions;
|
||||||
};
|
};
|
||||||
|
|
||||||
void setHardwareFluxReaderRevolutions(int revolutions)
|
void setHardwareFluxSourceRevolutions(int revolutions)
|
||||||
{
|
{
|
||||||
::revolutions.value = ::revolutions.defaultValue = revolutions;
|
::revolutions.value = ::revolutions.defaultValue = revolutions;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<FluxReader> FluxReader::createHardwareFluxReader(unsigned drive)
|
std::unique_ptr<FluxSource> FluxSource::createHardwareFluxSource(unsigned drive)
|
||||||
{
|
{
|
||||||
return std::unique_ptr<FluxReader>(new HardwareFluxReader(drive));
|
return std::unique_ptr<FluxSource>(new HardwareFluxSource(drive));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "fluxmap.h"
|
#include "fluxmap.h"
|
||||||
#include "sql.h"
|
#include "sql.h"
|
||||||
#include "fluxreader.h"
|
#include "fluxsource.h"
|
||||||
#include "fmt/format.h"
|
#include "fmt/format.h"
|
||||||
|
|
||||||
class SqliteFluxReader : public FluxReader
|
class SqliteFluxSource : public FluxSource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SqliteFluxReader(const std::string& filename)
|
SqliteFluxSource(const std::string& filename)
|
||||||
{
|
{
|
||||||
_indb = sqlOpen(filename, SQLITE_OPEN_READONLY);
|
_indb = sqlOpen(filename, SQLITE_OPEN_READONLY);
|
||||||
int version = sqlGetVersion(_indb);
|
int version = sqlGetVersion(_indb);
|
||||||
@@ -16,7 +16,7 @@ public:
|
|||||||
version, FLUX_VERSION_CURRENT);
|
version, FLUX_VERSION_CURRENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
~SqliteFluxReader()
|
~SqliteFluxSource()
|
||||||
{
|
{
|
||||||
if (_indb)
|
if (_indb)
|
||||||
sqlClose(_indb);
|
sqlClose(_indb);
|
||||||
@@ -34,9 +34,9 @@ private:
|
|||||||
sqlite3* _indb;
|
sqlite3* _indb;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<FluxReader> FluxReader::createSqliteFluxReader(const std::string& filename)
|
std::unique_ptr<FluxSource> FluxSource::createSqliteFluxSource(const std::string& filename)
|
||||||
{
|
{
|
||||||
return std::unique_ptr<FluxReader>(new SqliteFluxReader(filename));
|
return std::unique_ptr<FluxSource>(new SqliteFluxSource(filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "fluxmap.h"
|
#include "fluxmap.h"
|
||||||
#include "kryoflux.h"
|
#include "kryoflux.h"
|
||||||
#include "fluxreader.h"
|
#include "fluxsource.h"
|
||||||
|
|
||||||
class StreamFluxReader : public FluxReader
|
class StreamFluxSource : public FluxSource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StreamFluxReader(const std::string& path):
|
StreamFluxSource(const std::string& path):
|
||||||
_path(path)
|
_path(path)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~StreamFluxReader()
|
~StreamFluxSource()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ private:
|
|||||||
const std::string& _path;
|
const std::string& _path;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<FluxReader> FluxReader::createStreamFluxReader(const std::string& path)
|
std::unique_ptr<FluxSource> FluxSource::createStreamFluxSource(const std::string& path)
|
||||||
{
|
{
|
||||||
return std::unique_ptr<FluxReader>(new StreamFluxReader(path));
|
return std::unique_ptr<FluxSource>(new StreamFluxSource(path));
|
||||||
}
|
}
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#ifndef FLUXWRITER_H
|
|
||||||
#define FLUXWRITER_H
|
|
||||||
|
|
||||||
class Fluxmap;
|
|
||||||
class DataSpec;
|
|
||||||
|
|
||||||
class FluxWriter
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~FluxWriter() {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
static std::unique_ptr<FluxWriter> createSqliteFluxWriter(const std::string& filename);
|
|
||||||
static std::unique_ptr<FluxWriter> createHardwareFluxWriter(unsigned drive);
|
|
||||||
|
|
||||||
public:
|
|
||||||
static std::unique_ptr<FluxWriter> create(const DataSpec& spec);
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual void writeFlux(int track, int side, Fluxmap& fluxmap) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern void setHardwareFluxWriterDensity(bool high_density);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
#include "fluxreader.h"
|
#include "fluxsource.h"
|
||||||
#include "reader.h"
|
#include "reader.h"
|
||||||
#include "fluxmap.h"
|
#include "fluxmap.h"
|
||||||
#include "sql.h"
|
#include "sql.h"
|
||||||
@@ -51,13 +51,13 @@ void setReaderDefaultSource(const std::string& source)
|
|||||||
|
|
||||||
void setReaderRevolutions(int revolutions)
|
void setReaderRevolutions(int revolutions)
|
||||||
{
|
{
|
||||||
setHardwareFluxReaderRevolutions(revolutions);
|
setHardwareFluxSourceRevolutions(revolutions);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<Fluxmap> Track::read()
|
std::unique_ptr<Fluxmap> Track::read()
|
||||||
{
|
{
|
||||||
std::cout << fmt::format("{0:>3}.{1}: ", track, side) << std::flush;
|
std::cout << fmt::format("{0:>3}.{1}: ", track, side) << std::flush;
|
||||||
std::unique_ptr<Fluxmap> fluxmap = _fluxReader->readFlux(track, side);
|
std::unique_ptr<Fluxmap> fluxmap = _FluxSource->readFlux(track, side);
|
||||||
std::cout << fmt::format(
|
std::cout << fmt::format(
|
||||||
"{0} ms in {1} bytes\n",
|
"{0} ms in {1} bytes\n",
|
||||||
int(fluxmap->duration()/1e6),
|
int(fluxmap->duration()/1e6),
|
||||||
@@ -69,12 +69,12 @@ std::unique_ptr<Fluxmap> Track::read()
|
|||||||
|
|
||||||
void Track::recalibrate()
|
void Track::recalibrate()
|
||||||
{
|
{
|
||||||
_fluxReader->recalibrate();
|
_FluxSource->recalibrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Track::retryable()
|
bool Track::retryable()
|
||||||
{
|
{
|
||||||
return _fluxReader->retryable();
|
return _FluxSource->retryable();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::unique_ptr<Track>> readTracks()
|
std::vector<std::unique_ptr<Track>> readTracks()
|
||||||
@@ -83,7 +83,7 @@ std::vector<std::unique_ptr<Track>> readTracks()
|
|||||||
|
|
||||||
std::cout << "Reading from: " << dataSpec << std::endl;
|
std::cout << "Reading from: " << dataSpec << std::endl;
|
||||||
|
|
||||||
setHardwareFluxReaderDensity(highDensityFlag);
|
setHardwareFluxSourceDensity(highDensityFlag);
|
||||||
|
|
||||||
if (!destination.value.empty())
|
if (!destination.value.empty())
|
||||||
{
|
{
|
||||||
@@ -100,12 +100,12 @@ std::vector<std::unique_ptr<Track>> readTracks()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<FluxReader> fluxreader = FluxReader::create(dataSpec);
|
std::shared_ptr<FluxSource> FluxSource = FluxSource::create(dataSpec);
|
||||||
|
|
||||||
std::vector<std::unique_ptr<Track>> tracks;
|
std::vector<std::unique_ptr<Track>> tracks;
|
||||||
for (const auto& location : dataSpec.locations)
|
for (const auto& location : dataSpec.locations)
|
||||||
tracks.push_back(
|
tracks.push_back(
|
||||||
std::unique_ptr<Track>(new Track(fluxreader, location.track, location.side)));
|
std::unique_ptr<Track>(new Track(FluxSource, location.track, location.side)));
|
||||||
|
|
||||||
if (justRead)
|
if (justRead)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define READER_H
|
#define READER_H
|
||||||
|
|
||||||
class Fluxmap;
|
class Fluxmap;
|
||||||
class FluxReader;
|
class FluxSource;
|
||||||
class AbstractDecoder;
|
class AbstractDecoder;
|
||||||
|
|
||||||
extern void setReaderDefaultSource(const std::string& source);
|
extern void setReaderDefaultSource(const std::string& source);
|
||||||
@@ -11,10 +11,10 @@ extern void setReaderRevolutions(int revolutions);
|
|||||||
class Track
|
class Track
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Track(std::shared_ptr<FluxReader>& fluxReader, unsigned track, unsigned side):
|
Track(std::shared_ptr<FluxSource>& FluxSource, unsigned track, unsigned side):
|
||||||
track(track),
|
track(track),
|
||||||
side(side),
|
side(side),
|
||||||
_fluxReader(fluxReader)
|
_FluxSource(FluxSource)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -26,7 +26,7 @@ public:
|
|||||||
unsigned side;
|
unsigned side;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<FluxReader> _fluxReader;
|
std::shared_ptr<FluxSource> _FluxSource;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern std::vector<std::unique_ptr<Track>> readTracks();
|
extern std::vector<std::unique_ptr<Track>> readTracks();
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
#include "dataspec.h"
|
#include "dataspec.h"
|
||||||
#include "fluxreader.h"
|
#include "fluxsource.h"
|
||||||
#include "fluxwriter.h"
|
#include "fluxsink.h"
|
||||||
#include "fmt/format.h"
|
#include "fmt/format.h"
|
||||||
|
|
||||||
static DataSpecFlag dest(
|
static DataSpecFlag dest(
|
||||||
@@ -33,8 +33,8 @@ void writeTracks(
|
|||||||
|
|
||||||
std::cout << "Writing to: " << spec << std::endl;
|
std::cout << "Writing to: " << spec << std::endl;
|
||||||
|
|
||||||
setHardwareFluxReaderDensity(highDensityFlag);
|
setHardwareFluxSourceDensity(highDensityFlag);
|
||||||
setHardwareFluxWriterDensity(highDensityFlag);
|
setHardwareFluxSinkDensity(highDensityFlag);
|
||||||
|
|
||||||
if (!spec.filename.empty())
|
if (!spec.filename.empty())
|
||||||
{
|
{
|
||||||
|
|||||||
34
meson.build
34
meson.build
@@ -56,34 +56,34 @@ sqllib = declare_dependency(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
fluxreaderlib = declare_dependency(
|
fluxsourcelib = declare_dependency(
|
||||||
link_with:
|
link_with:
|
||||||
shared_library('fluxreaderlib',
|
shared_library('fluxsourcelib',
|
||||||
[
|
[
|
||||||
'lib/fluxreader/fluxreader.cc',
|
'lib/fluxsource/fluxsource.cc',
|
||||||
'lib/fluxreader/sqlitefluxreader.cc',
|
'lib/fluxsource/sqlitefluxsource.cc',
|
||||||
'lib/fluxreader/hardwarefluxreader.cc',
|
'lib/fluxsource/hardwarefluxsource.cc',
|
||||||
'lib/fluxreader/streamfluxreader.cc',
|
'lib/fluxsource/streamfluxsource.cc',
|
||||||
'lib/fluxreader/kryoflux.cc',
|
'lib/fluxsource/kryoflux.cc',
|
||||||
],
|
],
|
||||||
dependencies: [fmtlib, felib, sqllib, sqlite]
|
dependencies: [fmtlib, felib, sqllib, sqlite]
|
||||||
),
|
),
|
||||||
include_directories:
|
include_directories:
|
||||||
include_directories('lib/fluxreader')
|
include_directories('lib/fluxsource')
|
||||||
)
|
)
|
||||||
|
|
||||||
fluxwriterlib = declare_dependency(
|
fluxsinklib = declare_dependency(
|
||||||
link_with:
|
link_with:
|
||||||
shared_library('fluxwriterlib',
|
shared_library('fluxsinklib',
|
||||||
[
|
[
|
||||||
'lib/fluxwriter/fluxwriter.cc',
|
'lib/fluxsink/fluxsink.cc',
|
||||||
'lib/fluxwriter/sqlitefluxwriter.cc',
|
'lib/fluxsink/sqlitefluxsink.cc',
|
||||||
'lib/fluxwriter/hardwarefluxwriter.cc',
|
'lib/fluxsink/hardwarefluxsink.cc',
|
||||||
],
|
],
|
||||||
dependencies: [fmtlib, felib, sqllib, sqlite]
|
dependencies: [fmtlib, felib, sqllib, sqlite]
|
||||||
),
|
),
|
||||||
include_directories:
|
include_directories:
|
||||||
include_directories('lib/fluxwriter')
|
include_directories('lib/fluxsink')
|
||||||
)
|
)
|
||||||
|
|
||||||
decoderlib = declare_dependency(
|
decoderlib = declare_dependency(
|
||||||
@@ -103,14 +103,14 @@ readerlib = declare_dependency(
|
|||||||
link_with:
|
link_with:
|
||||||
shared_library('readerlib',
|
shared_library('readerlib',
|
||||||
['lib/reader.cc'],
|
['lib/reader.cc'],
|
||||||
dependencies: [fmtlib, felib, sqllib, decoderlib, fluxreaderlib, sqlite])
|
dependencies: [fmtlib, felib, sqllib, decoderlib, fluxsourcelib, sqlite])
|
||||||
)
|
)
|
||||||
|
|
||||||
writerlib = declare_dependency(
|
writerlib = declare_dependency(
|
||||||
link_with:
|
link_with:
|
||||||
shared_library('writerlib',
|
shared_library('writerlib',
|
||||||
['lib/writer.cc'],
|
['lib/writer.cc'],
|
||||||
dependencies: [fmtlib, felib, sqllib, fluxreaderlib, fluxwriterlib, sqlite]
|
dependencies: [fmtlib, felib, sqllib, fluxsourcelib, fluxsinklib, sqlite]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -261,7 +261,7 @@ test('DataSpec', executable('dataspec-test', ['tests/dataspec.cc'],
|
|||||||
test('Flags', executable('flags-test', ['tests/flags.cc'], dependencies: [felib]))
|
test('Flags', executable('flags-test', ['tests/flags.cc'], dependencies: [felib]))
|
||||||
test('FmMfm', executable('fmmfm-test', ['tests/fmmfm.cc'], dependencies: [felib, decoderlib]))
|
test('FmMfm', executable('fmmfm-test', ['tests/fmmfm.cc'], dependencies: [felib, decoderlib]))
|
||||||
test('BitAccumulator', executable('bitaccumulator-test', ['tests/bitaccumulator.cc'], dependencies: [felib]))
|
test('BitAccumulator', executable('bitaccumulator-test', ['tests/bitaccumulator.cc'], dependencies: [felib]))
|
||||||
test('Kryoflux', executable('kryoflux-test', ['tests/kryoflux.cc'], dependencies: [felib, decoderlib, fluxreaderlib]))
|
test('Kryoflux', executable('kryoflux-test', ['tests/kryoflux.cc'], dependencies: [felib, decoderlib, fluxsourcelib]))
|
||||||
test('Compression', executable('compression-test', ['tests/compression.cc'], dependencies: [felib, decoderlib]))
|
test('Compression', executable('compression-test', ['tests/compression.cc'], dependencies: [felib, decoderlib]))
|
||||||
test('Bytes', executable('bytes-test', ['tests/bytes.cc'], dependencies: [felib]))
|
test('Bytes', executable('bytes-test', ['tests/bytes.cc'], dependencies: [felib]))
|
||||||
test('Crunch', executable('crunch-test', ['tests/crunch.cc'], dependencies: [felib, crunchlib]))
|
test('Crunch', executable('crunch-test', ['tests/crunch.cc'], dependencies: [felib, crunchlib]))
|
||||||
|
|||||||
Reference in New Issue
Block a user