PMCUParameter.py 868 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. __author__ = 'citan'
  2. # <parameter id="P1" name="Engine Load (Relative)" desc="P1" ecubyteindex="8" ecubit="7" target="1">
  3. # <address>0x000007</address>
  4. # <conversions>
  5. # <conversion units="%" expr="x*100/255" format="0.00" />
  6. # </conversions>
  7. #</parameter>
  8. class PMCUParameter(object):
  9. def __init__(self, cu_type):
  10. self._cu_type = cu_type
  11. def get_cu_type(self):
  12. return self._cu_type
  13. @classmethod
  14. def CU_TYPE_STD_PARAMETER(cls):
  15. return 0
  16. @classmethod
  17. def CU_TYPE_FIXED_ADDRESS_PARAMETER(cls):
  18. return 1
  19. @classmethod
  20. def CU_TYPE_SWITCH_PARAMETER(cls):
  21. return 2
  22. @classmethod
  23. def CU_TYPE_CALCULATED_PARAMETER(cls):
  24. return 3
  25. @classmethod
  26. def CU_INVALID_BYTE_INDEX(cls):
  27. return -1
  28. @classmethod
  29. def CU_INVALID_BIT_INDEX(cls):
  30. return -1