Allow giving alphanumeric channels (Prepare for IMTS)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#define MAX_DISPLAY_WIDTH 1024
|
||||
|
||||
typedef struct display_wave {
|
||||
int kanal;
|
||||
const char *kanal;
|
||||
int interval_pos;
|
||||
int interval_max;
|
||||
int offset;
|
||||
@@ -44,7 +44,7 @@ typedef struct display_measurements_param {
|
||||
|
||||
typedef struct display_measurements {
|
||||
struct display_measurements *next;
|
||||
int kanal;
|
||||
const char *kanal;
|
||||
dispmeasparam_t *param;
|
||||
} dispmeas_t;
|
||||
|
||||
@@ -60,7 +60,7 @@ typedef struct display_iq {
|
||||
|
||||
typedef struct display_spectrum_mark {
|
||||
struct display_spectrum_mark *next;
|
||||
int kanal;
|
||||
const char *kanal;
|
||||
double frequency;
|
||||
} dispspectrum_mark_t;
|
||||
|
||||
@@ -74,17 +74,17 @@ typedef struct display_spectrum {
|
||||
|
||||
#define MAX_HEIGHT_STATUS 32
|
||||
|
||||
void display_wave_init(dispwav_t *disp, int samplerate, int kanal);
|
||||
void display_wave_init(dispwav_t *disp, int samplerate, const char *kanal);
|
||||
void display_wave_on(int on);
|
||||
void display_wave(dispwav_t *disp, sample_t *samples, int length, double range);
|
||||
|
||||
void display_status_on(int on);
|
||||
void display_status_start(void);
|
||||
void display_status_channel(int channel, const char *type, const char *state);
|
||||
void display_status_channel(const char *kanal, const char *type, const char *state);
|
||||
void display_status_subscriber(const char *number, const char *state);
|
||||
void display_status_end(void);
|
||||
|
||||
void display_measurements_init(dispmeas_t *disp, int samplerate, int kanal);
|
||||
void display_measurements_init(dispmeas_t *disp, int samplerate, const char *kanal);
|
||||
void display_measurements_exit(dispmeas_t *disp);
|
||||
void display_measurements_on(int on);
|
||||
dispmeasparam_t *display_measurements_add(dispmeas_t *disp, char *name, char *format, enum display_measurements_type type, enum display_measurements_bar bar, double min, double max, double mark);
|
||||
@@ -96,7 +96,7 @@ void display_iq_on(int on);
|
||||
void display_iq(float *samples, int length);
|
||||
|
||||
void display_spectrum_init(int samplerate, double center_frequency);
|
||||
void display_spectrum_add_mark(int kanal, double frequency);
|
||||
void display_spectrum_add_mark(const char *kanal, double frequency);
|
||||
void display_spectrum_exit(void);
|
||||
void display_spectrum_on(int on);
|
||||
void display_spectrum(float *samples, int length);
|
||||
|
@@ -40,7 +40,7 @@ static char line_color[MAX_DISPLAY_WIDTH];
|
||||
|
||||
dispmeas_t *meas_head = NULL;
|
||||
|
||||
void display_measurements_init(dispmeas_t *disp, int __attribute__((unused)) samplerate, int kanal)
|
||||
void display_measurements_init(dispmeas_t *disp, int __attribute__((unused)) samplerate, const char *kanal)
|
||||
{
|
||||
dispmeas_t **disp_p;
|
||||
|
||||
@@ -114,7 +114,7 @@ static void print_measurements(int on)
|
||||
for (disp = meas_head; disp; disp = disp->next) {
|
||||
memset(line, ' ', width);
|
||||
memset(line_color, 7, width);
|
||||
sprintf(line, "(chan %d", disp->kanal);
|
||||
sprintf(line, "(chan %s", disp->kanal);
|
||||
*strchr(line, '\0') = ')';
|
||||
display_line(on, width);
|
||||
for (param = disp->param; param; param = param->next) {
|
||||
|
@@ -55,7 +55,7 @@ void display_spectrum_init(int samplerate, double _center_frequency)
|
||||
has_init = 1;
|
||||
}
|
||||
|
||||
void display_spectrum_add_mark(int kanal, double frequency)
|
||||
void display_spectrum_add_mark(const char *kanal, double frequency)
|
||||
{
|
||||
dispspectrum_mark_t *mark, **mark_p;
|
||||
|
||||
@@ -348,7 +348,7 @@ void display_spectrum(float *samples, int length)
|
||||
screen[k][j] = ':';
|
||||
screen_color[k][j] = 12;
|
||||
}
|
||||
sprintf(print_channel, "Ch%d", mark->kanal);
|
||||
sprintf(print_channel, "Ch%s", mark->kanal);
|
||||
for (o = 0; o < (int)strlen(print_channel); o++) {
|
||||
s = j - strlen(print_channel) + o;
|
||||
if (s >= 0 && s < width) {
|
||||
|
@@ -87,7 +87,7 @@ void display_status_start(void)
|
||||
line_count = 1;
|
||||
}
|
||||
|
||||
void display_status_channel(int channel, const char *type, const char *state)
|
||||
void display_status_channel(const char *kanal, const char *type, const char *state)
|
||||
{
|
||||
char line[MAX_DISPLAY_WIDTH];
|
||||
|
||||
@@ -99,9 +99,9 @@ void display_status_channel(int channel, const char *type, const char *state)
|
||||
return;
|
||||
|
||||
if (type)
|
||||
snprintf(line, sizeof(line), "Channel: %d Type: %s State: %s", channel, type, state);
|
||||
snprintf(line, sizeof(line), "Channel: %s Type: %s State: %s", kanal, type, state);
|
||||
else
|
||||
snprintf(line, sizeof(line), "Channel: %d State: %s", channel, state);
|
||||
snprintf(line, sizeof(line), "Channel: %s State: %s", kanal, state);
|
||||
line[sizeof(line) - 1] = '\0';
|
||||
memcpy(screen[line_count++], line, strlen(line));
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ static int num_sender = 0;
|
||||
static char screen[HEIGHT][MAX_DISPLAY_WIDTH];
|
||||
static int wave_on = 0;
|
||||
|
||||
void display_wave_init(dispwav_t *disp, int samplerate, int kanal)
|
||||
void display_wave_init(dispwav_t *disp, int samplerate, const char *kanal)
|
||||
{
|
||||
memset(disp, 0, sizeof(*disp));
|
||||
disp->offset = (num_sender++) * HEIGHT;
|
||||
@@ -198,7 +198,7 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range)
|
||||
screen[k][j] = '|';
|
||||
}
|
||||
}
|
||||
sprintf(screen[0], "(chan %d", disp->kanal);
|
||||
sprintf(screen[0], "(chan %s", disp->kanal);
|
||||
*strchr(screen[0], '\0') = ')';
|
||||
printf("\0337\033[H");
|
||||
for (j = 0; j < disp->offset; j++)
|
||||
|
Reference in New Issue
Block a user