Extend ca support

master
Timothy Pearson 12 years ago
parent 7db02ff4fd
commit f8d3727794

@ -218,9 +218,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
$(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \

@ -644,4 +644,13 @@ int commanalyzer_set_spectrum_analyzer_reference_power_level(float desired_refle
else {
return 1;
}
}
int commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions( char * commanalyzerType, int gpibDevice) {
if ((strcmp("HP8924C", commanalyzerType) == 0)) {
return 8;
}
else {
return -1;
}
}

@ -46,4 +46,5 @@ int commanalyzer_set_spectrum_analyzer_generator_frequency(float desired_frequen
int commanalyzer_spectrum_analyzer_set_generator_sweep_ascending (char * commanalyzerType, int gpibDevice);
int commanalyzer_spectrum_analyzer_set_generator_sweep_descending (char * commanalyzerType, int gpibDevice);
int commanalyzer_set_spectrum_analyzer_trace_averaging(float desired_avg_samples, char * commanalyzerType, int gpibDevice);
int commanalyzer_set_spectrum_analyzer_reference_power_level(float desired_reflevel, char * commanalyzerType, int gpibDevice);
int commanalyzer_set_spectrum_analyzer_reference_power_level(float desired_reflevel, char * commanalyzerType, int gpibDevice);
int commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions( char * commanalyzerType, int gpibDevice);

@ -882,6 +882,8 @@ int mainserver(int fd) {
fsync(fd);
if (commanalyzer_get_spectrum_analyzer_trace(commanalyzerType, commanalyzer_board_device) == 0) {
bytestosend = commanalyzerTraceLength(commanalyzerType)*sizeof(double);
int16_t numbytes = bytestosend;
quiet_write(fd, &numbytes, 2);
k=0;
while (bytestosend > 0) {
return_status = write(fd, commanalyzer_raw_trace_data+k, 1);
@ -1055,6 +1057,16 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 62) { // Want the number of vertical divisions available
int16_t divisions = commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions(commanalyzerType, commanalyzer_board_device);
if (divisions >= 0) {
quiet_write(fd, &divisions, 2);
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
else {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
}
break;
case 2: // Open the serial port

Loading…
Cancel
Save