- Timestamp:
- 07/01/11 08:30:53 (13 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/Makefile.am
r11075 r11228 37 37 fadctrl fad \ 38 38 fscctrl fsc \ 39 biasctrl \ 39 40 fitsdump 40 41 … … 175 176 \ 176 177 src/Connection.h src/Connection.cc \ 178 src/ConnectionUSB.h src/ConnectionUSB.cc \ 177 179 \ 178 180 FACT.h ByteOrder.h … … 238 240 libConfiguration.la 239 241 242 biasctrl_SOURCES = src/biasctrl.cc src/LocalControl.h 243 biasctrl_LDADD = libDim.la libDim++.la libDimExtension.la \ 244 libTime.la libTools.la libStateMachine.la \ 245 libConfiguration.la 246 240 247 241 248 argv_SOURCES = src/argv.cc 242 argv_LDADD = libConfiguration.la 249 argv_LDADD = libConfiguration.la libTime.la 243 250 244 251 -
trunk/FACT++/Makefile.in
r11075 r11228 51 51 scheduler$(EXEEXT) triggerschedule$(EXEEXT) ftmctrl$(EXEEXT) \ 52 52 ftm$(EXEEXT) fadctrl$(EXEEXT) fad$(EXEEXT) fscctrl$(EXEEXT) \ 53 fsc$(EXEEXT) fitsdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) 53 fsc$(EXEEXT) biasctrl$(EXEEXT) fitsdump$(EXEEXT) \ 54 $(am__EXEEXT_2) $(am__EXEEXT_3) 54 55 @HAS_LIBXP_TRUE@am__append_1 = did 55 56 … … 146 147 src/DimServiceInfoList.lo src/DimNetwork.lo src/ServiceList.lo \ 147 148 src/DimErrorRedirecter.lo src/DimDescriptionService.lo \ 148 src/Connection.lo 149 src/Connection.lo src/ConnectionUSB.lo 149 150 libStateMachine_la_OBJECTS = $(am_libStateMachine_la_OBJECTS) 150 151 libTime_la_LIBADD = … … 163 164 am_argv_OBJECTS = src/argv.$(OBJEXT) 164 165 argv_OBJECTS = $(am_argv_OBJECTS) 165 argv_DEPENDENCIES = libConfiguration.la 166 argv_DEPENDENCIES = libConfiguration.la libTime.la 166 167 astro_SOURCES = astro.c 167 168 astro_OBJECTS = astro.$(OBJEXT) 168 169 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.la 169 174 am_chatclient_OBJECTS = src/chatclient.$(OBJEXT) 170 175 chatclient_OBJECTS = $(am_chatclient_OBJECTS) … … 332 337 $(libStateMachine_la_SOURCES) $(libTime_la_SOURCES) \ 333 338 $(libTools_la_SOURCES) $(argv_SOURCES) astro.c \ 334 $( chatclient_SOURCES) $(chatserv_SOURCES) \339 $(biasctrl_SOURCES) $(chatclient_SOURCES) $(chatserv_SOURCES) \ 335 340 $(datalogger_SOURCES) $(dclient5_SOURCES) $(did_SOURCES) \ 336 341 $(dimctrl_SOURCES) $(dns_SOURCES) $(drivectrl_SOURCES) \ … … 345 350 $(libStateMachine_la_SOURCES) $(libTime_la_SOURCES) \ 346 351 $(libTools_la_SOURCES) $(argv_SOURCES) astro.c \ 347 $( chatclient_SOURCES) $(chatserv_SOURCES) \352 $(biasctrl_SOURCES) $(chatclient_SOURCES) $(chatserv_SOURCES) \ 348 353 $(am__datalogger_SOURCES_DIST) $(dclient5_SOURCES) \ 349 354 $(did_SOURCES) $(dimctrl_SOURCES) $(dns_SOURCES) \ … … 730 735 \ 731 736 src/Connection.h src/Connection.cc \ 737 src/ConnectionUSB.h src/ConnectionUSB.cc \ 732 738 \ 733 739 FACT.h ByteOrder.h … … 781 787 libConfiguration.la 782 788 789 biasctrl_SOURCES = src/biasctrl.cc src/LocalControl.h 790 biasctrl_LDADD = libDim.la libDim++.la libDimExtension.la \ 791 libTime.la libTools.la libStateMachine.la \ 792 libConfiguration.la 793 783 794 argv_SOURCES = src/argv.cc 784 argv_LDADD = libConfiguration.la 795 argv_LDADD = libConfiguration.la libTime.la 785 796 dimctrl_SOURCES = src/dimctrl.cc src/RemoteControl.cc src/RemoteControl.h 786 797 dimctrl_LDADD = libTools.la libStateMachine.la libTime.la \ … … 1004 1015 src/$(DEPDIR)/$(am__dirstamp) 1005 1016 src/Connection.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) 1017 src/ConnectionUSB.lo: src/$(am__dirstamp) \ 1018 src/$(DEPDIR)/$(am__dirstamp) 1006 1019 libStateMachine.la: $(libStateMachine_la_OBJECTS) $(libStateMachine_la_DEPENDENCIES) 1007 1020 $(AM_V_CXXLD)$(CXXLINK) -rpath $(libdir) $(libStateMachine_la_OBJECTS) $(libStateMachine_la_LIBADD) $(LIBS) … … 1078 1091 @rm -f astro$(EXEEXT) 1079 1092 $(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) 1080 1098 src/chatclient.$(OBJEXT): src/$(am__dirstamp) \ 1081 1099 src/$(DEPDIR)/$(am__dirstamp) … … 1289 1307 -rm -f src/Connection.$(OBJEXT) 1290 1308 -rm -f src/Connection.lo 1309 -rm -f src/ConnectionUSB.$(OBJEXT) 1310 -rm -f src/ConnectionUSB.lo 1291 1311 -rm -f src/Console.$(OBJEXT) 1292 1312 -rm -f src/Console.lo … … 1345 1365 -rm -f src/WindowLog.lo 1346 1366 -rm -f src/argv.$(OBJEXT) 1367 -rm -f src/biasctrl.$(OBJEXT) 1347 1368 -rm -f src/chatclient.$(OBJEXT) 1348 1369 -rm -f src/chatserv.$(OBJEXT) … … 1407 1428 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/Configuration.Plo@am__quote@ 1408 1429 @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@ 1409 1431 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/Console.Plo@am__quote@ 1410 1432 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/Converter.Plo@am__quote@ … … 1438 1460 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/WindowLog.Plo@am__quote@ 1439 1461 @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@ 1440 1463 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/chatclient.Po@am__quote@ 1441 1464 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/chatserv.Po@am__quote@ -
trunk/FACT++/gui/design.ui
r11227 r11228 2874 2874 </attribute> 2875 2875 <layout class="QGridLayout" name="gridLayout_41"> 2876 <item row=" 1" column="0">2876 <item row="0" column="0"> 2877 2877 <widget class="QDockWidget" name="fFadDock"> 2878 2878 <property name="sizePolicy"> … … 2901 2901 <property name="geometry"> 2902 2902 <rect> 2903 <x> 630</x>2903 <x>460</x> 2904 2904 <y>0</y> 2905 <width>3 07</width>2906 <height>1 81</height>2905 <width>321</width> 2906 <height>161</height> 2907 2907 </rect> 2908 2908 </property> … … 3104 3104 </layout> 3105 3105 </widget> 3106 <widget class="QPushButton" name="fFadSingleTrigger">3107 <property name="geometry">3108 <rect>3109 <x>520</x>3110 <y>220</y>3111 <width>94</width>3112 <height>24</height>3113 </rect>3114 </property>3115 <property name="text">3116 <string>Trigger</string>3117 </property>3118 </widget>3119 <widget class="QPushButton" name="fFadResetTriggerId">3120 <property name="geometry">3121 <rect>3122 <x>520</x>3123 <y>250</y>3124 <width>94</width>3125 <height>24</height>3126 </rect>3127 </property>3128 <property name="text">3129 <string>Reset Evt ID</string>3130 </property>3131 </widget>3132 3106 <widget class="QGroupBox" name="groupBox_12"> 3133 3107 <property name="geometry"> 3134 3108 <rect> 3135 <x> 0</x>3136 <y>3 30</y>3137 <width> 361</width>3138 <height> 171</height>3109 <x>10</x> 3110 <y>300</y> 3111 <width>441</width> 3112 <height>211</height> 3139 3113 </rect> 3140 3114 </property> … … 3151 3125 <property name="geometry"> 3152 3126 <rect> 3153 <x> 630</x>3154 <y>1 90</y>3155 <width>3 03</width>3156 <height>3 24</height>3127 <x>460</x> 3128 <y>160</y> 3129 <width>321</width> 3130 <height>361</height> 3157 3131 </rect> 3158 3132 </property> … … 3162 3136 <layout class="QGridLayout" name="gridLayout_42"> 3163 3137 <item row="0" column="0"> 3164 <layout class="QGridLayout" name="gridLayout_37" rowstretch="0,0,0,0,0,0,0,0,0,0 ">3165 <item row=" 1" column="1">3138 <layout class="QGridLayout" name="gridLayout_37" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0"> 3139 <item row="3" column="1"> 3166 3140 <widget class="QPushButton" name="fFadTriggerLineOn"> 3167 3141 <property name="text"> … … 3170 3144 </widget> 3171 3145 </item> 3172 <item row=" 1" column="2">3146 <item row="3" column="2"> 3173 3147 <widget class="QPushButton" name="fFadTriggerLineOff"> 3174 3148 <property name="text"> … … 3177 3151 </widget> 3178 3152 </item> 3179 <item row=" 1" column="3">3153 <item row="3" column="3"> 3180 3154 <widget class="QLabel" name="label_134"> 3181 3155 <property name="text"> … … 3184 3158 </widget> 3185 3159 </item> 3186 <item row=" 1" column="0">3160 <item row="3" column="0"> 3187 3161 <widget class="QPushButton" name="fFadLedTriggerLine"> 3188 3162 <property name="enabled"> … … 3222 3196 </widget> 3223 3197 </item> 3224 <item row=" 0" column="1">3198 <item row="2" column="1"> 3225 3199 <widget class="QPushButton" name="fFadSocket0"> 3226 3200 <property name="text"> … … 3229 3203 </widget> 3230 3204 </item> 3231 <item row=" 0" column="2">3205 <item row="2" column="2"> 3232 3206 <widget class="QPushButton" name="fFadSocket17"> 3233 3207 <property name="text"> … … 3236 3210 </widget> 3237 3211 </item> 3238 <item row=" 0" column="3">3212 <item row="2" column="3"> 3239 3213 <widget class="QLabel" name="label_137"> 3240 3214 <property name="text"> … … 3243 3217 </widget> 3244 3218 </item> 3245 <item row=" 0" column="0">3219 <item row="2" column="0"> 3246 3220 <widget class="QPushButton" name="fFadLedSocket"> 3247 3221 <property name="enabled"> … … 3281 3255 </widget> 3282 3256 </item> 3283 <item row=" 3" column="1">3257 <item row="5" column="1"> 3284 3258 <widget class="QPushButton" name="fFadBusyOn"> 3285 3259 <property name="text"> … … 3288 3262 </widget> 3289 3263 </item> 3290 <item row=" 3" column="2">3264 <item row="5" column="2"> 3291 3265 <widget class="QPushButton" name="fFadBusyOff"> 3292 3266 <property name="text"> … … 3295 3269 </widget> 3296 3270 </item> 3297 <item row=" 3" column="3">3271 <item row="5" column="3"> 3298 3272 <widget class="QLabel" name="label_104"> 3299 3273 <property name="text"> … … 3302 3276 </widget> 3303 3277 </item> 3304 <item row=" 3" column="0">3278 <item row="5" column="0"> 3305 3279 <widget class="QPushButton" name="fFadLedBusy"> 3306 3280 <property name="enabled"> … … 3340 3314 </widget> 3341 3315 </item> 3342 <item row=" 2" column="3">3316 <item row="4" column="3"> 3343 3317 <widget class="QLabel" name="label_106"> 3344 3318 <property name="text"> … … 3347 3321 </widget> 3348 3322 </item> 3349 <item row=" 2" column="2">3323 <item row="4" column="2"> 3350 3324 <widget class="QPushButton" name="fFadContTriggerOff"> 3351 3325 <property name="text"> … … 3354 3328 </widget> 3355 3329 </item> 3356 <item row=" 2" column="1">3330 <item row="4" column="1"> 3357 3331 <widget class="QPushButton" name="fFadContTriggerOn"> 3358 3332 <property name="text"> … … 3361 3335 </widget> 3362 3336 </item> 3363 <item row=" 2" column="0">3337 <item row="4" column="0"> 3364 3338 <widget class="QPushButton" name="fFadLedContTrigger"> 3365 3339 <property name="enabled"> … … 3399 3373 </widget> 3400 3374 </item> 3401 <item row=" 4" column="1">3375 <item row="6" column="1"> 3402 3376 <widget class="QPushButton" name="fFadDrsOn"> 3403 3377 <property name="text"> … … 3406 3380 </widget> 3407 3381 </item> 3408 <item row=" 4" column="2">3382 <item row="6" column="2"> 3409 3383 <widget class="QPushButton" name="fFadDrsOff"> 3410 3384 <property name="text"> … … 3413 3387 </widget> 3414 3388 </item> 3415 <item row=" 4" column="3">3389 <item row="6" column="3"> 3416 3390 <widget class="QLabel" name="label_93"> 3417 3391 <property name="text"> … … 3420 3394 </widget> 3421 3395 </item> 3422 <item row=" 5" column="3">3396 <item row="7" column="3"> 3423 3397 <widget class="QLabel" name="label_94"> 3424 3398 <property name="text"> … … 3427 3401 </widget> 3428 3402 </item> 3429 <item row=" 5" column="2">3403 <item row="7" column="2"> 3430 3404 <widget class="QPushButton" name="fFadDwriteOff"> 3431 3405 <property name="text"> … … 3434 3408 </widget> 3435 3409 </item> 3436 <item row=" 5" column="1">3410 <item row="7" column="1"> 3437 3411 <widget class="QPushButton" name="fFadDwriteOn"> 3438 3412 <property name="text"> … … 3441 3415 </widget> 3442 3416 </item> 3443 <item row=" 4" column="0">3417 <item row="6" column="0"> 3444 3418 <widget class="QPushButton" name="fFadLedDrsEnabled"> 3445 3419 <property name="enabled"> … … 3479 3453 </widget> 3480 3454 </item> 3481 <item row=" 5" column="0">3455 <item row="7" column="0"> 3482 3456 <widget class="QPushButton" name="fFadLedDrsWrite"> 3483 3457 <property name="enabled"> … … 3517 3491 </widget> 3518 3492 </item> 3519 <item row=" 6" column="1">3493 <item row="8" column="1"> 3520 3494 <widget class="QPushButton" name="pushButton_8"> 3521 3495 <property name="enabled"> … … 3527 3501 </widget> 3528 3502 </item> 3529 <item row=" 6" column="2">3503 <item row="8" column="2"> 3530 3504 <widget class="QPushButton" name="pushButton_13"> 3531 3505 <property name="enabled"> … … 3537 3511 </widget> 3538 3512 </item> 3539 <item row=" 7" column="2">3513 <item row="9" column="2"> 3540 3514 <widget class="QPushButton" name="pushButton_14"> 3541 3515 <property name="enabled"> … … 3547 3521 </widget> 3548 3522 </item> 3549 <item row=" 7" column="1">3523 <item row="9" column="1"> 3550 3524 <widget class="QPushButton" name="pushButton_9"> 3551 3525 <property name="enabled"> … … 3557 3531 </widget> 3558 3532 </item> 3559 <item row=" 8" column="1">3533 <item row="10" column="1"> 3560 3534 <widget class="QPushButton" name="pushButton_10"> 3561 3535 <property name="enabled"> … … 3567 3541 </widget> 3568 3542 </item> 3569 <item row=" 8" column="2">3543 <item row="10" column="2"> 3570 3544 <widget class="QPushButton" name="pushButton_15"> 3571 3545 <property name="enabled"> … … 3577 3551 </widget> 3578 3552 </item> 3579 <item row=" 6" column="3">3553 <item row="8" column="3"> 3580 3554 <widget class="QLabel" name="label_95"> 3581 3555 <property name="text"> … … 3584 3558 </widget> 3585 3559 </item> 3586 <item row=" 7" column="3">3560 <item row="9" column="3"> 3587 3561 <widget class="QLabel" name="label_96"> 3588 3562 <property name="text"> … … 3591 3565 </widget> 3592 3566 </item> 3593 <item row=" 8" column="3">3567 <item row="10" column="3"> 3594 3568 <widget class="QLabel" name="label_97"> 3595 3569 <property name="text"> … … 3598 3572 </widget> 3599 3573 </item> 3600 <item row=" 6" column="0">3574 <item row="8" column="0"> 3601 3575 <widget class="QPushButton" name="fFadLedDcmLocked"> 3602 3576 <property name="enabled"> … … 3636 3610 </widget> 3637 3611 </item> 3638 <item row=" 7" column="0">3612 <item row="9" column="0"> 3639 3613 <widget class="QPushButton" name="fFadLedDcmReady"> 3640 3614 <property name="enabled"> … … 3674 3648 </widget> 3675 3649 </item> 3676 <item row=" 8" column="0">3650 <item row="10" column="0"> 3677 3651 <widget class="QPushButton" name="fFadLedSpiSclk"> 3678 3652 <property name="enabled"> … … 3712 3686 </widget> 3713 3687 </item> 3714 <item row=" 9" column="1">3688 <item row="11" column="1"> 3715 3689 <widget class="QPushButton" name="fFadStartRun"> 3716 3690 <property name="enabled"> … … 3722 3696 </widget> 3723 3697 </item> 3724 <item row=" 9" column="2">3698 <item row="11" column="2"> 3725 3699 <widget class="QPushButton" name="fFadStopRun"> 3726 3700 <property name="enabled"> … … 3732 3706 </widget> 3733 3707 </item> 3734 <item row=" 9" column="3">3708 <item row="11" column="3"> 3735 3709 <widget class="QLabel" name="label_136"> 3736 3710 <property name="text"> 3737 3711 <string>Run</string> 3712 </property> 3713 </widget> 3714 </item> 3715 <item row="1" column="2"> 3716 <widget class="QPushButton" name="fFadSingleTrigger"> 3717 <property name="text"> 3718 <string>Trigger</string> 3719 </property> 3720 </widget> 3721 </item> 3722 <item row="1" column="3"> 3723 <widget class="QPushButton" name="fFadResetTriggerId"> 3724 <property name="text"> 3725 <string>Reset Evt ID</string> 3738 3726 </property> 3739 3727 </widget> … … 3746 3734 <property name="geometry"> 3747 3735 <rect> 3748 <x> 0</x>3749 <y> 20</y>3750 <width> 361</width>3736 <x>10</x> 3737 <y>0</y> 3738 <width>441</width> 3751 3739 <height>300</height> 3752 3740 </rect> -
trunk/FACT++/src/argv.cc
r10707 r11228 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 defined 29 // that takes a std::ostream or std::wostream object on the left hand side 30 // and an instance of the argument type on the right. 31 32 // Target is InputStreamable, meaning that an operator>> is defined that 33 // takes a std::istream or std::wistream object on the left hand side and 34 // 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]. 6 38 7 39 // -------------------------------------------------------------------------- … … 82 114 ("switch", po_switch(), "include path") 83 115 ("bool", var<bool>()->implicit_value(true), "include path") 116 ("mytype", var<mytype>(), "include path") 84 117 ; 85 118 … … 172 205 cout << conf.Has("switch") << " " << conf.Get<bool>("switch") << endl; 173 206 cout << conf.Has("bool") << " " << conf.Get<bool>("bool") << endl; 207 cout << conf.Has("mytype") << " " << conf.Get<mytype>("mytype") << endl; 174 208 175 209 return 0; -
trunk/FACT++/src/fad.cc
r11209 r11228 89 89 fHeader.fTriggerId = fHeader.fEventCounter; 90 90 fHeader.fTimeStamp = uint32_t((Time(Time::utc).UnixTime()-fStartTime)*10000); 91 fHeader.fFreqRefClock = 997+rand()/(RAND_MAX/7); 91 92 92 93 for (int i=0; i<FAD::kNumTemp; i++) -
trunk/FACT++/src/logtime.cc
r10348 r11228 6 6 #include <iostream> 7 7 8 #include "DimDescriptionService.h" 9 8 10 int main(int, const char **) 9 11 { 10 // We could use putenv to make the Configure class change the value...12 // We could use putenv to make the Configure class change the value... 11 13 setenv("DIM_DNS_NODE", "localhost", 0); 12 14 … … 14 16 DimServer::start("TIME"); 15 17 18 usleep(2000000); 19 20 DimServer::stop(); 21 22 return 0; 23 16 24 // Some info on the console 17 25 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; 18 46 19 47 // Setup a DimService called TIME/MESSAGE … … 23 51 // Send current time 24 52 msg.Message(Time().GetAsStr()); 53 // servx.Update(); 54 /* 55 servs.updateService(); 56 servi.updateService(); 57 servf.updateService(); 58 servc.updateService(); 59 */ 60 // wait approximately one second 61 usleep(100000); 25 62 26 // wait approximately one second 27 usleep(1000000);63 // if (t0.UnixTime()-Time().UnixTime()<-5) 64 // break; 28 65 } 66 } 67 68 DimDescribedService servxx("TIME/XXX", const_cast<char*>(""), "|MyTime[T]:This is my time"); 69 usleep(10000000); 29 70 30 71 return 0; -
trunk/FACT++/src/tools.cc
r10429 r11228 12 12 #include <stdarg.h> 13 13 14 #include <boost/filesystem.hpp> 15 14 16 using namespace std; 15 17 /* 16 18 string Tools::Format(const char *fmt, va_list &ap) 17 19 { … … 49 51 return str; 50 52 } 53 */ 51 54 52 55 // -------------------------------------------------------------------------- … … 54 57 //! This is a static helper to remove leading and trailing whitespaces. 55 58 //! 56 //! @param buf59 //! @param str 57 60 //! a pointer to the char array from which the whitespaces should be 58 61 //! removed … … 73 76 return str.substr(start, end-start+1); 74 77 } 78 79 // -------------------------------------------------------------------------- 80 // 81 //! Splits a string of the form [SERVER/]COMMAND[ arguments] 82 //! into SERVER, COMMAND and arguments. 83 //! 84 //! @param str 85 //! string to be splitted 86 //! 87 //! @returns 88 //! a vector<string> with three components. Depending on what is existing 89 //! 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 // SERVER 104 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 // COMMAND 114 v[1] = str.substr(0, p1); 115 116 // Has arguments 117 if (p1!=string::npos) 118 v[2] = str.substr(p1+1); 119 120 return v; 121 } 122 */ -
trunk/FACT++/src/tools.h
r10429 r11228 1 1 #include <string> 2 #include <vector> 2 3 3 4 namespace Tools 4 5 { 5 std::string Format(const char *fmt, va_list &ap);6 std::string Form(const char *fmt, ...);6 // std::string Format(const char *fmt, va_list &ap); 7 // std::string Form(const char *fmt, ...); 7 8 std::string Trim(const std::string &str); 8 9 }
Note:
See TracChangeset
for help on using the changeset viewer.