From 299b041f014f75f6dbe6edc6d4419132fbd882f9 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 14 Jan 2025 10:41:11 -0500 Subject: [PATCH] Support Experience StandAlone mode --- xLights/controllers/Experience.cpp | 12 +++++++++++- xLights/controllers/Experience.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xLights/controllers/Experience.cpp b/xLights/controllers/Experience.cpp index 04caea0ca..ee72c2490 100644 --- a/xLights/controllers/Experience.cpp +++ b/xLights/controllers/Experience.cpp @@ -156,6 +156,13 @@ Experience::Experience(std::string const& ip, std::string const& proxy) : return; } + wxJSONValue config; + + if (!GetJSONData(GetConfigURL(), config)) { + logger_base.error("Error connecting to Genius controller on %s.", (const char*)_ip.c_str()); + return; + } + if (data.Size() > 0) { // decode controller type _model = data["system"]["controller_model_name"].AsString(); @@ -177,6 +184,9 @@ Experience::Experience(std::string const& ip, std::string const& proxy) : logger_base.error("Error connecting to Genius controller on %s.", (const char*)_ip.c_str()); DisplayError(wxString::Format("Error connecting to Genius controller on %s.", _ip).ToStdString()); } + if (config.Size() > 0) { + _opMode = config["system"]["operating_mode"].AsString(); + } } #pragma endregion @@ -227,7 +237,7 @@ int32_t Experience::SetInputUniverses(wxJSONValue& data, Controller* controller) data["inputs"] = universes; data["system"]["operating_mode"] = out->GetType() == OUTPUT_E131 ? wxString("e1.31") : wxString("artnet"); } else if (out->GetType() == OUTPUT_DDP) { - data["system"]["operating_mode"] = wxString("ddp"); + data["system"]["operating_mode"] = wxString(_opMode); DDPOutput* ddp = (DDPOutput*)out; if (ddp->IsKeepChannelNumbers()) { data["system"]["start_channel"] = startChannel; diff --git a/xLights/controllers/Experience.h b/xLights/controllers/Experience.h index 70fe62706..e9e9fde34 100644 --- a/xLights/controllers/Experience.h +++ b/xLights/controllers/Experience.h @@ -36,6 +36,7 @@ class Experience : public BaseController int _numberOfRemoteOutputs{ 0 }; int _numberOfSerialOutputs{ 0 }; bool _has_efuses{ false }; + std::string _opMode = "ddp"; #pragma endregion