diff options
Diffstat (limited to 'spectro/munki_imp.h')
-rw-r--r-- | spectro/munki_imp.h | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/spectro/munki_imp.h b/spectro/munki_imp.h index a9af3a9..6af366e 100644 --- a/spectro/munki_imp.h +++ b/spectro/munki_imp.h @@ -89,6 +89,7 @@ struct _munki_state { double targoscale; /* Optimal reading scale factor <= 1.0 */ double targmaxitime;/* maximum integration time to aim for (ie. 2.0 sec) */ double targoscale2; /* Proportion of targoscale allowed to meed targmaxitime */ + int auto_gain; /* Whether high gain mode should be used */ int gainmode; /* Gain mode, 0 = normal, 1 = high */ double inttime; /* Integration time */ double invsampt; /* Invalid sample time */ @@ -104,8 +105,6 @@ struct _munki_state { double maxscantime; /* Maximum scan time sets buffer size allocated */ - double min_wl; /* Minimum wavelegth to report for this mode */ - /* calibration information for this mode */ int dark_valid; /* dark calibration factor valid */ time_t ddate; /* Date/time of last dark calibration */ @@ -145,6 +144,8 @@ struct _munki_state { double dark_int_time3; /* Integration time used for dark data 3 */ double *dark_data3; /* [-1 nraw] of dark level to subtract for dark_int_time3. */ + char padding[1]; /* to change structure size to invalidate cal file */ + }; typedef struct _munki_state munki_state; @@ -158,7 +159,7 @@ struct _munkiimp { athread *th; /* Switch monitoring thread (NULL if not used) */ volatile int switch_count; /* Incremented in thread */ volatile int hide_switch; /* Set to supress switch event during read */ - usb_cancelt cancelt; /* Token to allow cancelling an outstanding I/O */ + usb_cancelt sw_cancel; /* Token to allow cancelling switch I/O */ volatile int th_term; /* Thread terminate on error rather than retry */ volatile int th_termed; /* Thread has terminated */ inst_opt_type trig; /* Reading trigger mode */ @@ -284,6 +285,12 @@ struct _munkiimp { int trig_se; /* Delayed trigger icoms error */ munki_code trig_rv; /* Delayed trigger result */ + athread *spos_th; /* Position change filter thread */ + volatile int spos_th_term; /* nz to terminate thread */ + volatile int spos_th_termed; /* nz when terminated */ + volatile int spos_change; /* counter that increments on an spos event change */ + unsigned int spos_msec; /* Time when spos last changes */ + }; typedef struct _munkiimp munkiimp; /* Add an implementation structure */ @@ -342,6 +349,7 @@ void del_munkiimp(munki *p); #define MUNKI_RD_NOFLASHES 0x3E /* No flashes recognized */ #define MUNKI_RD_NOAMBB4FLASHES 0x3F /* No ambient before flashes found */ #define MUNKI_RD_NOREFR_FOUND 0x40 /* Unable to measure refresh rate */ +#define MUNKI_RD_NOTRANS_FOUND 0x41 /* Unable to measure delay transition */ #define MUNKI_SPOS_PROJ 0x48 /* Sensor needs to be in projector position */ #define MUNKI_SPOS_SURF 0x49 /* Sensor needs to be in surface position */ @@ -392,8 +400,9 @@ char *munki_imp_get_serial_no(munki *p); /* Set the measurement mode. It may need calibrating */ munki_code munki_imp_set_mode( munki *p, - mk_mode mmode, /* munki mode to use */ - int spec_en); /* nz to enable reporting spectral */ + mk_mode mmode, /* Operating mode */ + inst_mode mode /* Full mode mask for options */ +); /* Implement get_n_a_cals */ munki_code munki_imp_get_n_a_cals(munki *p, inst_cal_type *pn_cals, inst_cal_type *pa_cals); @@ -421,6 +430,12 @@ munki_code munki_imp_meas_refrate( double *ref_rate ); +/* Measure the display update delay */ +munki_code munki_imp_meas_delay( + munki *p, + int *msecdelay +); + /* return nz if high res is supported */ int munki_imp_highres(munki *p); @@ -549,6 +564,18 @@ munki_code munki_whitemeasure_buf( unsigned char *buf /* Raw buffer */ ); +/* Take a measurement reading using the current mode (combined parts 1 & 2a) */ +/* Converts to completely processed output readings, without averaging or extracting */ +/* sample patches, for emissive measurement mode. */ +/* This is used for delay & refresh rate measurement. */ +munki_code munki_read_patches_all( + munki *p, + double **specrd, /* Return array [numpatches][nwav] of spectral reading values */ + int numpatches, /* Number of sample to measure */ + double *inttime, /* Integration time to use/used */ + int gainmode /* Gain mode to use, 0 = normal, 1 = high */ +); + /* Take a measurement reading using the current mode, part 1 */ /* Converts to completely processed output readings. */ munki_code munki_read_patches_1( @@ -795,8 +822,14 @@ inst_opt_type munki_get_trig(munki *p); /* Set the trigger return */ void munki_set_trigret(munki *p, int val); +#ifdef USE_THREAD /* Switch thread handler */ -int munki_switch_thread(void *pp); +static int munki_switch_thread(void *pp); +#endif + +#ifdef FILTER_SPOS_EVENTS +static int munki_spos_thread(void *pp); +#endif /* ============================================================ */ /* Low level commands */ |