Reduce output verbosity.
This commit is contained in:
parent
f99f670aed
commit
b2f604ad00
2 changed files with 54 additions and 51 deletions
|
@ -65,15 +65,16 @@ FGTextureManager::createTexture (const string &relativePath)
|
||||||
{
|
{
|
||||||
ssgTexture * texture = _textureMap[relativePath];
|
ssgTexture * texture = _textureMap[relativePath];
|
||||||
if (texture == 0) {
|
if (texture == 0) {
|
||||||
cerr << "Texture " << relativePath << " does not yet exist" << endl;
|
SG_LOG( SG_COCKPIT, SG_DEBUG,
|
||||||
|
"Texture " << relativePath << " does not yet exist" );
|
||||||
SGPath tpath(globals->get_fg_root());
|
SGPath tpath(globals->get_fg_root());
|
||||||
tpath.append(relativePath);
|
tpath.append(relativePath);
|
||||||
texture = new ssgTexture((char *)tpath.c_str(), false, false);
|
texture = new ssgTexture((char *)tpath.c_str(), false, false);
|
||||||
_textureMap[relativePath] = texture;
|
_textureMap[relativePath] = texture;
|
||||||
if (_textureMap[relativePath] == 0)
|
if (_textureMap[relativePath] == 0)
|
||||||
cerr << "Texture *still* doesn't exist" << endl;
|
SG_LOG( SG_COCKPIT, SG_ALERT, "Texture *still* doesn't exist" );
|
||||||
cerr << "Created texture " << relativePath
|
SG_LOG( SG_COCKPIT, SG_DEBUG, "Created texture " << relativePath
|
||||||
<< " handle=" << texture->getHandle() << endl;
|
<< " handle=" << texture->getHandle() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
|
|
|
@ -223,7 +223,7 @@ readTexture (const SGPropertyNode * node)
|
||||||
node->getFloatValue("y1"),
|
node->getFloatValue("y1"),
|
||||||
node->getFloatValue("x2", 1.0),
|
node->getFloatValue("x2", 1.0),
|
||||||
node->getFloatValue("y2", 1.0));
|
node->getFloatValue("y2", 1.0));
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Read texture " << node->getName());
|
SG_LOG(SG_COCKPIT, SG_DEBUG, "Read texture " << node->getName());
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ readAction (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
int h = int(node->getIntValue("h") * h_scale);
|
int h = int(node->getIntValue("h") * h_scale);
|
||||||
|
|
||||||
if (type == "") {
|
if (type == "") {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT,
|
SG_LOG(SG_COCKPIT, SG_ALERT,
|
||||||
"No type supplied for action " << name << " assuming \"adjust\"");
|
"No type supplied for action " << name << " assuming \"adjust\"");
|
||||||
type = "adjust";
|
type = "adjust";
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ readAction (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
float max = node->getFloatValue("max", 0.0);
|
float max = node->getFloatValue("max", 0.0);
|
||||||
bool wrap = node->getBoolValue("wrap", false);
|
bool wrap = node->getBoolValue("wrap", false);
|
||||||
if (min == max)
|
if (min == max)
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Action " << node->getName()
|
SG_LOG(SG_COCKPIT, SG_ALERT, "Action " << node->getName()
|
||||||
<< " has same min and max value");
|
<< " has same min and max value");
|
||||||
action = new FGAdjustAction(button, x, y, w, h, value,
|
action = new FGAdjustAction(button, x, y, w, h, value,
|
||||||
increment, min, max, wrap);
|
increment, min, max, wrap);
|
||||||
|
@ -306,7 +306,7 @@ readAction (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
|
|
||||||
// Unrecognized type
|
// Unrecognized type
|
||||||
else {
|
else {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized action type " << type);
|
SG_LOG( SG_COCKPIT, SG_ALERT, "Unrecognized action type " << type );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,9 +350,9 @@ readTransformation (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
SGValue * value = 0;
|
SGValue * value = 0;
|
||||||
|
|
||||||
if (type == "") {
|
if (type == "") {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT,
|
SG_LOG( SG_COCKPIT, SG_ALERT,
|
||||||
"No type supplied for transformation " << name
|
"No type supplied for transformation " << name
|
||||||
<< " assuming \"rotation\"");
|
<< " assuming \"rotation\"" );
|
||||||
type = "rotation";
|
type = "rotation";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,18 +369,20 @@ readTransformation (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
// Check for an interpolation table
|
// Check for an interpolation table
|
||||||
const SGPropertyNode * trans_table = node->getNode("interpolation");
|
const SGPropertyNode * trans_table = node->getNode("interpolation");
|
||||||
if (trans_table != 0) {
|
if (trans_table != 0) {
|
||||||
cerr << "Found interpolation table with " << trans_table->nChildren() << "children" << endl;
|
SG_LOG( SG_COCKPIT, SG_INFO, "Found interpolation table with "
|
||||||
|
<< trans_table->nChildren() << "children" );
|
||||||
t->table = new SGInterpTable();
|
t->table = new SGInterpTable();
|
||||||
for(int i = 0; i < trans_table->nChildren(); i++) {
|
for(int i = 0; i < trans_table->nChildren(); i++) {
|
||||||
const SGPropertyNode * node = trans_table->getChild(i);
|
const SGPropertyNode * node = trans_table->getChild(i);
|
||||||
if (node->getName() == "entry") {
|
if (node->getName() == "entry") {
|
||||||
double ind = node->getDoubleValue("ind", 0.0);
|
double ind = node->getDoubleValue("ind", 0.0);
|
||||||
double dep = node->getDoubleValue("dep", 0.0);
|
double dep = node->getDoubleValue("dep", 0.0);
|
||||||
cerr << "Adding interpolation entry " << ind << "==>" << dep << endl;
|
SG_LOG( SG_COCKPIT, SG_INFO, "Adding interpolation entry "
|
||||||
|
<< ind << "==>" << dep );
|
||||||
t->table->addEntry(ind, dep);
|
t->table->addEntry(ind, dep);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
|
SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
|
||||||
<< " in interpolation");
|
<< " in interpolation" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -413,12 +415,12 @@ readTransformation (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized transformation type " << type);
|
SG_LOG( SG_COCKPIT, SG_ALERT, "Unrecognized transformation type " << type );
|
||||||
delete t;
|
delete t;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Read transformation " << name);
|
SG_LOG( SG_COCKPIT, SG_DEBUG, "Read transformation " << name );
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,8 +451,8 @@ readTextChunk (const SGPropertyNode * node)
|
||||||
|
|
||||||
// Default to literal text.
|
// Default to literal text.
|
||||||
if (type == "") {
|
if (type == "") {
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "No type provided for text chunk " << name
|
SG_LOG( SG_COCKPIT, SG_INFO, "No type provided for text chunk " << name
|
||||||
<< " assuming \"literal\"");
|
<< " assuming \"literal\"");
|
||||||
type = "literal";
|
type = "literal";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,8 +480,8 @@ readTextChunk (const SGPropertyNode * node)
|
||||||
|
|
||||||
// Unknown type.
|
// Unknown type.
|
||||||
else {
|
else {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized type " << type
|
SG_LOG( SG_COCKPIT, SG_ALERT, "Unrecognized type " << type
|
||||||
<< " for text chunk " << name);
|
<< " for text chunk " << name );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,9 +525,9 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
|
|
||||||
|
|
||||||
if (type == "") {
|
if (type == "") {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT,
|
SG_LOG( SG_COCKPIT, SG_ALERT,
|
||||||
"No type supplied for layer " << name
|
"No type supplied for layer " << name
|
||||||
<< " assuming \"texture\"");
|
<< " assuming \"texture\"" );
|
||||||
type = "texture";
|
type = "texture";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -564,8 +566,8 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
if (chunk != 0)
|
if (chunk != 0)
|
||||||
tlayer->addChunk(chunk);
|
tlayer->addChunk(chunk);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
|
SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
|
||||||
<< " in chunks");
|
<< " in chunks" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
layer = tlayer;
|
layer = tlayer;
|
||||||
|
@ -592,21 +594,21 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (layerclass == "") {
|
else if (layerclass == "") {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "No class provided for built-in layer "
|
SG_LOG( SG_COCKPIT, SG_ALERT, "No class provided for built-in layer "
|
||||||
<< name);
|
<< name );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Unknown built-in layer class "
|
SG_LOG( SG_COCKPIT, SG_ALERT, "Unknown built-in layer class "
|
||||||
<< layerclass);
|
<< layerclass);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// An unknown type.
|
// An unknown type.
|
||||||
else {
|
else {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized layer type " << type);
|
SG_LOG( SG_COCKPIT, SG_ALERT, "Unrecognized layer type " << type );
|
||||||
delete layer;
|
delete layer;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -624,13 +626,13 @@ readLayer (const SGPropertyNode * node, float w_scale, float h_scale)
|
||||||
if (t != 0)
|
if (t != 0)
|
||||||
layer->addTransformation(t);
|
layer->addTransformation(t);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
|
SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
|
||||||
<< " in transformations");
|
<< " in transformations" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Read layer " << name);
|
SG_LOG( SG_COCKPIT, SG_DEBUG, "Read layer " << name );
|
||||||
return layer;
|
return layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -658,8 +660,8 @@ readInstrument (const SGPropertyNode * node)
|
||||||
int h = node->getIntValue("h-base", -1);
|
int h = node->getIntValue("h-base", -1);
|
||||||
|
|
||||||
if (x == -1 || y == -1) {
|
if (x == -1 || y == -1) {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT,
|
SG_LOG( SG_COCKPIT, SG_ALERT,
|
||||||
"x and y positions must be specified and >0");
|
"x and y positions must be specified and > 0" );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -674,7 +676,7 @@ readInstrument (const SGPropertyNode * node)
|
||||||
h = real_h;
|
h = real_h;
|
||||||
}
|
}
|
||||||
|
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Reading instrument " << name);
|
SG_LOG( SG_COCKPIT, SG_DEBUG, "Reading instrument " << name );
|
||||||
|
|
||||||
FGLayeredInstrument * instrument =
|
FGLayeredInstrument * instrument =
|
||||||
new FGLayeredInstrument(x, y, w, h);
|
new FGLayeredInstrument(x, y, w, h);
|
||||||
|
@ -692,8 +694,8 @@ readInstrument (const SGPropertyNode * node)
|
||||||
if (action != 0)
|
if (action != 0)
|
||||||
instrument->addAction(action);
|
instrument->addAction(action);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
|
SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
|
||||||
<< " in actions");
|
<< " in actions" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -711,13 +713,13 @@ readInstrument (const SGPropertyNode * node)
|
||||||
if (layer != 0)
|
if (layer != 0)
|
||||||
instrument->addLayer(layer);
|
instrument->addLayer(layer);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
|
SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
|
||||||
<< " in layers");
|
<< " in layers" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name);
|
SG_LOG( SG_COCKPIT, SG_DEBUG, "Done reading instrument " << name );
|
||||||
return instrument;
|
return instrument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -728,8 +730,8 @@ readInstrument (const SGPropertyNode * node)
|
||||||
FGPanel *
|
FGPanel *
|
||||||
readPanel (const SGPropertyNode * root)
|
readPanel (const SGPropertyNode * root)
|
||||||
{
|
{
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Reading properties for panel " <<
|
SG_LOG( SG_COCKPIT, SG_INFO, "Reading properties for panel " <<
|
||||||
root->getStringValue("name", "[Unnamed Panel]"));
|
root->getStringValue("name", "[Unnamed Panel]") );
|
||||||
|
|
||||||
FGPanel * panel = new FGPanel(0, 0, 1024, 768);
|
FGPanel * panel = new FGPanel(0, 0, 1024, 768);
|
||||||
panel->setWidth(root->getIntValue("w", 1024));
|
panel->setWidth(root->getIntValue("w", 1024));
|
||||||
|
@ -757,13 +759,13 @@ readPanel (const SGPropertyNode * root)
|
||||||
if (bgTexture == "")
|
if (bgTexture == "")
|
||||||
bgTexture = "FOO";
|
bgTexture = "FOO";
|
||||||
panel->setBackground(FGTextureManager::createTexture(bgTexture.c_str()));
|
panel->setBackground(FGTextureManager::createTexture(bgTexture.c_str()));
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Set background texture to " << bgTexture);
|
SG_LOG( SG_COCKPIT, SG_INFO, "Set background texture to " << bgTexture );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create each instrument.
|
// Create each instrument.
|
||||||
//
|
//
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Reading panel instruments");
|
SG_LOG( SG_COCKPIT, SG_INFO, "Reading panel instruments" );
|
||||||
const SGPropertyNode * instrument_group = root->getChild("instruments");
|
const SGPropertyNode * instrument_group = root->getChild("instruments");
|
||||||
if (instrument_group != 0) {
|
if (instrument_group != 0) {
|
||||||
int nInstruments = instrument_group->nChildren();
|
int nInstruments = instrument_group->nChildren();
|
||||||
|
@ -774,12 +776,12 @@ readPanel (const SGPropertyNode * root)
|
||||||
if (instrument != 0)
|
if (instrument != 0)
|
||||||
panel->addInstrument(instrument);
|
panel->addInstrument(instrument);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
|
SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
|
||||||
<< " in instruments section");
|
<< " in instruments section" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SG_LOG(SG_INPUT, SG_INFO, "Done reading panel instruments");
|
SG_LOG( SG_COCKPIT, SG_INFO, "Done reading panel instruments" );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -805,7 +807,7 @@ fgReadPanel (istream &input)
|
||||||
SGPropertyNode root;
|
SGPropertyNode root;
|
||||||
|
|
||||||
if (!readProperties(input, &root)) {
|
if (!readProperties(input, &root)) {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Malformed property list for panel.");
|
SG_LOG( SG_COCKPIT, SG_ALERT, "Malformed property list for panel." );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return readPanel(&root);
|
return readPanel(&root);
|
||||||
|
@ -826,7 +828,7 @@ fgReadPanel (const string &relative_path)
|
||||||
SGPropertyNode root;
|
SGPropertyNode root;
|
||||||
|
|
||||||
if (!readProperties(path.str(), &root)) {
|
if (!readProperties(path.str(), &root)) {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Malformed property list for panel.");
|
SG_LOG( SG_COCKPIT, SG_ALERT, "Malformed property list for panel." );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return readPanel(&root);
|
return readPanel(&root);
|
||||||
|
|
Loading…
Add table
Reference in a new issue