YASIM: minor corrections and safeguards.
This commit is contained in:
parent
ea8bfba98a
commit
3ac90ee866
3 changed files with 11 additions and 5 deletions
|
@ -211,7 +211,7 @@ bool Atmosphere::test() {
|
||||||
fprintf(stderr, "Columns = %d\n", numColumns);
|
fprintf(stderr, "Columns = %d\n", numColumns);
|
||||||
fprintf(stderr, "Rows = %d\n", rows);
|
fprintf(stderr, "Rows = %d\n", rows);
|
||||||
|
|
||||||
for (int alt = 0; alt < maxTableIndex(); alt++) {
|
for (int alt = 0; alt <= maxTableIndex(); alt++) {
|
||||||
float density = calcStdDensity(data[alt][PRESSURE], data[alt][TEMPERATURE]);
|
float density = calcStdDensity(data[alt][PRESSURE], data[alt][TEMPERATURE]);
|
||||||
float delta = data[alt][DENSITY] - density;
|
float delta = data[alt][DENSITY] - density;
|
||||||
fprintf(stderr, "%d : %f \n", alt, delta);
|
fprintf(stderr, "%d : %f \n", alt, delta);
|
||||||
|
|
|
@ -132,11 +132,12 @@ void ControlMap::setInput(int input, float val)
|
||||||
int ControlMap::getOutputHandle(void* obj, int type)
|
int ControlMap::getOutputHandle(void* obj, int type)
|
||||||
{
|
{
|
||||||
for(int i=0; i<_outputs.size(); i++) {
|
for(int i=0; i<_outputs.size(); i++) {
|
||||||
OutRec* o = (OutRec*)_outputs.get(i);
|
OutRec* o = (OutRec*)_outputs.get(i);
|
||||||
if(o->object == obj && o->type == type)
|
if(o->object == obj && o->type == type)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return 0;
|
fprintf(stderr, "ControlMap::getOutputHandle cannot find *%d, type %d \n", obj, type);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControlMap::setTransitionTime(int handle, float time)
|
void ControlMap::setTransitionTime(int handle, float time)
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef _VECTOR_HPP
|
#ifndef _VECTOR_HPP
|
||||||
#define _VECTOR_HPP
|
#define _VECTOR_HPP
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <cassert>
|
||||||
//
|
//
|
||||||
// Excruciatingly simple vector-of-pointers class. Easy & useful.
|
// Excruciatingly simple vector-of-pointers class. Easy & useful.
|
||||||
// No support for addition of elements anywhere but at the end of the
|
// No support for addition of elements anywhere but at the end of the
|
||||||
|
@ -46,11 +48,14 @@ inline int Vector::add(void* p)
|
||||||
|
|
||||||
inline void* Vector::get(int i) const
|
inline void* Vector::get(int i) const
|
||||||
{
|
{
|
||||||
|
assert(i >= 0 and i < _sz);
|
||||||
return _array[i];
|
return _array[i];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Vector::set(int i, void* p)
|
inline void Vector::set(int i, void* p)
|
||||||
{
|
{
|
||||||
|
assert(i >= 0 and i < _sz);
|
||||||
_array[i] = p;
|
_array[i] = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue