コード例 #1
0
ファイル: Form1.cs プロジェクト: SDTWerner/propeller-1
		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();
		}
コード例 #2
0
ファイル: Form1.cs プロジェクト: SDTWerner/propeller-1
		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();
			}
		}