This commit is contained in:
Kurt Moraw 2020-11-24 16:07:52 +01:00
parent 13fc720d65
commit e6fb6550e0
79 changed files with 309 additions and 157 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,47 +0,0 @@
HSmodem Windows 10
==================
* das ZIP entpacken
* in diesem Verzeichnis sind dann zwei exe Dateien und eibige DLLS
* oscardata.exe starten
dabei startet im Hintergrund das hsmodem. Vorerst geht dafür noch eine Konsole auf, wo man Meldungen ablesen kann die evt während der Entwicklung wichtig sind.
Einstellung der Soundkarte:
---------------------------
ins Setup Fenster gehen und das virtuelle Audiokabel for Playback (das geht dann zur SDR Console auf die TX Seite)
und das Record Audiokabel (das kommt von der SDR Konsole von der RX Seite).
Senden von Testdaten:
---------------------
* für den ersten Test unten Speed: 3000 einstellen.
* ins Fenster BER Test gehen
* Start drücken
ist das Playback-Audiokabel ordentlich initialisiert, so wird der TX Buffer Balken Aktivität zeigen, und Daten gehen zum Audikabel raus.
SDR Konsole:
------------
Auf der TX Seite das Audiokabel wählen und alles was Filtert ausschalten (kein Proc usw). Bandbreite hab ich mal auf 5kHz ESSB gestellt, wobei ich in der Konfig die untere Grenze von 100 auf 0 heruntergesetzt habe. Ob das notwendig ist wird man sehen.
TX drücken und mit Gain so einstellen dass der ALC Balken nicht ins rote geht. Die Ausgangsleistung mit Drive einstellen.
RX Seite: USB und auch alles was filtern könnte ausschalten, wobei da bei mir nichts zu machen war. Das Audiokabel auswählen.
Wenn alles geht und der Pluto Rauschen empfängt, dann müßten in oscardata schon die Konstellationspunkte rauschen.
Jetzt in der sdr Konsole TX aktivieren, und man sollte sich zurückhören.
Frequenzeinstellung:
--------------------
Bei mir ist meist eine Abweichung von ca. 50 Hz einzustellen. Solange man noch falsch ist, ist das Konstellationsdiagramm ein Kreis oder pulsiert.
Achtung: ich hab das anfangs nicht hinbekommen, weil ich vergessen hatte die SyncRX SyncTX auszuschalten. Immer wenn ich RX korrigiert hatte hat die SDR Console den TX nachgezogen :-) Nach Ausschalten vom Sync RX/TX war der korrekte Empfang schnell gefunden.
ACHTUNG WINDOWS VERSION:
========================
es gibt noch irgendwo einen Datenstau den ich die nächsten Tage suchen muss. Nach einigem guten Empfang der Testdaten steckt der Empfang einen Moment fest wodurch Daten verloren gehen. Solange ich das nicht korrigiert habe macht es keinen Sinn Bilder zu senden. Die Linuxversion macht das nicht.
Geschwindigkeit:
================
Beim IC9700 ist bei 6000 bit/s Schluss. Mit der SDR Konsole gehen auch die vollen 7200 bit/s, vorausgesetzt die Frequenz ist sauber eingestellt.

View File

