Skip to content
Snippets Groups Projects
Commit 01973629 authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Move methods from Parameter header to its cpp

parent a1cc8db1
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,37 @@ Parameter::Parameter(const String& name_, Array<var> a, int defaultVal,
}
Parameter::~Parameter() {}
const String& Parameter::getName()
{
return name;
}
const String& Parameter::getDescription()
{
return description;
}
void Parameter::addDescription(const String& desc)
{
description = desc;
}
var Parameter::getDefaultValue()
{
return defaultValue;
}
int Parameter::getID()
{
return parameterId;
}
Array<var> Parameter::getPossibleValues()
{
return possibleValues;
}
void Parameter::setValue(float val, int chan)
{
......@@ -111,6 +142,32 @@ void Parameter::setValue(float val, int chan)
}
var Parameter::operator[](int chan)
{
return values[chan];
}
var Parameter::getValue(int chan)
{
return values[chan];
}
bool Parameter::isBoolean()
{
return isBool;
}
bool Parameter::isContinuous()
{
return isCont;
}
bool Parameter::isDiscrete()
{
return isDisc;
}
// void BooleanParameter::setValue(float val, int chan)
// {
......
......@@ -58,79 +58,46 @@ public:
Parameter(const String& name_, Array<var> a, int defaultVal, int ID, bool t = false);
/** Destructor.*/
~Parameter() {}
~Parameter();
/** Returns the name of the parameter.*/
const String& getName()
{
return name;
}
const String& getName();
/** Returns a description of the parameter.*/
const String& getDescription()
{
return description;
}
const String& getDescription();
/** Sets the description of the parameter.*/
void addDescription(const String& desc)
{
description = desc;
}
void addDescription(const String& desc);
/** Returns the default value of a parameter (can be boolean, int, or float).*/
var getDefaultValue()
{
return defaultValue;
}
var getDefaultValue();
/** Returns the unique integer ID of a parameter.*/
int getID()
{
return parameterId;
}
int getID();
/** Returns all the possible values that a parameter can take.*/
Array<var> getPossibleValues()
{
return possibleValues;
}
Array<var> getPossibleValues();
/** Sets the value of a parameter for a given channel.*/
void setValue(float val, int chan);
/** Returns the value of a parameter for a given channel.*/
var operator[](int chan)
{
return values[chan];
}
var operator[](int chan);
/** Returns the value of a parameter for a given channel.*/
var getValue(int chan)
{
return values[chan];
}
var getValue(int chan);
/** Copies a parameter.*/
Parameter& operator=(const Parameter& other);
/** Returns true if a parameter is boolean, false otherwise.*/
bool isBoolean()
{
return isBool;
}
bool isBoolean();
/** Returns true if a parameter is continuous, false otherwise.*/
bool isContinuous()
{
return isCont;
}
bool isContinuous();
/** Returns true if a parameter is discrete, false otherwise.*/
bool isDiscrete()
{
return isDisc;
}
bool isDiscrete();
/** Certain parameters should not be changed while data acquisition is active.
......
......@@ -161,6 +161,11 @@ void ParameterEditor::parentHierarchyChanged()
}
void ParameterEditor::setChannelSelector(ChannelSelector* ch)
{
channelSelector = ch;
}
void ParameterEditor::setEnabled(bool state)
{
......@@ -285,6 +290,8 @@ ParameterButton::ParameterButton(var value, int buttonType, Font labelFont) :
}
ParameterButton::~ParameterButton() {}
void ParameterButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDown)
{
g.setColour(Colours::grey);
......@@ -400,6 +407,8 @@ ParameterCheckbox::ParameterCheckbox(bool defaultState) : Button("name"), isEnab
false);
}
ParameterCheckbox::~ParameterCheckbox() {}
void ParameterCheckbox::paintButton(Graphics& g, bool isMouseOver, bool isButtonDown)
{
......@@ -446,6 +455,8 @@ ParameterSlider::ParameterSlider(float min, float max, float def, Font labelFont
}
ParameterSlider::~ParameterSlider() {}
void ParameterSlider::paint(Graphics& g)
{
......
......@@ -61,10 +61,7 @@ public:
void buttonClicked(Button* button);
void sliderValueChanged(Slider* slider);
void setChannelSelector(ChannelSelector* ch)
{
channelSelector = ch;
}
void setChannelSelector(ChannelSelector* ch);
// for inactivation during acquisition:
void setEnabled(bool t);
......@@ -104,7 +101,7 @@ class ParameterButton : public Button
{
public:
ParameterButton(var value, int buttonType, Font labelFont);
~ParameterButton() {}
~ParameterButton();
bool isEnabled;
//Used to mark if unused, usedByActive, or usedby inactive
......@@ -150,7 +147,7 @@ class ParameterCheckbox : public Button
{
public:
ParameterCheckbox(bool defaultState);
~ParameterCheckbox() {}
~ParameterCheckbox();
bool isEnabled;
......@@ -175,7 +172,7 @@ class ParameterSlider : public Slider
{
public:
ParameterSlider(float min, float max, float defaultValue, Font f);
~ParameterSlider() {}
~ParameterSlider();
bool isEnabled;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment