¿ªÔÆÌåÓý

Locked Re: Is there any way to add time stamp to SensorLog.py? #scripting


 

Wain,

An alternate solution to Cliff¡¯s approach.

Add "import time¡±

Change the print line:

print time.strftime("%Y-%m-%d %H:%M:%S"), mesg


Dave Sand

On Nov 21, 2018, at 9:09 AM, Wain Schroeder <niaw1@...> wrote:

Hi,

I have recently started using SensorLog.py as a tool to validate block assignments on our layout and it works quite well, thank you. The only change I would like to see would be to add a time stamp to the output line when a sensor is triggered (ACTIVE/INACTIVE). I'd be more than glad to do this modification myself, but am not familiar with coding of py-type scripts and am afraid I'd really mess things up if I do attempt it without guidance.

Here is an example of how I would like to see this enhancement:

2018-11-20 18:53:17, Sensor LS123 from INACTIVE to ACTIVE
2018-11-20 18:53:52, Sensor LS123 from ACTIVE to INACTIVE

BTW - using PanelPro version 4.12+Rb6a9bb1 under Java 1.8.0_151 on Windows 7 amd64 v6.1

Thanks in advance,

Wain Schroeder

Join [email protected] to automatically receive all group messages.