private void OnExplorerChanged(Explorer caller) { Debug.Log("Browser changed"); var ld = caller.GetLogicalDrives(); var dirs = caller.GetDirectories(); var files = caller.GetFiles(); int ldCount = ld != null ? ld.Length : 0; int dirsCount = dirs != null ? dirs.Length : 0; int filesCount = files != null ? files.Length : 0; FSData[] mainData = new FSData[dirsCount + filesCount]; FSData[] sideData = new FSData[ldCount]; for (int i = 0; i < ldCount; i++) { var currentLD = new FSData(ld[i], FSData.FileType.LogicalDrive, explorer); sideData[i] = currentLD; } for (int i = 0; i < dirsCount; i++) { var currentDir = new FSData(dirs[i], FSData.FileType.Folder, explorer); mainData[i] = currentDir; } for (int i = 0; i < filesCount; i++) { var currentFile = new FSData(files[i], FSData.FileType.File, explorer); mainData[i + dirsCount] = currentFile; } mainGrid.SetData(mainData); sideGrid.SetData(sideData); }
public MainForm() { InitializeComponent(); FSUIPCProvider.mainForm = this; Connector.mainForm = this; fsData = new FSData(); pilot = new Pilot(); Snapshot.Init(); SoundFactory.Init(); Logger.pilot = AcarsBuilder.pilot = pilot; }
private void INFOTIMER_Tick(Object myObject, EventArgs myEventArgs) { FSData f = mainForm.fsData; fsInfoTxt.Text = ""; if (validatedAirport.Length > 0) { fsInfoTxt.Text += "Airport OK:\n" + validatedAirport + "\n"; } fsInfoTxt.Text += "\nAircaft:" + f.aircraftName; fsInfoTxt.Text += "\nGW: " + f.loadedWeight.ToString("N0") + " kg"; if (aircraft != null && f.loadedWeight > aircraft.mtow) { fsInfoTxt.Text += " (!)"; } fsInfoTxt.Text += "\nZFW: " + f.zeroFuelWeight.ToString("N0") + " kg"; fsInfoTxt.Text += "\nFuel: " + f.fuelTotalWeight.ToString("N0") + " kg"; fsInfoTxt.Text += "\nOn ground:" + ((f.onGround) ? "YES" : "NO"); fsInfoTxt.Text += "\nParking brake:" + ((f.parkingBrake) ? "ON":"OFF"); fsInfoTxt.Text += "\nGear: " + ((f.gear) ? "UP":"DOWN"); if (previousAircraft == null) { aircraft = Fleet.getAircraftByIcao(f.aircraftName); if (aircraft != null) { this.aircraftCombo.Text = aircraft.icao; previousAircraft = aircraft; } } if (aircraft != null) { if (aircraft.icao != previousAircraft.icao) { aircraft = Fleet.getAircraftByIcao(f.aircraftName); this.aircraftCombo.Text = aircraft.icao; previousAircraft = aircraft; } fsInfoTxt.Text += "\nFlaps:" + aircraft.getFlaps(f.flapsPosition); } fsInfoTxt.Text += "\nHeading:" + f.heading.ToString("N0"); fsInfoTxt.Text += "\nCom 1: " + f.com1; fsInfoTxt.Text += "\nTransponder: " + f.transponder; //fsInfoTxt.Text += "\nPaused: " + ((f.paused) ? "YES":"NO"); //fsInfoTxt.Text += "\nSlew: " + ((f.slewMode) ? "YES" : "NO"); //fsInfoTxt.Text += "\nRate: " + f.simRate + "x"; fsInfoTxt.Text += "\nWind: " + f.windDirection.ToString("N0") + "° " + f.windSpeed + " knots"; fsInfoTxt.Text += "\nPressure: " + f.pressure + "hPa"; fsInfoTxt.Text += "\nAltimeter: " + f.altimeterSetting + "hPa"; //fsInfoTxt.Text += "\nPitch: " + f.pitch.ToString("N0"); //fsInfoTxt.Text += "\nBank: " + f.bank.ToString("N0"); fsInfoTxt.Text += "\nSurface: " + f.surface + "\n" + f.GetSurfaceString(); //fsInfoTxt.Text += "\nG: " + (1 + f.acceleration_y).ToString("N2"); }
public void SetData(GridItemData data) { this.data = (FSData)data; Refresh(); }