koreader / kindlepdfviewer

(DEPRECATED, please use KOReader instead) A PDF (plus DJVU, ePub, TXT, CHM, FB2, HTML...) viewer made for e-ink framebuffer devices, using muPDF, djvulibre, crengine
GNU General Public License v3.0
499 stars 98 forks source link

add ev_log replay script & bug fix in gesturedetector #770

Closed houqp closed 11 years ago

houqp commented 11 years ago

we can have unit test for UI now :P

chrox commented 11 years ago

That's great. Thanks.

chrox commented 11 years ago

The bug seems still there. This time when I try to "hold" on the screen it crashes.

# set up hold timer
# in tap state... {
    ["y"] = 575,
    ["x"] = 607,
    ["timev"] = {
        ["usec"] = 686769,
        ["sec"] = 1361802764
    },
    ["id"] = 0
}
# in tap state... {
    ["y"] = 576,
    ["x"] = 606,
    ["timev"] = {
        ["usec"] = 726637,
        ["sec"] = 1361802764
    },
    ["id"] = 0
}
# in tap state... {
    ["x"] = 619,
    ["id"] = 1,
    ["y"] = 254,
    ["slot"] = 1,
    ["timev"] = {
        ["usec"] = 846883,
        ["sec"] = 1361802764
    }
}
# in pan state...
# in pan state...
# in pan state...
# in pan state...
# in pan state...
# in pan state...
# in tap state... {
    ["x"] = 597,
    ["id"] = -1,
    ["y"] = 597,
    ["slot"] = 0,
    ["timev"] = {
        ["usec"] = 109805,
        ["sec"] = 1361802765
    }
}
# set up tap timer
lua config error: ./frontend/ui/time.lua:81: attempt to index local 'self' (a nil value)
stack traceback:
    ./frontend/ui/time.lua:81: in function '__add'
    ./frontend/ui/gesturedetector.lua:215: in function 'state'
    ./frontend/ui/gesturedetector.lua:77: in function 'feedEvent'
    ./frontend/ui/inputevent.lua:405: in function 'waitEvent'
    ./frontend/ui/ui.lua:204: in function 'run'
    ./reader.lua:184: in main chunk

And ev log is

3|57|0|1361802764|587990
3|53|607|1361802764|588050
3|54|574|1361802764|588064
1|330|1|1361802764|588598
1|325|1|1361802764|588609
0|0|0|1361802764|588628
3|54|575|1361802764|686753
0|0|0|1361802764|686769
3|53|606|1361802764|726621
3|54|576|1361802764|726628
0|0|0|1361802764|726637
3|47|1|1361802764|846858
3|57|1|1361802764|846866
3|53|619|1361802764|846869
3|54|254|1361802764|846872
1|333|1|1361802764|846878
0|0|0|1361802764|846883
3|53|613|1361802764|867846
3|54|225|1361802764|867855
0|0|0|1361802764|867863
3|47|0|1361802764|888831
3|53|619|1361802764|888838
3|54|842|1361802764|888842
3|47|1|1361802764|888848
3|53|606|1361802764|888849
3|54|576|1361802764|888852
0|0|0|1361802764|888860
3|47|0|1361802764|929304
3|53|605|1361802764|929311
3|54|575|1361802764|929314
3|47|1|1361802764|929321
3|53|612|1361802764|929323
3|54|100|1361802764|929325
0|0|0|1361802764|929333
3|53|619|1361802764|969759
3|54|89|1361802764|969767
0|0|0|1361802764|969777
3|57|-1|1361802765|89756
3|47|0|1361802765|89770
3|53|593|1361802765|89772
3|54|617|1361802765|89775
1|333|0|1361802765|89783
0|0|0|1361802765|89786
3|53|597|1361802765|109785
3|54|597|1361802765|109796
0|0|0|1361802765|109805
houqp commented 11 years ago

Your crash is triggered in real device with multi-touch right? Cause I saw different tracking ID for the touch input.

chrox commented 11 years ago

Yes. I intended to just make a "hold" gesture but the detector might misunderstand it.

houqp commented 11 years ago

That's weird, because the ev trace shows there were two touch points at the same time. But anyway, the gesdetect module is not able to handle multi-touch right now.

chrox commented 11 years ago

How about handling these exceptions inside the gesture detector instead of raising them to the ui and destroying the whole application?

houqp commented 11 years ago

OK, will probably add a work around tonight.

chrox commented 11 years ago

This bug is fixed in #774.