mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 19:49:42 +08:00
主采集逻辑修改中,添加了部分写文件实现
This commit is contained in:
81
source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature.h
vendored
Normal file
81
source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature.h
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
/***************************************************//**
|
||||
* @file AcquisitionDelayFeature.h
|
||||
* @date November 2015
|
||||
* @author Ocean Optics, Inc.
|
||||
*
|
||||
* LICENSE:
|
||||
*
|
||||
* SeaBreeze Copyright (C) 2015, Ocean Optics Inc
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*******************************************************/
|
||||
|
||||
#ifndef ACQUISITION_DELAY_FEATURE_H
|
||||
#define ACQUISITION_DELAY_FEATURE_H
|
||||
|
||||
#include "common/features/FeatureImpl.h"
|
||||
#include "common/protocols/Protocol.h"
|
||||
#include "common/buses/Bus.h"
|
||||
#include "common/exceptions/FeatureException.h"
|
||||
#include "vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeatureInterface.h"
|
||||
|
||||
namespace seabreeze {
|
||||
|
||||
class AcquisitionDelayFeature : public FeatureImpl,
|
||||
public AcquisitionDelayFeatureInterface {
|
||||
public:
|
||||
AcquisitionDelayFeature(std::vector<ProtocolHelper *> helpers);
|
||||
virtual ~AcquisitionDelayFeature();
|
||||
|
||||
virtual void setAcquisitionDelayMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus,
|
||||
const unsigned long delayMicros)
|
||||
throw (FeatureException);
|
||||
|
||||
virtual unsigned long getAcquisitionDelayMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException);
|
||||
|
||||
/* Overriding from Feature */
|
||||
virtual FeatureFamily getFeatureFamily();
|
||||
|
||||
/* Methods that remain pure virtual since the protocol interface does
|
||||
* not necessarily provide clean methods for these. A derived
|
||||
* class will be necessary to specify the limits.
|
||||
*/
|
||||
virtual unsigned long getAcquisitionDelayIncrementMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException) = 0;
|
||||
virtual unsigned long getAcquisitionDelayMaximumMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException) = 0;
|
||||
virtual unsigned long getAcquisitionDelayMinimumMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException) = 0;
|
||||
|
||||
protected:
|
||||
unsigned long lastAcquisitionDelayMicroseconds;
|
||||
bool lastAcquisitionDelayValid;
|
||||
};
|
||||
|
||||
} /* end namespace seabreeze */
|
||||
|
||||
#endif /* ACQUISITION_DELAY_FEATURE_H */
|
||||
|
@ -0,0 +1,67 @@
|
||||
/***************************************************//**
|
||||
* @file AcquisitionDelayFeatureInterface.h
|
||||
* @date November 2015
|
||||
* @author Ocean Optics, Inc.
|
||||
*
|
||||
* LICENSE:
|
||||
*
|
||||
* SeaBreeze Copyright (C) 2015, Ocean Optics Inc
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*******************************************************/
|
||||
|
||||
#ifndef SEABREEZE_ACQUISITION_DELAY_FEATURE_INTERFACE_H
|
||||
#define SEABREEZE_ACQUISITION_DELAY_FEATURE_INTERFACE_H
|
||||
|
||||
#include "common/features/Feature.h"
|
||||
#include "common/protocols/Protocol.h"
|
||||
#include "common/buses/Bus.h"
|
||||
#include "common/exceptions/FeatureException.h"
|
||||
|
||||
namespace seabreeze {
|
||||
|
||||
class AcquisitionDelayFeatureInterface {
|
||||
public:
|
||||
virtual ~AcquisitionDelayFeatureInterface();
|
||||
virtual unsigned long getAcquisitionDelayIncrementMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException) = 0;
|
||||
virtual unsigned long getAcquisitionDelayMaximumMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException) = 0;
|
||||
virtual unsigned long getAcquisitionDelayMinimumMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException) = 0;
|
||||
virtual unsigned long getAcquisitionDelayMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException) = 0;
|
||||
virtual void setAcquisitionDelayMicroseconds(
|
||||
const Protocol &Protocol, const Bus &bus,
|
||||
const unsigned long delayMicros)
|
||||
throw (FeatureException) = 0;
|
||||
};
|
||||
|
||||
/* Default implementation for (otherwise) pure virtual destructor */
|
||||
inline AcquisitionDelayFeatureInterface::~AcquisitionDelayFeatureInterface() {}
|
||||
|
||||
} /* end namespace */
|
||||
|
||||
#endif /* SEABREEZE_ACQUISITION_DELAY_FEATURE_INTERFACE_H */
|
||||
|
@ -0,0 +1,79 @@
|
||||
/***************************************************//**
|
||||
* @file AcquisitionDelayFeature_FPGA.h
|
||||
* @date November 2015
|
||||
* @author Ocean Optics, Inc.
|
||||
*
|
||||
* This feature provides an interface to the acquisition
|
||||
* delay feature that is controlled by the FPGA in many
|
||||
* devices. This is likely to be derived from to
|
||||
* override the device limits.
|
||||
*
|
||||
* LICENSE:
|
||||
*
|
||||
* SeaBreeze Copyright (C) 2015, Ocean Optics Inc
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*******************************************************/
|
||||
|
||||
#ifndef ACQUISITION_DELAY_FEATURE_FPGA_H
|
||||
#define ACQUISITION_DELAY_FEATURE_FPGA_H
|
||||
|
||||
#include "vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature.h"
|
||||
#include <vector>
|
||||
|
||||
namespace seabreeze {
|
||||
|
||||
class AcquisitionDelayFeature_FPGA : public AcquisitionDelayFeature {
|
||||
public:
|
||||
AcquisitionDelayFeature_FPGA(std::vector<ProtocolHelper *> helpers);
|
||||
virtual ~AcquisitionDelayFeature_FPGA();
|
||||
|
||||
/* Inherited from AcquisitionDelayFeature */
|
||||
|
||||
virtual void setAcquisitionDelayMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus,
|
||||
const unsigned long delayMicros)
|
||||
throw (FeatureException);
|
||||
|
||||
virtual unsigned long getAcquisitionDelayIncrementMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException);
|
||||
virtual unsigned long getAcquisitionDelayMaximumMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException);
|
||||
virtual unsigned long getAcquisitionDelayMinimumMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException);
|
||||
|
||||
protected:
|
||||
virtual unsigned long countsToMicroseconds(unsigned long counts);
|
||||
virtual unsigned long microsecondsToCounts(unsigned long microseconds);
|
||||
|
||||
unsigned char acquisitionDelayRegister;
|
||||
unsigned long countsPerMicrosecond;
|
||||
unsigned long minimumDelayCounts;
|
||||
unsigned long maximumDelayCounts;
|
||||
unsigned long incrementMicroseconds;
|
||||
};
|
||||
|
||||
} /* end namespace seabreeze */
|
||||
|
||||
#endif /* ACQUISITION_DELAY_FEATURE_FPGA_H */
|
||||
|
60
source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/STSAcquisitionDelayFeature.h
vendored
Normal file
60
source/OSIF/include/vendors/OceanOptics/features/acquisition_delay/STSAcquisitionDelayFeature.h
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
/***************************************************//**
|
||||
* @file STSAcquisitionDelayFeature.h
|
||||
* @date November 2015
|
||||
* @author Ocean Optics, Inc.
|
||||
*
|
||||
* This feature provides an interface to the acquisition
|
||||
* delay feature in the STS.
|
||||
*
|
||||
* LICENSE:
|
||||
*
|
||||
* SeaBreeze Copyright (C) 2015, Ocean Optics Inc
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject
|
||||
* to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*******************************************************/
|
||||
|
||||
#ifndef STSACQUISITIONDELAYFEATURE_H
|
||||
#define STSACQUISITIONDELAYFEATURE_H
|
||||
|
||||
#include "vendors/OceanOptics/features/acquisition_delay/AcquisitionDelayFeature.h"
|
||||
|
||||
namespace seabreeze {
|
||||
|
||||
class STSAcquisitionDelayFeature : public AcquisitionDelayFeature {
|
||||
public:
|
||||
STSAcquisitionDelayFeature(std::vector<ProtocolHelper *> helpers);
|
||||
virtual ~STSAcquisitionDelayFeature();
|
||||
|
||||
/* Inherited from AcquisitionDelayFeature */
|
||||
virtual unsigned long getAcquisitionDelayIncrementMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException);
|
||||
virtual unsigned long getAcquisitionDelayMaximumMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException);
|
||||
virtual unsigned long getAcquisitionDelayMinimumMicroseconds(
|
||||
const Protocol &protocol, const Bus &bus)
|
||||
throw (FeatureException);
|
||||
};
|
||||
|
||||
} /* end namespace seabreeze */
|
||||
|
||||
#endif /* STSACQUISITIONDELAYFEATURE_H */
|
||||
|
Reference in New Issue
Block a user