This commit is contained in:
Kurt Moraw 2020-12-21 15:59:35 +01:00
parent 0f84850ff5
commit c4326e2281
49 changed files with 338 additions and 37 deletions

View File

@ -2,7 +2,7 @@
The purpose of this project is to transfer data (pictures...) via a 2,7kHz SSB channel on the narrow band transponder as fast as possible.
# this is work in progress
Version 0.52
Version 0.55
Windows 10 (should work on Win7, not tested)
linux Desktop PC,
Odroid SBC

Binary file not shown.

Binary file not shown.

View File

@ -9,7 +9,7 @@
CXXFLAGS = -Wall -O3 -std=c++0x -Wno-write-strings -Wno-narrowing
LDFLAGS = -lpthread -lrt -lsndfile -lasound -lm -lopus -lfftw3 -lfftw3_threads -lliquid -lcodec2 -lsoundio
OBJ = hsmodem.o constellation.o crc16.o frame_packer.o main_helper.o scrambler.o speed.o fec.o udp.o fft.o liquid_if.o symboltracker.o voiceprocessor.o codec2.o soundio.o fifo.o announcement.o fifo_voice.o voiceio.o
OBJ = hsmodem.o constellation.o crc16.o frame_packer.o main_helper.o scrambler.o speed.o fec.o udp.o fft.o liquid_if.o symboltracker.o voiceprocessor.o codec2.o soundio.o fifo.o announcement.o fifo_voice.o voiceio.o tuning.o
default: $(OBJ)
mkdir -p ../hsmodemLinux

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

@ -0,0 +1,32 @@
e:\funk\hsmodem\hsmodem\release\vc140.pdb
e:\funk\hsmodem\hsmodem\release\tuning.obj
e:\funk\hsmodem\hsmodem\release\liquid_if.obj
e:\funk\hsmodem\hsmodem\release\fft.obj
e:\funk\hsmodem\hsmodem\release\voiceprocessor.obj
e:\funk\hsmodem\hsmodem\release\voiceio.obj
e:\funk\hsmodem\hsmodem\release\udp.obj
e:\funk\hsmodem\hsmodem\release\symboltracker.obj
e:\funk\hsmodem\hsmodem\release\speed.obj
e:\funk\hsmodem\hsmodem\release\soundio.obj
e:\funk\hsmodem\hsmodem\release\scrambler.obj
e:\funk\hsmodem\hsmodem\release\main_helper.obj
e:\funk\hsmodem\hsmodem\release\hsmodem.obj
e:\funk\hsmodem\hsmodem\release\frame_packer.obj
e:\funk\hsmodem\hsmodem\release\fifo_voice.obj
e:\funk\hsmodem\hsmodem\release\fifo.obj
e:\funk\hsmodem\hsmodem\release\fec.obj
e:\funk\hsmodem\hsmodem\release\crc16.obj
e:\funk\hsmodem\hsmodem\release\constellation.obj
e:\funk\hsmodem\hsmodem\release\codec2.obj
e:\funk\hsmodem\hsmodem\release\announcement.obj
e:\funk\hsmodem\winrelease\hsmodem.exe
e:\funk\hsmodem\winrelease\hsmodem.ipdb
e:\funk\hsmodem\winrelease\hsmodem.iobj
e:\funk\hsmodem\winrelease\hsmodem.pdb
e:\funk\hsmodem\hsmodem\..\winrelease\hsmodem.exe
e:\funk\hsmodem\hsmodem\release\hsmodem.tlog\cl.command.1.tlog
e:\funk\hsmodem\hsmodem\release\hsmodem.tlog\cl.read.1.tlog
e:\funk\hsmodem\hsmodem\release\hsmodem.tlog\cl.write.1.tlog
e:\funk\hsmodem\hsmodem\release\hsmodem.tlog\link.command.1.tlog
e:\funk\hsmodem\hsmodem\release\hsmodem.tlog\link.read.1.tlog
e:\funk\hsmodem\hsmodem\release\hsmodem.tlog\link.write.1.tlog

View File

@ -1 +1,24 @@
 hsmodem.vcxproj -> E:\funk\hsmodem\hsmodem\..\WinRelease\hsmodem.exe
 announcement.cpp
