Commit 7d4342a6 authored by Adrien Dorsaz's avatar Adrien Dorsaz

Change fear for angry (seems better)

parent 0a236efa
......@@ -19,7 +19,7 @@ Emotions::Emotions()
_saveCalm=false;
_saveJoy=false;
_saveSad=false;
_saveFear=false;
_saveAngry=false;
/* These sets are used to record current to find later the emotion*/
_arousalSet = new QMap<double,double>();
......@@ -94,7 +94,7 @@ void Emotions::arousalValence(double arousal, double valence){
if(_saveSad){
updateTrainedClass("calm", arousal, "negative", valence);
}
if(_saveFear){
if(_saveAngry){
updateTrainedClass("exited", arousal, "negative", valence);
}
......@@ -119,8 +119,8 @@ void Emotions::toggleSaveSad(bool save){
resetCurrData();
}
void Emotions::toggleSaveFear(bool save){
_saveFear=save;
void Emotions::toggleSaveAngry(bool save){
_saveAngry=save;
resetCurrData();
}
......@@ -228,7 +228,7 @@ QString Emotions::getEmotion(){
}else if(curArousal.contains("exited") && curValence.contains("positive")){
emotion="joy";
}else if(curArousal.contains("exited") && curValence.contains("negative")){
emotion="fear";
emotion="angry";
}else{
emotion="try again later";
}
......
......@@ -38,7 +38,7 @@ private:
bool _saveCalm;
bool _saveJoy;
bool _saveSad;
bool _saveFear;
bool _saveAngry;
bool _guess;
bool _record;
......@@ -64,7 +64,7 @@ public:
public slots:
void arousalValence(double arousal, double valence);
void toggleSaveCalm(bool save);
void toggleSaveFear(bool save);
void toggleSaveAngry(bool save);
void toggleSaveSad(bool save);
void toggleSaveJoy(bool save);
void guessEmotion();
......
......@@ -37,7 +37,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
QObject::connect(myCallback, SIGNAL(arousalValence(double, double)), emotions, SLOT(arousalValence(double,double)));
QObject::connect(rootObject, SIGNAL(toggleSaveSad(bool)), emotions, SLOT(toggleSaveSad(bool)));
QObject::connect(rootObject, SIGNAL(toggleSaveCalm(bool)), emotions, SLOT(toggleSaveCalm(bool)));
QObject::connect(rootObject, SIGNAL(toggleSaveFear(bool)), emotions, SLOT(toggleSaveFear(bool)));
QObject::connect(rootObject, SIGNAL(toggleSaveAngry(bool)), emotions, SLOT(toggleSaveAngry(bool)));
QObject::connect(rootObject, SIGNAL(toggleSaveJoy(bool)), emotions, SLOT(toggleSaveJoy(bool)));
QObject::connect(rootObject, SIGNAL(storeClassifiers()), emotions, SLOT(storeClassifiers()));
QObject::connect(rootObject, SIGNAL(guessEmotion()), emotions, SLOT(guessEmotion()));
......
......@@ -24,7 +24,7 @@ Rectangle {
signal toggleSaveCalm(bool saving);
signal toggleSaveSad(bool saving);
signal toggleSaveFear(bool saving);
signal toggleSaveAngry(bool saving);
signal toggleSaveJoy(bool saving);
signal guessEmotion();
signal storeClassifiers();
......@@ -104,7 +104,7 @@ Rectangle {
anchors.fill: parent
onClicked:
{
if(!initSadDiv.saving && !initFearDiv.saving && !initJoyDiv.saving){
if(!initSadDiv.saving && !initAngryDiv.saving && !initJoyDiv.saving){
infoText.text="";
parent.saving=!parent.saving;
page.toggleSaveCalm(parent.saving);
......@@ -155,7 +155,7 @@ Rectangle {
anchors.fill: parent
onClicked:
{
if(!initCalmDiv.saving && !initFearDiv.saving && !initJoyDiv.saving){
if(!initCalmDiv.saving && !initAngryDiv.saving && !initJoyDiv.saving){
infoText.text="";
parent.saving=!parent.saving;
page.toggleSaveSad(parent.saving);
......@@ -173,7 +173,7 @@ Rectangle {
}
Rectangle{
id:initFearDiv;
id:initAngryDiv;
anchors.left:initSadDiv.right;
width:parent.width/4;
height:parent.height;
......@@ -181,7 +181,7 @@ Rectangle {
color:"black";
property bool saving: false;
Text{
id:initFearText;
id:initAngryText;
anchors.top:parent.top;
font.pixelSize: 20;
width:parent.width;
......@@ -192,11 +192,11 @@ Rectangle {
verticalAlignment: Text.AlignVCenter;
}
Text{
anchors.top: initFearText.baseline;
anchors.top: initAngryText.baseline;
width:parent.width;
font.pixelSize: initFearText.font.pixelSize;
font.pixelSize: initAngryText.font.pixelSize;
color: "white";
text: "Fear";
text: "Angry";
horizontalAlignment: Text.AlignHCenter;
verticalAlignment: Text.AlignVCenter;
}
......@@ -208,12 +208,12 @@ Rectangle {
if(!initCalmDiv.saving && !initSadDiv.saving && !initJoyDiv.saving){
infoText.text="";
parent.saving=!parent.saving;
page.toggleSaveFear(parent.saving);
page.toggleSaveAngry(parent.saving);
if(parent.saving){
initFearText.text="Stop train"; // it's the next action
initAngryText.text="Stop train"; // it's the next action
}else{
initFearText.text="Start train";
initAngryText.text="Start train";
}
}else{
infoText.text="Please stop other training before starting this one";
......@@ -224,7 +224,7 @@ Rectangle {
Rectangle{
id:initJoyDiv;
anchors.left: initFearDiv.right
anchors.left: initAngryDiv.right
width:parent.width/4;
height:parent.height;
border.color:"white";
......@@ -255,7 +255,7 @@ Rectangle {
anchors.fill: parent
onClicked:
{
if(!initCalmDiv.saving && !initFearDiv.saving && !initSadDiv.saving){
if(!initCalmDiv.saving && !initAngryDiv.saving && !initSadDiv.saving){
infoText.text="";
parent.saving=!parent.saving;
page.toggleSaveJoy(parent.saving);
......@@ -318,7 +318,7 @@ Rectangle {
anchors.fill: parent
onClicked:
{
if(!initCalmDiv.saving && !initFearDiv.saving && !initSadDiv.saving && !initJoyDiv.saving){
if(!initCalmDiv.saving && !initAngryDiv.saving && !initSadDiv.saving && !initJoyDiv.saving){
infoText.text="";
page.storeClassifiers();
}else{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment