fix idle slice bug.
This commit is contained in:
parent
9d50599924
commit
3646be90ae
@ -318,9 +318,8 @@ long SensorScheduler::CalcNextTimestamp(int id, uint16_t short_addr, bool &z, in
|
||||
auto iter = trigger_wave_record_.find(short_addr);
|
||||
if (iter->second.first != 0 || iter->second.second != 0) {
|
||||
for (int i = forward_wave_slice_num+1; i <= forward_wave_slice_num + wave_slice_num_per_eigen_interval_; ++i) {
|
||||
if (slice_sensor_id_[i] == 0) {
|
||||
if (slice_sensor_id_[i] == 0 || short_addr_map_.find(slice_sensor_id_[i]) == short_addr_map_.end()) {
|
||||
send_wave_ts = current_wave_start_ts_ + nth_eigen_value_slice_ * eigen_value_send_interval_ + 60 + (i - forward_wave_slice_num - 1) * 60;
|
||||
|
||||
if (free_slice_ocuppied_.count(send_wave_ts) == 0) {
|
||||
available_ts = send_wave_ts;
|
||||
free_slice_ocuppied_.insert(available_ts);
|
||||
@ -376,7 +375,7 @@ long SensorScheduler::CalcNextTimestamp(int id, uint16_t short_addr, bool &z, in
|
||||
|
||||
if (ZRetransferWave(short_addr) || XYRetransferWave(short_addr) || ZMissedWave(short_addr) || XYMissedWave(short_addr)) {
|
||||
for (int i = 1; i <= wave_slice_num_per_eigen_interval_; ++i) {
|
||||
if (slice_sensor_id_[i+forward_wave_slice_num] == 0) {
|
||||
if (slice_sensor_id_[i+forward_wave_slice_num] == 0 || short_addr_map_.find(slice_sensor_id_[i+forward_wave_slice_num]) == short_addr_map_.end()) {
|
||||
// 判断此空闲位置是否被占用
|
||||
long current_wave_slice_ts = current_wave_start_ts_ + nth_eigen_value_slice_ * eigen_value_send_interval_ + 60 + (i-1) * seconds_per_wave_slice_;
|
||||
if (free_slice_ocuppied_.count(current_wave_slice_ts) == 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user