codec2.cpp
constellation.cpp
crc16.cpp
fec.cpp
fft.cpp
fifo.cpp
fifo_voice.cpp
frame_packer.cpp
hsmodem.cpp
liquid_if.cpp
main_helper.cpp
scrambler.cpp
soundio.cpp
speed.cpp
symboltracker.cpp
tuning.cpp
udp.cpp
voiceio.cpp
voiceprocessor.cpp
Code wird generiert.
All 602 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
Codegenerierung ist abgeschlossen.
hsmodem.vcxproj -> E:\funk\hsmodem\hsmodem\..\WinRelease\hsmodem.exe

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.

BIN
hsmodem/Release/tuning.obj Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -159,7 +159,12 @@ int yidx = 0;
uint16_t* mean(uint16_t* f)
{
static uint16_t fa[FFT_AUDIOSAMPLERATE / 2 + 1];
if (tuning)
return f;
// first smooth X values
for (int x = 0; x < smoothX / 2; x++)
fa[x] = f[x];
@ -189,6 +194,10 @@ uint16_t* mean(uint16_t* f)
fa[i] /= smoothY;
}
// do not smooth 2950 to 3050 Hz
for (int i = 295; i < 305; i++)
fa[i] = f[i];
return fa;
}
@ -207,7 +216,7 @@ void _init_fft()
// decimate 44.1k or 48k down to 8000Hz
// the FFT rate is 800, but we feed it with 8000 Samplerate
// this results in a new fft every 100ms with a resolution of 10 Hz
float ratio = 10.0f * (float)FFT_AUDIOSAMPLERATE / (float)caprate;
float ratio = 10.0f * (float)FFT_AUDIOSAMPLERATE / (float)physcaprate;
fftdecim = msresamp_crcf_create(ratio, 40.0f);
}

View File

@ -86,6 +86,8 @@ float softwareLSvolume = 1;
int announcement = 0;
int VoiceAudioMode = VOICEMODE_OFF;
int codec = 1; // 0=opus, 1=codec2
int tuning = 0;
int marker = 0;
int init_audio_result = 0;
int init_voice_result = 0;
@ -247,6 +249,11 @@ int main(int argc, char* argv[])
encode(f);
}
}
if (tuning != 0)
{
do_tuning(tuning);
}
// demodulate incoming audio data stream
static uint64_t old_tm = 0;
@ -482,6 +489,7 @@ void appdata_rxdata(uint8_t* pdata, int len, struct sockaddr_in* rxsock)
if (type == 20)
{
// reset liquid RX modem
tuning = 0;
resetModem();
io_clear_audio_fifos();
return;
@ -555,6 +563,24 @@ void appdata_rxdata(uint8_t* pdata, int len, struct sockaddr_in* rxsock)
// GUI requests termination of this hsmodem
printf("shut down hsmodem\n");
closeAllandTerminate();
return;
}
if (type == 27)
{
// send Tuning tones
printf("Tuning mode active\n");
VoiceAudioMode = VOICEMODE_OFF;
tuning_runtime = 0;
tuning = minfo;
return;
}
if (type == 28)
{
printf("marker:%d\n",minfo);
marker = minfo;
return;
}
// here we are with payload data to be sent via the modulator

View File

@ -203,6 +203,9 @@ void km_symtrack_execute(liquid_float_complex _x, liquid_float_complex* _y, unsi
void io_saveStream(float f);
void playIntro();
void io_clear_voice_fifos();
float do_tuning(int send);
void init_tune();
float singleFrequency();
extern int speedmode;
@ -242,6 +245,9 @@ extern int restart_modems;
extern int safemode;
extern char homepath[];
extern int sendIntro;
extern int tuning;
extern uint32_t tuning_runtime;
extern int marker;
#ifdef _LINUX_
int isRunning(char* prgname);

View File

@ -255,6 +255,7 @@
<ClCompile Include="soundio.cpp" />
<ClCompile Include="speed.cpp" />
<ClCompile Include="symboltracker.cpp" />
<ClCompile Include="tuning.cpp" />
<ClCompile Include="udp.cpp" />
<ClCompile Include="voiceio.cpp" />
<ClCompile Include="voiceprocessor.cpp" />

View File

@ -72,6 +72,9 @@
<ClCompile Include="voiceio.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="tuning.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="hsmodem.h">

View File

@ -193,7 +193,7 @@ void modulator(uint8_t sym_in)
{
// move sample to 1,5kHz carrier
nco_crcf_step(upnco);
liquid_float_complex c;
nco_crcf_mix_up(upnco,y[i],&c);
float usb = c.real + c.imag;
@ -207,7 +207,10 @@ void modulator(uint8_t sym_in)
if(fs > 20000) break;
sleep_ms(10);
}
if(marker)
usb += singleFrequency() / 10.0f;
io_pb_write_fifo(usb * 0.2f); // reduce volume and send to soundcard
}
}

View File

@ -615,6 +615,8 @@ int io_init_sound(char *pbname, char *capname)
printf("physical capture rate:%d, logical capture rate:%d\n", caprate, caprate);
printf("format: %s\n\n", soundio_format_string(outstream->format));
init_tune();
return init_audio_result;
}

113
hsmodem/tuning.cpp Executable file
View File

@ -0,0 +1,113 @@
/*
* High Speed modem to transfer data in a 2,7kHz SSB channel
* =========================================================
* Author: DJ0ABR
*
* (c) DJ0ABR
* www.dj0abr.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* tuning.c ... generate tuning tones and feed audio to TRX
*
*/
#include "hsmodem.h"
#define NUMFREQ 12
int tunefreq[NUMFREQ] = { 150,420,690,960,1230,1500,1770,2040,2310,2580,2850,3000 };
nco_crcf tunenco[NUMFREQ];
uint32_t tuning_runtime = 0;
void init_tune()
{
static int f = 1;
if (f)
{
for (int i = 0; i < NUMFREQ; i++)
tunenco[i] = NULL;
f = 0;
}
for (int i = 0; i < NUMFREQ; i++)
{
if (tunenco[i] != NULL) nco_crcf_destroy(tunenco[i]);
// create NCO for frequency
printf("tuning: physcaprate:%d\n", physcaprate);
float rad_per_sample = ((2.0f * (float)M_PI * (float)tunefreq[i]) / (float)caprate);
tunenco[i] = nco_crcf_create(LIQUID_NCO);
nco_crcf_set_phase(tunenco[i], 0.0f);
nco_crcf_set_frequency(tunenco[i], rad_per_sample);
}
}
// send= 1 ... send all frequencies to soundcard
// send= 2,3,4 ... send a single freq to soundcard
float do_tuning(int send)
{
if (tunenco == NULL) return 0.0f;
if (send < 0 || send > 4) return 0.0f;
float f = 0;
if (send == 1)
{
for (int i = 0; i < NUMFREQ; i++)
{
nco_crcf_step(tunenco[i]);
float v = nco_crcf_sin(tunenco[i]);
f += v;
}
f /= 3;
}
else
{
nco_crcf_step(tunenco[send-2]);
f = nco_crcf_sin(tunenco[send-2]);
}
// adapt speed to soundcard samplerate
int fs;
while (1)
{
fs = io_pb_fifo_freespace(0);
// wait until there is space in fifo
if (fs > 20000) break;
sleep_ms(10);
}
io_pb_write_fifo(f * 0.05f); // reduce volume and send to soundcard
if (++tuning_runtime >= (48000 * 5 * 60))
{
// 5min max time
printf("Maximum tuning time, switch off tuning\n");
tuning = 0;
}
return f;
}
float singleFrequency()
{
int i = 11; // 3000 Hz
if (tunenco[i] == NULL) return 0.0f;
nco_crcf_step(tunenco[i]);
return nco_crcf_sin(tunenco[i]);
}

Binary file not shown.

Binary file not shown.

View File

