Skip to content

Commit 4c809d8

Browse files
committed
Add total_surface stream and channels property.
1 parent 26a1058 commit 4c809d8

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

catkit_core/DeformableMirrorService.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ DeformableMirrorService::DeformableMirrorService(std::string service_type, std::
6060
m_ChannelStreams[channel_id]->SubmitData(startup_map.data());
6161
}
6262
}
63+
64+
// Create total surface data stream.
65+
m_TotalSurface = DataStream::Create("total_surface", GetId(), DataType::DT_FLOAT64, {m_NumActuators}, 20);
66+
67+
// Create channels property.
68+
List channels;
69+
for (auto channel_id : m_ChannelIds)
70+
channels.push_back(Value(channel_id));
71+
72+
MakeProperty("channels", [channels]() { return channels; });
6373
}
6474

6575
DeformableMirrorService::~DeformableMirrorService()
@@ -140,4 +150,6 @@ void DeformableMirrorService::ApplySurfaceDelta(double *surface_delta)
140150

141151
// Apply the current surface to the deformable mirror.
142152
ApplySurface(m_CurrentSurface);
153+
154+
m_TotalSurface->SubmitData(m_CurrentSurface);
143155
}

catkit_core/DeformableMirrorService.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class DeformableMirrorService : public Service
3535
std::vector<std::string> m_ChannelIds;
3636
std::map<std::string, std::thread> m_ChannelThreads;
3737
std::map<std::string, std::shared_ptr<DataStream>> m_ChannelStreams;
38+
39+
std::shared_ptr<DataStream> m_TotalSurface;
3840
};
3941

4042
#endif // DEFORMABLE_MIRROR_SERVICE_H

0 commit comments

Comments
 (0)