VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Network Interface

The DtIndividualLocalEntityNetInterfaceWithTemperature is a new class that replaces the default local entity network interface to also update the temperature. This is done by copying the temperature from the state component to a new subclass of the VR-Link entity state repository which includes the new attribute.


Header file:

/*******************************************************************************
** Copyright (c) 2021 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
#pragma once
//
// class DtIndividualLocalEntityNetInterfaceWithTemperature
//
// This class replaces the default local entity network interface, which is responsible.
// for copying internal entity state to the VR-Link publisher which outputs that data to
// the network. Reads the new state component and copies the data to a new VR-Link
// entity state repository subclass for output to the network.
// This class currently only support HLA. It utilizes a new FOM that adds an attribute to the
// standard RPR PhysicalEntity object class.
{
public:
// read/writable constructor
// destructor
// Copies the temperature from the VR-Forces state component into the
// VR-Link state repository for publication.
virtual void updatePublisher() override;
// Overridden to completely replace the default VR-Forces interface.
// See the comment in the definition.
virtual DtString type() const override;
// Creates a new DtIndividualLocalEntityNetInterfaceWithTemperature
protected:
// default constructor; not implemented
// copy constructor; not implemented
DtReaderWriterRegistry* parentRegistry = 0);
// assignment operator; not implemented
};

Implementation:

/*******************************************************************************
** Copyright (c) 2021 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
#if DtHLA
// read/writable constructor
makVrf::DtVrlinkNetworkInterface* mgr, bool publishObject) :
DtSimIndividualLocalEntityWithPropertiesNetInterface(vrfObject,
mgr, publishObject)
{
}
// destructor
{
}
{
dynamic_cast<DtEntityStateRepWithTemperature*>(netState);
if (!tempState)
{
DtWarn("Cannot cast net state to DtEntityStateRepWithTemperature\n");
DtSimIndividualLocalEntityNetInterface::updatePublisher();
return;
}
{
if (stateComp)
{
// Copy the temperature value to the network state from the vrf state.
tempState->setTemperature(stateComp->internalCoreTemperature());
}
}
DtSimIndividualLocalEntityNetInterface::updatePublisher();
}
{
// Registering this VR-Forces default string (defined in vrfNetIfTypes.h)
// has the effect of changing the net interface for all OPE entries which
// use this string for their "net-interface" parameter.
}
makVrf::DtStateData* vrfObject, makVrf::DtVrlinkNetworkInterface* mgr, bool publishObject)
{
mgr, publishObject);
}
#endif

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)