from common_func.info_conf_reader import InfoConfReader
from common_func.utils import Utils
from profiling_bean.stars.stars_common import StarsCommon
from profiling_bean.struct_info.struct_decoder import StructDecoder
from msmodel.sqe_type_map import SqeType
class AcsqTask(StructDecoder):
"""
class used to decode acsq task
"""
def __init__(self: any, *args: any) -> None:
args = args[0]
self._func_type = Utils.get_func_type(args[0])
self._task_type = args[0] >> 10
self._stream_id = StarsCommon.set_stream_id(args[2], args[3], SqeType.StarsSqeType(self._task_type))
self._task_id = StarsCommon.set_task_id(args[2], args[3], SqeType.StarsSqeType(self._task_type))
self._sys_cnt = args[4]
self._acc_id = args[6] & 63
self._acsq_id = (args[6] >> 6) & 127
@property
def func_type(self: any) -> str:
"""
get func type
:return: func type
"""
return self._func_type
@property
def task_type(self: any) -> int:
"""
get task type
:return: task type
"""
return self._task_type
@property
def stream_id(self: any) -> int:
"""
get stream id
:return: stream id
"""
return self._stream_id
@property
def task_id(self: any) -> int:
"""
get task id
:return: task id
"""
return self._task_id
@property
def sys_cnt(self: any) -> float:
"""
get task sys cnt
:return: sys cnt
"""
return InfoConfReader().time_from_syscnt(self._sys_cnt)
@property
def acc_id(self: any) -> int:
"""
get acc id
:return: acc_id
"""
return self._acc_id