⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eventime.h

📁 PQDIF软件包(SDK,Software Development Kit),它能转换、生成并且显示PQDIF文件.对于开发电力系统的数据输出非常有用。
💻 H
字号:
#ifndef INC_EVENTTIME
#define INC_EVENTTIME

#define SECONDS_PER_DAY     86400L
#define DATE_BASE_ADJUST    25568L  // Days from 12-31-1899 to 1-1-1970.

//===========================================================================
//
//  CLASS CEventTime
//
//  Implements an intermediate date/time representation that will be used
//  to see if disturbance files match the time window passed in from PQDM.
//  It includes conversion routines to convert both PNDS date format and
//  PQDM date format to this format.
//
//===========================================================================



    // Date and Time Value Format codes. Values from the different
    // format groups are combined. 
    enum
        {
        
        
        // Time base group codes.
        etDTBase = 0x000f,        // Base group mask.
        etDTBaseUCT = 0x0000,     // UCT based (default.)
        etDTBaseLocal = 0x0001,   // Local time based.
        
        
        // Date format group .
        etDTDate = 0x00f0,        // Date group mask.
        etDTDateMDY = 0x0010,     // Month/Day/Year
        etDTDateD = 0x0020,       // Days since 12/31/1899 (includes
                                    // decimal time-of-day.)
        
        
        // Time format group.
        etDTTime = 0x0f00,        // Time group mask.
        etDTTimeHMS = 0x0100,     // Hours:Minutes:Seconds
        etDTTimeHMSM = 0x0200,    // Hours:Minutes:Seconds:Miliseconds
        etDTTimeS = 0x0300        // Seconds since midnight (floating point)
        
        };


class CEventTime : public CObject
    {
    public:

        CEventTime();                               // Default constructor.
    
        CEventTime(const CEventTime&);              // Copy constructor.
    
        CEventTime(const char *str, int fmt);

        int DateTimeToString(int fmt, char *str);

        CEventTime& operator=(const char FAR *);

        CEventTime& operator=(const CEventTime&);

        BOOL operator >=(const CEventTime&) const;
    
        BOOL operator <=(const CEventTime&) const;

        BOOL operator >(const CEventTime&) const;
    
        DWORD DayCount() const;
    
        DWORD Millisec() const;
    
        long ctime() const
            {
            long l1 = (long)dwDayCount - DATE_BASE_ADJUST;
            long l2 = l1 * SECONDS_PER_DAY;
            long l3 = l2 + ((long)dwMilliseconds / 1000L);
//            return ((long)dwDayCount - DATE_BASE_ADJUST) * SECONDS_PER_DAY + ((long)dwMilliseconds / 1000L);
            return (l3);
            }

    private:

        DWORD   dwDayCount;
    
        DWORD   dwMilliseconds;
    };

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -