// Downtime.h: interface for the CDowntime class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DOWNTIME_H__6D22B25D_CA6E_456C_984D_059BFCE8E131__INCLUDED_)
#define AFX_DOWNTIME_H__6D22B25D_CA6E_456C_984D_059BFCE8E131__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "UnscheduledDowntime.h"
#include "ScheduledDowntime.h"

/*
   #ifdef   BUILD_MCCTRDLL
   #define      MCCTRDLLCLASS   __declspec(dllexport)
   #else
   #define      MCCTRDLLCLASS   __declspec(dllimport)
   #endif

   class MCCTRDLLCLASS CDowntime  */
class CDowntime
{
public:
//  default constructor
    CDowntime();

//  default destructor
    virtual ~CDowntime();

//  read all equipment substate time span from file
    void ReadTimeSpanFromFile();

//  save equipment substate time periodically to file
    void SaveTimeInfo();

//  set unscheduled and scheduled equipment state
    void SetEquipState(int iEvt, int iState);

//  get total unscheduled and scheduled equipment state time
    LONGLONG GetTotalTime();

//  get unscheduled downtime in counts
    LONGLONG GetUnscheduledDowntime();

//  get scheduled downtime in counts
    LONGLONG GetScheduledDowntime();

//  get equipment substate time
    LONGLONG GetEquipSubStateTime(int iEvt);

//  check is equipment Substate timer started
    bool IsTimerStarted(int iEvt);

private:
    CUnscheduledDowntime m_unscheduledDowntime; // unscheduled downtime
    CScheduledDowntime   m_scheduledDowntime;   // scheduled downtime
};

#endif // !defined(AFX_DOWNTIME_H__6D22B25D_CA6E_456C_984D_059BFCE8E131__INCLUDED_)
