-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cardpeek tachograph over Fedora 31 lua float integer issues #109
Comments
I think the problem could be because of a lua 5.2 to 5.3 change https://stackoverflow.com/a/36031506 Fedora is using 5.3, chould cardpeek be changed to use lua 5.3? also in the output the value cold ATR is set with .0 instead of just the value. |
I have tried my best with lua as I have no knowledge about it and I did the following changes.
If // operator is changed to use / and then the result with math.floor() I think it can be keep compatible with previous lua versions. |
I will try to do a pull request with 3 commits, one for the ATR, another one with the minimum needed changes to get tachograph.lua work over lua 5.3 and finally a third one making the output behave as the previous lua versions. Still I don't know if it could be a way to make cardpeek work over lua 5.3 as expected over previous versions without the need to be using math.tointeger() an similars in the card script. |
Well, I tried to do my best, #110. |
I'm having troubles with cardpeek tachograph as it uses integer values as floats.
For example this piece of code:
local format = "ISO-8859-"..data[0]
makes format be "ISO-8859-1.0" instead "ISO-8859-1"
I don't know about lua so I searched to see if there is a way to default to integer values but it seems that it should do automatically as 1.0 could be represented as 1.
The same issue remains for the time for example here:
local sub_node = node:append({ classname='record',
label='Change',
id=string.format("%02u:%02u",time/60,time%60),
val=data,
size=2 })
time/60 is not integer and it does fail.
I have added math.floor() where applicable but I suppose there should be an easier way to do it I can't find.
I have diff over an xml generated with the windows version and there are a lot of numbers in the fedora output with .0 that doesn't appear over the windows output.
The text was updated successfully, but these errors were encountered: