#include "CounterChannel.h"
#include <iostream>

CounterChannel::CounterChannel(QObject *parent) : QObject(parent)
{

}

bool CounterChannel::isActive()
{
    return active;
}
QString CounterChannel::getDeviceId()
{
    return deviceId;
}
QString CounterChannel::getChannelId()
{
    return channelId;
}
QString CounterChannel::getChannelCode()
{
    return channelCode;
}
QString CounterChannel::getChannelNo()
{
    return channelNo;
}
QString CounterChannel::getDelays()
{
    return delays;
}
QString CounterChannel::getIsUse()
{
    return isUse;
}
QString CounterChannel::getName()
{
    return name;
}
void CounterChannel::setActive(bool active)
{
    this->active = active;
}
void CounterChannel::setDeviceId(QString deviceId)
{
    this->deviceId = deviceId;
}
void CounterChannel::setChannelId(QString channelId)
{
    this->channelId = channelId;
}
void CounterChannel::setChannelCode(QString channelCode)
{
    this->channelCode = channelCode;
}
void CounterChannel::setChannelNo(QString channelNo)
{
    this->channelNo = channelNo;
}
void CounterChannel::setDelays(QString delays)
{
    this->delays = delays;
}
void CounterChannel::setIsUse(QString isUse)
{
    this->isUse = isUse;
}
void CounterChannel::setName(QString name)
{
    this->name = name;
}

QList<QStringList> CounterChannel::getHisData()
{
    return this->hisDataList;
}
void CounterChannel::appendHisData(QString timestampStr, QString valueStr)
{
    QStringList valueObj;
    valueObj << timestampStr << valueStr;
    hisDataList.append(valueObj);
    if (hisDataList.size() > maxHisDataCount) {
        hisDataList = hisDataList.mid(hisDataList.size() - maxHisDataCount);
    }
}
