#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 <dirent.h>#include <assert.h>#include <signal.h>#include "common.h"#include "oifdefine.c"#include "oifalert.c"#include "omni.c"
Go to the source code of this file.
Defines | |
| #define | _GNU_SOURCE |
| #define | MAX_FUZZYNESS (600) |
| #define | MAX_SAGEDATA_AGE (4*86400) |
| #define | MAX_LONGINFOS_AGE (86400+100) |
| #define | MAX_LONGINFOS_AGE_TIMEOUT (10*86400+100) |
| #define | MAX_GPS_TOP_OLDNESS (86400+100) |
| #define | DISK_REMAINING_THRESHOLD (3*86400) |
| #define | POWER_REMAINING_THRESHOLD (3*86400) |
| #define | INTERNAL_BATTERY_MIN_LEVEL (6.0) |
| #define | INTERNAL_BATTERY_MAX_LEVEL (9.0) |
| #define | POWER_LEVEL_THRESHOLD (11.5) |
| #define | REBOOT_DELAY (86400/2) |
| #define | MAX_STRING_LENGTH 64 |
| #define | OSIRIS_ERROR_MESSAGES 20 |
| #define | OSIRIS_ERROR_MESSAGE_LENGTH 255 |
| #define | IFNAMSIZ 16 |
| #define | STATNAMELEN 12 |
| #define | COUNT(i) { if (acquisit_Fs##i.value.d>0) { myShi.activeChannels++; } } |
| #define | DoItForChannel(dd) |
Enumerations | |
| enum | { TYPE_Y = 1, TYPE_B, TYPE_T, TYPE_F, TYPE_S, TYPE_O, TYPE_D, TYPE_C, TYPE_H, TYPE_f, TYPE_G } |
Functions | |
| void | ReadShortInfos (void) |
| read the shi file and overload the curent information | |
| int | ReadField (char *line) |
| read a name/value pair and store the value for the 'name' structure | |
| void | PrintField (FILE *f, char *pre, struct OsirisInformationField *field, char *post) |
| print a field, with, prefix and postfix | |
| void | DumpOIF (void) |
| dump the OIF fields | |
| void | PrintStaLta (FILE *f) |
| print STA and LTA values | |
| void | PrintIdentification (FILE *f) |
| print the general identification fields | |
| void | PrintHealth (FILE *f) |
| print the time fields | |
| void | PrintTime (FILE *f) |
| print the time fields | |
| void | PrintGPS (FILE *f) |
| print the time fields | |
| void | PrintDisk (FILE *f) |
| print the disk fields | |
| void | PrintFTP (FILE *f) |
| print the ftp fields | |
| void | PrintTrigger (FILE *f) |
| print the trigger fields | |
| void | PrintSLServer (FILE *f) |
| print the slserver fields | |
| void | PrintLinks (FILE *f, char *name) |
| insert a short local link line | |
| void | PrintAlerts (FILE *f) |
| print the alert list, if any | |
| void | DumpHTML (FILE *f) |
| dump the OIF structure content in a HTML file f the stream to send the html source to | |
| int | ParseOifOptions (char *cmd) |
| parse the oif option | |
| void | ReadOEF (void) |
| read the OEF file if defined and fill osirisErrorMessages | |
| void | CheckAlerts (struct OsirisAlert *table, char *output, char *html, char *tip) |
| check for alerts and warnings | |
| void | ReadOIF (char *file) |
| read the OIF and dump the HTML file set | |
| void | DumpGpsMap (void) |
| dump the GPS map | |
| void | DumpTile (void) |
| dump the tile | |
| void | ProcessOIF (char *file) |
| dump the HTML file set | |
Variables | |
| int | omniMode = 0 |
| int | verboseMode = 0 |
| int | doGpsMap = 0 |
| print also the verboseOnly fields | |
| int | doHtml = 1 |
| create the GPS map | |
| int | embedHtml = 0 |
| dump html page | |
| char | imagePrefix [256] |
| dump html without header | |
| int | alertFlag = 0 |
| current path, to be prepended before the image names | |
| char | osirisErrorMessage [OSIRIS_ERROR_MESSAGES][OSIRIS_ERROR_MESSAGE_LENGTH+1] |
| general alert flag | |
| char | osirisAlertFile [OSIRIS_ERROR_MESSAGE_LENGTH] |
| char | tileBaseName [OSIRIS_ERROR_MESSAGE_LENGTH] |
| char | osirisErrorFile [OSIRIS_ERROR_MESSAGE_LENGTH] |
| char | osirisShortInfoFile [OSIRIS_ERROR_MESSAGE_LENGTH] |
| int | doTile = 0 |
| struct ShortInfos | myShi |
| struct MessageType | myMessage |
| short information for the current station | |
| #define COUNT | ( | i | ) | { if (acquisit_Fs##i.value.d>0) { myShi.activeChannels++; } } |
Referenced by ReadShortInfos().
| #define DoItForChannel | ( | dd | ) |
Value:
if (acquisit_Sta##dd.valid) \ { \ if (verboseMode) \ fprintf(f,"<tr ALIGN=center><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr>", \ dd,acquisit_Sta##dd.value.d, \ acquisit_Lta##dd.value.d, \ acquisit_Fs##dd.value.d); \ else \ fprintf(f,"<tr ALIGN=center><td>%d</td><td>%d</td></tr>", \ dd,\ acquisit_Fs##dd.value.d); \ }
Referenced by PrintStaLta().
| #define INTERNAL_BATTERY_MAX_LEVEL (9.0) |
| #define INTERNAL_BATTERY_MIN_LEVEL (6.0) |
| #define MAX_FUZZYNESS (600) |
Definition at line 43 of file oif.c.
Referenced by CheckAcquisitDiskmgrTime(), and CheckRecordingAge().
| #define MAX_GPS_TOP_OLDNESS (86400+100) |
| #define MAX_LONGINFOS_AGE (86400+100) |
| #define MAX_LONGINFOS_AGE_TIMEOUT (10*86400+100) |
Definition at line 46 of file oif.c.
Referenced by CheckLastInformationTime(), CheckSageLastData(), and CheckSageLastEventList().
| #define MAX_SAGEDATA_AGE (4*86400) |
Definition at line 44 of file oif.c.
Referenced by CheckSageLastData(), and CheckSageLastEventList().
| #define MAX_STRING_LENGTH 64 |
| #define OSIRIS_ERROR_MESSAGE_LENGTH 255 |
| #define OSIRIS_ERROR_MESSAGES 20 |
| #define POWER_LEVEL_THRESHOLD (11.5) |
| #define POWER_REMAINING_THRESHOLD (3*86400) |
| #define REBOOT_DELAY (86400/2) |
| anonymous enum |
| void CheckAlerts | ( | struct OsirisAlert * | table, | |
| char * | output, | |||
| char * | html, | |||
| char * | tip | |||
| ) |
check for alerts and warnings
| table | the alert table to process |
Definition at line 1964 of file oif.c.
References alertFlag, OSIRIS_ERROR_MESSAGE_LENGTH, PrintError, and Rename().
Referenced by ProcessOIF().
| void DumpGpsMap | ( | void | ) |
dump the GPS map
Definition at line 2113 of file oif.c.
References doGpsMap, doTile, gpsd_Sat00Az, gpsd_Sat01Az, gpsd_Sat02Az, gpsd_Sat03Az, gpsd_Sat04Az, gpsd_Sat05Az, gpsd_Sat06Az, gpsd_Sat07Az, gpsd_Sat08Az, gpsd_Sat09Az, gpsd_Sat10Az, gpsd_Sat11Az, gpsd_Sat12Az, gpsd_Sat13Az, gpsd_Sat14Az, gpsd_Sat15Az, gpsd_Sat16Az, gpsd_Sat17Az, gpsd_Sat18Az, gpsd_Sat19Az, gpsd_Sat20Az, gpsd_Sat21Az, gpsd_Sat22Az, gpsd_Sat23Az, gpsd_Sat24Az, gpsd_Sat25Az, gpsd_Sat26Az, gpsd_Sat27Az, gpsd_Sat28Az, gpsd_Sat29Az, gpsd_Sat30Az, gpsd_Sat31Az, gpsd_Sat32Az, PrintError, Rename(), and tileBaseName.
Referenced by ProcessOIF().
| void DumpHTML | ( | FILE * | f | ) |
dump the OIF structure content in a HTML file f the stream to send the html source to
Definition at line 1716 of file oif.c.
References comd_Hostid, comd_StationName, doTile, embedHtml, imagePrefix, OSIRIS_ERROR_MESSAGES, osirisErrorMessage, PrintDisk(), PrintFTP(), PrintGPS(), PrintHealth(), PrintIdentification(), PrintLinks(), PrintSLServer(), PrintStaLta(), PrintTime(), PrintTrigger(), tileBaseName, and verboseMode.
Referenced by ProcessOIF().
| void DumpOIF | ( | void | ) |
| void DumpTile | ( | void | ) |
dump the tile
Definition at line 2159 of file oif.c.
References doTile, PrintError, Rename(), and tileBaseName.
Referenced by ProcessOIF().
| int ParseOifOptions | ( | char * | cmd | ) |
parse the oif option
| cmd | the option string |
Definition at line 1789 of file oif.c.
References doGpsMap, doHtml, doTile, embedHtml, imagePrefix, osirisAlertFile, osirisErrorFile, osirisShortInfoFile, PrintDebug, PrintError, tileBaseName, and verboseMode.
Referenced by ParseOptions().
| void PrintAlerts | ( | FILE * | f | ) |
| void PrintDisk | ( | FILE * | f | ) |
print the disk fields
| f | the output stream |
Definition at line 1569 of file oif.c.
References diskmgr_DirectDisk, diskmgr_EndTime, diskmgr_ExtStorMountReq, diskmgr_FlashRate, diskmgr_Flush, diskmgr_ForceStorageWrite, diskmgr_IntStorMountReq, diskmgr_LastAcquisitCorrectedTime, diskmgr_LastFlushTime, diskmgr_lastWriteTime, diskmgr_Radio, diskmgr_RadioStartTime, diskmgr_Record, diskmgr_StartTime, diskmgr_StorageNoCache, diskmgr_StorageRate, diskmgr_StorageRemainingTime, diskmgr_StorageSerialNumber, diskmgr_StorageStatus, diskmgr_Throughput, and PrintField().
Referenced by DumpHTML().
| void PrintField | ( | FILE * | f, | |
| char * | pre, | |||
| struct OsirisInformationField * | field, | |||
| char * | post | |||
| ) |
print a field, with, prefix and postfix
| f | the strem to send printings to | |
| pre | the prefix, may be NULL | |
| field | the field | |
| post | the postfix, may be NULL |
Definition at line 1184 of file oif.c.
References MaskToList(), omniMode, TYPE_B, TYPE_C, TYPE_D, TYPE_f, TYPE_F, TYPE_G, TYPE_H, TYPE_O, TYPE_S, TYPE_T, TYPE_Y, and verboseMode.
Referenced by PrintDisk(), PrintFTP(), PrintGPS(), PrintHealth(), PrintIdentification(), PrintSLServer(), PrintTime(), and PrintTrigger().
| void PrintFTP | ( | FILE * | f | ) |
print the ftp fields
| f | the output stream |
Definition at line 1622 of file oif.c.
References diskmgr_ftpConnection, diskmgr_ftpCurrentFile, ftpdisk_nextFtpCycle, and PrintField().
Referenced by DumpHTML().
| void PrintGPS | ( | FILE * | f | ) |
print the time fields
| f | the output stream |
Definition at line 1509 of file oif.c.
References doGpsMap, gpsd_Alt, gpsd_AvgAlt, gpsd_AvgLat, gpsd_AvgLon, gpsd_externMode, gpsd_GpsHdop, gpsd_GpsNasa, gpsd_GpsNbPulses, gpsd_GpsNsav, gpsd_GpsOldness, gpsd_GpsPdop, gpsd_GpsPosValid, gpsd_GpsStartTime, gpsd_GpsState, gpsd_GpsTdop, gpsd_GpsTime, gpsd_GpsTimeValid, gpsd_GpsTShift, gpsd_GpsVdop, gpsd_Lat, gpsd_Long, gpsd_MsgTime, gpsd_NMEAThroughput, imagePrefix, PrintField(), and tileBaseName.
Referenced by DumpHTML().
| void PrintHealth | ( | FILE * | f | ) |
print the time fields
| f | the output stream |
Definition at line 1428 of file oif.c.
References PrintField(), sysd_AdcEnv0, sysd_AdcEnv1, sysd_AdcEnv2, sysd_AdcEnv3, sysd_AdcEnv4, sysd_BattRemaining, sysd_BattState, sysd_CPULoad, sysd_ExtBat, sysd_IntBat, sysd_IntTemp, sysd_RS232Power, sysd_SeismoPower, sysd_StartTime, and sysd_TrueIntBat.
Referenced by DumpHTML().
| void PrintIdentification | ( | FILE * | f | ) |
print the general identification fields
| f | the output stream |
Definition at line 1371 of file oif.c.
References acquisit_ADCDelay, acquisit_ADCFrequency, acquisit_ADCPrimDecim, acquisit_ADCPrimDecimLength, acquisit_ADCSecDecimLength, acquisit_ADCType, acquisit_AdjustClock, acquisit_DspRate, acquisit_DspRelease, acquisit_DspSaveTime, ADCName(), comd_Hostid, comd_MessageFlag, comd_StationName, PrintField(), sysd_OsirisHasGain, sysd_OsirisModel, sysd_OsirisPhysicalChannels, sysd_OsirisSoftwareRelease, and verboseMode.
Referenced by DumpHTML().
| void PrintLinks | ( | FILE * | f, | |
| char * | name | |||
| ) |
insert a short local link line
| f | ||
| name | a local page target |
Definition at line 1686 of file oif.c.
References verboseMode.
Referenced by DumpHTML().
| void PrintSLServer | ( | FILE * | f | ) |
print the slserver fields
| f | the output stream |
Definition at line 1654 of file oif.c.
References PrintField(), slserver_ChannelMask, slserver_ClientIP, slserver_IgnoreMask, slserver_ReadFrame, slserver_ReadNdx, slserver_Sequence, slserver_SLActivity, slserver_SLIOclock, slserver_SLQuality, slserver_WriteFrame, and slserver_WriteNdx.
Referenced by DumpHTML().
| void PrintStaLta | ( | FILE * | f | ) |
print STA and LTA values
| f | the output stream |
Definition at line 1317 of file oif.c.
References DoItForChannel, and verboseMode.
Referenced by DumpHTML().
| void PrintTime | ( | FILE * | f | ) |
print the time fields
| f | the output stream |
Definition at line 1470 of file oif.c.
References acquisit_ClockState, acquisit_CorrectedTime, acquisit_DeltaDspSys, acquisit_Drift, acquisit_LastDSPTimeSet, acquisit_LastGpsTop, acquisit_LastShift, acquisit_TargetShift, gpsd_GpsTime, gpsd_LastTimeSent, gpsd_LocalTimeCorrection, gpsd_SystemTime, and PrintField().
Referenced by DumpHTML().
| void PrintTrigger | ( | FILE * | f | ) |
print the trigger fields
| f | the output stream |
Definition at line 1637 of file oif.c.
References PrintField(), trigger_n1, trigger_n2, trigger_n3, and trigger_n4.
Referenced by DumpHTML().
| void ProcessOIF | ( | char * | file | ) |
dump the HTML file set
| file | the file to read |
Definition at line 2187 of file oif.c.
References AlertTable, CheckAlerts(), comd_Hostid, doHtml, DumpGpsMap(), DumpHTML(), DumpTile(), MykerinosRAlertTable, osirisAlertFile, PrintError, ReadOEF(), ReadOIF(), ReadShortInfos(), sysd_OsirisModel, and WarningTable.
Referenced by ParseOptions().
| int ReadField | ( | char * | line | ) |
read a name/value pair and store the value for the 'name' structure
| line | the line containing the pair name/value |
Definition at line 1062 of file oif.c.
References MAX_STRING_LENGTH, OIFList, PrintDebug, PrintError, TYPE_B, TYPE_C, TYPE_D, TYPE_f, TYPE_F, TYPE_G, TYPE_H, TYPE_O, TYPE_S, TYPE_T, and TYPE_Y.
Referenced by ReadOIF().
| void ReadOEF | ( | void | ) |
read the OEF file if defined and fill osirisErrorMessages
Definition at line 1929 of file oif.c.
References OSIRIS_ERROR_MESSAGE_LENGTH, OSIRIS_ERROR_MESSAGES, osirisErrorFile, osirisErrorMessage, and PrintError.
Referenced by ProcessOIF().
| void ReadOIF | ( | char * | file | ) |
read the OIF and dump the HTML file set
Definition at line 2068 of file oif.c.
References gpsd_SystemTime, MAX_STRING_LENGTH, PrintError, ReadField(), sysd_BattRemaining, sysd_BattState, sysd_ExtBat, and sysd_OsirisModel.
Referenced by ParseOptions(), and ProcessOIF().
| void ReadShortInfos | ( | void | ) |
read the shi file and overload the curent information
| shi | the pointer to the short infos structure |
Definition at line 161 of file oif.c.
References acquisit_CorrectedTime, acquisit_DspRate, comd_Hostid, comd_MessageFlag, COUNT, diskmgr_DirectDisk, diskmgr_FlashRate, diskmgr_FlashStatus, diskmgr_Flush, diskmgr_ForceStorageWrite, diskmgr_LastAcquisitCorrectedTime, diskmgr_Record, diskmgr_StorageRate, diskmgr_StorageRemainingTime, diskmgr_StorageStatus, gpsd_GpsNasa, gpsd_GpsState, gpsd_OnOff, gpsd_SystemTime, myMessage, myShi, osirisShortInfoFile, and PrintDebug.
Referenced by ProcessOIF().
| int alertFlag = 0 |
current path, to be prepended before the image names
Definition at line 68 of file oif.c.
Referenced by CheckAlerts().
| int doGpsMap = 0 |
print also the verboseOnly fields
Definition at line 64 of file oif.c.
Referenced by DumpGpsMap(), ParseOifOptions(), and PrintGPS().
| int doHtml = 1 |
create the GPS map
Definition at line 65 of file oif.c.
Referenced by ParseOifOptions(), and ProcessOIF().
| int doTile = 0 |
Definition at line 89 of file oif.c.
Referenced by DumpGpsMap(), DumpHTML(), DumpTile(), and ParseOifOptions().
| int embedHtml = 0 |
dump html page
Definition at line 66 of file oif.c.
Referenced by DumpHTML(), and ParseOifOptions().
| char imagePrefix[256] |
dump html without header
Definition at line 67 of file oif.c.
Referenced by DumpHTML(), ParseOifOptions(), and PrintGPS().
| struct MessageType myMessage |
short information for the current station
Definition at line 138 of file oif.c.
Referenced by CheckProcessAcquisit(), CheckProcessConfiguration(), CheckProcessDiskmgr(), CheckProcessGpsd(), CheckProcessOshCmd(), CheckProcessOshWww(), CheckProcessSysd(), CheckProcessTrigger(), and ReadShortInfos().
| struct ShortInfos myShi |
Definition at line 137 of file oif.c.
Referenced by CheckProcessAcquisit(), CheckProcessConfiguration(), CheckProcessDiskmgr(), CheckProcessGpsd(), CheckProcessOshCmd(), CheckProcessOshWww(), CheckProcessSysd(), CheckProcessTrigger(), CheckStorageDisk(), CheckStorageError(), and ReadShortInfos().
| int omniMode = 0 |
| char osirisAlertFile[OSIRIS_ERROR_MESSAGE_LENGTH] |
| char osirisErrorFile[OSIRIS_ERROR_MESSAGE_LENGTH] |
| char osirisErrorMessage[OSIRIS_ERROR_MESSAGES][OSIRIS_ERROR_MESSAGE_LENGTH+1] |
| char osirisShortInfoFile[OSIRIS_ERROR_MESSAGE_LENGTH] |
| char tileBaseName[OSIRIS_ERROR_MESSAGE_LENGTH] |
Definition at line 72 of file oif.c.
Referenced by DumpGpsMap(), DumpHTML(), DumpTile(), ParseOifOptions(), and PrintGPS().
| int verboseMode = 0 |
Definition at line 63 of file oif.c.
Referenced by DumpHTML(), ParseOifOptions(), PrintField(), PrintIdentification(), PrintLinks(), and PrintStaLta().
1.5.6