static void do_stats(void) { long cLoops = cComponents + cLegs - cStns; putnl(); if (cStns == 1) { fputs(msg(/*Survey contains 1 survey station,*/172), stdout); } else { printf(msg(/*Survey contains %ld survey stations,*/173), cStns); } if (cLegs == 1) { fputs(msg(/* joined by 1 leg.*/174), stdout); } else { printf(msg(/* joined by %ld legs.*/175), cLegs); } putnl(); if (cLoops == 1) { fputs(msg(/*There is 1 loop.*/138), stdout); } else { printf(msg(/*There are %ld loops.*/139), cLoops); } putnl(); if (cComponents != 1) { printf(msg(/*Survey has %ld connected components.*/178), cComponents); putnl(); } printf(msg(/*Total length of survey legs = %7.2fm (%7.2fm adjusted)*/132), total, totadj); putnl(); printf(msg(/*Total plan length of survey legs = %7.2fm*/133), totplan); putnl(); printf(msg(/*Total vertical length of survey legs = %7.2fm*/134), totvert); putnl(); /* If there's no underground survey, we've no ranges */ if (pfxHi[0]) { do_range(2, /*Vertical range = %4.2fm (from %s at %4.2fm to %s at %4.2fm)*/135); do_range(1, /*North-South range = %4.2fm (from %s at %4.2fm to %s at %4.2fm)*/136); do_range(0, /*East-West range = %4.2fm (from %s at %4.2fm to %s at %4.2fm)*/137); } print_node_stats(); /* Also, could give: * # nodes stations (ie have other than two references or are fixed) * # fixed stations (list of?) */ }
static void do_stats(void) { long cLoops = cComponents + cLegs - cStns; int length_units = get_length_units(Q_LENGTH); const char * units = get_units_string(length_units); real length_factor = 1.0 / get_units_factor(length_units); putnl(); if (cStns == 1) { fputs(msg(/*Survey contains 1 survey station,*/172), stdout); } else { printf(msg(/*Survey contains %ld survey stations,*/173), cStns); } if (cLegs == 1) { fputs(msg(/* joined by 1 leg.*/174), stdout); } else { printf(msg(/* joined by %ld legs.*/175), cLegs); } putnl(); if (cLoops == 1) { fputs(msg(/*There is 1 loop.*/138), stdout); } else { printf(msg(/*There are %ld loops.*/139), cLoops); } putnl(); if (cComponents != 1) { /* TRANSLATORS: "Connected component" in the graph theory sense - it * means there are %ld bits of survey with no connections between them. * This message is only used if there are more than 1. */ printf(msg(/*Survey has %ld connected components.*/178), cComponents); putnl(); } printf(msg(/*Total length of survey legs = %7.2f%s (%7.2f%s adjusted)*/132), total * length_factor, units, totadj * length_factor, units); putnl(); printf(msg(/*Total plan length of survey legs = %7.2f%s*/133), totplan * length_factor, units); putnl(); printf(msg(/*Total vertical length of survey legs = %7.2f%s*/134), totvert * length_factor, units); putnl(); /* If there's no underground survey, we've no ranges */ if (pfxHi[0]) { /* TRANSLATORS: numbers are altitudes of highest and lowest stations */ do_range(2, /*Vertical range = %4.2f%s (from %s at %4.2f%s to %s at %4.2f%s)*/135, length_factor, units); /* TRANSLATORS: c.f. previous message */ do_range(1, /*North-South range = %4.2f%s (from %s at %4.2f%s to %s at %4.2f%s)*/136, length_factor, units); /* TRANSLATORS: c.f. previous two messages */ do_range(0, /*East-West range = %4.2f%s (from %s at %4.2f%s to %s at %4.2f%s)*/137, length_factor, units); } print_node_stats(); /* Also, could give: * # nodes stations (ie have other than two references or are fixed) * # fixed stations (list of?) */ }