node->getFloatValue("y1"),
node->getFloatValue("x2", 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;
}
int h = int(node->getIntValue("h") * h_scale);
if (type == "") {
- SG_LOG(SG_INPUT, SG_ALERT,
+ SG_LOG(SG_COCKPIT, SG_ALERT,
"No type supplied for action " << name << " assuming \"adjust\"");
type = "adjust";
}
float max = node->getFloatValue("max", 0.0);
bool wrap = node->getBoolValue("wrap", false);
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");
action = new FGAdjustAction(button, x, y, w, h, value,
increment, min, max, wrap);
// Unrecognized type
else {
- SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized action type " << type);
+ SG_LOG( SG_COCKPIT, SG_ALERT, "Unrecognized action type " << type );
return 0;
}
SGValue * value = 0;
if (type == "") {
- SG_LOG(SG_INPUT, SG_ALERT,
- "No type supplied for transformation " << name
- << " assuming \"rotation\"");
+ SG_LOG( SG_COCKPIT, SG_ALERT,
+ "No type supplied for transformation " << name
+ << " assuming \"rotation\"" );
type = "rotation";
}
// Check for an interpolation table
const SGPropertyNode * trans_table = node->getNode("interpolation");
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();
for(int i = 0; i < trans_table->nChildren(); i++) {
const SGPropertyNode * node = trans_table->getChild(i);
if (node->getName() == "entry") {
double ind = node->getDoubleValue("ind", 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);
} else {
- SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
- << " in interpolation");
+ SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
+ << " in interpolation" );
}
}
} else {
}
else {
- SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized transformation type " << type);
+ SG_LOG( SG_COCKPIT, SG_ALERT, "Unrecognized transformation type " << type );
delete t;
return 0;
}
- SG_LOG(SG_INPUT, SG_INFO, "Read transformation " << name);
+ SG_LOG( SG_COCKPIT, SG_DEBUG, "Read transformation " << name );
return t;
}
// Default to literal text.
if (type == "") {
- SG_LOG(SG_INPUT, SG_INFO, "No type provided for text chunk " << name
- << " assuming \"literal\"");
+ SG_LOG( SG_COCKPIT, SG_INFO, "No type provided for text chunk " << name
+ << " assuming \"literal\"");
type = "literal";
}
// Unknown type.
else {
- SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized type " << type
- << " for text chunk " << name);
+ SG_LOG( SG_COCKPIT, SG_ALERT, "Unrecognized type " << type
+ << " for text chunk " << name );
return 0;
}
if (type == "") {
- SG_LOG(SG_INPUT, SG_ALERT,
- "No type supplied for layer " << name
- << " assuming \"texture\"");
+ SG_LOG( SG_COCKPIT, SG_ALERT,
+ "No type supplied for layer " << name
+ << " assuming \"texture\"" );
type = "texture";
}
if (chunk != 0)
tlayer->addChunk(chunk);
} else {
- SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
- << " in chunks");
+ SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
+ << " in chunks" );
}
}
layer = tlayer;
}
else if (layerclass == "") {
- SG_LOG(SG_INPUT, SG_ALERT, "No class provided for built-in layer "
- << name);
+ SG_LOG( SG_COCKPIT, SG_ALERT, "No class provided for built-in layer "
+ << name );
return 0;
}
else {
- SG_LOG(SG_INPUT, SG_ALERT, "Unknown built-in layer class "
- << layerclass);
+ SG_LOG( SG_COCKPIT, SG_ALERT, "Unknown built-in layer class "
+ << layerclass);
return 0;
}
}
// An unknown type.
else {
- SG_LOG(SG_INPUT, SG_ALERT, "Unrecognized layer type " << type);
+ SG_LOG( SG_COCKPIT, SG_ALERT, "Unrecognized layer type " << type );
delete layer;
return 0;
}
if (t != 0)
layer->addTransformation(t);
} else {
- SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
- << " in transformations");
+ SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
+ << " in transformations" );
}
}
}
- SG_LOG(SG_INPUT, SG_INFO, "Read layer " << name);
+ SG_LOG( SG_COCKPIT, SG_DEBUG, "Read layer " << name );
return layer;
}
int h = node->getIntValue("h-base", -1);
if (x == -1 || y == -1) {
- SG_LOG(SG_INPUT, SG_ALERT,
- "x and y positions must be specified and >0");
+ SG_LOG( SG_COCKPIT, SG_ALERT,
+ "x and y positions must be specified and > 0" );
return 0;
}
h = real_h;
}
- SG_LOG(SG_INPUT, SG_INFO, "Reading instrument " << name);
+ SG_LOG( SG_COCKPIT, SG_DEBUG, "Reading instrument " << name );
FGLayeredInstrument * instrument =
new FGLayeredInstrument(x, y, w, h);
if (action != 0)
instrument->addAction(action);
} else {
- SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
- << " in actions");
+ SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
+ << " in actions" );
}
}
}
if (layer != 0)
instrument->addLayer(layer);
} else {
- SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
- << " in layers");
+ SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
+ << " in layers" );
}
}
}
- SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name);
+ SG_LOG( SG_COCKPIT, SG_DEBUG, "Done reading instrument " << name );
return instrument;
}
FGPanel *
readPanel (const SGPropertyNode * root)
{
- SG_LOG(SG_INPUT, SG_INFO, "Reading properties for panel " <<
- root->getStringValue("name", "[Unnamed Panel]"));
+ SG_LOG( SG_COCKPIT, SG_INFO, "Reading properties for panel " <<
+ root->getStringValue("name", "[Unnamed Panel]") );
FGPanel * panel = new FGPanel(0, 0, 1024, 768);
panel->setWidth(root->getIntValue("w", 1024));
if (bgTexture == "")
bgTexture = "FOO";
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.
//
- 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");
if (instrument_group != 0) {
int nInstruments = instrument_group->nChildren();
if (instrument != 0)
panel->addInstrument(instrument);
} else {
- SG_LOG(SG_INPUT, SG_INFO, "Skipping " << node->getName()
- << " in instruments section");
+ SG_LOG( SG_COCKPIT, SG_INFO, "Skipping " << node->getName()
+ << " in instruments section" );
}
}
}
- SG_LOG(SG_INPUT, SG_INFO, "Done reading panel instruments");
+ SG_LOG( SG_COCKPIT, SG_INFO, "Done reading panel instruments" );
//
SGPropertyNode 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 readPanel(&root);
SGPropertyNode 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 readPanel(&root);