Projects
mass
turbina-core-mass
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 15
View file
turbina-core-mass.changes
Changed
@@ -1,4 +1,14 @@ ------------------------------------------------------------------- +Wed Sep 12 19:35:38 UTC 2018 - matwey@sai.msu.ru + +- Version 1.33 + +------------------------------------------------------------------- +Sat Aug 18 06:35:02 UTC 2018 - matwey@sai.msu.ru + +- Don't use legacy RS485 on latest openSUSE + +------------------------------------------------------------------- Mon Jun 19 17:42:40 UTC 2017 - matwey@sai.msu.ru - Add Requires(pre): user(uucp) to make recent openSUSE happy
View file
turbina-core-mass.spec
Changed
@@ -42,7 +42,7 @@ License: GPL-2.0 Group: Productivity/Scientific/Astronomy Name: turbina-core-mass -Version: 1.32 +Version: 1.33 Release: 0 Url: http://curl.sai.msu.ru/hg/turbina_core_m Source: %{tarname}-%{version}.tar.bz2 @@ -70,7 +70,9 @@ BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make +%if 0%{?suse_version} < 1500 BuildRequires: rs485-devel +%endif BuildRequires: boost-devel %if 0%{?suse_version} > 1230 BuildRequires: systemd-rpm-macros
View file
_service
Changed
@@ -1,8 +1,8 @@ <services> <service name="tar_scm" mode="disabled"> <param name="url">http://curl.sai.msu.ru/hg/turbina_core_m</param> - <param name="versionformat">1.32</param> - <param name="revision">1.32</param> + <param name="versionformat">1.33</param> + <param name="revision">1.33</param> <param name="scm">hg</param> </service> <service name="recompress" mode="disabled">
View file
turbina_core_m-1.33.tar.bz2/.hgsub
Added
@@ -0,0 +1,2 @@ +infras = infras +server = server
View file
turbina_core_m-1.33.tar.bz2/.hgsubstate
Added
@@ -0,0 +1,2 @@ +ea023410bd0cd86ac017ab4f8f2ddeafc933dba3 infras +5e6da4aab2bdc0d21f0885409c1f938ff7fb587e server
View file
turbina_core_m-1.33.tar.bz2/.hgtags
Added
@@ -0,0 +1,10 @@ +3c48b99d2acb9119149d81d98e0e83cc359b4a82 0.2 +3ff530057cf8c5c11ea80879de78e0789fc6a59c 1.20 +89cb84822a2deb003646237e08fe2c47576d0ec5 0.1 +08874596d5cbd36a71ea4de3472e6723dcf7a11b 1.26 +9ad288a77b9277969ff405979b79ee40d31ed31d 1.27 +a149340d7473e56a7ef6f5f7f20582ef411ce683 1.28 +aecd380a9b696f3fb10d422160d293be0c8bd825 1.29 +99b022ee8524a5038fac2b332edd9ec827be4dcc 1.30 +7e97a0961023ffa9f07d6da8db7ecfc4edd5f16f 1.31 +827b5b6e1632d96b8179739a6b8661dc62a289ad 1.32
View file
turbina_core_m-1.32.tar.bz2/Makefile -> turbina_core_m-1.33.tar.bz2/Makefile
Changed
@@ -10,11 +10,11 @@ MASS_SOURCES = main.o mass.o configs.o module.o auxiliary.o channel.o bicounter.o exchange.o rs485.o astrotime.o measmode.o errlog.o rserrno.o sci.o results.o receiver.o comms.o scenario.o instrument.o socket.o server.o PREPHOT = prephot PREPHOT_SOURCES = prephot.o parameter_set.o processing.o coordinates.o astrotime.o -VERSION = 1.32 +VERSION = 1.33 CXX = g++ INSTALL_PROGRAM = install -RS485INCLUDE = $(shell for X in /usr/include/linux/rs485 /usr/src/rs485/include; do T=$$X; if -d $$X ; then break; fi done; echo $$T;) -CXXFLAGS += -std=c++98 -Wall -O2 -DVERSION=\"$(VERSION)\" -I./infras -I./server -I$(RS485INCLUDE) +RS485FLAGS = $(shell FLAGS=-DNO_RS485_LEGACY; for X in /usr/include/linux/rs485 /usr/src/rs485/include; do if -d $$X ; then FLAGS=-I$$X; break; fi done; echo $$FLAGS;) +CXXFLAGS += -std=c++98 -Wall -O2 -DVERSION=\"$(VERSION)\" -I./infras -I./server $(RS485FLAGS) LDFLAGS += -lpthread all: $(MASS) $(PREPHOT)
View file
turbina_core_m-1.32.tar.bz2/defnames.h -> turbina_core_m-1.33.tar.bz2/defnames.h
Changed
@@ -18,6 +18,5 @@ const std::string SERVER_NAME = "0.0.0.0"; const unsigned short SERVER_PORT = 16201; -//const std::string device("/dev/rs485lpt0"); #endif
View file
turbina_core_m-1.32.tar.bz2/etc/mass.cfg -> turbina_core_m-1.33.tar.bz2/etc/mass.cfg
Changed
@@ -23,7 +23,7 @@ SubSection "Tests" FluxEstimationTime 4 ;sec ExchangeTestTime 10 ;exchange test duration in sec - DetectorTestTime 8 ; + DetectorTestTime 300 ; DetectorLight 0.25 ;reference light level for detector test TestCounts 1260 3720 5100 1440 ;reference counts into channels FluxTolerance 0.2 ;allowed tolerance for real counts @@ -65,7 +65,7 @@ PollingTime 100 ;temperature polling period in s IlluminationLevel 0.5 ;default illumination leve HVsteadying 20 ;sec - LightSteadying 30 ;sec + LightSteadying 5 ;sec EndSubSection EndSection Section "Channels" @@ -79,7 +79,8 @@ ChannelB 0.06 ; defined 12.08.16 EndSubSection SubSection "Rconstant" - ChannelC 8.04 ; starting from 25.08.16 +; ChannelC 8.04 ; starting from 25.08.16 + ChannelC 7.855 ; starting from 02.05.17 EndSubSection EndSection Section "Optics"
View file
turbina_core_m-1.33.tar.bz2/infras/.hgtags
Added
@@ -0,0 +1,32 @@ +01e464286edc36ad99fb10a2d4c994cd6fe408f2 ameba-0_58 +01e464286edc36ad99fb10a2d4c994cd6fe408f2 dome-1_23 +01e464286edc36ad99fb10a2d4c994cd6fe408f2 mokko-v1 +01e464286edc36ad99fb10a2d4c994cd6fe408f2 monitor-1_29 +2ba85c63ef00b7e14a329248c4194c551d15c960 ameba-0-49 +31f3e4725f5de92e8a8e9cb768c883ad992e46d8 ameba-0_21 +3b70b4af4eac10e493bb52242698fe983707bcdb dome-1_01 +498eca265f129013c09828f58c9a80087a572cb3 dimm-2_11 +4f6471d0b795ab6afab2dacf69b1dcdf67294d2d tlsp-0_20 +5433368217003ff8568b1952e217d5e5804ffd6e turb-0_2 +5f2bc6b675a1b282d79c9d18c54ae3342df932ad tlsp-0_15 +619ddedc25fdbbdd896eb398b421ed6d14aa4870 begin +64bb84845b2799cd72cbf384d8c9fc2e24704ebe ameba-0_57 +64bb84845b2799cd72cbf384d8c9fc2e24704ebe dimm-2_33 +6d962bd1c2cd184bf39ed96aac0c1ff2444054c3 dimm-2_26 +6d962bd1c2cd184bf39ed96aac0c1ff2444054c3 dome-1_19 +6d962bd1c2cd184bf39ed96aac0c1ff2444054c3 monitor-1_07 +72e27a05f3e9b9782b9e757788074403df1f1cd2 monitor-1_31 +72e27a05f3e9b9782b9e757788074403df1f1cd2 monitor-1_32 +7dd7c2a765f9be0ccd6436ebbecfb341a4994b1b dome-1_03 +819f0950d6a58e68902cf37bef9011826095ae61 tlsp-0_13 +8609d5073806cfdd04aaf380553cc5499fae53e6 ameba-0_40 +d2fadec4b7b176044ac4431c5ad1ec2e41fd28ff ameba-0_59 +d2fadec4b7b176044ac4431c5ad1ec2e41fd28ff ameba-0_60 +d2fadec4b7b176044ac4431c5ad1ec2e41fd28ff ameba-0_61 +d2fadec4b7b176044ac4431c5ad1ec2e41fd28ff ameba-0_62 +d2fadec4b7b176044ac4431c5ad1ec2e41fd28ff dimm-2_45 +d2fadec4b7b176044ac4431c5ad1ec2e41fd28ff dimm-2_46 +d2fadec4b7b176044ac4431c5ad1ec2e41fd28ff dome-1_24 +d2fadec4b7b176044ac4431c5ad1ec2e41fd28ff monitor-1_30 +d2fadec4b7b176044ac4431c5ad1ec2e41fd28ff turbina_core_m-1_20 +ecb66a74160bc8bcc9ece732712a929c7a7ff91f ameba-0_12
View file
turbina_core_m-1.32.tar.bz2/mass.cpp -> turbina_core_m-1.33.tar.bz2/mass.cpp
Changed
@@ -285,10 +285,95 @@ } string MASS::get(const string& key) { + + Cmpi cmpi; + static map<const string, GETF_T, Cmpi> getf(get_kwd, get_kwd + sizeof(get_kwd)/sizeof(get_kwd0)); - if( getf.find(key) == getf.end()) throw ErrSyn( ERR_PROT_WRKWD, key); - return (this->*getfkey)(); + + + if( getf.find(key) != getf.end()) { + return (this->*getfkey)(); + } + else if ( !cmpi("config", key.substr(0,key.find(':'))) ) { + return getConfig(key.substr(key.find(':')+1)); + } + throw ErrSyn( ERR_PROT_WRKWD, key); +} + +std::string MASS::getConfig(const std::string& keyword) +{ + /* + * Parse the configuration item string, assuming: + * section/sub-section/item + */ + std::string::size_type start = 0; + std::string::size_type pos = 0; + + + /* + * I could make a loop and store the three tokes in an array, + * this would save memory and code. + * I could also optimize the code avoiding copies and reusing + * strings. + * Still, it is not a matter of performance and + * I prefer code more intuitive to read. + * + * There is no need of explicit error handling for malformed + * or inexistent items: + * the std::sting functions would eventually return empy strings + * and the config.inp query would fail gratiously. + */ + + std::string path(keyword); + + pos = path.find_first_of('/',start); + std::string section = path.substr(start, pos-start); + + start = pos+1; + pos = path.find_first_of('/',start); + std::string subsec = path.substr(start, pos-start); + + /* + * A request for a vector is identified by the + * item name followed by "" (actually we are for simplicitly + * checking only for "" + */ + start = pos+1; + pos = path.find_first_of('',start); + std::string item = path.substr(start, pos-start); + + start = pos+1; + std::string arrayId = path.substr(start); + + // std::cout << "Section: " << section << std::endl; + // std::cout << "Sub-sec: " << subsec << std::endl; + // std::cout << "Item: " << item << std::endl; + // std::cout << "Array: " << arrayId << std::endl; + + std::string retval; + if(arrayId.empty()) { + /* + * if not an array + */ + retval = config.inp<std::string>( section, subsec, item); + } else { + /* + * if an array, + * we concatenate all the elements + * in a string separated by blanks + */ + std::vector<std::string>valv = config.inpv<std::string>( section, subsec, item); + for (std::vector<std::string>::const_iterator ii = valv.begin(); + ii != valv.end(); + ii++) { + retval += (*ii); + if( ii+1 != valv.end() ) { + retval += " "; + } + } + } + return keyword + "=\"" + retval + "\""; } MASS* MASS::pMASS = 0;
View file
turbina_core_m-1.32.tar.bz2/mass.h -> turbina_core_m-1.33.tar.bz2/mass.h
Changed
@@ -91,6 +91,7 @@ int quit( const std::vector<std::string>& ) { return 0; } void set(const std::string& key, const std::string& val = "-"); std::string get(const std::string& key); + std::string getConfig(const std::string&); static bool works() { return true; } };
View file
turbina_core_m-1.32.tar.bz2/measmode.cpp -> turbina_core_m-1.33.tar.bz2/measmode.cpp
Changed
@@ -18,35 +18,28 @@ const std::string StatMeasModeName = "Statistic measurement"; const std::string CountMeasModeName = "Counting measurement"; -const bool nstring = true; // true for n string output +const bool nstring = false; // true for n string output const double S2MS = 1000.0; MeasMode::MeasMode(const std::string& modename, Instrument& instr_) : mname(modename), instr(instr_), minDflux(0) { } -//void MeasMode::calcValues() { -// double ex = (nstring)? 0.5*exposition : exposition; -// blockNumber = (int)floor( S2MS*baseTime/ex/Instrument::getCountInBlock()); -// exposNumber = blockNumber*Instrument::getCountInBlock(); -//} - void MeasMode::outdata(RESULT_DATA& result_data, bool is_accum_time) { Result::instance().outdata(result_data, is_accum_time); } unsigned int MeasMode::runAccumTime() { -// double s0 = cutc.currentSec(); + unsigned int n_loss = 0; + unsigned int err = 0; RESULT_DATA result_data_accum; - unsigned int n_loss = 0, err = 0; - instr.getTemperature(); bool illum = instr.getIllum(); instr.setIllum(false); Result::instance().outmode(mname); instr.checkStatus(); instr.waitHV(); - exposNumber = instr.prepareAccumTime( (nstring)? 0.5*exposition : exposition, baseTime ); + int exposNumber = instr.prepareAccumTime( (nstring)? 0.5*exposition : exposition, baseTime ); for( unsigned int i = 0; i < base_number && further_now(); i++ ) { instr.startBaseTime( false ); @@ -58,22 +51,29 @@ continue; } // instr.checkStatus(); - if( nstring ) pre_processing( count_data ); // for n string set half of exposure + if( nstring ) { + RESULT_DATA first_data; // Additional n string + sci::calcmom( count_data, first_data ); + if( first_data.m3 < minDflux*exposition/2 ) { + n_loss++; + ErrlogSingl::instance().warning( "Measurement: low fluxes", (int)i ); + continue; + } + Result::instance().outdata_pre( first_data ); + sci::binned( count_data ); + } sci::calcmom( count_data, result_data ); Result::instance().outcnt( count_data ); if(result_data.m3 < minDflux*exposition) { n_loss++; ErrlogSingl::instance().warning( "Measurement: low fluxes", (int)i ); continue; -// flux = result_data.m/exposition; -// vars = result_data.s0*exposition; -// throw ErrFat( ERR_CCD_EMPTY, mname ); } outdata( result_data, false ); // output base-time data result_data_accum += result_data; particular_processing( count_data, result_data ); // for s strings } // end of base-time-cycle - if( n_loss == base_number ) throw ErrFat( ERR_EXCHANGE, mname ); + if( n_loss == base_number ) throw ErrFat( ERR_CCD_EMPTY, mname ); result_data_accum /= (double)(base_number - n_loss); flux = result_data_accum.m/exposition; // store accumtime mean fluxes vars = result_data_accum.s0*exposition; // store accumtime vaiances @@ -109,11 +109,10 @@ exposition = config.inp<double>("operations", NormalModeName, "exposition"); minDflux = config.inp<double>("operations", NormalModeName, "MinimalStarFlux"); base_number = (int)floor( accumTime/baseTime ); -// calcValues(); } void Normal::pre_processing( valarray<COUNT_T>& count_data ) { - RESULT_DATA first_data; // Additional n string + RESULT_DATA first_data; // Additional n string sci::calcmom( count_data, first_data ); Result::instance().outdata_pre( first_data ); sci::binned( count_data ); @@ -145,7 +144,6 @@ baseTime = config.inp<int>("operations", NormalModeName, "basetime"); exposition = config.inp<double>("operations", NormalModeName, "exposition"); base_number = (int)floor( accumTime/baseTime ); -// calcValues(); } void Background::run() { @@ -157,7 +155,6 @@ baseTime = config.inp<int>("operations", NormalModeName, "basetime"); exposition = config.inp<double>("operations", NormalModeName, "exposition"); base_number = (int)floor( accumTime/baseTime ); -// calcValues(); } void Flux::run() { @@ -173,7 +170,6 @@ if(testCounts.size() != N_CHAN) throw ErrFat(ERR_CFG_MISSED, "operations/tests/testcounts"); tolerance = config.inp<double>("operations", "tests", "fluxtolerance"); base_number = (int)floor( accumTime/baseTime ); -// calcValues(); } @@ -198,7 +194,6 @@ modulation = config.inp<double>("operations", "tests", "modulation"); tolerance = config.inp<double>("operations", "tests", "fluxtolerance"); base_number = (int)floor( accumTime/baseTime ); -// calcValues(); } void StatTest::run() { @@ -215,14 +210,13 @@ baseTime = config.inp<int>("operations", NormalModeName, "basetime"); exposition = config.inp<double>("operations", NormalModeName, "exposition"); base_number = (int)floor( accumTime/baseTime ); -// calcValues(); } unsigned int ExchTest::runAccumTime() { instr.getTemperature(); Result::instance().outmode(mname); - exposNumber = instr.prepareAccumTime(exposition, baseTime ); - blockNumber = instr.get_blocks_number(); + int exposNumber = instr.prepareAccumTime(exposition, baseTime ); + unsigned int n_loss = 0; unsigned int err = 0; unsigned int loss = 0; @@ -241,6 +235,7 @@ void ExchTest::run() { unsigned int err = runAccumTime(); + int blockNumber = instr.get_blocks_number(); if(!err) { Result::instance().outcomment("Exchange Test: It's OK"); } else { @@ -285,7 +280,6 @@ baseTime = config.inp<int>("operations", NormalModeName, "basetime"); exposition = config.inp<double>("operations", NormalModeName, "exposition"); base_number = (int)floor( accumTime/baseTime ); -// calcValues(); } void StatMeas::outdata(RESULT_DATA& result_data, bool is_accum_time) { @@ -307,7 +301,6 @@ exposition = config.inp<double>("operations", NormalModeName, "exposition"); light = config.inp<double>("operations", "tests", "countinglight"); base_number = (int)floor( accumTime/baseTime ); -// calcValues(); } void CountMeas::outdata(RESULT_DATA& result_data, bool is_accum_time) {
View file
turbina_core_m-1.32.tar.bz2/measmode.h -> turbina_core_m-1.33.tar.bz2/measmode.h
Changed
@@ -14,8 +14,8 @@ double minDflux; // 0 for all modes except normal int accumTime; unsigned int base_number; - int exposNumber; - int blockNumber; +// int exposNumber; +// int blockNumber; static std::valarray<double> flux; static std::valarray<double> vars; static bool _stop_now;
View file
turbina_core_m-1.33.tar.bz2/server/.hgtags
Added
@@ -0,0 +1,32 @@ +135764085dd15a107663c0a9154f36b809dc1923 dimm-2_11 +223e2569e1e84bdfc59542ae6e0931095f7437c2 mokko-v1 +560beaa379df8f40a7938bf59bbdefcf1ea4069c ameba-0_40 +68283fd7395f38c1d558df678859fcae41deaa7e dimm-2_26 +68283fd7395f38c1d558df678859fcae41deaa7e dome-1_19 +68283fd7395f38c1d558df678859fcae41deaa7e monitor-1_07 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc ameba-0_59 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc ameba-0_60 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc ameba-0_61 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc ameba-0_62 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc dimm-2_45 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc dimm-2_46 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc dome-1_24 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc monitor-1_30 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc monitor-1_31 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc monitor-1_32 +6c17fce2bf56e1dc148198c3e3e587fc7a1be9bc turbina_core_m-1_20 +863e6af94a47c115b3d827cfaf005cd8e752d204 ameba-0_58 +863e6af94a47c115b3d827cfaf005cd8e752d204 dome-1_23 +863e6af94a47c115b3d827cfaf005cd8e752d204 monitor-1_29 +9ad9ff9be3b2de132db5dfd288f7e1a924fdeb92 dome-1_01 +9ad9ff9be3b2de132db5dfd288f7e1a924fdeb92 dome-1_03 +9ad9ff9be3b2de132db5dfd288f7e1a924fdeb92 start +9ad9ff9be3b2de132db5dfd288f7e1a924fdeb92 tlsp-0_13 +9ad9ff9be3b2de132db5dfd288f7e1a924fdeb92 tlsp-0_15 +9ad9ff9be3b2de132db5dfd288f7e1a924fdeb92 tlsp-0_20 +9ad9ff9be3b2de132db5dfd288f7e1a924fdeb92 turb-0_2 +c0176904c8f0c48296e12e38241ef8736845ae78 ameba-0_57 +c0176904c8f0c48296e12e38241ef8736845ae78 dimm-2_33 +f1364cffaebd1d89de39da4ec627748e59eb3193 ameba-0-49 +f4d1b12c5ecf742b786ee57c4ae78b0e39f9bf6a ameba-0_12 +f4d1b12c5ecf742b786ee57c4ae78b0e39f9bf6a ameba-0_21
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.