// HardwareIni.h: interface for the CHardwareIni class.
//
//////////////////////////////////////////////////////////////////////
#pragma once


#include "Utility.h"

#include "HardwareConfiguration.h"
#include "DllDefines.h"

class IODLLCLASS CHardwareIni : public CIniFile, public CHardwareConfiguration
{
public:
    CHardwareIni();
    ~CHardwareIni();

    bool        GetChannelConfig(int nCardType, int nCardNo, int nNoOfChannel, std::vector<int>& vecChannelArray, int nWhatCard) override;
    int         GetSharing(int nCardType, int nCardNo, int nWhatCard) override;
    int         GetNoOfDifferentCardType(int nWhatCard) override;
    std::string GetCardName(int nCardTypeNo, int nWhatCard) override;

    // read from hardware ini file for any hardware cards info used on the machine

    // get the no of card of different card category
    int GetNoOfCard(int nCardTypeNo, int nWhatCard) override;

    // get the no of encoder card type, eg 1
    int GetEncoderCardTypeNo(int nCardTypeNo);

    // get the name of the encoder card type, eg 8133
    std::string GetEncoderCardType(int nCardTypeNo);

    // get the different no of encoder card used in the machine
    int GetNoOfEncoderCardType(void);

private:
    BOOL SetIniFile(int nWhatCard);

    // Inherited via CHardwareConfiguration
    int         GetNoOfModels(int nCardTypeNo, int nWhatCard) override;
    std::string GetModelName(int nCardTypeNo, int nModelNo, int nWhatCard) override;
    int         GetModelNoOfCards(int nCardTypeNo, int nModelNo, int nWhatCard) override;
    int         GetAddress(int nCardTypeNo, int nModelNo, int nCardNo, int nWhatCard) override;
    int         GetSpeed(int nCardTypeNo, int nModelNo, int nCardNo, int nWhatCard) override;
    int         GetHSLSpeed(int nCardTypeNo, int nModelNo, int nCardNo, int nWhatCard) override;
    int         GetHSLHubNumber(int nCardTypeNo, int nModelNo, int nCardNo, int nWhatCard) override;

    // Inherited via CHardwareConfiguration
    int GetGalilTriggerPulseWidth() override;

    // Inherited via CHardwareConfiguration
    bool GetGalilNewHomeBySensor() override;
};