#include "anchor.h"

Anchor::Anchor(QObject *parent) : QObject(parent)
{

}

QDateTime Anchor::getDate()        //getters
{
    return itsDate;
}

QString Anchor::getName()
{
    return itsName;
}

int Anchor::getRssi()
{
    return itsRssi;
}

double Anchor::getX()
{
    return itsXPossition;
}

double Anchor::getY()
{
    return itsYPossition;
}

double Anchor::getRadius()
{
    return itsRadius;
}

void Anchor::setRssi(int newRssi)       //setters+signals
{
    if(itsRssi != newRssi)
        emit rssiChanged();
    itsRssi = newRssi;
    itsRadius = ((itsRssi-58.255)/2.0925)/3; //radius is function of RSSI
}

void Anchor::setDate(QDateTime newDate)
{
    if(itsDate != newDate)
        emit dateChanged(newDate);
    itsDate = newDate;
}

void Anchor::setName(QString newName)
{
    if(itsName != newName)
        emit nameChanged(newName);
    itsName = newName;
}

void Anchor::setX(double newXPossition)
{
    if(itsXPossition != newXPossition)
        emit XChanged(newXPossition);
    itsXPossition = newXPossition;
}

void Anchor::setY(double newYPossition)
{
    if(itsYPossition != newYPossition)
        emit YChanged(newYPossition);
    itsYPossition = newYPossition;
}