@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.30517.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hsmodem", "hsmodem\hsmodem.vcxproj", "{E6292FAA-E794-4107-BD89-2310BCDBC858}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "oscardata", "oscardata\oscardata\oscardata.csproj", "{989BF5C6-36F6-4158-9FB2-42E86D2020DB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
64bit|Any CPU = 64bit|Any CPU
@ -44,6 +46,30 @@ Global
{E6292FAA-E794-4107-BD89-2310BCDBC858}.Release|Win32.Build.0 = Release|Win32
{E6292FAA-E794-4107-BD89-2310BCDBC858}.Release|x64.ActiveCfg = Release|x64
{E6292FAA-E794-4107-BD89-2310BCDBC858}.Release|x64.Build.0 = Release|x64
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.64bit|Any CPU.ActiveCfg = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.64bit|Any CPU.Build.0 = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.64bit|Mixed Platforms.ActiveCfg = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.64bit|Mixed Platforms.Build.0 = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.64bit|Win32.ActiveCfg = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.64bit|Win32.Build.0 = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.64bit|x64.ActiveCfg = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.64bit|x64.Build.0 = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Debug|Win32.ActiveCfg = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Debug|Win32.Build.0 = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Debug|x64.ActiveCfg = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Debug|x64.Build.0 = Debug|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Release|Any CPU.Build.0 = Release|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Release|Win32.ActiveCfg = Release|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Release|Win32.Build.0 = Release|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Release|x64.ActiveCfg = Release|Any CPU
{989BF5C6-36F6-4158-9FB2-42E86D2020DB}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -49,6 +49,8 @@ HSTREAM stream = 0;
int openpbdev = -1;
int opencapdev = -1;
float softwareCAPvolume = 0.5;
void showDeviceInfo(BASS_DEVICEINFO info)
{
printf("Name:%s driver:%s flags:%d:", info.name, info.driver,info.flags);
@ -377,16 +379,28 @@ int ret = 0;
}
#ifdef _LINUX_
void selectPBdevice()
int selectPBdevice()
{
if (!BASS_SetDevice(openpbdev))
{
printf("BASS_SetDevice: %d err:%d\n", openpbdev, BASS_ErrorGetCode());
}
else
return 1;
return 0;
}
void selectCAPdevice()
int selectCAPdevice()
{
if (!BASS_SetDevice(opencapdev))
printf("BASS_SetDevice: %d err:%d\n", opencapdev, BASS_ErrorGetCode());
{
//printf("BASS_SetDevice: %d err:%d\n", opencapdev, BASS_ErrorGetCode());
}
else
return 1;
return 0;
}
void close_audio()
@ -416,9 +430,9 @@ void setPBvolume(int v)
//printf("set PB volume to:%d / %f [0..1]\n", v, vf );
selectPBdevice();
if (!BASS_SetVolume(vf))
printf("setPBvolume: %d err:%d\n", openpbdev, BASS_ErrorGetCode());
if(selectPBdevice())
if (!BASS_SetVolume(vf))
printf("setPBvolume: %d err:%d\n", openpbdev, BASS_ErrorGetCode());
}
void setCAPvolume(int v)
@ -430,9 +444,18 @@ void setCAPvolume(int v)
//printf("set CAP volume to:%d / %f [0..1]\n", v, vf);
selectCAPdevice();
if (!BASS_RecordSetInput(-1,BASS_INPUT_ON,vf))
printf("setCAPvolume: %d err:%d\n", opencapdev, BASS_ErrorGetCode());
if (selectCAPdevice())
{
if (!BASS_RecordSetInput(-1, BASS_INPUT_ON, vf))
printf("setCAPvolume: %d err:%d\n", opencapdev, BASS_ErrorGetCode());
else
softwareCAPvolume = 1;
}
else
{
softwareCAPvolume = (float)v;
softwareCAPvolume /= 50;
}
}
// capture callback
@ -588,7 +611,6 @@ int cap_fifo_usedPercent()
int fs = cap_fifo_freespace();
int used = AUDIO_CAPTURE_BUFLEN - fs;
used = (used * 100) / AUDIO_CAPTURE_BUFLEN;
if (used < 5) printf("used:%d\n", used);
return used;
}

View File

