diff --git a/doc/NoiseUse.dox b/doc/NoiseUse.dox index cc214f65255a4d5e18894793efd8c2783807fdbc..78dafdb69e135607fc8ce1f71165da608f8df48d 100644 --- a/doc/NoiseUse.dox +++ b/doc/NoiseUse.dox @@ -15,8 +15,9 @@ This block utilizes the pseudo-random number generator from page 342 (section 7.1) of the third edition of Numerical recipies. It has been written as an inline function call. -This block utilizes the rdtscl c function once to get the system time to - set the initial random seed used by the generator for the entire model. +This block utilizes the rdtsc_ordered() function (kernel space) and +clock_gettime() (userspace) once to get the system time to set the +initial random seed used by the generator for the entire model. Each instance of this block then calls the same inline function to get a random number with equal probability between 0 and 1 on each cycle. diff --git a/src/epics/seq/CMakeLists.txt b/src/epics/seq/CMakeLists.txt index 3c9e1226b484e065e7b4226242dfadb56953c4b9..1eefade905f3de55de52695323f9ccd78596a68a 100644 --- a/src/epics/seq/CMakeLists.txt +++ b/src/epics/seq/CMakeLists.txt @@ -1,5 +1,6 @@ add_executable(test_sequencer_unit_tests test/test_main.cc + test/test_burtfile.cc test/test_simple_range.cc test/test_fixed_size_string.cc test/test_fixed_size_vector.cc diff --git a/src/epics/seq/burt_file.hh b/src/epics/seq/burt_file.hh new file mode 100644 index 0000000000000000000000000000000000000000..d7755ae4c44ef4c8fdabdb9984be18c726249216 --- /dev/null +++ b/src/epics/seq/burt_file.hh @@ -0,0 +1,149 @@ +// +// Created by jonathan.hanks on 4/2/22. +// + +#ifndef DAQD_TRUNK_BURT_FILE_HH +#define DAQD_TRUNK_BURT_FILE_HH + +#include "fixed_size_string.hh" +#include "fixed_size_vector.hh" + +namespace BURT +{ + + using parsed_word = embedded::fixed_string< 128 >; + using parsed_line = embedded::fixed_size_vector< parsed_word, 4 >; + + /** + * @brief Encode a string for output into a BURT file. + * @note BURT encoding of strings does not escape quotes, + * and lists empty strings as \0 (backslash and 0) + * + * @tparam SRC_SIZE + * @tparam DEST_SIZE Must be at least 2 greater than SRC_SIZE + * @param src Input string to encode. + * @param dest Destination for an encoded version of src. + */ + template < std::size_t SRC_SIZE, std::size_t DEST_SIZE > + void + encodeString( const embedded::fixed_string< SRC_SIZE >& src, + embedded::fixed_string< DEST_SIZE >& dest ) + { + static_assert( + DEST_SIZE >= ( SRC_SIZE + 2 ), + "The destination buffer must be at least bytes larger than " + "the source to account for quoting" ); + static_assert( + DEST_SIZE >= 2, + "The destination buffer must be long enough to burt encode " + "a NULL string" ); + + if ( src.empty( ) ) + { + dest = "\\0"; + return; + } + + bool expand = false; + + for ( char ch : src ) + { + if ( ch == ' ' || ch == '\t' || ch == '\n' || ch == '"' ) + { + expand = true; + break; + } + } + // we already bounds check this above + if ( expand ) + { + dest.printf( "\"%s\"", src.c_str( ) ); + } + else + { + dest = src; + } + } + + /// Common routine to parse lines read from BURT/SDF files.. + /// @param[in] *s Pointer to line of chars to parse. + /// @param[out] Output containing all the identified words in the line + /// @return wc Number of words in the line. + template < std::size_t N_WORDS, std::size_t WORD_LEN > + static inline int + parseLine( const char* s, + embedded::fixed_size_vector< embedded::fixed_string< WORD_LEN >, + N_WORDS >& out ) + { + int lastwasspace = 1; + + const char* lastquote = nullptr; + const char* qch = nullptr; + + out.clear( ); + embedded::fixed_string< WORD_LEN > cur_word{ }; + + while ( *s != 0 && *s != '\n' && out.capacity( ) > out.size( ) ) + { + if ( *s == ' ' || *s == '\t' ) + { + if ( !lastwasspace ) + { + out.push_back( cur_word ); + cur_word.clear( ); + } + lastwasspace = 1; + } + else if ( *s != '"' || !lastwasspace ) + { + cur_word += *s; + lastwasspace = 0; + } + else + { + // quote + // burt does not escape quotes, you have to look for the last + // quote and just take it. + lastquote = nullptr; + qch = s + 1; + + while ( *qch && *qch != '\n' ) + { + if ( *qch == '"' ) + lastquote = qch; + ++qch; + } + if ( !lastquote ) + lastquote = qch; + ++s; + // copy from (s,qch) then set lastwasspace + while ( s < lastquote ) + { + cur_word += *s; + ++s; + } + out.push_back( cur_word ); + cur_word.clear( ); + lastwasspace = 1; + if ( !( *s ) || *s == '\n' || out.size( ) == out.capacity( ) ) + break; + } + ++s; + } + if ( !cur_word.empty( ) ) + { + out.push_back( cur_word ); + } + for ( auto& word : out ) + { + if ( word == "\\0" ) + { + word = ""; + } + } + return out.size( ); + } + +} // namespace BURT + +#endif // DAQD_TRUNK_BURT_FILE_HH diff --git a/src/epics/seq/fixed_size_string.hh b/src/epics/seq/fixed_size_string.hh index 822db31163758b66b3499761419a7942c76e3dde..f457dc821f7d0d77a785722e57399b2f78f217ee 100644 --- a/src/epics/seq/fixed_size_string.hh +++ b/src/epics/seq/fixed_size_string.hh @@ -31,8 +31,9 @@ namespace embedded /** * @brief the buffer object is a way to get raw access to manipulate the - * fixed_string. It looses most protections of the fixed_string class, but - * ensures that the buffer is null terminated when the buffer is destroyed. + * fixed_string. It looses most protections of the fixed_string class, + * but ensures that the buffer is null terminated when the buffer is + * destroyed. */ class buffer { @@ -60,7 +61,7 @@ namespace embedded return buf_; } constexpr size_type - capacity( ) const noexcept + capacity( ) const noexcept { return max_size; } @@ -103,6 +104,18 @@ namespace embedded return *this; } + fixed_string& + operator+=( char in ) noexcept + { + if ( in && ( remaining( ) > 0 ) ) + { + size_type cur_size = size( ); + data_[ cur_size ] = in; + data_[ cur_size + 1 ] = 0; + } + return *this; + } + fixed_string& operator+=( const char* in ) noexcept { @@ -202,7 +215,7 @@ namespace embedded } constexpr size_type - capacity( ) const noexcept + capacity( ) const noexcept { return max_size; } @@ -213,6 +226,12 @@ namespace embedded return std::strlen( data_ ); } + bool + empty( ) const noexcept + { + return size( ) == 0; + } + const char* c_str( ) const noexcept { @@ -225,6 +244,18 @@ namespace embedded return data_; } + const char* + begin( ) const noexcept + { + return data_; + } + + const char* + end( ) const noexcept + { + return data_ + size( ); + } + void pop_back_n( size_type n ) noexcept { @@ -260,7 +291,7 @@ namespace embedded } static constexpr size_type - last_index( ) noexcept + last_index( ) noexcept { return max_size - 1; } diff --git a/src/epics/seq/main.cc b/src/epics/seq/main.cc index bee8345db5be119053fd1a7a662a2c313406a7aa..695027a1d91d4cdd142e36d49ae7ae10228098b0 100644 --- a/src/epics/seq/main.cc +++ b/src/epics/seq/main.cc @@ -54,6 +54,7 @@ extern "C" { #include "envDefs.h" #include "math.h" #include "rcgversion.h" +#include "burt_file.hh" #include "sdf_file_loaded.h" #include "util/user/check_file_crc.h" @@ -152,7 +153,7 @@ unsigned int fltrConst[17] = {16, 64, 256, 1024, 4096, 16384, }; union Data { double chval; - char strval[64]; + fixed_string<64> strval{}; }; /// Structure for holding BURT settings in local memory. @@ -319,7 +320,6 @@ void newfilterstats(); template <std::size_t entry_count> int writeEpicsDb(fixed_size_vector<CDS_CD_TABLE, entry_count>&,int); int readConfig( const char *, const char *,int, const char *); -int parseLine(char *, int,char *,char *,char *,char *,char *,char *); int modifyTable(table_range); template <std::size_t entry_count> int resetSelectedValues(fixed_size_vector<SET_ERR_TABLE, entry_count>&); @@ -521,96 +521,18 @@ bool isAlarmChannelRaw(const char* chname) { { return false; } - return ((strstr(chname,".HIGH") != NULL) || - (strstr(chname,".HIHI") != NULL) || - (strstr(chname,".LOW") != NULL) || - (strstr(chname,".LOLO") != NULL) || - (strstr(chname,".HSV") != NULL) || - (strstr(chname,".OSV") != NULL) || - (strstr(chname,".ZSV") != NULL) || - (strstr(chname,".LSV") != NULL) ); -} - -/// Common routine to parse lines read from BURT/SDF files.. -/// @param[in] *s Pointer to line of chars to parse. -/// @param[in] bufSize Size in characters of each output buffer str1 thru str6 -/// @param[out] str1 thru str6 String pointers to return individual words from line. -/// @return wc Number of words in the line. -int parseLine(char *s, int bufSize, char *str1, char *str2, char *str3, char *str4, char *str5,char *str6) -{ - int wc = 0; - int ii = 0; - int cursize = 0; - int lastwasspace = 0; - - char *lastquote = 0; - char *qch = 0; - char *out[7]; - - out[0]=str1; - out[1]=str2; - out[2]=str3; - out[3]=str4; - out[4]=str5; - out[5]=str6; - out[6]=0; - for (ii = 0; out[ii]; ++ii) { *(out[ii]) = '\0'; } - - while (*s != 0 && *s != '\n') { - if (*s == '\t') *s = ' '; - if (*s == ' ') { - // force the null termination of the output buffer - out[wc][bufSize-1] = '\0'; - if (!lastwasspace) { - ++wc; - // check for the end of the output buffers - if (!out[wc]) break; - } - lastwasspace = 1; - cursize = 0; - } else if (*s != '"' || !lastwasspace) { - // regular character - if (cursize < bufSize) { - strncat(out[wc], s, 1); - cursize++; - } - lastwasspace = 0; - } else { - // quote - // burt does not escape quotes, you have to look for the last quote and just take it. - lastquote = 0; - qch = s+1; - - while (*qch && *qch !='\n') { - if (*qch == '"') lastquote = qch; - ++qch; - } - if (!lastquote) lastquote = qch; - ++s; - // copy from (s,qch) then set lastwasspace - while (s < lastquote) { - if (cursize < bufSize) { - strncat(out[wc], s, 1); - cursize++; - } - ++s; - } - ++wc; - lastwasspace = 1; - if (!(*s) || *s == '\n' || !out[wc]) break; - } - ++s; - } - if (out[wc] && out[wc][0]) { - out[wc][bufSize-1]='\0'; - ++wc; - } - for (ii = 0; out[ii]; ++ii) { - if (strcmp(out[ii], "\\0") == 0) strcpy(out[ii], ""); - } - return wc; + return ((strstr(chname,".HIGH") != nullptr) || + (strstr(chname,".HIHI") != nullptr) || + (strstr(chname,".LOW") != nullptr) || + (strstr(chname,".LOLO") != nullptr) || + (strstr(chname,".HSV") != nullptr) || + (strstr(chname,".OSV") != nullptr) || + (strstr(chname,".ZSV") != nullptr) || + (strstr(chname,".LSV") != nullptr) ); } + + /// Common routine to clear all entries for table changes.. /// @param[in] numEntries Number of entries in the table. /// @param[in] dcsErrtable Pointer to table @@ -627,7 +549,6 @@ void clearTableSelections(fixed_size_vector<SET_ERR_TABLE, entry_count>& dcsErrT } } - /// Common routine to set all entries for table changes.. /// @param[in] numEntries Number of entries in the table. /// @param[in] dcsErrtable Pointer to table @@ -1009,9 +930,9 @@ void logFileEntry(const char *message) static std::unique_ptr < std::FILE, std::function<void(std::FILE*) > > fp = nullptr; static bool open_attempted = false; - embedded::fixed_string<256> timestring{}; - dbAddr paddr; - getSdfTime(timestring); + embedded::fixed_string<256> timestring{}; + dbAddr paddr; + getSdfTime(timestring); if(fp.get() == nullptr && !open_attempted ) { @@ -1023,7 +944,7 @@ void logFileEntry(const char *message) if(fp.get() == NULL) { dbNameToAddr(reloadtimechannel, &paddr); dbPutField(&paddr, DBR_STRING, "ERR - NO LOG FILE FOUND",1); - std::string error_msg("Failed to open log file: : "); + embedded::fixed_string<256> error_msg( "Failed to open log file: "); error_msg += logfilename; error_msg += " : "; perror(error_msg.c_str()); @@ -1066,39 +987,13 @@ void getEpicsSettings() result.data.chval = (entry.filterswitch ? (int) dval & 0xffff : dval); } } else { - GET_VALUE_STR(geaddr,result.data.strval, sizeof(result.data.strval),change_t, NULL); + GET_VALUE_STR(geaddr,result.data.strval, change_t, NULL); } } return result; }); } -void encodeBURTString(const char *src, char *dest, int dest_size) { - const char *ch = 0; - int expand = 0; - - if (!src || !dest || dest_size < 1) return; - dest[0]='\0'; - // make sure the destination can handle expansion which is two characters + a NULL - if (dest_size < (strlen(src) + 3)) return; - if (strlen(src) == 0) { - strcpy(dest, "\\0"); - } else { - for (ch = src; *ch; ++ch) { - if (*ch == ' ' || *ch == '\t' || *ch == '\n' || *ch == '"') { - expand = 1; - break; - } - } - // we already bounds check this above - if (expand) { - sprintf(dest, "\"%s\"", src); - } else { - strcpy(dest, src); - } - } -} - // writeTable2File ftype options: #define SDF_WITH_INIT_FLAG 0 #define SDF_FILE_PARAMS_ONLY 1 @@ -1111,11 +1006,12 @@ bool writeTable2File(const char *burtdir, fixed_size_vector<CDS_CD_TABLE, entry_count>& myTable) ///< Table to be written. { int ii; - FILE *csFile=0; - char filemsg[128]; + FILE *csFile=nullptr; + embedded::fixed_string<128> filemsg; embedded::fixed_string<256> timestring; - char monitorstring[128]; - char burtString[64+2]; + embedded::fixed_string<128> monitorstring; + + embedded::fixed_string<64+2> burtString; #ifdef CA_SDF int precision = 20; #else @@ -1123,12 +1019,12 @@ bool writeTable2File(const char *burtdir, #endif // Write out local monitoring table as snap file. errno=0; - burtString[0] = '\0'; + burtString = ""; csFile = fopen(filename,"w"); - if (csFile == NULL) + if (csFile == nullptr) { - sprintf(filemsg,"ERROR Failed to open %s - %s",filename,strerror(errno)); - logFileEntry(filemsg); + filemsg.printf("ERROR Failed to open %s - %s",filename,strerror(errno)); + logFileEntry(filemsg.c_str()); return(false); } // Write BURT header @@ -1149,44 +1045,48 @@ bool writeTable2File(const char *burtdir, { if (entry.filterswitch) { if ((entry.mask & ALL_SWSTAT_BITS)== ~0) { - strcpy(monitorstring, "1"); + monitorstring = "1"; } else if ((entry.mask & ALL_SWSTAT_BITS) == 0) { - strcpy(monitorstring, "0"); + monitorstring = "0"; } else { - snprintf(monitorstring, sizeof(monitorstring), "0x%x", entry.mask); - } + monitorstring.printf("0x%x", entry.mask); + } } else { if (entry.mask) - strcpy(monitorstring,"1"); - else - strcpy(monitorstring,"0"); - } + { + monitorstring = "1"; + } else + { + monitorstring = "0"; + } + } switch(ftype) { case SDF_WITH_INIT_FLAG: if(myTable[ii].datatype == SDF_NUM) { - fprintf(csFile,"%s %d %.*e %s %d\n",entry.chname,1,precision,entry.data.chval,monitorstring,entry.initialized); + fprintf(csFile,"%s %d %.*e %s %d\n",entry.chname.c_str(),1,precision,entry.data.chval,monitorstring.c_str(),entry.initialized); } else { - encodeBURTString(entry.data.strval, burtString, sizeof(burtString)); - fprintf(csFile,"%s %d %s %s %d\n",entry.chname,1,burtString,monitorstring,entry.initialized); + BURT::encodeString( entry.data.strval, burtString ); + fprintf(csFile,"%s %d %s %s %d\n",entry.chname.c_str(),1,burtString.c_str(),monitorstring.c_str(),entry.initialized); } break; case SDF_FILE_PARAMS_ONLY: if(entry.initialized) { if(entry.datatype == SDF_NUM) { - fprintf(csFile,"%s %d %.*e %s\n",entry.chname,1,precision,entry.data.chval,monitorstring); + fprintf(csFile,"%s %d %.*e %s\n",entry.chname.c_str(),1,precision,entry.data.chval,monitorstring.c_str()); } else { - encodeBURTString(entry.data.strval, burtString, sizeof(burtString)); - fprintf(csFile,"%s %d %s %s\n",entry.chname,1,burtString,monitorstring); + BURT::encodeString( entry.data.strval, + burtString ); + fprintf(csFile,"%s %d %s %s\n",entry.chname.c_str(),1,burtString.c_str(),monitorstring.c_str()); } } break; case SDF_FILE_BURT_ONLY: if(entry.datatype == SDF_NUM) { - fprintf(csFile,"%s %d %.*e\n",entry.chname,1,precision,entry.data.chval); + fprintf(csFile,"%s %d %.*e\n",entry.chname.c_str(),1,precision,entry.data.chval); } else { - encodeBURTString(entry.data.strval, burtString, sizeof(burtString)); - fprintf(csFile,"%s %d %s \n",entry.chname,1,burtString); + BURT::encodeString( entry.data.strval, burtString ); + fprintf(csFile,"%s %d %s \n",entry.chname.c_str(),1,burtString.c_str()); } break; default: @@ -1209,8 +1109,8 @@ int appendAlarms2File( { char sdffilename[256]; char alarmfilename[256]; -FILE *cdf=0; -FILE *adf=0; +FILE *cdf=nullptr; +FILE *adf=nullptr; char line[128]; char errMsg[128]; int lderror = 0; @@ -1218,15 +1118,15 @@ int lderror = 0; sprintf(alarmfilename,"%s%s_alarms.snap",sdfdir,currentload); // printf("sdffile = %s \nalarmfile = %s\n",sdffilename,alarmfilename); adf = fopen(alarmfilename,"r"); - if(adf == NULL) return(-1); + if(adf == nullptr) return(-1); cdf = fopen(sdffilename,"a"); - if(cdf == NULL) { + if(cdf == nullptr) { sprintf(errMsg,"New SDF request ERROR: FILE %s DOES NOT EXIST\n",sdffilename); logFileEntry(errMsg); lderror = 4; return(lderror); } - while(fgets(line,sizeof line,adf) != NULL) + while(fgets(line,sizeof line,adf) != nullptr) { fprintf(cdf,"%s",line); } @@ -1427,7 +1327,7 @@ double liveval = 0.0; { #ifdef VERBOSE_DEBUG if (D_NOW) { - if (strcmp(cdTable[jj].chname, TEST_CHAN) == 0) { + if (strcmp(cdTable[jj].chname.c_str(), TEST_CHAN) == 0) { D("%s: init: %d mask: %d filter: %d\n", TEST_CHAN, cdTable[jj].initialized, cdTable[jj].mask, cdTable[jj].filterswitch); } } @@ -1443,7 +1343,7 @@ double liveval = 0.0; } // Uninitialized channels if(!cdTable[jj].initialized && !cdTable[jj].filterswitch) { - // printf("Chan %s not init %d %d %d\n",cdTable[jj].chname,cdTable[jj].initialized,jj,numEntries); + // printf("Chan %s not init %d %d %d\n",cdTable[jj].chname.c_str(),cdTable[jj].initialized,jj,numEntries); if(lna < SDF_ERR_TSIZE) { uninitChans[lna].chname = cdTable[jj].chname; if(cdTable[jj].datatype == SDF_NUM) { @@ -1617,7 +1517,7 @@ int minusOne = -1; { sprintf(s, "%s_%s_STAT%d", pref,"SDF_SP", lineNum); status = dbNameToAddr(s,&saddr); - //sprintf(stmp, "%s%s", (setErrTable[ii].filtNum >= 0 ? "* " : ""), setErrTable[ii].chname); + //sprintf(stmp, "%s%s", (setErrTable[ii].filtNum >= 0 ? "* " : ""), setErrTable[ii].chname.c_str()); status = dbPutField(&saddr,DBR_UCHAR,setErrTable[ii].chname.c_str(),flength); sprintf(s1, "%s_%s_STAT%d_BURT", pref,"SDF_SP", lineNum); @@ -1831,7 +1731,7 @@ int modifyTable(table_range modTable) if (cdTable[jj].chname == entry.chname) { if ( CHFLAG_ACCEPT_BIT(entry.chFlag) ) { if(cdTable[jj].datatype == SDF_NUM) cdTable[jj].data.chval = entry.liveval;/* atof(entry.liveset);*/ - else sprintf(cdTable[jj].data.strval,"%s",entry.liveset); + else cdTable[jj].data.strval = entry.liveset; cdTable[jj].initialized = 1; found = 1; fmIndex = cdTable[jj].filterNum; @@ -1894,7 +1794,7 @@ ADDRESS saddr; } GET_ADDRESS(cdTable[sn].chname,&saddr); if (cdTable[sn].datatype == SDF_NUM) PUT_VALUE(saddr,SDF_NUM,&(cdTable[sn].data.chval)); - else PUT_VALUE(saddr,SDF_STR,cdTable[sn].data.strval);; + else PUT_VALUE(saddr,SDF_STR,cdTable[sn].data.strval.c_str());; if(sn1) { GET_ADDRESS(cdTable[sn1].chname,&saddr); PUT_VALUE(saddr,SDF_NUM,&(cdTable[sn1].data.chval)); @@ -1909,7 +1809,7 @@ void newfilterstats() { ADDRESS paddr; long status; - FILE *log=0; + FILE *log=nullptr; fixed_string<128> chname; unsigned int mask = 0x1ffff; int tmpreq; @@ -1973,11 +1873,11 @@ int writeEpicsDb(fixed_size_vector<CDS_CD_TABLE, entry_count>& myTable, ///< Tab { PUT_VALUE(paddr,SDF_NUM,&(entry.data.chval)); } else { - PUT_VALUE(paddr,SDF_STR,entry.data.strval); + PUT_VALUE(paddr,SDF_STR,entry.data.strval.c_str()); } } else { // Write errors to chan not found table. - printf("CNF for %s = %d\n",entry.chname,status); + printf("CNF for %s = %d\n",entry.chname.c_str(),status); } } // Set the SDF_FILE_LOADED environment var to 1, @@ -2009,7 +1909,7 @@ int writeEpicsDb(fixed_size_vector<CDS_CD_TABLE, entry_count>& myTable, ///< Tab { PUT_VALUE(paddr,SDF_NUM,&(entry.data.chval)); } else { - PUT_VALUE(paddr,SDF_STR,entry.data.strval); + PUT_VALUE(paddr,SDF_STR,entry.data.strval.c_str()); } } } @@ -2031,12 +1931,11 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm int command, ///< Read file request type. const char *alarmfile) { - FILE *cdf=0; - FILE *adf=0; + FILE *cdf=nullptr; + FILE *adf=nullptr; char c=0; int ii=0; int lock=0; - char s1[128],s2[128],s3[128],s4[128],s5[128],s6[128],s7[128],s8[128]; char ls[6][64]; ADDRESS paddr; dbAddr reloadDbAddr; @@ -2047,7 +1946,7 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm int starttime=0,totaltime=0; embedded::fixed_string<256> timestring{}; char line[128]; - char *fs=0; + char *fs=nullptr; char ifo[4]; double tmpreq = 0; char fname[128]; @@ -2063,9 +1962,6 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm const static char* header_start = "--- Start"; const static char* header_end = "--- End"; - - - s1[0]=s2[0]=s3[0]=s4[0]=s5[0]=s6[0]=s7[0]=s8[0]='\0'; line[0]='\0'; ifo[0]='\0'; fname[0]=errMsg[0]='\0'; @@ -2082,7 +1978,7 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm } else { printf("PARTIAL %s\n",sdfile); cdf = fopen(sdfile,"r"); - if(cdf == NULL) { + if(cdf == nullptr) { snprintf(errMsg, 64, "New SDF request ERROR: FILE %s DOES NOT EXIST", sdfile); logFileEntry(errMsg); lderror = 4; @@ -2091,7 +1987,7 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm return(lderror); } adf = fopen(alarmfile,"w"); - if(adf == NULL) + if(adf == nullptr) { snprintf(errMsg, 64, "New SDF request ERROR: failed open alarm file"); logFileEntry(errMsg); @@ -2102,12 +1998,9 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm } chNumP = 0; alarmCnt = 0; - // Put dummy in s4 as this column may or may not exist. - strcpy(s4,"x"); - bzero(s3,sizeof(s3)); strncpy(ifo,pref,3); chNotFound = 0; - while(fgets(line,sizeof line,cdf) != NULL) + while(fgets(line,sizeof line,cdf) != nullptr) { if (in_header) @@ -2127,28 +2020,28 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm isalarm = 0; lineCnt ++; - strcpy(s4,"x"); - argcount = parseLine(line,sizeof(s1),s1,s2,s3,s4,s5,s6); - if (strcmp(s4, "") == 0) strcpy(s4, "0"); - if(argcount == -1) { - readErrTable[rderror].chname = s1; - readErrTable[rderror].burtset = "Improper quotations "; - readErrTable[rderror].liveset.printf("Line # %d", lineCnt); - readErrTable[rderror].liveval = 0.0; - readErrTable[rderror].diff = sdfile; - readErrTable[rderror].timeset = timestring; - rderror ++; - printf("Read error --- %s\n",s1); - continue; - } - // Only 3 = no monit flag - // >=4 count be monit flag or string with quotes + BURT::parsed_line words{}; + argcount = BURT::parseLine(line, words); + // Only 3 = no monit flag + // >=4 count be monit flag or string with quotes + if ( argcount < 3 ) + { + continue; + } + if ( argcount < 4 ) + { + words.push_back(BURT::parsed_word("0")); + } + const char* s1 = words[0].c_str(); + const char* s2 = words[1].c_str(); + const char* s3 = words[2].c_str(); + const char* s4 = words[3].c_str(); // If 1st three chars match IFO ie checking this this line is not BURT header or channel marked RO if( // Don't allow load of SWSTAT or SWMASK, which are set by this program. - strstr(s1,"_SWMASK") == NULL && - strstr(s1,"_SDF_NAME") == NULL && - strstr(s1,"_SWREQ") == NULL && + strstr(s1,"_SWMASK") == nullptr && + strstr(s1,"_SDF_NAME") == nullptr && + strstr(s1,"_SWREQ") == nullptr && argcount > 2) { // Load channel name into local table. @@ -2167,7 +2060,7 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm cdTableP[chNumP].mask = 0; if (cdTableP[chNumP].mask > 0) cdTableP[chNumP].mask = ~0; } - // printf("mask: %d %s\n", cdTableP[chNumP].mask, cdTableP[chNumP].chname); + // printf("mask: %d %s\n", cdTableP[chNumP].mask, cdTableP[chNumP].chname.c_str()); } else { cdTableP[chNumP].mask = 0; } @@ -2181,11 +2074,11 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm if(isdigit(s3[0])) { cdTableP[chNumP].datatype = SDF_NUM; cdTableP[chNumP].data.chval = atof(s3); - // printf("Alarm set - %s = %f\n",cdTableP[chNumP].chname,cdTableP[chNumP].data.chval); + // printf("Alarm set - %s = %f\n",cdTableP[chNumP].chname.c_str(),cdTableP[chNumP].data.chval); } else { cdTableP[chNumP].datatype = SDF_STR; - sprintf(cdTableP[chNumP].data.strval,"%s",s3); - // printf("Alarm set - %s = %s\n",cdTableP[chNumP].chname,cdTableP[chNumP].data.strval); + cdTableP[chNumP].data.strval = s3; + // printf("Alarm set - %s = %s\n",cdTableP[chNumP].chname.c_str(),cdTableP[chNumP].data.strval.c_str()); } fprintf(adf,"%s %s %s\n",s1,s2,s3); } @@ -2202,10 +2095,10 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm { // s3[strlen(s3) - 1] = 0; cdTableP[chNumP].datatype = SDF_STR; - sprintf(cdTableP[chNumP].data.strval,"%s",s3); + cdTableP[chNumP].data.strval = s3; if(command != SDF_LOAD_DB_ONLY) { - sprintf(cdTable[ii].data.strval,"%s",s3); + cdTable[ii].data.strval = s3; } } else { cdTableP[chNumP].datatype = SDF_NUM; @@ -2218,7 +2111,7 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm readErrTable[rderror].liveval = 0.0; readErrTable[rderror].diff = "MAX VAL = 0xffff"; readErrTable[rderror].timeset = timestring; - printf("Read error --- %s\n", cdTable[ii].chname); + printf("Read error --- %s\n", cdTable[ii].chname.c_str()); rderror ++; } cdTableP[chNumP].data.chval = (int) cdTableP[chNumP].data.chval & 0xffff; @@ -2233,12 +2126,12 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm } } } - // if(!fmatch) printf("NEW channel not found %s %d\n",cdTableP[chNumP].chname,chNumP); + // if(!fmatch) printf("NEW channel not found %s %d\n",cdTableP[chNumP].chname.c_str(),chNumP); } // The following loads info into the filter module table if a FM switch fmIndex = -1; - if(((strstr(s1,"_SW1S") != NULL) && (strstr(s1,"_SW1S.") == NULL)) || - ((strstr(s1,"_SW2S") != NULL) && (strstr(s1,"_SW2S.") == NULL))) + if(((strstr(s1,"_SW1S") != nullptr) && (strstr(s1,"_SW1S.") == nullptr)) || + ((strstr(s1,"_SW2S") != nullptr) && (strstr(s1,"_SW2S.") == nullptr))) { bzero(fname,sizeof(fname)); strncpy(fname,s1,(strlen(s1)-4)); @@ -2255,7 +2148,7 @@ int readConfig( const char *pref, ///< EPICS channel prefix from EPICS environm if(fmatch) { chNumP ++; } else { - // printf("CNF for %s \n",cdTableP[chNumP].chname); + // printf("CNF for %s \n",cdTableP[chNumP].chname.c_str()); if(chNotFound < SDF_ERR_TSIZE) { unknownChans[chNotFound].chname = cdTableP[chNumP].chname; if(GET_ADDRESS(cdTableP[chNumP].chname,&paddr)) { @@ -2454,7 +2347,7 @@ void processFMChanCommands( } } - printf("Signal 0x%x set on '%s' ref=0x%x pre=0x%x post=0x%x pre/post diff(%d,%d) chFlag = 0x%x\n", ctrl, filterTable[ii].fname, refMask, preMask, fMask[ii], differsPre, differsPost, foundCh); + printf("Signal 0x%x set on '%s' ref=0x%x pre=0x%x post=0x%x pre/post diff(%d,%d) chFlag = 0x%x\n", ctrl, filterTable[ii].fname.c_str(), refMask, preMask, fMask[ii], differsPre, differsPost, foundCh); dbPutField(&fmMaskAddr[ii],DBR_LONG,&(fMask[ii]),1); @@ -2493,7 +2386,7 @@ void updateStrVarSetPoint(int index) { if (caStringSetpointInitted[index] == 1) { - strcpy(cdTable[index].data.strval, caStringSetpoint[index]); + cdTable[index].data.strval = caStringSetpoint[index]; caStringSetpointInitted[index] = 2; } } @@ -2557,7 +2450,7 @@ bool syncEpicsDoubleValue(ADDRESS index, double *dest, time_t *tp, int *connp) { int debug = 0; if (!dest || index < 0 || index >= chNum) return false; #if VERBOSE_DEBUG - if (strcmp(cdTable[caTable[index].chanIndex].chname, TEST_CHAN) == 0) { + if (strcmp(cdTable[caTable[index].chanIndex].chname.c_str(), TEST_CHAN) == 0) { debug=1; } #endif @@ -2589,8 +2482,8 @@ bool syncEpicsStrValue(ADDRESS index, char *dest, int dest_size, time_t *tp, int dest[0] = '\0'; lock_guard l_(caTableMutex); if (caTable[index].datatype == SDF_STR) { - const int MAX_STR_LEN = sizeof(caTable[index].data.strval); - strncpy(dest, caTable[index].data.strval, (dest_size < MAX_STR_LEN ? dest_size : MAX_STR_LEN)); + const int MAX_STR_LEN = caTable[index].data.strval.capacity(); + strncpy(dest, caTable[index].data.strval.c_str(), (dest_size < MAX_STR_LEN ? dest_size : MAX_STR_LEN)); dest[dest_size-1] = '\0'; if (tp) { *tp = caTable[index].mod_time; @@ -2627,15 +2520,13 @@ void subscriptionHandler(struct event_handler_args args) { // if we are getting data, we must be connected. entry->connected = 1; - const int MAX_STR_LEN = sizeof(entry->data.strval); if (args.type == DBR_TIME_DOUBLE) { struct dbr_time_double *dVal = (struct dbr_time_double *)args.dbr; entry->data.chval = dVal->value; entry->mod_time = dVal->stamp.secPastEpoch + POSIX_TIME_AT_EPICS_EPOCH; } else if (args.type == DBR_TIME_STRING) { struct dbr_time_string *sVal = (struct dbr_time_string *)args.dbr; - strncpy(entry->data.strval, sVal->value, MAX_STR_LEN); - entry->data.strval[MAX_STR_LEN - 1] = '\0'; + entry->data.strval = sVal->value; entry->mod_time = sVal->stamp.secPastEpoch + POSIX_TIME_AT_EPICS_EPOCH; } else if (args.type == DBR_GR_ENUM) { struct dbr_gr_enum *eVal = (struct dbr_gr_enum *)args.dbr; @@ -2659,11 +2550,10 @@ void subscriptionHandler(struct event_handler_args args) { entry->data.chval = (double)(eVal->value); } else { if (eVal->value > 0 && eVal->value < eVal->no_str) { - strncpy(entry->data.strval, eVal->strs[eVal->value], MAX_STR_LEN); + entry->data.strval = eVal->strs[eVal->value]; } else { - snprintf(entry->data.strval, MAX_STR_LEN, "Unexpected enum value received - %d", (int)eVal->value); + entry->data.strval.printf("Unexpected enum value received - %d", (int)eVal->value); } - entry->data.strval[MAX_STR_LEN - 1] = '\0'; } // The dbr_gr_enum type does not have time information, so we use current time entry->mod_time = time(NULL); @@ -2760,7 +2650,7 @@ void connectCallback(struct connection_handler_args args) { } /// Routine to register a channel -void registerPV(char *PVname) +void registerPV(const char *PVname) { long status=0; chid chid1; @@ -2816,16 +2706,17 @@ int daqToSDFDataType(int daqtype) { void parseChannelListReq(char *fname) { FILE *f = 0; char line[128]; - char s1[128],s2[128],s3[128],s4[128],s5[128],s6[128],s7[128],s8[128]; int argcount = 0; int in_header = 0; const static char* header_start = "--- Start"; const static char* header_end = "--- End"; - line[0]=s1[0]=s2[0]=s3[0]=s4[0]=s5[0]=s6[0]=s7[0]=s8[0]='\0'; + line[0]='\0'; f = fopen(fname, "r"); if (!f) return; + embedded::fixed_size_vector<embedded::fixed_string<128>, 1> words; + while (fgets(line, sizeof(line), f) != NULL) { if (in_header) { @@ -2840,13 +2731,13 @@ void parseChannelListReq(char *fname) { in_header = 1; continue; } - argcount = parseLine(line, sizeof(s1), s1, s2, s3, s4, s5, s6); + argcount = BURT::parseLine(line, words); if (argcount < 1) continue; - if (strstr(s1,"_SWMASK") != NULL || - strstr(s1,"_SDF_NAME") != NULL || - strstr(s1,"_SWREQ") != NULL) continue; - if (isAlarmChannelRaw(s1)) continue; - registerPV(s1); + if (strstr(words.front().c_str(),"_SWMASK") != NULL || + strstr(words.front().c_str(),"_SDF_NAME") != NULL || + strstr(words.front().c_str(),"_SWREQ") != NULL) continue; + if (isAlarmChannelRaw(words.front().c_str())) continue; + registerPV(words.front().c_str()); } fclose(f); } @@ -3160,7 +3051,7 @@ void dbDumpRecords(DBBASE *pdbbase, const char *pref) cdTable[chNum].data.chval = 0.0; } else { cdTable[chNum].datatype = SDF_STR; - sprintf(cdTable[chNum].data.strval,""); + cdTable[chNum].data.strval = ""; } cdTable[chNum].mask = 0; cdTable[chNum].initialized = 0; @@ -3312,8 +3203,8 @@ int main(int argc,char *argv[]) sdfile.printf("%s%s%s", sdfDir, sdf.c_str(), ".snap"); // Initialize with BURT_safe.snap bufile.printf("%s%s", sdfDir, "fec.snap"); // Initialize table dump file sprintf(logfilename, "%s%s", logdir, "/ioc.log"); // Initialize table dump file - printf("SDF FILE = %s\n",sdfile); - printf("CURRENt FILE = %s\n",bufile); + printf("SDF FILE = %s\n",sdfile.c_str() ); + printf("CURRENt FILE = %s\n",bufile.c_str() ); printf("LOG FILE = %s\n",logfilename); sleep(5); int majorversion = RCG_VERSION_MAJOR; @@ -3553,7 +3444,7 @@ int main(int argc,char *argv[]) fulldbcnt_channel.set(setChans); // Sort channels for data reporting via the MEDM table. getEpicsSettings(); - noMon = createSortTableEntries(chNum,0,"",&noInit,NULL); + noMon = createSortTableEntries(chNum,0,"",&noInit,nullptr); // Calculate and report number of channels NOT being monitored. unmonchancnt_channel.set(chNotMon); alrmchcount_channel.set(alarmCnt); diff --git a/src/epics/seq/test/test_burtfile.cc b/src/epics/seq/test/test_burtfile.cc new file mode 100644 index 0000000000000000000000000000000000000000..677bd8c156aae67b1e8a458214e32e5658b59c4c --- /dev/null +++ b/src/epics/seq/test/test_burtfile.cc @@ -0,0 +1,84 @@ +// +// Created by jonathan.hanks on 4/2/22. +// +#include "catch.hpp" +#include "burt_file.hh" +#include <string> +#include <vector> + +TEST_CASE( "Test encodeString" ) +{ + struct TestCase + { + const char* input; + const char* expected_output; + }; + std::vector< TestCase > test_cases{ + { nullptr, "\\0" }, + { "", "\\0" }, + { "abc", "abc" }, + { "abc def", "\"abc def\"" }, + { "abc\"d\"ef", "\"abc\"d\"ef\"" }, + { "abc\"def", "\"abc\"def\"" }, + { "abc\ndef", "\"abc\ndef\"" }, + { "abc\tdef", "\"abc\tdef\"" }, + }; + for ( const auto& test_case : test_cases ) + { + embedded::fixed_string< 18 > src( test_case.input ); + embedded::fixed_string< 20 > dest; + BURT::encodeString( src, dest ); + REQUIRE( strcmp( test_case.expected_output, dest.c_str( ) ) == 0 ); + } +} +#include <iostream> +TEST_CASE( "Test parseLine" ) +{ + struct TestCase + { + const char* input; + std::vector< std::string > expected_output; + }; + std::vector< TestCase > test_cases{ + { "", {} }, + { "\\0", { "" } }, + { "abc", { "abc" } }, + { "abc def", { "abc", "def" } }, + { "abc\tdef", { "abc", "def" } }, + /* newline ends the parsing */ + { "abc\ndef", { "abc" } }, + { "0 1 2 3 4 5", { "0", "1", "2", "3", "4", "5" } }, + { "0 1 2 \\0 4 5", { "0", "1", "2", "", "4", "5" } }, + /* shouldn't include the quote in the output */ + { "\"0\" 1 2 3 4 5", { "0", "1", "2", "3", "4", "5" } }, + { "0 1 2 3 4 5 6", { "0", "1", "2", "3", "4", "5" } }, + { "0 1 2 3 4 5 6 7 8 9 10", { "0", "1", "2", "3", "4", "5" } }, + { "0 \" 1 2 3 4 5 \" 6 7 8 9 10", + { "0", " 1 2 3 4 5 ", "6", "7", "8", "9" } }, + { "0 \" 1\t2\t3 4 5 \" 6 7 8 9 10", + { "0", " 1\t2\t3 4 5 ", "6", "7", "8", "9" } }, + { "0 \" 1\t2\n\t3 4 5 \" 6 7 8 9 10", { "0", " 1\t2" } }, + { "012345678901234567890", { "01234567890123" } }, + { "012345678901234567890 012345678901234567890", + { "01234567890123", "01234567890123" } }, + /* Make sure the quote is not in the output */ + { "\"012345678901234567890\" 012345678901234567890", + { "01234567890123", "01234567890123" } }, + /* truncate, and do not overflow */ + { "012345678901234567890 \"abcdefghijklmnop\" ABC", + { "01234567890123", "abcdefghijklmn", "ABC" } }, + }; + for ( const auto& test_case : test_cases ) + { + embedded::fixed_size_vector< embedded::fixed_string< 15 >, 6 > out{ }; + + std::cout << test_case.input << "\n"; + int wc = BURT::parseLine( test_case.input, out ); + REQUIRE( wc == test_case.expected_output.size( ) ); + REQUIRE( wc == out.size( ) ); + for ( auto i = 0; i < wc; ++i ) + { + REQUIRE( out[ i ] == test_case.expected_output[ i ].c_str( ) ); + } + } +} \ No newline at end of file diff --git a/src/epics/seq/test/test_fixed_size_string.cc b/src/epics/seq/test/test_fixed_size_string.cc index 4d808ef4ad1be346f712a248b72131433f0062e4..fafb843b378ec087879610808b1203f470d21371 100644 --- a/src/epics/seq/test/test_fixed_size_string.cc +++ b/src/epics/seq/test/test_fixed_size_string.cc @@ -199,6 +199,20 @@ TEST_CASE( "You can append to a fixed size string" ) embedded::fixed_string< 64 > s; embedded::fixed_string< 6 > single( "0" ); embedded::fixed_string< 6 > five( "00000" ); + + for ( int i = 1; i <= 100; ++i ) + { + s += '0'; + std::size_t expected_zeros = + ( i < s.capacity( ) ? i : s.capacity( ) - 1 ); + REQUIRE( s.size( ) == expected_zeros ); + std::size_t j = 0; + for ( ; j < expected_zeros && s.c_str( )[ j ] == '0'; ++j ) + { + } + REQUIRE( j == expected_zeros ); + } + s.clear( ); for ( int i = 1; i <= 100; ++i ) { s += "0"; @@ -284,6 +298,31 @@ TEST_CASE( "You can do printf style formatted printing" ) 0 ); } +TEST_CASE( "You can check for a zero length string by using empty()" ) +{ + embedded::fixed_string< 64 > s0( "" ); + REQUIRE( s0.empty( ) ); + + s0 = "abc"; + REQUIRE( !s0.empty( ) ); +} + +TEST_CASE( "You can use begin/end on a fixed_size_string" ) +{ + embedded::fixed_string< 64 > s0( "" ); + + REQUIRE( s0.begin( ) == s0.end( ) ); + REQUIRE( s0.begin( ) == s0.c_str( ) ); + + s0 = "a"; + REQUIRE( s0.end( ) == s0.begin( ) + 1 ); + REQUIRE( s0.begin( ) == s0.c_str( ) ); + + s0 = "abc"; + REQUIRE( s0.end( ) == s0.begin( ) + 3 ); + REQUIRE( s0.begin( ) == s0.c_str( ) ); +} + TEST_CASE( "You can assign and append via char arrays" ) { embedded::fixed_string< 64 > s0( "123456" ); diff --git a/src/epics/simLink/CDS_PARTS.mdl b/src/epics/simLink/CDS_PARTS.mdl index 63688b88e6b018dad82680643777eef4c5c400f0..7047ff25b22590db7e3003e4e9e378a0d5070004 100644 --- a/src/epics/simLink/CDS_PARTS.mdl +++ b/src/epics/simLink/CDS_PARTS.mdl @@ -1,12 +1,12 @@ Library { Name "CDS_PARTS" Version 9.3 - SavedCharacterEncoding "ISO-8859-1" - WebScopes_FoundationPlugin "on" + SavedCharacterEncoding "UTF-8" DiagnosticSuppressor "on" SLCCPlugin "on" - NotesPlugin "on" + WebScopes_FoundationPlugin "on" LogicAnalyzerPlugin "on" + NotesPlugin "on" LibraryType "BlockLibrary" EnableAccessToBaseWorkspace on ScopeRefreshTime 0.035000 @@ -14,7 +14,7 @@ Library { DisableAllScopes off FPTRunName "Run 1" MaxMDLFileLineLength 120 - LastSavedArchitecture "maci64" + LastSavedArchitecture "glnxa64" Object { $PropName "BdWindowsInfo" $ObjectID 1 @@ -24,17 +24,17 @@ Library { $ObjectID 2 $ClassName "Simulink.WindowInfo" IsActive [1] - Location [343.0, 42.0, 1036.0, 877.0] + Location [729.0, 64.0, 1036.0, 877.0] Object { $PropName "ModelBrowserInfo" $ObjectID 3 $ClassName "Simulink.ModelBrowserInfo" - Visible [0] + Visible [1] DockPosition "Left" Width [50] Height [50] Filter [9] - Minimized "Unset" + Minimized "Off" } Object { $PropName "ExplorerBarInfo" @@ -47,11 +47,11 @@ Library { $ObjectID 5 $ClassName "Simulink.EditorInfo" IsActive [1] - ViewObjType "SimulinkTopLevel" - LoadSaveID "0" - Extents [998.0, 712.0] - ZoomFactor [1.4799999999999998] - Offset [1.1368683772161603e-13, 0.0] + ViewObjType "SimulinkSubsys" + LoadSaveID "150" + Extents [735.0, 687.0] + ZoomFactor [1.5] + Offset [-17.569047619048717, 227.907229427522] } Object { $PropName "DockComponentsInfo" @@ -68,15 +68,15 @@ Library { Height [480] Minimized "Unset" } - WindowState "AAAA/wAAAAD9AAAAAgAAAAAAAAC9AAAB+PwCAAAAA/sAAAAWAEQAbwBjAGsAVwBpAGQAZwBlAHQAMwEAAAAxAAAB+AAAA" + WindowState "AAAA/wAAAAD9AAAAAgAAAAAAAAD1AAAC8PwCAAAAA/sAAAAWAEQAbwBjAGsAVwBpAGQAZwBlAHQAMwEAAAAxAAAB+AAAA" "AAAAAAA+wAAABYARABvAGMAawBXAGkAZABnAGUAdAA0AAAAAAD/////AAAAAAAAAAD7AAAAUgBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0Ac" - "ABvAG4AZQBuAHQALwBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQAAAAAAP////8AAABrAP///wAAAAEAAAAAAAAAAPwCA" + "ABvAG4AZQBuAHQALwBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQBAAAAQAAAAvAAAACAAP///wAAAAEAAAAAAAAAAPwCA" "AAAAfsAAABUAEcATABVAEUAMgA6AFAAcgBvAHAAZQByAHQAeQBJAG4AcwBwAGUAYwB0AG8AcgAvAFAAcgBvAHAAZQByAHQAeQAgAEkAbgBzAHAAZ" - "QBjAHQAbwByAAAAAAD/////AAABrAD///8AAAQMAAADAwAAAAEAAAACAAAAAQAAAAL8AAAAAQAAAAIAAAAP/////wAAAAAA/////wAAAAAAAAAA/" + "QBjAHQAbwByAAAAAAD/////AAABrAD///8AAAMFAAAC8AAAAAEAAAACAAAAAQAAAAL8AAAAAQAAAAIAAAAP/////wAAAAAA/////wAAAAAAAAAA/" "////wEAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/" - "////wEAAACE/////wAAAAAAAAAA/////wEAAAD2/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/" - "////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wEAAAFL/////wAAAAAAAAAA/" - "////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA" + "////wEAAACK/////wAAAAAAAAAA/////wEAAADy/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/" + "////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wEAAAFK/////wAAAAAAAAAA/" + "////wEAAAGB/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA" } } HideAutomaticNames on @@ -84,11 +84,11 @@ Library { Creator "aivanov" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%<Auto>" - LastModifiedBy "rolf" + LastModifiedBy "ezekiel.dohmen" ModifiedDateFormat "%<Auto>" - LastModifiedDate "Thu Dec 17 08:21:58 2020" - RTWModifiedTimeStamp 530093207 - ModelVersionFormat "1.%<AutoIncrement:396>" + LastModifiedDate "Tue Apr 12 10:14:15 2022" + RTWModifiedTimeStamp 571659248 + ModelVersionFormat "1.%<AutoIncrement:404>" SampleTimeColors off SampleTimeAnnotations off LibraryLinkDisplay "all" @@ -168,7 +168,7 @@ Library { Description "" Array { Type "Handle" - Dimension 9 + Dimension 10 Simulink.SolverCC { $ObjectID 8 Version "19.0.0" @@ -879,6 +879,21 @@ Library { CovStopTime 0 CovMcdcMode "Masking" } + hdlcoderui.hdlcc { + $ObjectID 19 + Version "19.0.0" + DisabledProps [] + Description "HDL Coder custom configuration component" + Components [] + Name "HDL Coder" + Array { + Type "Cell" + Dimension 1 + Cell " " + PropName "HDLConfigFile" + } + HDLCActiveTab "0" + } PropName "Components" } Name "Configuration" @@ -1177,12 +1192,12 @@ Library { } System { Name "CDS_PARTS" - Location [343, 42, 1379, 919] - Open on + Location [729, 64, 1765, 941] + Open off PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "portrait" @@ -1192,9 +1207,9 @@ Library { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "148" + ZoomFactor "100" ReportName "simulink-default.rpt" - SIDHighWatermark "379" + SIDHighWatermark "389" SimulinkSubDomain "Simulink" Block { BlockType SubSystem @@ -1212,7 +1227,7 @@ Library { PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "portrait" @@ -1241,7 +1256,7 @@ Library { PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" @@ -1546,7 +1561,7 @@ Library { PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" @@ -1609,7 +1624,7 @@ Library { PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" @@ -2185,7 +2200,7 @@ Library { PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" @@ -2729,7 +2744,7 @@ Library { Annotation { SID "98:321" Name "CONTEC6464 Binary I/O Modules " - Position [26, 11, 289, 31] + Position [26, 11, 289, 38] InternalMargins [0, 0, 0, 0] ZOrder -1 FontName "times" @@ -2738,7 +2753,7 @@ Library { Annotation { SID "98:322" Name "Card 0 " - Position [125, 101, 179, 121] + Position [125, 101, 179, 128] InternalMargins [0, 0, 0, 0] ZOrder -2 FontName "times" @@ -2747,7 +2762,7 @@ Library { Annotation { SID "98:323" Name "Card 1 " - Position [300, 101, 354, 121] + Position [300, 101, 354, 128] InternalMargins [0, 0, 0, 0] ZOrder -3 FontName "times" @@ -2756,7 +2771,7 @@ Library { Annotation { SID "98:324" Name "Card 2 " - Position [480, 101, 534, 121] + Position [480, 101, 534, 128] InternalMargins [0, 0, 0, 0] ZOrder -4 FontName "times" @@ -2765,7 +2780,7 @@ Library { Annotation { SID "98:325" Name "User Application Parts *********************************" - Position [29, 76, 495, 96] + Position [29, 76, 495, 103] InternalMargins [0, 0, 0, 0] ZOrder -5 FontName "times" @@ -2774,7 +2789,7 @@ Library { Annotation { SID "98:326" Name "IOP Parts *********************************" - Position [36, 351, 408, 371] + Position [36, 351, 408, 378] InternalMargins [0, 0, 0, 0] ZOrder -6 FontName "times" @@ -2783,7 +2798,7 @@ Library { Annotation { SID "98:327" Name "Card 3 " - Position [670, 101, 724, 121] + Position [670, 101, 724, 128] InternalMargins [0, 0, 0, 0] ZOrder -7 FontName "times" @@ -3096,7 +3111,7 @@ Library { Annotation { SID "335" Name "Binary I/O Modules *******************************************************************" - Position [20, 821, 774, 841] + Position [20, 821, 773, 848] InternalMargins [0, 0, 0, 0] ZOrder -1 FontName "times" @@ -3105,7 +3120,7 @@ Library { Annotation { SID "336" Name "Digital to Analog (DAC) Modules ********" - Position [25, 306, 350, 326] + Position [25, 306, 351, 333] InternalMargins [0, 0, 0, 0] ZOrder -2 FontName "times" @@ -3114,7 +3129,7 @@ Library { Annotation { SID "337" Name "Real-time Communications ********" - Position [24, 556, 300, 576] + Position [24, 556, 300, 583] InternalMargins [0, 0, 0, 0] ZOrder -3 FontName "times" @@ -3123,7 +3138,7 @@ Library { Annotation { SID "338" Name " aLIGO Real-time Code Generator - I/O Parts Library" - Position [126, 7, 644, 33] + Position [126, 7, 644, 42] InternalMargins [0, 0, 0, 0] ZOrder -4 FontName "times" @@ -3132,7 +3147,7 @@ Library { Annotation { SID "339" Name "Analog to Digial (ADC) Modules ***************************************************" - Position [33, 56, 741, 76] + Position [33, 56, 740, 83] InternalMargins [0, 0, 0, 0] ZOrder -5 FontName "times" @@ -3156,7 +3171,7 @@ Library { PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "portrait" @@ -3259,7 +3274,7 @@ Library { PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" @@ -3296,7 +3311,7 @@ Library { SID "6:7" Name "#DAQ Channels\n\nONE_DAQ_CHANNEL 2048\nANOTHER_DAQ_CHANNEL 1024\nSCIENCE_FRAME_CHAN* 1024\nUINT32_CHAN ui" "nt32 2048\nDAQ_CHANNEL_AT_DEFAULT_RATE" - Position [66, 81, 294, 181] + Position [66, 81, 294, 216] InternalMargins [0, 0, 0, 0] HorizontalAlignment "left" DropShadow on @@ -3337,12 +3352,12 @@ Library { RequestExecContextInheritance off System { Name "EpicsParts" - Location [1419, 271, 2439, 1254] + Location [729, 64, 1765, 941] Open off PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "portrait" @@ -3367,6 +3382,12 @@ Library { LibraryVersion "1.2" SourceBlock "cdsEpicsOutLong/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3379,13 +3400,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag13" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3399,13 +3421,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag14" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3419,13 +3442,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag15" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3439,13 +3463,14 @@ Library { BackgroundColor "magenta" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag16" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3459,13 +3484,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag17" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3479,13 +3505,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag18" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3499,13 +3526,14 @@ Library { BackgroundColor "magenta" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag19" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3519,13 +3547,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag20" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3539,13 +3568,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag21" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3559,13 +3589,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag22" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3579,13 +3610,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag23" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3609,6 +3641,12 @@ Library { LibraryVersion "1.6" SourceBlock "cdsEpicsBinIn/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3624,6 +3662,12 @@ Library { LibraryVersion "1.4" SourceBlock "cdsEpicsCounter/EpicsCounter" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3649,6 +3693,12 @@ Library { LibraryVersion "1.7" SourceBlock "cdsEpicsInCtrl/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3671,6 +3721,12 @@ Library { LibraryVersion "1.3" SourceBlock "cdsEpicsIn/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3687,6 +3743,12 @@ Library { LibraryVersion "1.6" SourceBlock "cdsEpicsMbbi/EpicsMbbi" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3703,6 +3765,12 @@ Library { LibraryVersion "1.3" SourceBlock "cdsEpicsMbbo/EpicsMbbo" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3718,6 +3786,12 @@ Library { LibraryVersion "1.6" SourceBlock "cdsEpicsMomentary/EpicsMomentary" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3737,6 +3811,12 @@ Library { LibraryVersion "1.2" SourceBlock "cdsEpicsOut/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3770,6 +3850,12 @@ Library { LibraryVersion "1.3" SourceBlock "cdsRemoteIntlk/Name" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3786,6 +3872,12 @@ Library { LibraryVersion "1.4" SourceBlock "cdsEpicsStringIn/EpicsStringIn" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Ground @@ -3819,6 +3911,12 @@ Library { LibraryVersion "1.4" SourceBlock "cdsEzCaRead/cdsEzCaRead" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -3837,6 +3935,12 @@ Library { LibraryVersion "1.2" SourceBlock "cdsEzCaWrite/cdsEzCaWrite" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Line { ZOrder 1 @@ -3855,7 +3959,7 @@ Library { Annotation { SID "332" Name "RCG EPICS Parts Library ******************************" - Position [55, 21, 520, 41] + Position [55, 21, 520, 48] InternalMargins [0, 0, 0, 0] ZOrder -1 FontName "times" @@ -3864,7 +3968,7 @@ Library { Annotation { SID "333" Name "Custom For Guardian Scripts ***************************" - Position [42, 471, 502, 491] + Position [42, 471, 502, 498] InternalMargins [0, 0, 0, 0] ZOrder -2 FontName "times" @@ -3885,12 +3989,12 @@ Library { RequestExecContextInheritance off System { Name "Filters/\nGDS" - Location [1419, 271, 2439, 1254] + Location [729, 64, 1765, 941] Open off PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "portrait" @@ -3913,13 +4017,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag24" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3933,13 +4038,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag25" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3953,13 +4059,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag26" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3973,13 +4080,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag27" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -3993,13 +4101,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag28" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4013,13 +4122,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag29" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4033,13 +4143,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag30" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4055,6 +4166,12 @@ Library { LibraryVersion "1.5" SourceBlock "cdsInputFilter/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4069,6 +4186,12 @@ Library { LibraryVersion "1.8" SourceBlock "cdsEXC/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4129,6 +4252,12 @@ Library { LibraryVersion "1.9" SourceBlock "cdsFiltCtrl/IIR FM with control" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4189,6 +4318,12 @@ Library { LibraryVersion "1.15" SourceBlock "cdsFiltCtrl2/IIR FM with control 2" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4221,6 +4356,12 @@ Library { LibraryVersion "1.3" SourceBlock "cdsFilt/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4239,6 +4380,12 @@ Library { LibraryVersion "1.4" SourceBlock "cdsPPFIR/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4255,6 +4402,12 @@ Library { LibraryVersion "1.2" SourceBlock "cdsRms/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4269,6 +4422,12 @@ Library { LibraryVersion "1.5" SourceBlock "cdsTP/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4285,6 +4444,12 @@ Library { LibraryVersion "1.8" SourceBlock "cdsTrueRMS/TrueRMS" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Annotation { SID "334" @@ -4308,12 +4473,12 @@ Library { RequestExecContextInheritance off System { Name "MatrixParts" - Location [857, 306, 1877, 1289] + Location [729, 64, 1765, 941] Open off PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "portrait" @@ -4372,13 +4537,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag31" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4392,13 +4558,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag32" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4412,13 +4579,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag33" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4432,13 +4600,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag34" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4452,13 +4621,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag35" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4472,13 +4642,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag36" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4492,13 +4663,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag37" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4512,13 +4684,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag38" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4532,13 +4705,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag39" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -4557,6 +4731,12 @@ Library { LibraryVersion "1.2" SourceBlock "cdsMatrix/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4580,6 +4760,12 @@ Library { LibraryVersion "1.4" SourceBlock "cdsProduct/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4596,6 +4782,12 @@ Library { LibraryVersion "1.1" SourceBlock "cdsSubtract8/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4612,6 +4804,12 @@ Library { LibraryVersion "1.1" SourceBlock "cdsSwitch1/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Mux @@ -4660,9 +4858,15 @@ Library { LibraryVersion "1.2" SourceBlock "cdsRampMuxMatrix/Subsystem" SourceType "SubSystem" - } - Block { - BlockType Reference + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off + } + Block { + BlockType Reference Name "RampSwitch" SID "305" Tag "cdsRampSwitch" @@ -4676,6 +4880,12 @@ Library { LibraryVersion "1.2" SourceBlock "cdsRampSwitch/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4692,6 +4902,12 @@ Library { LibraryVersion "1.6" SourceBlock "cdsBit2Word/cdsBit2Word" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4707,6 +4923,12 @@ Library { LibraryVersion "1.2" SourceBlock "cdsFiltMuxMatrix/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4723,6 +4945,12 @@ Library { LibraryVersion "1.3" SourceBlock "cdsMuxMatrix/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -4739,6 +4967,12 @@ Library { LibraryVersion "1.6" SourceBlock "cdsWord2Bit/cdsWord2Bit" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Line { ZOrder 1 @@ -4813,12 +5047,12 @@ Library { RequestExecContextInheritance off System { Name "Osc/Phase" - Location [694, 33, 1730, 1080] - Open off + Location [729, 64, 1765, 941] + Open on PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "portrait" @@ -4828,7 +5062,7 @@ Library { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "125" + ZoomFactor "150" SimulinkSubDomain "Simulink" Block { BlockType Reference @@ -4836,12 +5070,12 @@ Library { SID "109" Description "Saturation Count" Ports [] - Position [227, 590, 267, 629] + Position [227, 710, 267, 749] ZOrder -1 BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.358" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag40" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" @@ -4862,7 +5096,7 @@ Library { BackgroundColor "magenta" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.358" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag41" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" @@ -4883,7 +5117,7 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.358" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag42" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" @@ -4904,7 +5138,7 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.358" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag43" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" @@ -4925,7 +5159,7 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.358" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag44" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" @@ -4946,7 +5180,7 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.358" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag45" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" @@ -4967,7 +5201,7 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.358" + LibraryVersion "1.453" UserDataPersistent on UserData "DataTag46" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" @@ -4977,6 +5211,47 @@ Library { ContentPreviewEnabled off DocumentType "Text" } + Block { + BlockType Reference + Name "DocBlock7" + SID "386" + Description "GaussianNoiseGenerator" + Ports [] + Position [252, 585, 292, 624] + ZOrder 12 + BackgroundColor "yellow" + ShowName off + AttributesFormatString "%<Description>" + LibraryVersion "1.453" + UserDataPersistent on + UserData "DataTag47" + SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" + SourceType "DocBlock" + SourceProductName "Simulink" + SourceProductBaseCode "SL" + ContentPreviewEnabled off + DocumentType "Text" + } + Block { + BlockType Reference + Name "GaussianNoiseGenerator" + SID "389" + Tag "cdsGaussianNoiseGenerator" + Ports [1, 1] + Position [65, 584, 165, 626] + ZOrder 15 + BackgroundColor "[1.000000, 0.576471, 0.435294]" + AttributesFormatString "%<Tag>" + LibraryVersion "1.4" + SourceBlock "cdsGaussianNoiseGenerator/Subsystem" + SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off + } Block { BlockType Ground Name "Ground" @@ -4998,25 +5273,37 @@ Library { Position [5, 380, 25, 400] ZOrder 5 } + Block { + BlockType Ground + Name "Ground3" + SID "384" + Position [20, 595, 40, 615] + ZOrder 11 + } Block { BlockType Reference - Name "Noise Generator" + Name "NoiseGeneratorName" SID "130" Tag "cdsNoise" Description "White Noise Generator" Ports [1, 1] Position [80, 483, 165, 527] ZOrder -8 - BackgroundColor "[1.000000, 0.577622, 0.434895]" + BackgroundColor "[1.000000, 0.576471, 0.435294]" AttributesFormatString "%<Tag>" LibraryVersion "1.5" SourceBlock "cdsNoise/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off ContentPreviewEnabled off } Block { BlockType Reference - Name "Oscillator Fixed Phase Name" + Name "OscillatorFixedPhaseName" SID "369" Tag "cdsOscFixedPhase" Description "ADL=OSC.adl" @@ -5028,11 +5315,16 @@ Library { LibraryVersion "1.10" SourceBlock "cdsOscFixedPhase/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off ContentPreviewEnabled off } Block { BlockType Reference - Name "Oscillator Name" + Name "OscillatorName" SID "131" Tag "cdsOsc" Description "ADL=OSC.adl" @@ -5045,11 +5337,16 @@ Library { LibraryVersion "1.6" SourceBlock "cdsOsc/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off ContentPreviewEnabled off } Block { BlockType Reference - Name "Oscillator Set Phase Name" + Name "OscillatorSetPhaseName" SID "372" Tag "cdsOscSetPhase" Description "ADL=OSC.adl" @@ -5061,11 +5358,16 @@ Library { LibraryVersion "1.10" SourceBlock "cdsOscSetPhase/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off ContentPreviewEnabled off } Block { BlockType Reference - Name "Phase Rotator Name" + Name "PhaseRotatorName" SID "132" Tag "cdsPhase" Description "Phase Rotator" @@ -5078,11 +5380,16 @@ Library { LibraryVersion "1.2" SourceBlock "cdsPhase/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off ContentPreviewEnabled off } Block { BlockType Reference - Name "Rotator Name" + Name "RotatorName" SID "133" Tag "cdsWfsPhase" Description "WFS Phase Rotator" @@ -5095,6 +5402,11 @@ Library { LibraryVersion "1.2" SourceBlock "cdsWfsPhase/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off ContentPreviewEnabled off } Block { @@ -5104,7 +5416,7 @@ Library { Tag "cdsSatCount" Description "Saturation count" Ports [1, 2] - Position [35, 563, 165, 627] + Position [35, 683, 165, 747] ZOrder -12 BackgroundColor "red" DropShadow on @@ -5112,33 +5424,45 @@ Library { LibraryVersion "1.6" SourceBlock "cdsSatCount/Saturation Count Name" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off ContentPreviewEnabled off } Line { ZOrder 1 SrcBlock "Ground" SrcPort 1 - DstBlock "Oscillator Name" + DstBlock "OscillatorName" DstPort 1 } Line { ZOrder 2 SrcBlock "Ground1" SrcPort 1 - DstBlock "Noise Generator" + DstBlock "NoiseGeneratorName" DstPort 1 } Line { ZOrder 3 SrcBlock "Ground2" SrcPort 1 - DstBlock "Oscillator Fixed Phase Name" + DstBlock "OscillatorFixedPhaseName" + DstPort 1 + } + Line { + ZOrder 8 + SrcBlock "Ground3" + SrcPort 1 + DstBlock "GaussianNoiseGenerator" DstPort 1 } Annotation { SID "342" Name "RCG OSC/Phase Parts Library" - Position [70, 11, 294, 31] + Position [70, 11, 294, 38] InternalMargins [0, 0, 0, 0] ZOrder -1 FontName "times" @@ -5158,12 +5482,12 @@ Library { RequestExecContextInheritance off System { Name "RT Links" - Location [857, 306, 1877, 1289] + Location [729, 64, 1765, 941] Open off PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" @@ -5186,13 +5510,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag47" + UserData "DataTag48" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5206,13 +5531,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag48" + UserData "DataTag49" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5226,13 +5552,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag49" + UserData "DataTag50" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5247,6 +5574,12 @@ Library { LibraryVersion "1.7" SourceBlock "cdsGps/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -5260,6 +5593,12 @@ Library { LibraryVersion "1.1" SourceBlock "cdsModelRate/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -5274,6 +5613,12 @@ Library { LibraryVersion "1.4" SourceBlock "cdsStateWord/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } } } @@ -5288,12 +5633,12 @@ Library { RequestExecContextInheritance off System { Name "WatchDogs" - Location [1319, 176, 2347, 1191] + Location [729, 64, 1765, 941] Open off PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "portrait" @@ -5321,6 +5666,12 @@ Library { FontSize 12 SourceBlock "cdsDacKill/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -5337,6 +5688,12 @@ Library { LibraryVersion "1.3" SourceBlock "cdsDacKillIop/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -5352,6 +5709,12 @@ Library { LibraryVersion "1.3" SourceBlock "cdsDacKillTimed/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -5364,13 +5727,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag50" + UserData "DataTag51" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5384,13 +5748,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag51" + UserData "DataTag52" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5404,13 +5769,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag52" + UserData "DataTag53" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5424,13 +5790,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag53" + UserData "DataTag54" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5444,13 +5811,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag54" + UserData "DataTag55" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5464,13 +5832,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag55" + UserData "DataTag56" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5484,13 +5853,14 @@ Library { BackgroundColor "yellow" ShowName off AttributesFormatString "%<Description>" - LibraryVersion "1.281" + LibraryVersion "1.453" UserDataPersistent on - UserData "DataTag56" + UserData "DataTag57" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" SourceProductBaseCode "SL" + ContentPreviewEnabled off DocumentType "Text" } Block { @@ -5508,6 +5878,12 @@ Library { LibraryVersion "1.4" SourceBlock "cdsHWWD/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -5524,6 +5900,12 @@ Library { LibraryVersion "1.1" SourceBlock "cdsSusWd/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -5537,6 +5919,12 @@ Library { LibraryVersion "1.7" SourceBlock "SUS_IOP_WD/WD" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -5550,6 +5938,12 @@ Library { LibraryVersion "1.11" SourceBlock "SUS_IOP_WD_2_DC_RMS/WD" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } Block { BlockType Reference @@ -5565,6 +5959,12 @@ Library { LibraryVersion "1.3" SourceBlock "cdsWD/Subsystem" SourceType "SubSystem" + ShowPortLabels "FromPortIcon" + SystemSampleTime "-1" + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + ContentPreviewEnabled off } } } @@ -5584,7 +5984,7 @@ Library { PortBlocksUseCompactNotation off SetExecutionDomain off ExecutionDomainType "Deduce" - ModelBrowserVisibility off + ModelBrowserVisibility on ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "portrait" @@ -5688,7 +6088,7 @@ Library { AttributesFormatString "%<Description>" LibraryVersion "1.281" UserDataPersistent on - UserData "DataTag57" + UserData "DataTag58" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" @@ -5708,7 +6108,7 @@ Library { AttributesFormatString "%<Description>" LibraryVersion "1.281" UserDataPersistent on - UserData "DataTag58" + UserData "DataTag59" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" @@ -5728,7 +6128,7 @@ Library { AttributesFormatString "%<Description>" LibraryVersion "1.281" UserDataPersistent on - UserData "DataTag59" + UserData "DataTag60" SourceBlock "simulink/Model-Wide\nUtilities/DocBlock" SourceType "DocBlock" SourceProductName "Simulink" @@ -5893,7 +6293,7 @@ Library { Annotation { SID "343" Name "MUXs" - Position [156, 548, 215, 574] + Position [156, 548, 215, 581] InternalMargins [0, 0, 0, 0] ZOrder -1 FontSize 24 @@ -5901,7 +6301,7 @@ Library { Annotation { SID "344" Name "BUS CREATOR" - Position [246, 553, 366, 573] + Position [246, 553, 366, 578] InternalMargins [0, 0, 0, 0] ZOrder -2 FontSize 18 @@ -5965,7 +6365,7 @@ Library { SID "364" Name "Note: \nIn V2.8 and later:\nBIQUAD IIR filter algorithm set \nas default.\nshmem_daq=1 set as defau" "lt, so no\nlonger a required setting.\n" - Position [22, 297, 222, 369] + Position [22, 297, 222, 404] InternalMargins [0, 0, 0, 0] ZOrder -1 FontWeight "bold" @@ -5974,7 +6374,7 @@ Library { SID "345" Name "One cdsParameters block is\nrequired per User Model.\nPart is shown with the 6\nrequired fields. Ad" "ditional\noptions described in DOC block. " - Position [25, 95, 219, 147] + Position [25, 95, 219, 167] InternalMargins [0, 0, 0, 0] ZOrder -2 } @@ -5982,7 +6382,7 @@ Library { SID "346" Name "Matlab Parts Library for Use with aLIGO Real-time Code Generator - V4\nDefault Matlab Version is no" "w 2019a" - Position [63, 11, 595, 49] + Position [63, 11, 595, 63] InternalMargins [0, 0, 0, 0] ZOrder -3 FontName "times" @@ -5991,7 +6391,7 @@ Library { } } MatData { - NumRecords 60 + NumRecords 61 DataRecord { Tag DataTag0 Data " %)30 . ^ 0 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" @@ -6846,6 +7246,26 @@ MatData { } DataRecord { Tag DataTag47 + Data " %)30 . 4 4 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" + "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" + "PX \" ! !@ @ $ 4 ( 0 $T$ ! ! !-! 1V%U<W-I86Y.;VES94=E;F5R871O<CH*/3T]/3" + "T]/3T]/3T]/3T]\"E1H:7,@8FQO8VL@9V5N97)A=&5S(&$@<F%N9&]M(&YU;6)E<B!F<F]M(&$@;F]R;6%L(&1I<W1R:6)U=&EO;B!W:71H(&$@\"F" + "UE86X@;V8@,\"P@86YD(&$@<W1A;F1A<F0@9&5V:6%T:6]N(&]F(#$N\"@I5<V%G93H*0V]N;F5C=\"!T:&4@;W5T<'5T(\"=.;VES92<@=&\\@=&A" + "E(&1E<VER960@4D-'('!A<G0L(&=E;F5R86QL>2!A(&9I;'1E<B!B86YK\"G1O(&]F9G-E=\"P@<V-A;&4L(&%N9\"!O=&AE<G=I<V4@<VAA<&4@=&" + "AE(&]U='!U=\"!N;VES92X*\"D]P97)A=&EO;CH*5&AI<R!B;&]C:R!U=&EL:7IE<R!A('-L:6=H=&QY('-T<FEP<&5D(&1O=VX@=F5R<VEO;B!O9B" + "!T:&4@<6YO<FTH*2 *9G5N8W1I;VX@9&5F:6YE9\"!B>2!T:&4@4B!P<F]J96-T+@IH='1P<SHO+W-V;BYR+7!R;VIE8W0N;W)G+U(O=')U;FLO<W)" + "C+VYM871H+W%N;W)M+F,*\"E1H92!M971H;V0@=7-E9\"!I<R!I;G9E<G-E('1R86YS9F]R;2!S86UP;&EN9R!T;R!G96YE<F%T92!G875S<VEA;B!" + "N;VES92X*\"E1H:7,@8FQO8VL@=71I;&EZ97,@9V5T7W)A;F1O;5]B>71E<R@I(&9R;VT@=&AE(#QL:6YU>\"]R86YD;VTN:#XL( IK97)N96P@:&5" + "A9&5R+\"!T:&ES('!R;W9I9&5S(#8T(&)I=',@;V8@96YT<F]P>2!U<V5D('1O('-A;7!L92!T:&4@:6YV97)S92 *=')A;G-F;W)M('=I=&@N\"@I" + "%86-H(&EN<W1A;F-E(&]F('1H:7,@8FQO8VL@8V%L;',@=&AE('-A;64@:6YL:6YE(&9U;F-T:6]N('1O(&=E=\" *=&AE(&YE>'0@<F%N9&]M(&1O" + "=6)L92!S86UP;&5D(&9R;VT@=&AE(&1I<W1R:6)U=&EO;BX*\"E)%1D5214Y#10H@\"D)E87-L97DL($HN($0N(&%N9\"!3+B!'+B!3<')I;F=E<B " + "H,3DW-RDN\"D%L9V]R:71H;2!!4R Q,3$Z(%1H92!P97)C96YT86=E('!O:6YT<R!O9B!T:&4@;F]R;6%L(&1I<W1R:6)U=&EO;BP*07!P;&EE9\"!" + "3=&%T:7-T:6-S+\" R-BP@,3$X+3$R,2X*( I7:6-H=7)A+\"!-+DHN(\"@Q.3@X*2X*06QG;W)I=&AM($%3(#(T,3H@5&AE(%!E<F-E;G1A9V4@4&" + "]I;G1S(&]F('1H92!.;W)M86P@1&ES=')I8G5T:6]N+@I!<'!L:65D(%-T871I<W1I8W,L(#,W+\" T-S<M-#@T+@H* #@ # & \" " + " 0 !0 @ ! P $ $ # %185 " + } + DataRecord { + Tag DataTag48 Data " %)30 . 6 $ 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" "PX \"( !@ @ $ 4 ( 0 %4 ! ! !5 1U!3#0HZ#0H]/3T]#0H-\"E1H:7,@<&%R=\"!O" @@ -6853,7 +7273,7 @@ MatData { " 4 ( 0 , ! ! P!46%0 " } DataRecord { - Tag DataTag48 + Tag DataTag49 Data " %)30 . @ , 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" "PX \"P @ !@ @ $ 4 ( 0 'H\" ! ! !Z @ 4U1!5$573U)$#0HZ#0H]/3T]#0H-\"E1O('!R" @@ -6867,7 +7287,7 @@ MatData { "P@87,@8GD@1&%T879I97=E<BX-\"@ X P !@ @ $ 4 ( 0 , ! ! P!46%0 " } DataRecord { - Tag DataTag49 + Tag DataTag50 Data " %)30 . 0 $ 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" "PX !P !@ @ $ 4 ( 0 #H ! ! Z 1U!3#0HZ#0H]/3T]#0H-\"E1H:7,@<&%R=\"!O=" @@ -6875,7 +7295,7 @@ MatData { " P!46%0 " } DataRecord { - Tag DataTag50 + Tag DataTag51 Data " %)30 . V $ 8 ( @ % \" $ ! 0 % 0 \" $ 0 =F5R<" "VEO;@!C;VYT96YT X X !@ @ & 4 ( 0 $ ! D ( FIF9F9F9\\3\\. 2 $ " " 8 ( ! % \" $ 1 0 0 0 $0$ &-D<U-U<U=D.@T*/3T]/3T]/3T]#0H-\"E1H:7,@9G5N8W1I;" @@ -6884,7 +7304,7 @@ MatData { "G1E<F9E<F]M971E<BDN#0H-\"E1H:7,@8FQO8VL@<VAO=6QD(&YO=\"!B92!U<V5D(&EN(&%N>2!N97<@9&5S:6=N<RX-\"@ " } DataRecord { - Tag DataTag51 + Tag DataTag52 Data " %)30 . < 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" "PX P!@ !@ @ $ 4 ( 0 /\\% ! ! #_!0 8V1S5V%T8VAD;V<Z#0H]/3T]/3T-\"@T*5&AI<" @@ -6909,7 +7329,7 @@ MatData { "T('-I9VYA;',N#0H #@ # & \" 0 !0 @ ! P $ $ # %185 " } DataRecord { - Tag DataTag52 + Tag DataTag53 Data " %)30 . \" 8 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R" "<VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S" "/PX X!0 !@ @ $ 4 ( 0 0% ! ! $!0 8V1S5T0Z#0H]/3T]/3T-\"@T*5&AI<R!B;&]C:" @@ -6931,7 +7351,7 @@ MatData { "T97(N( T* X P !@ @ $ 4 ( 0 , ! ! P!46%0 " } DataRecord { - Tag DataTag53 + Tag DataTag54 Data " %)30 . D 0 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" "PX # P !@ @ $ 4 ( 0 (P# ! ! \", P 8V1S1&%Q2VEL;#H-\"CT]/3T]/0T*#0I4:&4@8" @@ -6949,7 +7369,7 @@ MatData { " @ ! P $ $ # %185 " } DataRecord { - Tag DataTag54 + Tag DataTag55 Data " %)30 . > 4 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" "PX \"H! !@ @ $ 4 ( 0 '@$ ! ! !X! 8V1S1&%C2VEL;$EO<#H-\"CT]/3T]/0T*#0I4:" @@ -6970,7 +7390,7 @@ MatData { " P!46%0 " } DataRecord { - Tag DataTag55 + Tag DataTag56 Data " %)30 . 6 ( 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" "PX \"( 0 !@ @ $ 4 ( 0 %0! ! ! !4 0 8V1S5T0R.@T*/3T]/3T]#0H-\"E1H:7,@8FQO8" @@ -6981,7 +7401,7 @@ MatData { " % \" $ # 0 0 , 5%A4 " } DataRecord { - Tag DataTag56 + Tag DataTag57 Data " %)30 . : 4 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" "PX \"8! !@ @ $ 4 ( 0 &0$ ! ! !D! 8V1S1&%C2VEL;%1I;65D.@T*/3T]/3T]#0H-\"" @@ -7001,14 +7421,14 @@ MatData { "7!A<W-I;F<B#0H #@ # & \" 0 !0 @ ! P $ $ # %185 " } DataRecord { - Tag DataTag57 + Tag DataTag58 Data " %)30 . * $ 8 ( @ % \" $ ! 0 % 0 \" $ 0 =F5R<" "VEO;@!C;VYT96YT X X !@ @ & 4 ( 0 $ ! D ( FIF9F9F9\\3\\. F " " 8 ( ! % \" $ !G 0 0 9P %5N:71$96QA>3H-\"CT]/3T]/3T]/3T-\"@T*5&AI<R!B;&]C" ":R!I<R!U<V5D(&9E960@8F%C:R!V86QU97,@;VX@=&AE(&YE>'0@8V]D92!C>6-L92!O9B!T:&4@<V]F='=A<F4N#0H " } DataRecord { - Tag DataTag58 + Tag DataTag59 Data " %)30 . D \\ 8 ( @ % \" $ ! 0 % 0 \" $ 0 =F5R" "<VEO;@!C;VYT96YT X X !@ @ & 4 ( 0 $ ! D ( FIF9F9F9\\3\\. \\" " 8 ( ! % \" $ !F!P 0 1 S X $T 80!T &@ 1@!U &X 8P!T &D ;P!N #H #0 * #T /0 ]" @@ -7060,7 +7480,7 @@ MatData { " ( !B &4 ( !S &4 = @ '0 ;P @ 'H 90!R &\\ +@ - H " } DataRecord { - Tag DataTag59 + Tag DataTag60 Data " %)30 . P D 8 ( @ % \" $ ! 0 % 0 \" $ 8 =F5R<" "VEO;@!C;VYT96YT &9O<FUA= #@ #@ & \" 8 !0 @ ! 0 $ \"0 @ S,S,S,S/S/" "PX #P\" !@ @ $ 4 ( 0 +D( ! ! \"Y\" 1F-N.@T*/3T]/0T*#0I4:&ES(&UO9'5L92!I" diff --git a/src/epics/simLink/lib/cdsGaussianNoiseGenerator.mdl b/src/epics/simLink/lib/cdsGaussianNoiseGenerator.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a2bab3abfaedaa81be9a13e2e16cf87078c8a84e --- /dev/null +++ b/src/epics/simLink/lib/cdsGaussianNoiseGenerator.mdl @@ -0,0 +1,1145 @@ +Library { + Name "cdsGaussianNoise" + Version 9.3 + SavedCharacterEncoding "UTF-8" + DiagnosticSuppressor "on" + SLCCPlugin "on" + WebScopes_FoundationPlugin "on" + LogicAnalyzerPlugin "on" + NotesPlugin "on" + LibraryType "BlockLibrary" + EnableAccessToBaseWorkspace on + ScopeRefreshTime 0.035000 + OverrideScopeRefreshTime on + DisableAllScopes off + FPTRunName "Run 1" + MaxMDLFileLineLength 120 + LastSavedArchitecture "glnxa64" + Object { + $PropName "BdWindowsInfo" + $ObjectID 1 + $ClassName "Simulink.BDWindowsInfo" + Object { + $PropName "WindowsInfo" + $ObjectID 2 + $ClassName "Simulink.WindowInfo" + IsActive [1] + Location [117.0, 61.0, 716.0, 564.0] + Object { + $PropName "ModelBrowserInfo" + $ObjectID 3 + $ClassName "Simulink.ModelBrowserInfo" + Visible [1] + DockPosition "Left" + Width [50] + Height [50] + Filter [9] + Minimized "On" + } + Object { + $PropName "ExplorerBarInfo" + $ObjectID 4 + $ClassName "Simulink.ExplorerBarInfo" + Visible [1] + } + Object { + $PropName "EditorsInfo" + $ObjectID 5 + $ClassName "Simulink.EditorInfo" + IsActive [1] + ViewObjType "SimulinkTopLevel" + LoadSaveID "0" + Extents [592.0, 374.0] + ZoomFactor [1.0] + Offset [0.0, 0.0] + } + Object { + $PropName "DockComponentsInfo" + $ObjectID 6 + $ClassName "Simulink.DockComponentInfo" + Type "GLUE2:PropertyInspector" + ID "Property Inspector" + Visible [1] + CreateCallback "" + UserData "" + Floating [0] + DockPosition "Right" + Width [640] + Height [480] + Minimized "On" + } + WindowState "AAAA/wAAAAD9AAAAAgAAAAAAAAC9AAAB+PwCAAAAA/sAAAAWAEQAbwBjAGsAVwBpAGQAZwBlAHQAMwEAAAAxAAAB+AAAA" + "AAAAAAA+wAAABYARABvAGMAawBXAGkAZABnAGUAdAA0AAAAAAD/////AAAAAAAAAAD7AAAAUgBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0Ac" + "ABvAG4AZQBuAHQALwBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQAAAAAAP////8AAACAAP///wAAAAEAAAAAAAAAAPwCA" + "AAAAfsAAABUAEcATABVAEUAMgA6AFAAcgBvAHAAZQByAHQAeQBJAG4AcwBwAGUAYwB0AG8AcgAvAFAAcgBvAHAAZQByAHQAeQAgAEkAbgBzAHAAZ" + "QBjAHQAbwByAAAAAAD/////AAABrAD///8AAAJ2AAABtwAAAAEAAAACAAAAAQAAAAL8AAAABAAAAAAAAAABAAAANgBjAG8AbABsAGEAcABzAGkAY" + "gBsAGUAUABhAG4AZQBsAFQAbwBvAGwAQgBhAHIATABlAGYAdAMAAAAA/////wAAAAAAAAAAAAAAAQAAAAEAAAA4AGMAbwBsAGwAYQBwAHMAaQBiA" + "GwAZQBQAGEAbgBlAGwAVABvAG8AbABCAGEAcgBSAGkAZwBoAHQDAAAAAP////8AAAAAAAAAAAAAAAIAAAAP/////wAAAAAA/////wAAAAAAAAAA/" + "////wEAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/" + "////wEAAACK/////wAAAAAAAAAA/////wEAAADy/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/" + "////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wEAAAFK/////wAAAAAAAAAA/" + "////wEAAAGB/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAAAAAAAwAAAAEAAAA6AGMAbwBsAGwAYQBwAHMAaQBiAGwAZQBQAGEAbgBlA" + "GwAVABvAG8AbABCAGEAcgBCAG8AdAB0AG8AbQAAAAAA/////wAAAAAAAAAA" + } + } + HideAutomaticNames on + Created "Mon Apr 11 16:37:21 2022" + Creator "ezekiel.dohmen" + UpdateHistory "UpdateHistoryNever" + ModifiedByFormat "%<Auto>" + LastModifiedBy "ezekiel.dohmen" + ModifiedDateFormat "%<Auto>" + LastModifiedDate "Tue Apr 12 09:53:07 2022" + RTWModifiedTimeStamp 571657983 + ModelVersionFormat "1.%<AutoIncrement:4>" + SampleTimeColors off + SampleTimeAnnotations off + LibraryLinkDisplay "disabled" + WideLines off + ShowLineDimensions off + ShowPortDataTypes off + ShowAllPropagatedSignalLabels off + PortDataTypeDisplayFormat "AliasTypeOnly" + ShowEditTimeErrors on + ShowEditTimeWarnings on + ShowEditTimeAdvisorChecks off + ShowPortUnits off + ShowDesignRanges off + ShowLoopsOnError on + IgnoreBidirectionalLines off + ShowStorageClass off + ShowTestPointIcons on + ShowSignalResolutionIcons on + ShowViewerIcons on + SortedOrder off + VariantCondition off + ShowSubsystemDomainSpec off + ExecutionContextIcon off + ShowLinearizationAnnotations on + ShowVisualizeInsertedRTB on + ShowMarkup on + BlockNameDataTip off + BlockParametersDataTip off + BlockDescriptionStringDataTip off + BlockVariantConditionDataTip off + ToolBar on + StatusBar on + BrowserShowLibraryLinks off + FunctionConnectors off + BrowserLookUnderMasks off + MultiThreadCoSim on + SimulationMode "normal" + PauseTimes "5" + NumberOfSteps 1 + SnapshotBufferSize 10 + SnapshotInterval 10 + NumberOfLastSnapshots 0 + LinearizationMsg "none" + Profile off + ParamWorkspaceSource "MATLABWorkspace" + ExtModeBatchMode off + ExtModeEnableFloating on + ExtModeTrigType "manual" + ExtModeTrigMode "normal" + ExtModeTrigPort "1" + ExtModeTrigElement "any" + ExtModeTrigDuration 1000 + ExtModeTrigDurationFloating "auto" + ExtModeTrigHoldOff 0 + ExtModeTrigDelay 0 + ExtModeTrigDirection "rising" + ExtModeTrigLevel 0 + ExtModeArchiveMode "off" + ExtModeAutoIncOneShot off + ExtModeIncDirWhenArm off + ExtModeAddSuffixToVar off + ExtModeWriteAllDataToWs off + ExtModeArmWhenConnect on + ExtModeSkipDownloadWhenConnect off + ExtModeLogAll on + ExtModeAutoUpdateStatusClock on + ShowModelReferenceBlockVersion off + ShowModelReferenceBlockIO off + OrderedModelArguments on + Array { + Type "Handle" + Dimension 1 + Simulink.ConfigSet { + $ObjectID 7 + Version "19.0.0" + DisabledProps [] + Description "" + Array { + Type "Handle" + Dimension 10 + Simulink.SolverCC { + $ObjectID 8 + Version "19.0.0" + DisabledProps [] + Description "" + Components [] + StartTime "0.0" + StopTime "10.0" + AbsTol "auto" + AutoScaleAbsTol on + FixedStep "auto" + InitialStep "auto" + MaxOrder 5 + ZcThreshold "auto" + ConsecutiveZCsStepRelTol "10*128*eps" + MaxConsecutiveZCs "1000" + ExtrapolationOrder 4 + NumberNewtonIterations 1 + MaxStep "auto" + MinStep "auto" + MaxConsecutiveMinStep "1" + RelTol "1e-3" + EnableMultiTasking off + ConcurrentTasks off + Solver "VariableStepAuto" + SolverName "VariableStepAuto" + SolverJacobianMethodControl "auto" + ShapePreserveControl "DisableAll" + ZeroCrossControl "UseLocalSettings" + ZeroCrossAlgorithm "Nonadaptive" + AlgebraicLoopSolver "TrustRegion" + SolverInfoToggleStatus off + IsAutoAppliedInSIP off + SolverResetMethod "Fast" + PositivePriorityOrder off + AutoInsertRateTranBlk off + SampleTimeConstraint "Unconstrained" + InsertRTBMode "Whenever possible" + SampleTimeProperty [] + DecoupledContinuousIntegration off + MinimalZcImpactIntegration off + SolverOrder 3 + } + Simulink.DataIOCC { + $ObjectID 9 + Version "19.0.0" + DisabledProps [] + Description "" + Components [] + Decimation "1" + ExternalInput "[t, u]" + FinalStateName "xFinal" + InitialState "xInitial" + LimitDataPoints off + MaxDataPoints "1000" + LoadExternalInput off + LoadInitialState off + SaveFinalState off + SaveOperatingPoint off + SaveFormat "Dataset" + SignalLoggingSaveFormat "Dataset" + SaveOutput on + SaveState off + SignalLogging on + DSMLogging on + InspectSignalLogs off + VisualizeSimOutput on + StreamToWorkspace off + StreamVariableName "streamout" + SaveTime on + ReturnWorkspaceOutputs on + StateSaveName "xout" + TimeSaveName "tout" + OutputSaveName "yout" + SignalLoggingName "logsout" + DSMLoggingName "dsmout" + OutputOption "RefineOutputTimes" + OutputTimes "[]" + ReturnWorkspaceOutputsName "out" + Refine "1" + LoggingToFile off + DatasetSignalFormat "timeseries" + LoggingFileName "out.mat" + LoggingIntervals "[-inf, inf]" + } + Simulink.OptimizationCC { + $ObjectID 10 + Version "19.0.0" + Array { + Type "Cell" + Dimension 8 + Cell "BooleansAsBitfields" + Cell "PassReuseOutputArgsAs" + Cell "PassReuseOutputArgsThreshold" + Cell "ZeroExternalMemoryAtStartup" + Cell "ZeroInternalMemoryAtStartup" + Cell "OptimizeModelRefInitCode" + Cell "NoFixptDivByZeroProtection" + Cell "UseSpecifiedMinMax" + PropName "DisabledProps" + } + Description "" + Components [] + BlockReduction on + BooleanDataType on + ConditionallyExecuteInputs on + DefaultParameterBehavior "Tunable" + UseDivisionForNetSlopeComputation "off" + GainParamInheritBuiltInType off + UseFloatMulNetSlope off + DefaultUnderspecifiedDataType "double" + UseSpecifiedMinMax off + InlineInvariantSignals off + OptimizeBlockIOStorage on + BufferReuse on + EnhancedBackFolding off + CachingGlobalReferences off + GlobalBufferReuse on + StrengthReduction off + AdvancedOptControl "" + ExpressionFolding on + BooleansAsBitfields off + BitfieldContainerType "uint_T" + EnableMemcpy on + MemcpyThreshold 64 + PassReuseOutputArgsAs "Structure reference" + PassReuseOutputArgsThreshold 12 + ExpressionDepthLimit 128 + LocalBlockOutputs on + RollThreshold 5 + StateBitsets off + DataBitsets off + ActiveStateOutputEnumStorageType "Native Integer" + ZeroExternalMemoryAtStartup on + ZeroInternalMemoryAtStartup on + InitFltsAndDblsToZero off + NoFixptDivByZeroProtection off + EfficientFloat2IntCast off + EfficientMapNaN2IntZero on + LifeSpan "auto" + MaxStackSize "Inherit from target" + BufferReusableBoundary on + SimCompilerOptimization "off" + AccelVerboseBuild off + OptimizeBlockOrder "off" + OptimizeDataStoreBuffers on + BusAssignmentInplaceUpdate on + DifferentSizesBufferReuse off + OptimizationLevel "level2" + OptimizationPriority "Balanced" + OptimizationCustomize on + UseRowMajorAlgorithm off + LabelGuidedReuse off + MultiThreadedLoops off + DenormalBehavior "GradualUnderflow" + } + Simulink.DebuggingCC { + $ObjectID 11 + Version "19.0.0" + Array { + Type "Cell" + Dimension 1 + Cell "UseOnlyExistingSharedCode" + PropName "DisabledProps" + } + Description "" + Components [] + RTPrefix "error" + ConsistencyChecking "none" + ArrayBoundsChecking "none" + SignalInfNanChecking "none" + StringTruncationChecking "error" + SignalRangeChecking "none" + ReadBeforeWriteMsg "UseLocalSettings" + WriteAfterWriteMsg "UseLocalSettings" + WriteAfterReadMsg "UseLocalSettings" + AlgebraicLoopMsg "warning" + ArtificialAlgebraicLoopMsg "warning" + SaveWithDisabledLinksMsg "warning" + SaveWithParameterizedLinksMsg "warning" + CheckSSInitialOutputMsg on + UnderspecifiedInitializationDetection "Simplified" + MergeDetectMultiDrivingBlocksExec "error" + CheckExecutionContextPreStartOutputMsg off + CheckExecutionContextRuntimeOutputMsg off + SignalResolutionControl "UseLocalSettings" + BlockPriorityViolationMsg "warning" + MinStepSizeMsg "warning" + TimeAdjustmentMsg "none" + MaxConsecutiveZCsMsg "error" + MaskedZcDiagnostic "warning" + IgnoredZcDiagnostic "warning" + SolverPrmCheckMsg "none" + InheritedTsInSrcMsg "warning" + MultiTaskDSMMsg "error" + MultiTaskCondExecSysMsg "error" + MultiTaskRateTransMsg "error" + SingleTaskRateTransMsg "none" + TasksWithSamePriorityMsg "warning" + ExportedTasksRateTransMsg "none" + SigSpecEnsureSampleTimeMsg "warning" + CheckMatrixSingularityMsg "none" + IntegerOverflowMsg "warning" + Int32ToFloatConvMsg "warning" + ParameterDowncastMsg "error" + ParameterOverflowMsg "error" + ParameterUnderflowMsg "none" + ParameterPrecisionLossMsg "warning" + ParameterTunabilityLossMsg "warning" + FixptConstUnderflowMsg "none" + FixptConstOverflowMsg "none" + FixptConstPrecisionLossMsg "none" + UnderSpecifiedDataTypeMsg "none" + UnnecessaryDatatypeConvMsg "none" + VectorMatrixConversionMsg "none" + InvalidFcnCallConnMsg "error" + FcnCallInpInsideContextMsg "error" + SignalLabelMismatchMsg "none" + UnconnectedInputMsg "warning" + UnconnectedOutputMsg "warning" + UnconnectedLineMsg "warning" + UseOnlyExistingSharedCode "error" + SFcnCompatibilityMsg "none" + FrameProcessingCompatibilityMsg "error" + UniqueDataStoreMsg "none" + BusObjectLabelMismatch "warning" + RootOutportRequireBusObject "warning" + AssertControl "UseLocalSettings" + AllowSymbolicDim on + RowMajorDimensionSupport off + ModelReferenceIOMsg "none" + ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error" + ModelReferenceVersionMismatchMessage "none" + ModelReferenceIOMismatchMessage "none" + UnknownTsInhSupMsg "warning" + ModelReferenceDataLoggingMessage "warning" + ModelReferenceSymbolNameMessage "warning" + ModelReferenceExtraNoncontSigs "error" + StateNameClashWarn "none" + OperatingPointInterfaceChecksumMismatchMsg "warning" + NonCurrentReleaseOperatingPointMsg "error" + ChecksumConsistencyForSSReuse "none" + PregeneratedLibrarySubsystemCodeDiagnostic "warning" + MatchCodeGenerationContextForUpdateDiagram "none" + InitInArrayFormatMsg "warning" + StrictBusMsg "ErrorLevel1" + BusNameAdapt "WarnAndRepair" + NonBusSignalsTreatedAsBus "none" + SymbolicDimMinMaxWarning "warning" + LossOfSymbolicDimsSimulationWarning "warning" + LossOfSymbolicDimsCodeGenerationWarning "error" + SymbolicDimsDataTypeCodeGenerationDiagnostic "error" + BlockIODiagnostic "none" + SFUnusedDataAndEventsDiag "warning" + SFUnexpectedBacktrackingDiag "error" + SFInvalidInputDataAccessInChartInitDiag "warning" + SFNoUnconditionalDefaultTransitionDiag "error" + SFTransitionOutsideNaturalParentDiag "warning" + SFUnreachableExecutionPathDiag "warning" + SFUndirectedBroadcastEventsDiag "warning" + SFTransitionActionBeforeConditionDiag "warning" + SFOutputUsedAsStateInMooreChartDiag "error" + SFTemporalDelaySmallerThanSampleTimeDiag "warning" + SFSelfTransitionDiag "warning" + SFExecutionAtInitializationDiag "warning" + SFMachineParentedDataDiag "warning" + IntegerSaturationMsg "warning" + AllowedUnitSystems "all" + UnitsInconsistencyMsg "warning" + AllowAutomaticUnitConversions on + RCSCRenamedMsg "warning" + RCSCObservableMsg "warning" + ForceCombineOutputUpdateInSim off + UnitDatabase "" + UnderSpecifiedDimensionMsg "none" + DebugExecutionForFMUViaOutOfProcess off + ArithmeticOperatorsInVariantConditions "error" + } + Simulink.HardwareCC { + $ObjectID 12 + Version "19.0.0" + DisabledProps [] + Description "" + Components [] + ProdBitPerChar 8 + ProdBitPerShort 16 + ProdBitPerInt 32 + ProdBitPerLong 32 + ProdBitPerLongLong 64 + ProdBitPerFloat 32 + ProdBitPerDouble 64 + ProdBitPerPointer 64 + ProdBitPerSizeT 64 + ProdBitPerPtrDiffT 64 + ProdLargestAtomicInteger "Char" + ProdLargestAtomicFloat "Float" + ProdIntDivRoundTo "Zero" + ProdEndianess "LittleEndian" + ProdWordSize 64 + ProdShiftRightIntArith on + ProdLongLongMode off + ProdHWDeviceType "Intel->x86-64 (Windows64)" + TargetBitPerChar 8 + TargetBitPerShort 16 + TargetBitPerInt 32 + TargetBitPerLong 32 + TargetBitPerLongLong 64 + TargetBitPerFloat 32 + TargetBitPerDouble 64 + TargetBitPerPointer 32 + TargetBitPerSizeT 32 + TargetBitPerPtrDiffT 32 + TargetLargestAtomicInteger "Char" + TargetLargestAtomicFloat "None" + TargetShiftRightIntArith on + TargetLongLongMode off + TargetIntDivRoundTo "Undefined" + TargetEndianess "Unspecified" + TargetWordSize 32 + TargetPreprocMaxBitsSint 32 + TargetPreprocMaxBitsUint 32 + TargetHWDeviceType "Specified" + TargetUnknown off + ProdEqTarget on + UseEmbeddedCoderFeatures on + UseSimulinkCoderFeatures on + HardwareBoardFeatureSet "EmbeddedCoderHSP" + } + Simulink.ModelReferenceCC { + $ObjectID 13 + Version "19.0.0" + DisabledProps [] + Description "" + Components [] + UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" + EnableRefExpFcnMdlSchedulingChecks on + CheckModelReferenceTargetMessage "error" + EnableParallelModelReferenceBuilds off + ParallelModelReferenceErrorOnInvalidPool on + ParallelModelReferenceMATLABWorkerInit "None" + ModelReferenceNumInstancesAllowed "Multi" + PropagateVarSize "Infer from blocks in model" + ModelDependencies "" + ModelReferencePassRootInputsByReference on + ModelReferenceMinAlgLoopOccurrences off + PropagateSignalLabelsOutOfModel on + SupportModelReferenceSimTargetCustomCode off + } + Simulink.SFSimCC { + $ObjectID 14 + Version "19.0.0" + DisabledProps [] + Description "" + Components [] + SimCustomSourceCode "" + SimCustomHeaderCode "" + SimCustomInitializer "" + SimCustomTerminator "" + SimReservedNameArray [] + SimUserSources "" + SimUserIncludeDirs "" + SimUserLibraries "" + SimUserDefines "" + SimCustomCompilerFlags "" + SimCustomLinkerFlags "" + SFSimEcho on + SimCtrlC on + SimIntegrity on + SimUseLocalCustomCode on + SimParseCustomCode on + SimAnalyzeCustomCode off + SimBuildMode "sf_incremental_build" + SimGenImportedTypeDefs off + ModelFunctionsGlobalVisibility "on" + CompileTimeRecursionLimit 50 + EnableRuntimeRecursion on + MATLABDynamicMemAlloc on + MATLABDynamicMemAllocThreshold 65536 + CustomCodeFunctionArrayLayout [] + DefaultCustomCodeFunctionArrayLayout "NotSpecified" + } + Simulink.RTWCC { + $BackupClass "Simulink.RTWCC" + $ObjectID 15 + Version "19.0.0" + Array { + Type "Cell" + Dimension 16 + Cell "IncludeHyperlinkInReport" + Cell "GenerateTraceInfo" + Cell "GenerateTraceReport" + Cell "GenerateTraceReportSl" + Cell "GenerateTraceReportSf" + Cell "GenerateTraceReportEml" + Cell "PortableWordSizes" + Cell "GenerateWebview" + Cell "GenerateCodeMetricsReport" + Cell "GenerateCodeReplacementReport" + Cell "GenerateMissedCodeReplacementReport" + Cell "GenerateErtSFunction" + Cell "CreateSILPILBlock" + Cell "CodeExecutionProfiling" + Cell "CodeProfilingSaveOptions" + Cell "CodeProfilingInstrumentation" + PropName "DisabledProps" + } + SystemTargetFile "grt.tlc" + HardwareBoard "None" + ShowCustomHardwareApp off + ShowEmbeddedHardwareApp off + TLCOptions "" + GenCodeOnly off + MakeCommand "make_rtw" + GenerateMakefile on + PackageGeneratedCodeAndArtifacts off + PackageName "" + TemplateMakefile "grt_default_tmf" + PostCodeGenCommand "" + Description "" + GenerateReport off + RTWVerbose on + RetainRTWFile off + RTWBuildHooks [] + ProfileTLC off + TLCDebug off + TLCCoverage off + TLCAssert off + RTWUseLocalCustomCode on + RTWUseSimCustomCode off + CustomSourceCode "" + CustomHeaderCode "" + CustomInclude "" + CustomSource "" + CustomLibrary "" + CustomDefine "" + CustomBLASCallback "" + CustomLAPACKCallback "" + CustomFFTCallback "" + CustomInitializer "" + CustomTerminator "" + Toolchain "Automatically locate an installed toolchain" + BuildConfiguration "Faster Builds" + CustomToolchainOptions [] + IncludeHyperlinkInReport off + LaunchReport off + PortableWordSizes off + CreateSILPILBlock "None" + CodeExecutionProfiling off + CodeExecutionProfileVariable "executionProfile" + CodeProfilingSaveOptions "SummaryOnly" + CodeProfilingInstrumentation "off" + SILDebugging off + TargetLang "C" + IncludeBusHierarchyInRTWFileBlockHierarchyMap off + GenerateTraceInfo off + GenerateTraceReport off + GenerateTraceReportSl off + GenerateTraceReportSf off + GenerateTraceReportEml off + GenerateWebview off + GenerateCodeMetricsReport off + GenerateCodeReplacementReport off + GenerateMissedCodeReplacementReport off + RTWCompilerOptimization "off" + ObjectivePriorities [] + RTWCustomCompilerOptimizations "" + CheckMdlBeforeBuild "Off" + SharedConstantsCachingThreshold 1024 + Array { + Type "Handle" + Dimension 2 + Simulink.CodeAppCC { + $ObjectID 16 + Version "19.0.0" + Array { + Type "Cell" + Dimension 28 + Cell "IgnoreCustomStorageClasses" + Cell "IgnoreTestpoints" + Cell "BlockCommentType" + Cell "InsertBlockDesc" + Cell "InsertPolySpaceComments" + Cell "SFDataObjDesc" + Cell "MATLABFcnDesc" + Cell "SimulinkDataObjDesc" + Cell "DefineNamingRule" + Cell "SignalNamingRule" + Cell "ParamNamingRule" + Cell "InternalIdentifier" + Cell "InlinedPrmAccess" + Cell "CustomSymbolStr" + Cell "CustomSymbolStrGlobalVar" + Cell "CustomSymbolStrType" + Cell "CustomSymbolStrField" + Cell "CustomSymbolStrFcn" + Cell "CustomSymbolStrModelFcn" + Cell "CustomSymbolStrFcnArg" + Cell "CustomSymbolStrBlkIO" + Cell "CustomSymbolStrTmpVar" + Cell "CustomSymbolStrMacro" + Cell "CustomSymbolStrUtil" + Cell "CustomSymbolStrEmxType" + Cell "CustomSymbolStrEmxFcn" + Cell "CustomUserTokenString" + Cell "ReqsInCode" + PropName "DisabledProps" + } + Description "" + Components [] + Comment "" + ForceParamTrailComments off + GenerateComments on + CommentStyle "Auto" + IgnoreCustomStorageClasses on + IgnoreTestpoints off + MaxIdLength 31 + PreserveName off + PreserveNameWithParent off + ShowEliminatedStatement off + OperatorAnnotations off + SimulinkDataObjDesc off + SFDataObjDesc off + MATLABFcnDesc off + MangleLength 1 + SharedChecksumLength 8 + CustomSymbolStrGlobalVar "$R$N$M" + CustomSymbolStrType "$N$R$M_T" + CustomSymbolStrField "$N$M" + CustomSymbolStrFcn "$R$N$M$F" + CustomSymbolStrModelFcn "$R$N" + CustomSymbolStrFcnArg "rt$I$N$M" + CustomSymbolStrBlkIO "rtb_$N$M" + CustomSymbolStrTmpVar "$N$M" + CustomSymbolStrMacro "$R$N$M" + CustomSymbolStrUtil "$N$C" + CustomSymbolStrEmxType "emxArray_$M$N" + CustomSymbolStrEmxFcn "emx$M$N" + CustomUserTokenString "" + CustomCommentsFcn "" + DefineNamingRule "None" + DefineNamingFcn "" + ParamNamingRule "None" + ParamNamingFcn "" + SignalNamingRule "None" + SignalNamingFcn "" + InsertBlockDesc off + InsertPolySpaceComments off + SimulinkBlockComments on + BlockCommentType "BlockPathComment" + StateflowObjectComments off + MATLABSourceComments off + EnableCustomComments off + InternalIdentifierFile "" + InternalIdentifier "Shortened" + InlinedPrmAccess "Literals" + ReqsInCode off + UseSimReservedNames off + ReservedNameArray [] + } + Simulink.GRTTargetCC { + $BackupClass "Simulink.TargetCC" + $ObjectID 17 + Version "19.0.0" + Array { + Type "Cell" + Dimension 16 + Cell "IncludeMdlTerminateFcn" + Cell "SuppressErrorStatus" + Cell "ERTCustomFileBanners" + Cell "GenerateSampleERTMain" + Cell "ExistingSharedCode" + Cell "GenerateTestInterfaces" + Cell "ModelStepFunctionPrototypeControlCompliant" + Cell "GenerateAllocFcn" + Cell "PurelyIntegerCode" + Cell "SupportComplex" + Cell "SupportAbsoluteTime" + Cell "SupportContinuousTime" + Cell "SupportNonInlinedSFcns" + Cell "RemoveDisableFunc" + Cell "RemoveResetFunc" + Cell "PreserveStateflowLocalDataDimensions" + PropName "DisabledProps" + } + Description "" + Components [] + TargetFcnLib "ansi_tfl_table_tmw.mat" + TargetLibSuffix "" + TargetPreCompLibLocation "" + GenFloatMathFcnCalls "NOT IN USE" + TargetLangStandard "C99 (ISO)" + CodeReplacementLibrary "None" + UtilityFuncGeneration "Auto" + MultiwordTypeDef "System defined" + MultiwordLength 2048 + DynamicStringBufferSize 256 + GenerateFullHeader on + InferredTypesCompatibility off + ExistingSharedCode "" + GenerateSampleERTMain off + GenerateTestInterfaces off + ModelReferenceCompliant on + ParMdlRefBuildCompliant on + CompOptLevelCompliant on + ConcurrentExecutionCompliant on + IncludeMdlTerminateFcn on + GeneratePreprocessorConditionals "Use local settings" + CombineOutputUpdateFcns on + CombineSignalStateStructs off + GroupInternalDataByFunction off + SuppressErrorStatus off + IncludeFileDelimiter "Auto" + ERTCustomFileBanners off + SupportAbsoluteTime on + LogVarNameModifier "rt_" + MatFileLogging on + MultiInstanceERTCode off + CodeInterfacePackaging "Nonreusable function" + PurelyIntegerCode off + SupportNonFinite on + SupportComplex on + SupportContinuousTime on + SupportNonInlinedSFcns on + RemoveDisableFunc off + RemoveResetFunc off + SupportVariableSizeSignals off + ParenthesesLevel "Nominal" + CastingMode "Nominal" + PreserveStateflowLocalDataDimensions off + MATLABClassNameForMDSCustomization "Simulink.SoftwareTarget.GRTCustomization" + ModelStepFunctionPrototypeControlCompliant off + CPPClassGenCompliant on + AutosarCompliant off + MDXCompliant off + GRTInterface off + GenerateAllocFcn off + UseToolchainInfoCompliant on + GenerateSharedConstants on + CoderGroups [] + AccessMethods [] + LookupTableObjectStructAxisOrder "1,2,3,4,..." + LUTObjectStructOrderExplicitValues "Size,Breakpoints,Table" + LUTObjectStructOrderEvenSpacing "Size,Breakpoints,Table" + ArrayLayout "Column-major" + UnsupportedSFcnMsg "error" + ERTHeaderFileRootName "$R$E" + ERTSourceFileRootName "$R$E" + ERTDataFileRootName "$R_data" + UseMalloc off + ExtMode off + ExtModeStaticAlloc off + ExtModeTesting off + ExtModeStaticAllocSize 1000000 + ExtModeTransport 0 + ExtModeMexFile "ext_comm" + ExtModeMexArgs "" + ExtModeIntrfLevel "Level1" + RTWCAPISignals off + RTWCAPIParams off + RTWCAPIStates off + RTWCAPIRootIO off + GenerateASAP2 off + MultiInstanceErrorCode "Error" + } + PropName "Components" + } + } + SlCovCC.ConfigComp { + $ObjectID 18 + Version "19.0.0" + DisabledProps [] + Description "Simulink Coverage Configuration Component" + Components [] + Name "Simulink Coverage" + CovEnable off + CovScope "EntireSystem" + CovIncludeTopModel on + RecordCoverage off + CovPath "/" + CovSaveName "covdata" + CovCompData "" + CovMetricSettings "dwe" + CovFilter "" + CovHTMLOptions "" + CovNameIncrementing off + CovHtmlReporting off + CovForceBlockReductionOff on + CovEnableCumulative on + CovSaveCumulativeToWorkspaceVar off + CovSaveSingleToWorkspaceVar off + CovCumulativeVarName "covCumulativeData" + CovCumulativeReport off + CovSaveOutputData on + CovOutputDir "slcov_output/$ModelName$" + CovDataFileName "$ModelName$_cvdata" + CovShowResultsExplorer on + CovReportOnPause on + CovModelRefEnable "off" + CovModelRefExcluded "" + CovExternalEMLEnable on + CovSFcnEnable on + CovBoundaryAbsTol 1e-05 + CovBoundaryRelTol 0.01 + CovUseTimeInterval off + CovStartTime 0 + CovStopTime 0 + CovMcdcMode "Masking" + } + hdlcoderui.hdlcc { + $ObjectID 19 + Version "19.0.0" + DisabledProps [] + Description "HDL Coder custom configuration component" + Components [] + Name "HDL Coder" + Array { + Type "Cell" + Dimension 1 + Cell " " + PropName "HDLConfigFile" + } + HDLCActiveTab "0" + } + PropName "Components" + } + Name "Configuration" + CurrentDlgPage "Solver" + ConfigPrmDlgPosition [ 465, 173, 1455, 843 ] + ExtraOptions "" + } + PropName "ConfigurationSets" + } + ExplicitPartitioning off + BlockDefaults { + ForegroundColor "black" + BackgroundColor "white" + DropShadow off + NamePlacement "normal" + FontName "Helvetica" + FontSize 10 + FontWeight "normal" + FontAngle "normal" + ShowName on + HideAutomaticName on + BlockRotation 0 + BlockMirror off + } + AnnotationDefaults { + HorizontalAlignment "left" + VerticalAlignment "top" + ForegroundColor "black" + BackgroundColor "white" + DropShadow off + FontName "Helvetica" + FontSize 10 + FontWeight "normal" + FontAngle "normal" + MarkupType "model" + UseDisplayTextAsClickCallback off + AnnotationType "note_annotation" + FixedHeight off + FixedWidth off + Interpreter "off" + } + LineDefaults { + FontName "Helvetica" + FontSize 9 + FontWeight "normal" + FontAngle "normal" + } + MaskDefaults { + SelfModifiable "off" + IconFrame "on" + IconOpaque "opaque" + RunInitForIconRedraw "analyze" + IconRotate "none" + PortRotate "default" + IconUnits "autoscale" + } + MaskParameterDefaults { + Evaluate "on" + Tunable "on" + NeverSave "off" + Internal "off" + ReadOnly "off" + Enabled "on" + Visible "on" + ToolTip "on" + } + BlockParameterDefaults { + Block { + BlockType Inport + Port "1" + OutputFunctionCall off + OutMin "[]" + OutMax "[]" + OutDataTypeStr "Inherit: auto" + LockScale off + BusOutputAsStruct off + Unit "inherit" + PortDimensions "-1" + VarSizeSig "Inherit" + SampleTime "-1" + SignalType "auto" + SamplingMode "auto" + LatchByDelayingOutsideSignal off + LatchInputForFeedbackSignals off + Interpolate on + } + Block { + BlockType Outport + Port "1" + OutMin "[]" + OutMax "[]" + OutDataTypeStr "Inherit: auto" + LockScale off + BusOutputAsStruct off + Unit "inherit" + PortDimensions "-1" + VarSizeSig "Inherit" + SampleTime "-1" + SignalType "auto" + SamplingMode "auto" + EnsureOutportIsVirtual off + SourceOfInitialOutputValue "Dialog" + OutputWhenDisabled "held" + InitialOutput "[]" + MustResolveToSignalObject off + OutputWhenUnConnected off + OutputWhenUnconnectedValue "0" + VectorParamsAs1DForOutWhenUnconnected off + } + Block { + BlockType SubSystem + ShowPortLabels "FromPortIcon" + Permissions "ReadWrite" + PermitHierarchicalResolution "All" + TreatAsAtomicUnit off + MinAlgLoopOccurrences off + PropExecContextOutsideSubsystem off + ScheduleAs "Sample time" + SystemSampleTime "-1" + RTWSystemCode "Auto" + RTWFcnNameOpts "Auto" + RTWFileNameOpts "Auto" + FunctionInterfaceSpec "void_void" + FunctionWithSeparateData off + RTWMemSecFuncInitTerm "Inherit from model" + RTWMemSecFuncExecute "Inherit from model" + RTWMemSecDataConstants "Inherit from model" + RTWMemSecDataInternal "Inherit from model" + RTWMemSecDataParameters "Inherit from model" + SimViewingDevice off + DataTypeOverride "UseLocalSettings" + DataTypeOverrideAppliesTo "AllNumericTypes" + MinMaxOverflowLogging "UseLocalSettings" + Opaque off + MaskHideContents off + SFBlockType "NONE" + VariantControlMode "Expression" + Variant off + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + TreatAsGroupedWhenPropagatingVariantConditions on + ContentPreviewEnabled off + IsWebBlock off + IsObserver off + Latency "0" + AutoFrameSizeCalculation off + IsWebBlockPanel off + } + } + System { + Name "cdsGaussianNoise" + Location [117, 61, 833, 625] + Open on + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility on + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + ReportName "simulink-default.rpt" + SIDHighWatermark "11" + SimulinkSubDomain "Simulink" + Block { + BlockType Inport + Name "Ground" + SID "6" + Position [160, 178, 190, 192] + ZOrder 6 + IconDisplay "Port number" + } + Block { + BlockType SubSystem + Name "Subsystem" + SID "9" + Ports [1, 1] + Position [230, 164, 330, 206] + ZOrder 7 + RequestExecContextInheritance off + System { + Name "Subsystem" + Location [117, 61, 833, 625] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility on + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + SimulinkSubDomain "Simulink" + Block { + BlockType Inport + Name "Ground" + SID "10" + Position [110, 103, 140, 117] + ZOrder -1 + IconDisplay "Port number" + } + Block { + BlockType Outport + Name "GNoise" + SID "11" + Position [240, 103, 270, 117] + ZOrder -2 + IconDisplay "Port number" + } + } + } + Block { + BlockType Outport + Name "GNoise" + SID "8" + Position [370, 178, 400, 192] + ZOrder 4 + IconDisplay "Port number" + } + Line { + ZOrder 8 + SrcBlock "Ground" + SrcPort 1 + DstBlock "Subsystem" + DstPort 1 + } + Line { + ZOrder 9 + SrcBlock "Subsystem" + SrcPort 1 + DstBlock "GNoise" + DstPort 1 + } + } +} diff --git a/src/epics/util/feCodeGen.pl b/src/epics/util/feCodeGen.pl index b46340f5e16f2fa26efd674b6c0c6510b2cac1f8..4e9ef071445bee33abb34b686378eb4a257acb8c 100755 --- a/src/epics/util/feCodeGen.pl +++ b/src/epics/util/feCodeGen.pl @@ -168,6 +168,7 @@ $remoteGpsPart = 0; $remoteGPS = 0; $requireIOcnt = 1; $noiseGeneratorSeed = "none"; +$gaussNoiseGeneratorSeed = "none"; #Following provide for non standard IOP clock rates $adcclock = 64; $modelrate = 64; diff --git a/src/epics/util/lib/GaussianNoiseGenerator.pm b/src/epics/util/lib/GaussianNoiseGenerator.pm new file mode 100644 index 0000000000000000000000000000000000000000..ba425632fbaa0ca67e472f2c533a80e83ad48164 --- /dev/null +++ b/src/epics/util/lib/GaussianNoiseGenerator.pm @@ -0,0 +1,103 @@ +package CDS::GaussianNoiseGenerator; +use Exporter; +@ISA = ('Exporter'); + +#// \page GaussianNoiseGenerator Noise.pm +#// Documentation for GaussianNoiseGenerator.pm +#// This GaussianNoiseGenerator part generates gaussian +#// random noise with 0 mean and 1 standard deviation. +#// +#// +#// +#// \n + + +$printed = 0; +$init_code_printed = 0; +1; + +sub partType { + return GaussianNoiseGenerator; +} + +# Print Epics communication structure into a header file +# Current part number is passed as first argument +sub printHeaderStruct { + my ($i) = @_; +} + +# Print Epics variable definitions +# Current part number is passed as first argument +sub printEpics { + my ($i) = @_; +} + + +# Print variable declarations int front-end file +# Current part number is passed as first argument +sub printFrontEndVars { + my ($i) = @_; + + print ::OUT "static double \L$::xpartName[$i];\n"; + if ($printed) { return; } + + $state_name = "gauss_gen_prng_state"; + print ::OUT "static uint64_t $state_name\[2\];\n"; + print ::OUT "static inline double gaussianRandomDouble( void ) \n"; + print ::OUT "{\n"; + print ::OUT " return qnorm5_s( ((double)xoroshiroPP_next( $state_name )/0xFFFFFFFFFFFFFFFF), 1, 0);\n"; + print ::OUT "}\n"; + + $printed = 1; +} + +# Check inputs are connected +sub checkInputConnect { + my ($i) = @_; + return ""; +} + +# Figure out part input code +# Argument 1 is the part number +# Argument 2 is the input number +# Returns calculated input code +sub fromExp { + my ($i, $j) = @_; + my $from = $::partInNum[$i][$j]; + return "\L$::xpartName[$from]"; +} + +# Return front end initialization code +# Argument 1 is the part number +# Returns calculated code string +sub frontEndInitCode { + my ($i) = @_; + + if ($init_code_printed) { return ""; } + my $calcExp = "\L$::xpartName[$i] = 0;\n"; + if( $::gaussNoiseGeneratorSeed eq "none") + { + $calcExp .= "ligo_get_random_bytes(gauss_gen_prng_state, sizeof(gauss_gen_prng_state));\n"; + } + else + { + #We don't want to have a zero seed for the RNG, so we take any user seed and + #add a constant to it, that way we can support a 0 gaussNoiseGeneratorSeed + $calcExp .= "gauss_gen_prng_state[0] = 0x38ECAC5FB3251641ULL;\n"; + $calcExp .= "gauss_gen_prng_state[1] = 0x145E556BD545B56BULL + $::gaussNoiseGeneratorSeed;\n"; + } + + $init_code_printed = 1; + return $calcExp; +} + + +# Return front end code +# Argument 1 is the part number +# Returns calculated code string +sub frontEndCode { + my ($i) = @_; + my $calcExp = "// GaussiaNoiseGenerator\n"; + $calcExp .= "\L$::xpartName[$i] " . "= gaussianRandomDouble();\n"; + return $calcExp; +} diff --git a/src/epics/util/lib/Noise.pm b/src/epics/util/lib/Noise.pm index 043c3ee5a148048828429ce2919366cb82082fc6..1e9243cca04afd543e7290ed021a5884e1bc1aed 100644 --- a/src/epics/util/lib/Noise.pm +++ b/src/epics/util/lib/Noise.pm @@ -108,4 +108,5 @@ sub frontEndCode { my ($i) = @_; my $calcExp = "// Noise\n"; $calcExp .= "\L$::xpartName[$i] = noise_doub();\n"; + return $calcExp; } diff --git a/src/epics/util/lib/Parameters.pm b/src/epics/util/lib/Parameters.pm index 18c91e5119bacbe6a3ee41578da01a878555cfbe..9b72c12b7f5a75c75a2e424dafa17e06e25819a1 100644 --- a/src/epics/util/lib/Parameters.pm +++ b/src/epics/util/lib/Parameters.pm @@ -236,6 +236,10 @@ sub parseParams { { $::noiseGeneratorSeed = $spp[1]; } + case "gaussNoiseGeneratorSeed" + { + $::gaussNoiseGeneratorSeed = $spp[1]; + } case "virtualIOP" { $::virtualiop = $spp[1]; diff --git a/src/gds/awgtpman/gdschannel.c b/src/gds/awgtpman/gdschannel.c index 39e359298cccf9316a6345ac99310ab990d84049..ca8f4614c4ef2bc024c6c4577208b7bea81e8bd4 100644 --- a/src/gds/awgtpman/gdschannel.c +++ b/src/gds/awgtpman/gdschannel.c @@ -605,6 +605,10 @@ static char *versionId = "Version $Id$" ; loadParamSectionEntry (PRM_RMID, sec, nentry, &cursor, 5, &chninfo[chninfonum].rmId); + // unify DCUID location between awgtpman and DAQ reports + // (other functions read dcuids from the daq into chGroup) + chninfo[chninfonum].chGroup = chninfo[chninfonum].rmId; + printf("%s rmid %d\n", chninfo[chninfonum].chName, chninfo[chninfonum].rmId); chninfo[chninfonum].dcuId = -1; loadParamSectionEntry (PRM_DCUID, sec, nentry, &cursor, diff --git a/src/gds/awgtpman/testpoint.c b/src/gds/awgtpman/testpoint.c index b081d2ff458af539fd62a497c4a5ea8be93a1e04..a0ed8977d34642753c39fb5e40c8f231a2ca626f 100644 --- a/src/gds/awgtpman/testpoint.c +++ b/src/gds/awgtpman/testpoint.c @@ -11,6 +11,10 @@ #include "dtt/gdserrmsg.h" #include "tconv.h" +#if defined (_CONFIG_DYNAMIC) +#include "confinfo.h" +#endif + /*----------------------------------------------------------------------*/ /* */ /* Types: tpNode_t - node type for rpc client */ @@ -82,9 +86,9 @@ static int tpNum = 0; if (tpNode[node].duplicate) { tpNode[node].id = k; } - printf ("TP: node = %i, host = %s, dup = %i, prog = 0x%x, vers = %i\n", - node, tpNode[node].hostname, tpNode[node].duplicate, - (int)tpNode[node].prognum, (int)tpNode[node].progver); +// printf ("TP: node = %i, host = %s, dup = %i, prog = 0x%x, vers = %i\n", +// node, tpNode[node].hostname, tpNode[node].duplicate, +// (int)tpNode[node].prognum, (int)tpNode[node].progver); return 0; } @@ -147,6 +151,11 @@ int testpoint_client (void) int status; /* rpc status */ +#if defined (_CONFIG_DYNAMIC) + const char* const* cinfo; /* configuration info */ + confinfo_t crec; /* conf. info record */ +#endif + /* already initialized */ if (tp_init == 2) { return tpNum; @@ -165,7 +174,19 @@ int testpoint_client (void) printf("testpoint_client %s\n", _TP_CLIENT_VERSION) ; } +#if defined (_CONFIG_DYNAMIC) + for (cinfo = getConfInfo (0, 0); cinfo && *cinfo; cinfo++) { + if ((parseConfInfo (*cinfo, &crec) == 0) && + (gds_strcasecmp (crec.interface, + CONFIG_SERVICE_TP) == 0) && + (crec.ifo >= 0) && (crec.ifo < TP_MAX_NODE) && + (crec.port_prognum > 0) && (crec.progver > 0)) { + tpSetHostAddress (crec.ifo, crec.host, + crec.port_prognum, crec.progver); + } + } +#endif timeout.tv_sec = RPC_PROBE_WAIT; timeout.tv_usec = 0; @@ -248,6 +269,7 @@ int tpClear (int node, const testpoint_t tp[], int tplen) TP_r testpoints; /* test point list */ int result; /* result of rpc call */ CLIENT* clnt; /* client rpc handle */ + const testpoint_t *target; gdsDebug ("clear test point"); @@ -259,19 +281,33 @@ int tpClear (int node, const testpoint_t tp[], int tplen) /* make test point list */ if (tp == NULL) { testpoints.TP_r_len = 1; - testpoints.TP_r_val = (ushort *)&all; + target = &all; } else if (tplen == 0) { return 0; } else { testpoints.TP_r_len = tplen; - testpoints.TP_r_val = (ushort *) tp; + target = tp; + } + + testpoints.TP_r_val = malloc(testpoints.TP_r_len * sizeof(testpoints.TP_r_val[0])); + if(testpoints.TP_r_val == NULL) + { + gdsError(GDS_ERR_MEM, "unable to allocate memory for RPC struct"); + return -5; + } + + int i; + for(i=0; i < testpoints.TP_r_len; ++i) + { + testpoints.TP_r_val[i] = target[i]; } /* make client handle */ clnt = tpMakeHandle (node); if (clnt == NULL) { + free(testpoints.TP_r_val); return -3; } @@ -284,6 +320,7 @@ int tpClear (int node, const testpoint_t tp[], int tplen) /* free handle */ clnt_destroy (clnt); + free(testpoints.TP_r_val); return result; } @@ -380,11 +417,23 @@ int tpRequest (int node, const testpoint_t tp[], int tplen, /* make test point list */ testpoints.TP_r_len = tplen; - testpoints.TP_r_val = (ushort *) tp; + testpoints.TP_r_val = malloc(tplen * sizeof( testpoints.TP_r_val[0] )); + if(testpoints.TP_r_val == NULL) + { + gdsError(GDS_ERR_MEM, "could not allocate buffer for testpoints"); + return -5; + } + + int i; + for(i=0; i < tplen; ++i) + { + testpoints.TP_r_val[i] = tp[i]; + } /* make client handle */ clnt = tpMakeHandle (node); if (clnt == NULL) { + free(testpoints.TP_r_val); return -3; } @@ -409,6 +458,7 @@ int tpRequest (int node, const testpoint_t tp[], int tplen, /* free handle and memory of return argument */ xdr_free ((xdrproc_t)xdr_resultRequestTP_r, (char*) &result); clnt_destroy (clnt); + free(testpoints.TP_r_val); return retval; } @@ -668,6 +718,7 @@ static void queryCmd (char* buf, int node) sprintf (p++, "\n"); } + /*----------------------------------------------------------------------*/ /* */ /* External Procedure Name: tpCommand */ @@ -691,7 +742,7 @@ char* tpCommand (const char* cmd) if (gds_strncasecmp (cmd, "help", 4) == 0) { return cmdreply (_HELP_TEXT); } - /* show */ + /* show */ else if (gds_strncasecmp (cmd, "show", 4) == 0) { p = (char*) (cmd + 4); while (*p == ' ') { @@ -713,10 +764,13 @@ char* tpCommand (const char* cmd) } } else { - node = *p - (int) '0'; - if ((node < 0) || (node >= TP_MAX_NODE) || - (!tpNode[node].valid)) { - return cmdreply ("error: invalid node number"); + node = atoi(p); + if ((node < 0) || (node >= TP_MAX_NODE)) { + printf("invalid node number: 0 < node <= %d\n", TP_MAX_NODE); + return cmdreply ("error: node number out of range"); + } + if ((!tpNode[node].valid)) { + return cmdreply ("error: node number invalid"); } buf = malloc (2000); if (!buf) /* JCB */ @@ -729,16 +783,18 @@ char* tpCommand (const char* cmd) buf = realloc (buf, strlen (buf) + 1); return buf; } - /* set */ + /* set */ else if (gds_strncasecmp (cmd, "set", 3) == 0) { p = (char*) (cmd + 3); while (*p == ' ') { p++; } - node = *p - (int) '0'; - if ((node < 0) || (node >= TP_MAX_NODE)) { + char *endptr; + node = strtol(p, &endptr, 10); + + if (endptr == p) { /* assume channel names are specified */ - if (tpRequestName (p, -1, NULL, NULL) < 0) { + if (tpRequestName (endptr, -1, NULL, NULL) < 0) { return cmdreply ("error: unable to set test point"); } else { @@ -746,6 +802,11 @@ char* tpCommand (const char* cmd) } } else { + p = endptr; + if ((node < 0) || (node >= TP_MAX_NODE)) { + printf("invalid node number: 0 < node <= %d\n", TP_MAX_NODE); + return cmdreply ("error: node number out of range"); + } /* assume test point numbers are specified */ if (!tpNode[node].valid) { return cmdreply ("error: invalid node number"); @@ -768,7 +829,7 @@ char* tpCommand (const char* cmd) } } } - /* clear */ + /* clear */ else if (gds_strncasecmp (cmd, "clear", 5) == 0) { p = (char*) (cmd + 5); while (*p == ' ') { @@ -776,16 +837,22 @@ char* tpCommand (const char* cmd) } /* read node */ if (*p == '*') { +#ifdef CLEAR_ALL_TP_ALLOWED for (node = 0; node < TP_MAX_NODE; node++) { if (tpNode[node].valid) { tpClear (node, NULL, 0); } } return cmdreply ("test point cleared"); +#else + return cmdreply ("Clearing all test points on all nodes is not allowed") ; +#endif } /* try reading node */ - node = *p - (int) '0'; - if ((node < 0) || (node >= TP_MAX_NODE)) { + char *endptr; + node = strtol(p, &endptr, 10); + + if (endptr == p) { /* assume channel names are specified */ if (tpClearName (p) < 0) { return cmdreply ("error: unable to clear test point"); @@ -795,6 +862,11 @@ char* tpCommand (const char* cmd) } } else { + p = endptr; + if ((node < 0) || (node >= TP_MAX_NODE)) { + printf("invalid node number: 0 < node <= %d\n", TP_MAX_NODE); + return cmdreply ("error: node number out of range"); + } /* assume test point numbers are specified */ if (!tpNode[node].valid) { return cmdreply ("error: invalid node number"); @@ -828,7 +900,6 @@ char* tpCommand (const char* cmd) } } - /*----------------------------------------------------------------------*/ /* */ /* External Procedure Name: tpcmdline */ diff --git a/src/gds/awgtpman/testpoint.h b/src/gds/awgtpman/testpoint.h index 92fedc295c0d419c93ba95d2bb25b4740a4f3c9f..4fc9ae9a2b3b1b8141c603c3f245a4de60e68bff 100644 --- a/src/gds/awgtpman/testpoint.h +++ b/src/gds/awgtpman/testpoint.h @@ -8,6 +8,11 @@ #include "testpoint_structs.h" #include "tconv.h" + +#ifdef __cplusplus +extern "C" { +#endif + /** Sets the test point manager address. This function is only available when compiling with the _TP_DAQD flag. It will disable the default parameter file and set the host address and rpc program @@ -23,9 +28,10 @@ @return 0 if successful, <0 otherwise @author DS, June 98 ************************************************************************/ -int tpSetHostAddress (int node, const char* hostname, - unsigned long prognum, unsigned long progver); - +int tpSetHostAddress( int node, + const char* hostname, + unsigned long prognum, + unsigned long progver ); /** Installs a test point client interface. This function should be called prior of using the test point interface. If not, the first @@ -37,8 +43,7 @@ int tpSetHostAddress (int node, const char* hostname, @return 0 if successful, <0 otherwise @author DS, June 98 ************************************************************************/ -int testpoint_client (void); - +int testpoint_client( void ); /** Clear test points. This routine clears test points from the reflective memory. Test points are cleared in the 6th epoch only. @@ -51,8 +56,7 @@ int testpoint_client (void); @return 0 if successful, <0 otherwise @author DS, June 98 ************************************************************************/ -int tpClear (int node, const testpoint_t tp[], int tplen); - +int tpClear( int node, const testpoint_t tp[], int tplen ); /** Terminates a test point client interface. @@ -60,10 +64,7 @@ int tpClear (int node, const testpoint_t tp[], int tplen); @return void @author DS, June 98 ************************************************************************/ -void testpoint_cleanup (void); - - - +void testpoint_cleanup( void ); /** Request test points. The requested test points are made available in the reflective memory if enough test point slots are free. @@ -87,9 +88,12 @@ void testpoint_cleanup (void); @return 0 if successful, <0 otherwise @author DS, June 98 ************************************************************************/ -int tpRequest (int node, const testpoint_t tp[], int tplen, - tainsec_t timeout, taisec_t* time, int* epoch); - +int tpRequest( int node, + const testpoint_t tp[], + int tplen, + tainsec_t timeout, + taisec_t* time, + int* epoch ); /** Request test points by name. This routine is similar to tpRequest but accepts channel names of test points. The tpNames @@ -105,12 +109,10 @@ int tpRequest (int node, const testpoint_t tp[], int tplen, @return 0 if successful, <0 otherwise @author DS, June 98 ************************************************************************/ -int tpRequestName (const char* tpNames, - tainsec_t timeout, taisec_t* time, int* epoch); - - - - +int tpRequestName( const char* tpNames, + tainsec_t timeout, + taisec_t* time, + int* epoch ); /** Clear test points by names. This routine is similar to tpClear but accepts channel names of test points. The tpNames @@ -123,8 +125,7 @@ int tpRequestName (const char* tpNames, @return 0 if successful, <0 otherwise @author DS, June 98 ************************************************************************/ -int tpClearName (const char* tpNames); - +int tpClearName( const char* tpNames ); /** Query the test point interface. This routine returns a list of all assigned test points in the reflective memory belonging to the @@ -157,9 +158,12 @@ int tpClearName (const char* tpNames); @return Number of read test points if successful, <0 otherwise @author DS, June 98 ************************************************************************/ -int tpQuery (int node, int tpinterface, testpoint_t tp[], int tplen, - taisec_t time, int epoch); - +int tpQuery( int node, + int tpinterface, + testpoint_t tp[], + int tplen, + taisec_t time, + int epoch ); /** ASCII interface to a test point interface. @@ -170,7 +174,7 @@ int tpQuery (int node, int tpinterface, testpoint_t tp[], int tplen, @return reply string @author DS, June 98 ************************************************************************/ -char* tpCommand (const char* cmd); +char* tpCommand( const char* cmd ); /** ASCII interface to a test point interface. @@ -181,7 +185,7 @@ char* tpCommand (const char* cmd); @return 0 if successful, <0 otherwise @author DS, June 98 ************************************************************************/ -int tpcmdline (const char* cmd); +int tpcmdline( const char* cmd ); /*----------------------------------------------------------------------*/ /* */ @@ -194,6 +198,10 @@ int tpcmdline (const char* cmd); /* Procedure Returns: 0 if successful, <0 if not */ /* */ /*----------------------------------------------------------------------*/ -int keepAlive (int node); +int keepAlive( int node ); + +#ifdef __cplusplus +} +#endif #endif // DAQD_TRUNK_TESTPOINT_H diff --git a/src/gds/awgtpman/testpoint_server.c b/src/gds/awgtpman/testpoint_server.c index bb469478308b5cb661dcb0cd6246019cd6642bdb..330f689de1f72be4fbfcb25f7c86819888e6b7ab 100644 --- a/src/gds/awgtpman/testpoint_server.c +++ b/src/gds/awgtpman/testpoint_server.c @@ -458,7 +458,7 @@ static char *versionId = "Version $Id$" ; int ret; TP_r tpcln; tpcln.TP_r_len = -result->status; - tpcln.TP_r_val = malloc (tpcln.TP_r_len * sizeof(testpoint_t)); + tpcln.TP_r_val = malloc (tpcln.TP_r_len * sizeof(tpcln.TP_r_val[0])); if (tpcln.TP_r_val != 0) { for (i = 0; i < tpcln.TP_r_len; i++) { tpcln.TP_r_val[i] = tp.TP_r_val[i]; @@ -728,15 +728,24 @@ static char *versionId = "Version $Id$" ; result->status = -2; return TRUE; } + + testpoint_t *testpoints; /* allocate memory for result array */ - result->tp.TP_r_val = malloc (tplen * sizeof (testpoint_t)); + result->tp.TP_r_val = malloc (tplen * sizeof (result->tp.TP_r_val[0])); if (result->tp.TP_r_val == NULL) { - gdsDebug("querytp_1_svc malloc(tplen * sizeof(testpoint_t)) failed.") ; /* JCB */ + gdsDebug("querytp_1_svc malloc(tplen * sizeof(testpoint_t)) [1] failed.") ; /* JCB */ result->status = -2; return FALSE; } + testpoints = malloc(tplen * sizeof(testpoint_t)); + if (testpoints == NULL) { + gdsDebug("querytp_1_svc malloc(tplen * sizeof(testpoint_t)) [1] failed.") ; /* JCB */ + result->status = -2; + return FALSE; + } result->tp.TP_r_len = tplen; + /* fix time if needed */ if (time == 0) { @@ -747,10 +756,16 @@ static char *versionId = "Version $Id$" ; /* get index directly from test point client interface */ result->status = - tpGetIndexDirect (node, tpinterface, (testpoint_t *)result->tp.TP_r_val, + tpGetIndexDirect (node, tpinterface, testpoints, result->tp.TP_r_len, time, epoch); if (result->status >= 0) { result->tp.TP_r_len = result->status; + + // copy over resutls to RPC structure + for(int i=0; i<result->tp.TP_r_len; ++i) + { + result->tp.TP_r_val[i] = testpoints[i]; + } } else { free (result->tp.TP_r_val); @@ -777,7 +792,7 @@ static char *versionId = "Version $Id$" ; } } #endif - + free(testpoints); return TRUE; #endif } @@ -962,21 +977,28 @@ static char *versionId = "Version $Id$" ; gdsChnInfo_t chn; /* channel info structure */ int tp_node; /* node of test point name */ char * saveptr; + testpoint_t * testpoints; /* allocate memory */ buf = malloc (strlen (tpNames) + 2); - if (!buf) /* JCB */ + if (NULL == buf) /* JCB */ { gdsDebug("tpName2Index malloc(strlen(tpNames)+2) failed.") ; return -1 ; } - tp->TP_r_val = malloc (_MAX_TPNAMES * sizeof (testpoint_t)); - if ((tp->TP_r_val == NULL) || (buf == NULL)) { - gdsDebug("tpName2Index malloc(_MAX_TPNAMES...) failed") ; /* JCB */ + tp->TP_r_val = malloc (_MAX_TPNAMES * sizeof tp->TP_r_val[0]); + if (tp->TP_r_val == NULL) { + gdsDebug("tpName2Index malloc(_MAX_TPNAMES...) [1] failed") ; /* JCB */ free (buf); - free (tp->TP_r_val); return -1; } + testpoints = malloc(_MAX_TPNAMES * sizeof(testpoint_t)); + if (testpoints == NULL) { + gdsDebug("tpName2Index malloc(_MAX_TPNAMES...) [2] failed") ; /* JCB */ + free (buf); + free (tp->TP_r_val); + return -1; + } tp->TP_r_len = 0; strcpy (buf, tpNames); @@ -985,17 +1007,24 @@ static char *versionId = "Version $Id$" ; while ((p != NULL) && (tp->TP_r_len < _MAX_TPNAMES)) { printf("tpName2Index checking %s\n", p); if ((gdsChannelInfo (p, &chn) == 0) && - (tpIsValid (&chn, &tp_node, (testpoint_t *)tp->TP_r_val + tp->TP_r_len)) && + (tpIsValid (&chn, &tp_node, testpoints + tp->TP_r_len)) && (node == tp_node)) { printf ("%s is tp %i (node %i)\n", p, - tp->TP_r_val[tp->TP_r_len], + testpoints[tp->TP_r_len], tp_node); tp->TP_r_len++; } printf("node=%d; tp_node=%d\n", node, tp_node); p = strtok_r (NULL, " \t\n", &saveptr); - } - + } + + /* copy back into rpc structure */ + for(int i=0; i < tp->TP_r_len; ++i) + { + tp->TP_r_val[i] = testpoints[i]; + } + + free(testpoints); free (buf); return 0; } diff --git a/src/gds/awgtpman/testpointinfo.c b/src/gds/awgtpman/testpointinfo.c index 3d7a6f6f8e86ab0c0525732e0520a1fd880be91c..8c456a24aba2d3b4ea0d266e843271c4612e9e96 100644 --- a/src/gds/awgtpman/testpointinfo.c +++ b/src/gds/awgtpman/testpointinfo.c @@ -52,7 +52,7 @@ static char *versionId = "Version $Id$" ; (TP_ID_TO_INTERFACE (chn->chNum) >= 0)) { /* copy return arguments */ if (node != NULL) { - *node = chn->rmId; + *node = chn->chGroup; } if (tp != NULL) { *tp = chn->chNum; diff --git a/src/include/drv/iop_adc_functions.c b/src/include/drv/iop_adc_functions.c index 4dddda5ee2725920f2ceefdeaf41427511491f4c..c664729fc25fc3ebbaf5d369ec191c9721824a79 100644 --- a/src/include/drv/iop_adc_functions.c +++ b/src/include/drv/iop_adc_functions.c @@ -348,6 +348,7 @@ iop_adc_read( adcInfo_t* adcinfo, int cpuClk[] ) // loops and max_loops are usually equal to UNDERSAMPLE, but on the first cycle // they loops may be less. + max_loops = UNDERSAMPLE; if(first_adc_read) { loops = UNDERSAMPLE - cdsPciModules.adcTimeShift[card]; diff --git a/src/include/fe.h b/src/include/fe.h index d3df46a176fb4aaa553588853101d6b4d31482bb..a6df4d44d10d338684b1955e2d8396f74fd3588e 100644 --- a/src/include/fe.h +++ b/src/include/fe.h @@ -1,7 +1,6 @@ #ifndef LIGO_FE_H #define LIGO_FE_H - #include "controller.h" //This has most globals externed #include "controllerko.h" //CDIO* Globals and tdsControl/tdsCount diff --git a/src/include/qnorm.h b/src/include/qnorm.h new file mode 100644 index 0000000000000000000000000000000000000000..a3700d1ce30d699cd9ec38e7d076b62b7f698f44 --- /dev/null +++ b/src/include/qnorm.h @@ -0,0 +1,253 @@ +/* -------- This header applies to the qnorm function ------------ + * Mathlib : A C Library of Special Functions + * Copyright (C) 2000--2020 The R Core Team + * Copyright (C) 1998 Ross Ihaka + * based on AS 111 (C) 1977 Royal Statistical Society + * and on AS 241 (C) 1988 Royal Statistical Society + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, a copy is available at + * https://www.R-project.org/Licenses/ + * + * SYNOPSIS + * + * double qnorm5(double p, double mu, double sigma, + * int lower_tail, int log_p) + * {qnorm (..) is synonymous and preferred inside R} + * + * DESCRIPTION + * + * Compute the quantile function for the normal distribution. + * + * For small to moderate probabilities, algorithm referenced + * below is used to obtain an initial approximation which is + * polished with a final Newton step. + * + * For very large arguments, an algorithm of Wichura is used. + * + * REFERENCE + * + * Beasley, J. D. and S. G. Springer (1977). + * Algorithm AS 111: The percentage points of the normal distribution, + * Applied Statistics, 26, 118-121. + * + * Wichura, M.J. (1988). + * Algorithm AS 241: The Percentage Points of the Normal Distribution. + * Applied Statistics, 37, 477-484. + * + * -------------- End qnorm function header ----------------------------- + * + * -------- This header applies to the fastlog2 and fastlog functions --- + * =====================================================================* + * Copyright (C) 2011 Paul Mineiro * + * All rights reserved. * + * * + * Redistribution and use in source and binary forms, with * + * or without modification, are permitted provided that the * + * following conditions are met: * + * * + * * Redistributions of source code must retain the * + * above copyright notice, this list of conditions and * + * the following disclaimer. * + * * + * * Redistributions in binary form must reproduce the * + * above copyright notice, this list of conditions and * + * the following disclaimer in the documentation and/or * + * other materials provided with the distribution. * + * * + * * Neither the name of Paul Mineiro nor the names * + * of other contributors may be used to endorse or promote * + * products derived from this software without specific * + * prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * + * POSSIBILITY OF SUCH DAMAGE. * + * * + * Contact: Paul Mineiro <paul@mineiro.com> * + * ===================================================================== + * + * ---------- End of fastlog2 and fastlog functions -------------------- + * + */ + +/** + * LIGO Header + * + * This code was taken from : https://svn.r-project.org/R/trunk/src/nmath/qnorm.c + * LIGO versions of math functions were swapped in. (sqrt -> lsqrt, etc) + * + * The fastlog2 and fastlog functions where taken from : + * https://github.com/romeric/fastapprox/blob/master/fastapprox/src/fastlog.h + * + */ + +#ifndef LIGO_QNORM_H +#define LIGO_QNORM_H + +#include "inlineMath.h" + + +#define ML_POSINF (1.0 / 0.0) +#define ML_NEGINF ((-1.0) / 0.0) +#define ML_NAN (0.0 / 0.0) + +/* Use 0.5 - p + 0.5 to perhaps gain 1 bit of accuracy */ +#define R_D_Lval(p) (lower_tail ? (p) : (0.5 - (p) + 0.5)) /* p */ +#define R_D_Cval(p) (lower_tail ? (0.5 - (p) + 0.5) : (p)) /* 1 - p */ + + +#define R_DT_qIv(p) (log_p ? (lower_tail ? taylor_9th_exp(p) : - expm1(p)) \ + : R_D_Lval(p)) + +#define R_DT_CIv(p) (log_p ? (lower_tail ? -expm1(p) : taylor_9th_exp(p)) \ + : R_D_Cval(p)) + +// This is a simplified 9th order Taylor polynomial for e^x +// +// This has a maximum percent error of 0.000011% over the (0,1) +// range, which is where we use it here +// +static inline double taylor_9th_exp(double x) +{ + return (362880+x*(362880+x*(181440+x*(60480+x* + (15120+x*(3024+x*(504+x*(72+x*(9+x)))))))))*2.75573192e-6; +} + +static inline double expm1( double x) +{ + return taylor_9th_exp(x) - 1.0; +} + + +static inline float +fastlog2 (float x) +{ + union { float f; uint32_t i; } vx = { x }; + union { uint32_t i; float f; } mx = { (vx.i & 0x007FFFFF) | 0x3f000000 }; + float y = vx.i; + y *= 1.1920928955078125e-7f; + + return y - 124.22551499f + - 1.498030302f * mx.f + - 1.72587999f / (0.3520887068f + mx.f); +} + +// The maximum error over the (0,1] range is a percent error of +// 0.000773% with the use of this acceleration +static inline float +fastlog (float x) +{ + return 0.69314718f * fastlog2 (x); +} + + +static inline double qnorm5_s(double p, int lower_tail, int log_p) +{ + double p_, q, r, val; + + p_ = R_DT_qIv(p);/* real lower_tail prob. p */ + q = p_ - 0.5; + + /*-- use AS 241 --- */ + /* double ppnd16_(double *p, long *ifault)*/ + /* ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3 + + Produces the normal deviate Z corresponding to a given lower + tail area of P; Z is accurate to about 1 part in 10**16. + + (original fortran code used PARAMETER(..) for the coefficients + and provided hash codes for checking them...) + */ + if (lfabs(q) <= .425) {/* |p~ - 0.5| <= .425 <==> 0.075 <= p~ <= 0.925 */ + r = .180625 - q * q; // = .425^2 - q^2 >= 0 + val = + q * (((((((r * 2509.0809287301226727 + + 33430.575583588128105) * r + 67265.770927008700853) * r + + 45921.953931549871457) * r + 13731.693765509461125) * r + + 1971.5909503065514427) * r + 133.14166789178437745) * r + + 3.387132872796366608) + / (((((((r * 5226.495278852854561 + + 28729.085735721942674) * r + 39307.89580009271061) * r + + 21213.794301586595867) * r + 5394.1960214247511077) * r + + 687.1870074920579083) * r + 42.313330701600911252) * r + 1.); + } + else { /* closer than 0.075 from {0,1} boundary : + * r := log(p~); p~ = min(p, 1-p) < 0.075 : */ + if(log_p && ((lower_tail && q <= 0) || (!lower_tail && q > 0))) { + p_ = R_DT_qIv(p);/* real lower_tail prob. p */ + r = p; + } else { + r = fastlog( (q > 0) ? R_DT_CIv(p) /* 1-p */ : p_ /* = R_DT_Iv(p) ^= p */); + } + + // r = sqrt( - log(min(p,1-p)) ) <==> min(p, 1-p) = exp( - r^2 ) : + r = lsqrt(-r); + if (r <= 5.) { /* <==> min(p,1-p) >= exp(-25) ~= 1.3888e-11 */ + r += -1.6; + val = (((((((r * 7.7454501427834140764e-4 + + .0227238449892691845833) * r + .24178072517745061177) * + r + 1.27045825245236838258) * r + + 3.64784832476320460504) * r + 5.7694972214606914055) * + r + 4.6303378461565452959) * r + + 1.42343711074968357734) + / (((((((r * + 1.05075007164441684324e-9 + 5.475938084995344946e-4) * + r + .0151986665636164571966) * r + + .14810397642748007459) * r + .68976733498510000455) * + r + 1.6763848301838038494) * r + + 2.05319162663775882187) * r + 1.); + } + else if(r >= 816) { // p is *extremly* close to 0 or 1 - only possibly when log_p =TRUE + // Using the asymptotical formula -- is *not* optimal but uniformly better than branch below + val = r * M_SQRT2; + } + else { // p is very close to 0 or 1: r > 5 <==> min(p,1-p) < exp(-25) = 1.3888..e-11 + // Wichura, p.478: minimax rational approx R_3(t) is for 5 <= t <= 27 (t :== r) + r += -5.; + val = (((((((r * 2.01033439929228813265e-7 + + 2.71155556874348757815e-5) * r + + .0012426609473880784386) * r + .026532189526576123093) * + r + .29656057182850489123) * r + + 1.7848265399172913358) * r + 5.4637849111641143699) * + r + 6.6579046435011037772) + / (((((((r * + 2.04426310338993978564e-15 + 1.4215117583164458887e-7)* + r + 1.8463183175100546818e-5) * r + + 7.868691311456132591e-4) * r + .0148753612908506148525) + * r + .13692988092273580531) * r + + .59983220655588793769) * r + 1.); + } + + if(q < 0.0) + val = -val; + } + return val; +} + + + + + +#endif //LIGO_QNORM_H diff --git a/src/include/util/inlineMath_x86_asm.h b/src/include/util/inlineMath_x86_asm.h index 4411e5063b5ab99afaaff1d3f6db3e6ebd3e4199..35c62ecf0e23e6a5150e955899e083fdfb54a387 100644 --- a/src/include/util/inlineMath_x86_asm.h +++ b/src/include/util/inlineMath_x86_asm.h @@ -3,6 +3,10 @@ #include "portableInline.h" +#define M_PI 3.14159265358979323846 +#define M_TWO_PI 6.28318530717958647692 +#define M_SQRT2 1.41421356237309504880 + #define __lrint_code \ long int __lrintres; \ diff --git a/src/include/util/prng_xoroshiroPP.h b/src/include/util/prng_xoroshiroPP.h new file mode 100644 index 0000000000000000000000000000000000000000..dad441a7d387dddb68fa0ba091803ab9080599ab --- /dev/null +++ b/src/include/util/prng_xoroshiroPP.h @@ -0,0 +1,46 @@ +/* Written in 2019 by David Blackman and Sebastiano Vigna (vigna@acm.org) + +To the extent possible under law, the author has dedicated all copyright +and related and neighboring rights to this software to the public domain +worldwide. This software is distributed without any warranty. + +See <http://creativecommons.org/publicdomain/zero/1.0/>. */ + + +/* This is xoroshiro128++ 1.0, one of our all-purpose, rock-solid, + * small-state generators. It is extremely (sub-ns) fast and it passes all + * tests we are aware of, but its state space is large enough only for + * mild parallelism. + * + * For generating just floating-point numbers, xoroshiro128+ is even + * faster (but it has a very mild bias, see notes in the comments). + * + * The state must be seeded so that it is not everywhere zero. If you have + * a 64-bit seed, we suggest to seed a splitmix64 generator and use its + * output to fill s. + * + * This has a 2^(128)-1 period + */ + +#ifndef LIGO_PRNG_XOROSHIRO_PLUS_PLUS_H +#define LIGO_PRNG_XOROSHIRO_PLUS_PLUS_H + +static inline uint64_t rotl(const uint64_t x, int k) { + return (x << k) | (x >> (64 - k)); +} + + +static uint64_t xoroshiroPP_next( uint64_t s[2] ) { + const uint64_t s0 = s[0]; + uint64_t s1 = s[1]; + const uint64_t result = rotl(s0 + s1, 17) + s0; + + s1 ^= s0; + s[0] = rotl(s0, 49) ^ s1 ^ (s1 << 21); // a, b + s[1] = rotl(s1, 28); // c + + return result; +} + + +#endif //LIGO_PRNG_XOROSHIRO_PLUS_H diff --git a/src/include/util/random_bytes.h b/src/include/util/random_bytes.h new file mode 100644 index 0000000000000000000000000000000000000000..ebc7f89bb6389376090d93a8c29660b56e054079 --- /dev/null +++ b/src/include/util/random_bytes.h @@ -0,0 +1,45 @@ +#ifndef LIGO_RAMDOM_BYTES_H +#define LIGO_RAMDOM_BYTES_H + +/**************************************************************************** + * + * This header provides a kernel/usp compatible compatible call for + * retrieving cryptographically secure random bytes. + * + * NOTE: These calls are SLOW and should not be used in performance sensitive + * loops. .5-1us measured on a Intel(R) Xeon(R) CPU E5-1660 v4 @ 3.20GHz + * + * You will see these used to seed faster PRNGs that will be used to + * generate random numbers during critical loops. + * + * @author EJ Dohmen + * @date 13 April 2022 + * + ****************************************************************************/ + +#ifdef __KERNEL__ + +#include <linux/random.h> + +static inline void ligo_get_random_bytes(void *buf, int nbytes) +{ + get_random_bytes(buf, nbytes); + return; +} + +#else + +#include <sys/random.h> + +static inline void ligo_get_random_bytes(void *buf, int nbytes) +{ + getrandom(buf, nbytes, GRND_NONBLOCK); + return; +} + + +#endif + + + +#endif //LIGO_RAMDOM_BYTES_H diff --git a/src/rtcds/__init__.py b/src/rtcds/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/rtcds/__main__.py b/src/rtcds/__main__.py deleted file mode 100644 index 329cc3ff2f700ae3d215cb5ead88122e1622a660..0000000000000000000000000000000000000000 --- a/src/rtcds/__main__.py +++ /dev/null @@ -1,61 +0,0 @@ -import os -import logging - - -ENV_FILE = os.getenv('RTS_ENV', '/etc/advligorts/env') - -USER_VARS = ['SITE', 'IFO', 'RCG_LIB_PATH'] -LIST_VARS = ['RTS_VERSION'] + USER_VARS + ['RCG_SRC', 'RCG_BUILD_ROOT', 'RCG_BUILDD', 'RCG_TARGET'] -EXPORT_VARS = USER_VARS + ['site', 'ifo', 'CDS_SRC', 'CDS_IFO_SRC'] - - - -def check_env(): - for var in USER_VARS: - if not os.getenv(var): - raise ValueError(f"variable '{var}' not set.") - for var in LIST_VARS: - logging.info(f"{var}=${!var}") - for var in EXPORT_VARS: - #export $var - pass - - -def prep_buildd(): - if os.path.exists(RCG_BUILDD): - return - logging.info(f"creating RCG_BUILDD {RCG_BUILDD}...") - if ! mkdir -p "$RCG_BUILDD" 2>/dev/null ; then - log "Could not create build directory '$RCG_BUILDD'." - log "Please create manually (with correct permissions) and try again." - exit 1 - fi - log "configuring RCG_BUILDD $RCG_BUILDD..." - cd "$RCG_BUILDD" - "$RCG_SRC"/configure - - -def prep_target(): - if os.path.exists(RCG_TARGET): - return - logging.info(f"creating RCG_TARGET {RCG_TARGET}...") - if ! mkdir -p "$RCG_TARGET" 2>/dev/null ; then - log "Could not create target directory '$RCG_TARGET'." - log "Please create manually (with correct permissions) and try again." - exit 1 - fi - mkdir -p ${RCG_TARGET}/{target,chans/tmp} - - - - - -def main(): - - - - if error: - logging.error(f"The following environment variables must be set (in e.g. {ENV_FILE}:") - for var in USER_VARS: - logging.error(f" {var}") - raise ValueError diff --git a/src/rtcds/fe_generator/README.md b/src/rtcds/fe_generator/README.md deleted file mode 100644 index 3b653b3497541286287de541a5bef54559ef2315..0000000000000000000000000000000000000000 --- a/src/rtcds/fe_generator/README.md +++ /dev/null @@ -1 +0,0 @@ -Systemd generator that creates units at server boot for automatically starting models and other front end services. diff --git a/src/rtcds/fe_generator/__init__.py b/src/rtcds/fe_generator/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/rtcds/fe_generator/__main__.py b/src/rtcds/fe_generator/__main__.py deleted file mode 100755 index a5529d7fc61275cdf4d6abb718e77b69202fba79..0000000000000000000000000000000000000000 --- a/src/rtcds/fe_generator/__main__.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/python3 - -# Generate systemd unit files needed for LIGO CDS front-end -# server startup sequences - -from rtcds.fe_generator.sequencer import Sequencer -from rtcds.fe_generator.options import get_options -import sys -from rtcds.fe_generator.log import klog - - -if __name__ == '__main__': - klog(f"in python with args {sys.argv}") - seq = Sequencer(get_options(), sys.argv[2]) - klog(f"Sequencer created") - seq.create_start_sequence() - klog(f"sequence complete") diff --git a/src/rtcds/fe_generator/cdsrfm.py b/src/rtcds/fe_generator/cdsrfm.py deleted file mode 100644 index 99aeaf7f4ec128ddb3c981e420cc434f93defc03..0000000000000000000000000000000000000000 --- a/src/rtcds/fe_generator/cdsrfm.py +++ /dev/null @@ -1,14 +0,0 @@ -from .front_end import Process - - -class CDSRFMProcesses(object): - def __init__(self, target_dir): - self.target_dir = target_dir - - @staticmethod - def epics(): - return Process("rts-cdsrfm-epics.service", "rts-cdsrfm-epics.service") - - @staticmethod - def module(): - return Process("rts-cdsrfm-module.service", "rts-cdsrfm-module.service") diff --git a/src/rtcds/fe_generator/fe_generator b/src/rtcds/fe_generator/fe_generator deleted file mode 100755 index 87c808a5af665da21e3a1cbc2d21dfb3d68bbea2..0000000000000000000000000000000000000000 --- a/src/rtcds/fe_generator/fe_generator +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -source /etc/advligorts/env - -# export all variables in between set -a and set +a -set -a -source /etc/advligorts/systemd_env -source /etc/advligorts/systemd_env_`hostname` -set +a - -python3 -m rtcds.fe_generator $@ diff --git a/src/rtcds/fe_generator/front_end.py b/src/rtcds/fe_generator/front_end.py deleted file mode 100644 index 4afcbfe4b6995739e270604ef4ae308b73641664..0000000000000000000000000000000000000000 --- a/src/rtcds/fe_generator/front_end.py +++ /dev/null @@ -1,285 +0,0 @@ -# Setup the various processes for the front end startup - -import os -import os.path as path - -gen_disclaimer = "# Created by systemd cds_frontend 'fe_generator'\n" - - -class Process(object): - def __init__(self, start, end, first_service=None): - self.start = start - self.end = end - if first_service is None: - self.first_service = start - else: - self.first_service = first_service - - -class FrontEndProcesses(object): - def __init__(self, target_dir): - self.target_dir = target_dir - - def models(self): - target_name = path.join(self.target_dir, "rts-models.target") - with open(target_name, "wt") as f: - f.write(gen_disclaimer) - f.write("""[Unit] -Description=All models -""") - - @staticmethod - def dolphin_port(): - return Process('rts-dolphin-port.service', 'rts-dolphin-port.service') - - def dolphin_drivers(self, dolphin_gen: str): - """Create units for dolphin drivers. - - :param dolphin_gen: The two letter generation name for the Dolphin rfm in use - """ - # link up from one to the next - targ_name = "rts-dolphin-driver.target" - targ_path = path.join(self.target_dir, targ_name) - services = ['dis_kosif.service', f"dis_{dolphin_gen}.service", 'dis_irm.service', 'dis_sisci.service', - 'dis_nodemgr.service'] - - with open(targ_path, "wt") as f: - f.write(gen_disclaimer) - f.write(f"""[Unit] -Description=Dolphin IX drivers -Wants={" ".join(services)}""") - - self.serialize_units(services) - self.bind_units(services) - - for service in services: - self.part_of(service, targ_name) - - return Process(targ_name, 'dis_nodemgr.service', 'dis_kosif.service',) - - def epics_only_models(self, models): - services = [f"rts-epics@{model}.service" for model in models] - - target_name = "rts-epics-only-models.target" - target_path = path.join(self.target_dir, target_name) - with open(target_path, "wt") as f: - f.write(gen_disclaimer) - f.write(f"""[Unit] -Description=All epics only models -Wants={" ".join(services)} -""") - - self.serialize_units(services) - for service in services: - self.part_of(service, target_name) - - self.link_to(target_name, "rts-models.target") - self.part_of(target_name, "rts-models.target") - - return Process(target_name, services[-1], services[0]) - - def iop_model(self, model, bind_to_dolphin=True): - """ - Link up various services for the IOP model. - If bind_to_dolphin is true, link the iop to the appropriate dolphin service - """ - target_path = path.join(self.target_dir, "rts-iop-model.target") - with open(target_path, "wt") as f: - f.write(gen_disclaimer) - f.write(f"""[Unit] -Description=The IPO model. -Wants=rts@{model}.target -""") - - self.part_of(f"rts@{model}.target", "rts-iop-model.target") - - self.link_to("rts-iop-model.target", "rts-models.target") - self.part_of("rts-iop-model.target", "rts-models.target") - - if bind_to_dolphin: - self.after(f"rts-module@{model}.service", "dis_nodemgr.service") - self.requires(f"rts-module@{model}.service", "dis_nodemgr.service") - - return Process(f"rts-iop-model.target", f"rts-awgtpman@{model}.service", - f"rts-epics@{model}.service") - - def user_models(self, models, iop_model): - target_name = "rts-user-models.target" - target_path = path.join(self.target_dir, target_name) - with open(target_path, "wt") as f: - f.write(gen_disclaimer) - f.write("""[Unit] -Description=All user models -""") - - services = [] - for model in models: - services += [f"rts-epics@{model}.service", f"rts-module@{model}.service", - f"rts-awgtpman@{model}.service"] - - self.serialize_units(services) - - for model in models: - self.link_to(f"rts@{model}.target", target_name) - self.part_of(f"rts@{model}.target", target_name) - - #make sure iop is running before running any user models - self.requires(f"rts-epics@{model}.service", f"rts-module@{iop_model}.service") - self.after(f"rts-epics@{model}.service", f"rts-module@{iop_model}.service") - self.binds_to(f"rts-module@{model}.service", f"rts-module@{iop_model}.service") - self.after(f"rts-module@{model}.service", f"rts-module@{iop_model}.service") - - self.link_to(target_name, "rts-models.target") - self.part_of(target_name, "rts-models.target") - - return Process(f"rts-user-models.target", services[-1], - services[0]) - - def edcs(self, edcs): - """ - Takes a list of edc names and returns a Process object that can be used to start them all. - """ - services = [f"rts-edc_{edc}.service" for edc in edcs] - self.serialize_units(services) - return Process(services[0], services[-1]) - - def streaming(self, options): - # check transport specifier exists - ts = 'transport_specifier' - if not (ts in options and options[ts]): - raise Exception(f"option '{ts}' must be determined when reading options") - - # set up port - network_dir = "/run/systemd/network" - os.makedirs(network_dir, exist_ok=True) - fpath = path.join(network_dir, "rts-daq.network") - with open(fpath, "wt") as f: - f.write(gen_disclaimer) - f.write(f"""[Match] -Name={options['DAQ_ETH_DEV']} - -[Link] -MTUBytes=9000 - -[Network] -Description=Interface for streaming data to the DAQ -Address={options['DAQ_ETH_IP']} -""") - - # setup services - services = ["rts-local_dc.service", f"rts-transport@{options[ts]}.service"] - self.serialize_units(services) - - # setup target - targ_unit_name = "rts-transport.target" - targ_path = path.join(self.target_dir, targ_unit_name) - with open(targ_path, "wt") as f: - f.write(gen_disclaimer) - f.write(f"""[Unit] -Description=Start transport of data to DAQ -Wants={" ".join(services)} -""") - - for service in services: - self.link_to(service, targ_unit_name) - self.part_of(service, targ_unit_name) - - return Process(targ_unit_name, services[-1], services[0]) - - def serialize_units(self, services): - """ - Take a list of systemd unit names and put one after the other. - """ - for i in range(1, len(services)): - self.after(services[i], services[i-1]) - - def bind_units(self, services): - """ - Take a list of systemd units and bind them together, with second - bound to the first, third bound to the second etc. - """ - for i in range(1, len(services)): - self.binds_to(services[i], services[i-1]) - - def serialize_processes(self, processes): - """ - Take a list of processes and put one after the other - """ - for i in range(1, len(processes)): - self.after(processes[i].first_service, processes[i-1].end) - - def create_world_target(self): - with open(path.join(self.target_dir, "rts-world.target"), "wt") as world: - world.write(gen_disclaimer) - world.write("""[Unit] -Description=All model and streaming services for Front End servers - -[Install] -WantedBy=multi-user.target -""") - - def link_to(self, unit_name, target_name): - """ - Makes systemd unit unit_name wanted by target_name - - :return: - """ - override_path = path.join(self.target_dir, f"{target_name}.d") - os.makedirs(override_path, exist_ok=True) - conf_path = path.join(override_path, f"wants_{unit_name}.conf") - with open(conf_path, "wt") as f: - f.write(gen_disclaimer) - f.write(f"""[Unit] -Wants={unit_name}""") - - def part_of(self, unit_name, parent_name): - """ - Make unit_name a part of parent_name, so that when parent_name is stopped, unit_name is as well. - """ - unit_d = path.join(self.target_dir, f"{unit_name}.d") - os.makedirs(unit_d, exist_ok=True) - fname = path.join(unit_d, f"part_of_{parent_name}.conf") - with open(fname, "wt") as conf: - conf.write(gen_disclaimer) - conf.write(f"""[Unit] -PartOf={parent_name} -""") - - def after(self, after_name, before_name): - """ - Make the systemd unit after_name start after before_name is finished - """ - after_d = path.join(self.target_dir, f"{after_name}.d") - os.makedirs(after_d, exist_ok=True) - fname = path.join(after_d, f"after_{before_name}.conf") - with open(fname, "wt") as conf: - conf.write(gen_disclaimer) - conf.write(f"""[Unit] -After={before_name} -""") - - def requires(self, after_name, before_name): - """ - Make the systemd unit after_name require before_name is finished - """ - after_d = path.join(self.target_dir, f"{after_name}.d") - os.makedirs(after_d, exist_ok=True) - fname = path.join(after_d, f"require_{before_name}.conf") - with open(fname, "wt") as conf: - conf.write(gen_disclaimer) - conf.write(f"""[Unit] -Requires={before_name} -""") - - def binds_to(self, after_name, before_name): - """ - Make the systemd unit after_name require before_name is finished - """ - after_d = path.join(self.target_dir, f"{after_name}.d") - os.makedirs(after_d, exist_ok=True) - fname = path.join(after_d, f"bindsto_{before_name}.conf") - with open(fname, "wt") as conf: - conf.write(gen_disclaimer) - conf.write(f"""[Unit] -BindsTo={before_name} -""") diff --git a/src/rtcds/fe_generator/log.py b/src/rtcds/fe_generator/log.py deleted file mode 100644 index 80d772959c2ddf1c1d5a89dcd43eaab8e8fbb20b..0000000000000000000000000000000000000000 --- a/src/rtcds/fe_generator/log.py +++ /dev/null @@ -1,3 +0,0 @@ -def klog(line): - with open("/dev/kmsg","wt") as f: - f.write(f"fe_generator: {line}\n") diff --git a/src/rtcds/fe_generator/options.py b/src/rtcds/fe_generator/options.py deleted file mode 100644 index b04811f4914bb892c5480487a82d5ee2b2930c37..0000000000000000000000000000000000000000 --- a/src/rtcds/fe_generator/options.py +++ /dev/null @@ -1,90 +0,0 @@ -# gather options for generating systemd units -import os -import os.path as path - - -def split(s): - """Split a string on whitespace""" - return s.split() - - -def boolean(s): - """Convert a string into True or False. - Return true only if first character is a 'T' of either case""" - return s[0] == "t" or s[0] == "T" - - -class Variable(object): - def __init__(self, convert, default=None): - self.convert = convert - self.default = default - - -# net every expected variable is set up here, only those that need translation from a string -# or need a default value -variables = { - 'IOP_MODEL': Variable(str, None), - 'USER_MODELS': Variable(split, default=[]), - 'EPICS_ONLY_MODELS': Variable(split, default=[]), - 'EDC': Variable(split, default=[]), - 'IS_DOLPHIN_NODE': Variable(boolean, False), - 'DOLPHIN_GEN': Variable(str, "ix"), - 'USE_DOLPHIN_PORT_CONTROL': Variable(boolean, True), - 'DAQ_STREAMING': Variable(boolean, False), - 'CDSRFM': Variable(boolean, False), - 'START_MODELS': Variable(boolean, False), -} - - -def get_options(): - # first check /etc/advligorts/systemd_env.. files - options = {key: value for key,value in os.environ.items()} - host_name = os.uname()[1] - - # also if rtsystab is available, prefer its unit list - - read_rtsystab(f"/etc/rtsystab", options, host_name) - - # process the options into right type, etc, and create a few that aren't to be found in the files - for name,var in variables.items(): - if name in options: - options[name] = var.convert(options[name]) - else: - options[name] = var.default - - if options['IOP_MODEL'] in options['EPICS_ONLY_MODELS']: - options['IOP_MODEL'] = None - - options['USER_MODELS'] = [m for m in options['USER_MODELS'] - if m not in options['EPICS_ONLY_MODELS']] - - options['HAS_DOLPHIN_PORT'] = path.exists('/etc/dolphin_ix_port_ctl.sh') - options['HAS_EPICS_ONLY_MODELS'] = len(options['EPICS_ONLY_MODELS']) > 0 - options['HAS_IOP_MODEL'] = options['IOP_MODEL'] is not None - options['HAS_USER_MODELS'] = len(options['USER_MODELS']) > 0 - - options['HAS_EDC'] = "EDC" in options and len(options["EDC"]) > 0 - - if 'cps_xmit_args' in options: - options['transport_specifier'] = 'cps_xmit' - - return options - - -def read_rtsystab(fname, options, host_name): - try: - with open(fname, "rt") as f: - for line_raw in f.readlines(): - line = line_raw.strip() - if len(line) <= 0: - continue - line = line.split('#')[0].strip() - if len(line) <= 0: - continue - words = [word.strip() for word in line.split()] - if len(words) > 1 and words[0] == host_name: - options["IOP_MODEL"] = words[1] - options["USER_MODELS"] = " ".join(words[2:]) - return - except IOError: - pass diff --git a/src/rtcds/fe_generator/sequencer.py b/src/rtcds/fe_generator/sequencer.py deleted file mode 100644 index bc77798bbdcb478c2961677b7dfaea5e92ee206d..0000000000000000000000000000000000000000 --- a/src/rtcds/fe_generator/sequencer.py +++ /dev/null @@ -1,121 +0,0 @@ -# Set the start sequence for front ends and other diskless systems - -from .front_end import FrontEndProcesses -from .cdsrfm import CDSRFMProcesses -import os.path as path -from .log import klog - - -class Sequencer(object): - - def __init__(self, options, target_dir): - """options is a dictionary of host-specific key/value pairs that will determine what - elements are added to the start sequence - - target_dir is the target directory for unit files - """ - self.options = options - self.target_dir = target_dir - self.processes = FrontEndProcesses(target_dir) - - def create_start_sequence(self): - if self.options["CDSRFM"]: - klog("is CDSRFM host") - before_world, world = self.create_cdsrfm_start_sequence(self.processes, - CDSRFMProcesses(self.target_dir)) - else: - klog("is standard front end host") - before_world, world = self.create_frontend_start_sequence() - self.link_sequence(before_world, world, self.options["START_MODELS"]) - - def create_frontend_start_sequence(self): - before_world = [] - world = [] - models = False - if self.options["IS_DOLPHIN_NODE"]: - dolphin_drivers = self.processes.dolphin_drivers(self.options["DOLPHIN_GEN"]) - if self.options["HAS_DOLPHIN_PORT"] and self.options["USE_DOLPHIN_PORT_CONTROL"]: - dolphin_port = self.processes.dolphin_port() - - # bind drivers to port control so that drivers automatically get disabled - # when port is closed - self.processes.binds_to(dolphin_drivers.first_service, dolphin_port.start) - - before_world.append(dolphin_port) - before_world.append(self.delay(15, 5, "dolphin_port")) - before_world.append(dolphin_drivers) - klog(f"{self.options['DOLPHIN_GEN']} gen. dolphin drivers added") - before_world.append(self.delay(30, 10, "startup")) - if self.options["HAS_EPICS_ONLY_MODELS"]: - world.append(self.processes.epics_only_models(self.options["EPICS_ONLY_MODELS"])) - models = True - if self.options["HAS_IOP_MODEL"]: - world.append(self.processes.iop_model(self.options["IOP_MODEL"], - self.options["IS_DOLPHIN_NODE"])) - models = True - if self.options["HAS_EDC"]: - world.append(self.processes.edcs(self.options["EDC"])) - if self.options["DAQ_STREAMING"]: - world.append(self.processes.streaming(self.options)) - if self.options["HAS_USER_MODELS"]: - if self.options["HAS_IOP_MODEL"]: - world.append(self.processes.user_models(self.options["USER_MODELS"], - self.options["IOP_MODEL"])) - models = True - else: - klog("Can't have user models without an IOP model") - if models: - self.processes.models() - return before_world, world - - def create_cdsrfm_start_sequence(self, front_end_processes, cdsrfm_processes): - before_world = [ - front_end_processes.dolphin_port(), - self.delay(15, 5, "dolphin_port"), - front_end_processes.dolphin_drivers(), - self.delay(30, 10, "startup"),] - world = [ - cdsrfm_processes.module(), - cdsrfm_processes.epics(), - ] - return before_world, world - - def link_sequence(self, before_world, world, start_models): - self.processes.create_world_target() - - # link the first of each process to multi-user or to the world target - for process in before_world: - self.processes.link_to(process.start, "multi-user.target") - for process in world: - self.processes.link_to(process.start, "rts-world.target") - self.processes.part_of(process.start, "rts-world.target") - if len(before_world) > 0: - self.processes.after("rts-world.target", before_world[-1].end) - if start_models: - self.processes.link_to("rts-world.target", "multi-user.target") - else: - klog("START_MODELS is false. Skipping model start.") - self.processes.serialize_processes(before_world + world) - - class Delay(object): - def __init__(self, unit_name): - self.start = unit_name - self.end = unit_name - self.first_service = unit_name - - def delay(self, start_time_s, stop_time_s, name): - file_name = f"rts-delay-{name}.service" - file_path = path.join(self.target_dir, file_name) - with open(file_path, "wt") as f: - f.write(f"""[Unit] -Description=Delay for {start_time_s} seconds - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStartPre=/bin/sleep {start_time_s} -ExecStart=/bin/echo '[startup] finished waiting for {name}' -ExecStop=/bin/sleep {stop_time_s} -ExecStopPost=/bin/echo '[shutdown] finished waiting for {name}' -""") - return self.Delay(file_name)