#include "nomDeLogiciel.h" nomDeLogiciel::Logiciel nomDeLogiciel::fromString( std::string s) { if (s == "parmela" ) return parmela; else if ( s == "transport" ) return transport; else if ( s == "generator" ) return generator; else if ( s == "test" ) return test; else if ( s == "madx" ) return madx; else if ( s == "usersprogram" ) return usersprogram; return unknownSoftware; } std::string nomDeLogiciel::toString(nomDeLogiciel::Logiciel lg) { switch (lg) { case parmela : { return "parmela"; } case transport : { return "transport"; } case generator : { return "generator"; } case test : { return "test"; } case madx : { return "madx"; } case usersprogram : { return "usersprogram"; } case unknownSoftware : { return "unknownSoftware"; } } return "unknownSoftware"; } /** Color of the background of the sofware Should be a valid Css name as FFEEDD */ std::string nomDeLogiciel::getWtColor( nomDeLogiciel::Logiciel lg) const { switch (lg) { case parmela : { return "#e09bdf"; } case transport : { return "#c0ea8e"; } case generator : { return "#a3c0ed"; } case test : { return "#ecc38e"; } case madx : { return "#ecc38e"; } //{ return "#FFFF00"; } case unknownSoftware : { return "#FFFFFF"; } } return "#FFFFFF"; } nomDeLogiciel::nomDeLogiciel() { program_ = unknownSoftware; progString_ = toString(program_); } nomDeLogiciel::nomDeLogiciel(const string& s) { program_ = fromString(s); progString_ = toString(program_); } nomDeLogiciel::nomDeLogiciel(int val) { program_ = (Logiciel)val; progString_ = toString(program_); } int nomDeLogiciel::getNumberOfSoftwares() { return unknownSoftware; } // operators nomDeLogiciel& nomDeLogiciel::operator= (const nomDeLogiciel& nl) { program_ = nl.program_; progString_ = nl.progString_; return *this; } bool nomDeLogiciel::operator== (const nomDeLogiciel& nl) { return ( program_ == nl.program_); } bool nomDeLogiciel::operator!= (const nomDeLogiciel& nl) { return ( program_ != nl.program_); }