fixed some little bugs

This commit is contained in:
Edward Emelianov 2023-04-02 18:47:54 +03:00
parent 290e95b76a
commit 87e8120122
5 changed files with 8 additions and 8 deletions

View File

@ -211,13 +211,14 @@ int saveFITS(IMG *img, char **outp){
}
int width = img->w, height = img->h;
void *data = (void*) img->data;
long naxes[2] = {width, height}, tmpl;
long naxes[2] = {width, height};
double tmpd = 0.0;
float tmpf = 0.0;
int tmpi = 0;
struct tm *tm_time;
char bufc[FLEN_CARD];
time_t savetime = time(NULL);
double dsavetime = dtime();
fitsfile *fp;
fitserror = 0;
TRYFITS(fits_create_file, &fp, fnam);
@ -277,10 +278,9 @@ int saveFITS(IMG *img, char **outp){
// DATE / Creation date (YYYY-MM-DDThh:mm:ss, UTC)
strftime(bufc, FLEN_VALUE, "%Y-%m-%dT%H:%M:%S", gmtime(&savetime));
WRITEKEY(fp, TSTRING, "DATE", bufc, "Creation date (YYYY-MM-DDThh:mm:ss, UTC)");
tmpl = (long) savetime;
tm_time = localtime(&savetime);
strftime(bufc, FLEN_VALUE, "File creation time (UNIX)", tm_time);
WRITEKEY(fp, TLONG, "UNIXTIME", &tmpl, bufc);
WRITEKEY(fp, TDOUBLE, "UNIXTIME", &dsavetime, bufc);
strftime(bufc, 80, "%Y/%m/%d", tm_time);
// DATE-OBS / DATE (YYYY/MM/DD) OF OBS.
WRITEKEY(fp, TSTRING, "DATE-OBS", bufc, "DATE OF OBS. (YYYY/MM/DD, local)");

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-20 11:45+0300\n"
"POT-Creation-Date: 2023-04-02 12:50+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@
msgid ""
msgstr "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-09 11:35+0300\n"
"POT-Creation-Date: 2023-04-02 12:50+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -516,7 +516,7 @@ static hresult formathandler(int fd, const char *key, const char *val){
char buf[64];
frameformat fmt;
if(val){
if(strcmp(key, CMD_FRAMEMAX)) return RESULT_BADKEY; // can't set maxformat
if(0 == strcmp(key, CMD_FRAMEMAX)) return RESULT_BADKEY; // can't set maxformat
if(4 != sscanf(val, "%d,%d,%d,%d", &fmt.xoff, &fmt.yoff, &fmt.w, &fmt.h)) return RESULT_BADVAL;
fmt.w -= fmt.xoff; fmt.h -= fmt.yoff;
int r = camera->setgeometry(&fmt);

View File

@ -40,8 +40,8 @@ char *makeabspath(const char *path, int shouldbe);
// get last exposed image
#define CMD_GETIMAGE "getimage"
// get image size in pixels
#define CMD_IMWIDTH "imheight"
#define CMD_IMHEIGHT "imwidth"
#define CMD_IMWIDTH "imwidth"
#define CMD_IMHEIGHT "imheight"
// CCD/CMOS
#define CMD_CAMLIST "camlist"