@ -44,10 +44,6 @@ float maxCAPvol = 99;
extern int openpbdev;
extern int opencapdev;
float softwareCAPvolume = 0.5;
int init_wasapi(int pbdev, int capdev)
{
int ret = 0;

Binary file not shown.

View File

@ -39,8 +39,11 @@ fftw_plan plan = NULL;
int fftidx = 0;
int fftcnt = fft_rate/2+1; // number of output values
uint16_t fftout[FFT_AUDIOSAMPLERATE / 10/2+1];
float f_fftout[FFT_AUDIOSAMPLERATE / 10 / 2 + 1];
int downsamp = 0;
int downphase = 0;
int rxlevel_deteced = 0;
int rx_in_sync = 0;
uint16_t *make_waterfall(float fre, int *retlen)
{
@ -50,9 +53,8 @@ uint16_t *make_waterfall(float fre, int *retlen)
// caprate 44,1k: downsample by 5,5
if (caprate == 48000)
{
if (++downsamp < 6) return NULL;
}
if (caprate == 44100)
{
if (downphase <= 1100)
@ -76,7 +78,7 @@ uint16_t *make_waterfall(float fre, int *retlen)
if(fftidx == fft_rate)
{
fftidx = 0;
// the fft buffer is full, execute the FFT
fftw_execute(plan);
@ -88,9 +90,49 @@ uint16_t *make_waterfall(float fre, int *retlen)
float mag = sqrt((fre * fre) + (fim * fim));
fftout[j] = (uint16_t)mag;
f_fftout[j] = mag;
fftrdy = 1;
}
// signal detection
// measure level at band edges
float edgelevel = 0;
for (int e = 0; e < 10; e++)
edgelevel += f_fftout[e];
for (int e = 390; e < fftcnt; e++)
edgelevel += f_fftout[e];
edgelevel /= 20;
// measure level at mid band
float midlevel = 0;
for (int e = 100; e < 300; e++)
midlevel += f_fftout[e];
midlevel /= 20;
//calc difference in %
int idiff = (int)((edgelevel * 100) / midlevel);
//printf("diff:%d %% edge:%10.6f midband:%10.6f\n", ldiff, idiff,edgelevel, midlevel);
// IC9700 ... noise makes about 5% idiff
// Signal makes 0-2%, so we take the decision at 3%
const int maxchecks = 3;
static int rxstat = 0;
if (idiff < 3)
{
if (rxstat == maxchecks)
{
printf("===>>> level detected, reset modem\n");
trigger_resetmodem = 1;
rxlevel_deteced = 1;
}
if(rxstat <= maxchecks) rxstat++;
}
else
{
rxstat = 0;
rxlevel_deteced = 0;
}
}
if(fftrdy == 1)

View File

@ -28,6 +28,9 @@
* it can be compiled under Linux: make
* and under Windows: Visual-Studio
*
* !!! compile x86 (32bit) version !!! all supplied dlls are 32 bit !!!
* ====================================================================
*
* 3rd party libraries:
* 1) BASS Audio from https://www.un4seen.com/
copy bass.h and bass.lib into source directory
@ -92,6 +95,7 @@ char ownfilename[] = { "hsmodem" };
char appIP[20] = { 0 };
int fixappIP = 0;
int restart_modems = 0;
int trigger_resetmodem = 0;
int caprate = 44100;
int txinterpolfactor = 20;
@ -239,11 +243,12 @@ int main(int argc, char* argv[])
}
int dret = demodulator();
#ifdef _LINUX_
if(dret == 0)
usleep(1);
#endif
if (dret == 0)
{
// no new data in fifo
// not important how long to sleep, 10ms is fine
sleep_ms(10);
}
}
printf("stopped: %d\n", keeprunning);
@ -411,8 +416,10 @@ void appdata_rxdata(uint8_t* pdata, int len, struct sockaddr_in* rxsock)
if (type == 19)
{
// shut down this modem PC
#ifdef _LINUX_
int r = system("sudo shutdown now");
exit(r);
#endif
}
if (type == 20)
@ -545,19 +552,27 @@ void GRdata_rxdata(uint8_t* pdata, int len, struct sockaddr_in* rxsock)
toCodecDecoder(pl + 10, PAYLOADLEN);
}
fnd = 0;
trigger_resetmodem = 0;
rx_in_sync = 1;
}
else
{
// no frame found
// if longer ws seconds nothing found, reset liquid RX modem
// comes here with symbol rate, i.e. 4000 S/s
int ws = 4;
int ws = 5;
int wt = sr[speedmode].audio / sr[speedmode].tx;
if (++fnd >= (wt * ws))
if (++fnd >= (wt * ws) || trigger_resetmodem)
{
fnd = 0;
trigger_resetmodem = 0;
rx_in_sync = 0;
printf("no signal detected %d, reset RX modem\n", wt);
resetModem();
}
else if (fnd >= wt)
{
rx_in_sync = 0;
}
}
}

