mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
More config machinery: the reader now reads (but can't put the resulting image
anywhere).
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "flags.h"
|
||||
#include "dataspec.h"
|
||||
#include "fluxsource/fluxsource.h"
|
||||
#include "lib/config.pb.h"
|
||||
|
||||
static bool ends_with(const std::string& value, const std::string& ending)
|
||||
{
|
||||
@@ -24,3 +25,15 @@ std::unique_ptr<FluxSource> FluxSource::create(const FluxSpec& spec)
|
||||
Error() << "unrecognised flux filename extension";
|
||||
return std::unique_ptr<FluxSource>();
|
||||
}
|
||||
|
||||
std::unique_ptr<FluxSource> FluxSource::create(const Config_InputDisk& config)
|
||||
{
|
||||
if (config.has_fluxfile())
|
||||
return createSqliteFluxSource(config.fluxfile());
|
||||
else
|
||||
return createHardwareFluxSource(config.drive());
|
||||
|
||||
Error() << "bad input disk configuration";
|
||||
return std::unique_ptr<FluxSource>();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ extern FlagGroup hardwareFluxSourceFlags;
|
||||
|
||||
class Fluxmap;
|
||||
class FluxSpec;
|
||||
class Config_InputDisk;
|
||||
|
||||
class FluxSource
|
||||
{
|
||||
@@ -20,6 +21,7 @@ private:
|
||||
|
||||
public:
|
||||
static std::unique_ptr<FluxSource> create(const FluxSpec& spec);
|
||||
static std::unique_ptr<FluxSource> create(const Config_InputDisk& spec);
|
||||
|
||||
public:
|
||||
virtual std::unique_ptr<Fluxmap> readFlux(int track, int side) = 0;
|
||||
|
||||
Reference in New Issue
Block a user