posting message using asset file

This commit is contained in:
Lovisa Hassler
2018-09-26 15:48:32 -04:00
parent 8b50aa0b82
commit c131824651
4 changed files with 17 additions and 13 deletions

View File

@@ -8,7 +8,7 @@ local CommunicationLine = {
Parent = earthTransforms.EarthBarycenter.Identifier,
Renderable = {
Type = "CommunicationLines",
--_myMessage = "My Asset works!"
Message = "My Asset works!"
-- SourceFolder = ENLILPaths.Earth,
-- InputFileType = "osfls",
},

View File

@@ -25,10 +25,9 @@
#include <modules/dsn/dsnmodule.h>
namespace openspace {
constexpr const char* _loggerCat = "CommunicationLine";
constexpr const char* _loggerCat = "DSN Module";
DsnModule::DsnModule() : OpenSpaceModule(Name) {
LDEBUG("Hello from DSN module");
}
void DsnModule::internalInitialize(const ghoul::Dictionary&) {

View File

@@ -27,22 +27,27 @@
namespace openspace {
constexpr const char* _loggerCat = "CommunicationLine";
constexpr const char* _messageKey = "Message";
CommunicationLines::CommunicationLines(const ghoul::Dictionary& dictionary)
: Renderable(dictionary) {
//lines between space and earth
_dictionary = std::make_unique<ghoul::Dictionary>(dictionary);
CommunicationLines::PrintSomething();
CommunicationLines::PrintSomething(dictionary);
}
void CommunicationLines::PrintSomething(const ghoul::Dictionary& aDictionary) {
void CommunicationLines::PrintSomething() {
std::ofstream file{ "dsnmodule.txt" };
file << _myMessage << std::endl;
file.close();
bool success = aDictionary.getValue(_messageKey, _myMessage);
if (!success) {
LERROR("ERROR DICTIONARY");
}
std::ofstream file{ "dsnmodule.txt" };
file << _myMessage << std::endl;
file.close();
LDEBUG(_myMessage);
}
void CommunicationLines::render(const RenderData& data, RendererTasks&) {

View File

@@ -36,10 +36,10 @@ namespace openspace {
class CommunicationLines : public Renderable {
public:
std::string _myMessage;
CommunicationLines(const ghoul::Dictionary& dictionary);
void PrintSomething();
void PrintSomething(const ghoul::Dictionary& dictionary);
void initializeGL() override;
void deinitializeGL() override;
@@ -50,7 +50,7 @@ public:
void update(const UpdateData& data) override;
private:
std::unique_ptr<ghoul::Dictionary> _dictionary;
std::string _myMessage = "base";
};
}