def getParamContext(param): if '.' in param.id: category, baseId = param.id.split('.', 1) else: category, baseId = None, param.id result = { 'paramId': xpjsonAstrobee.fixName(baseId), 'paramIdAllCaps': xpjsonAstrobee.allCaps(xpjsonAstrobee.fixName(baseId)), 'paramValueTypeRapid': xpjsonAstrobee.XPJSON_PARAM_VALUE_TYPE_MAPPINGS[param.valueType], } if category is not None: result['paramCategoryAllCaps'] = xpjsonAstrobee.allCaps(category) return result
def getParamConfig(param): if '.' in param.id: category, baseId = param.id.split('.', 1) else: category, baseId = None, param.id return { 'key': xpjsonAstrobee.fixName(baseId), 'type': xpjsonAstrobee.XPJSON_PARAM_VALUE_TYPE_MAPPINGS[param.valueType], }
def getParamContext(param): if '.' in param.id: category, baseId = param.id.split('.', 1) else: category, baseId = None, param.id parent = getattr(param, 'parent', None) valueType = '' if parent == None: valueType = param.valueType if valueType == 'long': valueType = 'int' elif valueType == 'long long': valueType = 'long' elif valueType == 'string': valueType = 'String' elif valueType == 'array[3].double': valueType = 'Vec3d' elif valueType == 'array[9].float': valueType = 'Mat33f' elif valueType == 'quaternion': valueType = 'Quaternion' else: if '.' in parent: category, valueType = parent.split('.', 1) else: category, valueType = None, parent notes = param.notes if notes == None: notes = '' else: notes = ' ' + notes result = { 'paramId': xpjsonAstrobee.fixName(baseId), 'paramNotes': notes, 'paramValueType': valueType } return result
def getParamContext(param): if '.' in param.id: category, baseId = param.id.split('.', 1) else: category, baseId = None, param.id return {'paramId': xpjsonAstrobee.fixName(baseId)}