fix typo in config

spilt grabber components in "GRABBER" and "V4L"
This commit is contained in:
redpanther 2016-08-31 00:54:47 +02:00
parent a85a5c0f2c
commit 9a2b167db7
8 changed files with 15 additions and 10 deletions

View File

@ -188,7 +188,7 @@
"greenSignalThreshold" : 0.0,
"blueSignalThreshold" : 0.0
}
]
],
/// The configuration for the frame-grabber, contains the following items:
/// * enable : true if the framegrabber (platform grabber) should be activated

View File

@ -117,7 +117,7 @@
"greenSignalThreshold" : 0.0,
"blueSignalThreshold" : 0.0
}
]
],
"framegrabber" :
{

View File

@ -15,7 +15,7 @@ class GrabberWrapper : public QObject
{
Q_OBJECT
public:
GrabberWrapper(std::string grabberName, const int priority);
GrabberWrapper(std::string grabberName, const int priority, hyperion::Components grabberComponentId=hyperion::COMP_GRABBER);
virtual ~GrabberWrapper();
@ -72,4 +72,5 @@ protected:
/// The processor for transforming images to led colors
ImageProcessor * _processor;
hyperion::Components _grabberComponentId;
};

View File

@ -15,7 +15,8 @@ enum Components
COMP_FORWARDER,
COMP_UDPLISTENER,
COMP_BOBLIGHTSERVER,
COMP_GRABBER
COMP_GRABBER,
COMP_V4L
};
inline const char* componentToString(Components c)
@ -29,6 +30,7 @@ inline const char* componentToString(Components c)
case COMP_UDPLISTENER: return "UDP listener";
case COMP_BOBLIGHTSERVER:return "Boblight server";
case COMP_GRABBER: return "Framegrabber";
case COMP_V4L: return "V4l Capture device";
default: return "";
}
}
@ -43,6 +45,7 @@ inline Components stringToComponent(QString component)
if (component == "UDPLISTENER") return COMP_UDPLISTENER;
if (component == "BOBLIGHTSERVER")return COMP_BOBLIGHTSERVER;
if (component == "GRABBER") return COMP_GRABBER;
if (component == "V4L") return COMP_V4L;
return COMP_INVALID;
}

View File

@ -16,7 +16,7 @@ V4L2Wrapper::V4L2Wrapper(const std::string &device,
double greenSignalThreshold,
double blueSignalThreshold,
const int priority)
: GrabberWrapper("V4L2:"+device, priority)
: GrabberWrapper("V4L2:"+device, priority, hyperion::COMP_V4L)
, _timeout_ms(1000)
, _grabber(device,
input,

View File

@ -4,7 +4,7 @@
#include <hyperion/GrabberWrapper.h>
GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority)
GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority, hyperion::Components grabberComponentId)
: _grabberName(grabberName)
, _hyperion(Hyperion::getInstance())
, _priority(priority)
@ -12,6 +12,7 @@ GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority)
, _log(Logger::getInstance(grabberName.c_str()))
, _forward(true)
, _processor(ImageProcessorFactory::getInstance().newImageProcessor())
, _grabberComponentId(grabberComponentId)
{
_timer.setSingleShot(false);
@ -44,7 +45,7 @@ void GrabberWrapper::stop()
void GrabberWrapper::componentStateChanged(const hyperion::Components component, bool enable)
{
if (component == hyperion::COMP_GRABBER && _timer.isActive() != enable)
if (component == _grabberComponentId && _timer.isActive() != enable)
{
if (enable) start();
else stop();

View File

@ -21,7 +21,7 @@
"component":
{
"type" : "string",
"enum" : ["SMOOTHING", "BLACKBORDER", "KODICHECKER", "FORWARDER", "UDPLISTENER", "BOBLIGHTSERVER", "GRABBER"],
"enum" : ["SMOOTHING", "BLACKBORDER", "KODICHECKER", "FORWARDER", "UDPLISTENER", "BOBLIGHTSERVER", "GRABBER", "V4L"],
"required": true
},
"state":

View File

@ -65,8 +65,8 @@ int main(int argc, char * argv[])
BooleanOption & argServerInfo = parser.add<BooleanOption> ('l', "list" , "List server info and active effects with priority and duration");
BooleanOption & argClear = parser.add<BooleanOption> ('x', "clear" , "Clear data for the priority channel provided by the -p option");
BooleanOption & argClearAll = parser.add<BooleanOption> (0x0, "clearall" , "Clear data for all active priority channels");
Option & argEnableComponent = parser.add<Option> ('E', "enable" , "Enable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER]");
Option & argDisableComponent = parser.add<Option> ('D', "disable" , "Disable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER]");
Option & argEnableComponent = parser.add<Option> ('E', "enable" , "Enable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L]");
Option & argDisableComponent = parser.add<Option> ('D', "disable" , "Disable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L]");
Option & argId = parser.add<Option> ('q', "qualifier" , "Identifier(qualifier) of the transform to set");
DoubleOption & argSaturation = parser.add<DoubleOption> ('s', "saturation", "!DEPRECATED! Will be removed soon! Set the HSV saturation gain of the leds");
DoubleOption & argValue = parser.add<DoubleOption> ('v', "getColors" , "!DEPRECATED! Will be removed soon! Set the HSV getColors gain of the leds");