Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExperienceLights support for Remote/Standalone modes #5115

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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