Line data Source code
1 : /* 2 : * This file is free software: you can redistribute it and/or modify it 3 : * under the terms of the GNU General Public License as published by the 4 : * Free Software Foundation, either version 3 of the License, or 5 : * (at your option) any later version. 6 : * 7 : * This file is distributed in the hope that it will be useful, but 8 : * WITHOUT ANY WARRANTY; without even the implied warranty of 9 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 : * See the GNU General Public License for more details. 11 : * 12 : * You should have received a copy of the GNU General Public License along 13 : * with this program. If not, see <http://www.gnu.org/licenses/>. 14 : * 15 : * AP_OSD partially based on betaflight and inav osd.c implemention. 16 : * clarity.mcm font is taken from inav configurator. 17 : * Many thanks to their authors. 18 : */ 19 : 20 : /* 21 : parameter object for one setting in AP_OSD 22 : */ 23 : 24 : #include "AP_OSD.h" 25 : 26 : const AP_Param::GroupInfo AP_OSD_Setting::var_info[] = { 27 : // @Param: _EN 28 : // @DisplayName: Enable 29 : // @Description: Enable setting 30 : // @Values: 0:Disabled,1:Enabled 31 : // @User: Standard 32 : AP_GROUPINFO_FLAGS_DEFAULT_POINTER("_EN", 1, AP_OSD_Setting, enabled, default_enabled), 33 : 34 : // @Param: _X 35 : // @DisplayName: X position 36 : // @Description: Horizontal position on screen 37 : // @Range: 0 29 38 : // @User: Standard 39 : AP_GROUPINFO_FLAGS_DEFAULT_POINTER("_X", 2, AP_OSD_Setting, xpos, default_xpos), 40 : 41 : // @Param: _Y 42 : // @DisplayName: Y position 43 : // @Description: Vertical position on screen 44 : // @Range: 0 15 45 : // @User: Standard 46 : AP_GROUPINFO_FLAGS_DEFAULT_POINTER("_Y", 3, AP_OSD_Setting, ypos, default_ypos), 47 : 48 : AP_GROUPEND 49 : }; 50 : 51 : // constructor 52 494640 : AP_OSD_Setting::AP_OSD_Setting(bool _enabled, uint8_t x, uint8_t y) : 53 494640 : default_enabled(_enabled), 54 494640 : default_xpos(x), 55 494640 : default_ypos(y) 56 : { 57 494640 : AP_Param::setup_object_defaults(this, var_info); 58 494640 : }