2025-03-29 18:05:12 +08:00
|
|
|
#include "vibrationdata.h"
|
2025-09-27 21:34:27 +08:00
|
|
|
#include <QDebug>
|
2025-04-01 15:03:59 +08:00
|
|
|
VibrationData::VibrationData() {
|
|
|
|
|
}
|
2025-03-29 18:05:12 +08:00
|
|
|
|
2025-04-01 15:03:59 +08:00
|
|
|
std::shared_ptr<VariableBase> VibrationData::GetChannelPtr(int cid) {
|
|
|
|
|
for (auto &item : variables_) {
|
|
|
|
|
if (item->id_ == cid) {
|
|
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nullptr;
|
2025-03-29 18:05:12 +08:00
|
|
|
}
|
2025-09-27 21:34:27 +08:00
|
|
|
void VibrationData::InsertChannelPtr(std::shared_ptr<RadialVariable> variable_base){
|
|
|
|
|
variables_.push_back(variable_base);
|
|
|
|
|
}
|
|
|
|
|
void VibrationData::InsertChannelPtr(std::shared_ptr<AccVelVariable> variable_base){
|
|
|
|
|
variables_.push_back(variable_base);
|
|
|
|
|
}
|
|
|
|
|
void VibrationData::InsertChannelPtr(std::shared_ptr<ThrustVariable> variable_base){
|
|
|
|
|
variables_.push_back(variable_base);
|
|
|
|
|
}
|
|
|
|
|
void VibrationData::InsertChannelPtr(std::shared_ptr<PressurePulsationVariable> variable_base){
|
|
|
|
|
variables_.push_back(variable_base);
|
|
|
|
|
}
|
2025-04-01 17:52:25 +08:00
|
|
|
void VibrationData::RemoveChannel(int cid) {
|
|
|
|
|
std::vector<std::shared_ptr<VariableBase>> tmp;
|
|
|
|
|
for (auto &item : variables_) {
|
|
|
|
|
if (item->id_ != cid) {
|
|
|
|
|
tmp.push_back(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
variables_.clear();
|
|
|
|
|
variables_ = tmp;
|
|
|
|
|
}
|