View File

@ -215,7 +215,9 @@ extern int init_voice_result;
extern int initialLSvol;
extern int initialMICvol;
extern int codec;
extern int trigger_resetmodem;
extern int rxlevel_deteced;
extern int rx_in_sync;
// audio device description table
typedef struct {

View File

@ -124,12 +124,13 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>wsock32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/NODEFAULTLIB:libcmt.lib %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

View File

@ -198,6 +198,7 @@ void modulator(uint8_t sym_in)
while(1)
{
fs = pb_fifo_freespace(0);
// wait until there is space in fifo
if(fs) break;
sleep_ms(10);
}
@ -287,6 +288,9 @@ void make_FFTdata(float f)
if (us > 255) us = 255;
txpl[bidx++] = us; // usage of TX fifo
txpl[bidx++] = rxlevel_deteced; // RX level present
txpl[bidx++] = rx_in_sync;
for (int i = 0; i < fftlen; i++)
{
txpl[bidx++] = fft[i] >> 8;
@ -339,9 +343,7 @@ static int ccol_idx = 0;
// input volume
#ifdef _WIN32_
f *= softwareCAPvolume;
#endif
getMax(f);
@ -393,7 +395,7 @@ static int ccol_idx = 0;
// we have about 2000 S/s, but this many points would make the GUI slow
// so we send only every x
static int ev = 0;
if (++ev >= 2)
if (++ev >= 10)
{
ev = 0;
uint32_t re = (uint32_t)(syms.real * 16777216.0);

View File

@ -90,8 +90,18 @@ void closeAllandTerminate()
// close liquid-SDR
close_dsp();
// close network sockets
#ifdef _LINUX_
close(BC_sock_AppToModem);
#endif
#ifdef _WIN32_
closesocket(BC_sock_AppToModem);
#endif
#ifdef _LINUX_
close(DATA_sock_AppToModem);
#endif
#ifdef _WIN32_
closesocket(DATA_sock_AppToModem);
#endif
exit(0);
}

View File

@ -104,7 +104,6 @@
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.tabPage4 = new System.Windows.Forms.TabPage();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.cb_speed = new System.Windows.Forms.ComboBox();
@ -113,6 +112,12 @@
this.progressBar_fifo = new System.Windows.Forms.ProgressBar();
this.label_fifo = new System.Windows.Forms.Label();
this.bt_blockinfo = new System.Windows.Forms.Button();
this.progressBar_capfifo = new System.Windows.Forms.ProgressBar();
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.pb_rxsync = new System.Windows.Forms.PictureBox();
this.pb_rxsignal = new System.Windows.Forms.PictureBox();
this.bt_rximages = new System.Windows.Forms.Button();
this.button_loadimage = new System.Windows.Forms.Button();
this.button_cancelimg = new System.Windows.Forms.Button();
@ -134,8 +139,6 @@
this.button_startBERtest = new System.Windows.Forms.Button();
this.pb_audioCAPstatus = new System.Windows.Forms.PictureBox();
this.pb_audioPBstatus = new System.Windows.Forms.PictureBox();
this.progressBar_capfifo = new System.Windows.Forms.ProgressBar();
this.label_capfifo = new System.Windows.Forms.Label();
this.statusStrip1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
@ -155,6 +158,8 @@
((System.ComponentModel.ISupportInitialize)(this.tb_PBvol)).BeginInit();
this.groupBox2.SuspendLayout();
this.tabPage4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pb_rxsync)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pb_rxsignal)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_rximage)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_tximage)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@ -882,7 +887,6 @@
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(674, 126);
@ -1005,18 +1009,6 @@
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, 102);
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;
//
// tabPage4
//
this.tabPage4.Controls.Add(this.richTextBox1);
@ -1100,6 +1092,61 @@
this.bt_blockinfo.UseVisualStyleBackColor = true;
this.bt_blockinfo.Click += new System.EventHandler(this.bt_blockinfo_Click);
//
// progressBar_capfifo
//
this.progressBar_capfifo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
this.progressBar_capfifo.Location = new System.Drawing.Point(658, 642);
this.progressBar_capfifo.Name = "progressBar_capfifo";
this.progressBar_capfifo.Size = new System.Drawing.Size(304, 18);
this.progressBar_capfifo.Step = 1;
this.progressBar_capfifo.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.progressBar_capfifo.TabIndex = 15;
//
// label_capfifo
//
this.label_capfifo.AutoSize = true;
this.label_capfifo.Location = new System.Drawing.Point(567, 643);
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(984, 643);
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(1094, 643);
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:";
//
// pb_rxsync
//
this.pb_rxsync.BackgroundImage = global::oscardata.Properties.Resources.redmarker;
this.pb_rxsync.Location = new System.Drawing.Point(1155, 636);
this.pb_rxsync.Name = "pb_rxsync";
this.pb_rxsync.Size = new System.Drawing.Size(24, 24);
this.pb_rxsync.TabIndex = 19;
this.pb_rxsync.TabStop = false;
//
// pb_rxsignal
//
this.pb_rxsignal.BackgroundImage = global::oscardata.Properties.Resources.redmarker;
this.pb_rxsignal.Location = new System.Drawing.Point(1047, 636);
this.pb_rxsignal.Name = "pb_rxsignal";
this.pb_rxsignal.Size = new System.Drawing.Size(24, 24);
this.pb_rxsignal.TabIndex = 17;
this.pb_rxsignal.TabStop = false;
//
// bt_rximages
//
this.bt_rximages.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
@ -1354,30 +1401,15 @@
this.pb_audioPBstatus.TabIndex = 17;
this.pb_audioPBstatus.TabStop = false;
//
// progressBar_capfifo
//
this.progressBar_capfifo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
this.progressBar_capfifo.Location = new System.Drawing.Point(658, 642);
this.progressBar_capfifo.Name = "progressBar_capfifo";
this.progressBar_capfifo.Size = new System.Drawing.Size(304, 18);
this.progressBar_capfifo.Step = 1;
this.progressBar_capfifo.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.progressBar_capfifo.TabIndex = 15;
//
// label_capfifo
//
this.label_capfifo.AutoSize = true;
this.label_capfifo.Location = new System.Drawing.Point(567, 643);
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:";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1293, 691);
this.Controls.Add(this.lb_rxsync);
this.Controls.Add(this.pb_rxsync);
this.Controls.Add(this.lb_rxsignal);
this.Controls.Add(this.pb_rxsignal);
this.Controls.Add(this.label_capfifo);
this.Controls.Add(this.progressBar_capfifo);
this.Controls.Add(this.bt_blockinfo);
@ -1423,6 +1455,8 @@
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.tabPage4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pb_rxsync)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pb_rxsignal)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_rximage)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_tximage)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
@ -1486,7 +1520,6 @@
private System.Windows.Forms.TextBox tb_callsign;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox cb_stampcall;
private System.Windows.Forms.CheckBox cb_savegoodfiles;
private System.Windows.Forms.TextBox tb_shutdown;
private System.Windows.Forms.Button bt_shutdown;
private System.Windows.Forms.Button bt_resetmodem;
@ -1545,6 +1578,10 @@
private System.Windows.Forms.PictureBox pb_voice;
private System.Windows.Forms.ProgressBar progressBar_capfifo;
private System.Windows.Forms.Label label_capfifo;
private System.Windows.Forms.PictureBox pb_rxsignal;
private System.Windows.Forms.Label lb_rxsignal;
private System.Windows.Forms.Label lb_rxsync;
private System.Windows.Forms.PictureBox pb_rxsync;
}
}

