Commit a17015d2 authored by Claes Sjöfors's avatar Claes Sjöfors

wb_print_wbl temporarily reverted due to problems with the classcache

parent 85c8328f
This diff is collapsed.
/* /*
* ProviewR Open Source Process Control. * Proview Open Source Process Control.
* Copyright (C) 2005-2019 SSAB EMEA AB. * Copyright (C) 2005-2017 SSAB EMEA AB.
* *
* This file is part of ProviewR. * This file is part of Proview.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of * published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version. * the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful * This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with ProviewR. If not, see <http://www.gnu.org/licenses/> * along with Proview. If not, see <http://www.gnu.org/licenses/>
* *
* Linking ProviewR statically or dynamically with other modules is * Linking Proview statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and * making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole * conditions of the GNU General Public License cover the whole
* combination. * combination.
* *
* In addition, as a special exception, the copyright holders of * In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the * Proview give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the * Proview Configurator, combine Proview with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license * Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting * terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every * combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of * copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the * the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU * combined work), being distributed under the terms of the GNU
* General Public License plus this exception. * General Public License plus this exception.
*/ **/
/** /**
* @file wb_print_wbl.h * @file wb_print_wbl.h
...@@ -44,10 +44,11 @@ ...@@ -44,10 +44,11 @@
#ifndef wb_print_wbl_h #ifndef wb_print_wbl_h
#define wb_print_wbl_h #define wb_print_wbl_h
#include <ostream> #include <iostream>
#include "pwr_class.h"
#include "wb_ldh.h" using namespace std;
#include "co_tree.h"
class wb_adef; class wb_adef;
class wb_attribute; class wb_attribute;
...@@ -55,68 +56,79 @@ class wb_cdef; ...@@ -55,68 +56,79 @@ class wb_cdef;
class wb_object; class wb_object;
class wb_volume; class wb_volume;
class wb_print_wbl {
class wb_print_wbl
{
protected: protected:
int m_errCnt; int m_errCnt;
int m_lineCnt;
bool m_idxFlag; bool m_idxFlag;
bool m_noFoCodeFlag; bool m_noFoCodeFlag;
bool m_timeFlag; bool m_timeFlag;
int m_level; int m_level;
int m_levelInd; int m_levelInd;
char m_indBuf[256]; char m_indBuf[256];
bool m_keepName; bool m_keepName;
bool m_isTemplateObject; bool m_isTemplateObject;
std::ostream& m_os; ostream& m_os;
tree_sTable* m_body_cache;
std::ostream& indent(int levelIncr = 0); ostream& indent(int levelIncr = 0);
void printBody( void printAttribute(wb_volume& v,
wb_volume& vol, pwr_tOid oid, pwr_tOid toid, pwr_tCid cid, pwr_eBix bix); wb_attribute& attr,
bool printValue(wb_volume& v, pwr_eType type, unsigned int flags, void* val, wb_attribute& tattr, ///< template attribute
int varSize, char** svalp); wb_adef& adef,
void printBuffer(wb_volume& vol, ldh_sParDef* par_bd, char* body); int force);
void printClass(wb_volume& vol, ldh_sParDef* par_bd, char* body, char* tbody,
char* par_path); void printBody(wb_volume& v,
void printText( wb_object& o,
wb_volume& v, const char* aname, const char* text, int varSize); wb_object& templ,
pwr_tStatus getBody(wb_volume& vol, pwr_tCid cid, const char* bname, wb_cdef& cdef,
int tsize, ldh_sParDef** bdef, int* rows, char** tbody); pwr_eBix bix);
void bodyCacheFree();
int attrCmp(char* a1, char* a2, int size, pwr_eType type); void printBuffer(wb_volume& v,
bool isFoCodeObject(wb_volume& v, wb_object& o); wb_attribute& attr,
wb_attribute& tattr, ///< template attribute
wb_adef& adef);
void printClass(wb_volume& v,
wb_attribute& attr,
wb_attribute& tattr, ///< template attribute
wb_adef& adef);
void printParameter(wb_volume& v,
wb_attribute& attr,
wb_attribute& tattr, ///< template attribute
wb_adef& adef);
void printText(wb_volume& v,
wb_adef& adef,
const char* text,
int varSize);
bool printValue(wb_volume& v,
wb_adef& adef,
void *val,
int varSize,
char **svalp);
bool isFoCodeObject( wb_volume& v,
wb_object& o);
public: public:
wb_print_wbl(std::ostream& os, int levelIndentation = 2); wb_print_wbl(ostream& os, int levelIndentation = 2);
~wb_print_wbl(); ~wb_print_wbl();
int getErrCnt() const int getErrCnt() const { return m_errCnt;}
{ void resetErrCnt() {m_errCnt = 0; }
return m_errCnt; void keepName() { m_keepName = true;}
} void noIndex() { m_idxFlag = false; m_timeFlag = false;}
void resetErrCnt() void noFoCode() { m_noFoCodeFlag = true;}
{
m_errCnt = 0; void printHierarchy(wb_volume& v, wb_object& o); //< Prints a hierarchy
} void printObject(wb_volume& v, wb_object& o, bool recursive = true); //< Prints an object
void keepName() void printVolume(wb_volume& v, bool recursive = true); //< Prints the volume
{
m_keepName = true;
}
void noIndex()
{
m_idxFlag = false;
m_timeFlag = false;
}
void noFoCode()
{
m_noFoCodeFlag = true;
}
void printHierarchy(wb_volume& v, wb_object& o); ///< Prints a hierarchy
void printObject(
wb_volume& v, wb_object& o, bool recursive = true); ///< Prints an object
void printVolume(wb_volume& v, bool recursive = true); ///< Prints the volume
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment