| 11 |
|
*/ |
| 12 |
|
|
| 13 |
|
#include <stdio.h> |
| 14 |
+ |
#include <math.h> |
| 15 |
|
#include <ctype.h> |
| 16 |
|
#include "color.h" |
| 17 |
|
#include "paths.h" |
| 40 |
|
/* file types */ |
| 41 |
|
#define T_RAD ".rad" |
| 42 |
|
#define T_DST ".dat" |
| 43 |
< |
#define T_TLT "+.dat" |
| 43 |
> |
#define T_TLT "%.dat" |
| 44 |
|
/* shape types */ |
| 45 |
|
#define RECT 1 |
| 46 |
|
#define DISK 2 |
| 407 |
|
} |
| 408 |
|
if (lampcolor == NULL) { |
| 409 |
|
fprintf(stderr, "%s: warning - no lamp type\n", inpname); |
| 410 |
+ |
fputs("# Unknown lamp type (used default)\n", outfp); |
| 411 |
|
lampcolor = defcolor; |
| 412 |
< |
} |
| 412 |
> |
} else if (lamptype == NULL) |
| 413 |
> |
fprintf(outfp,"# CIE(x,y) = (%f,%f)\n# Depreciation = %.1f%%\n", |
| 414 |
> |
lampcolor[3], lampcolor[4], 100.*lampcolor[5]); |
| 415 |
|
if (feof(inpfp)) { |
| 416 |
|
fprintf(stderr, "%s: not in IES format\n", inpname); |
| 417 |
|
goto readerr; |
| 567 |
|
else if (pmtype == PM_B) |
| 568 |
|
fprintf(out, "5 "); |
| 569 |
|
else if (FEQ(bounds[1][0],90.) && FEQ(bounds[1][1],270.)) |
| 570 |
< |
fprintf(out, "8 "); |
| 570 |
> |
fprintf(out, "7 "); |
| 571 |
|
else |
| 572 |
< |
fprintf(out, "6 "); |
| 572 |
> |
fprintf(out, "5 "); |
| 573 |
|
fprintf(out, "%s %s source.cal ", |
| 574 |
|
srcshape.type==SPHERE ? "corr" : "flatcorr", |
| 575 |
|
libname(buf,name,T_DST)); |
| 588 |
|
fprintf(out, "src_phi2 "); |
| 589 |
|
else |
| 590 |
|
fprintf(out, "src_phi "); |
| 591 |
< |
fprintf(out, "src_theta -my "); |
| 591 |
> |
fprintf(out, "src_theta "); |
| 592 |
|
if (FEQ(bounds[1][0],90.) && FEQ(bounds[1][1],270.)) |
| 593 |
|
fprintf(out, "-rz -90 "); |
| 594 |
|
} else |