00001
00002
00003
00004 #include "cddefines.h"
00005 #include "timesc.h"
00006 #include "parse.h"
00007
00008 void ParseAge(char *chCard )
00009 {
00010 bool lgEOL;
00011 long int i;
00012
00013 DEBUG_ENTRY( "ParseAge()" );
00014
00015
00016
00017
00018 i = 4;
00019 timesc.CloudAgeSet = (float)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00020
00021
00022 if( lgEOL && (!nMatch(" OFF",chCard)) )
00023 {
00024 fprintf( ioQQQ, " The age must be on this line.\n" );
00025 puts( "[Stop in getage]" );
00026 cdEXIT(EXIT_FAILURE);
00027 }
00028
00029
00030 if( nMatch(" LOG",chCard) )
00031 {
00032 timesc.CloudAgeSet = (float)pow(10.f,timesc.CloudAgeSet);
00033 }
00034
00035
00036 if( nMatch("MILL",chCard) )
00037 {
00038
00039 timesc.CloudAgeSet *= (float)(3.15569e7*1000.);
00040 }
00041 else if( nMatch("CENT",chCard) )
00042 {
00043
00044 timesc.CloudAgeSet *= (float)(3.15569e7*100.);
00045 }
00046 else if( nMatch("YEAR",chCard) )
00047 {
00048
00049 timesc.CloudAgeSet *= 3.15569e7;
00050 }
00051 else if( nMatch("MONT",chCard) )
00052 {
00053
00054 timesc.CloudAgeSet = (float)(timesc.CloudAgeSet*3.15569e7/12.);
00055 }
00056 else if( nMatch("FORT",chCard) )
00057 {
00058
00059 timesc.CloudAgeSet *= 24.f*3600.f*14.f;
00060 }
00061 else if( nMatch("WEEK",chCard) )
00062 {
00063
00064 timesc.CloudAgeSet *= 24.f*3600.f*7.f;
00065 }
00066 else if( nMatch("DAY ",chCard) )
00067 {
00068
00069 timesc.CloudAgeSet *= 24.f*3600.f;
00070 }
00071 else if( nMatch("HOUR",chCard) )
00072 {
00073
00074 timesc.CloudAgeSet *= 3600.f;
00075 }
00076 else if( nMatch("MINU",chCard) )
00077 {
00078
00079 timesc.CloudAgeSet *= 60.f;
00080 }
00081 else if( nMatch("SECO",chCard) )
00082 {
00083
00084 timesc.CloudAgeSet *= 1.f;
00085 }
00086
00087 DEBUG_EXIT( "ParseAge()" );
00088
00089 return;
00090 }
00091