2 次代码提交

作者 SHA1 备注 提交日期
  Matthias Janke b4aff612b7 radangeldump: changed output formsat ftpm tsv to csv 5 年前
  Matthias Janke efd8184bf0 timed start measurment time. to syncronize the steady-time with the wall-time the wall-clock call has been surrounded by calls to steady-clock and the half of the difference added as uncertainty parameter, to the config file. 5 年前
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 3
    0
      radangeld/main.cpp
  2. 4
    4
      radangeldump/main.cpp

+ 3
- 0
radangeld/main.cpp 查看文件

79
 	std::chrono::time_point<std::chrono::system_clock> starttime;
79
 	std::chrono::time_point<std::chrono::system_clock> starttime;
80
 	std::chrono::time_point<std::chrono::system_clock> endtime;
80
 	std::chrono::time_point<std::chrono::system_clock> endtime;
81
 
81
 
82
+    std::chrono::time_point<std::chrono::steady_clock> starterrortime;
82
 	std::chrono::time_point<std::chrono::steady_clock> startmeastime;
83
 	std::chrono::time_point<std::chrono::steady_clock> startmeastime;
83
 };
84
 };
84
 
85
 
106
 	libconfig::Setting &measurement = root.add ("Measurement", libconfig::Setting::TypeGroup);
107
 	libconfig::Setting &measurement = root.add ("Measurement", libconfig::Setting::TypeGroup);
107
 
108
 
108
 	measurement.add ("StartTime", libconfig::Setting::TypeString) = date::format ("%F %T ", date::make_zoned (date::current_zone(), mp.starttime) ) + date::current_zone()->name();
109
 	measurement.add ("StartTime", libconfig::Setting::TypeString) = date::format ("%F %T ", date::make_zoned (date::current_zone(), mp.starttime) ) + date::current_zone()->name();
110
+	measurement.add ("StartTimeError_ns", libconfig::Setting::TypeInt64) = std::chrono::duration_cast<std::chrono::nanoseconds>(mp.startmeastime-mp.starterrortime).count()/2;
109
 	measurement.add ("EndTime", libconfig::Setting::TypeString) = date::format ("%F %T ", date::make_zoned (date::current_zone(), mp.endtime) ) + date::current_zone()->name();
111
 	measurement.add ("EndTime", libconfig::Setting::TypeString) = date::format ("%F %T ", date::make_zoned (date::current_zone(), mp.endtime) ) + date::current_zone()->name();
110
 	measurement.add ("RunAsDaemon", libconfig::Setting::TypeBoolean) = mp.demonize;
112
 	measurement.add ("RunAsDaemon", libconfig::Setting::TypeBoolean) = mp.demonize;
111
 	measurement.add ("MaxIntegrationTime_s", libconfig::Setting::TypeInt) = static_cast<int> (mp.maxduration.count() );
113
 	measurement.add ("MaxIntegrationTime_s", libconfig::Setting::TypeInt) = static_cast<int> (mp.maxduration.count() );
185
 	if (mp.demonize)
187
 	if (mp.demonize)
186
 		sd_notifyf(0, "READY=1\nSTATUS=Processing events…\nMAINPID=%lu", (unsigned long) getpid());
188
 		sd_notifyf(0, "READY=1\nSTATUS=Processing events…\nMAINPID=%lu", (unsigned long) getpid());
187
                  
189
                  
190
+    mp.starterrortime = std::chrono::steady_clock::now();
188
 	mp.starttime = std::chrono::system_clock::now();
191
 	mp.starttime = std::chrono::system_clock::now();
189
 	mp.startmeastime = std::chrono::steady_clock::now();
192
 	mp.startmeastime = std::chrono::steady_clock::now();
190
 
193
 

+ 4
- 4
radangeldump/main.cpp 查看文件

76
 	zmqpp::message messages;
76
 	zmqpp::message messages;
77
 
77
 
78
     if(events)
78
     if(events)
79
-        std::cout << "Energy [Ch]\trelative  timestamp[µs]\n";
79
+        std::cout << "\"Energy [Ch]\",\"relative  timestamp[µs]\"\n";
80
     else if (cpm)
80
     else if (cpm)
81
-        std::cout << "relative  timestamp[µs]\tCoutrate [1/min]\n";
81
+        std::cout << "\"relative  timestamp[µs]\",\"Coutrate [1/min]\"\n";
82
 
82
 
83
     do
83
     do
84
     {
84
     {
88
         {
88
         {
89
             messages >> event
89
             messages >> event
90
                      >> timestamp;
90
                      >> timestamp;
91
-            std::cout << event << "\t"
91
+            std::cout << event << ","
92
                       << timestamp << "\n";
92
                       << timestamp << "\n";
93
         }
93
         }
94
         else if(cpm)
94
         else if(cpm)
95
         {
95
         {
96
             messages >> timestamp
96
             messages >> timestamp
97
                      >> countrate;
97
                      >> countrate;
98
-            std::cout << timestamp << "\t"
98
+            std::cout << timestamp << ","
99
                       << countrate << "\n";
99
                       << countrate << "\n";
100
         }
100
         }
101
         else
101
         else

正在加载...
取消
保存