#include "utils.h"
#include "manager.h"
#include "http.h"

const char *getConfigFilePath(const int &count, const char **&args) {
    if (count >= 2) return args[1];
    return "config.ini";
}

// EVENT_IVS_TRAFFIC_STAY: 交通滞留事件
// EVENT_IVS_STAYDETECTION: 停留事件
// 手动拍照
int main(const int count, const char **args) {
    hm::ReadConfig(getConfigFilePath(count, args));
    try {
        hm::StartManager();
        hm::StartHttpServer();
    } catch (...) {
        hm::StopHttpServer();
        hm::StopManager();
    }
    return 0;
}
