Example #1
0
car.setCode(Model.A)

# fixed arrays
for i in range(0, car.someNumbersLength()):
    car.setSomeNumbers(i, i)

code = [x for x in 'abcdef']
for i in range(0, car.vehicleCodeLength()):
    car.setVehicleCode(i, code[i])

car.extras().setCruiseControl(True)
car.extras().setSportsPack(True)
car.extras().setSunRoof(False)

# composites
car.engine().setCapacity(2000)
car.engine().setNumCylinders(4)
code = [x for x in '123']
for i in range(0, car.engine().manufacturerCodeLength()):
    car.engine().setManufacturerCode(i, code[i])

# groups
fuelFigures = car.fuelFiguresCount(3)
for speed, mpg in [(30, 35.9), (55, 49.0), (75, 40.0)]:
    fuelFigures.next()
    fuelFigures.setSpeed(speed)
    fuelFigures.setMpg(mpg)

performanceFigures = car.performanceFiguresCount(2)

performanceFigures.next()
# fixed arrays
for i in range(0, car.someNumbersLength()) :
    car.setSomeNumbers(i, i)

# Note: pad to fixed size if necessary for char arrays:
# car.setVehicleCode('abc'.ljust(6))
#
car.setVehicleCode('abcdef')

car.extras().setCruiseControl(True)
car.extras().setSportsPack(True)
car.extras().setSunRoof(False)

# composites
car.engine().setCapacity(2000)
car.engine().setNumCylinders(4)
car.engine().setManufacturerCode('123')

# groups
fuelFigures = car.fuelFiguresCount(3)
for speed, mpg in [(30,35.9), (55,49.0), (75,40.0)]:
    fuelFigures.next()
    fuelFigures.setSpeed(speed)
    fuelFigures.setMpg(mpg)


performanceFigures = car.performanceFiguresCount(2)

performanceFigures.next()
performanceFigures.setOctaneRating(95)
print('available: '+str(car.getAvailable()))
print('code: '+str(car.getCode()))

# fixed arrays
for i in range(0,car.someNumbersLength()):
    print('someNumber'+str(i)+': '+str(car.getSomeNumbers(i)))

print('vehicleCode: "'+str(car.getVehicleCode())) + '"'

# bitsets
print('cruiseControl: '+str(car.extras().getCruiseControl()))
print('sportsPack: '+str(car.extras().getSportsPack()))
print('sunRoof: '+str(car.extras().getSunRoof()))

# composites
print('capacity: '+str(car.engine().getCapacity()))
print('numCylinders: '+str(car.engine().getNumCylinders()))
print('maxRpm: '+str(car.engine().maxRpm()))

print('manufacturerCode: "'+str(car.engine().getManufacturerCode()))+'"'

# groups
figures = car.fuelFigures()
while figures.hasNext():
    figures.next()
    print('speed: '+str(figures.getSpeed()))
    print('mpg: '+str(figures.getMpg()))

figures = car.performanceFigures()
while figures.hasNext():
    figures.next()
# fixed arrays
for i in range(0, car.someNumbersLength()) :
    car.setSomeNumbers(i, i)


code = [x for x in 'abcdef']
for i in range(0, car.vehicleCodeLength()):
    car.setVehicleCode(i, code[i])

car.extras().setCruiseControl(True)
car.extras().setSportsPack(True)
car.extras().setSunRoof(False)

# composites
car.engine().setCapacity(2000)
car.engine().setNumCylinders(4)
code = [x for x in '123']
for i in range(0, car.engine().manufacturerCodeLength()):
    car.engine().setManufacturerCode(i, code[i])

# groups
fuelFigures = car.fuelFiguresCount(3)
for speed, mpg in [(30,35.9), (55,49.0), (75,40.0)]:
    fuelFigures.next()
    fuelFigures.setSpeed(speed)
    fuelFigures.setMpg(mpg)


performanceFigures = car.performanceFiguresCount(2)
Example #5
0
print('code: '+str(car.getCode()))

# fixed arrays
for i in range(0,car.someNumbersLength()):
    print('someNumber'+str(i)+': '+str(car.getSomeNumbers(i)))

for i in range(0,car.vehicleCodeLength()):
    print('vehicleCode'+str(i)+': '+str(car.getVehicleCode(i)))

# bitsets
print('cruiseControl: '+str(car.extras().getCruiseControl()))
print('sportsPack: '+str(car.extras().getSportsPack()))
print('sunRoof: '+str(car.extras().getSunRoof()))

# composites
print('capacity: '+str(car.engine().getCapacity()))
print('numCylinders: '+str(car.engine().getNumCylinders()))
print('maxRpm: '+str(car.engine().maxRpm()))

for i in range(0,car.engine().manufacturerCodeLength()):
    print('manufacturerCode'+str(i)+': '+str(car.engine().getManufacturerCode(i)))

# groups
figures = car.fuelFigures()
while figures.hasNext():
    figures.next()
    print('speed: '+str(figures.getSpeed()))
    print('mpg: '+str(figures.getMpg()))

figures = car.performanceFigures()
while figures.hasNext():