This commit is contained in:
Kurt
2021-01-18 15:36:29 +01:00
parent 46faf838bc
commit 43cea876bb
34 changed files with 335 additions and 1977 deletions
+22 -2
View File
@@ -37,6 +37,8 @@
this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.ts_ip = new System.Windows.Forms.ToolStripStatusLabel();
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();
@@ -253,7 +255,9 @@
this.toolStrip_Type,
this.toolStripStatusLabel,
this.ts_ip,
this.RXstatus});
this.RXstatus,
this.toolStrip_spacer,
this.ts_userinfo});
this.statusStrip1.Location = new System.Drawing.Point(0, 671);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(1296, 22);
@@ -286,6 +290,20 @@
this.RXstatus.Size = new System.Drawing.Size(58, 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.Spring = true;
//
// ts_userinfo
//
this.ts_userinfo.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
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;
@@ -2268,7 +2286,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.71 by DJ0ABR";
this.Text = "AMSAT-DL Multimedia HS Modem V0.72 by DJ0ABR";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
@@ -2498,6 +2516,8 @@
private System.Windows.Forms.CheckBox cb_rx_autosync;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.ToolStripStatusLabel toolStrip_spacer;
private System.Windows.Forms.ToolStripStatusLabel ts_userinfo;
}
}
+48 -18
View File
@@ -44,8 +44,8 @@ namespace oscardata
String old_tsip = "";
bool modemrunning = false;
receivefile recfile = new receivefile();
int last_initAudioStatus;
int last_initVoiceStatus;
int last_initAudioStatus = -1;
int last_initVoiceStatus = -1;
int recordStatus = 0;
int recPhase = 0;
const int Rtty_deftext_anz = 20;
@@ -220,8 +220,8 @@ namespace oscardata
{
if (s.Length > 1)
{
cb_audioPB.Items.Add(s.Substring(1));
cb_loudspeaker.Items.Add(s.Substring(1));
cb_audioPB.Items.Add(s);
cb_loudspeaker.Items.Add(s);
}
}
cb_loudspeaker.EndUpdate();
@@ -238,8 +238,8 @@ namespace oscardata
{
if (s.Length > 1)
{
cb_audioCAP.Items.Add(s.Substring(1));
cb_mic.Items.Add(s.Substring(1));
cb_audioCAP.Items.Add(s);
cb_mic.Items.Add(s);
}
}
cb_mic.EndUpdate();
@@ -315,21 +315,17 @@ namespace oscardata
}
}
// correct entries in the Audio Device Comboboxes if Devices have changed
// correct entries in the Audio Device Comboboxes if devices have changed
void findDevice(ComboBox cb)
{
int pos = -1;
if (cb.Text.Length >= 4)
{
// Device Name starts at Index 3 in the string
String dn = cb.Text.Substring(3);
int anz = cb.Items.Count;
for (int i = 0; i < anz; i++)
{
String name = cb.Items[i].ToString();
name = name.Substring(3);
if (dn == name)
if (cb.Text == cb.Items[i].ToString())
{
pos = i;
break;
@@ -349,7 +345,6 @@ namespace oscardata
cb.Text = cb.Items[pos].ToString();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
save_Setup();
@@ -443,6 +438,14 @@ namespace oscardata
//Console.WriteLine("minfo:" + minfo + " data:" + rxdata[0].ToString("X2") + " " + rxdata[1].ToString("X2"));
if (rxtype == statics.Userinfo)
{
String call = statics.ByteArrayToString(rxdata, 0, 20);
String qthloc = statics.ByteArrayToString(rxdata, 20, 10);
String name = statics.ByteArrayToString(rxdata, 30, 20);
ts_userinfo.Text = call + " " + name + " " + qthloc;
}
// ========= receive file ==========
// handle file receive
if (rxtype == statics.Image)
@@ -1181,13 +1184,17 @@ namespace oscardata
public String GetMyBroadcastIP()
{
String ip = "255.255.255.255";
/*
// selective BCs fail if the computer has multiple IPs
// therefore use 255.255.255.255
String[] myips = statics.getOwnIPs();
//Console.WriteLine("BClen: " + myips.Length.ToString());
Console.WriteLine("BClen: " + myips.Length.ToString());
// if PC has multiple IPs then use 255.255.255.255
/*for (int i = 0; i < myips.Length; i++)
for (int i = 0; i < myips.Length; i++)
{
Console.WriteLine("ip:" + myips[i]);
}*/
}
if (myips.Length >= 1)
{
statics.MyIP = myips[0];
@@ -1199,7 +1206,7 @@ namespace oscardata
ip += ".255";
//Console.WriteLine("BCip: " + ip);
}
}
}*/
return ip;
}
@@ -1231,7 +1238,7 @@ namespace oscardata
if (cb_safemode.Text.Contains("medium")) safemode = 2;
else if (cb_safemode.Text.Contains("high")) safemode = 4;
Byte[] txb = new byte[210];
Byte[] txb = new byte[260];
txb[0] = 0x3c; // ID of this message
txb[1] = (Byte)tb_PBvol.Value;
txb[2] = (Byte)tb_CAPvol.Value;
@@ -1248,6 +1255,7 @@ namespace oscardata
//Byte[] bpb = statics.StringToByteArray(cb_audioPB.Text);
//Byte[] bcap = statics.StringToByteArray(cb_audioCAP.Text);
// 200 Bytes (from 10..209) name of selected sound device
for (int i=0; i<100; i++)
{
if (i >= bpb.Length)
@@ -1261,6 +1269,28 @@ namespace oscardata
txb[i + 110] = bcap[i];
}
// 210 .. 229 = 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];
}
// 230 .. 239 = 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];
}
// 240 .. 259 = 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 (statics.ModemIP == "1.2.3.4")
{
// still searching a modem
+1 -1
View File
@@ -137,7 +137,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA+
JQAAAk1TRnQBSQFMAgEBFwEAAaABDAGgAQwBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
JQAAAk1TRnQBSQFMAgEBFwEAAdgBDAHYAQwBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAAWADAAEBAQABCAYAARgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
+1 -6
View File
@@ -1,12 +1,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace oscardata
{
class KmProgressBar : ProgressBar
Binary file not shown.
+18
View File
@@ -23,6 +23,7 @@ namespace oscardata
public static Byte HTMLFile = 4;
public static Byte BinaryFile = 5;
public static Byte Audio = 6;
public static Byte Userinfo = 7;
// the upper values are for internal use
public static Byte ResamplingRate = 16;
@@ -185,6 +186,23 @@ namespace oscardata
return enc.GetString(ban);
}
public static string ByteArrayToString(byte[] arr, int offset, int length)
{
Byte[] ba = new byte[arr.Length];
int dst = 0;
for (int i = 0; i < length; i++)
{
if (i >= arr.Length) break;
if (arr[i+ offset] != 0) ba[dst++] = arr[i+ offset];
}
Byte[] ban = new byte[dst];
Array.Copy(ba, ban, dst);
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
return enc.GetString(ban);
}
public static string ByteArrayToStringUtf8(byte[] arr, int offset = 0)
{
Byte[] ba = new byte[arr.Length];
+18 -12
View File
@@ -123,8 +123,13 @@ namespace oscardata
searchtimeout = 0;
// message b contains audio devices and init status
//String s = statics.ByteArrayToString(b,0);
String s = statics.ByteArrayToStringUtf8(b, 0);
statics.initAudioStatus = (b[0] == '1') ? 2 : 0;
statics.initAudioStatus |= (b[1] == '1') ? 1 : 0;
statics.initVoiceStatus = (b[2] == '1') ? 2 : 0;
statics.initVoiceStatus |= (b[3] == '1') ? 1 : 0;
//String s = statics.ByteArrayToString(b,4);
String s = statics.ByteArrayToStringUtf8(b, 4);
String[] sa1 = s.Split(new char[] { '^' });
statics.AudioPBdevs = sa1[0].Split(new char[] { '~' });
statics.AudioCAPdevs = sa1[1].Split(new char[] { '~' });
@@ -143,18 +148,19 @@ namespace oscardata
// FFT data
if (rxtype == statics.udp_fft)
{
statics.PBfifousage = b[0];
statics.CAPfifousage = b[1];
statics.RXlevelDetected = b[2];
statics.RXinSync = b[3];
statics.maxRXlevel = b[4];
statics.maxTXlevel = b[5];
statics.tune_frequency = b[6];
int idx = 0;
statics.PBfifousage = b[idx++];
statics.CAPfifousage = b[idx++];
statics.RXlevelDetected = b[idx++];
statics.RXinSync = b[idx++];
statics.maxRXlevel = b[idx++];
statics.maxTXlevel = b[idx++];
statics.tune_frequency = b[idx++];
statics.tune_frequency <<= 8;
statics.tune_frequency += b[7];
statics.tune_frequency += b[idx++];
//Console.WriteLine("f:" + statics.tune_frequency);
Byte[] b1 = new byte[b.Length - 6];
Array.Copy(b, 6, b1, 0, b1.Length);
Byte[] b1 = new byte[b.Length - idx];
Array.Copy(b, idx, b1, 0, b1.Length);
drawFftBitmap(b1);
}