public void WriteCoord(double x, double y) { if (ActualCoords.Text.CompareTo("")) { ActualCoords.AppendText(System.Environment.NewLine); } ActualCoords.AppendText(x.ToString()); ActualCoords.AppendText(","); ActualCoords.AppendText(y.ToString()); ActualCoords.AppendText(",0 "); ActualCoords.ScrollToCaret(); int xxx = System.Convert.ToInt32(Math.Round(x * 60 * 10000)); // in milliminutes for NAVCOM AI use int yyy = System.Convert.ToInt32(Math.Round(y * 60 * 10000)); // in milliminutes for NAVCOM AI use if (AICMDFile.Text.CompareTo("")) { AICMDFile.AppendText(System.Environment.NewLine); } AICMDFile.AppendText("@WW "); AICMDFile.AppendText((AICMDFile.Lines.Length + 1).ToString()); AICMDFile.AppendText(" "); AICMDFile.AppendText(yyy.ToString()); AICMDFile.AppendText(" "); AICMDFile.AppendText(xxx.ToString()); AICMDFile.ScrollToCaret(); }
private void Button5_Click(object sender, System.EventArgs e) { SaveFileDialog SaveHere = new SaveFileDialog(); SaveHere.Filter = "AICMD files (*.aicmd)|*.aicmd"; SaveHere.FilterIndex = 2; SaveHere.RestoreDirectory = true; if (SaveHere.ShowDialog() == System.Windows.Forms.DialogResult.OK) { AICMDFile.ScrollToCaret(); AICMDFile.AppendText(System.Environment.NewLine + System.Environment.NewLine); AICMDFile.SaveFile(SaveHere.FileName, RichTextBoxStreamType.PlainText); AICMDFile.Clear(); } }