| 148 | } |
| 149 | |
| 150 | void MeterModel::removeMeter(int index) |
| 151 | { |
| 152 | m_defs.remove(index); |
| 153 | m_values.remove(index); |
| 154 | m_valueUpdatedMs.remove(index); |
| 155 | |
| 156 | // Remove from per-slice LEVEL map |
| 157 | for (auto it = m_sLevelIdxBySlice.begin(); it != m_sLevelIdxBySlice.end(); ) { |
| 158 | if (it.value() == index) it = m_sLevelIdxBySlice.erase(it); |
| 159 | else ++it; |
| 160 | } |
| 161 | for (auto it = m_escLevelIdxBySlice.begin(); it != m_escLevelIdxBySlice.end(); ) { |
| 162 | if (it.value() == index) it = m_escLevelIdxBySlice.erase(it); |
| 163 | else ++it; |
| 164 | } |
| 165 | bool compressionMapChanged = false; |
| 166 | for (auto it = m_compPeakIdxByTxSource.begin(); it != m_compPeakIdxByTxSource.end(); ) { |
| 167 | if (it.value() == index) { |
| 168 | it = m_compPeakIdxByTxSource.erase(it); |
| 169 | compressionMapChanged = true; |
| 170 | } else { |
| 171 | ++it; |
| 172 | } |
| 173 | } |
| 174 | for (auto it = m_compPeakIdxBySlice.begin(); it != m_compPeakIdxBySlice.end(); ) { |
| 175 | if (it.value() == index) { |
| 176 | it = m_compPeakIdxBySlice.erase(it); |
| 177 | compressionMapChanged = true; |
| 178 | } else { |
| 179 | ++it; |
| 180 | } |
| 181 | } |
| 182 | if (index == m_fwdPwrIdx) m_fwdPwrIdx = -1; |
| 183 | if (index == m_swrIdx) m_swrIdx = -1; |
| 184 | if (index == m_micPeakIdx) m_micPeakIdx = -1; |
| 185 | if (index == m_micLevelIdx) m_micLevelIdx = -1; |
| 186 | if (index == m_compLevelIdx) m_compLevelIdx = -1; |
| 187 | if (index == m_hwAlcIdx) m_hwAlcIdx = -1; |
| 188 | if (index == m_swAlcIdx) m_swAlcIdx = -1; |
| 189 | if (index == m_paTempIdx) m_paTempIdx = -1; |
| 190 | if (index == m_supplyIdx) m_supplyIdx = -1; |
| 191 | if (index == m_ampFwdPwrIdx) m_ampFwdPwrIdx = -1; |
| 192 | if (index == m_ampSwrIdx) m_ampSwrIdx = -1; |
| 193 | if (index == m_ampTempIdx) m_ampTempIdx = -1; |
| 194 | if (index == m_tgxlFwdIdx) { |
| 195 | m_tgxlFwdIdx = -1; |
| 196 | m_tgxlFwdPwr = 0.0f; |
| 197 | m_lastTgxlFwdPowerUpdateMs = 0; |
| 198 | } |
| 199 | if (index == m_tgxlSwrIdx) { |
| 200 | m_tgxlSwrIdx = -1; |
| 201 | m_tgxlSwr = 1.0f; |
| 202 | m_lastTgxlSwrUpdateMs = 0; |
| 203 | } |
| 204 | |
| 205 | recomputeSourceIndexMins(); |
| 206 | if (compressionMapChanged) { |
| 207 | clearCompressionState(); |