mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Rename all protos to end with 'Proto' to avoid name conflicts.
This commit is contained in:
@@ -11,17 +11,17 @@ static bool ends_with(const std::string& value, const std::string& ending)
|
||||
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
|
||||
}
|
||||
|
||||
std::unique_ptr<FluxSource> FluxSource::create(const Config_InputDisk& config)
|
||||
std::unique_ptr<FluxSource> FluxSource::create(const InputDiskProto& config)
|
||||
{
|
||||
switch (config.source_case())
|
||||
{
|
||||
case Config_InputDisk::kFluxfile:
|
||||
case InputDiskProto::kFluxfile:
|
||||
return createSqliteFluxSource(config.fluxfile());
|
||||
|
||||
case Config_InputDisk::kDrive:
|
||||
case InputDiskProto::kDrive:
|
||||
return createHardwareFluxSource(config.drive());
|
||||
|
||||
case Config_InputDisk::kTestPattern:
|
||||
case InputDiskProto::kTestPattern:
|
||||
return createTestPatternFluxSource(config.test_pattern());
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ extern FlagGroup hardwareFluxSourceFlags;
|
||||
|
||||
class Fluxmap;
|
||||
class FluxSpec;
|
||||
class Config_InputDisk;
|
||||
class HardwareInput;
|
||||
class TestPatternInput;
|
||||
class InputDiskProto;
|
||||
class HardwareInputProto;
|
||||
class TestPatternInputProto;
|
||||
|
||||
class FluxSource
|
||||
{
|
||||
@@ -18,13 +18,12 @@ public:
|
||||
|
||||
private:
|
||||
static std::unique_ptr<FluxSource> createSqliteFluxSource(const std::string& filename);
|
||||
static std::unique_ptr<FluxSource> createHardwareFluxSource(const HardwareInput& config);
|
||||
static std::unique_ptr<FluxSource> createHardwareFluxSource(const HardwareInputProto& config);
|
||||
static std::unique_ptr<FluxSource> createStreamFluxSource(const std::string& path);
|
||||
static std::unique_ptr<FluxSource> createTestPatternFluxSource(const TestPatternInput& config);
|
||||
static std::unique_ptr<FluxSource> createTestPatternFluxSource(const TestPatternInputProto& config);
|
||||
|
||||
public:
|
||||
static std::unique_ptr<FluxSource> create(const FluxSpec& spec);
|
||||
static std::unique_ptr<FluxSource> create(const Config_InputDisk& spec);
|
||||
static std::unique_ptr<FluxSource> create(const InputDiskProto& spec);
|
||||
|
||||
public:
|
||||
virtual std::unique_ptr<Fluxmap> readFlux(int track, int side) = 0;
|
||||
|
||||
@@ -6,7 +6,7 @@ enum IndexMode {
|
||||
INDEXMODE_360 = 2;
|
||||
}
|
||||
|
||||
message HardwareInput {
|
||||
message HardwareInputProto {
|
||||
optional int32 drive = 1 [default = 0];
|
||||
optional double revolutions = 2 [default = 1.2];
|
||||
|
||||
@@ -16,7 +16,7 @@ message HardwareInput {
|
||||
optional bool high_density = 6 [default = true];
|
||||
}
|
||||
|
||||
message TestPatternInput {
|
||||
message TestPatternInputProto {
|
||||
optional double interval_us = 1 [default = 4.0];
|
||||
optional double sequence_length_us = 2 [default = 200.0];
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ FlagGroup hardwareFluxSourceFlags = {
|
||||
class HardwareFluxSource : public FluxSource
|
||||
{
|
||||
public:
|
||||
HardwareFluxSource(const HardwareInput& config):
|
||||
HardwareFluxSource(const HardwareInputProto& config):
|
||||
_config(config)
|
||||
{
|
||||
usbSetDrive(_config.drive(), fluxSourceSinkHighDensity, _config.index_mode());
|
||||
@@ -56,12 +56,12 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
const HardwareInput& _config;
|
||||
const HardwareInputProto& _config;
|
||||
nanoseconds_t _oneRevolution;
|
||||
nanoseconds_t _hardSectorThreshold;
|
||||
};
|
||||
|
||||
std::unique_ptr<FluxSource> FluxSource::createHardwareFluxSource(const HardwareInput& config)
|
||||
std::unique_ptr<FluxSource> FluxSource::createHardwareFluxSource(const HardwareInputProto& config)
|
||||
{
|
||||
return std::unique_ptr<FluxSource>(new HardwareFluxSource(config));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
class TestPatternFluxSource : public FluxSource
|
||||
{
|
||||
public:
|
||||
TestPatternFluxSource(const TestPatternInput& config):
|
||||
TestPatternFluxSource(const TestPatternInputProto& config):
|
||||
_config(config)
|
||||
{}
|
||||
|
||||
@@ -30,10 +30,10 @@ public:
|
||||
void recalibrate() {}
|
||||
|
||||
private:
|
||||
const TestPatternInput& _config;
|
||||
const TestPatternInputProto& _config;
|
||||
};
|
||||
|
||||
std::unique_ptr<FluxSource> FluxSource::createTestPatternFluxSource(const TestPatternInput& config)
|
||||
std::unique_ptr<FluxSource> FluxSource::createTestPatternFluxSource(const TestPatternInputProto& config)
|
||||
{
|
||||
return std::unique_ptr<FluxSource>(new TestPatternFluxSource(config));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user