+ int centre = a / 2;
+
+ if (huds_vert(options)) {
+ x = scrn_rect.left;
+ y = scrn_rect.top;
+ w = scrn_rect.left + scrn_rect.right;
+ h = scrn_rect.top + scrn_rect.bottom;
+ bottom = scrn_rect.bottom;
+
+ float xstart, yfirst, ycentre, ysecond;
+
+ float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
+ yfirst = mid_scr.y - hgt;
+ ycentre = mid_scr.y;
+ ysecond = mid_scr.y + hgt;
+ float range = hgt * 2;
+
+ int i;
+ float factor = range / 10.0;
+
+ float hgt1 = bottom * 30.0 / 100.0;
+ int incrs = ((int)val_span - (Maj_div * 2)) / Maj_div ;
+ int incr = incrs / 2;
+ float factors = hgt1 / incr;
+
+ // begin
+ //this is for moving type pointer
+ static float ycent, ypoint, xpoint;
+ static int wth;
+
+ ycent = mid_scr.y;
+ wth = scrn_rect.left + scrn_rect.right;
+
+ if (cur_value <= data[centre + 1])
+ if (cur_value > data[centre]) {
+ ypoint = ycent + ((cur_value - data[centre]) * hgt / Maj_div);
+ }
+
+ if (cur_value >= data[centre - 1])
+ if (cur_value <= data[centre]) {
+ ypoint = ycent - ((data[centre]-cur_value) * hgt / Maj_div);
+ }
+
+ if (cur_value < data[centre - 1])
+ if (cur_value >= minValue) {
+ float diff = minValue - data[centre - 1];
+ float diff1 = cur_value - data[centre - 1];
+ float val = (diff1 * hgt1) / diff;
+
+ ypoint = ycent - hgt - val;
+ }
+
+ if (cur_value > data[centre + 1])
+ if (cur_value <= maxValue) {
+ float diff = maxValue - data[centre + 1];
+ float diff1 = cur_value - data[centre + 1];
+ float val = (diff1 * hgt1) / diff;
+
+ ypoint = ycent + hgt + val;
+ }
+
+ if (huds_left(options)) {
+ xstart = w;
+
+ drawOneLine(xstart, ycentre, xstart - 5.0, ycentre); //centre tick
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString(x, ycentre, TextScale, 0);
+
+ for (i = 1; i < 5; i++) {
+ yfirst += factor;
+ ycentre += factor;
+ circles(xstart - 2.5, yfirst, 3.0);
+ circles(xstart - 2.5, ycentre, 3.0);
+ }
+
+ yfirst = mid_scr.y - hgt;
+
+ for (i = 0; i <= incr; i++) {
+ drawOneLine(xstart, yfirst, xstart - 5.0, yfirst);
+ drawOneLine(xstart, ysecond, xstart - 5.0, ysecond);
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre - i - 1] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString (x, yfirst, TextScale, 0);
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre + i + 1] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString (x, ysecond, TextScale, 0);
+
+ yfirst -= factors;
+ ysecond += factors;
+
+ }
+
+ //to draw moving type pointer for left option
+ //begin
+ xpoint = wth + 10.0;
+
+ if (pointer_type == "moving") {
+ drawOneLine(xpoint, ycent, xpoint, ypoint);
+ drawOneLine(xpoint, ypoint, xpoint - 10.0, ypoint);
+ drawOneLine(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint + 5.0);
+ drawOneLine(xpoint - 10.0, ypoint, xpoint - 5.0, ypoint - 5.0);
+ }
+ //end
+
+ } else {
+ //huds_right
+ xstart = (x + w) / 2;
+
+ drawOneLine(xstart, ycentre, xstart + 5.0, ycentre); //centre tick
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString(w, ycentre, TextScale, 0);
+
+ for (i = 1; i < 5; i++) {
+ yfirst += factor;
+ ycentre += factor;
+ circles(xstart + 2.5, yfirst, 3.0);
+ circles(xstart + 2.5, ycentre, 3.0);
+ }
+
+ yfirst = mid_scr.y - hgt;
+
+ for (i = 0; i <= incr; i++) {
+ drawOneLine(xstart, yfirst, xstart + 5.0, yfirst);
+ drawOneLine(xstart, ysecond, xstart + 5.0, ysecond);
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre - i - 1] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString(w, yfirst, TextScale, 0);
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre + i + 1] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString(w, ysecond, TextScale, 0);
+
+ yfirst -= factors;
+ ysecond += factors;
+
+ }
+
+ // to draw moving type pointer for right option
+ //begin
+ xpoint = scrn_rect.left;
+
+ if (pointer_type == "moving") {
+ drawOneLine(xpoint, ycent, xpoint, ypoint);
+ drawOneLine(xpoint, ypoint, xpoint + 10.0, ypoint);
+ drawOneLine(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint + 5.0);
+ drawOneLine(xpoint + 10.0, ypoint, xpoint + 5.0, ypoint - 5.0);
+ }
+ //end
+ }//end huds_right /left
+ //end of vertical scale
+
+ } else {
+ //horizontal scale
+ x = scrn_rect.left;
+ y = scrn_rect.top;
+ w = scrn_rect.left + scrn_rect.right;
+ h = scrn_rect.top + scrn_rect.bottom;
+ bottom = scrn_rect.right;
+
+ float ystart, xfirst, xcentre, xsecond;
+
+ float hgt = bottom * 20.0 / 100.0; // 60% of height should be zoomed
+ xfirst = mid_scr.x - hgt;
+ xcentre = mid_scr.x;
+ xsecond = mid_scr.x + hgt;
+ float range = hgt * 2;
+
+ int i;
+ float factor = range / 10.0;
+
+ float hgt1 = bottom * 30.0 / 100.0;
+ int incrs = ((int)val_span - (Maj_div * 2)) / Maj_div ;
+ int incr = incrs / 2;
+ float factors = hgt1 / incr;
+
+
+ //Code for Moving Type Pointer
+ //begin
+ static float xcent, xpoint, ypoint;
+
+ xcent = mid_scr.x;
+
+ if (cur_value <= data[centre + 1])
+ if (cur_value > data[centre]) {
+ xpoint = xcent + ((cur_value - data[centre]) * hgt / Maj_div);
+ }
+
+ if (cur_value >= data[centre - 1])
+ if (cur_value <= data[centre]) {
+ xpoint = xcent - ((data[centre]-cur_value) * hgt / Maj_div);
+ }
+
+ if (cur_value < data[centre - 1])
+ if (cur_value >= minValue) {
+ float diff = minValue - data[centre - 1];
+ float diff1 = cur_value - data[centre - 1];
+ float val = (diff1 * hgt1) / diff;
+
+ xpoint = xcent - hgt - val;
+ }
+
+
+ if (cur_value > data[centre + 1])
+ if (cur_value <= maxValue) {
+ float diff = maxValue - data[centre + 1];
+ float diff1 = cur_value - data[centre + 1];
+ float val = (diff1 * hgt1) / diff;
+
+ xpoint = xcent + hgt + val;
+ }
+
+ //end
+ if (huds_top(options)) {
+ ystart = h;
+ drawOneLine(xcentre, ystart, xcentre, ystart - 5.0); //centre tick
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString (xcentre - 10.0, y, TextScale, 0);
+
+ for (i = 1; i < 5; i++) {
+ xfirst += factor;
+ xcentre += factor;
+ circles(xfirst, ystart - 2.5, 3.0);
+ circles(xcentre, ystart - 2.5, 3.0);
+ }
+
+ xfirst = mid_scr.x - hgt;
+
+ for (i = 0; i <= incr; i++) {
+ drawOneLine(xfirst, ystart, xfirst, ystart - 5.0);
+ drawOneLine(xsecond, ystart, xsecond, ystart - 5.0);
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre - i - 1] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString (xfirst - 10.0, y, TextScale, 0);
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre + i + 1] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString (xsecond - 10.0, y, TextScale, 0);
+
+
+ xfirst -= factors;
+ xsecond += factors;
+ }
+ //this is for moving pointer for top option
+ //begin
+
+ ypoint = scrn_rect.top + scrn_rect.bottom + 10.0;
+
+ if (pointer_type == "moving") {
+ drawOneLine(xcent, ypoint, xpoint, ypoint);
+ drawOneLine(xpoint, ypoint, xpoint, ypoint - 10.0);
+ drawOneLine(xpoint, ypoint - 10.0, xpoint + 5.0, ypoint - 5.0);
+ drawOneLine(xpoint, ypoint - 10.0, xpoint - 5.0, ypoint - 5.0);
+ }
+ //end of top option
+
+ } else {
+ //else huds_bottom
+ ystart = (y + h) / 2;
+
+ //drawOneLine(xstart, yfirst, xstart - 5.0, yfirst);
+ drawOneLine(xcentre, ystart, xcentre, ystart + 5.0); //centre tick
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString (xcentre - 10.0, h, TextScale, 0);
+
+ for (i = 1; i < 5; i++) {
+ xfirst += factor;
+ xcentre += factor;
+ circles(xfirst, ystart + 2.5, 3.0);
+ circles(xcentre, ystart + 2.5, 3.0);
+ }
+
+ xfirst = mid_scr.x - hgt;
+
+ for (i = 0; i <= incr; i++) {
+ drawOneLine(xfirst, ystart, xfirst, ystart + 5.0);
+ drawOneLine(xsecond, ystart, xsecond, ystart + 5.0);
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre - i - 1] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString (xfirst - 10.0, h, TextScale, 0);
+
+ sprintf(TextScale,"%3.0f\n",(float)(data[centre + i + 1] * data_scaling()));
+
+ if (!huds_notext(options))
+ textString (xsecond - 10.0, h, TextScale, 0);
+
+ xfirst -= factors;
+ xsecond += factors;
+ }
+ //this is for movimg pointer for bottom option
+ //begin
+
+ ypoint = scrn_rect.top - 10.0;
+ if (pointer_type == "moving") {
+ drawOneLine(xcent, ypoint, xpoint, ypoint);
+ drawOneLine(xpoint, ypoint, xpoint, ypoint + 10.0);
+ drawOneLine(xpoint, ypoint + 10.0, xpoint + 5.0, ypoint + 5.0);
+ drawOneLine(xpoint, ypoint + 10.0, xpoint - 5.0, ypoint + 5.0);
+ }
+ }//end hud_top or hud_bottom
+ } //end of horizontal/vertical scales
+}//end draw
+
+