Skip to content

Commit

Permalink
improve comments
Browse files Browse the repository at this point in the history
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
  • Loading branch information
n-eiling committed Jul 30, 2024
1 parent 1338ae2 commit eab521a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dpsim-models/include/dpsim-models/Attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class Attribute : public AttributeBase,
AttributeBase::Ptr cloneValueOntoNewAttribute() override {
return AttributePointer<AttributeBase>(
AttributeStatic<T>::make(this->get()));
//TODO: This is in the real time path. We should not use heap here.
// TODO: This is in the real time path. We should not use heap here.
};

/**
Expand Down
3 changes: 2 additions & 1 deletion dpsim-villas/examples/cxx/FpgaExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ int main(int argc, char *argv[]) {
Simulation sim(args.name, args);
sim.setSystem(sys);
sim.addInterface(intf);
//sim.addLogger(logger);
// If you want to add loggging (slows down the execution) add
// sim.addLogger(logger);
sim.run();

CPS::Logger::get("FpgaExample")->info("Simulation finished.");
Expand Down
10 changes: 5 additions & 5 deletions dpsim-villas/src/InterfaceVillasQueueless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ void InterfaceVillasQueueless::open() {
createNode();
createSignals();

mNode->getFactory()->start(
nullptr); //We have no SuperNode, so just hope type_start doesnt use it...
// We have no SuperNode, so just hope type_start doesn't use it...
mNode->getFactory()->start(nullptr);

auto ret = mNode->start();
if (ret < 0) {
Expand Down Expand Up @@ -343,17 +343,17 @@ void InterfaceVillasQueueless::writeToVillas() {
"Failed to write samples to InterfaceVillas. Write returned code {}",
ret);

/* Don't throw here, because we managed to send something */
// Don't throw here, because we managed to send something
}
}

void InterfaceVillasQueueless::syncImports() {
//Block on read until all attributes with syncOnSimulationStart are read
// Block on read until all attributes with syncOnSimulationStart are read
mSequenceToDpsim = this->readFromVillas();
}

void InterfaceVillasQueueless::syncExports() {
//Just push all the attributes
// Just push all the attributes
this->writeToVillas();
}

Expand Down
4 changes: 2 additions & 2 deletions dpsim-villas/src/InterfaceWorkerVillas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,14 @@ void InterfaceWorkerVillas::readValuesFromEnv(

void InterfaceWorkerVillas::writeValuesToEnv(
std::vector<InterfaceQueued::AttributePacket> &updatedAttrs) {
//Update export sequence IDs
// Update export sequence IDs
for (const auto &packet : updatedAttrs) {
if (std::get<1>(mExports[packet.attributeId]) < packet.sequenceId) {
std::get<1>(mExports[packet.attributeId]) = packet.sequenceId;
}
}

//Remove outdated packets
// Remove outdated packets
auto beginOutdated = std::remove_if(
updatedAttrs.begin(), updatedAttrs.end(), [this](auto packet) {
return std::get<1>(mExports[packet.attributeId]) > packet.sequenceId;
Expand Down

0 comments on commit eab521a

Please sign in to comment.