tomkohler / Panel2Net

Upload data from Serial Interface to Web with HTTP Post (Python for RPi 3) for Mobatime, SwissTiming, Stramatel panels
1 stars 2 forks source link

is_numeric timeout #2

Open ikomob opened 5 years ago

ikomob commented 5 years ago

When it is timeout, my Saturn (Ver. 5.47EN) in odd seconds of Timeout (55, 53, 51 etc.) makes value of $timeoutA or $timeoutB unnumerical (x20) and because of

103 if ((!is_numeric($timeoutA)) or (!is_numeric($timeoutB))) { 104 $status = 2;

script dies every 2 seconds and only even value of timeout timer goes to XML and scorebug

Maybe it is just an issue in my version of console, but it seems to way make some kind of blinking on a Scoreboard during the Timeout

tomkohler commented 5 years ago

Hi, we stuck to very simple validation rules and this is - given the variety of wrong values coming down the pipe from the consoles - difficult to catch. Personally I have never used the timeout function in the frontend hence I am grateful that you flag the point. Would you be able to provide in general a more stable validation procedure for the value that could replace this?

ikomob commented 5 years ago

Sorry for so long silence. I'm an amateur in programming, do it onetime in several years when i need to do something very specifically so i can't provide a more stable procedure except "checking !is_numeric() in complex with value of seconds". But as for me, i think, that it is not a necessary validation when system is installed and working as it should work. Maybe it is wrong opinion, but i want to try without this part of script. I'm trying to adapt your script for using it in Hockey and with OBS. Main part is done, but some problem with Penalties. OBS doesn't understand .XML so i should use a separate .TXT for every values

tomkohler commented 5 years ago

Same here. Amateur. If your console is indeed not sending sometimes wrong sequences, then you can skip validation.

Best regards,

Thomas

On Tue, 4 Dec 2018 at 18:17, ikomob notifications@github.com wrote:

Sorry for so long silence. I'm an amateur in programming, do it one time several years when i need to do something very specifically so i can't provide a more stable procedure except "checking !is_numeric() in complex with value of seconds". But as for me, i think, that it is not a necessary validation when system is installed and working as it should work. Maybe it is wrong opinion, but i want to try without this part of script. I'm trying to adapt your script for using it in Hockey and with OBS. Main part is done, but some problem with Penalties. OBS doesn't understand .XML so i should use a separate .TXT for every values

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tomkohler/Panel2Net/issues/2#issuecomment-444181447, or mute the thread https://github.com/notifications/unsubscribe-auth/APnebcTn6Hgdyw0FDUYL4_lGwSUtF48Dks5u1q4fgaJpZM4YeyPN .

ikomob commented 5 years ago

I'm using a Saturn and cable between it and RPi not so long, so i think it will be ok :)

tomkohler commented 5 years ago

Understood, but despite this is get on some consoles quite a slot of improper elements. let's see how this pans out on your side.

On Tue, 4 Dec 2018 at 18:28, ikomob notifications@github.com wrote:

I'm using a Saturn an cable between it and RPi not so long, so i think it will be ok :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tomkohler/Panel2Net/issues/2#issuecomment-444185103, or mute the thread https://github.com/notifications/unsubscribe-auth/APnebXJD3Te9J5hpFxXOMsBw06iYOG-cks5u1rChgaJpZM4YeyPN .