#include "qsstvglobal.h" #include "sstvparam.h" #include "utils.h" double lineTimeTable[MAXLINES+1]; sSSTVParam activeSSTVParam; /*! \fn setupLineTimeTable(sstvMode modeIndex,double clock) \brief setup the lineTable Setup a table containing the relative positions expressed in samples \param modeIndex index of the differnt modes: Martin1=0 , .... \param clock the adjusted samplingrate */ void setupLineTimeTable(sstvMode modeIndex,double clock) { unsigned int i; for (i=1;i<=SSTVTable[(int)modeIndex].numberOfLines;i++) { lineTimeTable[i-1]=((SSTVTable[(int)modeIndex].imageTime*((double)i))/(double)SSTVTable[(int)modeIndex].numberOfLines)*clock; } } void adaptLineTimeTable(unsigned int lineNumber,int diff) { unsigned int i; double df=(double) diff; df=df/lineNumber; for (i=lineNumber;itotalError2) { if (totalError2<0.001) return (sstvMode)lmode2; } else if (totalError1<0.001) return (sstvMode)lmode1; return NOTVALID; } const char *modesText[NUMMODES]= { "Martin 1", "Martin 2", "Scottie 1", "Scottie 2", "Scottie DX", "Wr.SC2 180", "Robot 24", "Robot 36", "Robot 72", "P3", "P5", "P7", "BW8", "BW12", "PD50", "PD90", "PD120", "PD160", "PD180", "PD240", "PD290", "CALIB" }; sSSTVParam SSTVTable[NUMMODES]= { {"Martin 1" ,"M1", 114.28860,320,256,0xAC,0.00500,0.00080,0.00000,0.00050,0.00500,0.00080,0.00000,0.00050}, {"Martin 2" ,"M2", 58.06000,320,256,0x28,0.00500,0.00080,0.00000,0.00050,0.00500,0.00080,0.00000,0.00050}, {"Scottie 1" ,"S1", 109.62350,320,256,0x3c,0.00900,0.00080,0.00125,0.00125,0.00900,0.00080,0.00080,0.00125}, {"Scottie 2" ,"S2", 71.08855,320,256,0xb8,0.00900,0.00080,0.00125,0.00125,0.00900,0.00000,0.00110,0.00125}, {"Scottie DX","SDX", 268.87680,320,256,0xcc,0.00900,0.00000,0.00000,0.00100,0.00900,0.00000,0.00000,0.00100}, {"Wr SC2 180","WS2", 182.03000,320,256,0xB7,0.00500,0.00000,0.00000,0.00000,0.00500,0.00000,0.00000,0.00000}, {"Robot 24", "R24", 24.00000,160,120,0x84,0.00600,0.00125,0.00125,0.00450,0.00600,0.00000,0.00190,0.00380}, {"Robot 36" ,"R36", 36.00000,320,240,0x88,0.00900,0.00100,0.00340,0.00820,0.00900,0.00000,0.00300,0.00540}, {"Robot 72" ,"R72", 72.00000,320,240,0x0C,0.00900,0.00040,0.00250,0.00600,0.00900,0.00040,0.00250,0.00600}, {"P3" ,"P3" , 203.04760,640,496,0x71,0.00520,0.00210,0.00080,0.00250,0.00520,0.00104,0.00104,0.00104}, {"P5" ,"P5" , 304.57050,640,496,0x72,0.00780,0.00160,0.00160,0.00160,0.00780,0.00160,0.00160,0.00160}, {"P7" ,"P7" , 406.09700,640,496,0xF3,0.01040,0.00210,0.00210,0.00210,0.01040,0.00210,0.00210,0.00210}, {"B/W 8" ,"BW8" , 8.02800,160,120,0x82,0.00600,0.00100,0.00100,0.00000,0.00600,0.00100,0.00100,0.00000}, {"B/W 12" ,"BW12" , 12.00000,160,120,0x86,0.00600,0.00100,0.00100,0.00000,0.00600,0.00100,0.00100,0.00000}, {"PD50" ,"PD50", 49.68400,320,256,0xDD,0.02000,0.00000,0.00230,0.00000,0.02000,0.00000,0.00230,0.00000}, {"PD90" ,"PD90", 89.98912,320,256,0x63,0.02000,0.00000,0.00230,0.00000,0.02000,0.00000,0.00230,0.00000}, {"PD120" ,"PD120", 126.10180,640,496,0x5F,0.02000,0.00080,0.00230,0.00000,0.02000,0.00000,0.00230,0.00000}, {"PD160" ,"PD160", 160.88120,512,400,0xE2,0.02000,0.00080,0.00230,0.00000,0.02000,0.00000,0.00230,0.00000}, {"PD180" ,"PD180", 187.05152,640,496,0x60,0.02000,0.00080,0.00230,0.00000,0.02000,0.00000,0.00230,0.00000}, {"PD240" ,"PD240", 248.00000,640,496,0xE1,0.02000,0.00080,0.00230,0.00000,0.02000,0.00000,0.00230,0.00000}, {"PD290" ,"PD290", 288.68224,800,616,0xDE,0.02000,0.00080,0.00230,0.00000,0.02000,0.00000,0.00230,0.00000}, {"Calibrate" ,"CALIB" ,256.00000,300,256,0x99,0.00000,0.00000,0.000000,0.0000,0.00000,0.00000,0.000000,0.0000} };