00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FUNCTOR_TRAITS_H
00021 #define FUNCTOR_TRAITS_H
00022
00023
00024 #include "functor/functor.hpp"
00025
00026 #include <qwt_plot_curve.h>
00027 #include <qwt_symbol.h>
00028
00029
00030 namespace qsapecng
00031 {
00032
00033
00034
00035 template < class F >
00036 struct functor_traits { };
00037
00038
00039
00040 template < >
00041 struct functor_traits< sapecng::magnitude >
00042 {
00043 static const QString title;
00044 static const QString xLabel;
00045 static const QString yLabel;
00046 static const QwtPlotCurve::CurveStyle style;
00047 static const QwtPlotCurve::CurveAttribute attribute;
00048 static const QwtSymbol::Style symbol;
00049 static const int ssize;
00050 static const QPen pen;
00051 };
00052 const QString
00053 functor_traits<sapecng::magnitude>::title = QObject::tr("Magnitude");
00054 const QString
00055 functor_traits<sapecng::magnitude>::xLabel = QObject::tr("Frequency");
00056 const QString
00057 functor_traits<sapecng::magnitude>::yLabel = QObject::tr("Value");
00058 const QwtPlotCurve::CurveStyle
00059 functor_traits<sapecng::magnitude>::style = QwtPlotCurve::Lines;
00060 const QwtPlotCurve::CurveAttribute
00061 functor_traits<sapecng::magnitude>::attribute = QwtPlotCurve::Fitted;
00062 const QwtSymbol::Style
00063 functor_traits<sapecng::magnitude>::symbol = QwtSymbol::NoSymbol;
00064 const int functor_traits<sapecng::magnitude>::ssize = 0;
00065 const QPen functor_traits<sapecng::magnitude>::pen =
00066 QPen(Qt::SolidPattern, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
00067
00068
00069
00070 template < >
00071 struct functor_traits< sapecng::phase >
00072 {
00073 static const QString title;
00074 static const QString xLabel;
00075 static const QString yLabel;
00076 static const QwtPlotCurve::CurveStyle style;
00077 static const QwtPlotCurve::CurveAttribute attribute;
00078 static const QwtSymbol::Style symbol;
00079 static const int ssize;
00080 static const QPen pen;
00081 };
00082 const QString functor_traits<sapecng::phase>::title = QObject::tr("Phase");
00083 const QString
00084 functor_traits<sapecng::phase>::xLabel = QObject::tr("Frequency");
00085 const QString functor_traits<sapecng::phase>::yLabel = QObject::tr("Value");
00086 const QwtPlotCurve::CurveStyle
00087 functor_traits<sapecng::phase>::style = QwtPlotCurve::Lines;
00088 const QwtPlotCurve::CurveAttribute
00089 functor_traits<sapecng::phase>::attribute = QwtPlotCurve::Fitted;
00090 const QwtSymbol::Style
00091 functor_traits<sapecng::phase>::symbol = QwtSymbol::NoSymbol;
00092 const int functor_traits<sapecng::phase>::ssize = 0;
00093 const QPen functor_traits<sapecng::phase>::pen =
00094 QPen(Qt::SolidPattern, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
00095
00096
00097
00098 template < >
00099 struct functor_traits< sapecng::gain >
00100 {
00101 static const QString title;
00102 static const QString xLabel;
00103 static const QString yLabel;
00104 static const QwtPlotCurve::CurveStyle style;
00105 static const QwtPlotCurve::CurveAttribute attribute;
00106 static const QwtSymbol::Style symbol;
00107 static const int ssize;
00108 static const QPen pen;
00109 };
00110 const QString functor_traits<sapecng::gain>::title = QObject::tr("Gain");
00111 const QString
00112 functor_traits<sapecng::gain>::xLabel = QObject::tr("Frequency");
00113 const QString functor_traits<sapecng::gain>::yLabel = QObject::tr("dB");
00114 const QwtPlotCurve::CurveStyle
00115 functor_traits<sapecng::gain>::style = QwtPlotCurve::Lines;
00116 const QwtPlotCurve::CurveAttribute
00117 functor_traits<sapecng::gain>::attribute = QwtPlotCurve::Fitted;
00118 const QwtSymbol::Style
00119 functor_traits<sapecng::gain>::symbol = QwtSymbol::NoSymbol;
00120 const int functor_traits<sapecng::gain>::ssize = 0;
00121 const QPen functor_traits<sapecng::gain>::pen =
00122 QPen(Qt::SolidPattern, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
00123
00124
00125
00126 template < >
00127 struct functor_traits< sapecng::loss >
00128 {
00129 static const QString title;
00130 static const QString xLabel;
00131 static const QString yLabel;
00132 static const QwtPlotCurve::CurveStyle style;
00133 static const QwtPlotCurve::CurveAttribute attribute;
00134 static const QwtSymbol::Style symbol;
00135 static const int ssize;
00136 static const QPen pen;
00137 };
00138 const QString functor_traits<sapecng::loss>::title = QObject::tr("Loss");
00139 const QString
00140 functor_traits<sapecng::loss>::xLabel = QObject::tr("Frequency");
00141 const QString functor_traits<sapecng::loss>::yLabel = QObject::tr("dB");
00142 const QwtPlotCurve::CurveStyle
00143 functor_traits<sapecng::loss>::style = QwtPlotCurve::Lines;
00144 const QwtPlotCurve::CurveAttribute
00145 functor_traits<sapecng::loss>::attribute = QwtPlotCurve::Fitted;
00146 const QwtSymbol::Style
00147 functor_traits<sapecng::loss>::symbol = QwtSymbol::NoSymbol;
00148 const int functor_traits<sapecng::loss>::ssize = 0;
00149 const QPen functor_traits<sapecng::loss>::pen =
00150 QPen(Qt::SolidPattern, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
00151
00152
00153
00154 template < >
00155 struct functor_traits< sapecng::zeros >
00156 {
00157 static const QString title;
00158 static const QString xLabel;
00159 static const QString yLabel;
00160 static const QwtPlotCurve::CurveStyle style;
00161 static const QwtPlotCurve::CurveAttribute attribute;
00162 static const QwtSymbol::Style symbol;
00163 static const int ssize;
00164 static const QPen pen;
00165 };
00166 const QString functor_traits<sapecng::zeros>::title = QObject::tr("Zeros");
00167 const QString
00168 functor_traits<sapecng::zeros>::xLabel = QObject::tr("Real part");
00169 const QString
00170 functor_traits<sapecng::zeros>::yLabel = QObject::tr("Img part");
00171 const QwtPlotCurve::CurveStyle
00172 functor_traits<sapecng::zeros>::style = QwtPlotCurve::NoCurve;
00173 const QwtPlotCurve::CurveAttribute
00174 functor_traits<sapecng::zeros>::attribute = QwtPlotCurve::Fitted;
00175 const QwtSymbol::Style
00176 functor_traits<sapecng::zeros>::symbol = QwtSymbol::Ellipse;
00177 const int functor_traits<sapecng::zeros>::ssize = 7;
00178 const QPen functor_traits<sapecng::zeros>::pen = QPen();
00179
00180
00181
00182 template < >
00183 struct functor_traits< sapecng::poles >
00184 {
00185 static const QString title;
00186 static const QString xLabel;
00187 static const QString yLabel;
00188 static const QwtPlotCurve::CurveStyle style;
00189 static const QwtPlotCurve::CurveAttribute attribute;
00190 static const QwtSymbol::Style symbol;
00191 static const int ssize;
00192 static const QPen pen;
00193 };
00194 const QString functor_traits<sapecng::poles>::title = QObject::tr("Poles");
00195 const QString
00196 functor_traits<sapecng::poles>::xLabel = QObject::tr("Real part");
00197 const QString
00198 functor_traits<sapecng::poles>::yLabel = QObject::tr("Img part");
00199 const QwtPlotCurve::CurveStyle
00200 functor_traits<sapecng::poles>::style = QwtPlotCurve::NoCurve;
00201 const QwtPlotCurve::CurveAttribute
00202 functor_traits<sapecng::poles>::attribute = QwtPlotCurve::Fitted;
00203 const QwtSymbol::Style
00204 functor_traits<sapecng::poles>::symbol = QwtSymbol::XCross;
00205 const int functor_traits<sapecng::poles>::ssize = 7;
00206 const QPen functor_traits<sapecng::poles>::pen = QPen();
00207
00208
00209
00210 }
00211
00212
00213 #endif // FUNCTOR_TRAITS_H