2025-04-30 16:24:29 +08:00

93 lines
3.1 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/****************************************************************************/
/* Copyright (c) 2008,许继集团有限公司 */
/* All rights reserved. */
/* */
/* 模块描述: */
/** 时间处理模块,MMS_UTC_TIME MMS_BTIME6类型处理及转换
* @file ai_time.h */
/* */
/* 日期 作者 注释 */
/* 2008/09/22 DJF 创建文件,从cosmos移植 */
/****************************************************************************/
#ifndef INC_ACSITIME_H_HEADER_INCLUDED_BE050203
#define INC_ACSITIME_H_HEADER_INCLUDED_BE050203
//#include "ai_def.h"
#include "glbtypes.h"
#include "sysincs.h"
//#include "uca_obj.h"
#include "asn1r.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* 本函数完成系统当前时间的获取UTime的品质属性这里不操作
* @param curtime 存放当前时间的Time变量
* @retval 无
*/
ST_VOID get_system_curtime( MMS_UTC_TIME * curtime );
/**
* 根据时间精度TimeAccuracy 把毫秒数转换为UTCTime的Fraction.
* 如果转换精度为0则认为全精度24位,另外转换过程中精确度保证为0.1ms
* @param milsecond 毫秒值
* @param time_precision 时间精度
* @retval ST_UINT32 UTCTime的Fraction
*/
ST_UINT32 convert_milsec_to_timefrac( ST_FLOAT milsecond, ST_INT32 time_precision );
/**
* 根据时间精度TimeAccuracy 把61850的时间Fraction转换为毫秒数Float32
* @param frac 61850的时间Fraction
* @param time_precision 时间精度
* @retval ST_FLOAT 毫秒数
*/
ST_FLOAT convert_timefrac_to_milsec( ST_UINT32 frac, ST_INT32 time_precision );
/**
* 计算两个timeStamp时间的间隔以毫秒数返回结果
* @param curtime 当前时间
* @param destime 稍后时间
* @retval ST_FLOAT 毫秒数
*/
ST_UINT32 calculate_timespan( MMS_UTC_TIME * curtime, MMS_UTC_TIME * destime );
/**
* 把一个时间间隔添加到一个绝对的时间标签上
* @param curtime 当前时间
* @param tmspan 时间差
* @retval 无
*/
ST_VOID add_timespan_to_curtm( MMS_UTC_TIME * curtime, ST_UINT32 tmspan );
/**
* 获取当前的EntryTime时间
* @param entrytime 存放当前时间的ENTRYTIME变量
* @retval 无
*/
ST_VOID get_current_entrytime( MMS_BTIME6 * entrytime );
/**
* 把一个MMS_UTC_TIME类的时间转换为EntryTime时间
* @param timestamp timestamp时间
* @param entrytime entrytime时间
* @retval 无
*/
ST_VOID convert_timestamp_to_entrytime( MMS_UTC_TIME * timestamp, MMS_BTIME6 * entrytime );
/**
* 把一个EntryTime类的时间转换为MMS_UTC_TIME时间
* @param timestamp timestamp时间
* @param entrytime entrytime时间
* @retval 无
*/
ST_VOID convert_entrytime_to_timestamp( MMS_BTIME6 * entrytime, MMS_UTC_TIME * timestamp );
#ifdef __cplusplus
}
#endif
#endif /* end of 'already included' */