@ -41,6 +41,8 @@
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.bt_allf = new System.Windows.Forms.Button();
this.lb_tuningqrgs = new System.Windows.Forms.Label();
this.button_stopBERtest = new System.Windows.Forms.Button();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.button_startBERtest = new System.Windows.Forms.Button();
@ -149,6 +151,7 @@
this.progressBar_fifo = new oscardata.KmProgressBar();
this.vu_cap = new oscardata.KmProgressBar();
this.vu_pb = new oscardata.KmProgressBar();
this.cb_marker = new System.Windows.Forms.CheckBox();
this.statusStrip1.SuspendLayout();
this.tabPage_ber.SuspendLayout();
this.tabPage_image.SuspendLayout();
@ -256,6 +259,8 @@
// tabPage_ber
//
this.tabPage_ber.BackColor = System.Drawing.Color.Transparent;
this.tabPage_ber.Controls.Add(this.bt_allf);
this.tabPage_ber.Controls.Add(this.lb_tuningqrgs);
this.tabPage_ber.Controls.Add(this.button_stopBERtest);
this.tabPage_ber.Controls.Add(this.button_startBERtest);
this.tabPage_ber.Controls.Add(this.rtb);
@ -263,10 +268,30 @@
this.tabPage_ber.Location = new System.Drawing.Point(4, 23);
this.tabPage_ber.Name = "tabPage_ber";
this.tabPage_ber.Padding = new System.Windows.Forms.Padding(3);
this.tabPage_ber.Size = new System.Drawing.Size(1291, 552);
this.tabPage_ber.Size = new System.Drawing.Size(1280, 552);
this.tabPage_ber.TabIndex = 0;
this.tabPage_ber.Text = "BER Test";
//
// bt_allf
//
this.bt_allf.Location = new System.Drawing.Point(537, 18);
this.bt_allf.Name = "bt_allf";
this.bt_allf.Size = new System.Drawing.Size(95, 23);
this.bt_allf.TabIndex = 25;
this.bt_allf.Text = "150..2850 Hz";
this.bt_allf.UseVisualStyleBackColor = true;
this.bt_allf.Click += new System.EventHandler(this.bt_allf_Click);
//
// lb_tuningqrgs
//
this.lb_tuningqrgs.AutoSize = true;
this.lb_tuningqrgs.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lb_tuningqrgs.Location = new System.Drawing.Point(436, 22);
this.lb_tuningqrgs.Name = "lb_tuningqrgs";
this.lb_tuningqrgs.Size = new System.Drawing.Size(84, 13);
this.lb_tuningqrgs.TabIndex = 21;
this.lb_tuningqrgs.Text = "Frequency Test:";
//
// button_stopBERtest
//
this.button_stopBERtest.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -318,7 +343,7 @@
this.rtb.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtb.Location = new System.Drawing.Point(6, 51);
this.rtb.Name = "rtb";
this.rtb.Size = new System.Drawing.Size(1270, 494);
this.rtb.Size = new System.Drawing.Size(1266, 494);
this.rtb.TabIndex = 0;
this.rtb.Text = "";
//
@ -334,7 +359,7 @@
this.tabPage_image.Location = new System.Drawing.Point(4, 23);
this.tabPage_image.Name = "tabPage_image";
this.tabPage_image.Padding = new System.Windows.Forms.Padding(3);
this.tabPage_image.Size = new System.Drawing.Size(1291, 552);
this.tabPage_image.Size = new System.Drawing.Size(1280, 552);
this.tabPage_image.TabIndex = 1;
this.tabPage_image.Text = "Image";
//
@ -508,7 +533,7 @@
this.tabControl1.Location = new System.Drawing.Point(5, 3);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1299, 579);
this.tabControl1.Size = new System.Drawing.Size(1288, 579);
this.tabControl1.TabIndex = 3;
//
// tabPage_file
@ -528,7 +553,7 @@
this.tabPage_file.ImageIndex = 9;
this.tabPage_file.Location = new System.Drawing.Point(4, 23);
this.tabPage_file.Name = "tabPage_file";
this.tabPage_file.Size = new System.Drawing.Size(1291, 552);
this.tabPage_file.Size = new System.Drawing.Size(1280, 552);
this.tabPage_file.TabIndex = 2;
this.tabPage_file.Text = "File";
//
@ -670,7 +695,7 @@
this.tabPage_audio.ImageIndex = 11;
this.tabPage_audio.Location = new System.Drawing.Point(4, 23);
this.tabPage_audio.Name = "tabPage_audio";
this.tabPage_audio.Size = new System.Drawing.Size(1291, 552);
this.tabPage_audio.Size = new System.Drawing.Size(1280, 552);
this.tabPage_audio.TabIndex = 5;
this.tabPage_audio.Text = "Voice Audio";
//
@ -928,7 +953,7 @@
this.tabPage_setup.ImageIndex = 6;
this.tabPage_setup.Location = new System.Drawing.Point(4, 23);
this.tabPage_setup.Name = "tabPage_setup";
this.tabPage_setup.Size = new System.Drawing.Size(1291, 552);
this.tabPage_setup.Size = new System.Drawing.Size(1280, 552);
this.tabPage_setup.TabIndex = 4;
this.tabPage_setup.Text = "Setup";
//
@ -943,9 +968,9 @@
this.groupBox4.Controls.Add(this.tb_shutdown);
this.groupBox4.Controls.Add(this.bt_resetmodem);
this.groupBox4.Controls.Add(this.textBox3);
this.groupBox4.Location = new System.Drawing.Point(12, 257);
this.groupBox4.Location = new System.Drawing.Point(12, 313);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(674, 121);
this.groupBox4.Size = new System.Drawing.Size(743, 121);
this.groupBox4.TabIndex = 15;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Maintenance";
@ -1038,6 +1063,7 @@
this.bt_resetmodem.TabIndex = 6;
this.bt_resetmodem.Text = "Reset RX Modem";
this.bt_resetmodem.UseVisualStyleBackColor = true;
this.bt_resetmodem.Visible = false;
this.bt_resetmodem.Click += new System.EventHandler(this.bt_resetmodem_Click);
//
// textBox3
@ -1055,6 +1081,7 @@
//
// groupBox3
//
this.groupBox3.Controls.Add(this.cb_marker);
this.groupBox3.Controls.Add(this.vu_cap);
this.groupBox3.Controls.Add(this.vu_pb);
this.groupBox3.Controls.Add(this.pb_audioCAPstatus);
@ -1069,7 +1096,7 @@
this.groupBox3.Controls.Add(this.label4);
this.groupBox3.Location = new System.Drawing.Point(12, 144);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(674, 107);
this.groupBox3.Size = new System.Drawing.Size(743, 163);
this.groupBox3.TabIndex = 14;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Transceiver Audio";
@ -1197,7 +1224,7 @@
this.groupBox2.Controls.Add(this.cb_stampcall);
this.groupBox2.Location = new System.Drawing.Point(12, 13);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(674, 127);
this.groupBox2.Size = new System.Drawing.Size(734, 127);
this.groupBox2.TabIndex = 13;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Personal Settings";
@ -1388,7 +1415,7 @@
this.tabPage_about.ImageIndex = 12;
this.tabPage_about.Location = new System.Drawing.Point(4, 23);
this.tabPage_about.Name = "tabPage_about";
this.tabPage_about.Size = new System.Drawing.Size(1291, 552);
this.tabPage_about.Size = new System.Drawing.Size(1280, 552);
this.tabPage_about.TabIndex = 6;
this.tabPage_about.Text = "About";
this.tabPage_about.UseVisualStyleBackColor = true;
@ -1538,6 +1565,18 @@
this.vu_pb.Size = new System.Drawing.Size(100, 10);
this.vu_pb.TabIndex = 19;
//
// cb_marker
//
this.cb_marker.AutoSize = true;
this.cb_marker.Location = new System.Drawing.Point(605, 21);
this.cb_marker.Name = "cb_marker";
this.cb_marker.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.cb_marker.Size = new System.Drawing.Size(123, 17);
this.cb_marker.TabIndex = 27;
this.cb_marker.Text = "3kHz Tuning Marker";
this.cb_marker.UseVisualStyleBackColor = true;
this.cb_marker.CheckedChanged += new System.EventHandler(this.cb_marker_CheckedChanged);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1562,11 +1601,12 @@
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.53 by DJ0ABR";
this.Text = "AMSAT-DL Multimedia HS Modem V0.55 by DJ0ABR";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.tabPage_ber.ResumeLayout(false);
this.tabPage_ber.PerformLayout();
this.tabPage_image.ResumeLayout(false);
this.tabPage_image.PerformLayout();
this.groupBox1.ResumeLayout(false);
@ -1730,6 +1770,9 @@
private System.Windows.Forms.Button bt_aplay;
private System.Windows.Forms.TextBox tb_recintro;
private System.Windows.Forms.Label lb_rec;
private System.Windows.Forms.Label lb_tuningqrgs;
private System.Windows.Forms.Button bt_allf;
private System.Windows.Forms.CheckBox cb_marker;
}
}

