26 #ifndef C_OPENDSS_ADAPTER_HPP 27 #define C_OPENDSS_ADAPTER_HPP 31 #include <boost/enable_shared_from_this.hpp> 32 #include <boost/shared_ptr.hpp> 33 #include <boost/asio/io_service.hpp> 34 #include <boost/asio/ip/tcp.hpp> 35 #include <boost/asio/deadline_timer.hpp> 36 #include <boost/property_tree/ptree_fwd.hpp> 54 ,
public boost::enable_shared_from_this<COpenDssAdapter>
58 typedef boost::shared_ptr<COpenDssAdapter>
Pointer;
62 const boost::property_tree::ptree & ptree);
79 const boost::property_tree::ptree & ptree);
82 void Run(
const boost::system::error_code & e);
125 #endif // C_RTDS_ADAPTER_HPP static std::string openDss_data
variable to hold opendss data
Definition: COpenDssAdapter.hpp:115
COpenDssAdapter(boost::asio::io_service &service, const boost::property_tree::ptree &ptree)
Constructor.
Definition: COpenDssAdapter.cpp:104
std::string m_host
The hostname of the remote host.
Definition: COpenDssAdapter.hpp:100
boost::asio::deadline_timer m_runTimer
Timer object to set communication cycle pace.
Definition: COpenDssAdapter.hpp:94
static IAdapter::Pointer Create(boost::asio::io_service &service, const boost::property_tree::ptree &ptree)
Create a COpenDssAdapter object and returns a pointer to it.
Definition: COpenDssAdapter.cpp:86
void Run(const boost::system::error_code &e)
Continuous loop for sending and receiving to/from opendss.
Definition: COpenDssAdapter.cpp:152
static char buffer[BUFFER_SIZE]
Definition: COpenDssAdapter.hpp:112
static unsigned int sd
socket desciptor and int n for error handling
Definition: COpenDssAdapter.hpp:109
static std::string GetData()
Definition: COpenDssAdapter.cpp:187
static void sendCommand(std::string command)
send commands
Definition: COpenDssAdapter.cpp:225
static unsigned int n
Definition: COpenDssAdapter.hpp:109
boost::shared_ptr< COpenDssAdapter > Pointer
Pointer to an COpenDssAdapter object.
Definition: COpenDssAdapter.hpp:58
~COpenDssAdapter()
Destructor.
Definition: COpenDssAdapter.cpp:244
void Start()
Starts the adapter.
Definition: COpenDssAdapter.cpp:122
void ReverseBytes(char *buffer, const int numBytes)
Reverses all of the bytes in a buffer.
Definition: COpenDssAdapter.cpp:259
static const unsigned int BUFFER_SIZE
buffer size in bytes of the simulation packet
Definition: COpenDssAdapter.hpp:106
boost::asio::ip::tcp::socket m_socket
Socket to use for the TCP connection.
Definition: COpenDssAdapter.hpp:97
Buffer adapter device interface.
Definition: IBufferAdapter.hpp:47
std::string m_port
The port number of the remote host.
Definition: COpenDssAdapter.hpp:103
void Connect()
Creates a socket connection to the given hostname and port number.
Definition: COpenDssAdapter.cpp:313
void EndianSwapIfNeeded(std::vector< SignalValue > &v)
Swaps the endianness of all SignalValues in a vector.
Definition: COpenDssAdapter.cpp:283
void Stop()
Shut down communication to FPGA.
Definition: COpenDssAdapter.cpp:199
General FREEDM Namespace.
Definition: CBroker.cpp:53
Provides an interface for communicating with a opendss simulation model.
Definition: COpenDssAdapter.hpp:52
boost::shared_ptr< IAdapter > Pointer
Pointer to a physical adapter.
Definition: IAdapter.hpp:72