<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">Hi Didier,</p><div class="gmail_quote"><br>On Thu, May 27, 2010 at 10:41 AM, Didier Genier <span dir="ltr"><<a href="mailto:didier.genier@gmail.com">didier.genier@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I have a need for a gps-tracking application. With a static position of map I want refresh one ore more vector layers (points) to follow vehicles. Data side the work is allready made with a PostGis database and Talend ETL to write every 15' seconds a view with the last position of tracked vehicles. But, in QGis I must refresh manually to see the latest positions.<br>


<br>I have tested to write something like iface.mapCanvas().refresh() with python, it's work but my without automation.<br></blockquote><div><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">

You can use console to do this:</p>
<p style="margin: 0px; text-indent: 0px;">>>> from PyQt4.QtCore import *</p>

<p style="margin: 0px; text-indent: 0px;">>>> timer = QTimer()</p>
<p style="margin: 0px; text-indent: 0px;">>>> timer.setInterval(15000)</p>>>> QObject.connect(timer, SIGNAL("timeout()"), qgis.utils.iface.mapCanvas().refresh)<br>
>>> timer.start()<br>
<br> you can stop it simply typing:<br>
>>> timer.stop()<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">- Is somebody able to help me for writing a plugin fo doing this ?<br>

</blockquote><div><br>You can use the code above to create a plugin, by connecting timer.start and <br>timer.stop to a checkbox or buttons<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


- Is something already existing to do this ?   </blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> - Is this need enough interessant for developpers for a wish to the next version ?<br>

</blockquote><div><br>I think could be interessant, but I don't know if something already exists.<br><br>Cheers.<br><br></div></div>-- <br>Giuseppe Sucameli<br>