123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- class Singleton(object):
- def __new__(cls, *args, **kw):
- if not hasattr(cls, '_instance'):
- orig = super(Singleton, cls)
- cls._instance = orig.__new__(cls, *args, **kw)
- return cls._instance
- class RecordModel(Singleton):
- def __init__(self):
- # 时间戳 簇号 故障等级 簇电压 簇电流 簇SOC 簇SOH
- self.__now_time = ""
- self.__ccu_id = 0
- self.__fault_level = 0
- self.__volt = 0
- self.__cur = 0
- self.__soc = 0
- self.__soh = 0
- # 簇单体V平均 簇单体Vmax单体号 簇单体Vmax 簇单体Vmin单体号 簇单体Vmin 簇单体T平均 簇单体Tmax单体号 簇单体Tmax 簇单体Tmin单体号 簇单体Tmin
- self.__avg_cell_volt = 0
- self.__max_cell_volt_id = 0
- self.__max_cell_volt = 0
- self.__min_cell_volt_id = 0
- self.__min_cell_volt = 0
- self.__avg_cell_temp = 0
- self.__max_cell_temp_id = 0
- self.__max_cell_temp = 0
- self.__min_cell_temp_id = 0
- self.__min_cell_temp = 0
- # 主正接触器 主负接触器 预充接触器 断路器 干接点1 干接点2 最高单体SOC 最低单体SOC 平均单体SOC
- self.__p = 0
- self.__n = 0
- self.__pre = 0
- self.__dlq = 0
- self.__gjd_first = 0
- self.__gjd_second = 0
- self.__max_soc = 0
- self.__min_soc = 0
- self.__avg_soc = 0
- self.__cell_volt = [0 for i in range(396)]
- self.__cell_temp = [0 for i in range(360)]
- @property
- def now_time(self):
- return self.__now_time
- @now_time.setter
- def now_time(self, value):
- self.__now_time = value
- @property
- def ccu_id(self):
- return self.__ccu_id
- @ccu_id.setter
- def ccu_id(self, value):
- self.__ccu_id = value
- @property
- def fault_level(self):
- return self.__fault_level
- @fault_level.setter
- def fault_level(self, value):
- self.__fault_level = value
- @property
- def volt(self):
- return self.__volt
- @volt.setter
- def volt(self, value):
- self.__volt = value
- @property
- def cur(self):
- return self.__cur
- @cur.setter
- def cur(self, value):
- self.__cur = value
- @property
- def soc(self):
- return self.__soc
- @soc.setter
- def soc(self, value):
- self.__soc = value
- @property
- def soh(self):
- return self.__soh
- @soh.setter
- def soh(self, value):
- self.__soh = value
- @property
- def avg_cell_volt(self):
- return self.__avg_cell_volt
- @avg_cell_volt.setter
- def avg_cell_volt(self, value):
- self.__avg_cell_volt = value
- @property
- def max_cell_volt_id(self):
- return self.__max_cell_volt_id
- @max_cell_volt_id.setter
- def max_cell_volt_id(self, value):
- self.__max_cell_volt_id = value
- @property
- def max_cell_volt(self):
- return self.__max_cell_volt
- @max_cell_volt.setter
- def max_cell_volt(self, value):
- self.__max_cell_volt = value
- @property
- def min_cell_volt_id(self):
- return self.__min_cell_volt_id
- @min_cell_volt_id.setter
- def min_cell_volt_id(self, value):
- self.__min_cell_volt_id = value
- @property
- def min_cell_volt(self):
- return self.__min_cell_volt
- @min_cell_volt.setter
- def min_cell_volt(self, value):
- self.__min_cell_volt = value
- @property
- def avg_cell_temp(self):
- return self.__avg_cell_temp
- @avg_cell_temp.setter
- def avg_cell_temp(self, value):
- self.__avg_cell_temp = value
- @property
- def max_cell_temp_id(self):
- return self.__max_cell_temp_id
- @max_cell_temp_id.setter
- def max_cell_temp_id(self, value):
- self.__max_cell_temp_id = value
- @property
- def max_cell_temp(self):
- return self.__max_cell_temp
- @max_cell_temp.setter
- def max_cell_temp(self, value):
- self.__max_cell_temp = value
- @property
- def min_cell_temp_id(self):
- return self.__min_cell_temp_id
- @min_cell_temp_id.setter
- def min_cell_temp_id(self, value):
- self.__min_cell_temp_id = value
- @property
- def min_cell_temp(self):
- return self.__min_cell_temp
- @min_cell_temp.setter
- def min_cell_temp(self, value):
- self.__min_cell_temp = value
- @property
- def p(self):
- return self.__p
- @p.setter
- def p(self, value):
- self.__p = value
- @property
- def n(self):
- return self.__n
- @n.setter
- def n(self, value):
- self.__n = value
- @property
- def pre(self):
- return self.__pre
- @pre.setter
- def pre(self, value):
- self.__pre = value
- @property
- def dlq(self):
- return self.__dlq
- @dlq.setter
- def dlq(self, value):
- self.__dlq = value
- @property
- def gjd_first(self):
- return self.__gjd_first
- @gjd_first.setter
- def gjd_first(self, value):
- self.__gjd_first = value
- @property
- def gjd_second(self):
- return self.__gjd_second
- @gjd_second.setter
- def gjd_second(self, value):
- self.__gjd_second = value
- @property
- def max_soc(self):
- return self.__max_soc
- @max_soc.setter
- def max_soc(self, value):
- self.__max_soc = value
- @property
- def min_soc(self):
- return self.__min_soc
- @min_soc.setter
- def min_soc(self, value):
- self.__min_soc = value
- @property
- def avg_soc(self):
- return self.__avg_soc
- @avg_soc.setter
- def avg_soc(self, value):
- self.__avg_soc = value
- @property
- def cell_volt(self):
- return self.__cell_volt
- @cell_volt.setter
- def cell_volt(self, value):
- self.__cell_volt = value
- @property
- def cell_temp(self):
- return self.__cell_temp
- @cell_temp.setter
- def cell_temp(self, value):
- self.__cell_temp = value
|