View File

@ -48,6 +48,7 @@ namespace oscardata
int last_initVoiceStatus;
int recordStatus = 0;
int recPhase = 0;
public Form1()
{
@ -636,6 +637,13 @@ namespace oscardata
{
lb_rec.Visible = false;
}
if (statics.tuning_active == 1 && txcommand != statics.noTX)
{
// stop tuning
bt_resetmodem_Click(null, null);
statics.tuning_active = 0;
}
}
private void panel_constel_Paint(object sender, PaintEventArgs e)
@ -1443,6 +1451,8 @@ namespace oscardata
// and transmit it
Udp.UdpSendCtrl(txdata);
statics.tuning_active = 0;
}
int setPBvolume = -1;
@ -1734,6 +1744,8 @@ namespace oscardata
lb_rxsync.Text = "RX Sync:";
cb_sendIntro.Text = "send introduction";
tb_recintro.Text = "record introduction";
lb_tuningqrgs.Text = "Frequency Test";
cb_marker.Text = "3kHz Tuning Marker";
}
if (language == 1)
@ -1790,6 +1802,8 @@ namespace oscardata
tb_shutdown.Text = "Vor dem Ausschalten eines SBC diesen hier herunterfahren";
cb_sendIntro.Text = "sende Vorstellung";
tb_recintro.Text = "Vorstellung aufnehmen";
lb_tuningqrgs.Text = "Frequenz Test:";
cb_marker.Text = "3kHz Tuning Markierung";
}
}
@ -1894,6 +1908,44 @@ namespace oscardata
}
}
int acttuning = 0;
private void bt_tuning(int fr)
{
if (statics.tuning_active == 0 || fr != acttuning)
{
label_rximage.ForeColor = Color.Black;
pictureBox_rximage.Image = null;
ArraySend.stopSending();
bt_resetmodem_Click(null, null);
txcommand = statics.noTX;
Byte[] txdata = new byte[2];
txdata[0] = statics.tuning;
txdata[1] = (Byte)fr;
Udp.UdpSendCtrl(txdata);
statics.tuning_active = 1;
}
else
{
txcommand = statics.noTX;
bt_resetmodem_Click(null, null);
statics.tuning_active = 0;
}
acttuning = fr;
}
private void bt_allf_Click(object sender, EventArgs e)
{
bt_tuning(1);
}
private void cb_marker_CheckedChanged(object sender, EventArgs e)
{
Byte[] txdata = new byte[2];
txdata[0] = statics.marker;
txdata[1] = (Byte)(cb_marker.Checked ? 1 : 0);
Udp.UdpSendCtrl(txdata);
}
}
}

