diagnostics.cpp
Go to the documentation of this file.
1 // Copyright (c) 2020-2021 Pilz GmbH & Co. KG
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU Lesser General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public License
14 // along with this program. If not, see <https://www.gnu.org/licenses/>.
15 
16 #include <ostream>
17 
18 #include <fmt/format.h>
19 #include <fmt/ostream.h>
20 
22 
24 {
25 namespace data_conversion_layer
26 {
27 namespace monitoring_frame
28 {
29 namespace diagnostic
30 {
31 std::ostream& operator<<(std::ostream& os, const Message& msg)
32 {
33  os << fmt::format("Device: {} - {}",
36 
37  if (isAmbiguous(msg.diagnosticCode()))
38  {
39  os << fmt::format(" (Byte:{} Bit:{})", msg.errorLocation().byte(), msg.errorLocation().bit());
40  }
41 
42  return os;
43 }
44 
45 } // namespace diagnostic
46 } // namespace monitoring_frame
47 } // namespace data_conversion_layer
48 } // namespace psen_scan_v2_standalone
Defines an Diagnostic message by defining the ErrorLocation and a scanner ID.
Definition: diagnostics.h:181
static const std::map< ErrorType, ErrorMessage > ERROR_CODE_TO_STRING
Definition: diagnostics.h:89
std::ostream & operator<<(std::ostream &os, const diagnostic::Message &msg)
Definition: diagnostics.cpp:31
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
Definition: udp_client.h:41
static const std::map< ScannerId, std::string > SCANNER_ID_TO_STRING
Definition: scanner_ids.h:40


psen_scan_v2
Author(s): Pilz GmbH + Co. KG
autogenerated on Sat Nov 5 2022 02:13:36