| 232 | } |
| 233 | |
| 234 | void ObjectGcode::updateAll_() |
| 235 | { |
| 236 | if ( !gcodeSource_ ) |
| 237 | { |
| 238 | polyline_ = std::make_shared<Polyline3>(); |
| 239 | setDirtyFlags( DIRTY_ALL ); |
| 240 | return; |
| 241 | } |
| 242 | MR_TIMER; |
| 243 | GcodeProcessor executor; |
| 244 | executor.setCNCMachineSettings( cncMachineSettings_ ); |
| 245 | executor.setGcodeSource( *gcodeSource_ ); |
| 246 | actionList_ = executor.processSource(); |
| 247 | |
| 248 | maxFeedrate_ = 0.f; |
| 249 | std::shared_ptr<Polyline3> polyline = std::make_shared<Polyline3>(); |
| 250 | for ( int i = 0; i < actionList_.size(); ++i ) |
| 251 | { |
| 252 | const auto& part = actionList_[i]; |
| 253 | if ( part.action.path.empty() ) |
| 254 | continue; |
| 255 | polyline->addFromPoints( part.action.path.data(), part.action.path.size(), false ); |
| 256 | segmentToSourceLineMap_.insert( segmentToSourceLineMap_.end(), part.action.path.size() - 1, i ); |
| 257 | if ( !part.idle && part.feedrate > maxFeedrate_ ) |
| 258 | maxFeedrate_ = part.feedrate; |
| 259 | } |
| 260 | polyline_ = polyline; |
| 261 | updateColors_(); |
| 262 | updateHeapUsageCache_(); |
| 263 | setDirtyFlags( DIRTY_ALL ); |
| 264 | } |
| 265 | |
| 266 | } //namespace MR |
nothing calls this directly
no test coverage detected