MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / init

Method init

src/gui2/datastore.cc:209–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209void Datastore::init()
210{
211 runOnWorkerThread(
212 []
213 {
214 Logger::setLogger(
215 [](const AnyLogMessage& message)
216 {
217 hex::TaskManager::doLater(
218 [=]
219 {
220 hex::ImHexApi::System::unlockFrameRate();
221 Datastore::onLogMessage(message);
222 });
223 });
224 });
225
226 probeDevices();
227
228 Events::SeekToSectorViaPhysicalLocation::subscribe(
229 [](CylinderHeadSector physicalLocation)
230 {
231 if (!diskLayout)
232 return;
233 auto& ptlo = findOptionally(diskLayout->layoutByPhysicalLocation,
234 {physicalLocation.cylinder, physicalLocation.head});
235 if (ptlo.has_value())
236 {
237 auto& ptl = *ptlo;
238 auto offseto = findOptionally(
239 diskLayout->sectorOffsetByLogicalSectorLocation,
240 {ptl->logicalTrackLayout->logicalCylinder,
241 ptl->logicalTrackLayout->logicalHead,
242 physicalLocation.sector});
243 if (offseto.has_value())
244 hex::ImHexApi::HexEditor::setSelection(hex::Region(
245 *offseto, ptl->logicalTrackLayout->sectorSize));
246 }
247 });
248
249 Events::SeekToTrackViaPhysicalLocation::subscribe(
250 [](CylinderHead physicalLocation)
251 {
252 if (!disk || !diskLayout)
253 return;
254 auto ptlo = findOptionally(diskLayout->layoutByPhysicalLocation,
255 {physicalLocation.cylinder, physicalLocation.head});
256 if (!ptlo.has_value())
257 return;
258 auto ptl = *ptlo;
259 auto ltl = ptl->logicalTrackLayout;
260 unsigned firstSectorId = ltl->filesystemSectorOrder.front();
261 unsigned lastSectorId = ltl->filesystemSectorOrder.back();
262
263 unsigned startOffset =
264 diskLayout->sectorOffsetByLogicalSectorLocation.at(
265 {ltl->logicalCylinder, ltl->logicalHead, firstSectorId});
266 unsigned endOffset =

Callers

nothing calls this directly

Calls 3

runOnWorkerThreadFunction · 0.85
findOptionallyFunction · 0.85
wtRebuildConfigurationFunction · 0.85

Tested by

no test coverage detected