// Uptime.h: interface for the CUptime class.
//
//////////////////////////////////////////////////////////////////////

#pragma once

#include "EngineeringTime.h"
#include "ManufacturingTime.h"

class CUptime
{
public:
    //  default constructor
    CUptime();

    //  default destructor
    virtual ~CUptime();

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

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

    //  set engineering time and manufacturing time equipment state
    void SetEquipState(int iEvt, int iState);

    //  get total engineering time and manufacturing time equipment state time
    LONGLONG GetTotalTime();

    //  get Uptime
    LONGLONG GetUptime();

    //  get engineering time
    LONGLONG GetEngineeringTime();

    //  get manufacturing time
    LONGLONG GetManufacturingTime();

    //  get productive time
    LONGLONG GetProductiveTime();

    //  get standby time
    LONGLONG GetStandbyTime();

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

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

private:
    CEngineeringTime m_engineeringTime;     // engineering time
    CManufacturingTime m_manufacturingTime; // manufacturing time
};
