#include <stdio.h>
#include <time.h>
#include <math.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include "esd.h"
#include "esd_error.h"
#include "marcmd.h"
#include "mar_command.h"
#include "marglobals.h"
#include "twopower.h"
#include "config.h"
#include "marhw.h"
Go to the source code of this file.
Defines | |
#define | min0(a, b) if ( b < a ) a = b |
#define | max0(a, b) if ( b > a ) a = b |
#define | MAX_DOSE 2000 |
Functions | |
float | GetDiskSpace (char *) |
int | mar_io () |
void | swaplong (char *, int) |
Variables | |
char | start_time [32] |
char | motor_op = 0 |
char | skip_op = 0 |
char | keep_image = 1 |
int | mar_error = 0 |
int | target_steps = 0 |
int | ict1 = 0 |
int | ict2 = 0 |
int | adc1 = 0 |
int | adc2 = 0 |
time_t | exposure_time |
time_t | exposure_start = 0 |
int | erase_start |
int | fehler_index = 0 |
int | stat_scan_add = 0 |
int | stat_task_number |
int | stat_task_active |
int | stat_task_done |
int | stat_task_mode |
int | stat_task_error |
int | stat_pixels |
int | stat_blocks_sent |
int | stat_blocks_scanned |
int | stat_reference_status |
int | stat_plate_locked |
int | stat_lock_permit |
int | stat_sending_data |
int | stat_oscil_msg = (-1) |
char | stat_home = 1 |
char | stat_scan_active = 0 |
int | com_phi_steps |
int | op_dosen |
float | op_dosebeg |
float | op_doseend |
float | op_dosemin |
float | op_dosemax |
float | op_doseavg |
float | op_dosesig |
double | target_distance |
double | original_distance |
double | target_phi |
double | original_phi |
double | target_omega |
double | original_omega |
static float | expo_dosebeg = 99999 |
static float | expo_doseend = 0.0 |
static float | expo_doseavg = 0.0 |
static float | expo_dosesig = 0.0 |
static float | expo_dosemin = 999999.0 |
static float | expo_dosemax = 0.0 |
static int | expo_dosen = 0 |
static int | i |
static int | j |
static char | motor_moving [6] = {0,0,0,0,0,0} |
static char | change_mode = 0 |
static char | scan_started = 0 |
static char | stop_image = 0 |
static int | last_mar_mode = 0 |
static int | dist_retry = 0 |
static int | intensity_counter = 0 |
static int | open_shutter_counter = 0 |
static int | close_shutter_counter = 0 |
static int | scan_error = 0 |
static int | p_task_active = 0 |
static int | erase_lamps_ok = 0 |
static int | expo_dose [MAX_DOSE] |
static time_t | now |
static time_t | tick |
static time_t | last = 0 |
static float | ftmp |
static float | erase_time = 1.0 |
static float | xray_start = -999.0 |
static float | stat_start_phi = 0.0 |
static int | stat_erase_T |
static int | stat_erase_R |
static int | stat_erase_L |
static int | stat_erase_T_temp |
static int | stat_erase_R_temp |
static int | stat_erase_L_temp |
static int | stat_servo_warning |
static int | stat_laser_status |
static int | task_done [MAX_CMD] |
static int | task_error [MAX_CMD] |
static int | task_active [MAX_CMD] |
static int | task_queued [MAX_CMD] |
static int | task_started [MAX_CMD] |
char | op_in_progress |
char | scan_in_progress |
int | images_per_sweep |
int | current_block |
int | maximum_block |
int | current_pixel |
int | maximum_pixels |
static MarHW * | marhw = NULL |
#define max0 | ( | a, | |
b | |||
) | if ( b > a ) a = b |
Definition at line 41 of file marhw.cpp.
Referenced by MarHW::mar_progress().
#define MAX_DOSE 2000 |
Definition at line 42 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
#define min0 | ( | a, | |
b | |||
) | if ( b < a ) a = b |
Definition at line 40 of file marhw.cpp.
Referenced by MarHW::mar_progress().
float GetDiskSpace | ( | char * | ) |
Definition at line 90 of file mardisk.c.
References disk.
{ float free= 999999.0 ; if (strlen(dir) < 1 ) return( free ); #ifdef __sgi if(statfs(dir, &disk, sizeof disk, 0) != 0) return( free ); #elif (__linux__ || __hpux || __DARWIN__) if(statfs(dir, &disk) != 0) return( free ); #elif ( SUN ) if(statvfs(dir, &disk) != 0) return( free ); #elif __osf__ if(statfs(dir, &disk, sizeof disk ) != 0 )return( free ); #endif #ifdef __osf__ free = (float)disk.f_bavail * (float)disk.f_fsize / 1024000.; #else if(disk.f_blocks > 0) free = (float)disk.f_bfree * (float)disk.f_bsize / 1024000. ; #endif return( free ); }
int mar_io | ( | ) |
void swaplong | ( | char * | , |
int | |||
) |
Definition at line 129 of file utils.c.
Referenced by Getmar300Header(), MarXF::mar_start_scan_readout(), MarNet::net_comm(), MarNet::net_stat(), and MarHW::print_msg().
{ register int i, t1, t2, t3, t4; for(i=nbytes/4;i--;) { t1 = data[i*4+3]; t2 = data[i*4+2]; t3 = data[i*4+1]; t4 = data[i*4+0]; data[i*4+0] = t1; data[i*4+1] = t2; data[i*4+2] = t3; data[i*4+3] = t4; } }
int adc1 = 0 |
Definition at line 54 of file marhw.cpp.
Referenced by MarXF::get_header_values(), MarXF::PrintStats(), and MarXF::Transform().
int adc2 = 0 |
Definition at line 55 of file marhw.cpp.
Referenced by MarXF::get_header_values(), MarXF::PrintStats(), and MarXF::Transform().
char change_mode = 0 [static] |
Definition at line 101 of file marhw.cpp.
Referenced by MarHW::mar_change_mode(), and MarHW::marTask().
int close_shutter_counter = 0 [static] |
Definition at line 109 of file marhw.cpp.
Referenced by MarHW::mar_start_expo().
int com_phi_steps |
Definition at line 78 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::mar_start_expo(), and MarHW::marTask().
int current_block |
int current_pixel |
Definition at line 75 of file marxf.cpp.
Referenced by MarXF::mar_start_scan_readout(), MarHW::marTask(), MarHW::StartScan(), and MarXF::Transform().
int dist_retry = 0 [static] |
Definition at line 106 of file marhw.cpp.
Referenced by MarHW::mar_progress(), and MarHW::marTask().
int erase_lamps_ok = 0 [static] |
Definition at line 112 of file marhw.cpp.
Referenced by MarHW::marTask(), MarHW::process_status(), and MarHW::StartScan().
int erase_start |
Definition at line 59 of file marhw.cpp.
Referenced by MarHW::mar_erase(), MarHW::mar_progress(), MarHW::mar_start_expo(), and MarHW::marTask().
float erase_time = 1.0 [static] |
Definition at line 117 of file marhw.cpp.
Referenced by MarHW::mar_erase(), MarHW::mar_progress(), and MarHW::marTask().
int expo_dose[MAX_DOSE] [static] |
Definition at line 113 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
float expo_doseavg = 0.0 [static] |
Definition at line 89 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
float expo_dosebeg = 99999 [static] |
Definition at line 87 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
float expo_doseend = 0.0 [static] |
Definition at line 88 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
float expo_dosemax = 0.0 [static] |
Definition at line 92 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
float expo_dosemin = 999999.0 [static] |
Definition at line 91 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
int expo_dosen = 0 [static] |
Definition at line 93 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
float expo_dosesig = 0.0 [static] |
Definition at line 90 of file marhw.cpp.
Referenced by MarHW::marTask(), and MarHW::StartScan().
time_t exposure_start = 0 |
Definition at line 58 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
time_t exposure_time |
Definition at line 57 of file marhw.cpp.
Referenced by MarHW::mar_start_expo(), and MarHW::StartScan().
int fehler_index = 0 |
Definition at line 61 of file marhw.cpp.
Referenced by MarHW::get_error(), and MarHW::marError().
float ftmp [static] |
Definition at line 116 of file marhw.cpp.
Referenced by Getmar300Header(), MarHW::mar_progress(), MarHW::Modulo360(), and MarHW::StartScan().
int i [static] |
Definition at line 98 of file marhw.cpp.
Referenced by __yy_memcpy(), Command::BadInput(), bits(), CIF2mar345Header(), Decode(), diff_words(), Encode(), MarClock::enqueue_fcn(), Command::exec_command(), MarHW::get_error(), get_pck(), MarHW::get_status(), GetCIFHeader(), GetConfig(), Getmar300Header(), Getmar345Header(), GetmarNBHeader(), MarXF::HistoMinMax(), MarClock::init_clock(), InputType(), IsNFS(), mar3452CIFHeader(), MarHW::mar_abort(), MarHW::mar_change_mode(), MarClock::mar_clock(), MarHW::mar_erase(), MarHW::mar_lock(), Scan345::mar_loop(), MarHW::mar_move_phi(), MarHW::mar_progress(), MarHW::mar_quit(), MarHW::mar_servo(), MarXF::mar_start_scan_readout(), MarStartup::marStartup(), MarHW::marTask(), MD5_memcpy(), MD5_memset(), MD5Update(), MarHW::Modulo360(), MarNet::net_comm(), MarNet::net_data(), MarNet::net_open(), MarNet::net_stat(), MarHW::NotEnoughDiskSpace(), MarXF::output_header(), MarXF::output_image(), pack_chunk(), pack_longs(), QScan345Controller::poll_status(), MarHW::print_msg(), MarXF::PrintStats(), MarHW::process_status(), PutCIFHeader(), PutConfig(), Putmar300Header(), Putmar345Header(), PutmarNBHeader(), MarXF::ReadNB(), RemoveBlanks(), rotate_ch(), rotate_ch_anti(), rotate_i2(), rotate_i2_anti(), rotate_i4(), rotate_i4_anti(), Scan345::scan345_main(), MarClock::set_timer_params(), SetConfig(), Setmar345Header(), SetmarNBHeader(), MarHW::StartScan(), swaplong(), swapshort(), MarXF::Transform(), and yyparse().
int ict1 = 0 |
Definition at line 52 of file marhw.cpp.
Referenced by MarNet::net_data(), and MarHW::StartScan().
int ict2 = 0 |
Definition at line 53 of file marhw.cpp.
Referenced by MarNet::net_data(), and MarHW::StartScan().
int images_per_sweep |
int intensity_counter = 0 [static] |
Definition at line 107 of file marhw.cpp.
Referenced by MarHW::mar_progress(), and MarHW::StartScan().
int j |
Definition at line 98 of file marhw.cpp.
Referenced by CIF2mar345Header(), Decode(), Encode(), MarClock::enqueue_fcn(), Command::exec_command(), MarHW::get_error(), GetConfig(), Getmar300Header(), Getmar345Header(), GetmarNBHeader(), InputType(), MarHW::marTask(), MarNet::net_comm(), MarNet::net_data(), MarNet::net_stat(), MarXF::output_image(), pack_chunk(), MarHW::print_msg(), MarXF::PrintStats(), MarHW::process_status(), PutConfig(), PutmarNBHeader(), RemoveBlanks(), rotate_ch(), rotate_ch_anti(), rotate_i2(), rotate_i2_anti(), rotate_i4(), and rotate_i4_anti().
char keep_image = 1 |
Definition at line 49 of file marhw.cpp.
Referenced by MarXF::mar_start_scan_readout(), MarHW::marTask(), MarHW::NotEnoughDiskSpace(), MarXF::output_header(), MarXF::output_image(), Scan345::scan345_main(), and MarXF::Transform().
time_t last = 0 [static] |
Definition at line 115 of file marhw.cpp.
Referenced by cbf_read_character(), cbf_write_category(), MarHW::mar_progress(), and MarXF::PrintStats().
int last_mar_mode = 0 [static] |
Definition at line 105 of file marhw.cpp.
Referenced by MarHW::mar_command().
int mar_error = 0 |
Definition at line 50 of file marhw.cpp.
Referenced by MarHW::marError().
Definition at line 150 of file marhw.cpp.
Referenced by MarHW::mar_hw().
int maximum_block |
Definition at line 72 of file marxf.cpp.
Referenced by MarXF::mar_start_scan_readout(), and MarXF::Transform().
int maximum_pixels |
Definition at line 71 of file marxf.cpp.
Referenced by MarXF::get_header_values(), MarHW::mar_progress(), MarXF::mar_start_scan_readout(), and MarXF::Transform().
char motor_moving[6] = {0,0,0,0,0,0} [static] |
Definition at line 100 of file marhw.cpp.
Referenced by MarHW::marTask(), and MarHW::process_status().
char motor_op = 0 |
Definition at line 47 of file marhw.cpp.
Referenced by MarHW::mar_move_phi(), MarHW::mar_progress(), and MarHW::marTask().
time_t now [static] |
Definition at line 114 of file marhw.cpp.
Referenced by MarHW::get_status(), mar3452CIFHeader(), MarHW::mar_command(), MarHW::mar_progress(), MarHW::mar_start_expo(), MarStartup::marStartup(), MarHW::marTask(), MarXF::output_image(), MarXF::PrintStats(), Putmar300Header(), Putmar345Header(), and Setmar300Header().
float op_doseavg |
Definition at line 82 of file marhw.cpp.
Referenced by MarHW::StartScan().
float op_dosebeg |
Definition at line 81 of file marhw.cpp.
Referenced by MarXF::get_header_values(), and MarHW::StartScan().
float op_doseend |
Definition at line 81 of file marhw.cpp.
Referenced by MarXF::get_header_values(), and MarHW::StartScan().
float op_dosemax |
Definition at line 81 of file marhw.cpp.
Referenced by MarHW::StartScan().
float op_dosemin |
Definition at line 81 of file marhw.cpp.
Referenced by MarHW::StartScan().
int op_dosen |
Definition at line 80 of file marhw.cpp.
Referenced by MarHW::StartScan().
float op_dosesig |
Definition at line 82 of file marhw.cpp.
Referenced by MarHW::StartScan().
char op_in_progress |
Definition at line 58 of file marxf.cpp.
Referenced by MarXF::output_image(), and MarXF::Transform().
int open_shutter_counter = 0 [static] |
Definition at line 108 of file marhw.cpp.
Referenced by MarHW::mar_start_expo().
double original_distance |
Definition at line 83 of file marhw.cpp.
Referenced by MarHW::mar_progress(), and MarHW::marTask().
double original_omega |
double original_phi |
int p_task_active = 0 [static] |
Definition at line 111 of file marhw.cpp.
Referenced by MarHW::mar_progress().
int scan_error = 0 [static] |
Definition at line 110 of file marhw.cpp.
Referenced by MarHW::StartScan().
char scan_in_progress |
char scan_started = 0 [static] |
Definition at line 102 of file marhw.cpp.
Referenced by MarHW::mar_progress(), and MarHW::StartScan().
char skip_op = 0 |
Definition at line 48 of file marhw.cpp.
Referenced by MarHW::marTask(), MarXF::output_image(), and MarXF::PrintResults().
char start_time[32] |
Definition at line 46 of file marhw.cpp.
Referenced by MarHW::marTask().
Definition at line 70 of file marhw.cpp.
Referenced by MarNet::net_data().
int stat_blocks_sent |
Definition at line 69 of file marhw.cpp.
Referenced by MarXF::mar_start_scan_readout(), MarNet::net_data(), and MarXF::Transform().
int stat_erase_L |
Definition at line 121 of file marhw.cpp.
Referenced by MarHW::process_status().
Definition at line 122 of file marhw.cpp.
Referenced by MarHW::process_status().
int stat_erase_R |
Definition at line 121 of file marhw.cpp.
Referenced by MarHW::process_status().
Definition at line 122 of file marhw.cpp.
Referenced by MarHW::process_status().
int stat_erase_T [static] |
Definition at line 121 of file marhw.cpp.
Referenced by MarHW::process_status().
int stat_erase_T_temp [static] |
Definition at line 122 of file marhw.cpp.
Referenced by MarHW::process_status().
char stat_home = 1 |
Definition at line 76 of file marhw.cpp.
Referenced by MarHW::process_status().
Definition at line 123 of file marhw.cpp.
Referenced by MarHW::process_status().
int stat_lock_permit |
Definition at line 73 of file marhw.cpp.
Referenced by MarHW::mar_lock(), and MarHW::process_status().
int stat_oscil_msg = (-1) |
Definition at line 75 of file marhw.cpp.
Referenced by MarHW::mar_progress().
int stat_pixels |
Definition at line 68 of file marhw.cpp.
Referenced by MarHW::mar_progress(), and MarHW::process_status().
Definition at line 72 of file marhw.cpp.
Referenced by MarHW::mar_lock(), and MarHW::process_status().
Definition at line 71 of file marhw.cpp.
Referenced by MarHW::process_status().
char stat_scan_active = 0 |
Definition at line 77 of file marhw.cpp.
Referenced by MarHW::process_status().
int stat_scan_add = 0 |
Definition at line 62 of file marhw.cpp.
Referenced by MarXF::mar_start_scan_readout(), MarHW::marTask(), and MarHW::StartScan().
int stat_servo_warning [static] |
Definition at line 123 of file marhw.cpp.
Referenced by MarHW::process_status().
float stat_start_phi = 0.0 [static] |
Definition at line 119 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::StartScan().
int stat_task_active |
Definition at line 64 of file marhw.cpp.
Referenced by Command::exec_command(), and MarHW::process_status().
int stat_task_done |
Definition at line 65 of file marhw.cpp.
Referenced by MarHW::process_status().
int stat_task_error |
Definition at line 67 of file marhw.cpp.
Referenced by MarHW::process_status().
int stat_task_mode |
int stat_task_number |
Definition at line 63 of file marhw.cpp.
Referenced by MarHW::mar_progress(), MarHW::marTask(), and MarHW::process_status().
char stop_image = 0 [static] |
Definition at line 103 of file marhw.cpp.
Referenced by MarHW::mar_progress(), and MarHW::marTask().
double target_distance |
Definition at line 83 of file marhw.cpp.
Referenced by MarHW::mar_progress(), and MarHW::marTask().
double target_omega |
Definition at line 85 of file marhw.cpp.
Referenced by MarHW::marTask().
double target_phi |
Definition at line 84 of file marhw.cpp.
Referenced by MarHW::mar_move_phi(), and MarHW::marTask().
int target_steps = 0 |
Definition at line 51 of file marhw.cpp.
Referenced by MarHW::marTask().
int task_active[MAX_CMD] [static] |
Definition at line 126 of file marhw.cpp.
Referenced by MarHW::process_status().
int task_done[MAX_CMD] [static] |
Definition at line 124 of file marhw.cpp.
Referenced by MarHW::process_status().
int task_error[MAX_CMD] [static] |
Definition at line 125 of file marhw.cpp.
Referenced by MarHW::process_status().
int task_queued[MAX_CMD] [static] |
Definition at line 127 of file marhw.cpp.
Referenced by MarHW::process_status().
int task_started[MAX_CMD] [static] |
Definition at line 128 of file marhw.cpp.
Referenced by MarHW::process_status().
time_t tick |
Definition at line 114 of file marhw.cpp.
Referenced by MarHW::marError(), and MarHW::marTask().
float xray_start = -999.0 [static] |
Definition at line 118 of file marhw.cpp.
Referenced by MarHW::mar_progress(), and MarHW::StartScan().