1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 20:10:11 +03:00

Update OSD tab to support HD (50x18) mode

This commit is contained in:
Geoff Sim 2021-11-20 09:53:49 +00:00
parent 802b28c86b
commit 7dbb279c0f
6 changed files with 266 additions and 228 deletions

View file

@ -1131,6 +1131,9 @@
"portsFunction_DJI_FPV": { "portsFunction_DJI_FPV": {
"message": "DJI FPV VTX" "message": "DJI FPV VTX"
}, },
"portsFunction_SHARKBYTE_OSD": {
"message": "Shark Byte OSD"
},
"portsFunction_IMU2": { "portsFunction_IMU2": {
"message": "Secondary IMU" "message": "Secondary IMU"
}, },

View file

@ -44,6 +44,7 @@ var mspHelper = (function (gui) {
'DJI_FPV': 21, 'DJI_FPV': 21,
'SMARTPORT_MASTER': 23, 'SMARTPORT_MASTER': 23,
'IMU2': 24, 'IMU2': 24,
'SHARKBYTE_OSD': 25,
}; };
// Required for MSP_DEBUGMSG because console.log() doesn't allow omitting // Required for MSP_DEBUGMSG because console.log() doesn't allow omitting

View file

@ -415,8 +415,28 @@ button {
border-bottom: 0; border-bottom: 0;
} }
.tab-osd .third_left {
float: left;
width: calc(50% - 197px);
}
.tab-osd .third_right {
float: right;
width: calc(50% - 197px);
}
.tab-osd .preview { .tab-osd .preview {
width: 360px; width: 360px;
left: calc(50% - 197px);
}
.tab-osd .preview_hd {
width: 600px !important;
left: calc(50% - 317px) !important;
}
.tab-osd .preview_hd_side {
width: calc(50% - 317px) !important;
} }
.tab-osd .preview { .tab-osd .preview {

View file

@ -25,217 +25,215 @@
</div> </div>
</div> </div>
</div> </div>
<div class="cf_column twothird"> <div class="gui_box preview" style="float: left; position: fixed;">
<div class="gui_box grey preview" style="float: left; position: fixed;"> <div class="gui_box_titlebar">
<div class="gui_box_titlebar image"> <div class="spacer_box_title" data-i18n="osd_preview_title"></div>
<div class="spacer_box_title" data-i18n="osd_preview_title"></div> </div>
</div> <div class="display-layout">
<div class="display-layout"> <div class="col right">
<div class="col right"> <div class="preview">
<div class="preview">
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="cf_column third_right" style="width: calc(100% - 377px);"> </div>
<div class="gui_box grey"> <div class="cf_column third_right">
<div class="gui_box_titlebar"> <div class="gui_box grey">
<div class="spacer_box_title" data-i18n="osd_video_format"></div> <div class="gui_box_titlebar">
</div> <div class="spacer_box_title" data-i18n="osd_video_format"></div>
<div class="spacer_box">
<div class="video-types"></div>
</div>
</div> </div>
<div class="gui_box grey settings-container"> <div class="spacer_box">
<div class="gui_box_titlebar"> <div class="video-types"></div>
<div class="spacer_box_title" data-i18n="settings"></div>
</div>
<div class="spacer_box">
<div class="settings">
<label class="units">
<select id="unit_mode" name="unit_mode"></select>
<span data-i18n="osd_units"></span>
<div class="helpicon cf_tip" style="margin-top: 2px"></div>
</label>
<label>
<select class="update_preview" data-setting="osd_main_voltage_decimals" data-live="true"></select>
<span data-i18n="osd_main_voltage_decimals"></span>
</label>
<label>
<select class="update_preview" data-setting="osd_coordinate_digits" data-live="true"></select>
<span data-i18n="osd_coordinate_digits"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_DIGITS_HELP"></div>
<label>
<select class="update_preview" data-setting="osd_plus_code_digits" data-live="true"></select>
<span data-i18n="osd_plus_code_digits"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_SHORT_HELP"></div>
<label>
<select class="update_preview" data-setting="osd_plus_code_short" data-live="true"></select>
<span data-i18n="osd_plus_code_short"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osd_esc_rpm_precision_help"></div>
<label>
<select class="update_preview" data-setting="osd_esc_rpm_precision" data-live="true"></select>
<span data-i18n="osd_esc_rpm_precision"></span>
</label>
<label>
<select class="update_preview" data-setting="osd_crosshairs_style" data-live="true"></select>
<span data-i18n="osd_crosshairs_style"></span>
</label>
<label>
<select class="update_preview" data-setting="osd_left_sidebar_scroll" data-live="true"></select>
<span data-i18n="osd_left_sidebar_scroll"></span>
</label>
<label>
<select class="update_preview" data-setting="osd_right_sidebar_scroll" data-live="true"></select>
<span data-i18n="osd_right_sidebar_scroll"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdSettingCRSF_LQ_FORMAT_HELP"></div>
<label>
<select class="update_preview" data-setting="osd_crsf_lq_format" data-live="true"></select>
<span data-i18n="osd_crsf_lq_format"></span>
</label>
<label>
<input type="checkbox" class="toggle update_preview" data-setting="osd_sidebar_scroll_arrows" data-live="true">
<span data-i18n="osd_sidebar_scroll_arrows"></span>
</label>
<label>
<input type="checkbox" class="toggle update_preview" data-setting="osd_home_position_arm_screen" data-live="true">
<span data-i18n="osd_home_position_arm_screen"></span>
</label>
</div>
</div>
</div> </div>
<div class="gui_box grey alarms-container"> </div>
<div class="gui_box_titlebar"> <div class="gui_box grey settings-container">
<div class="spacer_box_title" data-i18n="osd_alarms"></div> <div class="gui_box_titlebar">
</div> <div class="spacer_box_title" data-i18n="settings"></div>
<div class="spacer_box settings"> </div>
<label for="rssi_alarm"> <div class="spacer_box">
<input id="osd_rssi_alarm" data-setting="osd_rssi_alarm" data-setting-multiplier="1" type="number" data-step="1" /> <div class="settings">
<span data-i18n="osd_rssi_alarm"></span> <label class="units">
<select id="unit_mode" name="unit_mode"></select>
<span data-i18n="osd_units"></span>
<div class="helpicon cf_tip" style="margin-top: 2px"></div>
</label> </label>
<label for="time_alarm"> <label>
<input id="osd_time_alarm" data-setting="osd_time_alarm" data-setting-multiplier="1" type="number" data-step="1" /> <select class="update_preview" data-setting="osd_main_voltage_decimals" data-live="true"></select>
<span data-i18n="osd_time_alarm"></span> <span data-i18n="osd_main_voltage_decimals"></span>
</label> </label>
<label for="osd_alt_alarm"> <label>
<input id="osd_alt_alarm" data-setting="osd_alt_alarm" data-setting-multiplier="1" type="number" data-step="1" /> <select class="update_preview" data-setting="osd_coordinate_digits" data-live="true"></select>
<span data-i18n="osd_alt_alarm"></span> <span data-i18n="osd_coordinate_digits"></span>
</label> </label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmMAX_NEG_ALTITUDE_HELP"></div> <div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_DIGITS_HELP"></div>
<label for="osd_neg_alt_alarm"> <label>
<input id="osd_neg_alt_alarm" data-setting="osd_neg_alt_alarm" data-setting-multiplier="1" type="number" data-step="1" /> <select class="update_preview" data-setting="osd_plus_code_digits" data-live="true"></select>
<span data-i18n="osd_neg_alt_alarm"></span> <span data-i18n="osd_plus_code_digits"></span>
</label> </label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmDIST_HELP"></div> <div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_SHORT_HELP"></div>
<label for="osd_dist_alarm"> <label>
<input id="osd_dist_alarm" data-setting="osd_dist_alarm" data-setting-multiplier="1" type="number" data-step="1" /> <select class="update_preview" data-setting="osd_plus_code_short" data-live="true"></select>
<span data-i18n="osd_dist_alarm"></span> <span data-i18n="osd_plus_code_short"></span>
</label> </label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmGFORCE_HELP"></div> <div class="helpicon cf_tip" data-i18n_title="osd_esc_rpm_precision_help"></div>
<label for="osd_gforce_alarm"> <label>
<input id="osd_gforce_alarm" data-setting="osd_gforce_alarm" data-setting-multiplier="1" type="number" data-step="0.1" /> <select class="update_preview" data-setting="osd_esc_rpm_precision" data-live="true"></select>
<span data-i18n="osd_gforce_alarm"></span> <span data-i18n="osd_esc_rpm_precision"></span>
</label> </label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmGFORCE_AXIS_MIN_HELP"></div> <label>
<label for="osd_gforce_axis_alarm_min"> <select class="update_preview" data-setting="osd_crosshairs_style" data-live="true"></select>
<input id="osd_gforce_axis_alarm_min" data-setting="osd_gforce_axis_alarm_min" data-setting-multiplier="1" type="number" data-step="0.1" /> <span data-i18n="osd_crosshairs_style"></span>
<span data-i18n="osd_gforce_axis_alarm_min"></span>
</label> </label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmGFORCE_AXIS_MAX_HELP"></div> <label>
<label for="osd_gforce_axis_alarm_max"> <select class="update_preview" data-setting="osd_left_sidebar_scroll" data-live="true"></select>
<input id="osd_gforce_axis_alarm_max" data-setting="osd_gforce_axis_alarm_max" data-setting-multiplier="1" type="number" data-step="0.1" /> <span data-i18n="osd_left_sidebar_scroll"></span>
<span data-i18n="osd_gforce_axis_alarm_max"></span>
</label> </label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmCURRENT_HELP"></div> <label>
<label for="osd_current_alarm"> <select class="update_preview" data-setting="osd_right_sidebar_scroll" data-live="true"></select>
<input id="osd_current_alarm" data-setting="osd_current_alarm" data-setting-multiplier="1" type="number" data-step="1" /> <span data-i18n="osd_right_sidebar_scroll"></span>
<span data-i18n="osd_current_alarm"></span>
</label> </label>
<label for="imu_temp_alarm_min"> <div class="helpicon cf_tip" data-i18n_title="osdSettingCRSF_LQ_FORMAT_HELP"></div>
<input id="imu_temp_alarm_min" data-setting="osd_imu_temp_alarm_min" data-setting-multiplier="10" type="number" data-step="0.5" /> <label>
<span data-i18n="osd_imu_temp_alarm_min"></span> <select class="update_preview" data-setting="osd_crsf_lq_format" data-live="true"></select>
<span data-i18n="osd_crsf_lq_format"></span>
</label> </label>
<label for="imu_temp_alarm_max"> <label>
<input id="imu_temp_alarm_max" data-setting="osd_imu_temp_alarm_max" data-setting-multiplier="10" type="number" data-step="0.5" /> <input type="checkbox" class="toggle update_preview" data-setting="osd_sidebar_scroll_arrows" data-live="true">
<span data-i18n="osd_imu_temp_alarm_max"></span> <span data-i18n="osd_sidebar_scroll_arrows"></span>
</label> </label>
<label for="baro_temp_alarm_min"> <label>
<input id="baro_temp_alarm_min" data-setting="osd_baro_temp_alarm_min" data-setting-multiplier="10" type="number" data-step="0.5" /> <input type="checkbox" class="toggle update_preview" data-setting="osd_home_position_arm_screen" data-live="true">
<span data-i18n="osd_baro_temp_alarm_min"></span> <span data-i18n="osd_home_position_arm_screen"></span>
</label>
<label for="baro_temp_alarm_max">
<input id="baro_temp_alarm_max" data-setting="osd_baro_temp_alarm_max" data-setting-multiplier="10" type="number" data-step="0.5" />
<span data-i18n="osd_baro_temp_alarm_max"></span>
</label>
<label for="esc_temp_alarm_min">
<input id="esc_temp_alarm_min" data-setting="osd_esc_temp_alarm_min" data-setting-multiplier="10" type="number" data-step="0.5" />
<span data-i18n="osd_esc_temp_alarm_min"></span>
</label>
<label for="esc_temp_alarm_max">
<input id="esc_temp_alarm_max" data-setting="osd_esc_temp_alarm_max" data-setting-multiplier="10" type="number" data-step="0.5" />
<span data-i18n="osd_esc_temp_alarm_max"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdalarmLQ_HELP"></div>
<label for="link_quality_alarm">
<input id="link_quality_alarm" data-setting="osd_link_quality_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<span data-i18n="osd_link_quality_alarm"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osd_rssi_dbm_alarm_HELP"></div>
<label for="rssi_dbm_alarm">
<input id="rssi_dbm_alarm" data-setting="osd_rssi_dbm_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<span data-i18n="osd_rssi_dbm_alarm"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdalarmSNR_HELP"></div>
<label for="snr_alarm">
<input id="snr_alarm" data-setting="osd_snr_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<span data-i18n="osd_snr_alarm"></span>
</label> </label>
</div> </div>
</div> </div>
<div class="gui_box grey dji-hd-container"> </div>
<div class="gui_box_titlebar"> <div class="gui_box grey alarms-container">
<div class="spacer_box_title" data-i18n="osd_dji_HD_FPV"></div> <div class="gui_box_titlebar">
</div> <div class="spacer_box_title" data-i18n="osd_alarms"></div>
<div class="spacer_box settings"> </div>
<label id="djiUnsupportedElements"> <div class="spacer_box settings">
<span data-i18n="osd_dji_hide_unsupported"></span> <label for="rssi_alarm">
</label> <input id="osd_rssi_alarm" data-setting="osd_rssi_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<label> <span data-i18n="osd_rssi_alarm"></span>
<select id="djiEscTempSource" data-setting="dji_esc_temp_source" data-live="true"></select> </label>
<span data-i18n="osd_dji_ESC_temp"></span> <label for="time_alarm">
</label> <input id="osd_time_alarm" data-setting="osd_time_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<label> <span data-i18n="osd_time_alarm"></span>
<select id="djiRssiSource" data-setting="dji_rssi_source" data-live="true"></select> </label>
<span data-i18n="osd_dji_RSSI_source"></span> <label for="osd_alt_alarm">
</label> <input id="osd_alt_alarm" data-setting="osd_alt_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<label> <span data-i18n="osd_alt_alarm"></span>
<select data-setting="osd_speed_source" data-live="true"></select> </label>
<span data-i18n="osd_dji_GPS_source"></span> <div class="helpicon cf_tip" data-i18n_title="osdAlarmMAX_NEG_ALTITUDE_HELP"></div>
</label> <label for="osd_neg_alt_alarm">
<label> <input id="osd_neg_alt_alarm" data-setting="osd_neg_alt_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<select data-setting="dji_message_speed_source" data-live="true"></select> <span data-i18n="osd_neg_alt_alarm"></span>
<span data-i18n="osd_dji_speed_source"></span> </label>
</label> <div class="helpicon cf_tip" data-i18n_title="osdAlarmDIST_HELP"></div>
<div class="djiCraftNameElements"> <label for="osd_dist_alarm">
<input type="checkbox" id="useCraftnameForMessages" data-setting="dji_use_name_for_messages" data-live="true" class="toggle"/> <input id="osd_dist_alarm" data-setting="osd_dist_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<span data-i18n="osd_dji_use_craft_name_elements"></span> <span data-i18n="osd_dist_alarm"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmGFORCE_HELP"></div>
<label for="osd_gforce_alarm">
<input id="osd_gforce_alarm" data-setting="osd_gforce_alarm" data-setting-multiplier="1" type="number" data-step="0.1" />
<span data-i18n="osd_gforce_alarm"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmGFORCE_AXIS_MIN_HELP"></div>
<label for="osd_gforce_axis_alarm_min">
<input id="osd_gforce_axis_alarm_min" data-setting="osd_gforce_axis_alarm_min" data-setting-multiplier="1" type="number" data-step="0.1" />
<span data-i18n="osd_gforce_axis_alarm_min"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmGFORCE_AXIS_MAX_HELP"></div>
<label for="osd_gforce_axis_alarm_max">
<input id="osd_gforce_axis_alarm_max" data-setting="osd_gforce_axis_alarm_max" data-setting-multiplier="1" type="number" data-step="0.1" />
<span data-i18n="osd_gforce_axis_alarm_max"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdAlarmCURRENT_HELP"></div>
<label for="osd_current_alarm">
<input id="osd_current_alarm" data-setting="osd_current_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<span data-i18n="osd_current_alarm"></span>
</label>
<label for="imu_temp_alarm_min">
<input id="imu_temp_alarm_min" data-setting="osd_imu_temp_alarm_min" data-setting-multiplier="10" type="number" data-step="0.5" />
<span data-i18n="osd_imu_temp_alarm_min"></span>
</label>
<label for="imu_temp_alarm_max">
<input id="imu_temp_alarm_max" data-setting="osd_imu_temp_alarm_max" data-setting-multiplier="10" type="number" data-step="0.5" />
<span data-i18n="osd_imu_temp_alarm_max"></span>
</label>
<label for="baro_temp_alarm_min">
<input id="baro_temp_alarm_min" data-setting="osd_baro_temp_alarm_min" data-setting-multiplier="10" type="number" data-step="0.5" />
<span data-i18n="osd_baro_temp_alarm_min"></span>
</label>
<label for="baro_temp_alarm_max">
<input id="baro_temp_alarm_max" data-setting="osd_baro_temp_alarm_max" data-setting-multiplier="10" type="number" data-step="0.5" />
<span data-i18n="osd_baro_temp_alarm_max"></span>
</label>
<label for="esc_temp_alarm_min">
<input id="esc_temp_alarm_min" data-setting="osd_esc_temp_alarm_min" data-setting-multiplier="10" type="number" data-step="0.5" />
<span data-i18n="osd_esc_temp_alarm_min"></span>
</label>
<label for="esc_temp_alarm_max">
<input id="esc_temp_alarm_max" data-setting="osd_esc_temp_alarm_max" data-setting-multiplier="10" type="number" data-step="0.5" />
<span data-i18n="osd_esc_temp_alarm_max"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdalarmLQ_HELP"></div>
<label for="link_quality_alarm">
<input id="link_quality_alarm" data-setting="osd_link_quality_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<span data-i18n="osd_link_quality_alarm"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osd_rssi_dbm_alarm_HELP"></div>
<label for="rssi_dbm_alarm">
<input id="rssi_dbm_alarm" data-setting="osd_rssi_dbm_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<span data-i18n="osd_rssi_dbm_alarm"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osdalarmSNR_HELP"></div>
<label for="snr_alarm">
<input id="snr_alarm" data-setting="osd_snr_alarm" data-setting-multiplier="1" type="number" data-step="1" />
<span data-i18n="osd_snr_alarm"></span>
</label>
</div>
</div>
<div class="gui_box grey dji-hd-container">
<div class="gui_box_titlebar">
<div class="spacer_box_title" data-i18n="osd_dji_HD_FPV"></div>
</div>
<div class="spacer_box settings">
<label id="djiUnsupportedElements">
<span data-i18n="osd_dji_hide_unsupported"></span>
</label>
<label>
<select id="djiEscTempSource" data-setting="dji_esc_temp_source" data-live="true"></select>
<span data-i18n="osd_dji_ESC_temp"></span>
</label>
<label>
<select id="djiRssiSource" data-setting="dji_rssi_source" data-live="true"></select>
<span data-i18n="osd_dji_RSSI_source"></span>
</label>
<label>
<select data-setting="osd_speed_source" data-live="true"></select>
<span data-i18n="osd_dji_GPS_source"></span>
</label>
<label>
<select data-setting="dji_message_speed_source" data-live="true"></select>
<span data-i18n="osd_dji_speed_source"></span>
</label>
<div class="djiCraftNameElements">
<input type="checkbox" id="useCraftnameForMessages" data-setting="dji_use_name_for_messages" data-live="true" class="toggle"/>
<span data-i18n="osd_dji_use_craft_name_elements"></span>
</div>
<label>
<input type="checkbox" id="djiAdjustments" data-setting="dji_use_adjustments" data-live="true" class="toggle"></select>
<span data-i18n="osd_dji_adjustments"></span>
</label>
<label for="cn_alternating_duration">
<input id="cn_alternating_duration" data-setting="dji_cn_alternating_duration" data-setting-multiplier="1" type="number" data-step="1"></input>
<span data-i18n="osd_dji_cn_alternating_duration"></span>
</label>
</div> </div>
</div> <label>
</div> <input type="checkbox" id="djiAdjustments" data-setting="dji_use_adjustments" data-live="true" class="toggle"></select>
<span data-i18n="osd_dji_adjustments"></span>
</label>
<label for="cn_alternating_duration">
<input id="cn_alternating_duration" data-setting="dji_cn_alternating_duration" data-setting-multiplier="1" type="number" data-step="1"></input>
<span data-i18n="osd_dji_cn_alternating_duration"></span>
</label>
</div>
</div>
</div> </div>
<div id="fontmanagercontent" style="display:none; width:712px;"> <div id="fontmanagercontent" style="display:none; width:712px;">
<div class="font-picker" style="margin-bottom: 10px;"> <div class="font-picker" style="margin-bottom: 10px;">
@ -263,9 +261,7 @@
</div> </div>
</div> </div>
<div class="clear-both"></div> <div class="clear-both"></div>
</div> </div>
</div> </div>
<div class="content_toolbar supported hide"> <div class="content_toolbar supported hide">
<div class="btn"> <div class="btn">

View file

@ -136,7 +136,7 @@ FONT.constants = {
MAX_NVM_FONT_CHAR_FIELD_SIZE: 64, MAX_NVM_FONT_CHAR_FIELD_SIZE: 64,
CHAR_HEIGHT: 18, CHAR_HEIGHT: 18,
CHAR_WIDTH: 12, CHAR_WIDTH: 12,
LINE: 30 LINE: 50
}, },
COLORS: { COLORS: {
// black // black
@ -512,19 +512,27 @@ OSD.DjiElements = {
}; };
OSD.constants = { OSD.constants = {
VISIBLE: 0x0800, VISIBLE: 0x2000,
VIDEO_TYPES: [ VIDEO_TYPES: [
'AUTO', 'AUTO',
'PAL', 'PAL',
'NTSC' 'NTSC',
'HD'
], ],
VIDEO_LINES: { VIDEO_LINES: {
PAL: 16, PAL: 16,
NTSC: 13 NTSC: 13,
HD: 18
},
VIDEO_COLS: {
PAL: 30,
NTSC: 30,
HD: 50
}, },
VIDEO_BUFFER_CHARS: { VIDEO_BUFFER_CHARS: {
PAL: 480, PAL: 480,
NTSC: 390 NTSC: 390,
HD: 900
}, },
UNIT_TYPES: [ UNIT_TYPES: [
{name: 'osdUnitImperial', value: 0}, {name: 'osdUnitImperial', value: 0},
@ -2003,9 +2011,17 @@ OSD.updateDisplaySize = function () {
if (video_type == 'AUTO') { if (video_type == 'AUTO') {
video_type = 'PAL'; video_type = 'PAL';
} }
$('.third_left').toggleClass('preview_hd_side', (video_type == 'HD'))
$('.preview').toggleClass('preview_hd', (video_type == 'HD'))
$('.third_right').toggleClass('preview_hd_side', (video_type == 'HD'))
// Not sure I can do this! This will mess with the calculation of the y position of the widget
//FONT.constants.SIZES.LINE = OSD.constants.VIDEO_COLS[video_type];
// compute the size // compute the size
OSD.data.display_size = { OSD.data.display_size = {
x: FONT.constants.SIZES.LINE, x: OSD.constants.VIDEO_COLS[video_type],
y: OSD.constants.VIDEO_LINES[video_type], y: OSD.constants.VIDEO_LINES[video_type],
total: null total: null
}; };
@ -2040,21 +2056,21 @@ OSD.msp = {
* b: blink flag * b: blink flag
* y: y coordinate * y: y coordinate
* x: x coordinate * x: x coordinate
* 0000 vbyy yyyx xxxx * 00vb yyyy yyxx xxxx
*/ */
helpers: { helpers: {
unpack: { unpack: {
position: function (bits) { position: function (bits) {
var display_item = {}; var display_item = {};
// size * y + x // size * y + x
display_item.position = FONT.constants.SIZES.LINE * ((bits >> 5) & 0x001F) + (bits & 0x001F); display_item.position = FONT.constants.SIZES.LINE * ((bits >> 6) & 0x003F) + (bits & 0x003F);
display_item.isVisible = (bits & OSD.constants.VISIBLE) != 0; display_item.isVisible = (bits & OSD.constants.VISIBLE) != 0;
return display_item; return display_item;
} }
}, },
pack: { pack: {
position: function (display_item) { position: function (display_item) {
return (display_item.isVisible ? 0x0800 : 0) | (((display_item.position / FONT.constants.SIZES.LINE) & 0x001F) << 5) | (display_item.position % FONT.constants.SIZES.LINE); return (display_item.isVisible ? 0x2000 : 0) | (((display_item.position / FONT.constants.SIZES.LINE) & 0x003F) << 6) | (display_item.position % FONT.constants.SIZES.LINE);
} }
} }
}, },
@ -2649,16 +2665,16 @@ OSD.GUI.updatePreviews = function() {
item.preview_img.style.pointerEvents = 'none'; item.preview_img.style.pointerEvents = 'none';
} }
var centerishPosition = 255;
// AHI is one line up with NTSC (less lines) compared to PAL var centerPosition = (OSD.data.display_size.x * OSD.data.display_size.y / 2);
if (OSD.constants.VIDEO_TYPES[OSD.data.video_system] == 'NTSC') if (OSD.data.display_size.y % 2 == 0) {
centerishPosition -= OSD.data.display_size.x; centerPosition += OSD.data.display_size.x / 2;
}
// artificial horizon // artificial horizon
if ($('input[name="ARTIFICIAL_HORIZON"]').prop('checked')) { if ($('input[name="ARTIFICIAL_HORIZON"]').prop('checked')) {
for (i = 0; i < 9; i++) { for (i = 0; i < 9; i++) {
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition - 4 + i, SYM.AH_BAR9_0 + 4); OSD.GUI.checkAndProcessSymbolPosition(centerPosition - 4 + i, SYM.AH_BAR9_0 + 4);
} }
} }
@ -2667,21 +2683,21 @@ OSD.GUI.updatePreviews = function() {
crsHNumber = Settings.getInputValue('osd_crosshairs_style'); crsHNumber = Settings.getInputValue('osd_crosshairs_style');
if (crsHNumber == 1) { if (crsHNumber == 1) {
// AIRCRAFT style // AIRCRAFT style
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition - 2, SYM.AH_AIRCRAFT0); OSD.GUI.checkAndProcessSymbolPosition(centerPosition - 2, SYM.AH_AIRCRAFT0);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition - 1, SYM.AH_AIRCRAFT1); OSD.GUI.checkAndProcessSymbolPosition(centerPosition - 1, SYM.AH_AIRCRAFT1);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition, SYM.AH_AIRCRAFT2); OSD.GUI.checkAndProcessSymbolPosition(centerPosition, SYM.AH_AIRCRAFT2);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition + 1, SYM.AH_AIRCRAFT3); OSD.GUI.checkAndProcessSymbolPosition(centerPosition + 1, SYM.AH_AIRCRAFT3);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition + 2, SYM.AH_AIRCRAFT4); OSD.GUI.checkAndProcessSymbolPosition(centerPosition + 2, SYM.AH_AIRCRAFT4);
} else if ((crsHNumber > 1) && (crsHNumber < 8)) { } else if ((crsHNumber > 1) && (crsHNumber < 8)) {
// TYPES 3 to 8 (zero indexed) // TYPES 3 to 8 (zero indexed)
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition - 1, SYM.AH_CROSSHAIRS[crsHNumber][0]); OSD.GUI.checkAndProcessSymbolPosition(centerPosition - 1, SYM.AH_CROSSHAIRS[crsHNumber][0]);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition, SYM.AH_CROSSHAIRS[crsHNumber][1]); OSD.GUI.checkAndProcessSymbolPosition(centerPosition, SYM.AH_CROSSHAIRS[crsHNumber][1]);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition + 1, SYM.AH_CROSSHAIRS[crsHNumber][2]); OSD.GUI.checkAndProcessSymbolPosition(centerPosition + 1, SYM.AH_CROSSHAIRS[crsHNumber][2]);
} else { } else {
// DEFAULT or unknown style // DEFAULT or unknown style
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition - 1, SYM.AH_CENTER_LINE); OSD.GUI.checkAndProcessSymbolPosition(centerPosition - 1, SYM.AH_CENTER_LINE);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition, SYM.AH_CROSSHAIRS[crsHNumber]); OSD.GUI.checkAndProcessSymbolPosition(centerPosition, SYM.AH_CROSSHAIRS[crsHNumber]);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition + 1, SYM.AH_CENTER_LINE_RIGHT); OSD.GUI.checkAndProcessSymbolPosition(centerPosition + 1, SYM.AH_CENTER_LINE_RIGHT);
} }
} }
@ -2690,21 +2706,17 @@ OSD.GUI.updatePreviews = function() {
var hudwidth = OSD.constants.AHISIDEBARWIDTHPOSITION; var hudwidth = OSD.constants.AHISIDEBARWIDTHPOSITION;
var hudheight = OSD.constants.AHISIDEBARHEIGHTPOSITION; var hudheight = OSD.constants.AHISIDEBARHEIGHTPOSITION;
for (i = -hudheight; i <= hudheight; i++) { for (i = -hudheight; i <= hudheight; i++) {
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition - hudwidth + (i * FONT.constants.SIZES.LINE), SYM.AH_DECORATION); OSD.GUI.checkAndProcessSymbolPosition(centerPosition - hudwidth + (i * FONT.constants.SIZES.LINE), SYM.AH_DECORATION);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition + hudwidth + (i * FONT.constants.SIZES.LINE), SYM.AH_DECORATION); OSD.GUI.checkAndProcessSymbolPosition(centerPosition + hudwidth + (i * FONT.constants.SIZES.LINE), SYM.AH_DECORATION);
} }
// AH level indicators // AH level indicators
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition - hudwidth + 1, SYM.AH_LEFT); OSD.GUI.checkAndProcessSymbolPosition(centerPosition - hudwidth + 1, SYM.AH_LEFT);
OSD.GUI.checkAndProcessSymbolPosition(centerishPosition + hudwidth - 1, SYM.AH_RIGHT); OSD.GUI.checkAndProcessSymbolPosition(centerPosition + hudwidth - 1, SYM.AH_RIGHT);
} }
var mapCenter = (OSD.data.display_size.x * OSD.data.display_size.y / 2); OSD.GUI.updateMapPreview(centerPosition, 'MAP_NORTH', 'N', SYM.HOME);
if (OSD.data.display_size.y % 2 == 0) { OSD.GUI.updateMapPreview(centerPosition, 'MAP_TAKEOFF', 'T', SYM.HOME);
mapCenter += OSD.data.display_size.x / 2; OSD.GUI.updateMapPreview(centerPosition, 'RADAR', null, SYM.DIR_TO_HOME);
}
OSD.GUI.updateMapPreview(mapCenter, 'MAP_NORTH', 'N', SYM.HOME);
OSD.GUI.updateMapPreview(mapCenter, 'MAP_TAKEOFF', 'T', SYM.HOME);
OSD.GUI.updateMapPreview(mapCenter, 'RADAR', null, SYM.DIR_TO_HOME);
// render // render
var $preview = $('.display-layout .preview').empty(); var $preview = $('.display-layout .preview').empty();

View file

@ -93,6 +93,12 @@ TABS.ports.initialize = function (callback) {
maxPorts: 1 } maxPorts: 1 }
); );
functionRules.push({
name: 'SHARKBYTE_OSD',
groups: ['peripherals'],
maxPorts: 1 }
);
functionRules.push({ functionRules.push({
name: 'SMARTPORT_MASTER', name: 'SMARTPORT_MASTER',
groups: ['peripherals'], groups: ['peripherals'],