Configure totalDistance and totalTime calculation

Hallo, so I was trying to adding a feature to calculate rate spraying for my sprayer drone in QGC, I hope that with the input totalDistance and totalTime value from mission creation I could calculate the sprayer rate that I need and automatically send it to the vehicle. the problem is, the distance value itself is still mixed with value from homeToMission distance and exitToHome distance, whereas I only need the value of waypoint totalDistance. I already find the responsible function to calculate totalDistance in missionController.cc and FlightPathSegment.cc, but I still confuse which construct is responsible for homeToMission and exitToHome distance. Thank you