Changeset 11229
- Timestamp:
- 07/01/11 08:38:40 (13 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/Makefile.am
r11228 r11229 37 37 fadctrl fad \ 38 38 fscctrl fsc \ 39 biasctrl \40 39 fitsdump 41 40 … … 176 175 \ 177 176 src/Connection.h src/Connection.cc \ 178 src/ConnectionUSB.h src/ConnectionUSB.cc \179 177 \ 180 178 FACT.h ByteOrder.h … … 240 238 libConfiguration.la 241 239 242 biasctrl_SOURCES = src/biasctrl.cc src/LocalControl.h243 biasctrl_LDADD = libDim.la libDim++.la libDimExtension.la \244 libTime.la libTools.la libStateMachine.la \245 libConfiguration.la246 247 240 248 241 argv_SOURCES = src/argv.cc 249 argv_LDADD = libConfiguration.la libTime.la242 argv_LDADD = libConfiguration.la 250 243 251 244 -
trunk/FACT++/Makefile.in
r11228 r11229 51 51 scheduler$(EXEEXT) triggerschedule$(EXEEXT) ftmctrl$(EXEEXT) \ 52 52 ftm$(EXEEXT) fadctrl$(EXEEXT) fad$(EXEEXT) fscctrl$(EXEEXT) \ 53 fsc$(EXEEXT) biasctrl$(EXEEXT) fitsdump$(EXEEXT) \ 54 $(am__EXEEXT_2) $(am__EXEEXT_3) 53 fsc$(EXEEXT) fitsdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) 55 54 @HAS_LIBXP_TRUE@am__append_1 = did 56 55 … … 147 146 src/DimServiceInfoList.lo src/DimNetwork.lo src/ServiceList.lo \ 148 147 src/DimErrorRedirecter.lo src/DimDescriptionService.lo \ 149 src/Connection.lo src/ConnectionUSB.lo148 src/Connection.lo 150 149 libStateMachine_la_OBJECTS = $(am_libStateMachine_la_OBJECTS) 151 150 libTime_la_LIBADD = … … 164 163 am_argv_OBJECTS = src/argv.$(OBJEXT) 165 164 argv_OBJECTS = $(am_argv_OBJECTS) 166 argv_DEPENDENCIES = libConfiguration.la libTime.la165 argv_DEPENDENCIES = libConfiguration.la 167 166 astro_SOURCES = astro.c 168 167 astro_OBJECTS = astro.$(OBJEXT) 169 168 astro_LDADD = $(LDADD) 170 am_biasctrl_OBJECTS = src/biasctrl.$(OBJEXT)171 biasctrl_OBJECTS = $(am_biasctrl_OBJECTS)172 biasctrl_DEPENDENCIES = libDim.la libDim++.la libDimExtension.la \173 libTime.la libTools.la libStateMachine.la libConfiguration.la174 169 am_chatclient_OBJECTS = src/chatclient.$(OBJEXT) 175 170 chatclient_OBJECTS = $(am_chatclient_OBJECTS) … … 337 332 $(libStateMachine_la_SOURCES) $(libTime_la_SOURCES) \ 338 333 $(libTools_la_SOURCES) $(argv_SOURCES) astro.c \ 339 $( biasctrl_SOURCES) $(chatclient_SOURCES) $(chatserv_SOURCES) \334 $(chatclient_SOURCES) $(chatserv_SOURCES) \ 340 335 $(datalogger_SOURCES) $(dclient5_SOURCES) $(did_SOURCES) \ 341 336 $(dimctrl_SOURCES) $(dns_SOURCES) $(drivectrl_SOURCES) \ … … 350 345 $(libStateMachine_la_SOURCES) $(libTime_la_SOURCES) \ 351 346 $(libTools_la_SOURCES) $(argv_SOURCES) astro.c \ 352 $( biasctrl_SOURCES) $(chatclient_SOURCES) $(chatserv_SOURCES) \347 $(chatclient_SOURCES) $(chatserv_SOURCES) \ 353 348 $(am__datalogger_SOURCES_DIST) $(dclient5_SOURCES) \ 354 349 $(did_SOURCES) $(dimctrl_SOURCES) $(dns_SOURCES) \ … … 735 730 \ 736 731 src/Connection.h src/Connection.cc \ 737 src/ConnectionUSB.h src/ConnectionUSB.cc \738 732 \ 739 733 FACT.h ByteOrder.h … … 787 781 libConfiguration.la 788 782 789 biasctrl_SOURCES = src/biasctrl.cc src/LocalControl.h790 biasctrl_LDADD = libDim.la libDim++.la libDimExtension.la \791 libTime.la libTools.la libStateMachine.la \792 libConfiguration.la793 794 783 argv_SOURCES = src/argv.cc 795 argv_LDADD = libConfiguration.la libTime.la784 argv_LDADD = libConfiguration.la 796 785 dimctrl_SOURCES = src/dimctrl.cc src/RemoteControl.cc src/RemoteControl.h 797 786 dimctrl_LDADD = libTools.la libStateMachine.la libTime.la \ … … 1015 1004 src/$(DEPDIR)/$(am__dirstamp) 1016 1005 src/Connection.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) 1017 src/ConnectionUSB.lo: src/$(am__dirstamp) \1018 src/$(DEPDIR)/$(am__dirstamp)1019 1006 libStateMachine.la: $(libStateMachine_la_OBJECTS) $(libStateMachine_la_DEPENDENCIES) 1020 1007 $(AM_V_CXXLD)$(CXXLINK) -rpath $(libdir) $(libStateMachine_la_OBJECTS) $(libStateMachine_la_LIBADD) $(LIBS) … … 1091 1078 @rm -f astro$(EXEEXT) 1092 1079 $(AM_V_CCLD)$(LINK) $(astro_OBJECTS) $(astro_LDADD) $(LIBS) 1093 src/biasctrl.$(OBJEXT): src/$(am__dirstamp) \1094 src/$(DEPDIR)/$(am__dirstamp)1095 biasctrl$(EXEEXT): $(biasctrl_OBJECTS) $(biasctrl_DEPENDENCIES)1096 @rm -f biasctrl$(EXEEXT)1097 $(AM_V_CXXLD)$(CXXLINK) $(biasctrl_OBJECTS) $(biasctrl_LDADD) $(LIBS)1098 1080 src/chatclient.$(OBJEXT): src/$(am__dirstamp) \ 1099 1081 src/$(DEPDIR)/$(am__dirstamp) … … 1307 1289 -rm -f src/Connection.$(OBJEXT) 1308 1290 -rm -f src/Connection.lo 1309 -rm -f src/ConnectionUSB.$(OBJEXT)1310 -rm -f src/ConnectionUSB.lo1311 1291 -rm -f src/Console.$(OBJEXT) 1312 1292 -rm -f src/Console.lo … … 1365 1345 -rm -f src/WindowLog.lo 1366 1346 -rm -f src/argv.$(OBJEXT) 1367 -rm -f src/biasctrl.$(OBJEXT)1368 1347 -rm -f src/chatclient.$(OBJEXT) 1369 1348 -rm -f src/chatserv.$(OBJEXT) … … 1428 1407 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/Configuration.Plo@am__quote@ 1429 1408 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/Connection.Plo@am__quote@ 1430 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/ConnectionUSB.Plo@am__quote@1431 1409 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/Console.Plo@am__quote@ 1432 1410 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/Converter.Plo@am__quote@ … … 1460 1438 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/WindowLog.Plo@am__quote@ 1461 1439 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/argv.Po@am__quote@ 1462 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/biasctrl.Po@am__quote@1463 1440 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/chatclient.Po@am__quote@ 1464 1441 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/chatserv.Po@am__quote@ -
trunk/FACT++/src/argv.cc
r11228 r11229 4 4 5 5 using namespace std; 6 7 template<class T,class S>8 std::ostream &operator<<(std::ostream &out, const pair<T,S> &f)9 {10 out << f.first << "|" << f.second;11 return out;12 }13 template<class T, class S>14 std::istream &operator>>(std::istream &in, pair<T,S> &f)15 {16 char c;17 in >> f.first;18 in >> c;19 if (c!=':')20 return in;21 in >> f.second;22 return in;23 }24 25 typedef pair<int,int> mytype;26 27 28 //Source is OutputStreamable, meaning that an operator<< is defined29 // that takes a std::ostream or std::wostream object on the left hand side30 // and an instance of the argument type on the right.31 32 // Target is InputStreamable, meaning that an operator>> is defined that33 // takes a std::istream or std::wistream object on the left hand side and34 // an instance of the result type on the right.35 36 //Target is CopyConstructible [20.1.3].37 //Target is DefaultConstructible, meaning that it is possible to default-initialize an object of that type [8.5, 20.1.4].38 6 39 7 // -------------------------------------------------------------------------- … … 114 82 ("switch", po_switch(), "include path") 115 83 ("bool", var<bool>()->implicit_value(true), "include path") 116 ("mytype", var<mytype>(), "include path")117 84 ; 118 85 … … 205 172 cout << conf.Has("switch") << " " << conf.Get<bool>("switch") << endl; 206 173 cout << conf.Has("bool") << " " << conf.Get<bool>("bool") << endl; 207 cout << conf.Has("mytype") << " " << conf.Get<mytype>("mytype") << endl;208 174 209 175 return 0; -
trunk/FACT++/src/logtime.cc
r11228 r11229 6 6 #include <iostream> 7 7 8 #include "DimDescriptionService.h"9 10 8 int main(int, const char **) 11 9 { 12 10 // We could use putenv to make the Configure class change the value... 13 11 setenv("DIM_DNS_NODE", "localhost", 0); 14 12 … … 16 14 DimServer::start("TIME"); 17 15 18 usleep(2000000);19 20 DimServer::stop();21 22 return 0;23 24 16 // Some info on the console 25 17 std::cout << "Offering TIME/MESSAGE...\n" << std::endl; 26 27 short s;28 int i;29 long long ll;30 float f;31 DimDescribedService servt("TIME/TEST", "O:1;I:1;C",32 "This is my test command|Char[c]:This is a char| Int This is an int|String[s]:This is a string");33 34 DimDescribedService servs("TIME/SHORT", s, "[a]");35 DimDescribedService servx("TIME/LONGLONG", ll, "|: This is my long long");36 DimDescribedService servi("TIME/INT", i, "|MyInt [ mi ] ");37 DimDescribedService servf("TIME/FLOAT", f, "| MyFloat : This is my float");38 DimDescribedService servc("TIME/TIME", const_cast<char*>(""), "|MyTime[T]:This is my time");39 40 DimCommand cmd("TIME/CMD", "I:2;F:2");41 42 DimDescriptionService des("TIME/CMD", "|range[addr]:From DAC to DAC|values[DAC]:DAC values to be set");43 44 {45 Time t0;46 18 47 19 // Setup a DimService called TIME/MESSAGE … … 51 23 // Send current time 52 24 msg.Message(Time().GetAsStr()); 53 // servx.Update(); 54 /* 55 servs.updateService(); 56 servi.updateService(); 57 servf.updateService(); 58 servc.updateService(); 59 */ 25 60 26 // wait approximately one second 61 usleep(100000); 62 63 // if (t0.UnixTime()-Time().UnixTime()<-5) 64 // break; 27 usleep(1000000); 65 28 } 66 }67 68 DimDescribedService servxx("TIME/XXX", const_cast<char*>(""), "|MyTime[T]:This is my time");69 usleep(10000000);70 29 71 30 return 0; -
trunk/FACT++/src/tools.cc
r11228 r11229 12 12 #include <stdarg.h> 13 13 14 #include <boost/filesystem.hpp> 14 using namespace std; 15 15 16 using namespace std;17 /*18 16 string Tools::Format(const char *fmt, va_list &ap) 19 17 { … … 51 49 return str; 52 50 } 53 */54 51 55 52 // -------------------------------------------------------------------------- … … 57 54 //! This is a static helper to remove leading and trailing whitespaces. 58 55 //! 59 //! @param str56 //! @param buf 60 57 //! a pointer to the char array from which the whitespaces should be 61 58 //! removed … … 76 73 return str.substr(start, end-start+1); 77 74 } 78 79 // --------------------------------------------------------------------------80 //81 //! Splits a string of the form [SERVER/]COMMAND[ arguments]82 //! into SERVER, COMMAND and arguments.83 //!84 //! @param str85 //! string to be splitted86 //!87 //! @returns88 //! a vector<string> with three components. Depending on what is existing89 //! in the string some of the components might be empty.90 //!91 /*92 vector<string> Split(std::string str)93 {94 const size_t p0 = str.find_first_of('/');95 96 size_t p1 = str.find_first_of(' ');97 98 vector<string> v(3);99 100 // string starts with SERVER/COMMAND[ arguments]101 if (p0<p1)102 {103 // SERVER104 v[0] = str.substr(0, p0);105 106 // COMMAND[ arguments)107 str = str.substr(p0+1);108 p1 = str.find_first_of(' ');109 }110 111 // String is of the form: COMMAND[ arguments]112 113 // COMMAND114 v[1] = str.substr(0, p1);115 116 // Has arguments117 if (p1!=string::npos)118 v[2] = str.substr(p1+1);119 120 return v;121 }122 */ -
trunk/FACT++/src/tools.h
r11228 r11229 1 1 #include <string> 2 #include <vector>3 2 4 3 namespace Tools 5 4 { 6 //std::string Format(const char *fmt, va_list &ap);7 //std::string Form(const char *fmt, ...);5 std::string Format(const char *fmt, va_list &ap); 6 std::string Form(const char *fmt, ...); 8 7 std::string Trim(const std::string &str); 9 8 }
Note:
See TracChangeset
for help on using the changeset viewer.