On Mon, Apr 12, 2010 at 1:34 AM, [email protected] <
[email protected]> wrote:

> Ben wrote:
>
>> Feature suggestion that will help with weaker signals in auto: Protect
>> against APT-end until a certain number of lines have been received (probably
>> should be user-settable... default to maybe 1000 or so.) Otherwise, in weak
>> signal conditions, the receive often quits very early, interpreting noise as
>> "stop." It would be nice to even disable APT-end, as once reception is
>> begun, even horribly weak signals can be somewhat copied, but that APT-end
>> will probably kill the fax under those conditions.
>>
>

>  What about a small tick to disable Apt-End detection, displayed only when
> in auto mode ?


Yes, I think this would be just fine.

On the matter of saving and loading fax preferences until you determine how
the program otherwise works, I have a suggestion you might wish to employ as
a stop-gap:

Temporarily use fopen(), fwrite(), fread() and fclose(). These calls exist
in the C library for windows, linux, and the mac (and probably almost
everything else on the planet... they were in the Amiga libraries in the
late 1980s, for instance.) So they should be extremely portable.

If you look at these C library functions, you will see they are trivial to
use, and allow storing and retrieving simple settings files with almost no
effort. For example, here's a trivial and easily extensible system-agnostic
prefs off the top of my head, uncompiled and untested, but should be close
or correct:

/* ----------- CUT -------- */

#include <stdio.h>

char keepwindowopen = 0;
int16 numoflines = 10000; /* 2-byte integer... declaration may vary */

/* returns int code with error bits:
1 - file failed to open for write
2 - failed to write keepwindow open byte
4 - failed to write numoflines int
*/
int writeprefs()
{
FILE *fp;
int err;

err = 0;
if (fp = fopen("prefs.txt","w") != NULL)
{
if (fwrite(&keepwindowopen,1,1,fp) != 1) { err += 2; }
if (fwrite(&numoflines,2,1,fp) != 1) { err += 4; }
fclose(fp);
}
else { err += 1; }
return(err); /* 0 = good, other = error */
}

/* returns int code with error bits:
1 - file failed to open for read
2 - failed to read keepwindow open byte
4 - failed to read numoflines int
*/
int readprefs()
{
FILE *fp;
int err;

err=0;
if (fp=fopen("prefs.txt","r") != NULL) /* in current directory */
{
if (fread(&keepwindowopen,1,1,fp) != 1) { err += 2; }
if (fread(&numoflines,2,1,fp) != 1) { err += 4; }
fclose(fp);
}
else { err += 1; }
return(err); /* 0=good, other = error */
}

/* ----------- CUT -------- */
/* use: */
/* at end of program: */

int err;
if ((err = writeprefs()) != 0)
{
/* failed to save prefs, see err */
}

/* ----------- CUT -------- */
/* near beginning of program: */

extern int16 numoflines;
extern char keepwindowopen;

if ((err = readprefs()) !=0)
{
/* failed to read prefs, can continue, should notify user though, see err */
}
/* sanity checks */

if ((keepwindowopen != 0) && (keepwindowopen != 1))
{
/* then we can't use it */
keepwindowopen = 0; /* sane, conservative default */
}

if ((numoflines < 0) || (numoflines > 10000))
{
/* then we can't use it */
numoflines = 2000;
}

/* here, values are set and sane */

/* ----------- CUT -------- */


Thanks for your ideas and remarks.
>

You are most welcome, and in return, I wish to express my gratitude for your
fine work.

I wish I could get the software to compile and link here, for then I feel I
could be of additional assistance. Unfortunately, the problem, whatever it
is, remains obscure to me.

--Ben
AA7AS




>
> Cheers
>
> Remi
>
>
> _______________________________________________
> fldigi-alpha mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/fldigi-alpha
>
_______________________________________________
fldigi-alpha mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/fldigi-alpha

Reply via email to