Commit 551c07b7 authored by Locatelli's avatar Locatelli
Browse files

read clientType nomad property

parent 42228307
......@@ -11,7 +11,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1871673139790983960" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1872269827090070488" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
......
......@@ -75,8 +75,8 @@ std::unique_ptr<cameo::application::Instance> getPloty2Instance(cameo::Server &
* \param[in] appli the name of application to connect on cameo server
* \return the server end point string
*/
std::string getServerEndPoint(const std::string& appli) {
std::string buf = "tcp://localhost:7000";
std::string getNomadProperty(const std::string& propertyname) {
std::string buf;
std::string fileName(getenv("HOME"));
fileName.append("/.nomad/settings.properties");
......@@ -94,15 +94,26 @@ std::string getServerEndPoint(const std::string& appli) {
std::string propertyName = line.substr(0, equalPosition);
std::string propertyValue = line.substr(equalPosition + 1, line.size() - equalPosition - 1);
if (propertyName == "serverEndpoint") {
if (propertyName == propertyname) {
buf = propertyValue;
break;
}
}
}
file.close();
}
return buf;
}
/*!
* \brief get server end point
* \param[in] appli the name of application to connect on cameo server
* \return the server end point string
*/
std::string getServerEndPoint(const std::string& appli) {
std::string buf = "tcp://localhost:7000";
buf += ":";
buf += appli;
buf += getNomadProperty("serverEndpoint");
return buf;
}
......
......@@ -61,22 +61,17 @@ int main(int32 argc, char* argv[]) {
// Need to create Mpl in main thread
shared_ptr<view::mpl::Mpl> mpl = make_shared<view::mpl::Mpl>();
bool remote = false;
if (string(argv[2]).find("remote") != string::npos) {
remote = true;
}
else if (string(argv[2]).find("local") != string::npos) {
remote = false;
}
// Init cameo application
int32 err = EXIT_SUCCESS;
application::This::init(1, &argv[3]);
application::This::init(1, &argv[2]);
{
if (remote == true) {
bool remote = false;
string clientype = getNomadProperty("clientType");
if (clientype == "remote") {
DBGMSG("Start ploty in remote mode");
}
else {
DBGMSG("Start ploty in local mode");
DBGMSG("Start ploty in main mode");
}
// Get nomad server instance
nomadserver = getNomadInstance(application::This::getServer());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment