#include <stdlib.h>#include <stdio.h>#include <time.h>#include <ctype.h>#include <math.h>#include <errno.h>#include <unistd.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include "common.h"
Go to the source code of this file.
Functions | |
| char * | ClockStateName (int state) |
| clock state name as a string | |
| char * | ADCName (int id) |
| ADC name as a string. | |
| char * | StrTimeNS (struct Titan2TimeType *t) |
| Generate a string representing a titan2 time without subsecond part This function uses a statically allocated buffer. | |
| char * | StrTime (struct Titan2TimeType *t) |
| Generate a string representing a titan2 time This function uses a statically allocated buffer. | |
| char * | StrFrame (const unsigned char *frame) |
| Generate a string representing a frame This function uses a statically allocated buffer. | |
| char * | MediumErrorStr (int s) |
| char * | FlushStateStr (int s) |
| float | InfoSamplingRate (struct HWConfigType *hw, int ch) |
| compute the sampling rate from the information frames | |
| float | KSta2Time (struct HWConfigType *hw, int ch) |
| compute a duration according to the Ksta coding | |
| float | KLta2Time (struct HWConfigType *hw, int ch) |
| compute a duration according to the Klta coding | |
| int | SelectMatch (char *in, char *stream) |
| check a channel name against a stream param in the channel name to test param mask the stream name | |
| int64_t | Stream2Channel (void) |
| compute a channel mask after the stream, compared to the channel names | |
| void | ChangeStreamConfig (void) |
| int | CheckDiffConfig (void) |
| Issue a message for changing parameters. | |
Variables | |
| int | streamChange = 1 |
| flasg to force a stream update | |
| char* ADCName | ( | int | id | ) |
ADC name as a string.
| id | the ADC id |
Definition at line 66 of file frames.c.
References AD7710, ADS1251, CS5321, CS5323, and HI7190.
Referenced by CheckDiffConfig(), and PrintIdentification().
| void ChangeStreamConfig | ( | void | ) |
Definition at line 304 of file frames.c.
References streamChange.
Referenced by CheckContinuity(), and ProcessTimeFrame().
| int CheckDiffConfig | ( | void | ) |
Issue a message for changing parameters.
This hook is called after each superframe
Definition at line 311 of file frames.c.
References info0_3_t::active, DigitizerType::adcDecimation, DigitizerType::adcDecimationLength, DigitizerType::adcDelay, DigitizerType::adcFrequency, DigitizerType::adcId, ADCName(), info20_t::ADCType, info20_t::auxPresent, HWConfigType::avgPos, Titan2SRType::base, info18_t::batteryVoltage, channelMask, HWConfigType::channelName, info20_t::channels, TimeTuningType::clockMode, TimeTuningType::clockState, ClockStateName(), info20_t::continuousGPS, info5_t::cycles, DEFAULT_SERIAL, DEFAULT_STATION, info18_t::detections, HWConfigType::digitizer, Titan2SRType::div, TimeTuningType::drift, PositionType::elev, info5_t::endDuration, info5_t::endDurationMode, fastSeek, HWConfigType::fieldIdent, info19_t::flashBytes, info19_t::flashCycles, info20_t::flashSize, info19_t::flushRunning, info19_t::flushState, FlushStateStr(), HWConfigType::formatMajor, HWConfigType::formatMinor, HWConfigType::formatVersion, HWConfigType::gain, info5_t::gain, globalStationChange, HWConfigType::HPFilter, HWConfig, HWConfigType::impedance, HWConfigType::info03, HWConfigType::info15, HWConfigType::info18, HWConfigType::info19, HWConfigType::info20, HWConfigType::info5, InfoSamplingRate(), HWConfigType::instantPos, KLta2Time(), KSta2Time(), PositionType::lat, HWConfigType::locationName, logInfo, LogPrint(), PositionType::lon, info18_t::lostFlushLowBatt, info19_t::lostFlushMediumError, HWConfigType::LSB, MAJOR, manualStationName, MAX_OSIRIS_CHANNEL, info18_t::mediaBytes, info19_t::mediumError, MediumErrorStr(), info20_t::mediumSize, MINOR, HWConfigType::networkName, Titan2SRType::npts, info0_3_t::offset, oldHWConfig, info20_t::parallelLink, TimeTuningType::phase, info5_t::postEvent, info15_t::PPM, info5_t::preEvent, PrintError, PrintLog, info15_t::pulseLength, info15_t::pulseTest, info20_t::radioMode, info15_t::reboot, HWConfigType::rebootTime, info20_t::recordingMedium, info20_t::recordingMode, HWConfigType::resetTime, info20_t::samplingSet, HWConfigType::satelliteNumber, DigitizerType::secondDecimationLength, HWConfigType::serialNumber, HWConfigType::softwareRealease, HWConfigType::srExp, HWConfigType::srObs, TimeTuningType::step, Stream2Channel(), streamChange, streamList, StrTimeNS(), info0_3_t::threshold, info15_t::time, time2str(), info20_t::timeKeeper, info19_t::triggerInProcess, HWConfigType::tune, Titan2TimeType::usecond, and VERSION.
Referenced by ProcessTimeFrame().
| char* ClockStateName | ( | int | state | ) |
clock state name as a string
| state | the state to represent as a string |
Definition at line 44 of file frames.c.
Referenced by CheckDiffConfig().
| char* FlushStateStr | ( | int | s | ) |
| float InfoSamplingRate | ( | struct HWConfigType * | hw, | |
| int | ch | |||
| ) |
compute the sampling rate from the information frames
Definition at line 180 of file frames.c.
References HWConfigType::info03, HWConfigType::info20, info20_t::samplingSet, and info0_3_t::srCode.
Referenced by CheckDiffConfig(), KLta2Time(), and KSta2Time().
| float KLta2Time | ( | struct HWConfigType * | hw, | |
| int | ch | |||
| ) |
compute a duration according to the Klta coding
Definition at line 213 of file frames.c.
References HWConfigType::info03, InfoSamplingRate(), and info0_3_t::lta.
Referenced by CheckDiffConfig().
| float KSta2Time | ( | struct HWConfigType * | hw, | |
| int | ch | |||
| ) |
compute a duration according to the Ksta coding
Definition at line 198 of file frames.c.
References HWConfigType::info03, InfoSamplingRate(), and info0_3_t::sta.
Referenced by CheckDiffConfig().
| char* MediumErrorStr | ( | int | s | ) |
| int SelectMatch | ( | char * | in, | |
| char * | stream | |||
| ) |
check a channel name against a stream param in the channel name to test param mask the stream name
Definition at line 231 of file frames.c.
References PrintDebug.
Referenced by Stream2Channel().
| int64_t Stream2Channel | ( | void | ) |
compute a channel mask after the stream, compared to the channel names
Definition at line 267 of file frames.c.
References HWConfigType::channelName, HWConfig, MAX_OSIRIS_CHANNEL, PrintDebug, SelectMatch(), and streamList.
Referenced by CheckDiffConfig().
| char* StrFrame | ( | const unsigned char * | frame | ) |
Generate a string representing a frame This function uses a statically allocated buffer.
| frame | the frame to represent |
Definition at line 120 of file frames.c.
Referenced by GetFrame(), ProcessDataFrame(), and ProcessMiscFrame().
| char* StrTime | ( | struct Titan2TimeType * | t | ) |
Generate a string representing a titan2 time This function uses a statically allocated buffer.
| t | the time to represent |
Definition at line 104 of file frames.c.
References US2S, and Titan2TimeType::usecond.
Referenced by AddSacData(), CheckContinuity(), CloseAscFile(), EndSuperFrame(), TimeFrameCallBack(), and UpdateInfoHeader().
| char* StrTimeNS | ( | struct Titan2TimeType * | t | ) |
Generate a string representing a titan2 time without subsecond part This function uses a statically allocated buffer.
| t | the time to represent |
Definition at line 89 of file frames.c.
References Titan2TimeType::usecond.
Referenced by CheckDiffConfig(), GetFrame(), LogPrint(), ProcessMiscFrame(), TimeFrameCallBack(), TriggerOneSample(), UpdateIndex(), and UpdateInfoHeader().
| int streamChange = 1 |
flasg to force a stream update
Definition at line 39 of file frames.c.
Referenced by ChangeStreamConfig(), and CheckDiffConfig().
1.5.6