Skip to content
Open
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
31 changes: 30 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
*/
void RequestListener::run(GNet::GServer* serverInstance)
{

// if input from web API..

// if input from discord..

// blah

shmea::GString command = "python3 python/server.py";
printf("Service Command: %s\n", command.c_str());
FILE* p = popen(command.c_str(), "r");
Expand All @@ -53,6 +60,28 @@ void RequestListener::run(GNet::GServer* serverInstance)
printf("%c", ch);
}

//printf("Server Output: %s\n", newStr.c_str());
//XBTUSD ENUM false 100010 100020 true false
const vector<shmea::GString> input= newStr.split(" ");

// Run an offline historical simulation
shmea::GList wData;
//ticker
wData.addString(input[0]);
//newAgg
wData.addInt(input[1]);
//guiEnabled
wData.addBoolean(false);
//startTs
wData.addLong(input[3]);
//endTs
wData.addLong(input[4]);
//tradingActivated
wData.addBoolean(input[5]);
wData.addBoolean(input[6]);

shmea::ServiceData* cSrvc = new shmea::ServiceData(destination, "HistEngine");
cSrvc->set("mainSim"+shmea::GString::intTOstring(simCount), wData);
serverInstance->send(cSrvc);

pclose(p);
}