2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2014-2014 - Scilab Enterprises - Clement DAVID
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
15 #include "scilabWrite.hxx"
17 #include "LoggerView.hxx"
18 #include "Controller.hxx"
20 namespace org_scilab_modules_scicos
23 LoggerView::LoggerView()
27 LoggerView::~LoggerView()
32 // awk ' $2 == "//!<" {sub(",","", $1); print "case " $1 ":\n os << \"" $1 "\";\n break;" }' ~/work/branches/YaSp/scilab/modules/scicos/includes/utilities.hxx
34 std::ostream& operator<<(std::ostream& os, update_status_t u)
51 std::ostream& operator<<(std::ostream& os, kind_t k)
75 std::ostream& operator<<(std::ostream& os, object_properties_t p)
80 os << "PARENT_DIAGRAM";
91 case INTERFACE_FUNCTION:
92 os << "INTERFACE_FUNCTION";
94 case SIM_FUNCTION_NAME:
95 os << "SIM_FUNCTION_NAME";
97 case SIM_FUNCTION_API:
98 os << "SIM_FUNCTION_API";
101 os << "SIM_SCHEDULE";
104 os << "SIM_BLOCKTYPE";
122 os << "EVENT_INPUTS";
125 os << "EVENT_OUTPUTS";
158 os << "PARENT_BLOCK";
164 os << "PORT_REFERENCE";
172 case DESTINATION_PORT:
173 os << "DESTINATION_PORT";
179 os << "CONTROL_POINTS";
200 os << "DATATYPE_ROWS";
203 os << "DATATYPE_COLS";
206 os << "DATATYPE_TYPE";
212 os << "SOURCE_BLOCK";
223 case CONNECTED_SIGNALS:
224 os << "CONNECTED_SIGNALS";
242 static const bool USE_SCILAB_WRITE = true;
244 void LoggerView::objectCreated(const ScicosID& uid, kind_t k)
246 std::stringstream ss;
248 ss << __FUNCTION__ << "( " << uid << " , " << k << " )" << std::endl;
250 if (USE_SCILAB_WRITE)
252 scilabForcedWrite(ss.str().data());
256 std::cerr << ss.str();
260 void LoggerView::objectDeleted(const ScicosID& uid)
262 std::stringstream ss;
264 ss << __FUNCTION__ << "( " << uid << " )" << std::endl;
266 if (USE_SCILAB_WRITE)
268 scilabForcedWrite(ss.str().data());
272 std::cerr << ss.str();
276 void LoggerView::objectUpdated(const ScicosID& uid, kind_t k)
278 std::stringstream ss;
280 ss << __FUNCTION__ << "( " << uid << " , " << k << " )" << std::endl;
282 if (USE_SCILAB_WRITE)
284 scilabForcedWrite(ss.str().data());
288 std::cerr << ss.str();
292 void LoggerView::propertyUpdated(const ScicosID& uid, kind_t k, object_properties_t p)
294 // do not log anything on success; the message has already been logged
297 void LoggerView::propertyUpdated(const ScicosID& uid, kind_t k, object_properties_t p,
300 std::stringstream ss;
302 ss << __FUNCTION__ << "( " << uid << " , " << k << " , " << p << " ) : " << u << std::endl;
304 if (USE_SCILAB_WRITE)
306 scilabForcedWrite(ss.str().data());
310 std::cerr << ss.str();
314 } /* namespace org_scilab_modules_scicos */