View File

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

View File

@ -36,6 +36,8 @@ namespace oscardata
public static Byte SetMICvolume = 24;
public static Byte SetVoiceMode = 25;
public static Byte terminate = 26;
public static Byte tuning = 27;
public static Byte marker = 28;
// frame sequence, modem needs that for i.e. sending a preamble
public static Byte FirstFrame = 0;
@ -80,6 +82,7 @@ namespace oscardata
public static int maxTXlevel = 0;
public static Color WindowBackColor;
public static String[] langstr;
public static int tuning_active = 0;
public static String[] getOwnIPs()
{

View File

@ -269,6 +269,7 @@ namespace oscardata
gr.DrawLine(penred, 150, yl, 150, yh);
gr.DrawLine(pensolid, 20, yl, 20, yh);
gr.DrawLine(pensolid, 280, yl, 280, yh);
gr.DrawLine(penred, 300, yl, 300, yh);
gr.DrawLine(pensolid, 360, yl, 360, yh);
gr.DrawRectangle(penred, 15, yh, 270, yl-yh);
@ -327,20 +328,11 @@ namespace oscardata
uq_fft.Add(bm);
}
static AutoResetEvent autoEvent = new AutoResetEvent(false);
// Udp TX Loop runs in its own thread
static void Udptxloop()
{
UdpClient udpc = new UdpClient();
// calculate cycle time for the requested data rate
// time in ms for one bit: 1000/statics.datarate
//int actdatarate = statics.getDatarate();
//int wait_datarate = (int)(((double)statics.UdpBlocklen * 8.0 * 1000.0 / (double)(statics.getDatarate())));
//Timer TTimer = new Timer(new TimerCallback(TXTickTimer), autoEvent, 0, wait_datarate);
while (statics.running)
{
bool wait = true;
@ -352,7 +344,7 @@ namespace oscardata
wait = false;
}
if(statics.PBfifousage < 2)
if(statics.PBfifousage < 3)
{
// we need to send more payload data
if (uq_tx.Count() > 0)
@ -373,13 +365,6 @@ namespace oscardata
udpc.Send(b, b.Length, ip, port);
}
static void TXTickTimer(object stateInfo)
{
autoEvent = (AutoResetEvent)stateInfo;
autoEvent.Set();
}
// send a Byte array via UDP
// this function can be called from anywhere in the program
// it transfers the data to the udp-tx thread via a thread-safe pipe