WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
ConfigurationWriter.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX INC.
15******************************************************************************/
16#ifndef CPP_APP_CONFIGURATION_WRITER_H
17#define CPP_APP_CONFIGURATION_WRITER_H
18
19#include <future>
20
21#include "EventLogger.h"
22#include "utils/AutoDoc.h"
23#include "ImNode.h"
24#include "Connection.h"
25
26namespace warptwin {
29 public:
32
39 void file(const std::string &filename) {_filename = filename;}
40 std::string file() {return _filename;}
41
44 void eventLogger(EventLogger* logger_ptr) {_logger_ptr = logger_ptr;}
45
49 void watchNode(ImNode* target);
50
54 void unwatchNode(ImNode* target);
55
57 virtual void write();
58
61 virtual std::future<int> build() = 0;
62
65 std::future<int> run() {return std::future<int>();}
66
68 int post() {return NO_ERROR;}
69 protected:
72
74 virtual void _decomposeNodeInformation() {}
75
77 virtual void _writeOutputStart() {}
78
81 virtual void _writeDataValue(ImNode* node) {}
82
86 virtual void _writeDataConnection(Connection* upstream, Connection* downstream) {}
87
89 virtual void _writeLogData() {}
90
92 virtual void _writeOutputEnd() {}
93
94 // Autodoc framework, which we repurpose here for writing to file
96
97 // EventLogger instance for error logging
99
100 // Vector in which to store watched nodes
101 std::vector<ImNode*> _watched_nodes;
102
103 // Vector in which to store sequenced nodes
104 std::vector<ImNode*> _sequenced_nodes;
105
106 // Vector of sequenced connections
107 std::vector<std::pair<Connection*, Connection*>> _paired_connections;
108
109 // String to record our filename
110 std::string _filename = "gui_config_file.py";
111 };
112}
113
114#endif
Class to document from code.
Definition AutoDoc.h:80
EventLogger * _logger_ptr
Definition ConfigurationWriter.h:98
virtual void _writeDataConnection(Connection *upstream, Connection *downstream)
Write the connection of one "Connection" to another.
Definition ConfigurationWriter.h:86
std::future< int > run()
Write, build, and run the resulting file.
Definition ConfigurationWriter.h:65
virtual ~ConfigurationWriter()
Definition ConfigurationWriter.h:31
std::vector< ImNode * > _watched_nodes
Definition ConfigurationWriter.h:101
void file(const std::string &filename)
Set the file for write and redirect output to that file.
Definition ConfigurationWriter.h:39
int post()
Run post-processing as applicable.
Definition ConfigurationWriter.h:68
std::vector< std::pair< Connection *, Connection * > > _paired_connections
Definition ConfigurationWriter.h:107
std::vector< ImNode * > _sequenced_nodes
Definition ConfigurationWriter.h:104
virtual void _writeDataValue(ImNode *node)
Write the creation of a single node, given by node.
Definition ConfigurationWriter.h:81
AutoDoc * _autodoc_ptr
Definition ConfigurationWriter.h:95
ConfigurationWriter()
Definition ConfigurationWriter.h:30
virtual void _writeLogData()
Write all logged data to file.
Definition ConfigurationWriter.h:89
virtual void _writeOutputEnd()
Write the end of the file output.
Definition ConfigurationWriter.h:92
std::string file()
Definition ConfigurationWriter.h:40
void unwatchNode(ImNode *target)
Remove a node from the ConfigurationWriter for tracking.
Definition ConfigurationWriter.cpp:32
virtual void _decomposeNodeInformation()
Decompose all relevant strings from the provided node and connection information.
Definition ConfigurationWriter.h:74
std::string _filename
Definition ConfigurationWriter.h:110
virtual void _setNodeConnectionSequence()
Set the sequence of nodes for creation and write paired connections.
Definition ConfigurationWriter.h:71
virtual void write()
Write watched node data to file.
Definition ConfigurationWriter.cpp:45
void watchNode(ImNode *target)
Add a node to the ConfigurationWriter for tracking.
Definition ConfigurationWriter.cpp:19
void eventLogger(EventLogger *logger_ptr)
Set the event logger instance for error logging.
Definition ConfigurationWriter.h:44
virtual void _writeOutputStart()
Write the start of the file.
Definition ConfigurationWriter.h:77
virtual std::future< int > build()=0
Write and build the resulting file.
Class to handle event and debug logging.
Definition EventLogger.h:50
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
const int NO_ERROR
Definition simlicense.cpp:30
Hold all information related to a connection point in the ImGUI UX.
Definition Connection.h:57
Hold all data related to a visual node in the ImGUI UX.
Definition ImNode.h:43