This file is part of a program that implements a Software-Defined Radio.
-Copyright (C) 2004 by Frank Brickle, AB2KT and Bob McGwier, N4HY
+Copyright (C) 2004-5 by Frank Brickle, AB2KT and Bob McGwier, N4HY
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
}
// setMode <mode> [TRX]
-
PRIVATE int
setMode(int n, char **p) {
int mode = atoi(p[0]);
}
//============================================================
+// some changes have been made to a transfer function in vec;
+// apply time-domain window to counter possible artifacts
PRIVATE void
re_window(COMPLEX *vec, int len) {
// 0 dB1 75 dB2 150 dB3 300 dB4 600 dB5 1200 dB6 2000 dB7 2800 dB8 3600
// approximates W2IHY bandcenters.
// no args, revert to no EQ.
+// NB these are shelves, not linear or other splines
PRIVATE int
setTXEQ(int n, char **p) {
setFinished(int n, char **p) {
top.running = FALSE;
pthread_cancel(top.thrd.trx.id);
- pthread_cancel(top.thrd.upd.id);
pthread_cancel(top.thrd.mon.id);
+ pthread_cancel(top.thrd.pws.id);
+ pthread_cancel(top.thrd.mtr.id);
+ pthread_cancel(top.thrd.upd.id);
return 0;
}
}
}
+// [pos] 0.0 <= pos <= 1.0
PRIVATE int
setRXPan(int n, char **p) {
REAL pos, theta;
}
}
+// [dB] NB both channels
PRIVATE int
setAuxMixGain(int n, char **p) {
if (n < 1) {
}
}
+//------------------------------------------------------------------------
+
+// [type]
+PRIVATE int
+setMeterType(int n, char **p) {
+ if (n < 1)
+ uni.meter.rx.type = SIGNAL_STRENGTH;
+ else {
+ METERTYPE type = (METERTYPE) atoi(p[0]);
+ if (n > 1) {
+ int trx = atoi(p[1]);
+ switch (trx) {
+ case TX: uni.meter.tx.type = type; break;
+ case RX:
+ default: uni.meter.rx.type = type; break;
+ }
+ } else
+ uni.meter.rx.type = type;
+ }
+ return 0;
+}
+
+// setSpectrumType [type [scale [rx]]]
+PRIVATE int
+setSpectrumType(int n, char **p) {
+ uni.spec.type = SPEC_POST_FILT;
+ uni.spec.scale = SPEC_PWR;
+ uni.spec.rxk = RL;
+ switch (n) {
+ case 3:
+ uni.spec.rxk = atoi(p[2]);
+ case 2:
+ uni.spec.scale = atoi(p[1]);
+ case 1:
+ uni.spec.type = atoi(p[0]);
+ break;
+ case 0:
+ return 0;
+ default:
+ return -1;
+ }
+}
+
+#if 0
+PRIVATE int
+setSpectrumType(int n, char **p) {
+ switch (n) {
+ case 3:
+ uni.spec.type = atoi(p[0]);
+ uni.spec.scale = atoi(p[1]);
+ uni.spec.rxk = atoi(p[2]);
+ case 2:
+ uni.spec.type = atoi(p[0]);
+ uni.spec.scale = atoi(p[1]);
+ uni.spec.rxk = RL;
+ break;
+ case 1:
+ uni.spec.type = atoi(p[0]);
+ uni.spec.scale = SPEC_PWR;
+ uni.spec.rxk = RL;
+ break;
+ case 0:
+ uni.spec.type = SPEC_POST_FILT;
+ uni.spec.scale = SPEC_PWR;
+ uni.spec.rxk = RL;
+ break;
+ default:
+ return -1;
+ }
+ return 0;
+}
+#endif
+
+//========================================================================
+
+// save current state while guarded by upd sem
+PRIVATE int
+reqMeter(int n, char **p) {
+ snap_meter(&uni.meter, n > 0 ? atoi(p[0]) : 0);
+ sem_post(&top.sync.mtr.sem);
+ return 0;
+}
+
+// simile modo
+PRIVATE int
+reqSpectrum(int n, char **p) {
+ snap_spectrum(&uni.spec, n > 0 ? atoi(p[0]) : 0);
+ sem_post(&top.sync.pws.sem);
+ return 0;
+}
+
//========================================================================
#include <thunk.h>
CTE update_cmds[] = {
+ {"reqMeter", reqMeter},
+ {"reqSpectrum", reqSpectrum},
{"setANF", setANF},
{"setANFvals", setANFvals},
{"setBIN", setBIN},
{"setRXPan", setRXPan},
{"setAuxMixSt", setAuxMixSt},
{"setAuxMixGain", setAuxMixGain},
+ {"setMeterType", setMeterType},
+ {"setSpectrumType", setSpectrumType},
{ 0, 0 }
};