public ActionContextMenu( Locator <AppOptions> appOptionsLocator, AirwayNetwork airwayNetwork, ISelectedProcedureProvider origController, ISelectedProcedureProvider destController, Locator <CountryCodeCollection> checkedCodesLocator, Func <AvgWindCalculator> windCalcGetter, Label routeDisLbl, DistanceDisplayStyle displayStyle, Func <string> routeTxtGetter, Action <string> routeTxtSetter, Form parentForm) : base() { Init(); controller = new RouteActionController( appOptionsLocator, airwayNetwork, origController, destController, checkedCodesLocator, windCalcGetter, routeDisLbl, displayStyle, routeTxtGetter, routeTxtSetter, findToolStripMenuItem, analyzeToolStripMenuItem, exportToolStripMenuItem, mapToolStripMenuItem, parentForm); }
public RouteActionController( Locator <AppOptions> appOptionsLocator, AirwayNetwork airwayNetwork, ISelectedProcedureProvider origController, ISelectedProcedureProvider destController, Locator <CountryCodeCollection> checkedCodesLocator, Func <AvgWindCalculator> windCalcGetter, Label routeDisLbl, DistanceDisplayStyle displayStyle, Func <string> routeTxtGetter, Action <string> routeTxtSetter, IClickable findRouteBtn, IClickable analyzeRouteBtn, IClickable exportBtn, IClickable showMapBtn, Form parentForm) { this.appOptionsLocator = appOptionsLocator; this.airwayNetwork = airwayNetwork; this.origController = origController; this.destController = destController; this.checkedCodesLocator = checkedCodesLocator; this.windCalcGetter = windCalcGetter; this.routeDisLbl = routeDisLbl; this.displayStyle = displayStyle; this.routeTxtGetter = routeTxtGetter; this.routeTxtSetter = routeTxtSetter; this.findRouteBtn = findRouteBtn; this.analyzeRouteBtn = analyzeRouteBtn; this.exportBtn = exportBtn; this.showMapBtn = showMapBtn; this.parentForm = parentForm; }
public static void UpdateRouteDistanceLbl( Label lbl, Route route, DistanceDisplayStyle displayStyle) { double totalDis = route.TotalDistance(); int disInt = RoundToInt(totalDis); double directDis = route.FirstWaypoint.Distance(route.LastWaypoint); double percentDiff = (totalDis - directDis) / directDis * 100.0; string diffStr = percentDiff.ToString("0.0"); var text = $"{disInt} NM (+{diffStr}%)"; if (displayStyle == DistanceDisplayStyle.Long) { text = "Distance: " + text; } lbl.Text = text; }