| 143 | } |
| 144 | |
| 145 | void UpdateExplorerData() |
| 146 | { |
| 147 | if (!IsQueueEmpty()) |
| 148 | { |
| 149 | _explorerUpdatePending = true; |
| 150 | return; |
| 151 | } |
| 152 | |
| 153 | _explorerUpdatePending = false; |
| 154 | QueueJob( |
| 155 | [this]() |
| 156 | { |
| 157 | int desiredTrack = explorerTrackSpinCtrl->GetValue(); |
| 158 | int desiredSide = explorerSideSpinCtrl->GetValue(); |
| 159 | if (!_explorerFluxmap || (desiredTrack != _explorerTrack) || |
| 160 | (desiredSide != _explorerSide)) |
| 161 | { |
| 162 | _explorerFluxmap = GetContext() |
| 163 | .GetFluxSource() |
| 164 | ->readFlux(desiredTrack, desiredSide) |
| 165 | ->next(); |
| 166 | _explorerTrack = desiredTrack; |
| 167 | _explorerSide = desiredSide; |
| 168 | } |
| 169 | |
| 170 | runOnUiThread( |
| 171 | [&]() |
| 172 | { |
| 173 | _state = STATE_IDLE; |
| 174 | UpdateState(); |
| 175 | |
| 176 | FluxmapReader fmr(*_explorerFluxmap); |
| 177 | fmr.seek(explorerStartTimeSpinCtrl->GetValue() * 1e6); |
| 178 | |
| 179 | nanoseconds_t clock = |
| 180 | explorerClockSpinCtrl->GetValue() * 1e3; |
| 181 | FluxDecoder fluxDecoder(&fmr, clock, DecoderProto()); |
| 182 | fluxDecoder.readBits( |
| 183 | explorerBitOffsetSpinCtrl->GetValue()); |
| 184 | auto bits = fluxDecoder.readBits(); |
| 185 | |
| 186 | Bytes bytes; |
| 187 | switch (explorerDecodeChoice->GetSelection()) |
| 188 | { |
| 189 | case 0: |
| 190 | bytes = fakeBits(bits); |
| 191 | break; |
| 192 | |
| 193 | case 1: |
| 194 | bytes = toBytes(bits); |
| 195 | break; |
| 196 | |
| 197 | case 2: |
| 198 | bytes = decodeFmMfm(bits.begin(), bits.end()); |
| 199 | break; |
| 200 | } |
| 201 | |
| 202 | if (explorerReverseCheckBox->GetValue()) |
nothing calls this directly
no test coverage detected