コード例 #1
0
ファイル: Driver.hpp プロジェクト: retlaw84/dune
    //! Read the contents of the MT SBD message buffer.
    //! @param[in] data buffer to hold binary data.
    //! @param[in] data_size size of binary data buffer.
    //! @return number of bytes read.
    unsigned
    readBufferMT(uint8_t* data, unsigned data_size)
    {
        ReadMode saved_read_mode = getReadMode();
        Counter<double> timer(getTimeout());
        uint8_t bfr[2] = {0};
        uint8_t ccsum[2] = {0};
        unsigned length = 0;

        try
        {
            // Prepare to read raw data.
            setReadMode(READ_MODE_RAW);

            // Send command.
            sendAT("+SBDRB");

            // Read incoming data length.
            length = getBufferSizeMT(timer);
            getTask()->spew("reading %u bytes of SBD binary data", length);

            // Read data.
            if (length > data_size)
                throw BufferTooSmall(data_size, length);

            if (length > 0)
            {
                readRaw(timer, data, length);
                computeChecksum(data, length, ccsum);
            }

            // Read and validate.
            readRaw(timer, bfr, 2);
            if ((bfr[0] != ccsum[0]) || (bfr[1] != ccsum[1]))
                throw Hardware::InvalidChecksum(bfr, ccsum);

            setReadMode(saved_read_mode);
            expectOK();
        }
        catch (...)
        {
            setReadMode(saved_read_mode);
            throw;
        }

        return length;
    }
コード例 #2
0
ファイル: contactdetails.cpp プロジェクト: ZestyMeta/qontacts
void ContactDetails::onPatientClicked(const QModelIndex& index)
{
    rowIndex = index.row();

    loadDetailsFromDocument();

    ui->stackedWidget->setCurrentWidget(ui->populatedPage);
    setReadMode(true);
}
コード例 #3
0
ファイル: contactdetails.cpp プロジェクト: ZestyMeta/qontacts
void ContactDetails::on_saveBtn_clicked()
{
    writeDetailsToDocument();

    loadDetailsFromDocument();

    emit saveContactDetails();

    setReadMode(true);
}
コード例 #4
0
/**
 * Reads any number of bytes from a specific address. Make sure that
 * the sensor will self-increment its register pointer after subsequent reads
 */
extern void read(uint8_t* readData, uint8_t addr, uint8_t numBytes){
	uint8_t i;
	uint8_t tmp;
	SELECT();
	__delay_cycles(1000);
	setReadMode(addr);
	for(i = 0; i != numBytes; i++){
		*readData = readByte();
		readData++; // increase to next address
	}
	__delay_cycles(1000);
	DESELECT();
}
コード例 #5
0
ファイル: BasicModem.cpp プロジェクト: tausteen/dune
    void
    BasicModem::initialize(void)
    {
      // Reset and flush pending input.
      sendReset();
      Time::Delay::wait(2.0);
      m_handle->flushInput();

      // Perform initialization.
      setReadMode(READ_MODE_LINE);
      start();
      sendInitialization();
    }
