Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: F746_GUI Array_Matrix TS_DISCO_F746NG mbed LCD_DISCO_F746NG BSP_DISCO_F746NG SDFileSystem_Warning_Fixed FrequencyResponseDrawer F746_SAI_IO
Diff: MyClasses_Functions/FrquencyResponseDrawer.hpp
- Revision:
- 2:2478e7a8e8d5
- Parent:
- 0:04b43b777fae
- Child:
- 3:cda40218256c
--- a/MyClasses_Functions/FrquencyResponseDrawer.hpp Wed Apr 20 12:10:17 2016 +0000
+++ b/MyClasses_Functions/FrquencyResponseDrawer.hpp Mon Apr 25 00:49:09 2016 +0000
@@ -2,7 +2,7 @@
// 周波数が対数スケールの周波数特性を描画するクラス
// FrqRespDrawer class Header
//
-// 2016/04/19, Copyright (c) 2016 MIKAMI, Naoki
+// 2016/04/25, Copyright (c) 2016 MIKAMI, Naoki
//-----------------------------------------------------------
#ifndef F746_FRQ_RESP_DRAWER_HPP
@@ -21,19 +21,18 @@
// Constructor
FrqRespDrawer(uint16_t org, float min, float max, uint16_t dec,
- uint16_t orgY, float minDb, float maxDb, uint16_t db10,
- float fs,
+ uint16_t orgY, float minDb, float maxDb,
+ float db1Pixel, float ySpace, float fs,
uint32_t lineColor = 0xFF00B0FF,
uint32_t axisColor = LCD_COLOR_LIGHTGRAY,
uint32_t backColor = GuiBase::ENUM_BACK)
: lcd_(GuiBase::GetLcdPtr()),
ORGX_(org), MIN_(min), MAX_(max), DEC_(dec),
- ORGY_(orgY), MIN_DB_(minDb), MAX_DB_(maxDb), DB10_(db10),
- FS_(fs),
+ ORGY_(orgY), MIN_DB_(minDb), MAX_DB_(maxDb),
+ DB1_(db1Pixel), Y_SPACE_(db1Pixel*ySpace), FS_(fs),
LINE_COLOR_(lineColor),
AXIS_COLOR_(axisColor),
- BACK_COLOR_(backColor),
- DB1_(db10*0.1f) {}
+ BACK_COLOR_(backColor) {}
// 周波数に対応する x 座標値の取得
int X(float frq)
@@ -52,8 +51,8 @@
uint32_t textColor = LCD_COLOR_WHITE);
// 縦軸の目盛値の表示
- void DrawNumericY(int offsetX, int offsetY, int count,
- uint16_t d_dB, const char fmt[], sFONT &fonts = Font12,
+ void DrawNumericY(int offsetX, int offsetY, uint16_t d_dB,
+ const char fmt[], sFONT &fonts = Font12,
uint32_t textColor = LCD_COLOR_WHITE,
string str = "[dB]");
@@ -74,12 +73,12 @@
const uint16_t ORGY_; // 縦軸の目盛の最小値に対応する位置
const float MIN_DB_; // 縦軸の目盛の最小値 [dB]
const float MAX_DB_; // 縦軸の目盛の最大値 [dB]
- const uint16_t DB10_; // 10 dB 対応する長さ (pixels)
+ const float DB1_; // 1 dB に対応する pixels 数
+ const float Y_SPACE_; // 縦軸の目盛線の間隔に対応する pixels 数
const float FS_; // 標本化周波数
const uint32_t LINE_COLOR_;
const uint32_t AXIS_COLOR_;
const uint32_t BACK_COLOR_;
- const float DB1_;
// 丸め
int Round(float x) { return x + 0.5f - (x < 0); }
@@ -94,4 +93,3 @@
};
}
#endif // F746_FRQ_RESP_DRAWER_HPP
-