NetTalk Central

Author Topic: Nettalk Maps problem with DrawRoutes  (Read 1642 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1846
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Nettalk Maps problem with DrawRoutes
« on: July 13, 2020, 01:43:10 PM »
In NetMaps.clw you call a proc to Draw all routes, it is like:

Code: [Select]
NetMapsBase.DrawRoutes  Procedure(Long pDisplay=true)
doneRoute  like(self.RouteQueue.Id)
x   long
  Code
  loop x = 1 to records(self.RouteQueue)
    get(self.RouteQueue,x)
    if self.RouteQueue.Id <> doneRoute
      self._DrawRoute(self.RouteQueue.Id)
      doneRoute = self.RouteQueue.Id
    end
  end

self.RouteQueue has ALL the wps of ALL routes
you are trying to call self._DrawRoute once each time the route ID changes
but self._DrawRoute does not filter by self.RouteQueue.Id and loops over all the waypoint of the routes
and at the end self.RouteQueue.Id is not the original route id but the last
then all the following records are different from doneRoute and the routine is called thouthand of times
to solve this you have to put the line:
      doneRoute = self.RouteQueue.Id
before
      self._DrawRoute(self.RouteQueue.Id)

But you still have a problem, self._DrawRoute is not filtering by route id, then when you have many routes the last wps of one route is linked with the first of the next route.
Another problem is that self._DrawRoute is taking the first record of the queue as the fisrt wp.
So you need to change the self._DrawRoute logic to draw only the wps of the route ID.

The queue is suppouse to be sorted by ID and the order obtained by the optimization.
So get the first route.Id record and loop till it change may be a solution.

Hope this helps

« Last Edit: July 13, 2020, 02:20:25 PM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: Nettalk Maps problem with DrawRoutes
« Reply #1 on: July 13, 2020, 09:18:27 PM »
thanks, fixed for the next build.