コード例 #6
0
ANDOR885_Camera::ANDOR885_Camera()
{
	debugging = false;

	initialized = false;
	notDestructed = false;
	extension = ".tif";

	eventMetadata = NULL;

	pauseCameraMutex = new omni_mutex();
	pauseCameraCondition = new omni_condition(pauseCameraMutex);
	stopEventMutex = new omni_mutex();
	stopEventCondition = new omni_condition(stopEventMutex);
	stopEvent = false;
	numAcquiredMutex = new omni_mutex();
	numAcquiredCondition = new omni_condition(numAcquiredMutex);
	waitForEndOfAcquisitionMutex = new omni_mutex();
	waitForEndOfAcquisitionCondition = new omni_condition(waitForEndOfAcquisitionMutex);
	waitForCleanupEventMutex = new omni_mutex();
	waitForCleanupEventCondition = new omni_condition(waitForCleanupEventMutex);
	bool cleanupEvent = false;

	//Initialize necessary parameters
	readMode_t.name = "Read mode"; //If ever there is more than one read mode, be sure to properly initialize this for playing events!
	readMode_t.choices[READMODE_IMAGE] = "Image";

	shutterMode_t.name = "Shutter mode";
	shutterMode_t.choices[SHUTTERMODE_AUTO] = "Auto";
	shutterMode_t.choices[SHUTTERMODE_OPEN] = "Open";
	shutterMode_t.choices[SHUTTERMODE_CLOSE] = "Closed";

	acquisitionMode_t.name = "**Acquisition mode (RTA)";
	acquisitionMode_t.choices[ACQMODE_SINGLE_SCAN] = "Single scan";
	acquisitionMode_t.choices[ACQMODE_KINETIC_SERIES] = "Kinetic series";
	acquisitionMode_t.choices[ACQMODE_RUN_TILL_ABORT] = "Run 'til abort";

	triggerMode_t.name = "**Trigger mode (EE)";
	triggerMode_t.choices[TRIGGERMODE_EXTERNAL] = "External";
	triggerMode_t.choices[TRIGGERMODE_EXTERNAL_EXPOSURE] = "External exposure";
	triggerMode_t.choices[TRIGGERMODE_INTERNAL] = "Internal";

	preAmpGain_t.name = "*Preamp Gain";
//	preAmpGain_t.choices.push_back("");
//	preAmpGain_t.choiceFlags.push_back(PREAMP_BLANK);
	preAmpGain = NOT_AVAILABLE;
//	preAmpGainPos = PREAMP_BLANK;

	verticalShiftSpeed_t.name = "*Vertical Shift Speed (us/px)";
	verticalClockVoltage_t.name = "*Vertical Clock Voltage";
	horizontalShiftSpeed_t.name = "*Horizontal Shift Speed (us)";

//	pImageArray = NULL;

	cameraStat		=	ANDOR_ON;
	acquisitionMode	=	ACQMODE_RUN_TILL_ABORT;
	readMode		=	READMODE_IMAGE;
	exposureTime	=	(float) 0.05; // in seconds
	accumulateTime	=	0;
	kineticTime		=	0;
	ttl				=	TTL_OPEN_HIGH;
	shutterMode		=	SHUTTERMODE_OPEN;
	closeTime		=	SHUTTER_CLOSE_TIME;
	openTime		=	SHUTTER_OPEN_TIME;
//	triggerMode		=	TRIGGERMODE_EXTERNAL_EXPOSURE; //will be set by InitializeCamera
	frameTransfer	=	ANDOR_OFF;
//	spoolMode		=	ANDOR_OFF;				
	coolerSetpt		=  -90;
	coolerStat		=	ANDOR_ON;
	cameraTemp		=	20;
	EMCCDGain		=	NOT_AVAILABLE;

	verticalShiftSpeed = 0;
	verticalClockVoltage = 0;
	horizontalShiftSpeed = 0;

	readMode_t.initial = readMode_t.choices.find(readMode)->second;
	shutterMode_t.initial = shutterMode_t.choices.find(shutterMode)->second;
//	triggerMode_t.initial = triggerMode_t.choices.find(triggerMode)->second;
	acquisitionMode_t.initial = acquisitionMode_t.choices.find(acquisitionMode)->second;

	//Name of path to which files should be saved
	filePath		=	createFilePath();
	logPath			=	"C:\\Documents and Settings\\EP Lab\\Desktop\\";
	palPath			=	"C:\\Documents and Settings\\User\\My Documents\\My Pictures\\Andor_iXon\\GREY.PAL";

	initialized = !InitializeCamera();

	if (initialized){
		notDestructed = true;

		omni_thread::create(playCameraWrapper, (void*) this, omni_thread::PRIORITY_HIGH);
	

		try {
			setExposureTime(exposureTime);
			setTriggerMode(triggerMode);
		} catch (ANDOR885_Exception& e){
			std::cerr << e.printMessage() << std::endl;
			initialized = false;
		}
		


		if (debugging) {
			try {
				setAcquisitionMode(acquisitionMode);
				setReadMode(readMode);
			} catch (ANDOR885_Exception& e){
				std::cerr << e.printMessage() << std::endl;
				initialized = false;
			}
		} 
	}
}
コード例 #7
0
ファイル: contactdetails.cpp プロジェクト: ZestyMeta/qontacts
void ContactDetails::on_editBtn_clicked()
{
    setReadMode(false);
}