+from Tools.HardwareInfo import HardwareInfo
+
from config import config, ConfigSubsection, ConfigSelection, ConfigFloat, \
ConfigSatlist, ConfigYesNo, ConfigInteger, ConfigSubList, ConfigNothing, \
ConfigSubDict, ConfigOnOff, ConfigDateTime
for slot in nim_slots:
x = slot.slot
nim = slot.config
+ hw = HardwareInfo()
if slot.isCompatible("DVB-S"):
print "slot: " + str(x) + " configmode: " + str(nim.configMode.value)
if nim.configMode.value in [ "loopthrough", "satposdepends", "nothing" ]:
loValue = rotorParam.EAST
else:
loValue = rotorParam.WEST
- inputPowerDelta=50
+ inputPowerDelta=nim.powerThreshold.value
useInputPower=False
turning_speed=0
if nim.powerMeasurement.value:
useInputPower=True
- inputPowerDelta=nim.powerThreshold.value
turn_speed_dict = { "fast": rotorParam.FAST, "slow": rotorParam.SLOW }
if turn_speed_dict.has_key(nim.turningSpeed.value):
turning_speed = turn_speed_dict[nim.turningSpeed.value]
def canEqualTo(self, slotid):
type = self.getNimType(slotid)
- if self.getNimConfig(slotid) == "DVB-S2":
+ if type == "DVB-S2":
type = "DVB-S"
nimList = self.getNimListOfType(type, slotid)
for nim in nimList[:]:
if mode.configMode.value == "loopthrough" or mode.configMode.value == "satposdepends":
nimList.remove(nim)
return nimList
-
+
def canDependOn(self, slotid):
type = self.getNimType(slotid)
- if self.getNimConfig(slotid) == "DVB-S2":
+ if type == "DVB-S2":
type = "DVB-S"
nimList = self.getNimListOfType(type, slotid)
positionerList = []
if lnb != 0:
nimHaveRotor = True
break
+ if not nimHaveRotor:
+ for sat in mode.advanced.sat.values():
+ lnb_num = int(sat.lnb.value)
+ diseqcmode = lnb_num and mode.advanced.lnb[lnb_num].diseqcMode.value or ""
+ if diseqcmode == "1_2":
+ nimHaveRotor = True
+ break
if nimHaveRotor:
alreadyConnected = False
for testnim in nimList:
x.addNotifier(lambda configElement: secClass.setParam(secClass.DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MOTOR_CMD, configElement.value))
config.sec.delay_after_voltage_change_before_motor_command = x
+ x = ConfigInteger(default=70, limits = (0, 9999))
+ x.addNotifier(lambda configElement: secClass.setParam(secClass.DELAY_BEFORE_SEQUENCE_REPEAT, configElement.value))
+ config.sec.delay_before_sequence_repeat = x
+
x = ConfigInteger(default=360, limits = (0, 9999))
x.addNotifier(lambda configElement: secClass.setParam(secClass.MOTOR_RUNNING_TIMEOUT, configElement.value))
config.sec.motor_running_timeout = x
def InitNimManager(nimmgr):
InitSecParams()
+ hw = HardwareInfo()
config.Nims = ConfigSubList()
for x in range(len(nimmgr.nim_slots)):
nim.latitude = ConfigFloat(default=[50,767], limits=[(0,359),(0,999)])
nim.latitudeOrientation = ConfigSelection(choices={"north": _("North"), "south": _("South")}, default="north")
nim.powerMeasurement = ConfigYesNo(default=True)
- nim.powerThreshold = ConfigInteger(default=50, limits=(0, 100))
+ nim.powerThreshold = ConfigInteger(default=hw.get_device_name() == "dm8000" and 15 or 50, limits=(0, 100))
nim.turningSpeed = ConfigSelection(choices = [("fast", _("Fast")), ("slow", _("Slow")), ("fast epoch", _("Fast epoch")) ], default = "fast")
btime = datetime(1970, 1, 1, 7, 0);
nim.fastTurningBegin = ConfigDateTime(default = mktime(btime.timetuple()), formatstring = _("%H:%M"), increment = 900)
nim.advanced.lnb[x].latitude = ConfigFloat(default = [50,767], limits = [(0,359),(0,999)])
nim.advanced.lnb[x].latitudeOrientation = ConfigSelection(choices = [("north", _("North")), ("south", _("South"))], default = "north")
nim.advanced.lnb[x].powerMeasurement = ConfigYesNo(default=True)
- nim.advanced.lnb[x].powerThreshold = ConfigInteger(default=50, limits=(0, 100))
+ nim.advanced.lnb[x].powerThreshold = ConfigInteger(default=hw.get_device_name() == "dm8000" and 15 or 50, limits=(0, 100))
nim.advanced.lnb[x].turningSpeed = ConfigSelection(choices = [("fast", _("Fast")), ("slow", _("Slow")), ("fast epoch", _("Fast epoch"))], default = "fast")
btime = datetime(1970, 1, 1, 7, 0);
nim.advanced.lnb[x].fastTurningBegin = ConfigDateTime(default=mktime(btime.timetuple()), formatstring = _("%H:%M"), increment = 600)
nim.terrestrial_5V = ConfigOnOff()
else:
nim.configMode = ConfigSelection(choices = { "nothing": _("disabled") }, default="nothing");
- print "pls add support for this frontend type!"
+ if slot.type is not None:
+ print "pls add support for this frontend type!", slot.type
# assert False
nimmgr.sec = SecConfigure(nimmgr)