diff --git a/mythplugins/mythzoneminder/mythzmserver/zmserver.cpp b/mythplugins/mythzoneminder/mythzmserver/zmserver.cpp
index dd8a29c..7b91cf5 100644
a
|
b
|
void ZMServer::handleGetMonitorStatus(void) |
604 | 604 | MYSQL_RES *res; |
605 | 605 | MYSQL_ROW row; |
606 | 606 | |
607 | | string sql("SELECT id, name, type, device, channel, function, enabled " |
| 607 | string sql("SELECT Id, Name, Type, Device, Host, Channel, Function, Enabled " |
608 | 608 | "FROM Monitors;"); |
609 | 609 | if (mysql_query(&g_dbConn, sql.c_str())) |
610 | 610 | { |
… |
… |
void ZMServer::handleGetMonitorStatus(void) |
633 | 633 | string id = row[0]; |
634 | 634 | string type = row[2]; |
635 | 635 | string device = row[3]; |
636 | | string channel = row[4]; |
637 | | string function = row[5]; |
638 | | string enabled = row[6]; |
| 636 | string host = row[4]; |
| 637 | string channel = row[5]; |
| 638 | string function = row[6]; |
| 639 | string enabled = row[7]; |
639 | 640 | string name = row[1]; |
640 | 641 | string events = ""; |
641 | 642 | string zmcStatus = ""; |
642 | 643 | string zmaStatus = ""; |
643 | | getMonitorStatus(id, type, device, channel, function, |
| 644 | getMonitorStatus(id, type, device, host, channel, function, |
644 | 645 | zmcStatus, zmaStatus, enabled); |
645 | 646 | MYSQL_RES *res2; |
646 | 647 | MYSQL_ROW row2; |
… |
… |
string ZMServer::runCommand(string command) |
707 | 708 | return outStr; |
708 | 709 | } |
709 | 710 | |
710 | | void ZMServer::getMonitorStatus(string id, string type, string device, string channel, |
| 711 | void ZMServer::getMonitorStatus(string id, string type, string device, string host, string channel, |
711 | 712 | string function, string &zmcStatus, string &zmaStatus, |
712 | 713 | string enabled) |
713 | 714 | { |
… |
… |
void ZMServer::getMonitorStatus(string id, string type, string device, string ch |
717 | 718 | string command(g_binPath + "/zmdc.pl status"); |
718 | 719 | string status = runCommand(command); |
719 | 720 | |
720 | | if (enabled == "0") |
721 | | zmaStatus = device + "(" + channel + ") [-]"; |
722 | | else if (status.find("'zma -m " + id + "' running") != string::npos) |
723 | | zmaStatus = device + "(" + channel + ") [R]"; |
| 721 | if (type == "Local") |
| 722 | { |
| 723 | if (enabled == "0") |
| 724 | zmaStatus = device + "(" + channel + ") [-]"; |
| 725 | else if (status.find("'zma -m " + id + "' running") != string::npos) |
| 726 | zmaStatus = device + "(" + channel + ") [R]"; |
| 727 | else |
| 728 | zmaStatus = device + "(" + channel + ") [S]"; |
| 729 | } |
724 | 730 | else |
725 | | zmaStatus = device + "(" + channel + ") [S]"; |
| 731 | { |
| 732 | if (enabled == "0") |
| 733 | zmaStatus = host + " [-]"; |
| 734 | else if (status.find("'zma -m " + id + "' running") != string::npos) |
| 735 | zmaStatus = host + " [R]"; |
| 736 | else |
| 737 | zmaStatus = host + " [S]"; |
| 738 | } |
726 | 739 | |
727 | 740 | if (type == "Local") |
728 | 741 | { |
… |
… |
void ZMServer::getMonitorList(void) |
1234 | 1247 | m_monitors.clear(); |
1235 | 1248 | |
1236 | 1249 | string sql("SELECT Id, Name, Width, Height, ImageBufferCount, MaxFPS, Palette, "); |
1237 | | sql += " Type, Function, Enabled, Device, Controllable, TrackMotion "; |
| 1250 | sql += " Type, Function, Enabled, Device, Host, Controllable, TrackMotion "; |
1238 | 1251 | sql += "FROM Monitors"; |
1239 | 1252 | |
1240 | 1253 | MYSQL_RES *res; |
… |
… |
void ZMServer::getMonitorList(void) |
1268 | 1281 | m->function = row[8]; |
1269 | 1282 | m->enabled = atoi(row[9]); |
1270 | 1283 | m->device = row[10]; |
1271 | | m->controllable = atoi(row[11]); |
1272 | | m->trackMotion = atoi(row[12]); |
| 1284 | m->host = row[11]; |
| 1285 | m->controllable = atoi(row[12]); |
| 1286 | m->trackMotion = atoi(row[13]); |
1273 | 1287 | m_monitors[m->mon_id] = m; |
1274 | 1288 | |
1275 | 1289 | initMonitor(m); |
diff --git a/mythplugins/mythzoneminder/mythzmserver/zmserver.h b/mythplugins/mythzoneminder/mythzmserver/zmserver.h
index 849f4ec..8fb6005 100644
a
|
b
|
typedef struct |
116 | 116 | string function; |
117 | 117 | int enabled; |
118 | 118 | string device; |
| 119 | string host; |
119 | 120 | int image_buffer_count; |
120 | 121 | int width; |
121 | 122 | int height; |
… |
… |
class ZMServer |
165 | 166 | void tokenize(const string &command, vector<string> &tokens); |
166 | 167 | void handleHello(void); |
167 | 168 | string runCommand(string command); |
168 | | void getMonitorStatus(string id, string type, string device, string channel, |
| 169 | void getMonitorStatus(string id, string type, string device, string host, string channel, |
169 | 170 | string function, string &zmcStatus, string &zmaStatus, |
170 | 171 | string enabled); |
171 | 172 | void handleGetServerStatus(void); |