Closed
Bug 513233
Opened 16 years ago
Closed 16 years ago
Implement accelerometer support for Windows ThinkPad
Categories
(Core :: Widget: Win32, enhancement)
Tracking
()
RESOLVED
FIXED
| Tracking | Status | |
|---|---|---|
| status1.9.2 | --- | beta1-fixed |
People
(Reporter: bugzilla, Assigned: dougt)
References
Details
Attachments
(3 files, 6 obsolete files)
|
27.02 KB,
patch
|
benjamin
:
approval1.9.2+
|
Details | Diff | Splinter Review |
|
590.52 KB,
application/x-download
|
Details | |
|
434 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; da; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
Build Identifier:
I would like to add support for the ThinkPad accelerometer under Windows to the new acceleration API from bug 485943.
Reproducible: Always
Jesper, just to be clear, do you plan on adding this yourself or is this a request for someone else to add the functionality?
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Reporter | ||
Comment 2•16 years ago
|
||
I would like to add this myself.
Excellent. Updating the bug appropriately.
Assignee: nobody → bugzilla
| Reporter | ||
Comment 4•16 years ago
|
||
Based on Patch 5 from bug 512345.
Attachment #397288 -
Flags: review?(doug.turner)
| Assignee | ||
Comment 5•16 years ago
|
||
this is great. I am doing something very similar on WindowsCE -- load a DLL, call startup, then call getvalues on the timer, and then shutdown. Maybe we can just put all of this in a common file. Let me get that patch together (bug 513183).
| Assignee | ||
Updated•16 years ago
|
Attachment #397288 -
Flags: review?(doug.turner) → review-
| Assignee | ||
Comment 6•16 years ago
|
||
Comment on attachment 397288 [details] [diff] [review]
Patch 1
I do not think we need a nsAccelerometerThinkPad file. Take a look at what I did with the CE sensors in the bug I mentioned above.
in the UpdateHandler, could you comment as what these values are -- it isn't obvious to me what they are.
otherwise, looks great.
| Reporter | ||
Comment 7•16 years ago
|
||
(In reply to comment #6)
> (From update of attachment 397288 [details] [diff] [review])
> I do not think we need a nsAccelerometerThinkPad file. Take a look at what I
> did with the CE sensors in the bug I mentioned above.
I think I will wait until that bug is resolved then. Why is the same thing implemented in such different ways in unix (bug 512345) and windows (bug 513183)? And why does each platform have its own update timer?
> in the UpdateHandler, could you comment as what these values are -- it isn't
> obvious to me what they are.
OK
| Assignee | ||
Comment 8•16 years ago
|
||
> Why is the same thing implemented in such different ways in unix (bug 512345) and windows (bug 513183)?
what do you mean?
> And why does each platform have its own update timer?
I would imagine that not all platforms need a timer to poll the sensor. Other platforms may have a callback that gets called (like windows 7)
| Reporter | ||
Comment 9•16 years ago
|
||
Now based on Attachment #397881 [details] [diff].
I am not sure if we need another h file or if I should reuse nsAccelerometerCE.h instead, as it has exactly the same content.
Attachment #397288 -
Attachment is obsolete: true
Attachment #398099 -
Flags: review?(doug.turner)
| Assignee | ||
Comment 10•16 years ago
|
||
Comment on attachment 398099 [details] [diff] [review]
Patch 2
wow, this is pretty similar to the others. I think you are right, we should just roll this into the existing "CE" version, and rename it to "Win".
Also, Lets just use LoadLibrary like the other implementations on WinCE.
Attachment #398099 -
Flags: review?(doug.turner) → review-
| Reporter | ||
Comment 11•16 years ago
|
||
Should I only merge the CE and Win h files or also the cpp files (moving the #ifdefs in nsWinWidgetFactory.cpp to nsAccelerometerWin.cpp) ?
| Assignee | ||
Comment 12•16 years ago
|
||
merge everything such that there is only one c++ and one h for windows.
| Reporter | ||
Comment 13•16 years ago
|
||
Attachment #398099 -
Attachment is obsolete: true
Attachment #398148 -
Flags: review?(doug.turner)
| Assignee | ||
Updated•16 years ago
|
Attachment #398148 -
Flags: review?(doug.turner) → review+
| Assignee | ||
Comment 14•16 years ago
|
||
Comment on attachment 398148 [details] [diff] [review]
Patch 3
Looks great!.
Please fix up these nits, and r+
wrap the long line:
+ gShockproofGetAccelerometerData = (ShockproofGetAccelerometerData) GetProcAddress(mLibrary, "ShockproofGetAccelerometerData");
typo:
accekerometer
No spaces before the #
+ #ifdef WINCE_WINDOWS_MOBILE
+ #else
+ #endif
| Reporter | ||
Comment 15•16 years ago
|
||
I think I don't need to ask for review again, but I am not 100% sure, so I will ask just to be safe.
Attachment #398148 -
Attachment is obsolete: true
Attachment #398162 -
Flags: review?(doug.turner)
| Assignee | ||
Updated•16 years ago
|
Attachment #398162 -
Flags: review?(doug.turner) → review+
| Assignee | ||
Comment 16•16 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/d07a46ba2eba
Thanks Jesper!
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•16 years ago
|
Attachment #398162 -
Flags: approval1.9.2?
| Assignee | ||
Comment 17•16 years ago
|
||
backed up. busted win32. mLibrary not defined.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Reporter | ||
Comment 18•16 years ago
|
||
(In reply to comment #17)
> backed up. busted win32. mLibrary not defined.
This seems to be from bug 513183, but was not discovered because tinderbox does not make test builds for Windows Mobile? Will you fix this, Doug, or should I try?
| Assignee | ||
Comment 19•16 years ago
|
||
i have a fix, and will push when it passes try.
| Assignee | ||
Comment 20•16 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 21•16 years ago
|
||
Bustage, wtf. pushed to try didn't catch this. why don't we have wince build machines yet.
e:/builds/moz2_slave/mozilla-central-wince/build/widget/src/windows/nsAccelerometerWin.cpp(311) : error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char [11]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Reporter | ||
Comment 22•16 years ago
|
||
Seems like the setup of Tinderbox is a little different than my MozillaBuild installation. I guess this will fix it, but I am not sure as I cannot reproduce the compile error.
Attachment #398162 -
Attachment is obsolete: true
Attachment #398162 -
Flags: approval1.9.2?
| Assignee | ||
Comment 23•16 years ago
|
||
I think the problem is that the thinkpad code probably shouldn't run on WINCE. Basically, we should play with the ifdefs.
| Assignee | ||
Comment 24•16 years ago
|
||
if this passes try, i will push to mc later today.
Assignee: bugzilla → doug.turner
Attachment #398929 -
Attachment is obsolete: true
| Assignee | ||
Comment 26•16 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•16 years ago
|
Attachment #399145 -
Flags: approval1.9.2?
Updated•16 years ago
|
Attachment #399145 -
Flags: approval1.9.2? → approval1.9.2+
Comment 27•16 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.3a1pre) Gecko/20090918 Minefield/3.7a1pre
Seems to work for me (Lenovo T400 on Windows XP) using the testcase at <http://people.mozilla.org/~dougt/ball.html>.
| Assignee | ||
Comment 28•16 years ago
|
||
status1.9.2:
--- → beta1-fixed
Comment 29•16 years ago
|
||
Should this be marked as dependent on bug 485943, in order to use that issue as a tracker for implementations? It seems that bug 512345 is already doing it with this is mind...? ;-)
Comment 30•16 years ago
|
||
It work on my Lenovo Z61m on Windows XP, however some calibration of sensor is necessary. My laptop acts as titled every time I start some of the demos.
| Reporter | ||
Comment 31•16 years ago
|
||
(In reply to comment #30)
> It work on my Lenovo Z61m on Windows XP, however some calibration of sensor is
> necessary. My laptop acts as titled every time I start some of the demos.
I determined the balance point experimentally to be x: between 529 and 528, y: between 525 and 527 on my T500 using the attached test program. Getting data from other laptops would be great, I think.
Comment 32•16 years ago
|
||
The test application didn't work for me on a Lenovo T400 with windows XP SP 3, I got the following error :
"The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."
See <http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/36971526-95f3-4a9f-a601-1843c86332c1/> for an explanation. The easiest fix is to link statically.
| Reporter | ||
Comment 33•16 years ago
|
||
(In reply to comment #32)
I guess you need to install http://www.microsoft.com/downloads/details.aspx?FamilyID=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en
Comment 34•16 years ago
|
||
(In reply to comment #33)
> (In reply to comment #32)
> I guess you need to install
> http://www.microsoft.com/downloads/details.aspx?FamilyID=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en
It doesn't work either for me and I am sure that I have VC2005 redist installed ...
| Reporter | ||
Comment 35•16 years ago
|
||
Try this test app instead. I have checked that it works on another computer.
Attachment #405995 -
Attachment is obsolete: true
Comment 36•16 years ago
|
||
results on on Lenovo T400, on Windows XP SP 3 (on a level surface) :
dll 3604480
func 3610566
Status: 0
x: 522, y: 517
xx: 522, yy: 517
x0: 522, y0: 517
temp: -1
Comment 37•16 years ago
|
||
Results from Lenovo Z61m
dll 268435456
func 268441803
Status: 0
x: 502, y: 496
xx: 502, yy: 496
x0: 502, y0: 495
temp: 48
However I expect that results from my docking station will be different. I will post them tomorrow.
Comment 38•16 years ago
|
||
Results from Lenovo Z61m sitting in my docking station
dll 268435456
func 268441803
Status: 0
x: 518, y: 497
xx: 517, yy: 496
x0: 516, y0: 496
temp: 44
Comment 39•16 years ago
|
||
ThinkPad R61 on desk:
dll 1845690368
func 1845696715
Status: 2
x: 522, y: 526
xx: 521, yy: 525
x0: 521, y0: 525
temp: -1
Haven't tried a 3.6 build though.
| Reporter | ||
Comment 40•16 years ago
|
||
Should there be more willing to provide data on the level point, this should be a little easier to do.
Comment 41•16 years ago
|
||
(In reply to comment #0)
> I would like to add support for the ThinkPad accelerometer under Windows
> to the new acceleration API from bug 485943.
I'd suggest adding a dependency from bug 485943 (not only is what's happening but also in order to help crawling for related issue and also possibly use it as a meta-bug...?). ;-)
Comment 42•16 years ago
|
||
(In reply to comment #41)
> I'd suggest adding a dependency from bug 485943
Naturally, it's "to" and not "from": this issue should be depend on the other one. As a side note/example, I've done this in bug 521902. Sorry for the bug spam!
Comment 43•14 years ago
|
||
So, today's Google home page uses the accelerator API. I don't have an accelerator, so I get two assertions, one when leaving the page to complain that the sensor didn't start up, and one when returning to the page to complain that the sensor has already been created! I guess you want new bugs on this.
You need to log in
before you can comment on or make changes to this bug.
Description
•