This commit is contained in:
Kurt
2021-02-22 15:58:19 +01:00
parent 43cea876bb
commit 01f82d2afb
49 changed files with 3643 additions and 847 deletions
+5 -2
View File
@@ -34,6 +34,7 @@ namespace oscardata
filestat = statics.LastFrame;
}
}
public static bool getSending()
{
bool v;
@@ -141,7 +142,7 @@ namespace oscardata
if (getSending() == false) return; // nothing to send
// check the TX buffer, do not feed more data into
// the buffer if it has already more than 10 entries
// the buffer if it has already more than n entries
if (Udp.GetBufferCount() > 3) return;
Byte[] txarr = new byte[statics.PayloadLen];
@@ -153,7 +154,9 @@ namespace oscardata
if (txlen <= statics.PayloadLen)
{
// we just need to send one frame
txudp(txdata, txtype, statics.SingleFrame);
for (int i = 0; i < txdata.Length; i++)
txarr[i] = txdata[i];
txudp(txarr, txtype, statics.SingleFrame);
setSending(false); // transmission complete
}
else
+252 -164
View File
@@ -39,9 +39,7 @@
this.RXstatus = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStrip_spacer = new System.Windows.Forms.ToolStripStatusLabel();
this.ts_userinfo = new System.Windows.Forms.ToolStripStatusLabel();
this.panel_constel = new System.Windows.Forms.Panel();
this.timer_qpsk = new System.Windows.Forms.Timer(this.components);
this.panel_txspectrum = new System.Windows.Forms.Panel();
this.tabPage_ber = new System.Windows.Forms.TabPage();
this.button6 = new System.Windows.Forms.Button();
this.bt_allf = new System.Windows.Forms.Button();
@@ -51,13 +49,13 @@
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.button_startBERtest = new System.Windows.Forms.Button();
this.tabPage_image = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.Panel();
this.groupBox1 = new oscardata.DoubleBufferedPanel();
this.cb_picres = new System.Windows.Forms.ComboBox();
this.cb_loop = new System.Windows.Forms.CheckBox();
this.bt_rximages = new System.Windows.Forms.Button();
this.button_loadimage = new System.Windows.Forms.Button();
this.comboBox_quality = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.checkBox_big = new System.Windows.Forms.CheckBox();
this.button_cancelimg = new System.Windows.Forms.Button();
this.button_sendimage = new System.Windows.Forms.Button();
this.label_rximage = new System.Windows.Forms.Label();
@@ -66,6 +64,11 @@
this.pictureBox_tximage = new System.Windows.Forms.PictureBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage_file = new System.Windows.Forms.TabPage();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.cb_file_pause = new System.Windows.Forms.ComboBox();
this.label13 = new System.Windows.Forms.Label();
this.cb_file_loop = new System.Windows.Forms.CheckBox();
this.bt_open_html = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.button2 = new System.Windows.Forms.Button();
this.bt_openrxfile = new System.Windows.Forms.Button();
@@ -105,7 +108,7 @@
this.label3 = new System.Windows.Forms.Label();
this.tb_rtty_TX = new System.Windows.Forms.TextBox();
this.tb_rtty_RX = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.panel1 = new oscardata.DoubleBufferedPanel();
this.textBox6 = new System.Windows.Forms.TextBox();
this.cb_rx_autosync = new System.Windows.Forms.CheckBox();
this.rb_rtty_real = new System.Windows.Forms.RadioButton();
@@ -143,9 +146,9 @@
this.label_cfgpath = new System.Windows.Forms.Label();
this.label_cfgpath_tit = new System.Windows.Forms.Label();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.label13 = new System.Windows.Forms.Label();
this.cb_extIF = new System.Windows.Forms.CheckBox();
this.textBox7 = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.cb_safemode = new System.Windows.Forms.ComboBox();
this.cb_language = new System.Windows.Forms.ComboBox();
this.cb_autostart = new System.Windows.Forms.CheckBox();
this.bt_shutdown = new System.Windows.Forms.Button();
@@ -191,18 +194,20 @@
this.cb_stampcall = new System.Windows.Forms.CheckBox();
this.tabPage_about = new System.Windows.Forms.TabPage();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
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.label_fifo = new System.Windows.Forms.Label();
this.label_capfifo = new System.Windows.Forms.Label();
this.lb_rxsignal = new System.Windows.Forms.Label();
this.lb_rxsync = new System.Windows.Forms.Label();
this.pn1 = new System.Windows.Forms.Panel();
this.pn1 = new oscardata.DoubleBufferedPanel();
this.progressBar_fifo = new oscardata.KmProgressBar();
this.label_capfifo = new System.Windows.Forms.Label();
this.label_speed = new System.Windows.Forms.Label();
this.pb_rxsignal = new System.Windows.Forms.PictureBox();
this.lb_rxsync = new System.Windows.Forms.Label();
this.progressBar_capfifo = new oscardata.KmProgressBar();
this.cb_speed = new System.Windows.Forms.ComboBox();
this.lb_rxsignal = new System.Windows.Forms.Label();
this.pb_rxsync = new System.Windows.Forms.PictureBox();
this.label_fifo = new System.Windows.Forms.Label();
this.panel_txspectrum = new oscardata.DoubleBufferedPanel();
this.panel_constel = new oscardata.DoubleBufferedPanel();
this.statusStrip1.SuspendLayout();
this.tabPage_ber.SuspendLayout();
this.tabPage_image.SuspendLayout();
@@ -211,6 +216,7 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox_tximage)).BeginInit();
this.tabControl1.SuspendLayout();
this.tabPage_file.SuspendLayout();
this.groupBox8.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.tabPage_audio.SuspendLayout();
this.groupBox7.SuspendLayout();
@@ -273,62 +279,46 @@
//
// toolStripStatusLabel
//
this.toolStripStatusLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.toolStripStatusLabel.Name = "toolStripStatusLabel";
this.toolStripStatusLabel.Size = new System.Drawing.Size(39, 17);
this.toolStripStatusLabel.Size = new System.Drawing.Size(37, 17);
this.toolStripStatusLabel.Text = "Status";
//
// ts_ip
//
this.ts_ip.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
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.Size = new System.Drawing.Size(13, 17);
this.ts_ip.Text = "?";
//
// RXstatus
//
this.RXstatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.RXstatus.Name = "RXstatus";
this.RXstatus.Size = new System.Drawing.Size(58, 17);
this.RXstatus.Size = new System.Drawing.Size(55, 17);
this.RXstatus.Text = "RX-Status";
//
// toolStrip_spacer
//
this.toolStrip_spacer.Name = "toolStrip_spacer";
this.toolStrip_spacer.Size = new System.Drawing.Size(1156, 17);
this.toolStrip_spacer.Size = new System.Drawing.Size(1160, 17);
this.toolStrip_spacer.Spring = true;
//
// ts_userinfo
//
this.ts_userinfo.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.ts_userinfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.ts_userinfo.ForeColor = System.Drawing.Color.Blue;
this.ts_userinfo.Name = "ts_userinfo";
this.ts_userinfo.Size = new System.Drawing.Size(16, 17);
this.ts_userinfo.Text = "...";
//
// panel_constel
//
this.panel_constel.BackColor = System.Drawing.Color.AliceBlue;
this.panel_constel.Location = new System.Drawing.Point(11, 590);
this.panel_constel.Name = "panel_constel";
this.panel_constel.Size = new System.Drawing.Size(75, 75);
this.panel_constel.TabIndex = 5;
this.panel_constel.Paint += new System.Windows.Forms.PaintEventHandler(this.panel_constel_Paint);
//
// timer_qpsk
//
this.timer_qpsk.Enabled = true;
this.timer_qpsk.Interval = 200;
this.timer_qpsk.Tick += new System.EventHandler(this.timer_qpsk_Tick);
//
// panel_txspectrum
//
this.panel_txspectrum.BackColor = System.Drawing.SystemColors.ControlLight;
this.panel_txspectrum.Location = new System.Drawing.Point(92, 590);
this.panel_txspectrum.Name = "panel_txspectrum";
this.panel_txspectrum.Size = new System.Drawing.Size(442, 76);
this.panel_txspectrum.TabIndex = 6;
this.panel_txspectrum.Paint += new System.Windows.Forms.PaintEventHandler(this.panel_txspectrum_Paint);
this.panel_txspectrum.DoubleClick += new System.EventHandler(this.panel_txspectrum_DoubleClick);
//
// tabPage_ber
//
this.tabPage_ber.BackColor = System.Drawing.Color.Transparent;
@@ -459,12 +449,12 @@
//
// groupBox1
//
this.groupBox1.Controls.Add(this.cb_picres);
this.groupBox1.Controls.Add(this.cb_loop);
this.groupBox1.Controls.Add(this.bt_rximages);
this.groupBox1.Controls.Add(this.button_loadimage);
this.groupBox1.Controls.Add(this.comboBox_quality);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.checkBox_big);
this.groupBox1.Controls.Add(this.button_cancelimg);
this.groupBox1.Controls.Add(this.button_sendimage);
this.groupBox1.Location = new System.Drawing.Point(3, 508);
@@ -472,6 +462,23 @@
this.groupBox1.Size = new System.Drawing.Size(1277, 42);
this.groupBox1.TabIndex = 12;
//
// cb_picres
//
this.cb_picres.FormattingEnabled = true;
this.cb_picres.Items.AddRange(new object[] {
"160x120",
"240x180",
"320x240",
"400x300",
"480x360",
"560x420",
"640x480"});
this.cb_picres.Location = new System.Drawing.Point(174, 7);
this.cb_picres.Name = "cb_picres";
this.cb_picres.Size = new System.Drawing.Size(85, 21);
this.cb_picres.TabIndex = 12;
this.cb_picres.Text = "640x480";
//
// cb_loop
//
this.cb_loop.AutoSize = true;
@@ -519,7 +526,7 @@
"very high, 4min"});
this.comboBox_quality.Location = new System.Drawing.Point(57, 7);
this.comboBox_quality.Name = "comboBox_quality";
this.comboBox_quality.Size = new System.Drawing.Size(109, 21);
this.comboBox_quality.Size = new System.Drawing.Size(111, 21);
this.comboBox_quality.TabIndex = 6;
this.comboBox_quality.Text = "medium, 1min";
//
@@ -532,19 +539,6 @@
this.label2.TabIndex = 7;
this.label2.Text = "Quality:";
//
// checkBox_big
//
this.checkBox_big.AutoSize = true;
this.checkBox_big.Checked = true;
this.checkBox_big.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBox_big.Location = new System.Drawing.Point(187, 9);
this.checkBox_big.Name = "checkBox_big";
this.checkBox_big.Size = new System.Drawing.Size(79, 17);
this.checkBox_big.TabIndex = 8;
this.checkBox_big.Text = "640(320)px";
this.checkBox_big.UseVisualStyleBackColor = true;
this.checkBox_big.CheckedChanged += new System.EventHandler(this.checkBox_small_CheckedChanged);
//
// button_cancelimg
//
this.button_cancelimg.ForeColor = System.Drawing.Color.Red;
@@ -601,7 +595,6 @@
this.pictureBox_rximage.Location = new System.Drawing.Point(642, 27);
this.pictureBox_rximage.Name = "pictureBox_rximage";
this.pictureBox_rximage.Size = new System.Drawing.Size(640, 480);
this.pictureBox_rximage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBox_rximage.TabIndex = 3;
this.pictureBox_rximage.TabStop = false;
//
@@ -634,6 +627,8 @@
// tabPage_file
//
this.tabPage_file.BackColor = System.Drawing.Color.Transparent;
this.tabPage_file.Controls.Add(this.groupBox8);
this.tabPage_file.Controls.Add(this.bt_open_html);
this.tabPage_file.Controls.Add(this.pictureBox1);
this.tabPage_file.Controls.Add(this.button2);
this.tabPage_file.Controls.Add(this.bt_openrxfile);
@@ -652,11 +647,76 @@
this.tabPage_file.TabIndex = 2;
this.tabPage_file.Text = "File";
//
// groupBox8
//
this.groupBox8.Controls.Add(this.cb_file_pause);
this.groupBox8.Controls.Add(this.label13);
this.groupBox8.Controls.Add(this.cb_file_loop);
this.groupBox8.Location = new System.Drawing.Point(17, 192);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(137, 103);
this.groupBox8.TabIndex = 16;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "Send all files in folder";
//
// cb_file_pause
//
this.cb_file_pause.FormattingEnabled = true;
this.cb_file_pause.Items.AddRange(new object[] {
"0 s",
"10s",
"20s",
"30s",
"40s",
"50s",
"1min",
"2min",
"5min",
"10min"});
this.cb_file_pause.Location = new System.Drawing.Point(14, 71);
this.cb_file_pause.Name = "cb_file_pause";
this.cb_file_pause.Size = new System.Drawing.Size(92, 21);
this.cb_file_pause.TabIndex = 16;
this.cb_file_pause.Text = "1min";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(11, 53);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(105, 13);
this.label13.TabIndex = 15;
this.label13.Text = "Pause between files:";
//
// cb_file_loop
//
this.cb_file_loop.AutoSize = true;
this.cb_file_loop.Location = new System.Drawing.Point(16, 25);
this.cb_file_loop.Name = "cb_file_loop";
this.cb_file_loop.Size = new System.Drawing.Size(65, 17);
this.cb_file_loop.TabIndex = 14;
this.cb_file_loop.Text = "ON / off";
this.cb_file_loop.UseVisualStyleBackColor = true;
//
// bt_open_html
//
this.bt_open_html.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.bt_open_html.ImageIndex = 2;
this.bt_open_html.ImageList = this.imageList1;
this.bt_open_html.Location = new System.Drawing.Point(17, 337);
this.bt_open_html.Name = "bt_open_html";
this.bt_open_html.Size = new System.Drawing.Size(137, 51);
this.bt_open_html.TabIndex = 15;
this.bt_open_html.Text = "Open received \r\nHTML file";
this.bt_open_html.UseVisualStyleBackColor = true;
this.bt_open_html.Visible = false;
this.bt_open_html.Click += new System.EventHandler(this.bt_open_html_Click);
//
// pictureBox1
//
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox1.Location = new System.Drawing.Point(17, 371);
this.pictureBox1.Location = new System.Drawing.Point(17, 394);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(127, 134);
this.pictureBox1.TabIndex = 13;
@@ -668,7 +728,7 @@
this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button2.ImageIndex = 8;
this.button2.ImageList = this.imageList1;
this.button2.Location = new System.Drawing.Point(17, 218);
this.button2.Location = new System.Drawing.Point(17, 163);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(137, 23);
this.button2.TabIndex = 12;
@@ -681,7 +741,7 @@
this.bt_openrxfile.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.bt_openrxfile.ImageIndex = 5;
this.bt_openrxfile.ImageList = this.imageList1;
this.bt_openrxfile.Location = new System.Drawing.Point(17, 306);
this.bt_openrxfile.Location = new System.Drawing.Point(17, 301);
this.bt_openrxfile.Name = "bt_openrxfile";
this.bt_openrxfile.Size = new System.Drawing.Size(137, 30);
this.bt_openrxfile.TabIndex = 11;
@@ -734,7 +794,7 @@
this.bt_file_send.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.bt_file_send.ImageIndex = 10;
this.bt_file_send.ImageList = this.imageList1;
this.bt_file_send.Location = new System.Drawing.Point(17, 157);
this.bt_file_send.Location = new System.Drawing.Point(17, 124);
this.bt_file_send.Name = "bt_file_send";
this.bt_file_send.Size = new System.Drawing.Size(137, 30);
this.bt_file_send.TabIndex = 3;
@@ -1576,9 +1636,9 @@
//
// groupBox4
//
this.groupBox4.Controls.Add(this.label13);
this.groupBox4.Controls.Add(this.cb_extIF);
this.groupBox4.Controls.Add(this.textBox7);
this.groupBox4.Controls.Add(this.label12);
this.groupBox4.Controls.Add(this.cb_safemode);
this.groupBox4.Controls.Add(this.cb_language);
this.groupBox4.Controls.Add(this.cb_autostart);
this.groupBox4.Controls.Add(this.bt_shutdown);
@@ -1592,44 +1652,46 @@
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Maintenance";
//
// label13
// cb_extIF
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(240, 78);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(70, 13);
this.label13.TabIndex = 27;
this.label13.Text = "data security:";
this.cb_extIF.AutoSize = true;
this.cb_extIF.Location = new System.Drawing.Point(213, 22);
this.cb_extIF.Name = "cb_extIF";
this.cb_extIF.Size = new System.Drawing.Size(135, 17);
this.cb_extIF.TabIndex = 27;
this.cb_extIF.Text = "External Data Interface";
this.cb_extIF.UseVisualStyleBackColor = true;
this.cb_extIF.CheckedChanged += new System.EventHandler(this.cb_extIF_CheckedChanged);
//
// textBox7
//
this.textBox7.BackColor = System.Drawing.SystemColors.Control;
this.textBox7.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox7.ForeColor = System.Drawing.Color.Black;
this.textBox7.Location = new System.Drawing.Point(211, 45);
this.textBox7.Multiline = true;
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(151, 39);
this.textBox7.TabIndex = 28;
this.textBox7.Text = "for advanced users only, see developers manual";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(221, 23);
this.label12.Location = new System.Drawing.Point(428, 23);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(103, 13);
this.label12.TabIndex = 26;
this.label12.Text = "Language/Sprache:";
//
// cb_safemode
//
this.cb_safemode.FormattingEnabled = true;
this.cb_safemode.Items.AddRange(new object[] {
"off (fast)",
"medium",
"high (slow)"});
this.cb_safemode.Location = new System.Drawing.Point(326, 75);
this.cb_safemode.Name = "cb_safemode";
this.cb_safemode.Size = new System.Drawing.Size(110, 21);
this.cb_safemode.TabIndex = 25;
this.cb_safemode.Text = "off";
//
// cb_language
//
this.cb_language.FormattingEnabled = true;
this.cb_language.Items.AddRange(new object[] {
"English",
"German/Deutsch"});
this.cb_language.Location = new System.Drawing.Point(326, 19);
this.cb_language.Location = new System.Drawing.Point(428, 42);
this.cb_language.Name = "cb_language";
this.cb_language.Size = new System.Drawing.Size(110, 21);
this.cb_language.TabIndex = 24;
@@ -1643,15 +1705,15 @@
this.cb_autostart.CheckState = System.Windows.Forms.CheckState.Checked;
this.cb_autostart.Location = new System.Drawing.Point(17, 23);
this.cb_autostart.Name = "cb_autostart";
this.cb_autostart.Size = new System.Drawing.Size(156, 17);
this.cb_autostart.Size = new System.Drawing.Size(155, 17);
this.cb_autostart.TabIndex = 4;
this.cb_autostart.Text = "AUTO start/stop HSmodem";
this.cb_autostart.Text = "LOCAL/(remote) HSmodem";
this.cb_autostart.UseVisualStyleBackColor = true;
this.cb_autostart.CheckedChanged += new System.EventHandler(this.cb_autostart_CheckedChanged);
//
// bt_shutdown
//
this.bt_shutdown.Location = new System.Drawing.Point(491, 19);
this.bt_shutdown.Location = new System.Drawing.Point(564, 18);
this.bt_shutdown.Name = "bt_shutdown";
this.bt_shutdown.Size = new System.Drawing.Size(155, 23);
this.bt_shutdown.TabIndex = 4;
@@ -1665,7 +1727,7 @@
this.tb_shutdown.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.tb_shutdown.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tb_shutdown.ForeColor = System.Drawing.Color.Red;
this.tb_shutdown.Location = new System.Drawing.Point(491, 48);
this.tb_shutdown.Location = new System.Drawing.Point(564, 47);
this.tb_shutdown.Multiline = true;
this.tb_shutdown.Name = "tb_shutdown";
this.tb_shutdown.Size = new System.Drawing.Size(155, 50);
@@ -1674,7 +1736,7 @@
//
// bt_resetmodem
//
this.bt_resetmodem.Location = new System.Drawing.Point(529, 92);
this.bt_resetmodem.Location = new System.Drawing.Point(602, 91);
this.bt_resetmodem.Name = "bt_resetmodem";
this.bt_resetmodem.Size = new System.Drawing.Size(117, 23);
this.bt_resetmodem.TabIndex = 6;
@@ -1692,7 +1754,7 @@
this.textBox3.Location = new System.Drawing.Point(15, 46);
this.textBox3.Multiline = true;
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(151, 50);
this.textBox3.Size = new System.Drawing.Size(151, 39);
this.textBox3.TabIndex = 12;
this.textBox3.Text = "only uncheck if modem runs on a separate PC";
//
@@ -2142,78 +2204,11 @@
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = resources.GetString("richTextBox1.Text");
//
// cb_speed
//
this.cb_speed.FormattingEnabled = true;
this.cb_speed.Items.AddRange(new object[] {
"1200 BPSK BW: 1300 Hz",
"2400 BPSK BW: 2500 Hz",
"3000 QPSK BW: 1700 Hz ",
"4000 QPSK BW: 2400 Hz ",
"4410 QPSK BW: 2500 Hz (QO-100 Standard)",
"4800 QPSK BW: 2700 Hz",
"5500 8APSK BW: 2300 Hz",
"6000 8APSK BW: 2500 Hz (QO-100 Transceiver)",
"6600 8APSK BW: 2600 Hz",
"7200 8APSK BW: 2700 Hz (QO-100 SDR)",
"45.45 Baud RTTY"});
this.cb_speed.Location = new System.Drawing.Point(122, 2);
this.cb_speed.Name = "cb_speed";
this.cb_speed.Size = new System.Drawing.Size(304, 21);
this.cb_speed.TabIndex = 11;
this.cb_speed.Text = "4410 QPSK BW: 2500 Hz (QO-100)";
this.cb_speed.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// label_speed
//
this.label_speed.AutoSize = true;
this.label_speed.Location = new System.Drawing.Point(31, 5);
this.label_speed.Name = "label_speed";
this.label_speed.Size = new System.Drawing.Size(71, 13);
this.label_speed.TabIndex = 12;
this.label_speed.Text = "Speed [bit/s]:";
//
// timer_searchmodem
//
this.timer_searchmodem.Interval = 1000;
this.timer_searchmodem.Tick += new System.EventHandler(this.timer_searchmodem_Tick);
//
// label_fifo
//
this.label_fifo.AutoSize = true;
this.label_fifo.Location = new System.Drawing.Point(31, 31);
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:";
//
// label_capfifo
//
this.label_capfifo.AutoSize = true;
this.label_capfifo.Location = new System.Drawing.Point(31, 54);
this.label_capfifo.Name = "label_capfifo";
this.label_capfifo.Size = new System.Drawing.Size(56, 13);
this.label_capfifo.TabIndex = 16;
this.label_capfifo.Text = "RX Buffer:";
//
// lb_rxsignal
//
this.lb_rxsignal.AutoSize = true;
this.lb_rxsignal.Location = new System.Drawing.Point(448, 54);
this.lb_rxsignal.Name = "lb_rxsignal";
this.lb_rxsignal.Size = new System.Drawing.Size(57, 13);
this.lb_rxsignal.TabIndex = 18;
this.lb_rxsignal.Text = "RX Signal:";
//
// lb_rxsync
//
this.lb_rxsync.AutoSize = true;
this.lb_rxsync.Location = new System.Drawing.Point(448, 7);
this.lb_rxsync.Name = "lb_rxsync";
this.lb_rxsync.Size = new System.Drawing.Size(52, 13);
this.lb_rxsync.TabIndex = 20;
this.lb_rxsync.Text = "RX Sync:";
//
// pn1
//
this.pn1.Controls.Add(this.progressBar_fifo);
@@ -2242,6 +2237,24 @@
this.progressBar_fifo.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.progressBar_fifo.TabIndex = 13;
//
// label_capfifo
//
this.label_capfifo.AutoSize = true;
this.label_capfifo.Location = new System.Drawing.Point(31, 54);
this.label_capfifo.Name = "label_capfifo";
this.label_capfifo.Size = new System.Drawing.Size(56, 13);
this.label_capfifo.TabIndex = 16;
this.label_capfifo.Text = "RX Buffer:";
//
// label_speed
//
this.label_speed.AutoSize = true;
this.label_speed.Location = new System.Drawing.Point(31, 5);
this.label_speed.Name = "label_speed";
this.label_speed.Size = new System.Drawing.Size(71, 13);
this.label_speed.TabIndex = 12;
this.label_speed.Text = "Speed [bit/s]:";
//
// pb_rxsignal
//
this.pb_rxsignal.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pb_rxsignal.BackgroundImage")));
@@ -2252,6 +2265,15 @@
this.pb_rxsignal.TabIndex = 17;
this.pb_rxsignal.TabStop = false;
//
// lb_rxsync
//
this.lb_rxsync.AutoSize = true;
this.lb_rxsync.Location = new System.Drawing.Point(448, 7);
this.lb_rxsync.Name = "lb_rxsync";
this.lb_rxsync.Size = new System.Drawing.Size(52, 13);
this.lb_rxsync.TabIndex = 20;
this.lb_rxsync.Text = "RX Sync:";
//
// progressBar_capfifo
//
this.progressBar_capfifo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
@@ -2262,6 +2284,37 @@
this.progressBar_capfifo.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.progressBar_capfifo.TabIndex = 15;
//
// cb_speed
//
this.cb_speed.FormattingEnabled = true;
this.cb_speed.Items.AddRange(new object[] {
"1200 BPSK BW: 1300 Hz",
"2400 BPSK BW: 2500 Hz",
"3000 QPSK BW: 1700 Hz ",
"4000 QPSK BW: 2400 Hz ",
"4410 QPSK BW: 2500 Hz (QO-100 Standard)",
"4800 QPSK BW: 2700 Hz",
"5500 8APSK BW: 2300 Hz",
"6000 8APSK BW: 2500 Hz (QO-100 Transceiver)",
"6600 8APSK BW: 2600 Hz",
"7200 8APSK BW: 2700 Hz (QO-100 SDR)",
"45.45 Baud RTTY"});
this.cb_speed.Location = new System.Drawing.Point(122, 2);
this.cb_speed.Name = "cb_speed";
this.cb_speed.Size = new System.Drawing.Size(304, 21);
this.cb_speed.TabIndex = 11;
this.cb_speed.Text = "4410 QPSK BW: 2500 Hz (QO-100)";
this.cb_speed.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// lb_rxsignal
//
this.lb_rxsignal.AutoSize = true;
this.lb_rxsignal.Location = new System.Drawing.Point(448, 54);
this.lb_rxsignal.Name = "lb_rxsignal";
this.lb_rxsignal.Size = new System.Drawing.Size(57, 13);
this.lb_rxsignal.TabIndex = 18;
this.lb_rxsignal.Text = "RX Signal:";
//
// pb_rxsync
//
this.pb_rxsync.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pb_rxsync.BackgroundImage")));
@@ -2272,6 +2325,34 @@
this.pb_rxsync.TabIndex = 19;
this.pb_rxsync.TabStop = false;
//
// label_fifo
//
this.label_fifo.AutoSize = true;
this.label_fifo.Location = new System.Drawing.Point(31, 31);
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:";
//
// panel_txspectrum
//
this.panel_txspectrum.BackColor = System.Drawing.SystemColors.ControlLight;
this.panel_txspectrum.Location = new System.Drawing.Point(92, 590);
this.panel_txspectrum.Name = "panel_txspectrum";
this.panel_txspectrum.Size = new System.Drawing.Size(442, 76);
this.panel_txspectrum.TabIndex = 6;
this.panel_txspectrum.Paint += new System.Windows.Forms.PaintEventHandler(this.panel_txspectrum_Paint);
this.panel_txspectrum.DoubleClick += new System.EventHandler(this.panel_txspectrum_DoubleClick);
//
// panel_constel
//
this.panel_constel.BackColor = System.Drawing.Color.AliceBlue;
this.panel_constel.Location = new System.Drawing.Point(11, 590);
this.panel_constel.Name = "panel_constel";
this.panel_constel.Size = new System.Drawing.Size(75, 75);
this.panel_constel.TabIndex = 5;
this.panel_constel.Paint += new System.Windows.Forms.PaintEventHandler(this.panel_constel_Paint);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -2286,7 +2367,7 @@
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Form1";
this.Text = "AMSAT-DL Multimedia HS Modem V0.72 by DJ0ABR";
this.Text = "AMSAT-DL Multimedia HS Modem V0.84 by DJ0ABR";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
@@ -2301,6 +2382,8 @@
this.tabControl1.ResumeLayout(false);
this.tabPage_file.ResumeLayout(false);
this.tabPage_file.PerformLayout();
this.groupBox8.ResumeLayout(false);
this.groupBox8.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.tabPage_audio.ResumeLayout(false);
this.groupBox7.ResumeLayout(false);
@@ -2349,9 +2432,9 @@
private System.Windows.Forms.Timer timer_udprx;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel;
private System.Windows.Forms.Panel panel_constel;
private DoubleBufferedPanel panel_constel;
private System.Windows.Forms.Timer timer_qpsk;
private System.Windows.Forms.Panel panel_txspectrum;
private DoubleBufferedPanel panel_txspectrum;
private System.Windows.Forms.TabPage tabPage_ber;
private System.Windows.Forms.Button button_stopBERtest;
private System.Windows.Forms.Button button_startBERtest;
@@ -2361,7 +2444,6 @@
private System.Windows.Forms.Button button_loadimage;
private System.Windows.Forms.Button button_cancelimg;
private System.Windows.Forms.Button button_sendimage;
private System.Windows.Forms.CheckBox checkBox_big;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label_rximage;
private System.Windows.Forms.Label label_tximage;
@@ -2369,7 +2451,7 @@
private System.Windows.Forms.PictureBox pictureBox_tximage;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.ToolStripStatusLabel ts_ip;
private System.Windows.Forms.Panel groupBox1;
private DoubleBufferedPanel groupBox1;
private System.Windows.Forms.TabPage tabPage_file;
private System.Windows.Forms.RichTextBox rtb_TXfile;
private System.Windows.Forms.Button bt_file_send;
@@ -2449,9 +2531,7 @@
private System.Windows.Forms.Label lb_rxsync;
private System.Windows.Forms.PictureBox pb_rxsync;
private System.Windows.Forms.ComboBox cb_language;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.ComboBox cb_safemode;
private KmProgressBar vu_cap;
private KmProgressBar vu_pb;
private System.Windows.Forms.ToolStripStatusLabel toolStrip_Type;
@@ -2501,8 +2581,8 @@
private System.Windows.Forms.Button bt_rxfont;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button bt_rtty_RY;
private System.Windows.Forms.Panel pn1;
private System.Windows.Forms.Panel panel1;
private DoubleBufferedPanel pn1;
private DoubleBufferedPanel panel1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button5;
@@ -2518,6 +2598,14 @@
private System.Windows.Forms.Button button6;
private System.Windows.Forms.ToolStripStatusLabel toolStrip_spacer;
private System.Windows.Forms.ToolStripStatusLabel ts_userinfo;
private System.Windows.Forms.CheckBox cb_file_loop;
private System.Windows.Forms.ComboBox cb_picres;
private System.Windows.Forms.CheckBox cb_extIF;
private System.Windows.Forms.TextBox textBox7;
private System.Windows.Forms.Button bt_open_html;
private System.Windows.Forms.GroupBox groupBox8;
private System.Windows.Forms.ComboBox cb_file_pause;
private System.Windows.Forms.Label label13;
}
}
+268 -90
View File
@@ -31,6 +31,8 @@ using System.Diagnostics;
using System.Threading;
using oscardata.Properties;
using System.Reflection;
using System.Globalization;
using System.Text.RegularExpressions;
namespace oscardata
{
@@ -50,7 +52,7 @@ namespace oscardata
int recPhase = 0;
const int Rtty_deftext_anz = 20;
String[] Rtty_deftext = new string[Rtty_deftext_anz];
DateTime dtfile = DateTime.UtcNow;
public Form1()
{
@@ -167,10 +169,10 @@ namespace oscardata
button_sendimage.Enabled = false;
}
if (TXfoldername == "" || lastFullName == "")
/*if (TXfoldername == "" || lastFullName == "")
cb_loop.Enabled = false;
else
cb_loop.Enabled = true;
cb_loop.Enabled = true;*/
ShowTXstatus();
@@ -183,7 +185,7 @@ namespace oscardata
if (ArraySend.getSending() == false)
{
// transmission is finished, wait until data in TXfifo have been sent
if (statics.PBfifousage < 2)
if (statics.PBfifousage < 4)
{
// start sending a new picture
startNextImage();
@@ -192,6 +194,29 @@ namespace oscardata
}
}
if (txcommand == statics.AsciiFile || txcommand == statics.HTMLFile || txcommand == statics.BinaryFile)
{
// if "loop" is selected send the next image in folder
if (cb_file_loop.Checked)
{
// check pause time
if(retransmitPause() == false)
{
// check if we are ready with any transmission
if (ArraySend.getSending() == false)
{
// transmission is finished, wait until data in TXfifo have been sent
if (statics.PBfifousage < 4)
{
// start sending a new picture
startNextFile();
dtfile = DateTime.UtcNow;
}
}
}
}
}
if (ts_ip.Text.Contains("?") || ts_ip.Text.Contains("1.2.3.4") || old_tsip != statics.ModemIP)
{
if (statics.ModemIP == "1.2.3.4")
@@ -251,7 +276,7 @@ namespace oscardata
if (setPBvolume >= 0)
{
Byte[] txdata = new byte[2];
txdata[0] = (Byte)statics.SetPBvolume;
txdata[0] = statics.SetPBvolume;
txdata[1] = (Byte)setPBvolume;
Udp.UdpSendCtrl(txdata);
setPBvolume = -1;
@@ -260,7 +285,7 @@ namespace oscardata
if (setCAPvolume != -1)
{
Byte[] txdata = new byte[2];
txdata[0] = (Byte)statics.SetCAPvolume;
txdata[0] = statics.SetCAPvolume;
txdata[1] = (Byte)setCAPvolume;
Udp.UdpSendCtrl(txdata);
setCAPvolume = -1;
@@ -269,7 +294,7 @@ namespace oscardata
if (setLSvolume >= 0)
{
Byte[] txdata = new byte[2];
txdata[0] = (Byte)statics.SetLSvolume;
txdata[0] = statics.SetLSvolume;
txdata[1] = (Byte)setLSvolume;
Udp.UdpSendCtrl(txdata);
setLSvolume = -1;
@@ -278,7 +303,7 @@ namespace oscardata
if (setMICvolume != -1)
{
Byte[] txdata = new byte[2];
txdata[0] = (Byte)statics.SetMICvolume;
txdata[0] = statics.SetMICvolume;
txdata[1] = (Byte)setMICvolume;
Udp.UdpSendCtrl(txdata);
setMICvolume = -1;
@@ -315,6 +340,35 @@ namespace oscardata
}
}
bool sendInProgress = false;
bool retransmitPause()
{
// check if file send is in progress
bool fstat = statics.PBfifousage > 1;
if (fstat == true)
{
// file send in progress
sendInProgress = true;
return true;
}
if(fstat == false && sendInProgress == true)
{
// just finished sending
sendInProgress = false;
dtfile = DateTime.UtcNow;
return true;
}
// not sending, wait until pause time elapsed
String s = cb_file_pause.Text;
int dur = int.Parse(Regex.Match(s, @"\d+").Value, NumberFormatInfo.InvariantInfo);
if (s.Contains("min")) dur *= 60;
TimeSpan ts = DateTime.UtcNow - dtfile;
if (ts.TotalSeconds >= dur) return false;
return true;
}
// correct entries in the Audio Device Comboboxes if devices have changed
void findDevice(ComboBox cb)
{
@@ -362,7 +416,7 @@ namespace oscardata
{
// tell hsmodem to terminate itself
Byte[] txdata = new byte[1];
txdata[0] = (Byte)statics.terminate;
txdata[0] = statics.terminate;
Udp.UdpSendCtrl(txdata);
Thread.Sleep(250);
@@ -456,8 +510,15 @@ namespace oscardata
{
// reception complete, show stored file
Console.WriteLine("load " + recfile.filename);
pictureBox_rximage.BackgroundImage = Image.FromFile(recfile.filename);
pictureBox_rximage.Invalidate();
try
{
pictureBox_rximage.BackgroundImage = Image.FromFile(recfile.filename);
pictureBox_rximage.Invalidate();
}
catch
{
// invalid picture
}
}
if (recfile.pbmp != null)
{
@@ -474,7 +535,7 @@ namespace oscardata
if (rxtype == statics.AsciiFile)
{
int fret = recfile.receive(rxd);
if (fret == 1)
if (fret >= 1)
{
// ASCII file received, show in window
String serg = File.ReadAllText(recfile.filename);
@@ -487,13 +548,15 @@ namespace oscardata
if (rxtype == statics.HTMLFile)
{
int fret = recfile.receive(rxd);
if (fret == 1)
if (fret >= 1)
{
// HTML file received, show in window
String serg = File.ReadAllText(recfile.filename);
printText(rtb_RXfile, serg);
// and show in browser
OpenUrl(recfile.filename);
// save filename
statics.lastRXedHTMLfile = recfile.filename;
// show the HTML-Show Button
bt_open_html.Visible = true;
}
if (fret == -5)
printBadBlocks();
@@ -502,7 +565,7 @@ namespace oscardata
if (rxtype == statics.BinaryFile)
{
int fret = recfile.receive(rxd);
if (fret == 1)
if (fret >= 1)
{
// Binary file received, show statistics in window
try
@@ -661,7 +724,6 @@ namespace oscardata
if (ba != null)
{
int rtty_val = ba[0];
rtty_txon = ba[1];
rtty_sync = ba[2];
if (rtty_val != 0)
{
@@ -683,7 +745,7 @@ namespace oscardata
}
}
}
if (rtty_txon == 1)
if (statics.rtty_txon == 1)
{
bt_rtty_tx.BackColor = Color.Red;
tb_rtty_TX.Enabled = true;
@@ -702,6 +764,7 @@ namespace oscardata
RTTYmousepos.X = e.X;
RTTYmousepos.Y = e.Y;
int cidx = tb_rtty_RX.GetCharIndexFromPosition(RTTYmousepos);
Console.WriteLine("cidx: " + cidx.ToString());
// get the word under this position
// text after pos
@@ -853,6 +916,7 @@ namespace oscardata
long TXRealFileSize = 0;
String TXfoldername = "";
String lastFullName = "";
String TXfullfilename = "";
// prepare an image file for transmission
void prepareImage(String fullfn)
@@ -860,10 +924,10 @@ namespace oscardata
if (statics.checkImage(fullfn) == false) return;
// all images are converted to jpg, make the new filename
TXfullfilename = fullfn;
TXfoldername = statics.purePath(fullfn);
TXRealFilename = statics.pureFilename(fullfn);
TXRealFilename = statics.AddReplaceFileExtension(TXRealFilename,"jpg");
lastFullName = fullfn;
// random filename for picturebox control (picturebox cannot reload image from actual filename)
try {
@@ -888,11 +952,13 @@ namespace oscardata
if (cb_stampcall.Checked == false) cs = "";
String inf = tb_info.Text;
if (cb_stampinfo.Checked == false) inf = "";
if (!checkBox_big.Checked)
Size picsize = getResolution();
if(picsize.Width != 0 && picsize.Height != 0)
{
img = ih.ResizeImage(img, 320, 240, cs, inf);
// set quality by reducing the file size and save under default name
ih.SaveJpgAtFileSize(img, TXimagefilename, max_size / 2);
int reduc = 640 / picsize.Width;
if (reduc < 1) reduc = 1;
img = ih.ResizeImage(img, picsize.Width, picsize.Height, cs, inf);
ih.SaveJpgAtFileSize(img, TXimagefilename, max_size/ reduc);
}
else
{
@@ -901,12 +967,31 @@ namespace oscardata
ih.SaveJpgAtFileSize(img, TXimagefilename, max_size);
}
//pictureBox_tximage.Load(TXimagefilename); this does not work under ARM mono
//pictureBox_tximage.Load(TXimagefilename); // this does not work under ARM mono
pictureBox_tximage.BackgroundImage = Image.FromFile(TXimagefilename);
TXRealFileSize = statics.GetFileSize(TXimagefilename);
ShowTXstatus();
txcommand = statics.Image;
}
Size getResolution()
{
Size sz = new Size(0,0);
String r = cb_picres.Text;
String[] ra = r.Split(new char[] { 'x' });
try
{
int w = Convert.ToInt32(ra[0]);
int h = Convert.ToInt32(ra[1]);
sz.Width = w;
sz.Height = h;
}
catch { }
return sz;
}
void ShowTXstatus()
{
@@ -952,8 +1037,51 @@ namespace oscardata
button_sendimage_Click(null, null);
}
// in loop mode only: send the next picture in current image folder
void startNextFile()
{
if (lastFullName == "") return;
// read all file from folder
String folder = Path.GetDirectoryName(lastFullName);
String[] files = Directory.GetFiles(folder);
Array.Sort(files);
int i;
bool found = false;
for (i = 0; i < files.Length; i++)
{
// look for the last transmitted file
if (files[i] == lastFullName)
{
// choose the next file
if (++i == files.Length) i = 0;
// check if the file is valid
try
{
long sz = statics.GetFileSize(files[i]);
if (sz < 1000000)
{
// do not try to send a file > 1MB
found = true;
break;
}
}
catch
{
lastFullName = files[i];
}
}
}
if (!found) return;
// files[i] is the filename to be sent
bt_prepareAndSendFile(files[i], Path.GetFileName(files[i]), statics.BinaryFile);
bt_file_send_Click(null, null);
}
private void button_loadimage_Click(object sender, EventArgs e)
{
lastFullName = "";
OpenFileDialog open = new OpenFileDialog();
open.Filter = statics.langstr[13];
if (open.ShowDialog() == DialogResult.OK)
@@ -964,6 +1092,7 @@ namespace oscardata
private void button_sendimage_Click(object sender, EventArgs e)
{
lastFullName = TXfullfilename;
txcommand = statics.Image;
rxbytecounter = 0;
pictureBox_rximage.Image = null;
@@ -1207,9 +1336,22 @@ namespace oscardata
//Console.WriteLine("BCip: " + ip);
}
}*/
// if hsmodem is local, use local IP instead of broadcast
if (cb_autostart.Checked)
{
String[] myips = statics.getOwnIPs();
if (myips.Length >= 1)
{
statics.MyIP = myips[0];
}
return statics.MyIP;
}
return ip;
}
/*
* search for the modem IP:
* send a search message via UDP to port UdpBCport
@@ -1226,69 +1368,84 @@ namespace oscardata
* 4 ... DV loudspeaker volume
* 5 ... DV mic volume
* 6 ... safe mode
* 7..9 ... unused
* 10 .. 109 ... PB device name
* 110 .. 209 ... CAP device name
* 7 ... send introduction voice record
* 8 ... rtty autosync on/off
* 9 ... hsmodem speed mode
* 10 .. external data IF on/off
* 11-19 ... unused
* 20 .. 119 ... PB device name
* 120 .. 219 ... CAP device name
* 220 .. 239 ... Callsign
* 230 .. 249 ... qthloc
* 250 .. 269 ... Name
*
*/
private void search_modem()
{
Byte safemode = 0; //number of frame repeats
if (cb_safemode.Text.Contains("medium")) safemode = 2;
else if (cb_safemode.Text.Contains("high")) safemode = 4;
Byte[] txb = new byte[270];
int idx = 0;
txb[idx++] = 0x3c; // ID of this message
txb[idx++] = (Byte)tb_PBvol.Value;
txb[idx++] = (Byte)tb_CAPvol.Value;
txb[idx++] = (Byte)cb_announcement.Items.IndexOf(cb_announcement.Text);
txb[idx++] = (Byte)tb_loadspeaker.Value;
txb[idx++] = (Byte)tb_mic.Value;
txb[idx++] = 0; // unused
txb[idx++] = (Byte)(cb_sendIntro.Checked?1:0);
txb[idx++] = (Byte)(cb_rx_autosync.Checked ? 1 : 0);
if(cb_speed.DroppedDown == false)
txb[idx++] = (Byte)cb_speed.SelectedIndex;
else
txb[idx++] = (Byte)255; // invalid, hsmodem does not use this value
txb[idx++] = (Byte)(cb_extIF.Checked ? 1 : 0);
Byte[] txb = new byte[260];
txb[0] = 0x3c; // ID of this message
txb[1] = (Byte)tb_PBvol.Value;
txb[2] = (Byte)tb_CAPvol.Value;
txb[3] = (Byte)cb_announcement.Items.IndexOf(cb_announcement.Text);
txb[4] = (Byte)tb_loadspeaker.Value;
txb[5] = (Byte)tb_mic.Value;
txb[6] = safemode;
txb[7] = (Byte)(cb_sendIntro.Checked?1:0);
txb[8] = (Byte)(cb_rx_autosync.Checked ? 1 : 0);
txb[9] = (Byte)0; // unused
Byte[] bpb = statics.StringToByteArrayUtf8(cb_audioPB.Text);
Byte[] bcap = statics.StringToByteArrayUtf8(cb_audioCAP.Text);
//Byte[] bpb = statics.StringToByteArray(cb_audioPB.Text);
//Byte[] bcap = statics.StringToByteArray(cb_audioCAP.Text);
// 200 Bytes (from 10..209) name of selected sound device
// 200 Bytes (from 20..219) name of selected sound device
for (int i=0; i<100; i++)
{
if (i >= bpb.Length)
txb[i + 10] = 0;
txb[i + 20] = 0;
else
txb[i+10] = bpb[i];
txb[i + 20] = bpb[i];
if (i >= bcap.Length)
txb[i + 110] = 0;
txb[i + 120] = 0;
else
txb[i + 110] = bcap[i];
txb[i + 120] = bcap[i];
}
// 210 .. 229 = Callsign
// 220 .. 239 = Callsign
Byte[] callarr = statics.StringToByteArray(tb_callsign.Text);
for (int i = 0; i < 20; i++)
{
if (i >= callarr.Length) txb[i+210] = 0;
else txb[i + 210] = callarr[i];
if (i >= callarr.Length)
txb[i + 220] = 0;
else
txb[i + 220] = callarr[i];
}
// 230 .. 239 = qthloc
// 240 .. 249 = qthloc
Byte[] qtharr = statics.StringToByteArray(tb_myqthloc.Text);
for (int i = 0; i < 10; i++)
{
if (i >= qtharr.Length) txb[i + 230] = 0;
else txb[i+230] = qtharr[i];
if (i >= qtharr.Length)
txb[i + 240] = 0;
else
txb[i + 240] = qtharr[i];
}
// 240 .. 259 = Name
// 250 .. 269 = Name
Byte[] namearr = statics.StringToByteArray(tb_myname.Text);
for (int i = 0; i < 20; i++)
{
if (i >= namearr.Length) txb[i+240] = 0;
else txb[i + 240] = namearr[i];
if (i >= namearr.Length)
txb[i + 250] = 0;
else
txb[i + 250] = namearr[i];
}
if (statics.ModemIP == "1.2.3.4")
@@ -1316,6 +1473,7 @@ namespace oscardata
Byte[] textarr = File.ReadAllBytes(statics.zip_TXtempfilename);
ArraySend.Send(textarr, (Byte)txcommand, TXfilename, TXRealFilename);
lastFullName = TXfilename;
}
private void bt_file_ascii_Click(object sender, EventArgs e)
@@ -1335,38 +1493,32 @@ namespace oscardata
private void bt_sendFile(String filter, int cmd)
{
lastFullName = "";
OpenFileDialog open = new OpenFileDialog();
open.Filter = filter;
if (open.ShowDialog() == DialogResult.OK)
{
txcommand = cmd;
TXfilename = open.FileName;
TXRealFilename = open.SafeFileName;
if (txcommand == statics.BinaryFile)
rtb_TXfile.Text = statics.langstr[20] + TXfilename + statics.langstr[21];
else
rtb_TXfile.Text = File.ReadAllText(TXfilename);
// compress file
ZipStorer zs = new ZipStorer();
zs.zipFile(statics.zip_TXtempfilename, open.SafeFileName, open.FileName);
TXRealFileSize = statics.GetFileSize(statics.zip_TXtempfilename);
ShowTXstatus();
bt_prepareAndSendFile(open.FileName, open.SafeFileName, cmd);
}
}
/*void removeTab(TabPage tb)
private void bt_prepareAndSendFile(String FilenameAndPath, String Filename, int txcmd)
{
if (tabControl1.TabPages.IndexOf(tb) != -1)
tabControl1.TabPages.Remove(tb);
}
txcommand = txcmd;
TXfilename = FilenameAndPath;
TXRealFilename = Filename;
if (txcommand == statics.BinaryFile)
rtb_TXfile.Text = statics.langstr[20] + TXfilename + statics.langstr[21];
else
rtb_TXfile.Text = File.ReadAllText(TXfilename);
void addTab(int idx, TabPage tb)
{
if (tabControl1.TabPages.IndexOf(tb) == -1)
tabControl1.TabPages.Insert(idx,tb);
}*/
// compress file
ZipStorer zs = new ZipStorer();
zs.zipFile(statics.zip_TXtempfilename, Filename, FilenameAndPath);
TXRealFileSize = statics.GetFileSize(statics.zip_TXtempfilename);
ShowTXstatus();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
@@ -1395,6 +1547,8 @@ namespace oscardata
removeTab(tabPage_rtty);*/
}
if (cb_speed.Text.Contains("1200")) statics.real_datarate = 1200;
if (cb_speed.Text.Contains("2400")) statics.real_datarate = 2400;
if (cb_speed.Text.Contains("3000")) statics.real_datarate = 3000;
if (cb_speed.Text.Contains("4000")) statics.real_datarate = 4000;
if (cb_speed.Text.Contains("4410")) statics.real_datarate = 4410;
@@ -1404,13 +1558,17 @@ namespace oscardata
if (cb_speed.Text.Contains("6600")) statics.real_datarate = 6600;
if (cb_speed.Text.Contains("7200")) statics.real_datarate = 7200;
Byte[] txdata = new byte[statics.PayloadLen + 2];
/*Byte[] txdata = new byte[statics.PayloadLen + 2];
int idx = cb_speed.SelectedIndex;
txdata[0] = (Byte)statics.ResamplingRate; // BER Test Marker
txdata[1] = (Byte)idx;
// and send info to modem
Udp.UdpSendCtrl(txdata);
Udp.UdpSendCtrl(txdata);*/
String s = cb_speed.Text;
txcommand = statics.noTX;
// stop any ongoing transmission
@@ -1689,10 +1847,10 @@ namespace oscardata
switch(i)
{
case 0:
Rtty_deftext[0] = "\r\n\r\nCQ CQ CQ de %m CQ CQ CQ de %m pse k k k\r\n%r"; // CQ call
Rtty_deftext[0] = "\r\n\r\nRYRYRYRYRYRYRYRYRYRY\r\nCQ CQ CQ de %m CQ CQ CQ de %m pse k k k\r\n%r"; // CQ call
break;
case 1:
Rtty_deftext[1] = "\r\n\r\n%c de %m pse k k k\r\n%r"; // answer CQ call
Rtty_deftext[1] = "\r\n\r\n%c %c de %m %m %m pse k k k\r\n%r"; // answer CQ call
break;
case 2:
Rtty_deftext[2] = "\r\n\r\n%c de %m\r\n"; // start TX
@@ -1724,7 +1882,7 @@ namespace oscardata
if (dr == DialogResult.Yes)
{
Byte[] txdata = new byte[1];
txdata[0] = (Byte)statics.Modem_shutdown;
txdata[0] = statics.Modem_shutdown;
Udp.UdpSendCtrl(txdata);
MessageBox.Show(statics.langstr[24], statics.langstr[22], MessageBoxButtons.OK);
@@ -1736,7 +1894,7 @@ namespace oscardata
private void button1_Click(object sender, EventArgs e)
{
Byte[] txdata = new byte[1];
txdata[0] = (Byte)statics.AutosendFile;
txdata[0] = statics.AutosendFile;
// and transmit it
Udp.UdpSendCtrl(txdata);
@@ -1745,7 +1903,7 @@ namespace oscardata
private void bt_resetmodem_Click(object sender, EventArgs e)
{
Byte[] txdata = new byte[1];
txdata[0] = (Byte)statics.ResetModem;
txdata[0] = statics.ResetModem;
// and transmit it
Udp.UdpSendCtrl(txdata);
@@ -2019,7 +2177,6 @@ namespace oscardata
cb_sendIntro.Text = "send introduction before TX";
tb_recintro.Text = "record introduction";
lb_tuningqrgs.Text = "Send Marker Frequency:";
label13.Text = "Data Security:";
textBox5.Text = "Click on Callsign or Name in RX window";
textBox2.Text = @"Special Markers:
%m... my call
@@ -2043,6 +2200,11 @@ namespace oscardata
bt_rtty_myinfo.Text = "My Info";
bt_rtty_station.Text = "My Station";
textBox6.Text = "or double click in spectrum";
textBox7.Text = "for advanced users only, see developers manual";
bt_open_html.Text = "Open received " + Environment.NewLine + "HTML file";
groupBox8.Text = "Send all files in folder";
cb_file_loop.Text = "ON / off";
label13.Text = "Pause between files";
}
if (language == 1)
@@ -2098,7 +2260,6 @@ namespace oscardata
cb_sendIntro.Text = "sende Vorstellung vor TX";
tb_recintro.Text = "Vorstellung aufnehmen";
lb_tuningqrgs.Text = "Sende Frequenzmarkierung:";
label13.Text = "Datensicherheit:";
textBox5.Text = "Klicke auf Rufzeichen und Namen im RX Fenster";
textBox2.Text = @"Spezialzeichen:
%m... mein Rufzeichen
@@ -2122,6 +2283,11 @@ namespace oscardata
bt_rtty_myinfo.Text = "Meine Info";
bt_rtty_station.Text = "Meine Station";
textBox6.Text = "oder Doppelklick in Spektrum";
textBox7.Text = "nur für spezielle Nutzer, siehe Entwickler - Dokumentation";
bt_open_html.Text = "Öffne empfangene" + Environment.NewLine + "HTML Datei";
groupBox8.Text = "TX alle Dateien im Verz.";
cb_file_loop.Text = "EIN / aus";
label13.Text = "Pause zwischen Dateien";
}
}
@@ -2488,13 +2654,12 @@ namespace oscardata
ShowRTTYtext(selected_rtty_deftext, 0);
}
int rtty_txon = 0;
int rtty_sync = 0;
private void bt_rtty_tx_Click(object sender, EventArgs e)
{
Byte[] txdata = new byte[2];
txdata[0] = statics.txonoff;
txdata[1] = (Byte)((rtty_txon==1)?0:1);
txdata[1] = (Byte)((statics.rtty_txon==1)?0:1);
Udp.UdpSendCtrl(txdata);
}
@@ -2592,5 +2757,18 @@ namespace oscardata
{
ShowRTTYtext(13);
}
private void cb_extIF_CheckedChanged(object sender, EventArgs e)
{
statics.extData = (Byte)(cb_extIF.Checked?1:0);
}
private void bt_open_html_Click(object sender, EventArgs e)
{
if(statics.lastRXedHTMLfile.Length > 4)
OpenUrl(statics.lastRXedHTMLfile);
}
}
class DoubleBufferedPanel : Panel { public DoubleBufferedPanel() : base() { DoubleBuffered = true; } }
}
+6 -2
View File
@@ -137,7 +137,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA+
JQAAAk1TRnQBSQFMAgEBFwEAAdgBDAHYAQwBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
JQAAAk1TRnQBSQFMAgEBFwEAAcgBDQHIAQ0BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAAWADAAEBAQABCAYAARgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -5297,10 +5297,14 @@ GNU General Public License
FreeDV: https://github.com/drowe67/codec2
GNU Lesser General Public License v2.1
Sound Library: libsoundio
Sound Library Linux: libsoundio
https://github.com/andrewrk/libsoundio
MIT License
Sound Library Windows: Portaudio
https://github.com/PortAudio/portaudio
https://github.com/PortAudio/portaudio/blob/master/LICENSE.txt
Reed Solomon error correction:
https://www.schifra.com/
License: Schifra User Group 1, GPL V2
Binary file not shown.
+5 -1
View File
@@ -24,9 +24,10 @@ namespace oscardata
public static Byte BinaryFile = 5;
public static Byte Audio = 6;
public static Byte Userinfo = 7;
public static Byte ExternalDate = 8; // data from ext. application
// the upper values are for internal use
public static Byte ResamplingRate = 16;
public static Byte BulletinFile = 16;
public static Byte AutosendFile = 17;
public static Byte AutosendFolder = 18;
public static Byte Modem_shutdown = 19;
@@ -92,6 +93,9 @@ namespace oscardata
public static String[] langstr;
public static int tuning_active = 0;
public static int tune_frequency = 1500;
public static int rtty_txon = 0;
public static Byte extData = 0;
public static String lastRXedHTMLfile = "";
public static String[] getOwnIPs()
{
+47 -10
View File
@@ -81,6 +81,7 @@ namespace oscardata
bool autoRXnum = false;
String blockFilename = "";
// 2 ... file OK, file already exist
// 1 ... file OK
// 0 ... continue receiving
// -1 ... invalid header
@@ -154,9 +155,10 @@ namespace oscardata
if (rxtype == statics.AsciiFile || rxtype == statics.HTMLFile || rxtype == statics.BinaryFile)
{
// these file type must be unzipped
handleZIPfiles();
int r = 1;
if (handleZIPfiles() == 1) r = 2;
receiving = false;
return 1;
return r;
}
}
@@ -429,7 +431,7 @@ namespace oscardata
bool SaveFile()
{
Console.WriteLine("save file");
//Console.WriteLine("save file");
// check if all blocks ok
for (int i = 0; i <= blockidx; i++)
@@ -450,7 +452,7 @@ namespace oscardata
// make filename
filename = makeRXfilename();
Console.WriteLine("save at " + filename);
//Console.WriteLine("save at " + filename);
try
{
@@ -513,12 +515,18 @@ namespace oscardata
return bmp;
}
void handleZIPfiles()
// returns:
// -1 ... error
// 0 ... ok
// 1 ... ok, but file exists already
int handleZIPfiles()
{
int ret = -1;
if (filename == null)
{
Console.WriteLine("handleZIPfile: no filename");
return;
return ret;
}
try
@@ -530,7 +538,7 @@ namespace oscardata
if (fc.Length < ArraySend.FileSize)
{
Console.WriteLine("file not complete: got len=" + fc.Length + " expected len=" + ArraySend.FileSize);
return;
return ret;
}
Array.Copy(fc, 0, fdst, 0, ArraySend.FileSize);
File.WriteAllBytes(statics.zip_RXtempfilename, fdst); // the received file (still zipped) is here
@@ -541,19 +549,28 @@ namespace oscardata
if (fl != null)
{
// save file
ret = 0;
// fl is the filename of the file inside the zip file, so the originally zipped file
// remove path to get just the filename
int idx = fl.LastIndexOf('/');
if (idx == -1) idx = fl.LastIndexOf('\\');
String fdest = fl.Substring(idx + 1);
fdest = statics.getHomePath("", fdest);
// fdest is the file in the oscardata's user home directoty
// remove old file with same name
try { statics.FileDelete(fdest); } catch { }
// fdest is the file in the oscardata's user home directory
// check if file already exists
if (File.Exists(fdest))
{
ret = 1;
// remove old file with same name
try { statics.FileDelete(fdest); } catch { }
}
// move the unzipped file to the final location
File.Move(fl, fdest);
filesize = statics.GetFileSize(fdest);
StatusText = "unzip OK";
sendBulletin(fdest);
}
else
StatusText = "unzip failed";
@@ -564,6 +581,26 @@ namespace oscardata
{
StatusText = "unzip failed";
}
return ret;
}
// send a bulletin file to hsmodem
// which sends it via websocket to a browser
void sendBulletin(String fn)
{
if (Path.GetExtension(fn) != ".blt") return; // no bulletin, ignore
String s = File.ReadAllText(fn);
Byte[] tarr = statics.StringToByteArrayUtf8(s);
Byte[] tsend = new byte[tarr.Length + 1];
tsend[0] = statics.BulletinFile;
for (int i = 0; i < tarr.Length; i++)
tsend[i + 1] = tarr[i];
Udp.UdpSendCtrl(tsend);
}
}
}
+18 -8
View File
@@ -158,6 +158,7 @@ namespace oscardata
statics.tune_frequency = b[idx++];
statics.tune_frequency <<= 8;
statics.tune_frequency += b[idx++];
statics.rtty_txon = b[idx++];
//Console.WriteLine("f:" + statics.tune_frequency);
Byte[] b1 = new byte[b.Length - idx];
Array.Copy(b, idx, b1, 0, b1.Length);
@@ -278,8 +279,8 @@ namespace oscardata
static int fftw = 410, ffth = 72;
static Bitmap bmskala = new Bitmap(fftw,ffth);
static bool bmf = false;
static Font fnt = new Font("Verdana", 9.0f);
static Font smallfnt = new Font("Verdana", 7.0f);
static Font fnt = new Font("Verdana", 10.0f);
static Font smallfnt = new Font("Verdana", 8.0f);
static Pen penyl = new Pen(Brushes.Yellow, 1);
static Pen pengn = new Pen(Brushes.LightGreen, 3);
@@ -294,6 +295,7 @@ namespace oscardata
bmf = true;
Pen pen = new Pen(Brushes.Navy, 1);
Pen pensolid = new Pen(Brushes.Navy, 1);
Pen pensolidwhite = new Pen(Brushes.White, 1);
pen.DashPattern = new float[] { 1.0F, 2.0F, 1.0F, 2.0F };
Pen penred = new Pen(Brushes.Red, 1);
Pen penred2 = new Pen(Brushes.Red, 2);
@@ -306,20 +308,28 @@ namespace oscardata
for (int x = 10; x <= 390; x += 10)
gr.DrawLine(pen, x, yl, x, yh);
gr.DrawLine(penred2, 11, yl, 10, yh);
gr.DrawLine(penred2, 11, yl, 11, yh);
gr.DrawLine(penred, 150, yl, 150, yh);
gr.DrawLine(pensolid, 20, yl, 20, yh);
gr.DrawLine(pensolid, 280, yl, 280, yh);
gr.DrawLine(pensolid, 360, yl, 360, yh);
gr.DrawLine(pensolidwhite, 11, 12, 11,20);
gr.DrawLine(pensolidwhite, 150, yl + 2, 150, yl + 7);
gr.DrawLine(pensolidwhite, 20, yl + 2, 20, yl + 7);
gr.DrawLine(pensolidwhite, 280, yl + 2, 280, yl + 7);
gr.DrawLine(pensolidwhite, 360, yl+2, 360, yl+7);
gr.DrawRectangle(penred, 15, yh, 270, yl-yh);
gr.DrawString("200", smallfnt, Brushes.Black, 8, yl);
gr.DrawString("1500", smallfnt, Brushes.Black, 135, yl);
gr.DrawString("2800", smallfnt, Brushes.Black, 265, yl);
gr.DrawString("3600", smallfnt, Brushes.Black, 345, yl);
gr.DrawString("200", smallfnt, Brushes.DarkBlue, 8, yl+7);
gr.DrawString("1500", smallfnt, Brushes.DarkBlue, 135, yl + 7);
gr.DrawString("2800", smallfnt, Brushes.DarkBlue, 267, yl + 7);
gr.DrawString("3600", smallfnt, Brushes.DarkBlue, 345, yl + 7);
gr.DrawString(statics.langstr[8], fnt, Brushes.Black, 100, 0);
gr.DrawString(statics.langstr[8], fnt, Brushes.White, 100, 0);
gr.DrawString("Ref", smallfnt, Brushes.LightCoral, 1, 0);
}
bmskala.MakeTransparent(Color.White);