Ignore:
Timestamp:
04/16/12 17:53:47 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The logger disconnects from the simulator if the flight has ended and the Forward button on the landing page can be activated only then.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/pyuipc_sim.py

    r85 r88  
    351351            index = 0
    352352            while index<numNotchesM1 and \
    353                   self.flapsControl<self.flapsNotches[index]:
     353                  self.flapsControl>self.flapsNotches[index]:
    354354                index += 1
    355                
     355
    356356            if index==numNotchesM1:
    357357                return 16383
    358358            else:
    359                 return int((self.flapsControl-self.flapsNotches[index]) * \
    360                            flapsIncrement / \
     359                return int(index * flapsIncrement +
     360                           (self.flapsControl-self.flapsNotches[index]) *
     361                           flapsIncrement /
    361362                           (self.flapsNotches[index+1] - self.flapsNotches[index]))
    362363        elif offset==0x0be0 or offset==0x0be4:    # Flaps left and  right
     
    529530            numNotchesM1 = len(self.flapsNotches) - 1
    530531            flapsIncrement = 16383.0 / numNotchesM1
    531             index = value / flapsIncrement
     532            index = int(value / flapsIncrement)
    532533            if index>=numNotchesM1:
    533534                self.flapsControl = self.flapsNotches[-1]
    534535            else:
    535536                self.flapsControl = self.flapsNotches[index]
    536                 self.flapsControl += value * \
     537                self.flapsControl += (value - index * flapsIncrement) * \
    537538                    (self.flapsNotches[index+1] - self.flapsNotches[index]) / \
    538539                    flapsIncrement
     
    583584        elif offset==0x3bfc:       # ZFW
    584585            self.zfw = value * const.LBSTOKG / 256.0
    585             print "ZFW:", self.zfw
    586586        elif offset==0x3c00:       # Path of the current AIR file
    587587            self.airPath = value
     
    640640        temperature += 273.15  # Celsius -> Kelvin
    641641        airDensity = pressure / (temperature * 287.05)
    642         print "pressure:", pressure, "temperature:", temperature, "airDensity:", airDensity
     642        #print "pressure:", pressure, "temperature:", temperature, "airDensity:", airDensity
    643643        return self.ias * math.sqrt(1.225 / airDensity)
    644644
Note: See TracChangeset for help on using the changeset viewer.