本文整理汇总了Python中Modules.Utilities.xml_tools.PutGetXML.get_float_from_xml方法的典型用法代码示例。如果您正苦于以下问题:Python PutGetXML.get_float_from_xml方法的具体用法?Python PutGetXML.get_float_from_xml怎么用?Python PutGetXML.get_float_from_xml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modules.Utilities.xml_tools.PutGetXML
的用法示例。
在下文中一共展示了PutGetXML.get_float_from_xml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _read_thermostat_data
# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import get_float_from_xml [as 别名]
def _read_thermostat_data(p_obj, p_xml):
"""
@return: a ThermostatData object.
"""
p_obj.CoolSetPoint = PutGetXML.get_float_from_xml(p_xml, 'CoolSetPoint', p_default = 76.0)
p_obj.HeatSetPoint = PutGetXML.get_float_from_xml(p_xml, 'HeatSetPoint', 68.0)
p_obj.ThermostatMode = PutGetXML.get_text_from_xml(p_xml, 'ThermostatMode', 'Cool')
p_obj.ThermostatScale = PutGetXML.get_text_from_xml(p_xml, 'ThermostatScale', 'F')
#
p_obj.CurrentTemperature = PutGetXML.get_float_from_xml(p_xml, 'CurrentTemperature')
return p_obj
示例2: read_interface_xml
# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import get_float_from_xml [as 别名]
def read_interface_xml(p_controller_entry):
l_serial = SerialControllerData()
l_serial.BaudRate = PutGetXML.get_int_from_xml(p_controller_entry, "BaudRate", 19200)
l_serial.ByteSize = PutGetXML.get_int_from_xml(p_controller_entry, "ByteSize", 8)
l_serial.DsrDtr = PutGetXML.get_bool_from_xml(p_controller_entry, "DsrDtr", False)
l_serial.Parity = PutGetXML.get_text_from_xml(p_controller_entry, "Parity", "N")
l_serial.RtsCts = PutGetXML.get_bool_from_xml(p_controller_entry, "RtsCts", False)
l_serial.StopBits = PutGetXML.get_float_from_xml(p_controller_entry, "StopBits", 1.0)
l_serial.Timeout = PutGetXML.get_float_from_xml(p_controller_entry, "Timeout", 1.0)
l_serial.XonXoff = PutGetXML.get_bool_from_xml(p_controller_entry, "XonXoff", False)
return l_serial
示例3: read_location_xml
# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import get_float_from_xml [as 别名]
def read_location_xml(p_pyhouse_obj):
"""
@param p_house_xml: is the config file xml for a house.
"""
l_obj = LocationData()
l_obj.RiseSet = RiseSetData()
p_pyhouse_obj.House.Location = l_obj
try:
l_xml = p_pyhouse_obj.Xml.XmlRoot.find('HouseDivision')
l_xml = l_xml.find('LocationSection')
l_obj.Street = PutGetXML.get_text_from_xml(l_xml, 'Street')
l_obj.City = PutGetXML.get_text_from_xml(l_xml, 'City')
l_obj.State = PutGetXML.get_text_from_xml(l_xml, 'State')
l_obj.ZipCode = PutGetXML.get_text_from_xml(l_xml, 'ZipCode', '99999')
l_obj.Region = PutGetXML.get_text_from_xml(l_xml, 'Region', 'America')
l_obj.Phone = PutGetXML.get_text_from_xml(l_xml, 'Phone')
l_obj.Latitude = PutGetXML.get_float_from_xml(l_xml, 'Latitude')
l_obj.Longitude = PutGetXML.get_float_from_xml(l_xml, 'Longitude')
l_obj.Elevation = PutGetXML.get_float_from_xml(l_xml, 'Elevation', 10)
l_obj.TimeZoneName = PutGetXML.get_text_from_xml(l_xml, 'TimeZoneName', 'America/New_York')
except AttributeError as e_err:
LOG.error('ERROR getting location Data - {}'.format(e_err))
p_pyhouse_obj.House.Location = l_obj
return l_obj