Load mqtt subscriptions from db when loading monitor
This commit is contained in:
parent
763209ce15
commit
fb8db3b046
|
@ -83,7 +83,7 @@ std::string load_monitor_sql =
|
||||||
"`SectionLength`, `MinSectionLength`, `FrameSkip`, `MotionFrameSkip`, "
|
"`SectionLength`, `MinSectionLength`, `FrameSkip`, `MotionFrameSkip`, "
|
||||||
"`FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`,"
|
"`FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`,"
|
||||||
"`RTSPServer`, `RTSPStreamName`,"
|
"`RTSPServer`, `RTSPStreamName`,"
|
||||||
"`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1 FROM `Monitors`";
|
"`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1, `MQTT_Subscriptions` FROM `Monitors`";
|
||||||
|
|
||||||
std::string CameraType_Strings[] = {
|
std::string CameraType_Strings[] = {
|
||||||
"Unknown",
|
"Unknown",
|
||||||
|
@ -447,7 +447,7 @@ Monitor::Monitor()
|
||||||
"SectionLength, MinSectionLength, FrameSkip, MotionFrameSkip, "
|
"SectionLength, MinSectionLength, FrameSkip, MotionFrameSkip, "
|
||||||
"FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif,"
|
"FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif,"
|
||||||
"`RTSPServer`,`RTSPStreamName`,
|
"`RTSPServer`,`RTSPStreamName`,
|
||||||
"SignalCheckPoints, SignalCheckColour, Importance-1 FROM Monitors";
|
"SignalCheckPoints, SignalCheckColour, Importance-1, `MQTT_Subscriptions` FROM Monitors";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) {
|
void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) {
|
||||||
|
@ -628,9 +628,11 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) {
|
||||||
blue_val = BLUE_VAL_BGRA(signal_check_colour);
|
blue_val = BLUE_VAL_BGRA(signal_check_colour);
|
||||||
grayscale_val = signal_check_colour & 0xff; /* Clear all bytes but lowest byte */
|
grayscale_val = signal_check_colour & 0xff; /* Clear all bytes but lowest byte */
|
||||||
|
|
||||||
importance = dbrow[col] ? atoi(dbrow[col]) : 0;// col++;
|
importance = dbrow[col] ? atoi(dbrow[col]) : 0; col++;
|
||||||
if (importance < 0) importance = 0; // Should only be >= 0
|
if (importance < 0) importance = 0; // Should only be >= 0
|
||||||
|
|
||||||
|
mqtt_subscriptions = Split(std::string(dbrow[col] ? dbrow[col] : ""), ','); col++;
|
||||||
|
|
||||||
// How many frames we need to have before we start analysing
|
// How many frames we need to have before we start analysing
|
||||||
ready_count = std::max(warmup_count, pre_event_count);
|
ready_count = std::max(warmup_count, pre_event_count);
|
||||||
|
|
||||||
|
|
|
@ -401,6 +401,7 @@ protected:
|
||||||
|
|
||||||
std::vector<Zone> zones;
|
std::vector<Zone> zones;
|
||||||
|
|
||||||
|
std::vector<std::string> mqtt_subscriptions;
|
||||||
std::unique_ptr<MQTT> mqtt;
|
std::unique_ptr<MQTT> mqtt;
|
||||||
|
|
||||||
const unsigned char *privacy_bitmask;
|
const unsigned char *privacy_bitmask;
|
||||||
|
|
Loading…
Reference in New Issue