#include "SignalProperties.h"

SignalProperties::SignalProperties(){
	analog=true;
	noise=0;
	xMove=0;
	yMove=0;
}

SignalProperties::SignalProperties(const char * filename){
	ifstream in(filename);
	if (!in.is_open()) return;
	in>>*this;
}

SignalProperties::~SignalProperties(){}

void SignalProperties::loadSignalProp(const char * filename){
	ifstream in(filename);
	if (!in.is_open()) return;
	in>>*this;
	in.close();
}


void SignalProperties::save(const char * filename){
	ofstream out(filename);
	if (!out.is_open()) return;
	out<<*this;
	out.close();
}
	
bool SignalProperties::isAnalog(){return analog;}
double SignalProperties::getNoise(){return noise;}
double SignalProperties::getXMove(){return xMove;}
double SignalProperties::getYMove(){return yMove;}

void SignalProperties::setAnalog(bool a){analog=a;}
void SignalProperties::setNoise(double n){noise=n;}
void SignalProperties::setXMove(double xm){xMove=xm;}
void SignalProperties::setYMove(double ym){yMove=ym;}

ofstream & operator<<(ofstream &out, const SignalProperties & sp){
	out<<sp.analog<<endl;
	out<<sp.noise<<endl;
	out<<sp.xMove<<endl;
	out<<sp.yMove<<endl;
	return out;
}

ifstream & operator>>(ifstream &in, SignalProperties & sp){
	in>>sp.analog;
	in>>sp.noise;
	in>>sp.xMove;
	in>>sp.yMove;
	return in;
}