View File

@ -30,6 +30,7 @@ using System.IO;
using System.Drawing.Drawing2D;
using System.Diagnostics;
using System.Threading;
using oscardata.Properties;
namespace oscardata
{
@ -55,11 +56,7 @@ namespace oscardata
OperatingSystem osversion = System.Environment.OSVersion;
statics.OSversion = osversion.Platform.ToString();
if (osversion.VersionString.Contains("indow"))
{
statics.ostype = 0;
tb_shutdown.Visible = false;
bt_shutdown.Visible = false;
}
else
statics.ostype = 1; // Linux
@ -92,8 +89,6 @@ namespace oscardata
timer_udpTX.Enabled = true;
timer_udprx.Enabled = true;
timer_searchmodem.Enabled = true;
//pictureBox_rximage.BackgroundImage = Image.FromFile("/tmp/temp293.jpg");
}
// TX timer
@ -509,14 +504,19 @@ namespace oscardata
panel_txspectrum.Invalidate();
// show RX and TX Buffer Usage
if (statics.PBfifousage < progressBar_fifo.Minimum) progressBar_fifo.Value = progressBar_fifo.Minimum;
else if (statics.PBfifousage >= progressBar_fifo.Maximum) progressBar_fifo.Value = progressBar_fifo.Maximum-1;
else progressBar_fifo.Value = statics.PBfifousage;
progressBar_capfifo.Invalidate();
if (statics.CAPfifousage < progressBar_capfifo.Minimum) progressBar_capfifo.Value = progressBar_capfifo.Minimum;
else if (statics.CAPfifousage >= progressBar_capfifo.Maximum) progressBar_capfifo.Value = progressBar_capfifo.Maximum - 1;
else progressBar_capfifo.Value = statics.CAPfifousage;
if (statics.CAPfifousage > 50) progressBar_capfifo.ForeColor = Color.Red; else progressBar_capfifo.ForeColor = Color.Green;
// Show RX Status LEDs
if (statics.RXlevelDetected == 1) pb_rxsignal.BackgroundImage = Resources.greenmarker; else pb_rxsignal.BackgroundImage = Resources.redmarker;
if (statics.RXinSync == 1 && statics.RXlevelDetected == 1) pb_rxsync.BackgroundImage = Resources.greenmarker; else pb_rxsync.BackgroundImage = Resources.redmarker;
}
private void panel_constel_Paint(object sender, PaintEventArgs e)
@ -721,10 +721,10 @@ namespace oscardata
// random filename for picturebox control (picturebox cannot reload image from actual filename)
try {
//File.Delete(TXimagefilename);
//statics.FileDelete(TXimagefilename);
// delete also older unused files
foreach (string f in Directory.EnumerateFiles(statics.addTmpPath(""), "tempTX*.jpg"))
File.Delete(f);
statics.FileDelete(f);
} catch { }
Random randNum = new Random();
TXimagefilename = statics.addTmpPath("tempTX" + randNum.Next(0, 65000).ToString() + ".jpg");
@ -1028,6 +1028,12 @@ namespace oscardata
label_capfifo.Location = new Point(label_fifo.Location.X, label_fifo.Location.Y + y);
progressBar_capfifo.Location = new Point(progressBar_fifo.Location.X, progressBar_fifo.Location.Y + y);
progressBar_capfifo.Size = new Size(progressBar_capfifo.Width, 18);
lb_rxsignal.Location = new Point(progressBar_capfifo.Location.X + progressBar_capfifo.Size.Width + 15, label_capfifo.Location.Y);
pb_rxsignal.Location = new Point(lb_rxsignal.Location.X + lb_rxsignal.Size.Width + 2, label_capfifo.Location.Y-5);
lb_rxsync.Location = new Point(pb_rxsignal.Location.X + pb_rxsignal.Size.Width + 15, label_capfifo.Location.Y);
pb_rxsync.Location = new Point(lb_rxsync.Location.X + lb_rxsync.Size.Width + 2, label_capfifo.Location.Y-5);
}
public String GetMyBroadcastIP()
@ -1114,7 +1120,7 @@ namespace oscardata
private void bt_file_send_Click(object sender, EventArgs e)
{
rtb_RXfile.Text = "";
File.Delete(statics.zip_RXtempfilename);
statics.FileDelete(statics.zip_RXtempfilename);
Byte[] textarr = File.ReadAllBytes(statics.zip_TXtempfilename);
ArraySend.Send(textarr, (Byte)txcommand, TXfilename, TXRealFilename);
@ -1244,11 +1250,15 @@ namespace oscardata
private String ReadString(StreamReader sr)
{
String s = sr.ReadLine();
if (s != null)
try
{
return s;
String s = sr.ReadLine();
if (s != null)
{
return s;
}
}
catch { }
return " ";
}
@ -1280,7 +1290,7 @@ namespace oscardata
String s = ReadString(sr);
cb_stampcall.Checked = (s == "1");
s = ReadString(sr);
cb_savegoodfiles.Checked = (s == "1");
// free for other usage
cb_audioPB.Text = ReadString(sr);
cb_audioCAP.Text = ReadString(sr);
tb_PBvol.Value = ReadInt(sr);
@ -1323,7 +1333,7 @@ namespace oscardata
sw.WriteLine(tb_callsign.Text);
sw.WriteLine(cb_speed.Text);
sw.WriteLine(cb_stampcall.Checked?"1":"0");
sw.WriteLine(cb_savegoodfiles.Checked ? "1" : "0");
sw.WriteLine("0"); // free for other use
sw.WriteLine(cb_audioPB.Text);
sw.WriteLine(cb_audioCAP.Text);
sw.WriteLine(tb_PBvol.Value.ToString());

View File

@ -137,7 +137,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABw
FwAAAk1TRnQBSQFMAgEBDQEAAbABAAGwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
FwAAAk1TRnQBSQFMAgEBDQEAAcgBAAHIAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAAUADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -150,6 +150,16 @@ namespace oscardata.Properties {
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap greenmarker {
get {
object obj = ResourceManager.GetObject("greenmarker", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
@ -230,6 +240,16 @@ namespace oscardata.Properties {
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap redmarker {
get {
object obj = ResourceManager.GetObject("redmarker", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>

View File

@ -202,4 +202,10 @@
<data name="cdc_intloop" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>cdc_intloop.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="greenmarker" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>greenmarker.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="redmarker" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>redmarker.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -74,6 +74,8 @@ namespace oscardata
public static int CAPfifousage = 0;
public static int initAudioStatus;
public static int initVoiceStatus;
public static int RXlevelDetected = 0;
public static int RXinSync = 0;
public static String[] getOwnIPs()
@ -399,5 +401,14 @@ namespace oscardata
catch { }
}
}
public static void FileDelete(String fn)
{
try
{
File.Delete(fn);
}
catch { }
}
}
}

View File

@ -18,7 +18,7 @@ namespace oscardata
encoder_params.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, compression);
ImageCodecInfo image_codec_info = GetEncoderInfo("image/jpeg");
File.Delete(file_name);
statics.FileDelete(file_name);
image.Save(file_name, image_codec_info, encoder_params);
}
catch (Exception ex)

View File

@ -111,13 +111,6 @@
<ItemGroup>
<None Include="Properties\image.jpg" />
<None Include="Properties\image1.jpg" />
<None Include="Properties\image2.jpg" />
<None Include="Properties\App-voice-support-headset-icon.png" />
<None Include="Properties\Categories-preferences-system-icon.png" />
<None Include="Properties\Downloads-1-icon.png" />
<None Include="Properties\Mimetypes-text-csv-icon.png" />
<None Include="Properties\Photography-icon.png" />
<None Include="Properties\Mimetypes-text-html-icon.png" />
<None Include="Properties\binary.png" />
<None Include="Properties\cancel.png" />
<None Include="Properties\html.png" />
@ -144,6 +137,8 @@
<None Include="Properties\cdc_intloop.png" />
<None Include="Properties\textrx.png" />
<None Include="Properties\texttx.png" />
<None Include="Properties\greenmarker.png" />
<None Include="Properties\redmarker.png" />
<Content Include="Satellite-icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MathNet.Numerics" version="4.12.0" targetFramework="net40" />
</packages>

View File

@ -102,7 +102,7 @@ namespace oscardata
if (!StartFileRX()) return false; // invalid file
}
if (minfo != statics.FirstFrame)
if (receiving && minfo != statics.FirstFrame)
runtime = DateTime.UtcNow - starttime;
// receive continous frames of a transmission
@ -403,29 +403,35 @@ namespace oscardata
// reception was ok, blockfile no more needed, delete it
// file is OK, blockfile no more needed, delete it
try { File.Delete(blockFilename); } catch { }
try { statics.FileDelete(blockFilename); } catch { }
// make filename
filename = makeRXfilename();
Console.WriteLine("save at " + filename);
using (BinaryWriter writer = new BinaryWriter(File.Open(filename, FileMode.Create)))
try
{
for (int i = 0; i <= blockidx; i++)
using (BinaryWriter writer = new BinaryWriter(File.Open(filename, FileMode.Create)))
{
if (i == 0)
writer.Write(firstblock);
else
for (int i = 0; i <= blockidx; i++)
{
Byte[] blk = new byte[statics.PayloadLen];
for (int j = 0; j < statics.PayloadLen; j++)
blk[j] = blockbuf[i, j];
if (i == 0)
writer.Write(firstblock);
else
{
Byte[] blk = new byte[statics.PayloadLen];
for (int j = 0; j < statics.PayloadLen; j++)
blk[j] = blockbuf[i, j];
writer.Write(blk);
writer.Write(blk);
}
}
writer.Close();
}
writer.Close();
}
catch
{
}
return true;
@ -501,7 +507,7 @@ namespace oscardata
fdest = statics.getHomePath("", fdest);
// fdest is the file in the oscardata's user home directoty
// remove old file with same name
try { File.Delete(fdest); } catch { }
try { statics.FileDelete(fdest); } catch { }
// move the unzipped file to the final location
File.Move(fl, fdest);
filesize = statics.GetFileSize(fdest);
@ -510,7 +516,7 @@ namespace oscardata
else
StatusText = "unzip failed";
File.Delete(statics.zip_RXtempfilename);
statics.FileDelete(statics.zip_RXtempfilename);
}
catch
{

View File

@ -122,8 +122,10 @@ namespace oscardata
{
statics.PBfifousage = b[0];
statics.CAPfifousage = b[1];
Byte[] b1 = new byte[b.Length - 2];
Array.Copy(b, 2, b1, 0, b1.Length);
statics.RXlevelDetected = b[2];
statics. RXinSync = b[3];
Byte[] b1 = new byte[b.Length - 4];
Array.Copy(b, 4, b1, 0, b1.Length);
uq_fft.Add(b1);
}

View File

@ -51,7 +51,7 @@ namespace oscardata
{
try
{
File.Delete(zipfilename);
statics.FileDelete(zipfilename);
}
catch { }