Subversion Repositories Projects

Rev

Rev 902 | Rev 1437 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 902 Rev 952
Line 118... Line 118...
118
        }
118
        }
119
    }
119
    }
120
 
120
 
121
    // remember statistics (only when engines running)
121
    // remember statistics (only when engines running)
122
    if (naviData.FCFlags & FCFLAG_MOTOR_RUN) {
122
    if (naviData.FCFlags & FCFLAG_MOTOR_RUN) {
-
 
123
        if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) {
-
 
124
            if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000;
-
 
125
        } else {
123
        if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter;
126
            if (naviData.Altimeter / 20 > max_Altimeter) max_Altimeter = naviData.Altimeter / 20;
-
 
127
        }
124
        if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed;
128
        if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed;
125
        if (naviData.HomePositionDeviation.Distance > max_Distance) {
129
        if (naviData.HomePositionDeviation.Distance > max_Distance) {
126
            max_Distance = naviData.HomePositionDeviation.Distance;
130
            max_Distance = naviData.HomePositionDeviation.Distance;
127
        }
131
        }
128
        if (naviData.UBat < min_UBat) min_UBat = naviData.UBat;
132
        if (naviData.UBat < min_UBat) min_UBat = naviData.UBat;
129
        if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime;
133
        if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime;
-
 
134
        if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) {
130
        if (ampere > max_ampere) max_ampere = ampere;
135
            if (ampere > max_ampere) max_ampere = ampere;
-
 
136
        } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) {
-
 
137
            if (naviData.Current * 10 > max_ampere) max_ampere = naviData.Current * 10;
-
 
138
        }
131
    }
139
    }
132
 
140
 
133
    // remember last values
141
    // remember last values
-
 
142
    last_RC_Quality = naviData.RC_Quality;
134
    last_UBat = naviData.UBat;
143
    last_UBat = naviData.UBat;
135
    old_MKFlags = naviData.FCFlags;
144
    old_MKFlags = naviData.FCFlags;
-
 
145
    old_NCFlags = naviData.NCFlags;
136
    seconds_since_last_data = 0;
146
    seconds_since_last_data = 0;
137
 
147
 
138
    return 0;
148
    return 0;
139
}
149
}
140
 
150