Skip to content

Commit

Permalink
Experience support Remote/StandAlone modes
Browse files Browse the repository at this point in the history
  • Loading branch information
cybercop23 authored and dkulp committed Jan 17, 2025
1 parent 4dd2294 commit f871a45
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
21 changes: 19 additions & 2 deletions xLights/controllers/Experience.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -177,6 +184,10 @@ 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
Expand Down Expand Up @@ -225,9 +236,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");
DDPOutput* ddp = (DDPOutput*)out;
if (ddp->IsKeepChannelNumbers()) {
data["system"]["start_channel"] = startChannel;
Expand All @@ -244,6 +253,14 @@ int32_t Experience::SetInputUniverses(wxJSONValue& data, Controller* controller)
return startChannel;
}

if (_opMode == "standalone" || _opMode == "remote") {
data["system"]["operating_mode"] = wxString(_opMode);
} else if (out->GetType() == OUTPUT_DDP) {
data["system"]["operating_mode"] = wxString("ddp");
} else {
data["system"]["operating_mode"] = out->GetType() == OUTPUT_E131 ? wxString("e1.31") : wxString("artnet");
}

return startChannel;
}

Expand Down
1 change: 1 addition & 0 deletions xLights/controllers/Experience.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Experience : public BaseController
int _numberOfRemoteOutputs{ 0 };
int _numberOfSerialOutputs{ 0 };
bool _has_efuses{ false };
std::string _opMode = "ddp";

#pragma endregion

Expand Down

0 comments on commit f871a45

Please sign in to comment.