Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8446 closed defect (fixed)

[PATCH] Error in DiseqC 1.2 Rotor Positioning

Reported by: pieter@… Owned by: danielk
Priority: minor Milestone: 0.24
Component: MythTV - DVB Version: Master Head
Severity: medium Keywords: diseqc rotor
Cc: Ticket locked: no


Attached patch fixes the problem.

The find() instruction did not work on the QMap table, because it is searching for a double (the angle) but it is filled with floats. The patch fills the QMap with doubles.

Because of this, the position could not be found in the table and Diseqc would send the degrees (19.2 for example) instead the position (1, 2, or 3 for example)

I'm compiling this on Mythbuntu 10.04/amd64 btw.

Attachments (1)

diseq.cpp.patch (394 bytes) - added by pieter@… 11 years ago.
Patch to fix issue

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by pieter@…

Attachment: diseq.cpp.patch added

Patch to fix issue

comment:1 Changed 11 years ago by robertm

Milestone: 0.23-fixesunknown

Please see ticket howto, don't set milestones. Thank you for the patch.

comment:2 Changed 11 years ago by danielk

Owner: changed from Janne Grunau to danielk
Status: newassigned
Version: 0.23rc2Trunk Head

pieter, searching for a float with a single lookup in a QMap seems rather fragile, could you perhaps rewrite the search using QMap::lowerBound() & QMap::upperBound() with deltas?

comment:3 Changed 11 years ago by Pieter Hoekstra <pieter@…>

Because of lack of precision of floats?

I think I can make a simple iteration with a greater/smaller than routine.

Is this what you mean?

comment:4 Changed 11 years ago by sphery

Resolution: fixed
Status: assignedclosed

Seems Trac missed the close message on [24603]:

diseqc: Use inexact matching when using float as keys in a QMap, Fixes #8446

comment:5 Changed 11 years ago by stuartm

Milestone: unknown0.24
Note: See TracTickets for help on using tickets.