mirror of
https://github.com/dj0abr/SSB_HighSpeed_Modem.git
synced 2026-06-03 06:24:51 -04:00
update
This commit is contained in:
Binary file not shown.
@@ -192,12 +192,12 @@ namespace oscardata
|
||||
|
||||
static void txudp(Byte[] txdata, Byte txtype, Byte filestat)
|
||||
{
|
||||
// add the tytype and filestatus at the beginning
|
||||
// add the txtype and filestatus at the beginning
|
||||
Byte[] darr = new byte[statics.PayloadLen + 2];
|
||||
darr[0] = txtype;
|
||||
darr[1] = filestat;
|
||||
Array.Copy(txdata, 0, darr, 2, statics.PayloadLen);
|
||||
Udp.UdpSend(darr);
|
||||
Udp.UdpSendData(darr);
|
||||
// Console.WriteLine("TX filestat: " + filestat+ " data:" + darr[2].ToString("X2") + " " + darr[3].ToString("X2"));
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+241
-153
@@ -71,25 +71,31 @@
|
||||
this.bt_file_html = new System.Windows.Forms.Button();
|
||||
this.bt_file_ascii = new System.Windows.Forms.Button();
|
||||
this.tabPage5 = new System.Windows.Forms.TabPage();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.cb_audioCAP = new System.Windows.Forms.ComboBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.cb_audioPB = new System.Windows.Forms.ComboBox();
|
||||
this.bt_resetmodem = new System.Windows.Forms.Button();
|
||||
this.tb_shutdown = new System.Windows.Forms.TextBox();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.bt_shutdown = new System.Windows.Forms.Button();
|
||||
this.cb_savegoodfiles = new System.Windows.Forms.CheckBox();
|
||||
this.cb_stampcall = new System.Windows.Forms.CheckBox();
|
||||
this.tb_shutdown = new System.Windows.Forms.TextBox();
|
||||
this.bt_resetmodem = new System.Windows.Forms.Button();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.tb_CAPvol = new System.Windows.Forms.TrackBar();
|
||||
this.tb_PBvol = new System.Windows.Forms.TrackBar();
|
||||
this.cb_audioPB = new System.Windows.Forms.ComboBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.cb_audioCAP = new System.Windows.Forms.ComboBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.tb_callsign = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.cb_stampcall = new System.Windows.Forms.CheckBox();
|
||||
this.cb_savegoodfiles = new System.Windows.Forms.CheckBox();
|
||||
this.cb_speed = new System.Windows.Forms.ComboBox();
|
||||
this.label_speed = new System.Windows.Forms.Label();
|
||||
this.timer_searchmodem = new System.Windows.Forms.Timer(this.components);
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.progressBar_fifo = new System.Windows.Forms.ProgressBar();
|
||||
this.label_fifo = new System.Windows.Forms.Label();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.tabPage2.SuspendLayout();
|
||||
@@ -99,9 +105,11 @@
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabPage3.SuspendLayout();
|
||||
this.tabPage5.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tb_CAPvol)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tb_PBvol)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// timer_udpTX
|
||||
@@ -121,7 +129,7 @@
|
||||
this.RXstatus});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 669);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(1304, 22);
|
||||
this.statusStrip1.Size = new System.Drawing.Size(1293, 22);
|
||||
this.statusStrip1.TabIndex = 4;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
@@ -133,6 +141,7 @@
|
||||
//
|
||||
// ts_ip
|
||||
//
|
||||
this.ts_ip.ForeColor = System.Drawing.Color.Red;
|
||||
this.ts_ip.Name = "ts_ip";
|
||||
this.ts_ip.Size = new System.Drawing.Size(12, 17);
|
||||
this.ts_ip.Text = "?";
|
||||
@@ -521,75 +530,28 @@
|
||||
this.tabPage5.Text = "Setup";
|
||||
this.tabPage5.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// textBox3
|
||||
// groupBox4
|
||||
//
|
||||
this.textBox3.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textBox3.ForeColor = System.Drawing.Color.Black;
|
||||
this.textBox3.Location = new System.Drawing.Point(138, 73);
|
||||
this.textBox3.Multiline = true;
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(177, 19);
|
||||
this.textBox3.TabIndex = 12;
|
||||
this.textBox3.Text = "(HDMI is usually not used)";
|
||||
this.groupBox4.Controls.Add(this.bt_shutdown);
|
||||
this.groupBox4.Controls.Add(this.tb_shutdown);
|
||||
this.groupBox4.Controls.Add(this.bt_resetmodem);
|
||||
this.groupBox4.Controls.Add(this.textBox2);
|
||||
this.groupBox4.Location = new System.Drawing.Point(12, 259);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(384, 105);
|
||||
this.groupBox4.TabIndex = 15;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Maintenance";
|
||||
//
|
||||
// textBox2
|
||||
// bt_shutdown
|
||||
//
|
||||
this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textBox2.ForeColor = System.Drawing.Color.Black;
|
||||
this.textBox2.Location = new System.Drawing.Point(189, 48);
|
||||
this.textBox2.Multiline = true;
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(126, 50);
|
||||
this.textBox2.TabIndex = 11;
|
||||
this.textBox2.Text = "in case the RX has sync\r\nproblems, it can be\r\nre-initialized here.";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(12, 50);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(112, 13);
|
||||
this.label4.TabIndex = 10;
|
||||
this.label4.Text = "Audio Record Device:";
|
||||
//
|
||||
// cb_audioCAP
|
||||
//
|
||||
this.cb_audioCAP.FormattingEnabled = true;
|
||||
this.cb_audioCAP.Location = new System.Drawing.Point(138, 46);
|
||||
this.cb_audioCAP.Name = "cb_audioCAP";
|
||||
this.cb_audioCAP.Size = new System.Drawing.Size(230, 21);
|
||||
this.cb_audioCAP.TabIndex = 9;
|
||||
this.cb_audioCAP.Text = "Default";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(12, 23);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(121, 13);
|
||||
this.label3.TabIndex = 8;
|
||||
this.label3.Text = "Audio Playback Device:";
|
||||
//
|
||||
// cb_audioPB
|
||||
//
|
||||
this.cb_audioPB.FormattingEnabled = true;
|
||||
this.cb_audioPB.Location = new System.Drawing.Point(138, 19);
|
||||
this.cb_audioPB.Name = "cb_audioPB";
|
||||
this.cb_audioPB.Size = new System.Drawing.Size(230, 21);
|
||||
this.cb_audioPB.TabIndex = 7;
|
||||
this.cb_audioPB.Text = "Default";
|
||||
//
|
||||
// bt_resetmodem
|
||||
//
|
||||
this.bt_resetmodem.Location = new System.Drawing.Point(189, 19);
|
||||
this.bt_resetmodem.Name = "bt_resetmodem";
|
||||
this.bt_resetmodem.Size = new System.Drawing.Size(117, 23);
|
||||
this.bt_resetmodem.TabIndex = 6;
|
||||
this.bt_resetmodem.Text = "Reset RX Modem";
|
||||
this.bt_resetmodem.UseVisualStyleBackColor = true;
|
||||
this.bt_resetmodem.Click += new System.EventHandler(this.bt_resetmodem_Click);
|
||||
this.bt_shutdown.Location = new System.Drawing.Point(17, 19);
|
||||
this.bt_shutdown.Name = "bt_shutdown";
|
||||
this.bt_shutdown.Size = new System.Drawing.Size(155, 23);
|
||||
this.bt_shutdown.TabIndex = 4;
|
||||
this.bt_shutdown.Text = "Shutdown Modem-SBC";
|
||||
this.bt_shutdown.UseVisualStyleBackColor = true;
|
||||
this.bt_shutdown.Click += new System.EventHandler(this.bt_shutdown_Click);
|
||||
//
|
||||
// tb_shutdown
|
||||
//
|
||||
@@ -603,39 +565,152 @@
|
||||
this.tb_shutdown.TabIndex = 5;
|
||||
this.tb_shutdown.Text = "before switching off the \r\nmodem SBC click here to \r\navoid defective SD-cards.\r\n";
|
||||
//
|
||||
// bt_shutdown
|
||||
// bt_resetmodem
|
||||
//
|
||||
this.bt_shutdown.Location = new System.Drawing.Point(17, 19);
|
||||
this.bt_shutdown.Name = "bt_shutdown";
|
||||
this.bt_shutdown.Size = new System.Drawing.Size(155, 23);
|
||||
this.bt_shutdown.TabIndex = 4;
|
||||
this.bt_shutdown.Text = "Shutdown Modem-SBC";
|
||||
this.bt_shutdown.UseVisualStyleBackColor = true;
|
||||
this.bt_shutdown.Click += new System.EventHandler(this.bt_shutdown_Click);
|
||||
this.bt_resetmodem.Location = new System.Drawing.Point(189, 19);
|
||||
this.bt_resetmodem.Name = "bt_resetmodem";
|
||||
this.bt_resetmodem.Size = new System.Drawing.Size(117, 23);
|
||||
this.bt_resetmodem.TabIndex = 6;
|
||||
this.bt_resetmodem.Text = "Reset RX Modem";
|
||||
this.bt_resetmodem.UseVisualStyleBackColor = true;
|
||||
this.bt_resetmodem.Click += new System.EventHandler(this.bt_resetmodem_Click);
|
||||
//
|
||||
// cb_savegoodfiles
|
||||
// textBox2
|
||||
//
|
||||
this.cb_savegoodfiles.AutoSize = true;
|
||||
this.cb_savegoodfiles.Checked = true;
|
||||
this.cb_savegoodfiles.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.cb_savegoodfiles.Location = new System.Drawing.Point(71, 90);
|
||||
this.cb_savegoodfiles.Name = "cb_savegoodfiles";
|
||||
this.cb_savegoodfiles.Size = new System.Drawing.Size(159, 17);
|
||||
this.cb_savegoodfiles.TabIndex = 3;
|
||||
this.cb_savegoodfiles.Text = "Save good files/images only";
|
||||
this.cb_savegoodfiles.UseVisualStyleBackColor = true;
|
||||
this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textBox2.ForeColor = System.Drawing.Color.Black;
|
||||
this.textBox2.Location = new System.Drawing.Point(189, 48);
|
||||
this.textBox2.Multiline = true;
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(126, 50);
|
||||
this.textBox2.TabIndex = 11;
|
||||
this.textBox2.Text = "in case the RX has sync\r\nproblems, it can be\r\nre-initialized here.";
|
||||
//
|
||||
// cb_stampcall
|
||||
// groupBox3
|
||||
//
|
||||
this.cb_stampcall.AutoSize = true;
|
||||
this.cb_stampcall.Checked = true;
|
||||
this.cb_stampcall.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.cb_stampcall.Location = new System.Drawing.Point(71, 67);
|
||||
this.cb_stampcall.Name = "cb_stampcall";
|
||||
this.cb_stampcall.Size = new System.Drawing.Size(146, 17);
|
||||
this.cb_stampcall.TabIndex = 2;
|
||||
this.cb_stampcall.Text = "Insert Callsign into picture";
|
||||
this.cb_stampcall.UseVisualStyleBackColor = true;
|
||||
this.groupBox3.Controls.Add(this.label6);
|
||||
this.groupBox3.Controls.Add(this.label5);
|
||||
this.groupBox3.Controls.Add(this.tb_CAPvol);
|
||||
this.groupBox3.Controls.Add(this.tb_PBvol);
|
||||
this.groupBox3.Controls.Add(this.cb_audioPB);
|
||||
this.groupBox3.Controls.Add(this.label3);
|
||||
this.groupBox3.Controls.Add(this.textBox3);
|
||||
this.groupBox3.Controls.Add(this.cb_audioCAP);
|
||||
this.groupBox3.Controls.Add(this.label4);
|
||||
this.groupBox3.Location = new System.Drawing.Point(12, 146);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(674, 107);
|
||||
this.groupBox3.TabIndex = 14;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Transceiver Audio";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(391, 54);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(45, 13);
|
||||
this.label6.TabIndex = 16;
|
||||
this.label6.Text = "Volume:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(391, 23);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(45, 13);
|
||||
this.label5.TabIndex = 15;
|
||||
this.label5.Text = "Volume:";
|
||||
//
|
||||
// tb_CAPvol
|
||||
//
|
||||
this.tb_CAPvol.Cursor = System.Windows.Forms.Cursors.SizeAll;
|
||||
this.tb_CAPvol.Location = new System.Drawing.Point(442, 50);
|
||||
this.tb_CAPvol.Maximum = 100;
|
||||
this.tb_CAPvol.MaximumSize = new System.Drawing.Size(0, 24);
|
||||
this.tb_CAPvol.MinimumSize = new System.Drawing.Size(100, 0);
|
||||
this.tb_CAPvol.Name = "tb_CAPvol";
|
||||
this.tb_CAPvol.Size = new System.Drawing.Size(100, 24);
|
||||
this.tb_CAPvol.TabIndex = 14;
|
||||
this.tb_CAPvol.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.tb_CAPvol.Value = 50;
|
||||
this.tb_CAPvol.Scroll += new System.EventHandler(this.tb_CAPvol_Scroll);
|
||||
//
|
||||
// tb_PBvol
|
||||
//
|
||||
this.tb_PBvol.Cursor = System.Windows.Forms.Cursors.SizeAll;
|
||||
this.tb_PBvol.Location = new System.Drawing.Point(442, 19);
|
||||
this.tb_PBvol.Maximum = 100;
|
||||
this.tb_PBvol.MaximumSize = new System.Drawing.Size(0, 24);
|
||||
this.tb_PBvol.MinimumSize = new System.Drawing.Size(100, 0);
|
||||
this.tb_PBvol.Name = "tb_PBvol";
|
||||
this.tb_PBvol.Size = new System.Drawing.Size(100, 24);
|
||||
this.tb_PBvol.TabIndex = 13;
|
||||
this.tb_PBvol.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.tb_PBvol.Value = 50;
|
||||
this.tb_PBvol.Scroll += new System.EventHandler(this.tb_PBvol_Scroll);
|
||||
//
|
||||
// cb_audioPB
|
||||
//
|
||||
this.cb_audioPB.FormattingEnabled = true;
|
||||
this.cb_audioPB.Location = new System.Drawing.Point(138, 19);
|
||||
this.cb_audioPB.Name = "cb_audioPB";
|
||||
this.cb_audioPB.Size = new System.Drawing.Size(230, 21);
|
||||
this.cb_audioPB.TabIndex = 7;
|
||||
this.cb_audioPB.Text = "Default";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(12, 23);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(121, 13);
|
||||
this.label3.TabIndex = 8;
|
||||
this.label3.Text = "Audio Playback Device:";
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textBox3.ForeColor = System.Drawing.Color.Black;
|
||||
this.textBox3.Location = new System.Drawing.Point(138, 79);
|
||||
this.textBox3.Multiline = true;
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(177, 19);
|
||||
this.textBox3.TabIndex = 12;
|
||||
this.textBox3.Text = "(HDMI is usually not used)";
|
||||
//
|
||||
// cb_audioCAP
|
||||
//
|
||||
this.cb_audioCAP.FormattingEnabled = true;
|
||||
this.cb_audioCAP.Location = new System.Drawing.Point(138, 52);
|
||||
this.cb_audioCAP.Name = "cb_audioCAP";
|
||||
this.cb_audioCAP.Size = new System.Drawing.Size(230, 21);
|
||||
this.cb_audioCAP.TabIndex = 9;
|
||||
this.cb_audioCAP.Text = "Default";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(12, 56);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(112, 13);
|
||||
this.label4.TabIndex = 10;
|
||||
this.label4.Text = "Audio Record Device:";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.tb_callsign);
|
||||
this.groupBox2.Controls.Add(this.label1);
|
||||
this.groupBox2.Controls.Add(this.cb_stampcall);
|
||||
this.groupBox2.Controls.Add(this.cb_savegoodfiles);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 13);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(384, 126);
|
||||
this.groupBox2.TabIndex = 13;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Personal Settings";
|
||||
//
|
||||
// tb_callsign
|
||||
//
|
||||
@@ -654,6 +729,30 @@
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Callsign:";
|
||||
//
|
||||
// cb_stampcall
|
||||
//
|
||||
this.cb_stampcall.AutoSize = true;
|
||||
this.cb_stampcall.Checked = true;
|
||||
this.cb_stampcall.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.cb_stampcall.Location = new System.Drawing.Point(71, 67);
|
||||
this.cb_stampcall.Name = "cb_stampcall";
|
||||
this.cb_stampcall.Size = new System.Drawing.Size(146, 17);
|
||||
this.cb_stampcall.TabIndex = 2;
|
||||
this.cb_stampcall.Text = "Insert Callsign into picture";
|
||||
this.cb_stampcall.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cb_savegoodfiles
|
||||
//
|
||||
this.cb_savegoodfiles.AutoSize = true;
|
||||
this.cb_savegoodfiles.Checked = true;
|
||||
this.cb_savegoodfiles.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.cb_savegoodfiles.Location = new System.Drawing.Point(71, 90);
|
||||
this.cb_savegoodfiles.Name = "cb_savegoodfiles";
|
||||
this.cb_savegoodfiles.Size = new System.Drawing.Size(159, 17);
|
||||
this.cb_savegoodfiles.TabIndex = 3;
|
||||
this.cb_savegoodfiles.Text = "Save good files/images only";
|
||||
this.cb_savegoodfiles.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cb_speed
|
||||
//
|
||||
this.cb_speed.FormattingEnabled = true;
|
||||
@@ -668,7 +767,7 @@
|
||||
"6000 8PSK BW: 2500 Hz (QO-100)",
|
||||
"6600 8PSK BW: 2600 Hz",
|
||||
"7200 8PSK BW: 2700 Hz"});
|
||||
this.cb_speed.Location = new System.Drawing.Point(636, 644);
|
||||
this.cb_speed.Location = new System.Drawing.Point(636, 593);
|
||||
this.cb_speed.Name = "cb_speed";
|
||||
this.cb_speed.Size = new System.Drawing.Size(324, 21);
|
||||
this.cb_speed.TabIndex = 11;
|
||||
@@ -678,7 +777,7 @@
|
||||
// label_speed
|
||||
//
|
||||
this.label_speed.AutoSize = true;
|
||||
this.label_speed.Location = new System.Drawing.Point(545, 647);
|
||||
this.label_speed.Location = new System.Drawing.Point(545, 596);
|
||||
this.label_speed.Name = "label_speed";
|
||||
this.label_speed.Size = new System.Drawing.Size(71, 13);
|
||||
this.label_speed.TabIndex = 12;
|
||||
@@ -689,51 +788,32 @@
|
||||
this.timer_searchmodem.Interval = 1000;
|
||||
this.timer_searchmodem.Tick += new System.EventHandler(this.timer_searchmodem_Tick);
|
||||
//
|
||||
// groupBox2
|
||||
// progressBar_fifo
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.tb_callsign);
|
||||
this.groupBox2.Controls.Add(this.label1);
|
||||
this.groupBox2.Controls.Add(this.cb_stampcall);
|
||||
this.groupBox2.Controls.Add(this.cb_savegoodfiles);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 13);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(384, 126);
|
||||
this.groupBox2.TabIndex = 13;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Personal Settings";
|
||||
this.progressBar_fifo.Location = new System.Drawing.Point(636, 620);
|
||||
this.progressBar_fifo.Maximum = 20;
|
||||
this.progressBar_fifo.Name = "progressBar_fifo";
|
||||
this.progressBar_fifo.Size = new System.Drawing.Size(324, 23);
|
||||
this.progressBar_fifo.Step = 11;
|
||||
this.progressBar_fifo.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.progressBar_fifo.TabIndex = 13;
|
||||
//
|
||||
// groupBox3
|
||||
// label_fifo
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.cb_audioPB);
|
||||
this.groupBox3.Controls.Add(this.label3);
|
||||
this.groupBox3.Controls.Add(this.textBox3);
|
||||
this.groupBox3.Controls.Add(this.cb_audioCAP);
|
||||
this.groupBox3.Controls.Add(this.label4);
|
||||
this.groupBox3.Location = new System.Drawing.Point(12, 146);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(384, 107);
|
||||
this.groupBox3.TabIndex = 14;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Transceiver Audio";
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.bt_shutdown);
|
||||
this.groupBox4.Controls.Add(this.tb_shutdown);
|
||||
this.groupBox4.Controls.Add(this.bt_resetmodem);
|
||||
this.groupBox4.Controls.Add(this.textBox2);
|
||||
this.groupBox4.Location = new System.Drawing.Point(12, 259);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(384, 105);
|
||||
this.groupBox4.TabIndex = 15;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Maintenance";
|
||||
this.label_fifo.AutoSize = true;
|
||||
this.label_fifo.Location = new System.Drawing.Point(545, 625);
|
||||
this.label_fifo.Name = "label_fifo";
|
||||
this.label_fifo.Size = new System.Drawing.Size(55, 13);
|
||||
this.label_fifo.TabIndex = 14;
|
||||
this.label_fifo.Text = "TX Buffer:";
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1304, 691);
|
||||
this.ClientSize = new System.Drawing.Size(1293, 691);
|
||||
this.Controls.Add(this.label_fifo);
|
||||
this.Controls.Add(this.progressBar_fifo);
|
||||
this.Controls.Add(this.cb_speed);
|
||||
this.Controls.Add(this.label_speed);
|
||||
this.Controls.Add(this.panel_txspectrum);
|
||||
@@ -758,12 +838,14 @@
|
||||
this.tabPage3.ResumeLayout(false);
|
||||
this.tabPage3.PerformLayout();
|
||||
this.tabPage5.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tb_CAPvol)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tb_PBvol)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -831,6 +913,12 @@
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.TrackBar tb_PBvol;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TrackBar tb_CAPvol;
|
||||
private System.Windows.Forms.ProgressBar progressBar_fifo;
|
||||
private System.Windows.Forms.Label label_fifo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@ namespace oscardata
|
||||
{
|
||||
Imagehandler ih = new Imagehandler();
|
||||
int txcommand = 0; // commands what to send
|
||||
int txframecounter = 0;
|
||||
Byte frameinfo = (Byte)statics.FirstFrame;
|
||||
String TXfilename;
|
||||
int rxbytecounter = 0;
|
||||
DateTime starttime;
|
||||
String old_tsip = "";
|
||||
bool modemrunning = false;
|
||||
|
||||
public Form1()
|
||||
{
|
||||
@@ -60,6 +60,9 @@ namespace oscardata
|
||||
else
|
||||
statics.ostype = 1; // Linux
|
||||
|
||||
// start hsmodem (.exe)
|
||||
modemrunning = statics.StartHSmodem();
|
||||
|
||||
// set temp paths
|
||||
statics.zip_TXtempfilename = statics.addTmpPath(statics.zip_TXtempfilename);
|
||||
statics.zip_RXtempfilename = statics.addTmpPath(statics.zip_RXtempfilename);
|
||||
@@ -92,26 +95,26 @@ namespace oscardata
|
||||
// BER testdata
|
||||
if (txcommand == statics.BERtest)
|
||||
{
|
||||
if (Udp.GetBufferCount() > 3) return;
|
||||
|
||||
Byte[] txdata = new byte[statics.PayloadLen + 2];
|
||||
|
||||
txdata[0] = (Byte)statics.BERtest; // BER Test Marker
|
||||
txdata[1] = frameinfo;
|
||||
|
||||
Byte tb = (Byte)'A';
|
||||
for (int i = 2; i < txdata.Length; i++)
|
||||
if (Udp.GetBufferCount() < 2)
|
||||
{
|
||||
txdata[i] = tb;
|
||||
tb++;
|
||||
if (tb == 'z') tb = (Byte)'A';
|
||||
Byte[] txdata = new byte[statics.PayloadLen + 2];
|
||||
|
||||
txdata[0] = (Byte)statics.BERtest; // BER Test Marker
|
||||
txdata[1] = frameinfo;
|
||||
|
||||
Byte tb = (Byte)'A';
|
||||
for (int i = 2; i < txdata.Length; i++)
|
||||
{
|
||||
txdata[i] = tb;
|
||||
tb++;
|
||||
if (tb == 'z') tb = (Byte)'A';
|
||||
}
|
||||
|
||||
// and transmit it
|
||||
Udp.UdpSendData(txdata);
|
||||
|
||||
frameinfo = (Byte)statics.NextFrame;
|
||||
}
|
||||
|
||||
// and transmit it
|
||||
Udp.UdpSend(txdata);
|
||||
|
||||
frameinfo = (Byte)statics.NextFrame;
|
||||
txframecounter++;
|
||||
}
|
||||
|
||||
if (ArraySend.getSending())
|
||||
@@ -169,10 +172,14 @@ namespace oscardata
|
||||
if (ts_ip.Text.Contains("?") || ts_ip.Text.Contains("1.2.3.4") || old_tsip != statics.ModemIP)
|
||||
{
|
||||
if (statics.ModemIP == "1.2.3.4")
|
||||
{
|
||||
ts_ip.Text = "Modem-IP: ?";
|
||||
ts_ip.ForeColor = Color.Red;
|
||||
}
|
||||
else
|
||||
{
|
||||
ts_ip.Text = "Modem-IP: " + statics.ModemIP;
|
||||
ts_ip.ForeColor = Color.Black;
|
||||
old_tsip = statics.ModemIP;
|
||||
comboBox1_SelectedIndexChanged(null, null); // send speed to modem
|
||||
}
|
||||
@@ -193,11 +200,38 @@ namespace oscardata
|
||||
cb_audioCAP.Items.Add(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (setPBvolume >= 0)
|
||||
{
|
||||
Byte[] txdata = new byte[2];
|
||||
txdata[0] = (Byte)statics.SetPBvolume;
|
||||
txdata[1] = (Byte)setPBvolume;
|
||||
Udp.UdpSendCtrl(txdata);
|
||||
setPBvolume = -1;
|
||||
}
|
||||
|
||||
if (setCAPvolume != -1)
|
||||
{
|
||||
Byte[] txdata = new byte[2];
|
||||
txdata[0] = (Byte)statics.SetCAPvolume;
|
||||
txdata[1] = (Byte)setCAPvolume;
|
||||
Udp.UdpSendCtrl(txdata);
|
||||
setCAPvolume = -1;
|
||||
}
|
||||
|
||||
/*if(modemrunning == false)
|
||||
{
|
||||
// start hsmodem (.exe)
|
||||
modemrunning = statics.StartHSmodem();
|
||||
}*/
|
||||
}
|
||||
|
||||
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
save_Setup();
|
||||
statics.killall("hsmodem");
|
||||
statics.killall("hsmodem.exe");
|
||||
// exit the threads
|
||||
statics.running = false;
|
||||
Udp.Close();
|
||||
@@ -633,6 +667,8 @@ namespace oscardata
|
||||
panel_constel.Invalidate();
|
||||
|
||||
panel_txspectrum.Invalidate();
|
||||
|
||||
progressBar_fifo.Value = statics.PBfifousage;
|
||||
}
|
||||
|
||||
private void panel_constel_Paint(object sender, PaintEventArgs e)
|
||||
@@ -934,7 +970,6 @@ namespace oscardata
|
||||
|
||||
private void button_startBERtest_Click(object sender, EventArgs e)
|
||||
{
|
||||
txframecounter = 1;
|
||||
ber = 0;
|
||||
framelost = 0;
|
||||
totallostframes = 0;
|
||||
@@ -978,8 +1013,7 @@ namespace oscardata
|
||||
|
||||
private void BERcheck(Byte[] rxdata)
|
||||
{
|
||||
String line = "RX: " + rxframecounter.ToString().PadLeft(6, ' ') +
|
||||
" TX: " + txframecounter.ToString().PadLeft(6, ' ') + " ";
|
||||
String line = "RX: " + rxframecounter.ToString().PadLeft(6, ' ') + " ";
|
||||
|
||||
// print payload (must be printable chars)
|
||||
line += Encoding.UTF8.GetString(rxdata).Substring(0, 50) + " ...";
|
||||
@@ -1100,6 +1134,9 @@ namespace oscardata
|
||||
|
||||
label_speed.Location = new Point(panel_txspectrum.Location.X + panel_txspectrum.Size.Width + 20,panel_txspectrum.Location.Y+10);
|
||||
cb_speed.Location = new Point(label_speed.Location.X + label_speed.Size.Width + 10, label_speed.Location.Y-5);
|
||||
|
||||
label_fifo.Location = new Point(label_speed.Location.X, label_speed.Location.Y + 35);
|
||||
progressBar_fifo.Location = new Point(cb_speed.Location.X, cb_speed.Location.Y + 35);
|
||||
}
|
||||
|
||||
public String GetMyBroadcastIP()
|
||||
@@ -1148,10 +1185,12 @@ namespace oscardata
|
||||
|
||||
private void search_modem()
|
||||
{
|
||||
Byte[] txb = new byte[3];
|
||||
Byte[] txb = new byte[5];
|
||||
txb[0] = 0x3c; // ID of this message
|
||||
txb[1] = getPBaudioDevice();
|
||||
txb[2] = getCAPaudioDevice();
|
||||
txb[3] = (Byte)tb_PBvol.Value;
|
||||
txb[4] = (Byte)tb_CAPvol.Value;
|
||||
|
||||
Udp.UdpBCsend(txb, GetMyBroadcastIP(), statics.UdpBCport_AppToModem);
|
||||
|
||||
@@ -1254,7 +1293,7 @@ namespace oscardata
|
||||
txdata[1] = (Byte)idx;
|
||||
|
||||
// and send info to modem
|
||||
Udp.UdpSend(txdata);
|
||||
Udp.UdpSendCtrl(txdata);
|
||||
|
||||
//txcommand = statics.noTX;
|
||||
// stop any ongoing transmission
|
||||
@@ -1363,6 +1402,8 @@ namespace oscardata
|
||||
cb_savegoodfiles.Checked = (s == "1");
|
||||
cb_audioPB.Text = ReadString(sr);
|
||||
cb_audioCAP.Text = ReadString(sr);
|
||||
tb_PBvol.Value = ReadInt(sr);
|
||||
tb_CAPvol.Value = ReadInt(sr);
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -1387,6 +1428,8 @@ namespace oscardata
|
||||
sw.WriteLine(cb_savegoodfiles.Checked ? "1" : "0");
|
||||
sw.WriteLine(cb_audioPB.Text);
|
||||
sw.WriteLine(cb_audioCAP.Text);
|
||||
sw.WriteLine(tb_PBvol.Value.ToString());
|
||||
sw.WriteLine(tb_CAPvol.Value.ToString());
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@@ -1397,11 +1440,9 @@ namespace oscardata
|
||||
DialogResult dr = MessageBox.Show("Do you want to shut down the Modem-Computer ?", "Shut Down Modem", MessageBoxButtons.YesNo);
|
||||
if (dr == DialogResult.Yes)
|
||||
{
|
||||
Byte[] txdata = new byte[statics.PayloadLen + 2];
|
||||
Byte[] txdata = new byte[1];
|
||||
txdata[0] = (Byte)statics.Modem_shutdown;
|
||||
|
||||
// and transmit it
|
||||
Udp.UdpSend(txdata);
|
||||
Udp.UdpSendCtrl(txdata);
|
||||
|
||||
MessageBox.Show("Please wait abt. 1 minute before powering OFF the modem", "Shut Down Modem", MessageBoxButtons.OK);
|
||||
}
|
||||
@@ -1411,20 +1452,33 @@ namespace oscardata
|
||||
// TEST ONLY: tell modem to send a file
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Byte[] txdata = new byte[statics.PayloadLen + 2];
|
||||
Byte[] txdata = new byte[1];
|
||||
txdata[0] = (Byte)statics.AutosendFile;
|
||||
|
||||
// and transmit it
|
||||
Udp.UdpSend(txdata);
|
||||
Udp.UdpSendCtrl(txdata);
|
||||
}
|
||||
|
||||
private void bt_resetmodem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Byte[] txdata = new byte[statics.PayloadLen + 2];
|
||||
Byte[] txdata = new byte[1];
|
||||
txdata[0] = (Byte)statics.ResetModem;
|
||||
|
||||
// and transmit it
|
||||
Udp.UdpSend(txdata);
|
||||
Udp.UdpSendCtrl(txdata);
|
||||
}
|
||||
|
||||
int setPBvolume = -1;
|
||||
int setCAPvolume = -1;
|
||||
|
||||
private void tb_PBvol_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
setPBvolume = tb_PBvol.Value;
|
||||
}
|
||||
|
||||
private void tb_CAPvol_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
setCAPvolume = tb_CAPvol.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq.Expressions;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace oscardata
|
||||
@@ -26,6 +28,8 @@ namespace oscardata
|
||||
public static Byte AutosendFolder = 18;
|
||||
public static Byte Modem_shutdown = 19;
|
||||
public static Byte ResetModem = 20;
|
||||
public static Byte SetPBvolume = 21;
|
||||
public static Byte SetCAPvolume = 22;
|
||||
|
||||
// frame sequence, modem needs that for i.e. sending a preamble
|
||||
public static Byte FirstFrame = 0;
|
||||
@@ -33,6 +37,11 @@ namespace oscardata
|
||||
public static Byte LastFrame = 2;
|
||||
public static Byte SingleFrame = 3;
|
||||
|
||||
// udp messages from modem
|
||||
public static Byte udp_payload = 1;
|
||||
public static Byte udp_bc = 3;
|
||||
public static Byte udp_fft = 4;
|
||||
public static Byte udp_iq = 5;
|
||||
|
||||
// global static variables
|
||||
public static bool running = true;
|
||||
@@ -56,6 +65,7 @@ namespace oscardata
|
||||
public static int GotAudioDevices = 0;
|
||||
public static String[] AudioPBdevs;
|
||||
public static String[] AudioCAPdevs;
|
||||
public static int PBfifousage = 0;
|
||||
|
||||
public static void setDatarate(int rate)
|
||||
{
|
||||
@@ -139,11 +149,11 @@ namespace oscardata
|
||||
return enc.GetBytes(str);
|
||||
}
|
||||
|
||||
public static string ByteArrayToString(byte[] arr)
|
||||
public static string ByteArrayToString(byte[] arr, int offset = 0)
|
||||
{
|
||||
Byte[] ba = new byte[arr.Length];
|
||||
int dst = 0;
|
||||
for (int i = 0; i < arr.Length; i++)
|
||||
for (int i = offset; i < arr.Length; i++)
|
||||
{
|
||||
if (arr[i] != 0) ba[dst++] = arr[i];
|
||||
}
|
||||
@@ -271,5 +281,76 @@ namespace oscardata
|
||||
|
||||
return fn.Substring(0, idx) + "." + ext;
|
||||
}
|
||||
|
||||
static Process cmd = null;
|
||||
public static bool StartHSmodem()
|
||||
{
|
||||
// kill old processes already running
|
||||
killall("hsmodem");
|
||||
killall("hsmodem.exe");
|
||||
// starte Prozesse
|
||||
try
|
||||
{
|
||||
if (ostype == 0)
|
||||
{
|
||||
if (!File.Exists("hsmodem.exe")) return false;
|
||||
cmd = new Process();
|
||||
cmd.StartInfo.FileName = "hsmodem.exe";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!File.Exists("hsmodem")) return false;
|
||||
cmd = new Process();
|
||||
cmd.StartInfo.FileName = "hsmodem";
|
||||
}
|
||||
|
||||
if (cmd != null)
|
||||
{
|
||||
cmd.StartInfo.WindowStyle = ProcessWindowStyle.Normal;// .Hidden;
|
||||
cmd.StartInfo.Arguments = "";
|
||||
cmd.Start();
|
||||
Console.WriteLine("hsmodem started");
|
||||
}
|
||||
}
|
||||
catch { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
static public void killall(String s)
|
||||
{
|
||||
if (ostype == 0)
|
||||
{
|
||||
// kill a Windows process
|
||||
try
|
||||
{
|
||||
foreach (var process in Process.GetProcessesByName(s))
|
||||
process.Kill();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
else
|
||||
{
|
||||
// kill a Linux process
|
||||
try
|
||||
{
|
||||
if (cmd != null)
|
||||
cmd.Kill();
|
||||
cmd = null;
|
||||
|
||||
Process proc = new Process();
|
||||
proc.EnableRaisingEvents = false;
|
||||
proc.StartInfo.FileName = "killall";
|
||||
proc.StartInfo.UseShellExecute = false;
|
||||
proc.StartInfo.RedirectStandardOutput = true;
|
||||
proc.OutputDataReceived += (sender, args) => { }; // schreibe Output ins nichts
|
||||
proc.StartInfo.RedirectStandardError = true;
|
||||
proc.ErrorDataReceived += (sender, args) => { }; // schreibe Output ins nichts
|
||||
proc.StartInfo.Arguments = s;
|
||||
proc.Start();
|
||||
proc.WaitForExit();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,6 @@
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
||||
+59
-17
@@ -16,7 +16,6 @@ using System.Drawing;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
|
||||
namespace oscardata
|
||||
{
|
||||
@@ -29,6 +28,7 @@ namespace oscardata
|
||||
// Pipes for data transferred via UDP ports
|
||||
static UdpQueue uq_rx = new UdpQueue();
|
||||
static UdpQueue uq_tx = new UdpQueue();
|
||||
static UdpQueue uq_ctrl = new UdpQueue();
|
||||
static UdpQueue uq_fft = new UdpQueue();
|
||||
static UdpQueue uq_iq = new UdpQueue();
|
||||
|
||||
@@ -83,13 +83,13 @@ namespace oscardata
|
||||
int rxtype = rxarr[0];
|
||||
Byte[] b = new byte[rxarr.Length - 1];
|
||||
Array.Copy(rxarr, 1, b, 0, b.Length);
|
||||
|
||||
|
||||
// payload
|
||||
if (rxtype == 1)
|
||||
if (rxtype == statics.udp_payload)
|
||||
uq_rx.Add(b);
|
||||
|
||||
// Broadcast response
|
||||
if (rxtype == 3)
|
||||
if (rxtype == statics.udp_bc)
|
||||
{
|
||||
statics.ModemIP = RemoteEndpoint.Address.ToString();
|
||||
searchtimeout = 0;
|
||||
@@ -103,11 +103,16 @@ namespace oscardata
|
||||
}
|
||||
|
||||
// FFT data
|
||||
if (rxtype == 4)
|
||||
uq_fft.Add(b);
|
||||
if (rxtype == statics.udp_fft)
|
||||
{
|
||||
statics.PBfifousage = b[0];
|
||||
Byte[] b1 = new byte[b.Length - 1];
|
||||
Array.Copy(b, 1, b1, 0, b1.Length);
|
||||
uq_fft.Add(b1);
|
||||
}
|
||||
|
||||
// IQ data
|
||||
if (rxtype == 5)
|
||||
if (rxtype == statics.udp_iq)
|
||||
{
|
||||
for (int i = 0; i < b.Length; i++)
|
||||
{
|
||||
@@ -167,7 +172,7 @@ namespace oscardata
|
||||
}
|
||||
|
||||
static int panelw = 75, panelh = 75;
|
||||
static int maxdrawanz = 250;
|
||||
static int maxdrawanz = 160;
|
||||
static int drawanz = 0;
|
||||
static Bitmap bm;
|
||||
static void drawBitmap(int re, int im)
|
||||
@@ -194,7 +199,7 @@ namespace oscardata
|
||||
int x = panelw / 2 + (int)fre;
|
||||
int y = panelh / 2 + (int)fim;
|
||||
|
||||
int et = 1;
|
||||
int et = 2;
|
||||
gr.FillEllipse(Brushes.Blue, x - et, y - et, et * 2, et * 2);
|
||||
}
|
||||
}
|
||||
@@ -209,35 +214,62 @@ namespace oscardata
|
||||
// calculate cycle time for the requested data rate
|
||||
// time in ms for one bit: 1000/statics.datarate
|
||||
|
||||
int actdatarate = statics.getDatarate();
|
||||
int wait_datarate = (int)(((double)statics.UdpBlocklen * 8.0 * 1000.0 / (double)(statics.getDatarate())));
|
||||
//int actdatarate = statics.getDatarate();
|
||||
//int wait_datarate = (int)(((double)statics.UdpBlocklen * 8.0 * 1000.0 / (double)(statics.getDatarate())));
|
||||
//Timer TTimer = new Timer(new TimerCallback(TXTickTimer), autoEvent, 0, wait_datarate);
|
||||
|
||||
Timer TTimer = new Timer(new TimerCallback(TXTickTimer), autoEvent, 0, wait_datarate);
|
||||
while (statics.running)
|
||||
{
|
||||
bool wait = true;
|
||||
if(uq_ctrl.Count() > 0)
|
||||
{
|
||||
// Control Message: send immediately
|
||||
Byte[] b = uq_ctrl.Getarr();
|
||||
udpc.Send(b, b.Length, statics.ModemIP, statics.UdpTXport);
|
||||
wait = false;
|
||||
}
|
||||
|
||||
if(statics.PBfifousage < 2)
|
||||
{
|
||||
// we need to send more payload data
|
||||
if (uq_tx.Count() > 0)
|
||||
{
|
||||
Byte[] b = uq_tx.Getarr();
|
||||
udpc.Send(b, b.Length, statics.ModemIP, statics.UdpTXport);
|
||||
wait = false;
|
||||
}
|
||||
}
|
||||
if (wait) Thread.Sleep(1);
|
||||
}
|
||||
|
||||
/*
|
||||
while (statics.running)
|
||||
{
|
||||
autoEvent.WaitOne();
|
||||
try
|
||||
{
|
||||
if (uq_tx.Count() > 0)
|
||||
while (uq_tx.Count() > 0)
|
||||
{
|
||||
// TX data available
|
||||
Byte[] b = uq_tx.Getarr();
|
||||
udpc.Send(b, b.Length, statics.ModemIP, statics.UdpTXport);
|
||||
if (b[0] < 16) break; // continue without pause for internal control messages, or break for TX messages
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
String err = e.ToString();
|
||||
}
|
||||
if(statics.getDatarate() != actdatarate)
|
||||
|
||||
// do not wait in case of internal messages
|
||||
if (statics.getDatarate() != actdatarate)
|
||||
{
|
||||
// rate has been changed, reset the timer
|
||||
wait_datarate = (int)(((double)statics.UdpBlocklen * 8.0 * 1000.0 / (double)(statics.getDatarate())));
|
||||
TTimer.Change(0, wait_datarate);
|
||||
actdatarate = statics.getDatarate();
|
||||
actdatarate = statics.getDatarate();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public static void UdpBCsend(Byte[] b, String ip, int port)
|
||||
@@ -257,16 +289,26 @@ namespace oscardata
|
||||
// send a Byte array via UDP
|
||||
// this function can be called from anywhere in the program
|
||||
// it transfers the data to the udp-tx thread via a thread-safe pipe
|
||||
public static void UdpSend(Byte[] b)
|
||||
public static void UdpSendData(Byte[] b)
|
||||
{
|
||||
uq_tx.Add(b);
|
||||
}
|
||||
|
||||
public static void UdpSendCtrl(Byte[] b)
|
||||
{
|
||||
uq_ctrl.Add(b);
|
||||
}
|
||||
|
||||
public static int GetBufferCount()
|
||||
{
|
||||
return uq_tx.Count();
|
||||
}
|
||||
|
||||
public static int GetBufferCountCtrl()
|
||||
{
|
||||
return uq_ctrl.Count();
|
||||
}
|
||||
|
||||
public static Byte[] UdpReceive()
|
||||
{
|
||||
if (uq_rx.Count() == 0) return null;
|
||||
|
||||
Reference in New Issue
Block a user